Remove magic numbers

Replace magic numbers with constexpr calculated times.

Tested that trying to create a new instance while shutting down doesn't allow a new instance to be created.
This commit is contained in:
EmosewaMC
2022-12-15 20:39:29 -08:00
parent 4775dbf27f
commit 3c581fffbb
3 changed files with 73 additions and 34 deletions

View File

@@ -128,6 +128,7 @@ public:
Instance* CreatePrivateInstance(LWOMAPID mapID, LWOCLONEID cloneID, const std::string& password);
Instance* FindPrivateInstance(const std::string& password);
void SetIsShuttingDown(bool value) { this->m_IsShuttingDown = value; };
private:
dLogger* mLogger;
@@ -136,6 +137,11 @@ private:
unsigned short m_LastPort;
LWOINSTANCEID m_LastInstanceID;
/**
* Whether or not the master server is currently shutting down.
*/
bool m_IsShuttingDown = false;
//Private functions:
bool IsInstanceFull(Instance* instance, bool isFriendTransfer);
int GetSoftCap(LWOMAPID mapID);