1
0
mirror of https://github.com/vcmi/vcmi.git synced 2025-01-26 03:52:01 +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; 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) void CServerHandler::debugStartTest(std::string filename, bool save)

View File

@ -404,15 +404,6 @@ void CClient::endGame()
logNetwork->info("Client stopped."); 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() void CClient::initMapHandler()
{ {
// TODO: CMapHandler initialization can probably go somewhere else // 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::map<PlayerColor, std::vector<std::shared_ptr<IBattleEventsReceiver>>> additionalBattleInts;
std::set<PlayerColor> disconnectedPlayers;
boost::optional<BattleAction> curbaction; boost::optional<BattleAction> curbaction;
CClient(); CClient();
@ -159,8 +157,6 @@ public:
void save(const std::string & fname); void save(const std::string & fname);
void endGame(); void endGame();
void processDisconnectedPlayers();
void initMapHandler(); void initMapHandler();
void initPlayerEnvironments(); void initPlayerEnvironments();

View File

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

View File

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

View File

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