summaryrefslogtreecommitdiff
path: root/src/server.h
diff options
context:
space:
mode:
authorsfan5 <sfan5@live.de>2021-01-31 20:36:47 +0100
committerGitHub <noreply@github.com>2021-01-31 20:36:47 +0100
commit112a6adb10d3a5a2e55012a36580607d12ce9758 (patch)
tree344696315dbb8e261477e15d2e13421173fca8ba /src/server.h
parent6e0e0324a48130376ab3c9fef03b84ee25608242 (diff)
downloadminetest-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.h15
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);