From c5907717f08857e98c9f2e45356c98a27cf9d8c4 Mon Sep 17 00:00:00 2001 From: Mark Vejvoda Date: Sat, 22 Sep 2012 05:26:58 +0000 Subject: [PATCH] - ensure client that gets kicked knows he should also quit so he doesn't get a timeout message after disconnect --- source/glest_game/game/commander.cpp | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/source/glest_game/game/commander.cpp b/source/glest_game/game/commander.cpp index 07c2c1d3..8a8f305b 100644 --- a/source/glest_game/game/commander.cpp +++ b/source/glest_game/game/commander.cpp @@ -849,7 +849,12 @@ void Commander::giveNetworkCommand(NetworkCommand* networkCommand) const { ServerInterface *server = networkManager.getServerInterface(); if(server->isClientConnected(playerIndex) == true) { ConnectionSlot *slot = server->getSlot(playerIndex); - slot->close(); + if(slot != NULL) { + NetworkMessageQuit networkMessageQuit; + slot->sendMessage(&networkMessageQuit); + sleep(5); + slot->close(); + } } } }