Fix the issue where we would create new worlds on ports that were still being used (#625)

* Wait for world to shutdown

We need to wait for the message that the world has shutdown before shutting it down.

* Dont sent people to dead instances

* Added shutting down check

Added check for isShuttingDown

* Update when we remove from master
This commit is contained in:
David Markowitz
2022-07-18 16:08:33 -07:00
committed by GitHub
parent ef8c2a40f3
commit b55606d41e
3 changed files with 10 additions and 5 deletions

View File

@@ -280,7 +280,7 @@ bool InstanceManager::IsInstanceFull(Instance* instance, bool isFriendTransfer)
Instance * InstanceManager::FindInstance(LWOMAPID mapID, bool isFriendTransfer, LWOCLONEID cloneId) {
for (Instance* i : m_Instances) {
if (i && i->GetMapID() == mapID && i->GetCloneID() == cloneId && !IsInstanceFull(i, isFriendTransfer) && !i->GetIsPrivate() && !i->GetShutdownComplete()) {
if (i && i->GetMapID() == mapID && i->GetCloneID() == cloneId && !IsInstanceFull(i, isFriendTransfer) && !i->GetIsPrivate() && !i->GetShutdownComplete() && !i->GetIsShuttingDown()) {
return i;
}
}
@@ -290,7 +290,7 @@ Instance * InstanceManager::FindInstance(LWOMAPID mapID, bool isFriendTransfer,
Instance * InstanceManager::FindInstance(LWOMAPID mapID, LWOINSTANCEID instanceID) {
for (Instance* i : m_Instances) {
if (i && i->GetMapID() == mapID && i->GetInstanceID() == instanceID && !i->GetIsPrivate()) {
if (i && i->GetMapID() == mapID && i->GetInstanceID() == instanceID && !i->GetIsPrivate() && !i->GetShutdownComplete() && !i->GetIsShuttingDown()) {
return i;
}
}