diff options
Diffstat (limited to 'src/server.h')
-rw-r--r-- | src/server.h | 18 |
1 files changed, 14 insertions, 4 deletions
diff --git a/src/server.h b/src/server.h index fbca05f26..5f3905005 100644 --- a/src/server.h +++ b/src/server.h @@ -244,8 +244,13 @@ public: { return m_shutdown_requested; } // request server to shutdown - inline void requestShutdown(void) - { m_shutdown_requested = true; } + inline void requestShutdown() { m_shutdown_requested = true; } + void requestShutdown(const std::string &msg, bool reconnect) + { + m_shutdown_requested = true; + m_shutdown_msg = msg; + m_shutdown_ask_reconnect = reconnect; + } // Returns -1 if failed, sound handle on success // Envlock @@ -366,6 +371,8 @@ public: void deletingPeer(con::Peer *peer, bool timeout); void DenySudoAccess(u16 peer_id); + void DenyAccessVerCompliant(u16 peer_id, u16 proto_ver, AccessDeniedCode reason, + const std::string &str_reason = "", bool reconnect = false); void DenyAccess(u16 peer_id, AccessDeniedCode reason, const std::string &custom_reason=""); void acceptAuth(u16 peer_id, bool forSudoMode); void DenyAccess_Legacy(u16 peer_id, const std::wstring &reason); @@ -390,7 +397,8 @@ private: void SendMovement(u16 peer_id); void SendHP(u16 peer_id, u8 hp); void SendBreath(u16 peer_id, u16 breath); - void SendAccessDenied(u16 peer_id, AccessDeniedCode reason, const std::string &custom_reason); + void SendAccessDenied(u16 peer_id, AccessDeniedCode reason, + const std::string &custom_reason, bool reconnect = false); void SendAccessDenied_Legacy(u16 peer_id, const std::wstring &reason); void SendDeathscreen(u16 peer_id,bool set_camera_point_target, v3f camera_point_target); void SendItemDef(u16 peer_id,IItemDefManager *itemdef, u16 protocol_version); @@ -490,7 +498,7 @@ private: Call with env and con locked. */ - PlayerSAO *emergePlayer(const char *name, u16 peer_id); + PlayerSAO *emergePlayer(const char *name, u16 peer_id, u16 proto_version); void handlePeerChanges(); @@ -596,6 +604,8 @@ private: */ bool m_shutdown_requested; + std::string m_shutdown_msg; + bool m_shutdown_ask_reconnect; /* Map edit event queue. Automatically receives all map edits. |