From 822ab80f30e7982d13b71fc564048c90fca28d7d Mon Sep 17 00:00:00 2001 From: mckaygerhard Date: Sun, 21 Nov 2021 19:54:55 -0400 Subject: [PATCH] retrieve more client info on minetest 5.X or 5.2 for minetest5 * take from https://forum.minetest.net/viewtopic.php?p=354631#p354631 * usefull for give more info for idetification of clients cheaters --- doc/lua_api.txt | 15 +++++++-------- src/script/lua_api/l_server.cpp | 2 -- 2 files changed, 7 insertions(+), 10 deletions(-) diff --git a/doc/lua_api.txt b/doc/lua_api.txt index bd95062a5..5634df821 100644 --- a/doc/lua_api.txt +++ b/doc/lua_api.txt @@ -4073,14 +4073,13 @@ Utilities connection_uptime = 200, -- seconds since client connected protocol_version = 32, -- protocol version used by client formspec_version = 2, -- supported formspec version - -- following information is available on debug build only!!! - -- DO NOT USE IN MODS - --ser_vers = 26, -- serialization version used by client - --major = 0, -- major version number - --minor = 4, -- minor version number - --patch = 10, -- patch version number - --vers_string = "0.4.9-git", -- full version string - --state = "Active" -- current client state + -- following information is available on minenux only build. dont assume in mods + serialization_version = 26, -- serialization version used by client + major = 5, -- major version number + minor = 2, -- minor version number + patch = 1, -- patch version number + vers_string = "5.2.1", -- full version string + state = "Active" -- current client state } * `minetest.mkdir(path)`: returns success. diff --git a/src/script/lua_api/l_server.cpp b/src/script/lua_api/l_server.cpp index 00e849cdf..28615f65a 100644 --- a/src/script/lua_api/l_server.cpp +++ b/src/script/lua_api/l_server.cpp @@ -237,7 +237,6 @@ int ModApiServer::l_get_player_information(lua_State *L) lua_pushnumber(L, player->formspec_version); lua_settable(L, table); -#ifndef NDEBUG lua_pushstring(L,"serialization_version"); lua_pushnumber(L, ser_vers); lua_settable(L, table); @@ -261,7 +260,6 @@ int ModApiServer::l_get_player_information(lua_State *L) lua_pushstring(L,"state"); lua_pushstring(L,ClientInterface::state2Name(state).c_str()); lua_settable(L, table); -#endif #undef ERET return 1;