1
0
mirror of https://github.com/vcmi/vcmi.git synced 2025-01-12 02:28:11 +02:00

Cleanup code

This commit is contained in:
nordsoft 2022-10-06 17:56:54 +04:00
parent 16e185343a
commit ea49b8cf40
6 changed files with 6 additions and 20 deletions

View File

@ -679,7 +679,7 @@ void CServerHandler::restoreLastSession()
saveSession->Bool() = false;
};
CInfoWindow::showYesNoDialog("Connect to the last session?", {}, loadSession, cleanUpSession);
CInfoWindow::showYesNoDialog(VLC->generaltexth->localizedTexts["server"]["confirmReconnect"].String(), {}, loadSession, cleanUpSession);
}
void CServerHandler::debugStartTest(std::string filename, bool save)

View File

@ -404,15 +404,6 @@ void CClient::endGame()
logNetwork->info("Client stopped.");
}
void CClient::processDisconnectedPlayers()
{
if(!gs || !disconnectedPlayers.count(gs->currentPlayer))
return;
LOCPLINT->showYesNoDialog("Waiting for player. Press Ok to save & end, cancel to kick that player",
[](){}, [](){});
}
void CClient::initMapHandler()
{
// TODO: CMapHandler initialization can probably go somewhere else

View File

@ -139,8 +139,6 @@ public:
std::map<PlayerColor, std::vector<std::shared_ptr<IBattleEventsReceiver>>> additionalBattleInts;
std::set<PlayerColor> disconnectedPlayers;
boost::optional<BattleAction> curbaction;
CClient();
@ -159,8 +157,6 @@ public:
void save(const std::string & fname);
void endGame();
void processDisconnectedPlayers();
void initMapHandler();
void initPlayerEnvironments();

View File

@ -811,8 +811,6 @@ void YourTurn::applyCl(CClient *cl)
callAllInterfaces(cl, &IGameEventsReceiver::playerStartsTurn, player);
callOnlyThatInterface(cl, player, &CGameInterface::yourTurn);
cl->processDisconnectedPlayers();
}
void SaveGameClient::applyCl(CClient *cl)

View File

@ -33,7 +33,8 @@
{
"existingProcess" : "Another vcmiserver process is running, please terminate it first",
"modsIncompatibility" : "Required mods to load game:"
}
},
"confirmReconnect" : "Connect to the last session?"
},
"systemOptions" :
{

View File

@ -206,10 +206,10 @@ void CVCMIServer::threadAnnounceLobby()
announcePack(std::move(announceQueue.front()));
announceQueue.pop_front();
}
if(state != EServerState::LOBBY)
if(state != EServerState::LOBBY && hangingConnections.empty())
{
//if(acceptor)
//acceptor->close();
if(acceptor)
acceptor->close();
}
if(acceptor)