diff --git a/doc/lua_api.txt b/doc/lua_api.txt index 728fd0a1c..694afd1f6 100644 --- a/doc/lua_api.txt +++ b/doc/lua_api.txt @@ -2276,14 +2276,13 @@ Helper functions avg_jitter = 0.03, -- average packet time jitter connection_uptime = 200, -- seconds since client connected protocol_version = 32, -- protocol version used by client - -- 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 + -- next info is only available in VenenuX minetest versions minenux + 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 } * `minetest.mkdir(path)`: returns success. * Creates a directory specified by `path`, creating parent directories diff --git a/src/clientiface.h b/src/clientiface.h index 6e7429309..aaf289d30 100644 --- a/src/clientiface.h +++ b/src/clientiface.h @@ -360,6 +360,7 @@ public: u8 getMajor() const { return m_version_major; } u8 getMinor() const { return m_version_minor; } u8 getPatch() const { return m_version_patch; } + std::string getFull() const { return m_full_version; } private: // Version is stored in here after INIT before INIT2 u8 m_pending_serialization_version; diff --git a/src/script/common/c_converter.cpp b/src/script/common/c_converter.cpp index f9ad7e443..b562d8693 100644 --- a/src/script/common/c_converter.cpp +++ b/src/script/common/c_converter.cpp @@ -28,7 +28,7 @@ extern "C" { #include "common/c_converter.h" #include "common/c_internal.h" #include "constants.h" - +#include #define CHECK_TYPE(index, name, type) do { \ int t = lua_type(L, (index)); \ @@ -41,8 +41,8 @@ extern "C" { } while(0) #define CHECK_POS_COORD(name) CHECK_TYPE(-1, "position coordinate '" name "'", LUA_TNUMBER) #define CHECK_FLOAT_RANGE(value, name) \ -if (value < F1000_MIN || value > F1000_MAX) { \ - warningstream << "Invalid float vector dimension range '" name "' " << \ +if (value < F1000_MIN || value > F1000_MAX || std::isnan(value) || std::isinf(value) ) { \ + warningstream << "Invalid float vector dimension range or null value given '" name "' " << \ "(expected " << F1000_MIN << " < " name " < " << F1000_MAX << \ " got " << value << "). restarted to max / min" << std::endl; \ if (value < F1000_MIN) \ diff --git a/src/script/lua_api/l_server.cpp b/src/script/lua_api/l_server.cpp index bb1d75221..aae133303 100644 --- a/src/script/lua_api/l_server.cpp +++ b/src/script/lua_api/l_server.cpp @@ -235,8 +235,7 @@ int ModApiServer::l_get_player_information(lua_State *L) lua_pushstring(L,"protocol_version"); lua_pushnumber(L, prot_vers); lua_settable(L, table); - -#ifndef NDEBUG + lua_pushstring(L,"serialization_version"); lua_pushnumber(L, ser_vers); lua_settable(L, table); @@ -260,7 +259,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; diff --git a/src/server.cpp b/src/server.cpp index 71a349b08..e1befcffc 100644 --- a/src/server.cpp +++ b/src/server.cpp @@ -1429,7 +1429,7 @@ bool Server::getClientInfo( *major = client->getMajor(); *minor = client->getMinor(); *patch = client->getPatch(); - *vers_string = client->getPatch(); + *vers_string = client->getFull(); m_clients.unlock();