Ports over configuration controller (#16484)

* Ports over configuration controller

* Fixes

* Manual path fix

* patch (#16490)

* patch

* .

* SQL Fix

* Post-rebase fix

* Added missing examples

---------

Co-authored-by: Kashargul <144968721+Kashargul@users.noreply.github.com>
This commit is contained in:
Selis
2024-10-22 19:26:44 +02:00
committed by GitHub
parent 25d323e8a8
commit 242fa3a66b
242 changed files with 3275 additions and 1257 deletions
+2 -2
View File
@@ -435,10 +435,10 @@ GLOBAL_DATUM_INIT(ahelp_tickets, /datum/admin_help_tickets, new)
log_admin(msg)
AddInteraction("[key_name_admin(usr)] is now handling this ticket.")
var/query_string = "type=admintake"
query_string += "&key=[url_encode(config.chat_webhook_key)]"
query_string += "&key=[url_encode(CONFIG_GET(string/chat_webhook_key))]"
query_string += "&admin=[url_encode(key_name(usr))]"
query_string += "&user=[url_encode(key_name(initiator))]"
world.Export("[config.chat_webhook_url]?[query_string]")
world.Export("[CONFIG_GET(string/chat_webhook_url)]?[query_string]")
+3 -3
View File
@@ -1,5 +1,5 @@
/datum/admin_help/proc/send2adminchat()
if(!config.chat_webhook_url)
if(!CONFIG_GET(string/chat_webhook_url))
return
var/list/adm = get_admin_counts()
@@ -8,12 +8,12 @@
spawn(0) //Unreliable world.Exports()
var/query_string = "type=adminhelp"
query_string += "&key=[url_encode(config.chat_webhook_key)]"
query_string += "&key=[url_encode(CONFIG_GET(string/chat_webhook_key))]"
query_string += "&from=[url_encode(key_name(initiator))]"
query_string += "&msg=[url_encode(html_decode(name))]"
query_string += "&admin_number=[allmins.len]"
query_string += "&admin_number_afk=[afkmins.len]"
world.Export("[config.chat_webhook_url]?[query_string]")
world.Export("[CONFIG_GET(string/chat_webhook_url)]?[query_string]")
/client/verb/adminspice()
set category = "Admin"
+9 -9
View File
@@ -11,7 +11,7 @@
if(!check_rights(R_ADMIN|R_MOD|R_DEBUG|R_EVENT))
return
if(!config.allow_admin_jump)
if(!CONFIG_GET(flag/allow_admin_jump))
tgui_alert_async(usr, "Admin jumping disabled")
return
@@ -36,7 +36,7 @@
set category = "Admin"
if(!check_rights(R_ADMIN|R_MOD|R_DEBUG|R_EVENT))
return
if(config.allow_admin_jump)
if(CONFIG_GET(flag/allow_admin_jump))
log_admin("[key_name(usr)] jumped to [T.x],[T.y],[T.z] in [T.loc]")
message_admins("[key_name_admin(usr)] jumped to [T.x],[T.y],[T.z] in [T.loc]", 1)
usr.on_mob_jump()
@@ -59,7 +59,7 @@
/// Performs the jumps, also called from admin Topic() for JMP links
/client/proc/do_jumptomob(var/mob/M)
if(!config.allow_admin_jump)
if(!CONFIG_GET(flag/allow_admin_jump))
tgui_alert_async(usr, "Admin jumping disabled")
return
@@ -86,7 +86,7 @@
if(!check_rights(R_ADMIN|R_MOD|R_DEBUG|R_EVENT))
return
if (config.allow_admin_jump)
if (CONFIG_GET(flag/allow_admin_jump))
if(src.mob)
var/mob/A = src.mob
A.on_mob_jump()
@@ -108,7 +108,7 @@
if(!check_rights(R_ADMIN|R_MOD|R_DEBUG|R_EVENT))
return
if(config.allow_admin_jump)
if(CONFIG_GET(flag/allow_admin_jump))
var/list/keys = list()
for(var/mob/M in player_list)
keys += M.client
@@ -132,7 +132,7 @@
if(!check_rights(R_ADMIN|R_MOD|R_DEBUG|R_EVENT))
return
if(config.allow_admin_jump)
if(CONFIG_GET(flag/allow_admin_jump))
if(!M) //VOREStation Edit
M = tgui_input_list(usr, "Pick a mob:", "Get Mob", mob_list) //VOREStation Edit
if(!M)
@@ -155,7 +155,7 @@
if(!check_rights(R_ADMIN|R_MOD|R_DEBUG|R_EVENT))
return
if(config.allow_admin_jump)
if(CONFIG_GET(flag/allow_admin_jump))
var/list/keys = list()
for(var/mob/M in player_list)
keys += M.client
@@ -183,7 +183,7 @@
if(!check_rights(R_ADMIN|R_MOD|R_DEBUG|R_EVENT))
return
if(config.allow_admin_jump)
if(CONFIG_GET(flag/allow_admin_jump))
var/area/A = tgui_input_list(usr, "Pick an area:", "Send Mob", return_sorted_areas())
if(!A)
return
@@ -208,7 +208,7 @@
if(!check_rights(R_ADMIN|R_DEBUG|R_EVENT))
return
if(config.allow_admin_jump)
if(CONFIG_GET(flag/allow_admin_jump))
if(isnull(tx))
tx = tgui_input_number(usr, "Select X coordinate", "Move Atom", null, null)
if(!tx) return
+1 -1
View File
@@ -184,7 +184,7 @@
recipient << 'sound/effects/adminhelp.ogg'
//AdminPM popup for ApocStation and anybody else who wants to use it. Set it with POPUP_ADMIN_PM in config.txt ~Carn
if(config.popup_admin_pm)
if(CONFIG_GET(flag/popup_admin_pm))
spawn() //so we don't hold the caller proc up
var/sender = src
var/sendername = key
+6 -6
View File
@@ -64,9 +64,9 @@
to_chat(user, span_notice("\The [I] does <b>[DPS]</b> damage per second."))
if(DPS > 0)
to_chat(user, span_notice("At your maximum health ([user.getMaxHealth()]), it would take approximately;"))
to_chat(user, span_notice("[(user.getMaxHealth() - config.health_threshold_softcrit) / DPS] seconds to softcrit you. ([config.health_threshold_softcrit] health)"))
to_chat(user, span_notice("[(user.getMaxHealth() - config.health_threshold_crit) / DPS] seconds to hardcrit you. ([config.health_threshold_crit] health)"))
to_chat(user, span_notice("[(user.getMaxHealth() - config.health_threshold_dead) / DPS] seconds to kill you. ([config.health_threshold_dead] health)"))
to_chat(user, span_notice("[(user.getMaxHealth() - CONFIG_GET(number/health_threshold_softcrit)) / DPS] seconds to softcrit you. ([CONFIG_GET(number/health_threshold_softcrit)] health)"))
to_chat(user, span_notice("[(user.getMaxHealth() - CONFIG_GET(number/health_threshold_crit)) / DPS] seconds to hardcrit you. ([CONFIG_GET(number/health_threshold_crit)] health)"))
to_chat(user, span_notice("[(user.getMaxHealth() - CONFIG_GET(number/health_threshold_dead)) / DPS] seconds to kill you. ([CONFIG_GET(number/health_threshold_dead)] health)"))
else
to_chat(user, span_warning("You need to be a living mob, with hands, and for an object to be in your active hand, to use this verb."))
@@ -206,9 +206,9 @@
set category = "Server"
set name = "Toggle Aliens"
config.aliens_allowed = !config.aliens_allowed
log_admin("[key_name(src)] has turned aliens [config.aliens_allowed ? "on" : "off"].")
message_admins("[key_name_admin(src)] has turned aliens [config.aliens_allowed ? "on" : "off"].", 0)
CONFIG_SET(flag/aliens_allowed, !CONFIG_GET(flag/aliens_allowed))
log_admin("[key_name(src)] has turned aliens [CONFIG_GET(flag/aliens_allowed) ? "on" : "off"].")
message_admins("[key_name_admin(src)] has turned aliens [CONFIG_GET(flag/aliens_allowed) ? "on" : "off"].", 0)
feedback_add_details("admin_verb","TAL") //If you are copy-pasting this, ensure the 2nd parameter is unique to the new proc!
/client/proc/cmd_display_del_log()
+3 -3
View File
@@ -8,12 +8,12 @@
if(!check_rights(R_DEBUG))
return
var/new_fps = round(tgui_input_number(usr, "Sets game frames-per-second. Can potentially break the game (default: [config.fps])", "FPS", world.fps), round(config.fps * 1.5))
var/new_fps = round(tgui_input_number(usr, "Sets game frames-per-second. Can potentially break the game (default: [CONFIG_GET(number/fps)])", "FPS", world.fps), round(CONFIG_GET(number/fps) * 1.5))
if(new_fps <= 0)
to_chat(src, span_danger("Error: set_server_fps(): Invalid world.fps value. No changes made."))
return
if(new_fps > config.fps * 1.5)
if(tgui_alert(src, "You are setting fps to a high value:\n\t[new_fps] frames-per-second\n\tconfig.fps = [config.fps]", "Warning!", list("Confirm", "ABORT-ABORT-ABORT")) != "Confirm")
if(new_fps > CONFIG_GET(number/fps) * 1.5)
if(tgui_alert(src, "You are setting fps to a high value:\n\t[new_fps] frames-per-second\n\tconfig.fps = [CONFIG_GET(number/fps)]", "Warning!", list("Confirm", "ABORT-ABORT-ABORT")) != "Confirm")
return
var/msg = "[key_name(src)] has modified world.fps to [new_fps]"
+10 -10
View File
@@ -5,14 +5,14 @@
if(!check_rights(R_ADMIN))
return
if (!config.sql_enabled)
if (!CONFIG_GET(flag/sql_enabled))
to_chat(usr, span_adminnotice("The Database is not enabled!"))
return
config.panic_bunker = (!config.panic_bunker)
CONFIG_SET(flag/panic_bunker, !CONFIG_GET(flag/panic_bunker))
log_and_message_admins("[key_name(usr)] has toggled the Panic Bunker, it is now [(config.panic_bunker?"on":"off")].")
if (config.panic_bunker && (!dbcon || !dbcon.IsConnected()))
log_and_message_admins("[key_name(usr)] has toggled the Panic Bunker, it is now [(CONFIG_GET(flag/panic_bunker) ? "on":"off")].")
if (CONFIG_GET(flag/panic_bunker) && (!dbcon || !dbcon.IsConnected()))
message_admins("The database is not connected! Panic bunker will not work until the connection is reestablished.")
feedback_add_details("admin_verb","PANIC") //If you are copy-pasting this, ensure the 2nd parameter is unique to the new proc!
@@ -23,10 +23,10 @@
if(!check_rights(R_ADMIN))
return
config.paranoia_logging = (!config.paranoia_logging)
CONFIG_SET(flag/paranoia_logging, !CONFIG_GET(flag/paranoia_logging))
log_and_message_admins("[key_name(usr)] has toggled Paranoia Logging, it is now [(config.paranoia_logging?"on":"off")].")
if (config.paranoia_logging && (!dbcon || !dbcon.IsConnected()))
log_and_message_admins("[key_name(usr)] has toggled Paranoia Logging, it is now [(CONFIG_GET(flag/paranoia_logging) ? "on":"off")].")
if (CONFIG_GET(flag/paranoia_logging) && (!dbcon || !dbcon.IsConnected()))
message_admins("The database is not connected! Paranoia logging will not be able to give 'player age' (time since first connection) warnings, only Byond account warnings.")
feedback_add_details("admin_verb","PARLOG") //If you are copy-pasting this, ensure the 2nd parameter is unique to the new proc!
@@ -37,9 +37,9 @@
if(!check_rights(R_ADMIN))
return
config.ip_reputation = (!config.ip_reputation)
CONFIG_SET(flag/ip_reputation, !CONFIG_GET(flag/ip_reputation))
log_and_message_admins("[key_name(usr)] has toggled IP reputation checks, it is now [(config.ip_reputation?"on":"off")].")
if (config.ip_reputation && (!dbcon || !dbcon.IsConnected()))
log_and_message_admins("[key_name(usr)] has toggled IP reputation checks, it is now [(CONFIG_GET(flag/ip_reputation) ? "on":"off")].")
if (CONFIG_GET(flag/ip_reputation) && (!dbcon || !dbcon.IsConnected()))
message_admins("The database is not connected! IP reputation logging will not be able to allow existing players to bypass the reputation checks (if that is enabled).")
feedback_add_details("admin_verb","IPREP") //If you are copy-pasting this, ensure the 2nd parameter is unique to the new proc!
+2 -2
View File
@@ -119,7 +119,7 @@ var/list/sounds_cache = list()
/proc/web_sound(mob/user, input, credit)
if(!check_rights(R_SOUNDS))
return
var/ytdl = config.invoke_youtubedl
var/ytdl = CONFIG_GET(string/invoke_youtubedl)
if(!ytdl)
to_chat(user, span_boldwarning("Youtube-dl was not configured, action unavailable"), confidential = TRUE) //Check config.txt for the INVOKE_YOUTUBEDL value
return
@@ -220,7 +220,7 @@ var/list/sounds_cache = list()
if(!check_rights(R_SOUNDS))
return
var/ytdl = config.invoke_youtubedl
var/ytdl = CONFIG_GET(string/invoke_youtubedl)
if(!ytdl)
to_chat(src, span_boldwarning("Youtube-dl was not configured, action unavailable"), confidential = TRUE) //Check config.txt for the INVOKE_YOUTUBEDL value
return
+1 -1
View File
@@ -3,7 +3,7 @@
set category = "Object"
if(istype(O,/obj/singularity))
if(config.forbid_singulo_possession)
if(CONFIG_GET(flag/forbid_singulo_possession))
to_chat(usr, "It is forbidden to possess singularities.")
return
+11 -11
View File
@@ -173,7 +173,7 @@
/proc/cmd_admin_mute(mob/M as mob, mute_type, automute = 0)
if(automute)
if(!config.automute_on)
if(!CONFIG_GET(flag/automute_on))
return
else
if(!usr || !usr.client)
@@ -321,7 +321,7 @@ Ccomp's first proc.
return
var/action=""
if(config.antag_hud_allowed)
if(CONFIG_GET(flag/antag_hud_allowed))
for(var/mob/observer/dead/g in get_ghosts())
if(!g.client.holder) //Remove the verb from non-admin ghosts
remove_verb(g, /mob/observer/dead/verb/toggle_antagHUD)
@@ -329,7 +329,7 @@ Ccomp's first proc.
g.antagHUD = 0 // Disable it on those that have it enabled
g.has_enabled_antagHUD = 2 // We'll allow them to respawn
to_chat(g, span_boldwarning("The Administrator has disabled AntagHUD "))
config.antag_hud_allowed = 0
CONFIG_SET(flag/antag_hud_allowed, FALSE)
to_chat(src, span_boldwarning("AntagHUD usage has been disabled"))
action = "disabled"
else
@@ -337,7 +337,7 @@ Ccomp's first proc.
if(!g.client.holder) // Add the verb back for all non-admin ghosts
add_verb(g, /mob/observer/dead/verb/toggle_antagHUD)
to_chat(g, span_boldnotice("The Administrator has enabled AntagHUD")) // Notify all observers they can now use AntagHUD
config.antag_hud_allowed = 1
CONFIG_SET(flag/antag_hud_allowed, TRUE)
action = "enabled"
to_chat(src, span_boldnotice("AntagHUD usage has been enabled"))
@@ -356,11 +356,11 @@ Ccomp's first proc.
return
var/action=""
if(config.antag_hud_restricted)
if(CONFIG_GET(flag/antag_hud_restricted))
for(var/mob/observer/dead/g in get_ghosts())
to_chat(g, span_boldnotice("The administrator has lifted restrictions on joining the round if you use AntagHUD"))
action = "lifted restrictions"
config.antag_hud_restricted = 0
CONFIG_SET(flag/antag_hud_restricted, FALSE)
to_chat(src, span_boldnotice("AntagHUD restrictions have been lifted"))
else
for(var/mob/observer/dead/g in get_ghosts())
@@ -369,7 +369,7 @@ Ccomp's first proc.
g.antagHUD = 0
g.has_enabled_antagHUD = 0
action = "placed restrictions"
config.antag_hud_restricted = 1
CONFIG_SET(flag/antag_hud_restricted, TRUE)
to_chat(src, span_boldwarning("AntagHUD restrictions have been enabled"))
log_admin("[key_name(usr)] has [action] on joining the round if they use AntagHUD")
@@ -634,7 +634,7 @@ Traitors and the like can also be revived with the previous role mostly intact.
if(!istype(M))
tgui_alert_async(usr, "Cannot revive a ghost")
return
if(config.allow_admin_rev)
if(CONFIG_GET(flag/allow_admin_rev))
M.revive()
log_admin("[key_name(usr)] healed / revived [key_name(M)]")
@@ -1029,12 +1029,12 @@ Traitors and the like can also be revived with the previous role mostly intact.
if(!check_rights(R_SERVER)) return //VOREStation Edit
if(!config.allow_random_events)
config.allow_random_events = 1
if(!CONFIG_GET(flag/allow_random_events))
CONFIG_SET(flag/allow_random_events, TRUE)
to_chat(usr, "Random events enabled")
message_admins("Admin [key_name_admin(usr)] has enabled random events.", 1)
else
config.allow_random_events = 0
CONFIG_SET(flag/allow_random_events, FALSE)
to_chat(usr, "Random events disabled")
message_admins("Admin [key_name_admin(usr)] has disabled random events.", 1)
feedback_add_details("admin_verb","TRE") //If you are copy-pasting this, ensure the 2nd parameter is unique to the new proc!