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

@ -226,12 +226,7 @@ public:
inline bool getShutdownRequested() const { return m_shutdown_requested; }
// request server to shutdown
void requestShutdown(const std::string &msg, bool reconnect)
{
m_shutdown_requested = true;
m_shutdown_msg = msg;
m_shutdown_ask_reconnect = reconnect;
}
void requestShutdown(const std::string &msg, bool reconnect, float delay = 0.0f);
// Returns -1 if failed, sound handle on success
// Envlock
@ -602,6 +597,7 @@ private:
bool m_shutdown_requested;
std::string m_shutdown_msg;
bool m_shutdown_ask_reconnect;
float m_shutdown_timer;
ChatInterface *m_admin_chat;
std::string m_admin_nick;