Logging for turret controller (#40884)

* Logging for turret controller

* Wording

* MEDIUM

* changed to use ItemConfigure
This commit is contained in:
OnyxTheBrave
2025-10-14 18:30:27 -05:00
committed by GitHub
parent 41bdf00a35
commit e92b48c1fa

View File

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