add airlock pry logs (#17377)

This commit is contained in:
Chief-Engineer
2023-06-16 05:58:29 -05:00
committed by GitHub
parent 0eea58e4b2
commit bfa5ce44d4

View File

@@ -17,6 +17,7 @@ using Content.Shared.Verbs;
using Robust.Shared.Audio; using Robust.Shared.Audio;
using Robust.Shared.Containers; using Robust.Shared.Containers;
using System.Linq; using System.Linq;
using Content.Server.Administration.Logs;
using Content.Server.Power.EntitySystems; using Content.Server.Power.EntitySystems;
using Content.Shared.Tools; using Content.Shared.Tools;
using Robust.Shared.Physics.Components; using Robust.Shared.Physics.Components;
@@ -27,6 +28,7 @@ namespace Content.Server.Doors.Systems;
public sealed class DoorSystem : SharedDoorSystem public sealed class DoorSystem : SharedDoorSystem
{ {
[Dependency] private readonly IAdminLogManager _adminLog = default!;
[Dependency] private readonly DoorBoltSystem _bolts = default!; [Dependency] private readonly DoorBoltSystem _bolts = default!;
[Dependency] private readonly AirtightSystem _airtightSystem = default!; [Dependency] private readonly AirtightSystem _airtightSystem = default!;
[Dependency] private readonly SharedToolSystem _toolSystem = default!; [Dependency] private readonly SharedToolSystem _toolSystem = default!;
@@ -181,6 +183,7 @@ public sealed class DoorSystem : SharedDoorSystem
var modEv = new DoorGetPryTimeModifierEvent(user); var modEv = new DoorGetPryTimeModifierEvent(user);
RaiseLocalEvent(target, modEv, false); 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); _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 return true; // we might not actually succeeded, but a do-after has started
} }
@@ -191,10 +194,16 @@ public sealed class DoorSystem : SharedDoorSystem
return; return;
if (door.State == DoorState.Closed) 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); StartOpening(uid, door);
}
else if (door.State == DoorState.Open) 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); StartClosing(uid, door);
} }
}
#endregion #endregion