From bfa5ce44d4586adeff06320347431070795eec7a Mon Sep 17 00:00:00 2001 From: Chief-Engineer <119664036+Chief-Engineer@users.noreply.github.com> Date: Fri, 16 Jun 2023 05:58:29 -0500 Subject: [PATCH] add airlock pry logs (#17377) --- Content.Server/Doors/Systems/DoorSystem.cs | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/Content.Server/Doors/Systems/DoorSystem.cs b/Content.Server/Doors/Systems/DoorSystem.cs index 687fc98dd7..c93fbc334b 100644 --- a/Content.Server/Doors/Systems/DoorSystem.cs +++ b/Content.Server/Doors/Systems/DoorSystem.cs @@ -17,6 +17,7 @@ using Content.Shared.Verbs; using Robust.Shared.Audio; using Robust.Shared.Containers; using System.Linq; +using Content.Server.Administration.Logs; using Content.Server.Power.EntitySystems; using Content.Shared.Tools; using Robust.Shared.Physics.Components; @@ -27,6 +28,7 @@ namespace Content.Server.Doors.Systems; public sealed class DoorSystem : SharedDoorSystem { + [Dependency] private readonly IAdminLogManager _adminLog = default!; [Dependency] private readonly DoorBoltSystem _bolts = default!; [Dependency] private readonly AirtightSystem _airtightSystem = default!; [Dependency] private readonly SharedToolSystem _toolSystem = default!; @@ -181,6 +183,7 @@ public sealed class DoorSystem : SharedDoorSystem var modEv = new DoorGetPryTimeModifierEvent(user); RaiseLocalEvent(target, modEv, false); + _adminLog.Add(LogType.Action, LogImpact.Low, $"{ToPrettyString(user)} is using {ToPrettyString(tool)} to pry {ToPrettyString(target)} while it is {door.State}"); // TODO move to generic tool use logging in a way that includes door state _toolSystem.UseTool(tool, user, target, TimeSpan.FromSeconds(modEv.PryTimeModifier * door.PryTime), new[] {door.PryingQuality}, new DoorPryDoAfterEvent(), out id); return true; // we might not actually succeeded, but a do-after has started } @@ -191,9 +194,15 @@ public sealed class DoorSystem : SharedDoorSystem return; if (door.State == DoorState.Closed) + { + _adminLog.Add(LogType.Action, LogImpact.Medium, $"{ToPrettyString(args.User)} pried {ToPrettyString(uid)} open"); // TODO move to generic tool use logging in a way that includes door state StartOpening(uid, door); + } else if (door.State == DoorState.Open) + { + _adminLog.Add(LogType.Action, LogImpact.Medium, $"{ToPrettyString(args.User)} pried {ToPrettyString(uid)} closed"); // TODO move to generic tool use logging in a way that includes door state StartClosing(uid, door); + } } #endregion