]> git.smokeofanarchy.ru Git - space-station-14.git/commitdiff
Log Station AI radial actions (#41911)
authorScarKy0 <106310278+ScarKy0@users.noreply.github.com>
Sat, 20 Dec 2025 18:11:07 +0000 (19:11 +0100)
committerGitHub <noreply@github.com>
Sat, 20 Dec 2025 18:11:07 +0000 (18:11 +0000)
* fuck you and your anonymous zombie shocking

* ToUglyString

* because

Content.Shared/Silicons/StationAi/SharedStationAiSystem.Airlock.cs

index 2bf1ddc3bf8bcc3424b4d59d50a2084b89da44af..f11cba419ee4e970c9e34c1a1cede3c2aa3476de 100644 (file)
@@ -1,3 +1,5 @@
+using Content.Shared.Administration.Logs;
+using Content.Shared.Database;
 using Content.Shared.Doors.Components;
 using Robust.Shared.Serialization;
 using Content.Shared.Electrocution;
@@ -7,6 +9,8 @@ namespace Content.Shared.Silicons.StationAi;
 // Handles airlock radial
 public abstract partial class SharedStationAiSystem
 {
+    [Dependency] private readonly ISharedAdminLogManager _adminLogger = default!;
+
     private void InitializeAirlock()
     {
         SubscribeLocalEvent<DoorBoltComponent, StationAiBoltEvent>(OnAirlockBolt);
@@ -22,20 +26,30 @@ public abstract partial class SharedStationAiSystem
         if (component.BoltWireCut || !PowerReceiver.IsPowered(ent))
         {
             ShowDeviceNotRespondingPopup(args.User);
+            _adminLogger.Add(LogType.Action,
+                $"{args.User} was unable to change bolt status on {ent} to [{args.Bolted}] using the Station AI radial because it was unpowered.");
             return;
         }
 
         if (!_access.IsAllowed(args.User, ent))
         {
             ShowDeviceNoAccessPopup(args.User);
+            _adminLogger.Add(LogType.Action,
+                $"{args.User} was unable to change bolt status on {ent} to [{args.Bolted}] using the Station AI radial because they had no access.");
             return;
         }
 
         var setResult = _doors.TrySetBoltDown((ent, component), args.Bolted, args.User, predicted: true);
         if (!setResult)
         {
+            _adminLogger.Add(LogType.Action,
+                $"{args.User} was unable to change bolt status on {ent} to [{args.Bolted}] using the Station AI radial.");
             ShowDeviceNotRespondingPopup(args.User);
         }
+        else
+        {
+            _adminLogger.Add(LogType.Action, $"{args.User} set bolt status on {ent} to [{args.Bolted}] using the Station AI radial.");
+        }
     }
 
     /// <summary>
@@ -46,16 +60,21 @@ public abstract partial class SharedStationAiSystem
         if (!PowerReceiver.IsPowered(ent))
         {
             ShowDeviceNotRespondingPopup(args.User);
+            _adminLogger.Add(LogType.Action,
+                $"{args.User} was unable to change emergency access status on {ent} to [{args.EmergencyAccess}] using the Station AI radial because it was unpowered.");
             return;
         }
 
         if (!_access.IsAllowed(args.User, ent))
         {
             ShowDeviceNoAccessPopup(args.User);
+            _adminLogger.Add(LogType.Action,
+                $"{args.User} was unable to change emergency access status on {ent} to [{args.EmergencyAccess}] using the Station AI radial because they had no access.");
             return;
         }
 
         _airlocks.SetEmergencyAccess((ent, component), args.EmergencyAccess, args.User, predicted: true);
+        _adminLogger.Add(LogType.Action, $"{args.User} set emergency access status on {ent} to [{args.EmergencyAccess}] using the Station AI radial.");
     }
 
     /// <summary>
@@ -66,15 +85,20 @@ public abstract partial class SharedStationAiSystem
         if (component.IsWireCut || !PowerReceiver.IsPowered(ent))
         {
             ShowDeviceNotRespondingPopup(args.User);
+            _adminLogger.Add(LogType.Action,
+                $"{args.User} was unable to change electrified status on {ent} to [{args.Electrified}] using the Station AI radial because it was unpowered.");
             return;
         }
 
         if (!_access.IsAllowed(args.User, ent))
         {
             ShowDeviceNoAccessPopup(args.User);
+            _adminLogger.Add(LogType.Action,
+                $"{args.User} was unable to change electrified status on {ent} to [{args.Electrified}] using the Station AI radial because they had no access.");
             return;
         }
 
+        _adminLogger.Add(LogType.Action, $"{args.User} set electrified status on {ent} to [{args.Electrified}] using the Station AI radial.");
         _electrify.SetElectrified((ent, component), args.Electrified);
         var soundToPlay = component.Enabled
             ? component.AirlockElectrifyDisabled