add restart command
This commit is contained in:
@@ -52,9 +52,15 @@ public:
|
|||||||
getline(std::cin, line);
|
getline(std::cin, line);
|
||||||
|
|
||||||
if (line == "stop") {
|
if (line == "stop") {
|
||||||
|
LOG("Stopping server ...");
|
||||||
m_Server.Stop();
|
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 \"stop\" to stop the server");
|
||||||
|
LOG("use \"restart\" to restart the server");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -57,6 +57,8 @@ void Server::Restart() {
|
|||||||
m_Lobby.OpenLobby();
|
m_Lobby.OpenLobby();
|
||||||
|
|
||||||
m_Game.NotifyListeners(&game::GameListener::OnGameStateUpdate, game::GameState::Lobby);
|
m_Game.NotifyListeners(&game::GameListener::OnGameStateUpdate, game::GameState::Lobby);
|
||||||
|
|
||||||
|
utils::LOG("Game restarted !");
|
||||||
}
|
}
|
||||||
|
|
||||||
void Server::Close() {
|
void Server::Close() {
|
||||||
|
|||||||
Reference in New Issue
Block a user