aboutsummaryrefslogtreecommitdiff
path: root/src/network
diff options
context:
space:
mode:
authorLoïc Blot <nerzhul@users.noreply.github.com>2018-06-13 21:58:34 +0200
committerGitHub <noreply@github.com>2018-06-13 21:58:34 +0200
commit9a1d3584c22013860ec4b664858076ab6ddf3ea1 (patch)
tree444af0cbb0f77fa2ff47123b3e3b46d83b01e5c2 /src/network
parent10634f0443c478ff08daf80388198931befaa95c (diff)
downloadminetest-9a1d3584c22013860ec4b664858076ab6ddf3ea1.tar.gz
minetest-9a1d3584c22013860ec4b664858076ab6ddf3ea1.tar.bz2
minetest-9a1d3584c22013860ec4b664858076ab6ddf3ea1.zip
Server: move shutdown parts to a specific shutdown state object (#7437)
* Server: move shutdown parts to a specific shutdown state object
Diffstat (limited to 'src/network')
-rw-r--r--src/network/serverpackethandler.cpp7
1 files changed, 2 insertions, 5 deletions
diff --git a/src/network/serverpackethandler.cpp b/src/network/serverpackethandler.cpp
index c961d406e..bb5eed92b 100644
--- a/src/network/serverpackethandler.cpp
+++ b/src/network/serverpackethandler.cpp
@@ -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());
}
}