Configuration Controller (#7857)

This commit is contained in:
Selis
2024-04-05 07:44:20 +02:00
committed by GitHub
parent c542e3bac0
commit e1a987c25c
235 changed files with 3294 additions and 989 deletions
+2 -2
View File
@@ -473,10 +473,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))]" // CHOMPEdit
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]") // CHOMPEdit
+2 -2
View File
@@ -6,7 +6,7 @@ Reason: Replaced with "Tickets System"
*/
/datum/admin_help/proc/send2adminchat()
if(!config.chat_webhook_url)
if(!CONFIG_GET(string/chat_webhook_url)) // CHOMPEdit
return
var/list/adm = get_admin_counts()
@@ -20,7 +20,7 @@ Reason: Replaced with "Tickets System"
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]") // CHOMPEdit
/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)) // CHOMPEdit
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)) // CHOMPEdit
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)) // CHOMPEdit
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)) // CHOMPEdit
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)) // CHOMPEdit
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)) // CHOMPEdit
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)) // CHOMPEdit
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)) // CHOMPEdit
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)) // CHOMPEdit
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)) // CHOMPEdit
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 class='notice'>\The [I] does <b>[DPS]</b> damage per second.</span>")
if(DPS > 0)
to_chat(user, "<span class='notice'>At your maximum health ([user.getMaxHealth()]), it would take approximately;</span>")
to_chat(user, "<span class='notice'>[(user.getMaxHealth() - config.health_threshold_softcrit) / DPS] seconds to softcrit you. ([config.health_threshold_softcrit] health)</span>")
to_chat(user, "<span class='notice'>[(user.getMaxHealth() - config.health_threshold_crit) / DPS] seconds to hardcrit you. ([config.health_threshold_crit] health)</span>")
to_chat(user, "<span class='notice'>[(user.getMaxHealth() - config.health_threshold_dead) / DPS] seconds to kill you. ([config.health_threshold_dead] health)</span>")
to_chat(user, "<span class='notice'>[(user.getMaxHealth() - CONFIG_GET(number/health_threshold_softcrit)) / DPS] seconds to softcrit you. ([CONFIG_GET(number/health_threshold_softcrit)] health)</span>") // CHOMPEdit
to_chat(user, "<span class='notice'>[(user.getMaxHealth() - CONFIG_GET(number/health_threshold_crit)) / DPS] seconds to hardcrit you. ([CONFIG_GET(number/health_threshold_crit)] health)</span>") // CHOMPEdit
to_chat(user, "<span class='notice'>[(user.getMaxHealth() - CONFIG_GET(number/health_threshold_dead)) / DPS] seconds to kill you. ([CONFIG_GET(number/health_threshold_dead)] health)</span>") // CHOMPEdit
else
to_chat(user, "<span class='warning'>You need to be a living mob, with hands, and for an object to be in your active hand, to use this verb.</span>")
@@ -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)) // CHOMPEdit
log_admin("[key_name(src)] has turned aliens [CONFIG_GET(flag/aliens_allowed) ? "on" : "off"].") // CHOMPEdit
message_admins("[key_name_admin(src)] has turned aliens [CONFIG_GET(flag/aliens_allowed) ? "on" : "off"].", 0) // CHOMPEdit
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))) // CHOMPEdit
if(new_fps <= 0)
to_chat(src, "<span class='danger'>Error: set_server_fps(): Invalid world.fps value. No changes made.</span>")
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) // CHOMPEdit
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") // CHOMPEdit
return
var/msg = "[key_name(src)] has modified world.fps to [new_fps]"
+11 -11
View File
@@ -1,18 +1,18 @@
/client/proc/panicbunker()
set category = "Server"
set name = "Toggle Panic Bunker"
if(!check_rights(R_ADMIN))
return
if (!config.sql_enabled)
if (!CONFIG_GET(flag/sql_enabled)) // CHOMPEdit
to_chat(usr, "<span class='adminnotice'>The Database is not enabled!</span>")
return
config.panic_bunker = (!config.panic_bunker)
CONFIG_SET(flag/panic_bunker, !CONFIG_GET(flag/panic_bunker)) // CHOMPEdit
log_and_message_admins("[key_name(usr)] has toggled the Panic Bunker, it is now [(config.panic_bunker?"on":"off")].")
if (config.panic_bunker && (!SSdbcore.IsConnected())) //CHOMPEdit TGSQL
log_and_message_admins("[key_name(usr)] has toggled the Panic Bunker, it is now [(CONFIG_GET(flag/panic_bunker) ? "on" : "off")].") // CHOMPEdit
if (CONFIG_GET(flag/panic_bunker) && (!SSdbcore.IsConnected())) //CHOMPEdit TGSQL
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)) // CHOMPEdit
log_and_message_admins("[key_name(usr)] has toggled Paranoia Logging, it is now [(config.paranoia_logging?"on":"off")].")
if (config.paranoia_logging && (!SSdbcore.IsConnected())) //CHOMPEdit TGSQL
log_and_message_admins("[key_name(usr)] has toggled Paranoia Logging, it is now [(CONFIG_GET(flag/paranoia_logging) ? "on" : "off")].") // CHOMPEdit
if (CONFIG_GET(flag/paranoia_logging) && (!SSdbcore.IsConnected())) //CHOMPEdit TGSQL
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)) // CHOMPEdit
log_and_message_admins("[key_name(usr)] has toggled IP reputation checks, it is now [(config.ip_reputation?"on":"off")].")
if (config.ip_reputation && (!SSdbcore.IsConnected())) //CHOMPEdit TGSQL
log_and_message_admins("[key_name(usr)] has toggled IP reputation checks, it is now [(CONFIG_GET(flag/ip_reputation) ? "on" : "off")].") // CHOMPEdit
if (CONFIG_GET(flag/ip_reputation) && (!SSdbcore.IsConnected())) //CHOMPEdit TGSQL
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
@@ -117,7 +117,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) // CHOMPEdit
if(!ytdl)
to_chat(user, "<span class='boldwarning'>Youtube-dl was not configured, action unavailable</span>", confidential = TRUE) //Check config.txt for the INVOKE_YOUTUBEDL value
return
@@ -218,7 +218,7 @@ var/list/sounds_cache = list()
if(!check_rights(R_SOUNDS))
return
var/ytdl = config.invoke_youtubedl
var/ytdl = CONFIG_GET(string/invoke_youtubedl) // CHOMPEdit
if(!ytdl)
to_chat(src, "<span class='boldwarning'>Youtube-dl was not configured, action unavailable</span>", 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)) // CHOMPEdit
to_chat(usr, "It is forbidden to possess singularities.")
return
+11 -11
View File
@@ -172,7 +172,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)) // CHOMPEdit
return
else
if(!usr || !usr.client)
@@ -317,7 +317,7 @@ Ccomp's first proc.
return
var/action=""
if(config.antag_hud_allowed)
if(CONFIG_GET(flag/antag_hud_allowed)) // CHOMPEdit
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) //CHOMPEdit
@@ -325,7 +325,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_red("<B>The Administrator has disabled AntagHUD </B>"))
config.antag_hud_allowed = 0
CONFIG_SET(flag/antag_hud_allowed, FALSE) // CHOMPEdit
to_chat(src, span_red("<B>AntagHUD usage has been disabled</B>"))
action = "disabled"
else
@@ -333,7 +333,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) //CHOMPEdit
to_chat(g, span_blue("<B>The Administrator has enabled AntagHUD </B>")) // Notify all observers they can now use AntagHUD
config.antag_hud_allowed = 1
CONFIG_SET(flag/antag_hud_allowed, TRUE) // CHOMPEdit
action = "enabled"
to_chat(src, span_blue("<B>AntagHUD usage has been enabled</B>"))
@@ -352,11 +352,11 @@ Ccomp's first proc.
return
var/action=""
if(config.antag_hud_restricted)
if(CONFIG_GET(flag/antag_hud_restricted)) // CHOMPEdit
for(var/mob/observer/dead/g in get_ghosts())
to_chat(g, span_blue("<B>The administrator has lifted restrictions on joining the round if you use AntagHUD</B>"))
action = "lifted restrictions"
config.antag_hud_restricted = 0
CONFIG_SET(flag/antag_hud_restricted, FALSE) // CHOMPEdit
to_chat(src, span_blue("<B>AntagHUD restrictions have been lifted</B>"))
else
for(var/mob/observer/dead/g in get_ghosts())
@@ -365,7 +365,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) // CHOMPEdit
to_chat(src, span_red("<B>AntagHUD restrictions have been enabled</B>"))
log_admin("[key_name(usr)] has [action] on joining the round if they use AntagHUD")
@@ -628,7 +628,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)) // CHOMPEdit
M.revive()
log_admin("[key_name(usr)] healed / revived [key_name(M)]")
@@ -1021,12 +1021,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)) // CHOMPEdit
CONFIG_SET(flag/allow_random_events, TRUE) // CHOMPEdit
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) // CHOMPEdit
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!