From 6f22d14206824911b620ecec450689f84e6d278b Mon Sep 17 00:00:00 2001 From: SmallJoker Date: Sun, 1 Jul 2018 12:31:28 +0200 Subject: Make the server status message customizable (#7357) Remove now redundant setting show_statusline_on_connect Improve documentation of `minetest.get_server_status` --- builtin/game/chatcommands.lua | 6 +++++- builtin/game/misc.lua | 6 ++++++ builtin/settingtypes.txt | 3 --- 3 files changed, 11 insertions(+), 4 deletions(-) (limited to 'builtin') diff --git a/builtin/game/chatcommands.lua b/builtin/game/chatcommands.lua index d56f2112b..4aef063de 100644 --- a/builtin/game/chatcommands.lua +++ b/builtin/game/chatcommands.lua @@ -799,7 +799,11 @@ core.register_chatcommand("rollback", { core.register_chatcommand("status", { description = "Show server status", func = function(name, param) - return true, core.get_server_status() + local status = core.get_server_status(name, false) + if status and status ~= "" then + return true, status + end + return false, "This command was disabled by a mod or game" end, }) diff --git a/builtin/game/misc.lua b/builtin/game/misc.lua index 2e05cdc41..1d60f1958 100644 --- a/builtin/game/misc.lua +++ b/builtin/game/misc.lua @@ -62,6 +62,12 @@ end core.register_on_joinplayer(function(player) local player_name = player:get_player_name() player_list[player_name] = player + if not minetest.is_singleplayer() then + local status = core.get_server_status(player_name, true) + if status and status ~= "" then + core.chat_send_player(player_name, status) + end + end core.send_join_message(player_name) end) diff --git a/builtin/settingtypes.txt b/builtin/settingtypes.txt index b43d66838..0b0ec4a4c 100644 --- a/builtin/settingtypes.txt +++ b/builtin/settingtypes.txt @@ -950,9 +950,6 @@ map-dir (Map directory) path # Setting it to -1 disables the feature. item_entity_ttl (Item entity TTL) int 900 -# If enabled, show the server status message on player connection. -show_statusline_on_connect (Status message on connection) bool true - # Enable players getting damage and dying. enable_damage (Damage) bool false -- cgit v1.2.3