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