mirror of
https://github.com/luanti-org/luanti.git
synced 2025-06-27 16:36:03 +00:00
Optional reconnect functionality
Enable the server to request the client to reconnect. This can be done with the now extended minetest.request_shutdown([reason], [reconnect]) setting.
This commit is contained in:
parent
1e0e85f82e
commit
3b50b2766a
25 changed files with 232 additions and 109 deletions
18
src/server.h
18
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.
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue