mirror of
https://github.com/corvax-team/ss14-wl.git
synced 2026-02-14 19:29:57 +01:00
Log Station AI radial actions (#41911)
* fuck you and your anonymous zombie shocking * ToUglyString * because
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user