add buckle logs (#13206)
This commit is contained in:
parent
920bad3dc6
commit
d3d8dde42c
|
|
@ -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);
|
||||
|
|
|
|||
Loading…
Reference in New Issue