From ddaa0e83c6b055a0b2d162af7d2f04b8a6fec1c5 Mon Sep 17 00:00:00 2001 From: SlamBamActionman <83650252+SlamBamActionman@users.noreply.github.com> Date: Wed, 9 Oct 2024 13:55:48 +0200 Subject: [PATCH] Add admin log for codewords (#32531) * initial commit * Delta review --- Content.Server/GameTicking/Rules/TraitorRuleSystem.cs | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/Content.Server/GameTicking/Rules/TraitorRuleSystem.cs b/Content.Server/GameTicking/Rules/TraitorRuleSystem.cs index 4e4191a51b..56b652ed9a 100644 --- a/Content.Server/GameTicking/Rules/TraitorRuleSystem.cs +++ b/Content.Server/GameTicking/Rules/TraitorRuleSystem.cs @@ -1,3 +1,4 @@ +using Content.Server.Administration.Logs; using Content.Server.Antag; using Content.Server.GameTicking.Rules.Components; using Content.Server.Mind; @@ -5,6 +6,7 @@ using Content.Server.Objectives; using Content.Server.PDA.Ringer; using Content.Server.Roles; using Content.Server.Traitor.Uplink; +using Content.Shared.Database; using Content.Shared.GameTicking.Components; using Content.Shared.Mind; using Content.Shared.NPC.Systems; @@ -25,6 +27,7 @@ public sealed class TraitorRuleSystem : GameRuleSystem { private static readonly Color TraitorCodewordColor = Color.FromHex("#cc3b3b"); + [Dependency] private readonly IAdminLogManager _adminLogger = default!; [Dependency] private readonly IPrototypeManager _prototypeManager = default!; [Dependency] private readonly IRobustRandom _random = default!; [Dependency] private readonly NpcFactionSystem _npcFaction = default!; @@ -47,7 +50,7 @@ public sealed class TraitorRuleSystem : GameRuleSystem protected override void Added(EntityUid uid, TraitorRuleComponent component, GameRuleComponent gameRule, GameRuleAddedEvent args) { base.Added(uid, component, gameRule, args); - SetCodewords(component); + SetCodewords(component, args.RuleEntity); } private void AfterEntitySelected(Entity ent, ref AfterAntagEntitySelectedEvent args) @@ -55,9 +58,10 @@ public sealed class TraitorRuleSystem : GameRuleSystem MakeTraitor(args.EntityUid, ent); } - private void SetCodewords(TraitorRuleComponent component) + private void SetCodewords(TraitorRuleComponent component, EntityUid ruleEntity) { component.Codewords = GenerateTraitorCodewords(component); + _adminLogger.Add(LogType.EventStarted, LogImpact.Low, $"Codewords generated for game rule {ToPrettyString(ruleEntity)}: {string.Join(", ", component.Codewords)}"); } public string[] GenerateTraitorCodewords(TraitorRuleComponent component)