A healthy addition of debug verbs (#21843)

* A healthy addition of debug verbs

* Forgot some stuff

* SEANNNNNNNNNNN
This commit is contained in:
AffectedArc07
2023-07-29 08:58:22 +01:00
committed by GitHub
parent ed08e46fea
commit 7340fb0a65
4 changed files with 60 additions and 0 deletions
+2
View File
@@ -285,12 +285,14 @@ GLOBAL_LIST_INIT(admin_verbs_maintainer, list(
if(holder.rights & R_MAINTAINER)
verbs += GLOB.admin_verbs_maintainer
if(holder.rights & R_VIEWRUNTIMES)
// TODO - Make a viewruntimes list at this point - its getting silly
verbs += /client/proc/view_runtimes
verbs += /client/proc/cmd_display_del_log
verbs += /client/proc/cmd_display_del_log_simple
verbs += /client/proc/toggledebuglogs
verbs += /client/proc/debug_variables /*allows us to -see- the variables of any instance in the game. +VAREDIT needed to modify*/
verbs += /client/proc/ss_breakdown
verbs += /client/proc/show_gc_queues
spawn(1) // This setting exposes the profiler for people with R_VIEWRUNTIMES. They must still have it set in cfg/admin.txt
control_freak = 0
+46
View File
@@ -835,6 +835,52 @@ GLOBAL_PROTECT(AdminProcCallSpamPrevention)
usr << browse(dat, "window=simpledellog")
/client/proc/show_gc_queues()
set name = "View GC Queue"
set category = "Debug"
set desc = "Shows the list of whats currently in a GC queue"
if(!check_rights(R_DEBUG|R_VIEWRUNTIMES))
return
// Get the amount of queues
var/queue_count = length(SSgarbage.queues)
var/list/selectable_queues = list()
// Setup choices
for(var/i in 1 to queue_count)
selectable_queues["Queue #[i] ([length(SSgarbage.queues[i])] item\s)"] = i
// Ask the user
var/choice = input(usr, "Select a GC queue. Note that the queue lookup may lag the server.", "GC Queue") as null|anything in selectable_queues
if(!choice)
return
// Get our target
var/list/target_queue = SSgarbage.queues[selectable_queues[choice]]
var/list/queue_counts = list()
// Iterate that target and see whats what
for(var/queue_entry in target_queue)
var/datum/D = locate(queue_entry[1])
if(!istype(D))
continue
if(!queue_counts[D.type])
queue_counts[D.type] = 0
queue_counts[D.type]++
// Sort it the right way
var/list/sorted = sortTim(queue_counts, GLOBAL_PROC_REF(cmp_numeric_dsc), TRUE)
// And make a nice little menu
var/list/text = list("<h1>Current status of [choice]</h1>", "<ul>")
for(var/key in sorted)
text += "<li>[key] - [sorted[key]]</li>"
text += "</ul>"
usr << browse(text.Join(), "window=gcqueuestatus")
/client/proc/cmd_admin_toggle_block(mob/M, block)
if(!check_rights(R_SPAWN))
return