소스 검색

Fix merge

Ivan Savenko 1 년 전
부모
커밋
9e62eb28c5
3개의 변경된 파일4개의 추가작업 그리고 7개의 파일을 삭제
  1. 1 2
      client/CMT.cpp
  2. 2 4
      client/CServerHandler.cpp
  3. 1 1
      server/NetPacksLobbyServer.cpp

+ 1 - 2
client/CMT.cpp

@@ -138,8 +138,7 @@ int main(int argc, char * argv[])
 		("nointro,i", "skips intro movies")
 		("donotstartserver,d","do not attempt to start server and just connect to it instead server")
 		("serverport", po::value<si64>(), "override port specified in config file")
-		("savefrequency", po::value<si64>(), "limit auto save creation to each N days")
-		("uuid", po::value<std::string>(), "uuid for the client");
+		("savefrequency", po::value<si64>(), "limit auto save creation to each N days");
 
 	if(argc > 1)
 	{

+ 2 - 4
client/CServerHandler.cpp

@@ -277,9 +277,6 @@ void CServerHandler::onConnectionFailed(const std::string & errorMessage)
 		// retry - local server might be still starting up
 		logNetwork->debug("\nCannot establish connection. %s. Retrying...", errorMessage);
 		networkHandler->createTimer(*this, std::chrono::milliseconds(100));
-
-			nextClient = std::make_unique<CClient>();
-			c->setCallback(nextClient.get());
 	}
 	else
 	{
@@ -307,8 +304,10 @@ void CServerHandler::onConnectionEstablished(const std::shared_ptr<INetworkConne
 
 	logNetwork->info("Connection established");
 	c = std::make_shared<CConnection>(netConnection);
+	nextClient = std::make_unique<CClient>();
 	c->uuid = uuid;
 	c->enterLobbyConnectionMode();
+	c->setCallback(nextClient.get());
 	sendClientConnecting();
 }
 
@@ -325,7 +324,6 @@ std::set<PlayerColor> CServerHandler::getHumanColors()
 	return clientHumanColors(c->connectionID);
 }
 
-
 PlayerColor CServerHandler::myFirstColor() const
 {
 	return clientFirstColor(c->connectionID);

+ 1 - 1
server/NetPacksLobbyServer.cpp

@@ -92,7 +92,7 @@ void ClientPermissionsCheckerNetPackVisitor::visitLobbyClientDisconnected(LobbyC
 			return;
 		}
 
-		if(pack.c->uuid != srv.cmdLineOptions["uuid"].as<std::string>())
+		if(pack.c->connectionID != srv.hostClientId)
 		{
 			result = false;
 			return;