add restart command

This commit is contained in:
2023-08-14 17:46:49 +02:00
parent f9f80fc4fb
commit 49a5a09537
2 changed files with 9 additions and 1 deletions

View File

@@ -52,9 +52,15 @@ public:
getline(std::cin, line);
if (line == "stop") {
LOG("Stopping server ...");
m_Server.Stop();
} else if (line == "help") {
} else if (line == "restart") {
LOG("Restarting server ...");
m_Server.Restart();
}
else if (line == "help") {
LOG("use \"stop\" to stop the server");
LOG("use \"restart\" to restart the server");
}
}
});

View File

@@ -57,6 +57,8 @@ void Server::Restart() {
m_Lobby.OpenLobby();
m_Game.NotifyListeners(&game::GameListener::OnGameStateUpdate, game::GameState::Lobby);
utils::LOG("Game restarted !");
}
void Server::Close() {