support running saved sdql scripts (#29480)

* support running saved sdql scripts

* Update code/modules/admin/verbs/SDQL2/SDQL_2.dm

Co-authored-by: AffectedArc07 <25063394+AffectedArc07@users.noreply.github.com>
Signed-off-by: warriorstar-orion <orion@snowfrost.garden>

---------

Signed-off-by: warriorstar-orion <orion@snowfrost.garden>
Co-authored-by: AffectedArc07 <25063394+AffectedArc07@users.noreply.github.com>
This commit is contained in:
warriorstar-orion
2025-06-03 17:23:38 -04:00
committed by GitHub
parent 0bd0b6d800
commit 72a4ec7dc9
4 changed files with 30 additions and 1 deletions
+2 -1
View File
@@ -240,7 +240,8 @@ GLOBAL_LIST_INIT(admin_verbs_dev, list(
GLOBAL_LIST_INIT(admin_verbs_proccall, list(
/client/proc/callproc,
/client/proc/callproc_datum,
/client/proc/SDQL2_query
/client/proc/SDQL2_query,
/client/proc/load_sdql2_query,
))
GLOBAL_LIST_INIT(admin_verbs_ticket, list(
/client/proc/openAdminTicketUI,
+8
View File
@@ -28,6 +28,14 @@
if(!query_text || length(query_text) < 1)
return
run_sdql2_query(query_text)
/client/proc/run_sdql2_query(query_text)
if(!check_rights(R_PROCCALL)) //Shouldn't happen... but just to be safe.
message_admins("<span class='danger'>ERROR: Non-admin [key_name_admin(usr)] attempted to execute an SDQL query!</span>")
log_admin("Non-admin [key_name(usr)] attempted to execute an SDQL query: [query_text]")
return
// to_chat(world, query_text)
var/list/query_list = SDQL2_tokenize(query_text)
@@ -0,0 +1,19 @@
/client/proc/load_sdql2_query()
set category = "Debug"
set name = "Load SDQL2 Query"
if(!check_rights(R_PROCCALL))
return
var/list/choices = flist("data/sdql/")
var/choice = input(src, "Choose an SDQL script to run:", "Load SDQL Query", null) as null|anything in choices
if(isnull(choice))
return
var/script_text = return_file_text("data/sdql/[choice]")
script_text = input(usr, "SDQL2 query", "", script_text) as message
if(!script_text || length(script_text) < 1)
return
run_sdql2_query(script_text)