]> git.smokeofanarchy.ru Git - space-station-14.git/commitdiff
added basic admin logs for PDA notekeeper notes (#34118)
authorDylan Hunter Whittingham <45404433+DylanWhittingham@users.noreply.github.com>
Thu, 2 Jan 2025 16:16:44 +0000 (16:16 +0000)
committerGitHub <noreply@github.com>
Thu, 2 Jan 2025 16:16:44 +0000 (17:16 +0100)
* added basic admin logs for PDA notekeeper notes

* formatting

* added new LogType 'PdaInteract' and changed PDA notekeeper logs to it

---------

Co-authored-by: dylanhunter <dylan2.whittingham@live.uwe.ac.uk>
Content.Server/CartridgeLoader/Cartridges/NotekeeperCartridgeSystem.cs
Content.Shared.Database/LogType.cs

index 287f68240241a859c7bdb3667e86c639afe27da1..1b77e63e5a99576da03ea952508630b064c9db58 100644 (file)
@@ -1,11 +1,14 @@
+using Content.Server.Administration.Logs;
 using Content.Shared.CartridgeLoader;
 using Content.Shared.CartridgeLoader.Cartridges;
+using Content.Shared.Database;
 
 namespace Content.Server.CartridgeLoader.Cartridges;
 
 public sealed class NotekeeperCartridgeSystem : EntitySystem
 {
     [Dependency] private readonly CartridgeLoaderSystem? _cartridgeLoaderSystem = default!;
+    [Dependency] private readonly IAdminLogManager _adminLogger = default!;
 
     public override void Initialize()
     {
@@ -36,16 +39,19 @@ public sealed class NotekeeperCartridgeSystem : EntitySystem
         if (message.Action == NotekeeperUiAction.Add)
         {
             component.Notes.Add(message.Note);
+            _adminLogger.Add(LogType.PdaInteract, LogImpact.Low,
+                $"{ToPrettyString(args.Actor)} added a note to PDA: '{message.Note}' contained on: {ToPrettyString(uid)}");
         }
         else
         {
             component.Notes.Remove(message.Note);
+            _adminLogger.Add(LogType.PdaInteract, LogImpact.Low,
+                $"{ToPrettyString(args.Actor)} removed a note from PDA: '{message.Note}' was contained on: {ToPrettyString(uid)}");
         }
 
         UpdateUiState(uid, GetEntity(args.LoaderUid), component);
     }
 
-
     private void UpdateUiState(EntityUid uid, EntityUid loaderUid, NotekeeperCartridgeComponent? component)
     {
         if (!Resolve(uid, ref component))
index dd5091fbcfd7d2b3adbbfb9a5f3eb34ec837c88b..1bbaa962231e45d13468e2bb5f89d953a62cd11e 100644 (file)
@@ -439,4 +439,9 @@ public enum LogType
     /// A ghost warped to an entity through the ghost warp menu.
     /// </summary>
     GhostWarp = 95,
+
+    /// <summary>
+    /// A player interacted with a PDA or its cartridge component
+    /// </summary>
+    PdaInteract = 96,
 }