add buckle logs (#13206)

This commit is contained in:
Chief-Engineer 2022-12-27 10:58:06 -06:00 committed by GitHub
parent 920bad3dc6
commit d3d8dde42c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 16 additions and 0 deletions

View File

@ -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<BuckleComponent, ComponentStartup>(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);