mirror of
https://github.com/luanti-org/luanti.git
synced 2025-10-15 01:25:20 +02:00
Network: offload often changed constants to source file (#15207)
* Network: offload often changed constants to source file This prevents unnecessary recompiling when using incremental builds. There is also no need to have separate max proto version variables; as they're subject to the handshake between client and server. The code is also expected to support the same version (or higher). Co-authored-by: sfan5 <sfan5@live.de>
This commit is contained in:
@@ -1034,7 +1034,7 @@ int ModApiMainMenu::l_get_min_supp_proto(lua_State *L)
|
||||
|
||||
int ModApiMainMenu::l_get_max_supp_proto(lua_State *L)
|
||||
{
|
||||
lua_pushinteger(L, CLIENT_PROTOCOL_VERSION_MAX);
|
||||
lua_pushinteger(L, LATEST_PROTOCOL_VERSION);
|
||||
return 1;
|
||||
}
|
||||
|
||||
|
@@ -531,7 +531,7 @@ int ModApiUtil::l_get_version(lua_State *L)
|
||||
lua_pushnumber(L, SERVER_PROTOCOL_VERSION_MIN);
|
||||
lua_setfield(L, table, "proto_min");
|
||||
|
||||
lua_pushnumber(L, SERVER_PROTOCOL_VERSION_MAX);
|
||||
lua_pushnumber(L, LATEST_PROTOCOL_VERSION);
|
||||
lua_setfield(L, table, "proto_max");
|
||||
|
||||
if (strcmp(g_version_string, g_version_hash) != 0) {
|
||||
|
Reference in New Issue
Block a user