mirror of
https://github.com/vcmi/vcmi.git
synced 2025-01-12 02:28:11 +02:00
Cleanup code
This commit is contained in:
parent
16e185343a
commit
ea49b8cf40
@ -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)
|
||||
|
@ -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
|
||||
|
@ -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();
|
||||
|
@ -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)
|
||||
|
@ -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" :
|
||||
{
|
||||
|
@ -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)
|
||||
|
Loading…
Reference in New Issue
Block a user