From ae0d8f74d747fab2fbe5b4553818e0f938e3289d Mon Sep 17 00:00:00 2001 From: red-001 Date: Wed, 19 Apr 2017 14:16:54 +0100 Subject: Add function to get server info. --- clientmods/preview/init.lua | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'clientmods') diff --git a/clientmods/preview/init.lua b/clientmods/preview/init.lua index 255c0b83f..fb606b3f4 100644 --- a/clientmods/preview/init.lua +++ b/clientmods/preview/init.lua @@ -8,6 +8,11 @@ end) core.register_on_connect(function() print("[PREVIEW] Player connection completed") + local server_info = core.get_server_info() + print("Server version: " .. server_info.protocol_version) + print("Server ip: " .. server_info.ip) + print("Server address: " .. server_info.address) + print("Server port: " .. server_info.port) end) core.register_on_placenode(function(pointed_thing, node) @@ -80,7 +85,6 @@ core.after(2, function() print("[PREVIEW] loaded " .. modname .. " mod") modstorage:set_string("current_mod", modname) print(modstorage:get_string("current_mod")) - print("Server version:" .. core.get_protocol_version()) preview_minimap() end) -- cgit v1.2.3