summaryrefslogtreecommitdiff
path: root/doc
diff options
context:
space:
mode:
authorred-001 <red-001@outlook.ie>2017-04-19 14:16:54 +0100
committerparamat <mat.gregory@virginmedia.com>2017-05-04 04:25:45 +0100
commitae0d8f74d747fab2fbe5b4553818e0f938e3289d (patch)
treeddbb434b4a7c9b1300d6e0503b3fd70f391c6ff5 /doc
parent468eeb618e9abbff2f04f4635eb89a8f684d71ae (diff)
downloadminetest-ae0d8f74d747fab2fbe5b4553818e0f938e3289d.tar.gz
minetest-ae0d8f74d747fab2fbe5b4553818e0f938e3289d.tar.bz2
minetest-ae0d8f74d747fab2fbe5b4553818e0f938e3289d.zip
Add function to get server info.
Diffstat (limited to 'doc')
-rw-r--r--doc/client_lua_api.md18
1 files changed, 13 insertions, 5 deletions
diff --git a/doc/client_lua_api.md b/doc/client_lua_api.md
index 3e81818ae..b76a406ea 100644
--- a/doc/client_lua_api.md
+++ b/doc/client_lua_api.md
@@ -702,11 +702,10 @@ Call these functions only at load time!
* `minetest.disconnect()`
* Disconnect from the server and exit to main menu.
* Returns `false` if the client is already disconnecting otherwise returns `true`.
-* `minetest.get_protocol_version()`
- * Returns the protocol version of the server.
- * Might not be accurate at start up as the client might not be connected to the server yet, in that case it will return 0.
* `minetest.take_screenshot()`
* Take a screenshot.
+* `minetest.get_server_info()`
+ * Returns [server info](#server-info).
### Misc.
* `minetest.parse_json(string[, nullvalue])`: returns something
@@ -932,9 +931,18 @@ Can be obtained via `minetest.get_meta(pos)`.
{
params = "<name> <privilege>", -- Short parameter description
description = "Remove privilege from player", -- Full description
- func = function(param), -- Called when command is run.
- -- Returns boolean success and text output.
+ func = function(param), -- Called when command is run.
+ -- Returns boolean success and text output.
}
+### Server info
+```lua
+{
+ 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.
+}
+```
Escape sequences
----------------