1
0
Fork 0
mirror of https://github.com/luanti-org/luanti.git synced 2025-06-27 16:36:03 +00:00

Expose client version information in non-debug builds (#15708)

Co-authored-by: SmallJoker <SmallJoker@users.noreply.github.com>
Co-authored-by: Lars Mueller <appgurulars@gmx.de>
Co-authored-by: sfan5 <sfan5@live.de>
This commit is contained in:
ROllerozxa 2025-02-09 18:09:07 +01:00 committed by GitHub
parent e6cf08169e
commit dd0070a6b8
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
8 changed files with 95 additions and 24 deletions

View file

@ -64,6 +64,7 @@
[scheduled bump for 5.11.0]
*/
// Note: Also update core.protocol_versions in builtin when bumping
const u16 LATEST_PROTOCOL_VERSION = 47;
// See also formspec [Version History] in doc/lua_api.md

View file

@ -239,6 +239,10 @@ int ModApiServer::l_get_player_information(lua_State *L)
lua_pushstring(L, info.lang_code.c_str());
lua_settable(L, table);
lua_pushstring(L, "version_string");
lua_pushstring(L, info.vers_string.c_str());
lua_settable(L, table);
#ifndef NDEBUG
lua_pushstring(L,"serialization_version");
lua_pushnumber(L, info.ser_vers);
@ -256,10 +260,6 @@ int ModApiServer::l_get_player_information(lua_State *L)
lua_pushnumber(L, info.patch);
lua_settable(L, table);
lua_pushstring(L,"version_string");
lua_pushstring(L, info.vers_string.c_str());
lua_settable(L, table);
lua_pushstring(L,"state");
lua_pushstring(L, ClientInterface::state2Name(info.state).c_str());
lua_settable(L, table);