From f7bef32db9f5f864aa410e9a370dda705aada8d8 Mon Sep 17 00:00:00 2001 From: CHOMPStation2StaffMirrorBot <94713762+CHOMPStation2StaffMirrorBot@users.noreply.github.com> Date: Fri, 15 Aug 2025 20:31:27 -0700 Subject: [PATCH] [MIRROR] Cleans up some unticked dm files (#11438) Co-authored-by: Selis <12716288+ItsSelis@users.noreply.github.com> --- code/__defines/art.dm | 5 ----- code/_global_vars/_regexes.dm | 3 +++ code/_helpers/chat.dm | 14 ++++++++++++++ code/controllers/subsystems/ticker.dm | 4 +--- code/game/gamemodes/game_mode.dm | 2 +- code/modules/admin/verbs/adminpm.dm | 1 - code/modules/client/client procs.dm | 10 ---------- code/modules/ext_scripts/github.dm | 0 code/modules/mob/logout.dm | 7 ++----- code/modules/tickets/procs.dm | 2 +- code/modules/tickets/tickets.dm | 4 ++-- vorestation.dme | 3 +-- 12 files changed, 25 insertions(+), 30 deletions(-) delete mode 100644 code/__defines/art.dm create mode 100644 code/_helpers/chat.dm delete mode 100644 code/modules/ext_scripts/github.dm diff --git a/code/__defines/art.dm b/code/__defines/art.dm deleted file mode 100644 index 473f7f3565..0000000000 --- a/code/__defines/art.dm +++ /dev/null @@ -1,5 +0,0 @@ - -///tgui tab portrait categories- they're the same across all portrait tguis. -#define TAB_LIBRARY 1 -#define TAB_SECURE 2 -#define TAB_PRIVATE 3 diff --git a/code/_global_vars/_regexes.dm b/code/_global_vars/_regexes.dm index 336706fc46..cf5995f699 100644 --- a/code/_global_vars/_regexes.dm +++ b/code/_global_vars/_regexes.dm @@ -3,6 +3,9 @@ GLOBAL_DATUM_INIT(is_http_protocol, /regex, regex("^https?://")) GLOBAL_DATUM_INIT(is_valid_url, /regex, regex("((?:https://)\[-a-zA-Z0-9@:%._+~#=]{1,256}.\[-a-zA-Z0-9@:%._+~#=]{1,256}\\b(?:\[-a-zA-Z0-9@():%_+.,~#?&/=]*\[^.,!?:; ()<>{}\\[]\n\"'ยด`]))", "gm")) +//finds text strings recognized as links on discord. Mainly used to stop embedding. +GLOBAL_DATUM_INIT(has_discord_embeddable_links, /regex, regex("(https?://\[^\\s|<\]{2,})")) + //All < and > characters GLOBAL_DATUM_INIT(angular_brackets, /regex, regex(@"[<>]", "g")) diff --git a/code/_helpers/chat.dm b/code/_helpers/chat.dm new file mode 100644 index 0000000000..dbb124b950 --- /dev/null +++ b/code/_helpers/chat.dm @@ -0,0 +1,14 @@ +/** + * Asynchronously sends a message to TGS admin chat channels. + * + * category - The category of the mssage. + * message - The message to send. + */ +/proc/send2adminchat(category, message, embed_links = FALSE) + set waitfor = FALSE + + category = replacetext(replacetext(category, "\proper", ""), "\improper", "") + message = replacetext(replacetext(message, "\proper", ""), "\improper", "") + if(!embed_links) + message = GLOB.has_discord_embeddable_links.Replace(replacetext(message, "`", ""), " ```$1``` ") + world.TgsTargetedChatBroadcast(new /datum/tgs_message_content("[category] | [message]"), TRUE) diff --git a/code/controllers/subsystems/ticker.dm b/code/controllers/subsystems/ticker.dm index 8283b4885c..012ebb6034 100644 --- a/code/controllers/subsystems/ticker.dm +++ b/code/controllers/subsystems/ticker.dm @@ -235,9 +235,7 @@ SUBSYSTEM_DEF(ticker) var/list/adm = get_admin_counts() var/list/allmins = adm["present"] - // TODO: IMPLEMENT: send2adminchat("Server", "Round [GLOB.round_id ? "#[GLOB.round_id]" : ""] has started[allmins.len ? ".":" with no active admins online!"]") - if(!allmins.len) - send2adminirc("A round has started with no admins online.") + send2adminchat("Server", "Round [GLOB.round_id ? "#[GLOB.round_id]" : ""] has started[allmins.len ? ".":" with no active admins online!"]") setup_done = TRUE // TODO START diff --git a/code/game/gamemodes/game_mode.dm b/code/game/gamemodes/game_mode.dm index 34da4a837d..1cf79e512b 100644 --- a/code/game/gamemodes/game_mode.dm +++ b/code/game/gamemodes/game_mode.dm @@ -397,7 +397,7 @@ GLOBAL_LIST_EMPTY(additional_antag_types) if(escaped_on_cryopod > 0) //CHOMP Add feedback_set("escaped_on_cryopod",escaped_on_cryopod) - send2mainirc("A round of [src.name] has ended - [surviving_total] survivors, [ghosts] ghosts.") + // send2mainirc("A round of [src.name] has ended - [surviving_total] survivors, [ghosts] ghosts.") SSwebhooks.send( WEBHOOK_ROUNDEND, list( diff --git a/code/modules/admin/verbs/adminpm.dm b/code/modules/admin/verbs/adminpm.dm index 417a9ae73f..b0373e7859 100644 --- a/code/modules/admin/verbs/adminpm.dm +++ b/code/modules/admin/verbs/adminpm.dm @@ -145,7 +145,6 @@ to_chat(src, span_admin_pm_notice("PM to-" + span_bold("Admins") + ": [rawmsg]")) admin_ticket_log(src, span_admin_pm_warning("Reply PM from-" + span_bold("[key_name(src, TRUE, TRUE)]") + " to " + span_italics("IRC") + ": [keywordparsedmsg]")) ircreplyamount-- - send2irc("Reply: [ckey]",rawmsg) else if(recipient.holder) if(holder) //both are admins diff --git a/code/modules/client/client procs.dm b/code/modules/client/client procs.dm index 0e34a1bf2d..3bdc95db51 100644 --- a/code/modules/client/client procs.dm +++ b/code/modules/client/client procs.dm @@ -112,16 +112,6 @@ cmd_mentor_pm(C, null) return - if(href_list["irc_msg"]) - if(!check_rights_for(src, R_HOLDER) && received_irc_pm < world.time - 6000) //Worse they can do is spam IRC for 10 minutes - to_chat(src, span_warning("You are no longer able to use this, it's been more than 10 minutes since an admin on IRC has responded to you")) - return - if(mute_irc) - to_chat(usr, span_warning("You cannot use this as your client has been muted from sending messages to the admins on IRC")) - return - send2adminirc(href_list["irc_msg"]) - return - //VOREStation Add if(href_list["discord_reg"]) var/their_id = html_decode(href_list["discord_reg"]) diff --git a/code/modules/ext_scripts/github.dm b/code/modules/ext_scripts/github.dm deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/code/modules/mob/logout.dm b/code/modules/mob/logout.dm index c1a1a9ca81..1f7e49f67f 100644 --- a/code/modules/mob/logout.dm +++ b/code/modules/mob/logout.dm @@ -6,15 +6,12 @@ update_client_z(null) log_access_out(src) unset_machine() + var/datum/admins/is_admin = GLOB.admin_datums[src.ckey] if(is_admin && is_admin.check_for_rights(R_HOLDER)) message_admins("Staff logout: [key_name(src)]") // Staff logout notice displays no matter what - if (SSticker && SSticker.current_state == GAME_STATE_PLAYING) //Only report this stuff if we are currently playing. - var/admins_number = GLOB.admins.len - if(admins_number == 0) //Apparently the admin logging out is no longer an admin at this point, so we have to check this towards 0 and not towards 1. Awell. - send2adminirc("[key_name(src)] logged out - no more admins online.") set_listening(NON_LISTENING_ATOM) //maybe remove this, even if it will cause a teensy bit more lag ..() - return 1 + return TRUE diff --git a/code/modules/tickets/procs.dm b/code/modules/tickets/procs.dm index 071f0d7b79..b288fbcc19 100644 --- a/code/modules/tickets/procs.dm +++ b/code/modules/tickets/procs.dm @@ -144,7 +144,7 @@ ADMIN_VERB(cmd_mentor_ticket_panel, (R_ADMIN|R_SERVER|R_MOD|R_MENTOR), "Mentor T //// VOREstation Additions Below -/datum/ticket/proc/send2adminchat() +/datum/ticket/proc/send2adminchatwebhook() if(!CONFIG_GET(string/chat_webhook_url)) return diff --git a/code/modules/tickets/tickets.dm b/code/modules/tickets/tickets.dm index 788de9810d..89b1616168 100644 --- a/code/modules/tickets/tickets.dm +++ b/code/modules/tickets/tickets.dm @@ -315,7 +315,7 @@ INITIALIZE_IMMEDIATE(/obj/effect/statclick/ticket_list) log_admin("Ticket #[id]: [key_name(initiator)]: [name] - heard by [admin_number_present] non-AFK admins who have +BAN.") if(admin_number_present <= 0) to_chat(C, span_notice("No active admins are online, your adminhelp was sent to the admin discord.")) - send2adminchat() + send2adminchatwebhook() var/list/adm = get_admin_counts() var/list/activemins = adm["present"] @@ -790,7 +790,7 @@ INITIALIZE_IMMEDIATE(/obj/effect/statclick/ticket) final = "[msg] - No admins online" else final = "[msg] - All admins stealthed\[[english_list(stealthmins)]\], AFK\[[english_list(afkmins)]\], or lacks +BAN\[[english_list(powerlessmins)]\]! Total: [allmins.len] " - send2irc(source,final) + // send2irc(source,final) /proc/ircadminwho() var/list/message = list("Admins: ") diff --git a/vorestation.dme b/vorestation.dme index d699bd4237..a48fcd390b 100644 --- a/vorestation.dme +++ b/vorestation.dme @@ -262,6 +262,7 @@ #include "code\_helpers\announcements.dm" #include "code\_helpers\atmospherics.dm" #include "code\_helpers\atom_movables.dm" +#include "code\_helpers\chat.dm" #include "code\_helpers\datums.dm" #include "code\_helpers\distance_ch.dm" #include "code\_helpers\events.dm" @@ -2768,8 +2769,6 @@ #include "code\modules\examine\descriptions\telecomms.dm" #include "code\modules\examine\descriptions\turfs.dm" #include "code\modules\examine\descriptions\weapons.dm" -#include "code\modules\ext_scripts\irc.dm" -#include "code\modules\ext_scripts\python.dm" #include "code\modules\fireworks\firework_launcher.dm" #include "code\modules\fireworks\firework_stars.dm" #include "code\modules\fireworks\launcher_construction.dm"