From d3d8dde42c08c1bb183afe02b9b8838e3b171218 Mon Sep 17 00:00:00 2001 From: Chief-Engineer <119664036+Chief-Engineer@users.noreply.github.com> Date: Tue, 27 Dec 2022 10:58:06 -0600 Subject: [PATCH] add buckle logs (#13206) --- .../Buckle/Systems/BuckleSystem.Buckle.cs | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/Content.Server/Buckle/Systems/BuckleSystem.Buckle.cs b/Content.Server/Buckle/Systems/BuckleSystem.Buckle.cs index fc50dbff5a..5cc39d3178 100644 --- a/Content.Server/Buckle/Systems/BuckleSystem.Buckle.cs +++ b/Content.Server/Buckle/Systems/BuckleSystem.Buckle.cs @@ -1,8 +1,10 @@ using System.Diagnostics.CodeAnalysis; +using Content.Server.Administration.Logs; using Content.Server.Storage.Components; using Content.Shared.Alert; using Content.Shared.Bed.Sleep; using Content.Shared.Buckle.Components; +using Content.Shared.Database; using Content.Shared.DragDrop; using Content.Shared.Hands.Components; using Content.Shared.IdentityManagement; @@ -18,6 +20,8 @@ namespace Content.Server.Buckle.Systems; public sealed partial class BuckleSystem { + [Dependency] private readonly IAdminLogManager _adminLogger = default!; + private void InitializeBuckle() { SubscribeLocalEvent(OnBuckleStartup); @@ -275,6 +279,12 @@ public sealed partial class BuckleSystem } } + // Logging + if (user != buckleId) + _adminLogger.Add(LogType.Action, LogImpact.Low, $"{ToPrettyString(user):player} buckled {ToPrettyString(buckleId)} to {ToPrettyString(to)}"); + else + _adminLogger.Add(LogType.Action, LogImpact.Low, $"{ToPrettyString(user):player} buckled themselves to {ToPrettyString(to)}"); + return true; } @@ -317,6 +327,12 @@ public sealed partial class BuckleSystem return false; } + // Logging + if (user != buckleId) + _adminLogger.Add(LogType.Action, LogImpact.Low, $"{ToPrettyString(user):player} unbuckled {ToPrettyString(buckleId)} from {ToPrettyString(oldBuckledTo.Owner)}"); + else + _adminLogger.Add(LogType.Action, LogImpact.Low, $"{ToPrettyString(user):player} unbuckled themselves from {ToPrettyString(oldBuckledTo.Owner)}"); + SetBuckledTo(buckle, null); var xform = Transform(buckleId);