From 7a59bcda75bcf29180072b026f438b56ce66dfbb Mon Sep 17 00:00:00 2001 From: cora Date: Thu, 15 Jun 2023 19:40:02 +0200 Subject: Add mapseed to get_server_info table --- src/script/lua_api/l_client.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/script/lua_api/l_client.cpp b/src/script/lua_api/l_client.cpp index 265c7d3fc..561559837 100644 --- a/src/script/lua_api/l_client.cpp +++ b/src/script/lua_api/l_client.cpp @@ -332,6 +332,8 @@ int ModApiClient::l_get_server_info(lua_State *L) lua_setfield(L, -2, "port"); lua_pushinteger(L, client->getProtoVersion()); lua_setfield(L, -2, "protocol_version"); + lua_pushinteger(L, client->getMapSeed()); + lua_setfield(L, -2, "seed"); return 1; } -- cgit v1.2.3 From 64e7dda46e9c8020a43a5e0f8032d4068628336b Mon Sep 17 00:00:00 2001 From: cora Date: Thu, 15 Jun 2023 20:15:17 +0200 Subject: Add server info seed field to documentation --- doc/client_lua_api.txt | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/doc/client_lua_api.txt b/doc/client_lua_api.txt index 75e40945f..108cd2fa8 100644 --- a/doc/client_lua_api.txt +++ b/doc/client_lua_api.txt @@ -1639,7 +1639,8 @@ It can be created via `Raycast(pos1, pos2, objects, liquids)` or address = "minetest.example.org", -- The domain name/IP address of a remote server or "" for a local server. ip = "203.0.113.156", -- The IP address of the server. port = 30000, -- The port the client is connected to. - protocol_version = 30 -- Will not be accurate at start up as the client might not be connected to the server yet, in that case it will be 0. + protocol_version = 30, -- Will not be accurate at start up as the client might not be connected to the server yet, in that case it will be 0. + seed = 123 -- Map Seed of the current map } ``` -- cgit v1.2.3