diff options
author | red-001 <red-001@outlook.ie> | 2017-04-27 10:49:44 +0100 |
---|---|---|
committer | Loïc Blot <nerzhul@users.noreply.github.com> | 2017-04-27 11:49:44 +0200 |
commit | 1ef9eee31133a3001ed0c642df5cbe54169850de (patch) | |
tree | 2cccea0b614ff4601b2d42fcd6810e1ea1fddd3a /src/script | |
parent | d130e1fdc09398367bfed3e0d4a4b2574ca33ab1 (diff) | |
download | minetest-1ef9eee31133a3001ed0c642df5cbe54169850de.tar.gz minetest-1ef9eee31133a3001ed0c642df5cbe54169850de.tar.bz2 minetest-1ef9eee31133a3001ed0c642df5cbe54169850de.zip |
Allow scripts to get the client protocol version in non-debug builds. (#5649)
Diffstat (limited to 'src/script')
-rw-r--r-- | src/script/lua_api/l_server.cpp | 10 | ||||
-rw-r--r-- | src/script/lua_api/l_server.h | 2 |
2 files changed, 6 insertions, 6 deletions
diff --git a/src/script/lua_api/l_server.cpp b/src/script/lua_api/l_server.cpp index 813d5a945..7b723d14c 100644 --- a/src/script/lua_api/l_server.cpp +++ b/src/script/lua_api/l_server.cpp @@ -137,7 +137,7 @@ int ModApiServer::l_get_player_ip(lua_State *L) } } -// get_player_information() +// get_player_information(name) int ModApiServer::l_get_player_information(lua_State *L) { @@ -231,15 +231,15 @@ int ModApiServer::l_get_player_information(lua_State *L) lua_pushnumber(L, uptime); lua_settable(L, table); + 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); - lua_pushstring(L,"protocol_version"); - lua_pushnumber(L, prot_vers); - lua_settable(L, table); - lua_pushstring(L,"major"); lua_pushnumber(L, major); lua_settable(L, table); diff --git a/src/script/lua_api/l_server.h b/src/script/lua_api/l_server.h index e6c0df978..3a4a917c0 100644 --- a/src/script/lua_api/l_server.h +++ b/src/script/lua_api/l_server.h @@ -74,7 +74,7 @@ private: // get_player_ip() static int l_get_player_ip(lua_State *L); - // get_player_information() + // get_player_information(name) static int l_get_player_information(lua_State *L); // get_ban_list() |