Merge branch 'stable-4.0' into stable-4.0-next, sync float limits

* fix commits 00114e9c23 and 8afa292ed8  and c63593ec39, merge
  the solution with stable-4.0-next to define final release soon
This commit is contained in:
mckaygerhard 2023-01-04 16:36:43 -04:00
commit db479a9e97
5 changed files with 13 additions and 15 deletions

View File

@ -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

View File

@ -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;

View File

@ -28,7 +28,7 @@ extern "C" {
#include "common/c_converter.h"
#include "common/c_internal.h"
#include "constants.h"
#include <cmath>
#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) \

View File

@ -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;

View File

@ -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();