diff --git a/client/CMT.cpp b/client/CMT.cpp index 254b8b37c..64ba2cea8 100644 --- a/client/CMT.cpp +++ b/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(), "override port specified in config file") - ("savefrequency", po::value(), "limit auto save creation to each N days") - ("uuid", po::value(), "uuid for the client"); + ("savefrequency", po::value(), "limit auto save creation to each N days"); if(argc > 1) { diff --git a/client/CServerHandler.cpp b/client/CServerHandler.cpp index 5a6369dde..10ac7e48e 100644 --- a/client/CServerHandler.cpp +++ b/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(); - c->setCallback(nextClient.get()); } else { @@ -307,8 +304,10 @@ void CServerHandler::onConnectionEstablished(const std::shared_ptrinfo("Connection established"); c = std::make_shared(netConnection); + nextClient = std::make_unique(); c->uuid = uuid; c->enterLobbyConnectionMode(); + c->setCallback(nextClient.get()); sendClientConnecting(); } @@ -325,7 +324,6 @@ std::set CServerHandler::getHumanColors() return clientHumanColors(c->connectionID); } - PlayerColor CServerHandler::myFirstColor() const { return clientFirstColor(c->connectionID); diff --git a/server/NetPacksLobbyServer.cpp b/server/NetPacksLobbyServer.cpp index a3610aace..e83d54bb8 100644 --- a/server/NetPacksLobbyServer.cpp +++ b/server/NetPacksLobbyServer.cpp @@ -92,7 +92,7 @@ void ClientPermissionsCheckerNetPackVisitor::visitLobbyClientDisconnected(LobbyC return; } - if(pack.c->uuid != srv.cmdLineOptions["uuid"].as()) + if(pack.c->connectionID != srv.hostClientId) { result = false; return;