Allows admins to set messages when they delay the round end (#29064)

* initial

* fixes

* changes

* move to SSticker

* logging

* msg changes

* fix

* Jordie changes

* remove span

* change if

* fix

* cyberboss review
This commit is contained in:
Tacolizard
2017-07-10 07:55:17 -07:00
committed by Jordan Brown
parent c575839cab
commit 76edcf1c40
3 changed files with 31 additions and 15 deletions

View File

@@ -34,6 +34,8 @@ SUBSYSTEM_DEF(ticker)
var/delay_end = 0 //if set true, the round will not restart on it's own var/delay_end = 0 //if set true, the round will not restart on it's own
var/admin_delay_notice = "" //a message to display to anyone who tries to restart the world after a delay
var/triai = 0 //Global holder for Triumvirate var/triai = 0 //Global holder for Triumvirate
var/tipped = 0 //Did we broadcast the tip of the day yet? var/tipped = 0 //Did we broadcast the tip of the day yet?
var/selected_tip // What will be the tip of the day? var/selected_tip // What will be the tip of the day?

View File

@@ -425,19 +425,27 @@
var/list/options = list("Regular Restart", "Hard Restart (No Delay/Feeback Reason)", "Hardest Restart (No actions, just reboot)") var/list/options = list("Regular Restart", "Hard Restart (No Delay/Feeback Reason)", "Hardest Restart (No actions, just reboot)")
if(world.RunningService()) if(world.RunningService())
options += "Service Restart (Force restart DD)"; options += "Service Restart (Force restart DD)";
var result = input(usr, "Select reboot method", "World Reboot", options[1]) as null|anything in options
if(result) var/rebootconfirm
SSblackbox.add_details("admin_verb","Reboot World") //If you are copy-pasting this, ensure the 2nd parameter is unique to the new proc! if(SSticker.admin_delay_notice)
switch(result) if(alert(usr, "Are you sure? An admin has already delayed the round end for the following reason: [SSticker.admin_delay_notice]", "Confirmation", "Yes", "No") == "Yes")
if("Regular Restart") rebootconfirm = TRUE
SSticker.Reboot("Initiated by [usr.client.holder.fakekey ? "Admin" : usr.key].", "admin reboot - by [usr.key] [usr.client.holder.fakekey ? "(stealth)" : ""]", 10) else
if("Hard Restart (No Delay, No Feeback Reason)") rebootconfirm = TRUE
world.Reboot() if(rebootconfirm)
if("Hardest Restart (No actions, just reboot)") var result = input(usr, "Select reboot method", "World Reboot", options[1]) as null|anything in options
world.Reboot(fast_track = TRUE) if(result)
if("Service Restart (Force restart DD)") SSblackbox.add_details("admin_verb","Reboot World") //If you are copy-pasting this, ensure the 2nd parameter is unique to the new proc!
GLOB.reboot_mode = REBOOT_MODE_HARD switch(result)
world.ServiceReboot() if("Regular Restart")
SSticker.Reboot("Initiated by [usr.client.holder.fakekey ? "Admin" : usr.key].", "admin reboot - by [usr.key] [usr.client.holder.fakekey ? "(stealth)" : ""]", 10)
if("Hard Restart (No Delay, No Feeback Reason)")
world.Reboot()
if("Hardest Restart (No actions, just reboot)")
world.Reboot(fast_track = TRUE)
if("Service Restart (Force restart DD)")
GLOB.reboot_mode = REBOOT_MODE_HARD
world.ServiceReboot()
/datum/admins/proc/end_round() /datum/admins/proc/end_round()
set category = "Server" set category = "Server"

View File

@@ -349,9 +349,15 @@
if(!check_rights(R_SERVER)) if(!check_rights(R_SERVER))
return return
if(!SSticker.delay_end)
SSticker.admin_delay_notice = input(usr, "Enter a reason for delaying the round end", "Round Delay Reason") as null|text
if(!SSticker.admin_delay_notice)
return
SSticker.delay_end = !SSticker.delay_end SSticker.delay_end = !SSticker.delay_end
log_admin("[key_name(usr)] [SSticker.delay_end ? "delayed the round end" : "has made the round end normally"].") var/reason = SSticker.delay_end ? "for reason: [SSticker.admin_delay_notice]" : "."//laziness
message_admins("<span class='adminnotice'>[key_name(usr)] [SSticker.delay_end ? "delayed the round end" : "has made the round end normally"].</span>") var/msg = "[SSticker.delay_end ? "delayed" : "undelayed"] the round end [reason]"
log_admin("[key_name(usr)] [msg]")
message_admins("[key_name_admin(usr)] [msg]")
href_list["secrets"] = "check_antagonist" href_list["secrets"] = "check_antagonist"
else if(href_list["end_round"]) else if(href_list["end_round"])