diff options
author | red-001 <red-001@outlook.ie> | 2017-02-18 11:16:11 +0000 |
---|---|---|
committer | Loïc Blot <nerzhul@users.noreply.github.com> | 2017-02-18 12:16:11 +0100 |
commit | 3d25914986845dcb789d372ec7c20d15e310572a (patch) | |
tree | 439aa4e2016cf9f14567991723acb5ba0fb60a77 /builtin | |
parent | d0ce27edd8e9a30330c81a69ccca52b02056c286 (diff) | |
download | minetest-3d25914986845dcb789d372ec7c20d15e310572a.tar.gz minetest-3d25914986845dcb789d372ec7c20d15e310572a.tar.bz2 minetest-3d25914986845dcb789d372ec7c20d15e310572a.zip |
Add support for the new arguments of `request_shutdown` to the `/shutdown` chatcommand. (#5252)
Diffstat (limited to 'builtin')
-rw-r--r-- | builtin/game/chatcommands.lua | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/builtin/game/chatcommands.lua b/builtin/game/chatcommands.lua index 08dc1bb1d..54cd6c325 100644 --- a/builtin/game/chatcommands.lua +++ b/builtin/game/chatcommands.lua @@ -836,11 +836,13 @@ core.register_chatcommand("days", { core.register_chatcommand("shutdown", { description = "Shutdown server", + params = "[reconnect] [message]", privs = {server=true}, func = function(name, param) core.log("action", name .. " shuts down server") - core.request_shutdown() core.chat_send_all("*** Server shutting down (operator request).") + local reconnect, message = param:match("([^ ]+)(.*)") + core.request_shutdown(message:trim(), minetest.is_yes(reconnect)) end, }) |