Add admin logs for anchoring/unanchoring (#7274)

This commit is contained in:
DrSmugleaf
2022-03-25 22:10:43 +01:00
committed by GitHub
parent 648ffbf673
commit e563b0b7e1
2 changed files with 17 additions and 3 deletions

View File

@@ -1,19 +1,19 @@
using System;
using System.Threading.Tasks;
using Content.Server.Administration.Logs;
using Content.Server.Construction.Components;
using Content.Server.Coordinates.Helpers;
using Content.Server.Pulling;
using Content.Server.Tools;
using Content.Server.Tools.Components;
using Content.Shared.Database;
using Content.Shared.Interaction;
using Content.Shared.Pulling.Components;
using Robust.Shared.GameObjects;
using Robust.Shared.IoC;
namespace Content.Server.Construction
{
public sealed class AnchorableSystem : EntitySystem
{
[Dependency] private readonly AdminLogSystem _adminLogs = default!;
[Dependency] private readonly ToolSystem _toolSystem = default!;
[Dependency] private readonly PullingSystem _pullingSystem = default!;
@@ -106,6 +106,12 @@ namespace Content.Server.Construction
RaiseLocalEvent(uid, new UserAnchoredEvent(userUid, usingUid), false);
_adminLogs.Add(
LogType.Action,
LogImpact.Low,
$"{EntityManager.ToPrettyString(userUid):user} anchored {EntityManager.ToPrettyString(uid):anchored} using {EntityManager.ToPrettyString(usingUid):using}"
);
return true;
}
@@ -135,6 +141,12 @@ namespace Content.Server.Construction
RaiseLocalEvent(uid, new UserUnanchoredEvent(userUid, usingUid), false);
_adminLogs.Add(
LogType.Action,
LogImpact.Low,
$"{EntityManager.ToPrettyString(userUid):user} unanchored {EntityManager.ToPrettyString(uid):anchored} using {EntityManager.ToPrettyString(usingUid):using}"
);
return true;
}

View File

@@ -67,6 +67,8 @@ public enum LogType
RCD = 63,
Construction = 64,
Trigger = 65,
Anchor = 66,
Unanchor = 67,
// haha so funny
Emag = 69,
}