From 338bb4e5296f8e014eff25ac2e29f889907d5ba5 Mon Sep 17 00:00:00 2001 From: rubenwardy Date: Wed, 30 Dec 2015 14:17:06 +0000 Subject: [PATCH] Add chatcommand to queue restart --- mods/ctf_match/chat.lua | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/mods/ctf_match/chat.lua b/mods/ctf_match/chat.lua index c6baf85..aa32a53 100644 --- a/mods/ctf_match/chat.lua +++ b/mods/ctf_match/chat.lua @@ -35,3 +35,24 @@ minetest.register_chatcommand("ctf_respawn", { end end }) + +local restart_on_next_match = false +local restart_on_next_match_by = nil +minetest.register_chatcommand("ctf_queue_restart", { + description = "Respawn a player (clean inv, send to base)", + privs = { + server = true + }, + func = function(name, param) + restart_on_next_match = true + restart_on_next_match_by = name + return true, "Restart queued." + end +}) + +ctf_match.register_on_new_match(function() + if restart_on_next_match then + minetest.chat_send_player(restart_on_next_match_by, "Shutting down now!") + minetest.request_shutdown("Restarting server at operator request.", true) + end +end)