diff options
author | sfan5 <sfan5@live.de> | 2021-01-31 20:36:47 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-01-31 20:36:47 +0100 |
commit | 112a6adb10d3a5a2e55012a36580607d12ce9758 (patch) | |
tree | 344696315dbb8e261477e15d2e13421173fca8ba /src/server.h | |
parent | 6e0e0324a48130376ab3c9fef03b84ee25608242 (diff) | |
download | minetest-112a6adb10d3a5a2e55012a36580607d12ce9758.tar.gz minetest-112a6adb10d3a5a2e55012a36580607d12ce9758.tar.bz2 minetest-112a6adb10d3a5a2e55012a36580607d12ce9758.zip |
Cache client IP in RemoteClient so it can always be retrieved (#10887)
specifically: after the peer has already disappeared
Diffstat (limited to 'src/server.h')
-rw-r--r-- | src/server.h | 15 |
1 files changed, 12 insertions, 3 deletions
diff --git a/src/server.h b/src/server.h index 1dd181794..7071d2d07 100644 --- a/src/server.h +++ b/src/server.h @@ -126,6 +126,17 @@ struct MinimapMode { u16 scale = 1; }; +// structure for everything getClientInfo returns, for convenience +struct ClientInfo { + ClientState state; + Address addr; + u32 uptime; + u8 ser_vers; + u16 prot_vers; + u8 major, minor, patch; + std::string vers_string, lang_code; +}; + class Server : public con::PeerHandler, public MapEventReceiver, public IGameDef { @@ -326,9 +337,7 @@ public: void DenyAccess_Legacy(session_t peer_id, const std::wstring &reason); void DisconnectPeer(session_t peer_id); bool getClientConInfo(session_t peer_id, con::rtt_stat_type type, float *retval); - bool getClientInfo(session_t peer_id, ClientState *state, u32 *uptime, - u8* ser_vers, u16* prot_vers, u8* major, u8* minor, u8* patch, - std::string* vers_string, std::string* lang_code); + bool getClientInfo(session_t peer_id, ClientInfo &ret); void printToConsoleOnly(const std::string &text); |