1
0
mirror of https://github.com/vcmi/vcmi.git synced 2025-11-06 09:09:40 +02:00

Add LeaveGame netpack and avoid replying on it and CloseServer

This commit is contained in:
Arseniy Shestakov
2017-05-31 09:45:26 +03:00
parent c7e7a4d7be
commit 4b0f702e7e
7 changed files with 68 additions and 12 deletions

View File

@@ -83,7 +83,7 @@ struct EvilHlpStruct
void reset()
{
vstd::clear_pointer(serv);
// vstd::clear_pointer(serv);
vstd::clear_pointer(sInfo);
}

View File

@@ -701,6 +701,12 @@ void CClient::stopConnection()
sendRequest(&close_server, PlayerColor::NEUTRAL);
logNetwork->infoStream() << "Sent closing signal to the server";
}
else
{
LeaveGame leave_Game;
sendRequest(&leave_Game, PlayerColor::NEUTRAL);
logNetwork->infoStream() << "Sent leaving signal to the server";
}
if(connectionHandler)//end connection handler
{