Add welding logs (#13299)
This commit is contained in:
@@ -1,4 +1,6 @@
|
|||||||
|
using Content.Server.Administration.Logs;
|
||||||
using Content.Server.Tools.Components;
|
using Content.Server.Tools.Components;
|
||||||
|
using Content.Shared.Database;
|
||||||
using Content.Shared.Examine;
|
using Content.Shared.Examine;
|
||||||
using Content.Shared.Interaction;
|
using Content.Shared.Interaction;
|
||||||
using Content.Shared.Tools.Components;
|
using Content.Shared.Tools.Components;
|
||||||
@@ -7,6 +9,7 @@ namespace Content.Server.Tools.Systems;
|
|||||||
|
|
||||||
public sealed class WeldableSystem : EntitySystem
|
public sealed class WeldableSystem : EntitySystem
|
||||||
{
|
{
|
||||||
|
[Dependency] private readonly IAdminLogManager _adminLogger = default!;
|
||||||
[Dependency] private readonly ToolSystem _toolSystem = default!;
|
[Dependency] private readonly ToolSystem _toolSystem = default!;
|
||||||
|
|
||||||
public override void Initialize()
|
public override void Initialize()
|
||||||
@@ -64,6 +67,9 @@ public sealed class WeldableSystem : EntitySystem
|
|||||||
component.WeldingTime.Seconds, component.WeldingQuality,
|
component.WeldingTime.Seconds, component.WeldingQuality,
|
||||||
new WeldFinishedEvent(user, tool), new WeldCancelledEvent(), uid);
|
new WeldFinishedEvent(user, tool), new WeldCancelledEvent(), uid);
|
||||||
|
|
||||||
|
// Log attempt
|
||||||
|
_adminLogger.Add(LogType.Action, LogImpact.Low, $"{ToPrettyString(user):user} is {(component.IsWelded ? "un" : "")}welding {ToPrettyString(uid):target} at {Transform(uid).Coordinates:targetlocation}");
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -79,6 +85,9 @@ public sealed class WeldableSystem : EntitySystem
|
|||||||
RaiseLocalEvent(uid, new WeldableChangedEvent(component.IsWelded), true);
|
RaiseLocalEvent(uid, new WeldableChangedEvent(component.IsWelded), true);
|
||||||
|
|
||||||
UpdateAppearance(uid, component);
|
UpdateAppearance(uid, component);
|
||||||
|
|
||||||
|
// Log success
|
||||||
|
_adminLogger.Add(LogType.Action, LogImpact.Low, $"{ToPrettyString(args.User):user} {(!component.IsWelded ? "un" : "")}welded {ToPrettyString(uid):target}");
|
||||||
}
|
}
|
||||||
|
|
||||||
private void OnWeldCanceled(EntityUid uid, WeldableComponent component, WeldCancelledEvent args)
|
private void OnWeldCanceled(EntityUid uid, WeldableComponent component, WeldCancelledEvent args)
|
||||||
|
|||||||
Reference in New Issue
Block a user