From 7757b94333978572d767f4bb9a4460bc4b6a6c6c Mon Sep 17 00:00:00 2001 From: Paul Date: Mon, 20 Dec 2021 15:17:40 +0100 Subject: [PATCH] adds a few logitems & bumps bullethit to high/extreme, depending on if a player was hit --- Content.Server/Projectiles/ProjectileSystem.cs | 4 +++- Content.Server/Singularity/EntitySystems/EmitterSystem.cs | 8 ++++++++ Content.Shared.Database/LogType.cs | 1 + 3 files changed, 12 insertions(+), 1 deletion(-) diff --git a/Content.Server/Projectiles/ProjectileSystem.cs b/Content.Server/Projectiles/ProjectileSystem.cs index 2cc15d56eb..2d00d30938 100644 --- a/Content.Server/Projectiles/ProjectileSystem.cs +++ b/Content.Server/Projectiles/ProjectileSystem.cs @@ -5,6 +5,7 @@ using Content.Shared.Body.Components; using Content.Shared.Damage; using Content.Shared.Database; using JetBrains.Annotations; +using Robust.Server.GameObjects; using Robust.Shared.Audio; using Robust.Shared.GameObjects; using Robust.Shared.IoC; @@ -57,7 +58,8 @@ namespace Content.Server.Projectiles component.DamagedEntity = true; if (dmg is not null && EntityManager.EntityExists(component.Shooter)) - _adminLogSystem.Add(LogType.BulletHit, LogImpact.Low, + _adminLogSystem.Add(LogType.BulletHit, + HasComp(otherEntity) ? LogImpact.Extreme : LogImpact.High, $"Projectile {ToPrettyString(component.Owner):projectile} shot by {ToPrettyString(component.Shooter):user} hit {ToPrettyString(otherEntity):target} and dealt {dmg.Total:damage} damage"); } diff --git a/Content.Server/Singularity/EntitySystems/EmitterSystem.cs b/Content.Server/Singularity/EntitySystems/EmitterSystem.cs index e68c227a1a..91baa74975 100644 --- a/Content.Server/Singularity/EntitySystems/EmitterSystem.cs +++ b/Content.Server/Singularity/EntitySystems/EmitterSystem.cs @@ -1,14 +1,17 @@ using System; using System.Threading; +using Content.Server.Administration.Logs; using Content.Server.Power.EntitySystems; using Content.Server.Projectiles.Components; using Content.Server.Singularity.Components; using Content.Server.Storage.Components; using Content.Shared.Audio; +using Content.Shared.Database; using Content.Shared.Interaction; using Content.Shared.Popups; using Content.Shared.Singularity.Components; using JetBrains.Annotations; +using Robust.Server.GameObjects; using Robust.Shared.Audio; using Robust.Shared.GameObjects; using Robust.Shared.IoC; @@ -26,6 +29,7 @@ namespace Content.Server.Singularity.EntitySystems public class EmitterSystem : EntitySystem { [Dependency] private readonly IRobustRandom _random = default!; + [Dependency] private readonly AdminLogSystem _adminLog = default!; public override void Initialize() { @@ -56,6 +60,10 @@ namespace Content.Server.Singularity.EntitySystems SwitchOff(component); component.Owner.PopupMessage(args.User, Loc.GetString("comp-emitter-turned-off", ("target", component.Owner))); } + + _adminLog.Add(LogType.Emitter, + component.IsOn ? LogImpact.Medium : LogImpact.High, + $"{ToPrettyString(args.User):player} toggled {ToPrettyString(uid):emitter}"); } else { diff --git a/Content.Shared.Database/LogType.cs b/Content.Shared.Database/LogType.cs index be025e61d5..1928f13fc2 100644 --- a/Content.Shared.Database/LogType.cs +++ b/Content.Shared.Database/LogType.cs @@ -60,4 +60,5 @@ public enum LogType AtmosVolumeChanged = 56, AtmosFilterChanged = 57, AtmosRatioChanged = 58, + Emitter = 59, }