mirror of
https://github.com/DarkflameUniverse/DarkflameServer.git
synced 2025-09-07 07:41:26 +00:00
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:
@@ -311,7 +311,7 @@ int main(int argc, char** argv) {
|
||||
|
||||
if (affirmTimeout == 1000) {
|
||||
instance->Shutdown();
|
||||
instance->SetShutdownComplete(true);
|
||||
instance->SetIsShuttingDown(true);
|
||||
|
||||
Game::im->RedirectPendingRequests(instance);
|
||||
}
|
||||
@@ -358,6 +358,7 @@ void HandlePacket(Packet* packet) {
|
||||
Instance* instance =
|
||||
Game::im->GetInstanceBySysAddr(packet->systemAddress);
|
||||
if (instance) {
|
||||
Game::logger->Log("MasterServer", "Actually disconnected from zone %i clone %i instance %i port %i\n", instance->GetMapID(), instance->GetCloneID(), instance->GetInstanceID(), instance->GetPort());
|
||||
Game::im->RemoveInstance(instance); //Delete the old
|
||||
}
|
||||
|
||||
@@ -694,8 +695,8 @@ void HandlePacket(Packet* packet) {
|
||||
return;
|
||||
}
|
||||
|
||||
Game::logger->Log("MasterServer", "Got shutdown response\n");
|
||||
instance->SetShutdownComplete(true);
|
||||
Game::logger->Log("MasterServer", "Got shutdown response from zone %i clone %i instance %i port %i\n", instance->GetMapID(), instance->GetCloneID(), instance->GetInstanceID(), instance->GetPort());
|
||||
instance->SetIsShuttingDown(true);
|
||||
break;
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user