Merge pull request #9735 from Jordie0608/whyevenhavetwoverbs

World.Reboot() Improvement
This commit is contained in:
Cheridan
2015-06-05 16:43:13 -05:00
9 changed files with 35 additions and 109 deletions
+2 -18
View File
@@ -103,25 +103,9 @@ var/datum/subsystem/ticker/ticker
declare_completion()
spawn(50)
if(mode.station_was_nuked)
feedback_set_details("end_proper","nuke")
if(!delay_end)
world << "\blue <B>Rebooting due to destruction of station in [restart_timeout/10] seconds</B>"
world.Reboot("Station destroyed by Nuclear Device.", "end_proper", "nuke")
else
feedback_set_details("end_proper","proper completion")
if(!delay_end)
world << "\blue <B>Restarting in [restart_timeout/10] seconds</B>"
if(blackbox)
blackbox.save_all_data_to_sql()
if(delay_end)
world << "\blue <B>An admin has delayed the round end</B>"
else
sleep(restart_timeout)
kick_clients_in_lobby("\red The round came to an end with you in the lobby.", 1) //second parameter ensures only afk clients are kicked
world.Reboot()
world.Reboot("Round ended.", "end_proper", "proper completion")
/datum/subsystem/ticker/proc/setup()
//Create and announce mode
+1 -7
View File
@@ -115,14 +115,8 @@ var/datum/subsystem/vote/SSvote
restart = 1
else
master_mode = .
if(restart)
world << "World restarting due to vote..."
feedback_set_details("end_error","restart vote")
if(blackbox) blackbox.save_all_data_to_sql()
sleep(50)
log_game("Rebooting due to restart vote")
world.Reboot()
world.Reboot("Restart vote successful.", "end_error", "restart vote")
return .
+1 -18
View File
@@ -57,33 +57,16 @@
/datum/game_mode/malfunction/post_setup()
for(var/datum/mind/AI_mind in malf_ai)
if(malf_ai.len < 1)
world << "Uh oh, its malfunction and there is no AI! Please report this."
world << "Rebooting world in 5 seconds."
feedback_set_details("end_error","malf - no AI")
if(blackbox)
blackbox.save_all_data_to_sql()
sleep(50)
world.Reboot()
world.Reboot("No AI during Malfunction.", "end_error", "malf - no AI", 50)
return
AI_mind.current.verbs += /mob/living/silicon/ai/proc/choose_modules
AI_mind.current:laws = new /datum/ai_laws/malfunction
AI_mind.current:malf_picker = new /datum/module_picker
AI_mind.current:show_laws()
greet_malf(AI_mind)
AI_mind.special_role = "malfunction"
AI_mind.current.verbs += /datum/game_mode/malfunction/proc/takeover
AI_mind.current.verbs += /mob/living/silicon/ai/proc/ai_cancel_call
/* AI_mind.current.icon_state = "ai-malf"
spawn(10)
if(alert(AI_mind.current,"Do you want to use an alternative sprite for your real core?",,"Yes","No")=="Yes")
AI_mind.current.icon_state = "ai-malf2"
*/
SSshuttle.emergencyNoEscape = 1
..()
+1 -12
View File
@@ -208,21 +208,10 @@ var/bomb_set
ticker.mode:nukes_left --
else
world << "<B>The station was destoyed by the nuclear blast!</B>"
ticker.mode.station_was_nuked = (off_station<2) //offstation==1 is a draw. the station becomes irradiated and needs to be evacuated.
//kinda shit but I couldn't get permission to do what I wanted to do.
if(!ticker.mode.check_finished())//If the mode does not deal with the nuke going off so just reboot because everyone is stuck as is
world << "<B>Resetting in 30 seconds!</B>"
feedback_set_details("end_error","nuke - unhandled ending")
if(blackbox)
blackbox.save_all_data_to_sql()
sleep(300)
log_game("Rebooting due to nuclear detonation")
kick_clients_in_lobby("<span class='danger'>The round came to an end with you in the lobby.</span>", 1) //second parameter ensures only afk clients are kicked
world.Reboot()
world.Reboot("Station destroyed by Nuclear Device.", "end_error", "nuke - unhandled ending")
return
return
+3 -29
View File
@@ -491,24 +491,16 @@ var/global/floorIsLava = 0
/datum/admins/proc/restart()
set category = "Server"
set name = "Restart"
set desc="Restarts the world"
set desc="Restarts the world immediately"
if (!usr.client.holder)
return
var/confirm = alert("Restart the game world?", "Restart", "Yes", "Cancel")
if(confirm == "Cancel")
return
if(confirm == "Yes")
world << "<span class='boldannounce'>Restarting world!</span> <span class='adminnotice'> Initiated by [usr.client.holder.fakekey ? "Admin" : usr.key]!</span>"
log_admin("[key_name(usr)] initiated a reboot.")
feedback_set_details("end_error","admin reboot - by [usr.key] [usr.client.holder.fakekey ? "(stealth)" : ""]")
ticker.delay_end = 0
feedback_add_details("admin_verb","R") //If you are copy-pasting this, ensure the 2nd parameter is unique to the new proc!
if(blackbox)
blackbox.save_all_data_to_sql()
sleep(50)
world.Reboot()
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/announce()
@@ -650,24 +642,6 @@ var/global/floorIsLava = 0
log_admin("[key_name(usr)] set the pre-game delay to [newtime] seconds.")
feedback_add_details("admin_verb","DELAY") //If you are copy-pasting this, ensure the 2nd parameter is unique to the new proc!
/datum/admins/proc/immreboot()
set category = "Server"
set desc="Reboots the server post haste"
set name="Immediate Reboot"
if(!usr.client.holder) return
if( alert("Reboot server?",,"Yes","No") == "No")
return
world << "<span class='boldannounce'>Rebooting world!</span> <span class='adminnotice'>Initiated by [usr.client.holder.fakekey ? "Admin" : usr.key]!</span>"
log_admin("[key_name(usr)] initiated an immediate reboot.")
feedback_set_details("end_error","immediate admin reboot - by [usr.key] [usr.client.holder.fakekey ? "(stealth)" : ""]")
feedback_add_details("admin_verb","IR") //If you are copy-pasting this, ensure the 2nd parameter is unique to the new proc!
if(blackbox)
blackbox.save_all_data_to_sql()
world.Reboot()
/datum/admins/proc/unprison(var/mob/M in mob_list)
set category = "Admin"
set name = "Unprison"
-2
View File
@@ -97,7 +97,6 @@ var/list/admin_verbs_server = list(
/datum/admins/proc/delay,
/datum/admins/proc/toggleaban,
/client/proc/toggle_log_hrefs,
/datum/admins/proc/immreboot,
/client/proc/everyone_random,
/datum/admins/proc/toggleAI,
/client/proc/cmd_admin_delete, /*delete an instance/object/mob/etc*/
@@ -178,7 +177,6 @@ var/list/admin_verbs_hideable = list(
/datum/admins/proc/delay,
/datum/admins/proc/toggleaban,
/client/proc/toggle_log_hrefs,
/datum/admins/proc/immreboot,
/client/proc/everyone_random,
/datum/admins/proc/toggleAI,
/client/proc/restart_controller,
-17
View File
@@ -1716,28 +1716,13 @@
dirty_paths = href_list["object_list"]
var/paths = list()
var/removed_paths = list()
for(var/dirty_path in dirty_paths)
var/path = text2path(dirty_path)
if(!path)
removed_paths += dirty_path
continue
else if(!ispath(path, /obj) && !ispath(path, /turf) && !ispath(path, /mob))
removed_paths += dirty_path
continue
else if(ispath(path, /obj/item/weapon/gun/energy/pulse))
if(!check_rights(R_FUN,0))
removed_paths += dirty_path
continue
else if(ispath(path, /obj/item/weapon/melee/energy/blade))//Not an item one should be able to spawn./N
if(!check_rights(R_FUN,0))
removed_paths += dirty_path
continue
else if(ispath(path, /obj/effect/anomaly/bhole))
if(!check_rights(R_FUN,0))
removed_paths += dirty_path
continue
paths += path
if(!paths)
@@ -1746,8 +1731,6 @@
if(length(paths) > 5)
alert("Select fewer object types, (max 5)")
return
else if(length(removed_paths))
alert("Removed:\n" + list2text(removed_paths, "\n"))
var/list/offset = text2list(href_list["offset"],",")
var/number = dd_range(1, 100, text2num(href_list["object_count"]))
+21 -6
View File
@@ -134,8 +134,26 @@
C << "<span class='announce'>PR: [input["announce"]]</span>"
#undef CHAT_PULLR
/world/Reboot(var/reason)
#ifdef dellogging
/world/Reboot(var/reason, var/feedback_c, var/feedback_r, var/time)
var/delay
if(time)
delay = time
else
delay = ticker.restart_timeout
if(ticker.delay_end)
world << "<span class='boldannounce'>An admin has delayed the round end.</span>"
return
world << "<span class='boldannounce'>Rebooting World in [delay/10] [delay > 10 ? "seconds" : "second"]. [reason]</span>"
sleep(delay)
if(blackbox)
blackbox.save_all_data_to_sql()
if(ticker.delay_end)
world << "<span class='boldannounce'>Reboot was cancelled by an admin.</span>"
return
feedback_set_details("[feedback_c]","[feedback_r]")
log_game("<span class='boldannounce'>Rebooting World. [reason]</span>")
kick_clients_in_lobby("<span class='boldannounce'>The round came to an end with you in the lobby.</span>", 1) //second parameter ensures only afk clients are kicked
#ifdef dellogging
var/log = file("data/logs/del.log")
log << time2text(world.realtime)
//mergeSort(del_counter, /proc/cmp_descending_associative) //still testing the sorting procs. Use notepad++ to sort the resultant logfile for now.
@@ -149,14 +167,11 @@
world << sound(ticker.round_end_sound)
else
world << sound(pick('sound/AI/newroundsexy.ogg','sound/misc/apcdestroyed.ogg','sound/misc/bangindonk.ogg','sound/misc/leavingtg.ogg')) // random end sounds!! - LastyBatsy
for(var/client/C in clients)
if(config.server) //if you set a server location in config.txt, it sends you there instead of trying to reconnect to the same world address. -- NeoFite
C << link("byond://[config.server]")
// Note: all clients automatically connect to the world after it restarts
..(reason)
..(0)
/world/proc/load_mode()
+6
View File
@@ -0,0 +1,6 @@
author: Jordie0608
delete-after: True
changes:
- rscadd: "Admin-delaying the round now works once it has finished."