diff options
author | Loïc Blot <nerzhul@users.noreply.github.com> | 2017-04-15 23:19:18 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-04-15 23:19:18 +0200 |
commit | 34d32ce55ae4f3f29d7b645075dc8efacb2c96d2 (patch) | |
tree | 6e21a37780352412b853fd242b6177eff2afd0fd /src/network | |
parent | 0f955bf7fa7a1376acdbc06a617c0f15f9fad467 (diff) | |
download | minetest-34d32ce55ae4f3f29d7b645075dc8efacb2c96d2.tar.gz minetest-34d32ce55ae4f3f29d7b645075dc8efacb2c96d2.tar.bz2 minetest-34d32ce55ae4f3f29d7b645075dc8efacb2c96d2.zip |
Implement delayed server shutdown with cancelation (#4664)
Diffstat (limited to 'src/network')
-rw-r--r-- | src/network/serverpackethandler.cpp | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/src/network/serverpackethandler.cpp b/src/network/serverpackethandler.cpp index 27c33a4f6..2e4c5b6be 100644 --- a/src/network/serverpackethandler.cpp +++ b/src/network/serverpackethandler.cpp @@ -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) |