Browse Source

Looks like everything works

nordsoft 3 years ago
parent
commit
2eb497b477
2 changed files with 10 additions and 2 deletions
  1. 2 0
      client/CServerHandler.cpp
  2. 8 2
      server/CVCMIServer.cpp

+ 2 - 0
client/CServerHandler.cpp

@@ -514,6 +514,8 @@ void CServerHandler::sendStartGame(bool allowOnlyAI) const
 		* si = * lsg.initializedStartInfo;
 	}
 	sendLobbyPack(lsg);
+	c->enterLobbyConnectionMode();
+	c->disableStackSendingByID();
 }
 
 void CServerHandler::startGameplay(CGameState * gameState)

+ 8 - 2
server/CVCMIServer.cpp

@@ -230,10 +230,16 @@ bool CVCMIServer::prepareToStartGame()
 		state = EServerState::LOBBY;
 		// FIXME: dirry hack to make sure old CGameHandler::run is finished
 		boost::this_thread::sleep(boost::posix_time::milliseconds(1000));
+		
+		for(auto c : connections)
+		{
+			c->enterLobbyConnectionMode();
+			c->disableStackSendingByID();
+		}
 	}
 
-	if(!gh)
-		gh = std::make_shared<CGameHandler>(this);
+	//if(!gh)
+	gh = std::make_shared<CGameHandler>(this);
 	switch(si->mode)
 	{
 	case StartInfo::CAMPAIGN: