From 59217b2b063ce720adeea4734d67ff53b562d06b Mon Sep 17 00:00:00 2001 From: Incoming Date: Mon, 20 Jul 2015 23:06:42 -0400 Subject: [PATCH] Adds a server admin version of end round now; a semi obscure admin tool that came about in the mulligan push but never really got advertised. It will print out a round end report and attempt to database round stats before restarting. Suggested use is when the round has SLOWED down to an unplayble crawl for some reason but the game is still technically responcive. Pressing end round doesn't preclude the use of reset if it doesn't seem to be working, but end round should usually be tried first. Removes the 20 second confirmation between prompts for the normal admin version of end round now. If admins force end a round escape objectives will be good faith greentexted if the antagonists were still in a position to escape alive. The survival rate will always be printed at round end now, even if the shuttle makes it to centcom (evac rate will be printed too in that case). --- code/controllers/subsystem/ticker.dm | 3 +-- code/game/gamemodes/objective.dm | 6 ++++-- code/modules/admin/admin.dm | 14 ++++++++++++++ code/modules/admin/admin_verbs.dm | 1 + code/modules/admin/topic.dm | 1 - 5 files changed, 20 insertions(+), 5 deletions(-) diff --git a/code/controllers/subsystem/ticker.dm b/code/controllers/subsystem/ticker.dm index 599563b1c81..9b191785071 100644 --- a/code/controllers/subsystem/ticker.dm +++ b/code/controllers/subsystem/ticker.dm @@ -370,8 +370,7 @@ var/datum/subsystem/ticker/ticker world << "
[TAB]Total Population: [joined_player_list.len]" if(station_evacuated) world << "
[TAB]Evacuation Rate: [num_escapees] ([round((num_escapees/joined_player_list.len)*100, 0.1)]%)" - else - world << "
[TAB]Survival Rate: [num_survivors] ([round((num_survivors/joined_player_list.len)*100, 0.1)]%)" + world << "
[TAB]Survival Rate: [num_survivors] ([round((num_survivors/joined_player_list.len)*100, 0.1)]%)" world << "
" //Silicon laws report diff --git a/code/game/gamemodes/objective.dm b/code/game/gamemodes/objective.dm index 0ea208a2fcd..379720fcca3 100644 --- a/code/game/gamemodes/objective.dm +++ b/code/game/gamemodes/objective.dm @@ -247,10 +247,12 @@ return 0 if(isbrain(owner.current)) return 0 - if(SSshuttle.emergency.mode < SHUTTLE_ENDGAME) - return 0 if(!owner.current || owner.current.stat == DEAD) return 0 + if(ticker.force_ending) //This one isn't their fault, so lets just assume good faith + return 1 + if(SSshuttle.emergency.mode < SHUTTLE_ENDGAME) + return 0 var/turf/location = get_turf(owner.current) if(!location) return 0 diff --git a/code/modules/admin/admin.dm b/code/modules/admin/admin.dm index 9d8c74ea4f8..8f57064f66d 100644 --- a/code/modules/admin/admin.dm +++ b/code/modules/admin/admin.dm @@ -418,6 +418,20 @@ var/global/floorIsLava = 0 feedback_add_details("admin_verb","R") //If you are copy-pasting this, ensure the 2nd parameter is unique to the new proc! world.Reboot("Initiated by [usr.client.holder.fakekey ? "Admin" : usr.key].", "end_error", "admin reboot - by [usr.key] [usr.client.holder.fakekey ? "(stealth)" : ""]", 10) +/datum/admins/proc/end_round() + set category = "Server" + set name = "End Round" + set desc = "Attempts to produce a round end report and then restart the server organically." + + if (!usr.client.holder) + return + var/confirm = alert("End the round and restart the game world?", "End Round", "Yes", "Cancel") + if(confirm == "Cancel") + return + if(confirm == "Yes") + ticker.force_ending = 1 + feedback_add_details("admin_verb","ER") //If you are copy-pasting this, ensure the 2nd parameter is unique to the new proc! + /datum/admins/proc/announce() set category = "Special Verbs" diff --git a/code/modules/admin/admin_verbs.dm b/code/modules/admin/admin_verbs.dm index 194a4437e55..b6132dbf816 100644 --- a/code/modules/admin/admin_verbs.dm +++ b/code/modules/admin/admin_verbs.dm @@ -98,6 +98,7 @@ var/list/admin_verbs_spawn = list( var/list/admin_verbs_server = list( /datum/admins/proc/startnow, /datum/admins/proc/restart, + /datum/admins/proc/end_round, /datum/admins/proc/delay, /datum/admins/proc/toggleaban, /client/proc/toggle_log_hrefs, diff --git a/code/modules/admin/topic.dm b/code/modules/admin/topic.dm index 062cc7f9378..e66b3945ed7 100644 --- a/code/modules/admin/topic.dm +++ b/code/modules/admin/topic.dm @@ -352,7 +352,6 @@ message_admins("[key_name_admin(usr)] is considering ending the round.") if(alert(usr, "This will end the round, are you SURE you want to do this?", "Confirmation", "Yes", "No") == "Yes") - spawn(200) //I wish you would step back from that ledge my friend if(alert(usr, "Final Confirmation: End the round NOW?", "Confirmation", "Yes", "No") == "Yes") message_admins("[key_name_admin(usr)] has ended the round.") ticker.force_ending = 1 //Yeah there we go APC destroyed mission accomplished