diff --git a/code/modules/admin/admin_verbs.dm b/code/modules/admin/admin_verbs.dm index 939b9c44321..d678325ce80 100644 --- a/code/modules/admin/admin_verbs.dm +++ b/code/modules/admin/admin_verbs.dm @@ -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, diff --git a/code/modules/admin/verbs/SDQL2/SDQL_2.dm b/code/modules/admin/verbs/SDQL2/SDQL_2.dm index 61568f741ef..63618c4a2ea 100644 --- a/code/modules/admin/verbs/SDQL2/SDQL_2.dm +++ b/code/modules/admin/verbs/SDQL2/SDQL_2.dm @@ -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("ERROR: Non-admin [key_name_admin(usr)] attempted to execute an SDQL query!") + 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) diff --git a/code/modules/admin/verbs/SDQL2/sdql2_verbs.dm b/code/modules/admin/verbs/SDQL2/sdql2_verbs.dm new file mode 100644 index 00000000000..4fb2ecad4c7 --- /dev/null +++ b/code/modules/admin/verbs/SDQL2/sdql2_verbs.dm @@ -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) diff --git a/paradise.dme b/paradise.dme index 5cab04f7157..f82b6593c29 100644 --- a/paradise.dme +++ b/paradise.dme @@ -1599,6 +1599,7 @@ #include "code\modules\admin\verbs\toggledebugverbs.dm" #include "code\modules\admin\verbs\tripAI.dm" #include "code\modules\admin\verbs\view_instances.dm" +#include "code\modules\admin\verbs\SDQL2\sdql2_verbs.dm" #include "code\modules\admin\verbs\SDQL2\SDQL_2.dm" #include "code\modules\admin\verbs\SDQL2\SDQL_2_parser.dm" #include "code\modules\admin\verbs\SDQL2\useful_procs.dm"