diff --git a/dMasterServer/MasterServer.cpp b/dMasterServer/MasterServer.cpp index f307151f..0876eaa6 100644 --- a/dMasterServer/MasterServer.cpp +++ b/dMasterServer/MasterServer.cpp @@ -751,6 +751,14 @@ void ShutdownSequence() { Game::logger->Log("MasterServer", "Attempting to shutdown instances, max 60 seconds...\n"); while (true) { + + auto packet = Game::server->Receive(); + if (packet) { + HandlePacket(packet); + Game::server->DeallocatePacket(packet); + packet = nullptr; + } + auto done = true; for (auto* instance : Game::im->GetInstances()) { @@ -764,6 +772,7 @@ void ShutdownSequence() { } if (done) { + Game::logger->Log("MasterServer", "Finished shutting down naturally!\n"); break; } @@ -773,6 +782,7 @@ void ShutdownSequence() { ticks++; if (ticks == 600 * 6) { + Game::logger->Log("MasterServer", "Finished shutting down by timeout!\n"); break; } } diff --git a/dWorldServer/WorldServer.cpp b/dWorldServer/WorldServer.cpp index c8f2641e..23bf9356 100644 --- a/dWorldServer/WorldServer.cpp +++ b/dWorldServer/WorldServer.cpp @@ -522,10 +522,6 @@ int main(int argc, char** argv) { CBITSTREAM; PacketUtils::WriteHeader(bitStream, MASTER, MSG_MASTER_SHUTDOWN_RESPONSE); Game::server->SendToMaster(&bitStream); - } - - if (framesSinceShutdownSequence == 300) - { break; } }