Add port recycling to instance creation

Made instance creation use previously used ports when available, to prevent
crashes caused by ports being used that are outside of the assigned range.
This commit is contained in:
Nexus
2021-12-14 11:05:33 +08:00
parent 259c236b72
commit ca8f0059a3
2 changed files with 26 additions and 8 deletions

View File

@@ -102,6 +102,7 @@ public:
Instance* GetInstance(LWOMAPID mapID, bool isFriendTransfer, LWOCLONEID cloneID); //Creates an instance if none found
bool IsPortInUse(uint32_t port);
uint32_t GetFreePort();
void AddPlayer(SystemAddress systemAddr, LWOMAPID mapID, LWOINSTANCEID instanceID);
void RemovePlayer(SystemAddress systemAddr, LWOMAPID mapID, LWOINSTANCEID instanceID);