1
0
Fork 0
mirror of https://github.com/luanti-org/luanti.git synced 2025-08-11 17:51:04 +00:00

Server: move shutdown parts to a specific shutdown state object (#7437)

* Server: move shutdown parts to a specific shutdown state object
This commit is contained in:
Loïc Blot 2018-06-13 21:58:34 +02:00 committed by GitHub
parent 10634f0443
commit 9a1d3584c2
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
7 changed files with 296 additions and 137 deletions

View file

@ -402,11 +402,8 @@ void Server::handleCommand_ClientReady(NetworkPacket* pkt)
m_clients.event(peer_id, CSE_SetClientReady);
m_script->on_joinplayer(playersao);
// Send shutdown timer if shutdown has been scheduled
if (m_shutdown_timer > 0.0f) {
std::wstringstream ws;
ws << L"*** Server shutting down in "
<< duration_to_string(myround(m_shutdown_timer)).c_str() << ".";
SendChatMessage(pkt->getPeerId(), ws.str());
if (m_shutdown_state.isTimerRunning()) {
SendChatMessage(pkt->getPeerId(), m_shutdown_state.getShutdownTimerMessage());
}
}