]> git.smokeofanarchy.ru Git - space-station-14.git/commitdiff
Logging for turret controller (#40884)
authorOnyxTheBrave <131422822+OnyxTheBrave@users.noreply.github.com>
Tue, 14 Oct 2025 23:30:27 +0000 (18:30 -0500)
committerGitHub <noreply@github.com>
Tue, 14 Oct 2025 23:30:27 +0000 (23:30 +0000)
* Logging for turret controller

* Wording

* MEDIUM

* changed to use ItemConfigure

Content.Server/TurretController/DeployableTurretControllerSystem.cs

index f0b68814311daf114acc7d79cbda1d984548075f..fbb802b6796b79ac23b54870c786a95ffd4dc458 100644 (file)
@@ -9,6 +9,8 @@ using Content.Shared.Turrets;
 using Robust.Server.GameObjects;
 using Robust.Shared.Prototypes;
 using System.Linq;
+using Content.Server.Administration.Logs;
+using Content.Shared.Database;
 
 namespace Content.Server.TurretController;
 
@@ -17,6 +19,7 @@ public sealed partial class DeployableTurretControllerSystem : SharedDeployableT
 {
     [Dependency] private readonly UserInterfaceSystem _userInterfaceSystem = default!;
     [Dependency] private readonly DeviceNetworkSystem _deviceNetwork = default!;
+    [Dependency] private readonly IAdminLogManager _adminLogger = default!;
 
     /// Keys for the device network. See <see cref="DeviceNetworkConstants"/> for further examples.
     public const string CmdSetArmamemtState = "set_armament_state";
@@ -109,6 +112,8 @@ public sealed partial class DeployableTurretControllerSystem : SharedDeployableT
             [CmdSetArmamemtState] = armamentState,
         };
 
+        _adminLogger.Add(LogType.ItemConfigure, LogImpact.Medium, $"{ToPrettyString(user)} set {ToPrettyString(ent)} to {armamentState}");
+
         _deviceNetwork.QueuePacket(ent, null, payload, device: device);
     }
 
@@ -132,6 +137,11 @@ public sealed partial class DeployableTurretControllerSystem : SharedDeployableT
             [CmdSetAccessExemptions] = turretTargetingSettings.ExemptAccessLevels,
         };
 
+        foreach (var exemption in exemptions)
+        {
+            _adminLogger.Add(LogType.ItemConfigure, LogImpact.Medium, $"{ToPrettyString(user)} set {ToPrettyString(ent)} authorization of {exemption} to {enabled}");
+        }
+
         _deviceNetwork.QueuePacket(ent, null, payload, device: device);
     }