diff --git a/Content.Server/Tools/ToolSystem.Welder.cs b/Content.Server/Tools/ToolSystem.Welder.cs index 181b1462ca..71a5a779f4 100644 --- a/Content.Server/Tools/ToolSystem.Welder.cs +++ b/Content.Server/Tools/ToolSystem.Welder.cs @@ -3,6 +3,7 @@ using Content.Server.Chemistry.Components; using Content.Server.Chemistry.Components.SolutionManager; using Content.Server.Chemistry.EntitySystems; using Content.Server.Tools.Components; +using Content.Shared.Database; using Content.Shared.Examine; using Content.Shared.FixedPoint; using Content.Shared.Interaction; @@ -108,6 +109,12 @@ namespace Content.Server.Tools welder.Lit = true; + // Logging + if (user != null) + _adminLogger.Add(LogType.InteractActivate, LogImpact.Low, $"{ToPrettyString(user.Value):user} toggled {ToPrettyString(uid):welder} on"); + else + _adminLogger.Add(LogType.Action, LogImpact.Low, $"{ToPrettyString(uid):welder} toggled on"); + var ev = new WelderToggledEvent(true); RaiseLocalEvent(welder.Owner, ev, false); @@ -145,6 +152,12 @@ namespace Content.Server.Tools welder.Lit = false; + // Logging + if (user != null) + _adminLogger.Add(LogType.InteractActivate, LogImpact.Low, $"{ToPrettyString(user.Value):user} toggled {ToPrettyString(uid):welder} off"); + else + _adminLogger.Add(LogType.Action, LogImpact.Low, $"{ToPrettyString(uid):welder} toggled off"); + var ev = new WelderToggledEvent(false); RaiseLocalEvent(welder.Owner, ev, false); @@ -207,6 +220,8 @@ namespace Content.Server.Tools private void OnWelderActivate(EntityUid uid, WelderComponent welder, ActivateInWorldEvent args) { args.Handled = TryToggleWelder(uid, args.User, welder); + if (args.Handled) + args.WasLogged = true; var hotEvent = new IsHotEvent() {IsHot = true}; RaiseLocalEvent(uid, hotEvent); } diff --git a/Content.Shared/Interaction/ActivateInWorldEvent.cs b/Content.Shared/Interaction/ActivateInWorldEvent.cs index ea308f9b08..9dbd636c48 100644 --- a/Content.Shared/Interaction/ActivateInWorldEvent.cs +++ b/Content.Shared/Interaction/ActivateInWorldEvent.cs @@ -18,6 +18,11 @@ public sealed class ActivateInWorldEvent : HandledEntityEventArgs, ITargetedInte /// public EntityUid Target { get; } + /// + /// Set to true when the activation is logged by a specific logger. + /// + public bool WasLogged { get; set; } + public ActivateInWorldEvent(EntityUid user, EntityUid target) { User = user; diff --git a/Content.Shared/Interaction/SharedInteractionSystem.cs b/Content.Shared/Interaction/SharedInteractionSystem.cs index 56b7012794..f0a16c3563 100644 --- a/Content.Shared/Interaction/SharedInteractionSystem.cs +++ b/Content.Shared/Interaction/SharedInteractionSystem.cs @@ -870,7 +870,8 @@ namespace Content.Shared.Interaction DoContactInteraction(user, used, activateMsg); _useDelay.BeginDelay(used, delayComponent); - _adminLogger.Add(LogType.InteractActivate, LogImpact.Low, $"{ToPrettyString(user):user} activated {ToPrettyString(used):used}"); + if (!activateMsg.WasLogged) + _adminLogger.Add(LogType.InteractActivate, LogImpact.Low, $"{ToPrettyString(user):user} activated {ToPrettyString(used):used}"); return true; } #endregion