From ba767641e5cd09775d54325120e6ba9192e5906c Mon Sep 17 00:00:00 2001 From: Gabriel Adamson Date: Sun, 12 Sep 2021 14:06:26 -0500 Subject: [PATCH] Allow mods to soft reboot the server, also allows admins to reboot the server ignoring tickets --- code/controllers/subsystem/ticker.dm | 4 ++-- code/modules/admin/admin.dm | 10 ++++++---- 2 files changed, 8 insertions(+), 6 deletions(-) diff --git a/code/controllers/subsystem/ticker.dm b/code/controllers/subsystem/ticker.dm index b534e44da916..e32b14e50060 100755 --- a/code/controllers/subsystem/ticker.dm +++ b/code/controllers/subsystem/ticker.dm @@ -649,7 +649,7 @@ SUBSYSTEM_DEF(ticker) /datum/controller/subsystem/ticker/proc/Reboot(reason, end_string, delay, force = FALSE) set waitfor = FALSE if(usr && !force) - if(!check_rights(R_SERVER, TRUE)) + if(!check_rights(R_ADMIN, TRUE)) return // yogs end @@ -664,7 +664,7 @@ SUBSYSTEM_DEF(ticker) if(GLOB.ahelp_tickets && GLOB.ahelp_tickets.ticketAmount) var/list/adm = get_admin_counts(R_BAN) var/list/activemins = adm["present"] - if(activemins.len > 0) + if(activemins.len > 0 && !force) // Ignore tickets if forced to_chat(world, "Not all tickets have been resolved. Server restart delayed.") return else diff --git a/code/modules/admin/admin.dm b/code/modules/admin/admin.dm index ebc8c600d867..683b08443d42 100644 --- a/code/modules/admin/admin.dm +++ b/code/modules/admin/admin.dm @@ -476,9 +476,11 @@ if (!usr.client.holder) return - var/list/options = list("Regular Restart", "Hard Restart (No Delay/Feeback Reason)", "Hardest Restart (No actions, just reboot)") - if(world.TgsAvailable()) - options += "Server Restart (Kill and restart DD)"; + var/list/options = list("Regular Restart") + if(check_rights(R_SERVER, FALSE)) + options += list("Hard Restart (No Delay/Feeback Reason)", "Hardest Restart (No actions, just reboot)") + if(world.TgsAvailable()) + options += "Server Restart (Kill and restart DD)"; var/rebootconfirm if(SSticker.admin_delay_notice) @@ -493,7 +495,7 @@ var/init_by = "Initiated by [usr.client.holder.fakekey ? "Admin" : usr.key]." switch(result) if("Regular Restart") - SSticker.Reboot(init_by, "admin reboot - by [usr.key] [usr.client.holder.fakekey ? "(stealth)" : ""]", 10) + SSticker.Reboot(init_by, "admin reboot - by [usr.key] [usr.client.holder.fakekey ? "(stealth)" : ""]", 10 SECONDS, check_rights(R_SERVER, FALSE)) // Force if they have +SERVER if("Hard Restart (No Delay, No Feeback Reason)") to_chat(world, "World reboot - [init_by]") world.Reboot()