Files
Bubberstation/code/controllers/admin.dm
SkyratBot 84e42fd0eb [MIRROR] Removes some code soul (IF YOU ARE COPY PASTING THIS...), replaces it with a macro [MDB IGNORE] (#25272)
* Removes some code soul (`IF YOU ARE COPY PASTING THIS...`), replaces it with a macro (#79935)

## About The Pull Request

Replaces all instances of `SSblackbox.record_feedback\("tally",
"admin_verb", 1, (.+)\)` with `BLACKBOX_LOG_ADMIN_VERB($1)`

This makes so the funny comment isn't necessary.

It also reveals one location which someone did not heed the comment, the
`debug_controller` proc copy+pasted the line but did not change the
fourth argument. PEOPLE DON'T READ!

* Removes some code soul (`IF YOU ARE COPY PASTING THIS...`), replaces it with a macro

---------

Co-authored-by: MrMelbert <51863163+MrMelbert@users.noreply.github.com>
2023-11-27 01:02:37 -05:00

92 lines
2.5 KiB
Plaintext

// Clickable stat() button.
/obj/effect/statclick
name = "Initializing..."
blocks_emissive = EMISSIVE_BLOCK_NONE
var/target
INITIALIZE_IMMEDIATE(/obj/effect/statclick)
/obj/effect/statclick/Initialize(mapload, text, target)
. = ..()
name = text
src.target = target
if(isdatum(target)) //Harddel man bad
RegisterSignal(target, COMSIG_QDELETING, PROC_REF(cleanup))
/obj/effect/statclick/Destroy()
target = null
return ..()
/obj/effect/statclick/proc/cleanup()
SIGNAL_HANDLER
qdel(src)
/obj/effect/statclick/proc/update(text)
name = text
return src
/obj/effect/statclick/debug
var/class
/obj/effect/statclick/debug/Click()
if(!usr.client.holder || !target)
return
if(!class)
if(istype(target, /datum/controller/subsystem))
class = "subsystem"
else if(istype(target, /datum/controller))
class = "controller"
else if(isdatum(target))
class = "datum"
else
class = "unknown"
usr.client.debug_variables(target)
message_admins("Admin [key_name_admin(usr)] is debugging the [target] [class].")
// Debug verbs.
/client/proc/restart_controller(controller in list("Master", "Failsafe"))
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
switch(controller)
if("Master")
Recreate_MC()
BLACKBOX_LOG_ADMIN_VERB("Restart Master Controller")
if("Failsafe")
new /datum/controller/failsafe()
BLACKBOX_LOG_ADMIN_VERB("Restart Failsafe Controller")
message_admins("Admin [key_name_admin(usr)] has restarted the [controller] controller.")
/client/proc/debug_controller()
set category = "Debug"
set name = "Debug Controller"
set desc = "Debug the various periodic loop controllers for the game (be careful!)"
if(!holder)
return
var/list/controllers = list()
var/list/controller_choices = list()
for (var/datum/controller/controller in world)
if (istype(controller, /datum/controller/subsystem))
continue
controllers["[controller] (controller.type)"] = controller //we use an associated list to ensure clients can't hold references to controllers
controller_choices += "[controller] (controller.type)"
var/datum/controller/controller_string = input("Select controller to debug", "Debug Controller") as null|anything in controller_choices
var/datum/controller/controller = controllers[controller_string]
if (!istype(controller))
return
debug_variables(controller)
BLACKBOX_LOG_ADMIN_VERB("Debug Controller")
message_admins("Admin [key_name_admin(usr)] is debugging the [controller] controller.")