Log Station AI radial actions (#41911)

* fuck you and your anonymous zombie shocking

* ToUglyString

* because
This commit is contained in:
ScarKy0
2025-12-20 19:11:07 +01:00
committed by GitHub
parent dcd083a25b
commit e2ef727096

View 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