Files
vgstation13/code/controllers/verbs.dm
elly1989@rocketmail.com a10f6e0ec2 Added a switch inside client/Topic which can direct the topic call to a few frequently used destinations.
Before, when making a link to an admin tool, you done this:
<a href='?src=\ref[C.holder];parameter=1;>link</a>

Now, we do not need to use a reference to direct it to places like usr or usr.client.holder (or client, but you never needed src for that anyway)
usr: <a href='?_src_=usr;parameter=1;>link</a>
holder: <a href='?_src_=holder;parameter=1;>link</a>

This basically allows us to move a LOT of code outside of loops as we no longer have to create a \ref for every recipient of the message. They can all be sent identical links. A simple example of this would be in pray.dm Although it's most noticeable in the adminhelp code which is vastly simplified.

Adminhelp name spotting code thingy...whatever... looks for ckey matches first, then surnames, then forenames. This is to stop it possibly weirding out if there is a station full of "Ed"s of "Sarah"s

Prayer code no longer loads a new icon into memory every time a prayer is sent. Use image() not icon()!

key_name() no longer needs a reference for it's admin_link argument.

message_admin() pretty much doesn't need those extra arguments for finding and replacing %holder_ref%. I've got to go through all the code to check before I remove it though.

git-svn-id: http://tgstation13.googlecode.com/svn/trunk@5105 316c924e-a436-60f5-8080-3fe189b3f50e
2012-11-18 08:27:11 +00:00

79 lines
2.8 KiB
Plaintext

//TODO: rewrite and standardise all controller datums to the datum/controller type
//TODO: allow all controllers to be deleted for clean restarts (see WIP master controller stuff) - MC done - lighting done
/client/proc/restart_controller(controller in list("Master","Failsafe","Lighting","Supply Shuttle"))
set category = "Debug"
set name = "Restart Controller"
set desc = "Restart one of the various periodic loop controllers for the game (be careful!)"
if(!holder) return
usr = null
src = null
switch(controller)
if("Master")
new /datum/controller/game_controller()
master_controller.process()
feedback_add_details("admin_verb","RMC")
if("Failsafe")
new /datum/controller/failsafe()
feedback_add_details("admin_verb","RFailsafe")
if("Lighting")
new /datum/controller/lighting()
lighting_controller.process()
feedback_add_details("admin_verb","RLighting")
if("Supply Shuttle")
supply_shuttle.process()
feedback_add_details("admin_verb","RSupply")
message_admins("Admin [key_name_admin(usr)] has restarted the [controller] controller.")
return
/client/proc/debug_controller(controller in list("Master","Failsafe","Ticker","Lighting","Air","Jobs","Sun","Radio","Supply Shuttle","Emergency Shuttle","Configuration","pAI", "Cameras"))
set category = "Debug"
set name = "Debug Controller"
set desc = "Debug the various periodic loop controllers for the game (be careful!)"
if(!holder) return
switch(controller)
if("Master")
debug_variables(master_controller)
feedback_add_details("admin_verb","DMC")
if("Failsafe")
debug_variables(Failsafe)
feedback_add_details("admin_verb","DFailsafe")
if("Ticker")
debug_variables(ticker)
feedback_add_details("admin_verb","DTicker")
if("Lighting")
debug_variables(lighting_controller)
feedback_add_details("admin_verb","DLighting")
if("Air")
debug_variables(air_master)
feedback_add_details("admin_verb","DAir")
if("Jobs")
debug_variables(job_master)
feedback_add_details("admin_verb","DJobs")
if("Sun")
debug_variables(sun)
feedback_add_details("admin_verb","DSun")
if("Radio")
debug_variables(radio_controller)
feedback_add_details("admin_verb","DRadio")
if("Supply Shuttle")
debug_variables(supply_shuttle)
feedback_add_details("admin_verb","DSupply")
if("Emergency Shuttle")
debug_variables(emergency_shuttle)
feedback_add_details("admin_verb","DEmergency")
if("Configuration")
debug_variables(config)
feedback_add_details("admin_verb","DConf")
if("pAI")
debug_variables(paiController)
feedback_add_details("admin_verb","DpAI")
if("Cameras")
debug_variables(cameranet)
feedback_add_details("admin_verb","DCameras")
message_admins("Admin [key_name_admin(usr)] is debugging the [controller] controller.")
return