Adds a new admin/runtime verb that allows you to easily access global variables without lag (#22407)

* fuq yeah

* AA review
This commit is contained in:
Contrabang
2023-09-25 19:03:02 -04:00
committed by GitHub
parent 2c19219c40
commit 6118cc8f48
2 changed files with 41 additions and 11 deletions
+26
View File
@@ -1420,3 +1420,29 @@
if(href_list["listrefresh"])
debug_variables(locate(href_list["listrefresh"]))
return TRUE
/client/proc/debug_global_variables(var_search as text)
set category = "Debug"
set name = "Debug Global Variables"
if(!check_rights(R_ADMIN|R_VIEWRUNTIMES))
to_chat(usr, "<span class='warning'>You need to be an administrator to access this.</span>")
return
var_search = trim(var_search)
if(!var_search)
return
if(!GLOB.can_vv_get(var_search))
return
switch(var_search)
if("vars")
return FALSE
if(!(var_search in GLOB.vars))
to_chat(src, "<span class='debug'>GLOB.[var_search] does not exist.</span>")
return
log_and_message_admins("is debugging the Global Variables controller with the search term \"[var_search]\"")
var/result = GLOB.vars[var_search]
if(islist(result) || isclient(result) || istype(result, /datum))
to_chat(src, "<span class='debug'>Now showing GLOB.[var_search].</span>")
return debug_variables(result)
to_chat(src, "<span class='debug'>GLOB.[var_search] returned [result].</span>")