aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCora de la Mouche <73539712+corarona@users.noreply.github.com>2023-06-20 02:43:39 +0200
committerGitHub <noreply@github.com>2023-06-20 02:43:39 +0200
commit2c050a42d7d4c33552834a219fb8247b7e70a69e (patch)
treeb828573611448daae5a3085d2651100f6564ff19
parentf8fd5c11b645c2f35e3b46fa72844ceb25bbde2e (diff)
parent64e7dda46e9c8020a43a5e0f8032d4068628336b (diff)
downloaddragonfireclient-2c050a42d7d4c33552834a219fb8247b7e70a69e.tar.xz
Merge pull request #61 from dragonfireclient/serverinfo_seed
Add mapseed to get_server_info table
-rw-r--r--doc/client_lua_api.txt3
-rw-r--r--src/script/lua_api/l_client.cpp2
2 files changed, 4 insertions, 1 deletions
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
}
```
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;
}