1
0
Fork 0
mirror of https://github.com/luanti-org/luanti.git synced 2025-06-27 16:36:03 +00:00

Implement delayed server shutdown with cancelation (#4664)

This commit is contained in:
Loïc Blot 2017-04-15 23:19:18 +02:00 committed by GitHub
parent 0f955bf7fa
commit 34d32ce55a
8 changed files with 124 additions and 14 deletions

View file

@ -722,6 +722,13 @@ 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(round(m_shutdown_timer)).c_str() << ".";
SendChatMessage(pkt->getPeerId(), ws.str());
}
}
void Server::handleCommand_GotBlocks(NetworkPacket* pkt)