Add support for the new arguments of request_shutdown
to the /shutdown
chatcommand. (#5252)
This commit is contained in:
parent
d0ce27edd8
commit
3d25914986
@ -836,11 +836,13 @@ core.register_chatcommand("days", {
|
|||||||
|
|
||||||
core.register_chatcommand("shutdown", {
|
core.register_chatcommand("shutdown", {
|
||||||
description = "Shutdown server",
|
description = "Shutdown server",
|
||||||
|
params = "[reconnect] [message]",
|
||||||
privs = {server=true},
|
privs = {server=true},
|
||||||
func = function(name, param)
|
func = function(name, param)
|
||||||
core.log("action", name .. " shuts down server")
|
core.log("action", name .. " shuts down server")
|
||||||
core.request_shutdown()
|
|
||||||
core.chat_send_all("*** Server shutting down (operator request).")
|
core.chat_send_all("*** Server shutting down (operator request).")
|
||||||
|
local reconnect, message = param:match("([^ ]+)(.*)")
|
||||||
|
core.request_shutdown(message:trim(), minetest.is_yes(reconnect))
|
||||||
end,
|
end,
|
||||||
})
|
})
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user