From cfe0f6bb55685d1fc5c10a94628f0c03a9450063 Mon Sep 17 00:00:00 2001 From: Mark Vejvoda Date: Sat, 16 Feb 2013 19:26:17 +0000 Subject: [PATCH] - bugfix for in game joining --- source/glest_game/network/server_interface.cpp | 5 ++++- source/glest_game/network/server_interface.h | 1 + 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/source/glest_game/network/server_interface.cpp b/source/glest_game/network/server_interface.cpp index 1e0b0c8c..39772672 100644 --- a/source/glest_game/network/server_interface.cpp +++ b/source/glest_game/network/server_interface.cpp @@ -54,6 +54,7 @@ ServerInterface::ServerInterface(bool publishEnabled) :GameNetworkInterface() { allowInGameConnections = false; pauseForInGameConnection = false; unPauseForInGameConnection = false; + gameStarted = false; serverSynchAccessor = new Mutex(); switchSetupRequestsSynchAccessor = new Mutex(); @@ -2256,13 +2257,15 @@ bool ServerInterface::launchGame(const GameSettings *gameSettings) { ftpServer = NULL; } } + + gameStarted = true; } if(SystemFlags::getSystemSettingType(SystemFlags::debugNetwork).enabled) SystemFlags::OutputDebug(SystemFlags::debugNetwork,"In [%s::%s] Line: %d\n",extractFileFromDirectoryPath(__FILE__).c_str(),__FUNCTION__,__LINE__); return bOkToStart; } void ServerInterface::checkListenerSlots() { - if(allowInGameConnections == true) { + if(gameStarted == true && allowInGameConnections == true) { bool useInGameBlockingClientSockets = Config::getInstance().getBool("EnableInGameBlockingSockets","true"); if(SystemFlags::getSystemSettingType(SystemFlags::debugNetwork).enabled) SystemFlags::OutputDebug(SystemFlags::debugNetwork,"In [%s::%s Line: %d]\n",extractFileFromDirectoryPath(__FILE__).c_str(),__FUNCTION__,__LINE__); diff --git a/source/glest_game/network/server_interface.h b/source/glest_game/network/server_interface.h index 618a1b14..7ef6aaee 100644 --- a/source/glest_game/network/server_interface.h +++ b/source/glest_game/network/server_interface.h @@ -102,6 +102,7 @@ private: bool pauseForInGameConnection; bool startInGameConnectionLaunch; bool unPauseForInGameConnection; + bool gameStarted; public: ServerInterface(bool publishEnabled);