1
0
mirror of https://github.com/vcmi/vcmi.git synced 2025-11-23 22:37:55 +02:00

Reconnection partially works

This commit is contained in:
nordsoft
2022-10-04 05:09:03 +04:00
parent b91bb41a80
commit 16a5414247
5 changed files with 43 additions and 16 deletions

View File

@@ -466,7 +466,8 @@ bool CVCMIServer::passHost(int toConnectionId)
void CVCMIServer::clientConnected(std::shared_ptr<CConnection> c, std::vector<std::string> & names, std::string uuid, StartInfo::EMode mode)
{
c->connectionID = currentClientId++;
if(state == EServerState::LOBBY)
c->connectionID = currentClientId++;
if(!hostClient)
{
@@ -476,6 +477,8 @@ void CVCMIServer::clientConnected(std::shared_ptr<CConnection> c, std::vector<st
}
logNetwork->info("Connection with client %d established. UUID: %s", c->connectionID, c->uuid);
if(state == EServerState::LOBBY)
for(auto & name : names)
{
logNetwork->info("Client %d player: %s", c->connectionID, name);