1
0
mirror of https://github.com/luanti-org/luanti.git synced 2025-10-14 09:05:19 +02:00

Add min/max protocol version to minetest.get_version() (#13482)

This commit is contained in:
Buckaroo Banzai
2023-05-06 17:16:21 +02:00
committed by GitHub
parent bc4fc6d648
commit 65692ad1b5
4 changed files with 22 additions and 0 deletions

View File

@@ -24,6 +24,7 @@ with this program; if not, write to the Free Software Foundation, Inc.,
#include "common/c_converter.h"
#include "common/c_content.h"
#include "cpp_api/s_async.h"
#include "network/networkprotocol.h"
#include "serialization.h"
#include <json/json.h>
#include <zstd.h>
@@ -527,6 +528,12 @@ int ModApiUtil::l_get_version(lua_State *L)
lua_pushstring(L, g_version_string);
lua_setfield(L, table, "string");
lua_pushnumber(L, SERVER_PROTOCOL_VERSION_MIN);
lua_setfield(L, table, "proto_min");
lua_pushnumber(L, SERVER_PROTOCOL_VERSION_MAX);
lua_setfield(L, table, "proto_max");
if (strcmp(g_version_string, g_version_hash) != 0) {
lua_pushstring(L, g_version_hash);
lua_setfield(L, table, "hash");