From 081982735c46c56354fb3be3bb13eda1f3a5d5fd Mon Sep 17 00:00:00 2001 From: Chief-Engineer <119664036+Chief-Engineer@users.noreply.github.com> Date: Sun, 18 Dec 2022 19:15:55 -0600 Subject: [PATCH] Add pull logs (#12922) * add pull logs * fix logs for stopping pulling * rm missed line --- Content.Shared/Pulling/Systems/SharedPullerSystem.cs | 5 +++++ .../Pulling/Systems/SharedPullingSystem.Actions.cs | 5 +++++ 2 files changed, 10 insertions(+) diff --git a/Content.Shared/Pulling/Systems/SharedPullerSystem.cs b/Content.Shared/Pulling/Systems/SharedPullerSystem.cs index eb1c68baf4..162bcb1c8f 100644 --- a/Content.Shared/Pulling/Systems/SharedPullerSystem.cs +++ b/Content.Shared/Pulling/Systems/SharedPullerSystem.cs @@ -1,4 +1,6 @@ +using Content.Shared.Administration.Logs; using Content.Shared.Alert; +using Content.Shared.Database; using Content.Shared.Hands; using Content.Shared.Movement.Systems; using Content.Shared.Physics.Pull; @@ -13,6 +15,7 @@ namespace Content.Shared.Pulling.Systems [Dependency] private readonly SharedPullingSystem _pullSystem = default!; [Dependency] private readonly MovementSpeedModifierSystem _movementSpeedModifierSystem = default!; [Dependency] private readonly AlertsSystem _alertsSystem = default!; + [Dependency] private readonly ISharedAdminLogManager _adminLogger = default!; public override void Initialize() { @@ -60,6 +63,8 @@ namespace Content.Shared.Pulling.Systems return; var euid = component.Owner; + if (_alertsSystem.IsShowingAlert(euid, AlertType.Pulling)) + _adminLogger.Add(LogType.Action, LogImpact.Low, $"{ToPrettyString(euid):user} stopped pulling {ToPrettyString(args.Pulled.Owner):target}"); _alertsSystem.ClearAlert(euid, AlertType.Pulling); RefreshMovementSpeed(component); diff --git a/Content.Shared/Pulling/Systems/SharedPullingSystem.Actions.cs b/Content.Shared/Pulling/Systems/SharedPullingSystem.Actions.cs index 52bd4fb059..9782c538ac 100644 --- a/Content.Shared/Pulling/Systems/SharedPullingSystem.Actions.cs +++ b/Content.Shared/Pulling/Systems/SharedPullingSystem.Actions.cs @@ -1,5 +1,7 @@ using Content.Shared.ActionBlocker; +using Content.Shared.Administration.Logs; using Content.Shared.Buckle.Components; +using Content.Shared.Database; using Content.Shared.Hands.EntitySystems; using Content.Shared.Interaction; using Content.Shared.Physics.Pull; @@ -18,6 +20,7 @@ namespace Content.Shared.Pulling [Dependency] private readonly SharedContainerSystem _containerSystem = default!; [Dependency] private readonly SharedHandsSystem _handsSystem = default!; [Dependency] private readonly SharedInteractionSystem _interaction = default!; + [Dependency] private readonly ISharedAdminLogManager _adminLogger = default!; public bool CanPull(EntityUid puller, EntityUid pulled) { @@ -196,6 +199,8 @@ namespace Content.Shared.Pulling _pullSm.ForceRelationship(puller, pullable); pullable.PrevFixedRotation = pullablePhysics.FixedRotation; pullablePhysics.FixedRotation = pullable.FixedRotationOnPull; + _adminLogger.Add(LogType.Action, LogImpact.Low, + $"{ToPrettyString(puller.Owner):user} started pulling {ToPrettyString(pullable.Owner):target}"); return true; }