Add support for the new arguments of `request_shutdown` to the `/shutdown` chatcomman...
authorred-001 <red-001@outlook.ie>
Sat, 18 Feb 2017 11:16:11 +0000 (11:16 +0000)
committerLoïc Blot <nerzhul@users.noreply.github.com>
Sat, 18 Feb 2017 11:16:11 +0000 (12:16 +0100)
builtin/game/chatcommands.lua

index 08dc1bb1d11053189507a926871dbb8e8460e279..54cd6c3252cd7a8175bd9903182986af60dbedd1 100644 (file)
@@ -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,
 })