diff --git a/code/datums/entities/player.dm b/code/datums/entities/player.dm index 3bf427c046f6..831f4a1fd8a5 100644 --- a/code/datums/entities/player.dm +++ b/code/datums/entities/player.dm @@ -316,9 +316,14 @@ BSQL_PROTECT_DATUM(/datum/entity/player) if(banner) permaban_admin_id = banner.id - log_and_message_admins("[key_name_admin(banner.owning_client)] has permanently banned [ckey] for '[reason]'.") - important_message_external("[banner.owning_client] has permanently banned [ckey] for '[reason]'.", "Permaban Placed") - important_message_external("[internal_reason]", "Permaban Reason") + message_admins("[key_name_admin(banner.owning_client)] has permanently banned [ckey] for '[reason]'.") + var/datum/tgs_chat_embed/field/reason + if(internal_reason) + reason = new() + reason.name = "Permaban Reason" + reason.value = internal_reason + important_message_external("[banner.owning_client] has permanently banned [ckey] for '[reason]'.", "Permaban Placed", list(reason)) + add_note("Permanently banned | [reason]", FALSE, NOTE_ADMIN, TRUE) if(internal_reason) add_note("Internal reason: [internal_reason]", TRUE, NOTE_ADMIN) diff --git a/code/defines/procs/admin.dm b/code/defines/procs/admin.dm index fd40bc947818..289d62e9314c 100644 --- a/code/defines/procs/admin.dm +++ b/code/defines/procs/admin.dm @@ -1,8 +1,4 @@ -/proc/log_and_message_admins(message as text) - log_admin("[key_name(usr)] [message]") - message_admins("[key_name(usr)] [message]") - -/proc/important_message_external(message, title) +/proc/important_message_external(message, title, list/datum/tgs_chat_embed/field/fields) if(CONFIG_GET(string/important_log_channel)) var/datum/tgs_message_content/to_send = new("") @@ -11,6 +7,7 @@ embed.description = message embed.timestamp = time2text(world.timeofday, "YYYY-MM-DD hh:mm:ss") embed.colour = "#ED2939" + embed.fields = fields to_send.embed = embed diff --git a/code/modules/admin/NewBan.dm b/code/modules/admin/NewBan.dm index ee9c533193ad..e0452ac024a5 100644 --- a/code/modules/admin/NewBan.dm +++ b/code/modules/admin/NewBan.dm @@ -322,6 +322,8 @@ GLOBAL_DATUM(Banlist, /savefile) SSstickyban.add_matched_ip(new_sticky.id, ip) log_admin("STICKYBAN: Identifier: [identifier] Reason: [reason] Message: [message] CKEYs: [english_list(impacted_ckeys)] IPs: [english_list(impacted_ips)] CIDs: [english_list(impacted_cids)]") - log_and_message_admins("[key_name_admin(src)] has added a new stickyban with the identifier '[identifier]'.") - important_message_external("[src] has added a new stickyban with the identifier '[identifier]'.", "Stickyban Placed") - important_message_external("[reason]", "Stickyban Reason") + message_admins("[key_name_admin(src)] has added a new stickyban with the identifier '[identifier]'.") + var/datum/tgs_chat_embed/field/reason = new() + reason.name = "Stickyban Reason" + reason.value = reason + important_message_external("[src] has added a new stickyban with the identifier '[identifier]'.", "Stickyban Placed", list(reason)) diff --git a/code/modules/admin/topic/topic.dm b/code/modules/admin/topic/topic.dm index fb9b0ee5d67a..03eb3c44cd45 100644 --- a/code/modules/admin/topic/topic.dm +++ b/code/modules/admin/topic/topic.dm @@ -244,7 +244,7 @@ unban_player.save() - log_and_message_admins("[key_name_admin(owner)] has removed the permanent ban on [unban_player.ckey].") + message_admins("[key_name_admin(owner)] has removed the permanent ban on [unban_player.ckey].") important_message_external("[owner] has removed the permanent ban on [unban_player.ckey].", "Permaban Removed") else if(href_list["sticky"]) @@ -324,7 +324,7 @@ return SSstickyban.whitelist_ckey(sticky.id, ckey_to_whitelist) - log_and_message_admins("[key_name_admin(owner)] has whitelisted [ckey_to_whitelist] against stickyban '[sticky.identifier]'.") + message_admins("[key_name_admin(owner)] has whitelisted [ckey_to_whitelist] against stickyban '[sticky.identifier]'.") important_message_external("[owner] has whitelisted [ckey_to_whitelist] against stickyban '[sticky.identifier]'.", "CKEY Whitelisted") if(href_list["add"]) @@ -344,7 +344,7 @@ if("IP") SSstickyban.add_matched_ip(sticky.id, to_add) - log_and_message_admins("[key_name_admin(owner)] has added a [option] ([to_add]) to stickyban '[sticky.identifier]'.") + message_admins("[key_name_admin(owner)] has added a [option] ([to_add]) to stickyban '[sticky.identifier]'.") important_message_external("[owner] has added a [option] ([to_add]) to stickyban '[sticky.identifier]'.", "[option] Added to Stickyban") if(href_list["remove"]) @@ -357,7 +357,7 @@ sticky.active = FALSE sticky.save() - log_and_message_admins("[key_name_admin(owner)] has deactivated stickyban '[sticky.identifier]'.") + message_admins("[key_name_admin(owner)] has deactivated stickyban '[sticky.identifier]'.") important_message_external("[owner] has deactivated stickyban '[sticky.identifier]'.", "Stickyban Deactivated") if("CID") @@ -378,7 +378,7 @@ var/datum/entity/stickyban_matched_cid/sticky_cid = DB_ENTITY(/datum/entity/stickyban_matched_cid, selected) sticky_cid.delete() - log_and_message_admins("[key_name_admin(owner)] has removed a CID ([picked]) from stickyban '[sticky.identifier]'.") + message_admins("[key_name_admin(owner)] has removed a CID ([picked]) from stickyban '[sticky.identifier]'.") important_message_external("[owner] has removed a CID ([picked]) from stickyban '[sticky.identifier]'.", "CID Removed from Stickyban") if("CKEY") @@ -399,7 +399,7 @@ var/datum/entity/stickyban_matched_ckey/sticky_ckey = DB_ENTITY(/datum/entity/stickyban_matched_ckey, selected) sticky_ckey.delete() - log_and_message_admins("[key_name_admin(owner)] has removed a CKEY ([picked]) from stickyban '[sticky.identifier]'.") + message_admins("[key_name_admin(owner)] has removed a CKEY ([picked]) from stickyban '[sticky.identifier]'.") important_message_external("[owner] has removed a CKEY ([picked]) from stickyban '[sticky.identifier]'.", "CKEY Removed from Stickyban") if("IP") @@ -420,7 +420,7 @@ var/datum/entity/stickyban_matched_ip/sticky_ip = DB_ENTITY(/datum/entity/stickyban_matched_ip, selected) sticky_ip.delete() - log_and_message_admins("[key_name_admin(owner)] has removed an IP ([picked]) from stickyban [sticky.identifier].") + message_admins("[key_name_admin(owner)] has removed an IP ([picked]) from stickyban [sticky.identifier].") important_message_external("[owner] has removed an IP ([picked]) from stickyban '[sticky.identifier].", "IP Removed from Stickyban") else if(href_list["warn"]) diff --git a/code/modules/admin/verbs/autoreplace.dm b/code/modules/admin/verbs/autoreplace.dm index b2fe04cfb4a3..a896c751f5ed 100644 --- a/code/modules/admin/verbs/autoreplace.dm +++ b/code/modules/admin/verbs/autoreplace.dm @@ -32,7 +32,7 @@ GLOBAL_LIST_INIT_TYPED(admin_runtime_decorators, /datum/decorator/manual/admin_r GLOB.admin_runtime_decorators.Add(SSdecorator.add_decorator(/datum/decorator/manual/admin_runtime, types, subtypes, field, value)) - log_and_message_admins("[src] activated new decorator id: [GLOB.admin_runtime_decorators.len] set for [hint_text] `[types]` for field `[field]` set value `[value]`") + message_admins("[src] activated new decorator id: [GLOB.admin_runtime_decorators.len] set for [hint_text] `[types]` for field `[field]` set value `[value]`") /client/proc/deactivate_autoreplacer() set category = "Admin.Events" @@ -49,7 +49,7 @@ GLOBAL_LIST_INIT_TYPED(admin_runtime_decorators, /datum/decorator/manual/admin_r GLOB.admin_runtime_decorators[num_value].enabled = FALSE - log_and_message_admins("[src] deactivated decorator id: [num_value]") + message_admins("[src] deactivated decorator id: [num_value]") /client/proc/rerun_decorators() set category = "Admin.Events" @@ -65,4 +65,4 @@ GLOBAL_LIST_INIT_TYPED(admin_runtime_decorators, /datum/decorator/manual/admin_r SSdecorator.force_update() - log_and_message_admins("[src] rerun all decorators.") + message_admins("[src] rerun all decorators.") diff --git a/code/modules/clans/client.dm b/code/modules/clans/client.dm index c4948b2a6923..3450b7553c51 100644 --- a/code/modules/clans/client.dm +++ b/code/modules/clans/client.dm @@ -234,7 +234,7 @@ return - log_and_message_admins("[key_name_admin(src)] has set the name of [target_clan.name] to [input].") + message_admins("[key_name_admin(src)] has set the name of [target_clan.name] to [input].") to_chat(src, SPAN_NOTICE("Set the name of [target_clan.name] to [input].")) target_clan.name = trim(input) @@ -247,7 +247,7 @@ if(!input || input == target_clan.description) return - log_and_message_admins("[key_name_admin(src)] has set the description of [target_clan.name].") + message_admins("[key_name_admin(src)] has set the description of [target_clan.name].") to_chat(src, SPAN_NOTICE("Set the description of [target_clan.name].")) target_clan.description = trim(input) @@ -261,7 +261,7 @@ return target_clan.color = color - log_and_message_admins("[key_name_admin(src)] has set the color of [target_clan.name] to [color].") + message_admins("[key_name_admin(src)] has set the color of [target_clan.name] to [color].") to_chat(src, SPAN_NOTICE("Set the name of [target_clan.name] to [color].")) if(CLAN_ACTION_CLAN_SETHONOR) if(!has_clan_permission(CLAN_PERMISSION_ADMIN_MANAGER)) @@ -272,7 +272,7 @@ if((!input && input != 0) || input == target_clan.honor) return - log_and_message_admins("[key_name_admin(src)] has set the honor of clan [target_clan.name] from [target_clan.honor] to [input].") + message_admins("[key_name_admin(src)] has set the honor of clan [target_clan.name] from [target_clan.honor] to [input].") to_chat(src, SPAN_NOTICE("Set the honor of [target_clan.name] from [target_clan.honor] to [input].")) target_clan.honor = input @@ -286,7 +286,7 @@ to_chat(src, "You have decided not to delete [target_clan.name].") return - log_and_message_admins("[key_name_admin(src)] has deleted the clan [target_clan.name].") + message_admins("[key_name_admin(src)] has deleted the clan [target_clan.name].") to_chat(src, SPAN_NOTICE("You have deleted [target_clan.name].")) var/list/datum/view_record/clan_playerbase_view/CPV = DB_VIEW(/datum/view_record/clan_playerbase_view, DB_COMP("clan_id", DB_EQUALS, target_clan.id)) @@ -339,7 +339,7 @@ return var/target_clan = target.clan_id - log_and_message_admins("[key_name_admin(src)] has purged [player_name]'s clan profile.") + message_admins("[key_name_admin(src)] has purged [player_name]'s clan profile.") to_chat(src, SPAN_NOTICE("You have purged [player_name]'s clan profile.")) target.delete() @@ -379,20 +379,20 @@ target.clan_id = null target.clan_rank = GLOB.clan_ranks_ordered[CLAN_RANK_YOUNG] to_chat(src, SPAN_NOTICE("Removed [player_name] from their clan.")) - log_and_message_admins("[key_name_admin(src)] has removed [player_name] from their current clan.") + message_admins("[key_name_admin(src)] has removed [player_name] from their current clan.") else if(input == "Remove from Ancient") target.clan_rank = GLOB.clan_ranks_ordered[CLAN_RANK_YOUNG] target.permissions = GLOB.clan_ranks[CLAN_RANK_YOUNG].permissions to_chat(src, SPAN_NOTICE("Removed [player_name] from ancient.")) - log_and_message_admins("[key_name_admin(src)] has removed [player_name] from ancient.") + message_admins("[key_name_admin(src)] has removed [player_name] from ancient.") else if(input == "Make Ancient" && is_clan_manager) target.clan_rank = GLOB.clan_ranks_ordered[CLAN_RANK_ADMIN] target.permissions = CLAN_PERMISSION_ADMIN_ANCIENT to_chat(src, SPAN_NOTICE("Made [player_name] an ancient.")) - log_and_message_admins("[key_name_admin(src)] has made [player_name] an ancient.") + message_admins("[key_name_admin(src)] has made [player_name] an ancient.") else to_chat(src, SPAN_NOTICE("Moved [player_name] to [input].")) - log_and_message_admins("[key_name_admin(src)] has moved [player_name] to clan [input].") + message_admins("[key_name_admin(src)] has moved [player_name] to clan [input].") target.clan_id = clans[input] @@ -455,7 +455,7 @@ target.clan_rank = GLOB.clan_ranks_ordered[chosen_rank.name] target.permissions = chosen_rank.permissions - log_and_message_admins("[key_name_admin(src)] has set the rank of [player_name] to [chosen_rank.name] for their clan.") + message_admins("[key_name_admin(src)] has set the rank of [player_name] to [chosen_rank.name] for their clan.") to_chat(src, SPAN_NOTICE("Set [player_name]'s rank to [chosen_rank.name]")) target.save() diff --git a/code/modules/mob/living/carbon/xenomorph/castes/Queen.dm b/code/modules/mob/living/carbon/xenomorph/castes/Queen.dm index 2e5c6a9112a3..d89e8572caff 100644 --- a/code/modules/mob/living/carbon/xenomorph/castes/Queen.dm +++ b/code/modules/mob/living/carbon/xenomorph/castes/Queen.dm @@ -595,7 +595,7 @@ xeno_announcement(input, hivenumber, "The words of the [name] reverberate in our head...") - log_and_message_admins("[key_name_admin(src)] has created a Word of the Queen report:") + message_admins("[key_name_admin(src)] has created a Word of the Queen report:") log_admin("[key_name_admin(src)] Word of the Queen: [input]") return TRUE