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:
parent
10634f0443
commit
9a1d3584c2
7 changed files with 296 additions and 137 deletions
|
@ -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());
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue