Browse Source

Fix merge

Ivan Savenko 1 year ago
parent
commit
9e62eb28c5
3 changed files with 4 additions and 7 deletions
  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")
 		("nointro,i", "skips intro movies")
 		("donotstartserver,d","do not attempt to start server and just connect to it instead server")
 		("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")
 		("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)
 	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
 		// retry - local server might be still starting up
 		logNetwork->debug("\nCannot establish connection. %s. Retrying...", errorMessage);
 		logNetwork->debug("\nCannot establish connection. %s. Retrying...", errorMessage);
 		networkHandler->createTimer(*this, std::chrono::milliseconds(100));
 		networkHandler->createTimer(*this, std::chrono::milliseconds(100));
-
-			nextClient = std::make_unique<CClient>();
-			c->setCallback(nextClient.get());
 	}
 	}
 	else
 	else
 	{
 	{
@@ -307,8 +304,10 @@ void CServerHandler::onConnectionEstablished(const std::shared_ptr<INetworkConne
 
 
 	logNetwork->info("Connection established");
 	logNetwork->info("Connection established");
 	c = std::make_shared<CConnection>(netConnection);
 	c = std::make_shared<CConnection>(netConnection);
+	nextClient = std::make_unique<CClient>();
 	c->uuid = uuid;
 	c->uuid = uuid;
 	c->enterLobbyConnectionMode();
 	c->enterLobbyConnectionMode();
+	c->setCallback(nextClient.get());
 	sendClientConnecting();
 	sendClientConnecting();
 }
 }
 
 
@@ -325,7 +324,6 @@ std::set<PlayerColor> CServerHandler::getHumanColors()
 	return clientHumanColors(c->connectionID);
 	return clientHumanColors(c->connectionID);
 }
 }
 
 
-
 PlayerColor CServerHandler::myFirstColor() const
 PlayerColor CServerHandler::myFirstColor() const
 {
 {
 	return clientFirstColor(c->connectionID);
 	return clientFirstColor(c->connectionID);

+ 1 - 1
server/NetPacksLobbyServer.cpp

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