Files
Bubberstation/code/modules/admin/verbs/list_exposer.dm
T
807846f7d6 [MIRROR] Updates signaler investigate code | Adds some nice QOL changes for signalers | Enforces cooldown on signaler circuitry [MDB IGNORE] (#24500)
* Updates signaler investigate code | Adds some nice QOL changes for signalers | Enforces cooldown on signaler circuitry (#78974)

## About The Pull Request

See title.
If someone was abusing signalers previously to cause server lag, going
into list signalers would actually cause even worse lag as byond sat
there and processed thousands of items into a string over and over,
which would cause string format operations on longer and longer strings,
resulting in more and more overhead. This is bad.
So instead there is now a limit to the size of the list, currently I
have that set to 500 although I am open to increasing and even reducing
the number.

I have also made signalers slightly more intuitive by having the
cooldown actually displayed in the ui as a tooltip instead of just being
a secret feature you didnt know about unless you code dived. Also made
the cooldown actually respected by things such as circuitry where it
didnt even implement the cooldown and would happily send as many signals
as you had items connected to your proximity circuit.
## Why It's Good For The Game

Admins won't accidentally kill the server by trying to parse a lag
machines signal list. Players lagging the server? No, how about the
admins trying to fix it!

## Changelog

🆑
qol: signalers now tell you their cooldown and also use balloon alerts
/🆑

* Updates signaler investigate code | Adds some nice QOL changes for signalers | Enforces cooldown on signaler circuitry

---------

Co-authored-by: Zephyr <12817816+ZephyrTFA@users.noreply.github.com>
2023-10-21 18:20:44 -04:00

89 lines
3.4 KiB
Plaintext

// All the procs that admins can use to view something like a global list in a cleaner manner than just View Variables are contained in this file.
/datum/admins/proc/list_bombers()
if(!SSticker.HasRoundStarted())
tgui_alert(usr, "The game hasn't started yet!")
return
var/data = "<b>Bombing List</b><hr>"
for(var/entry in GLOB.bombers)
data += "[entry]<br>"
usr << browse(data, "window=bombers;size=800x500")
/datum/admins/proc/list_signalers()
if(!SSticker.HasRoundStarted())
tgui_alert(usr, "The game hasn't started yet!")
return
var/data = "<b>Showing last [length(GLOB.investigate_signaler)] signalers.</b><hr>"
for(var/entry in GLOB.investigate_signaler)
data += "[entry]<BR>"
usr << browse(data, "window=lastsignalers;size=800x500")
/datum/admins/proc/list_law_changes()
if(!SSticker.HasRoundStarted())
tgui_alert(usr, "The game hasn't started yet!")
return
var/data = "<b>Showing last [length(GLOB.lawchanges)] law changes.</b><hr>"
for(var/entry in GLOB.lawchanges)
data += "[entry]<BR>"
usr << browse(data, "window=lawchanges;size=800x500")
/datum/admins/proc/list_dna()
var/data = "<b>Showing DNA from blood.</b><hr>"
data += "<table cellspacing=5 border=1><tr><th>Name</th><th>DNA</th><th>Blood Type</th></tr>"
for(var/entry in GLOB.human_list)
var/mob/living/carbon/human/subject = entry
if(subject.ckey)
data += "<tr><td>[subject]</td><td>[subject.dna.unique_enzymes]</td><td>[subject.dna.blood_type]</td></tr>"
data += "</table>"
usr << browse(data, "window=DNA;size=440x410")
/datum/admins/proc/list_fingerprints() //kid named fingerprints
var/data = "<b>Showing Fingerprints.</b><hr>"
data += "<table cellspacing=5 border=1><tr><th>Name</th><th>Fingerprints</th></tr>"
for(var/entry in GLOB.human_list)
var/mob/living/carbon/human/subject = entry
if(subject.ckey)
data += "<tr><td>[subject]</td><td>[md5(subject.dna.unique_identity)]</td></tr>"
data += "</table>"
usr << browse(data, "window=fingerprints;size=440x410")
/datum/admins/proc/show_manifest()
if(!SSticker.HasRoundStarted())
tgui_alert(usr, "The game hasn't started yet!")
return
var/data = "<b>Showing Crew Manifest.</b><hr>"
data += "<table cellspacing=5 border=1><tr><th>Name</th><th>Position</th></tr>"
for(var/datum/record/crew/entry in GLOB.manifest.general)
data += "<tr><td>[entry.name]</td><td>[entry.rank][entry.rank != entry.trim ? " ([entry.trim])" : ""]</td></tr>"
data += "</table>"
usr << browse(data, "window=manifest;size=440x410")
/datum/admins/proc/output_ai_laws()
var/law_bound_entities = 0
for(var/mob/living/silicon/subject as anything in GLOB.silicon_mobs)
law_bound_entities++
var/message = ""
if(isAI(subject))
message += "<b>AI [key_name(subject, usr)]'s laws:</b>"
else if(iscyborg(subject))
var/mob/living/silicon/robot/borg = subject
message += "<b>CYBORG [key_name(subject, usr)] [borg.connected_ai?"(Slaved to: [key_name(borg.connected_ai)])":"(Independent)"]: laws:</b>"
else if (ispAI(subject))
message += "<b>pAI [key_name(subject, usr)]'s laws:</b>"
else
message += "<b>SOMETHING SILICON [key_name(subject, usr)]'s laws:</b>"
message += "<br>"
if (!subject.laws)
message += "[key_name(subject, usr)]'s laws are null?? Contact a coder."
else
message += jointext(subject.laws.get_law_list(include_zeroth = TRUE), "<br>")
to_chat(usr, message, confidential = TRUE)
if(!law_bound_entities)
to_chat(usr, "<b>No law bound entities located</b>", confidential = TRUE)