diff --git a/Content.Server/ParticleAccelerator/EntitySystems/ParticleAcceleratorSystem.ControlBox.cs b/Content.Server/ParticleAccelerator/EntitySystems/ParticleAcceleratorSystem.ControlBox.cs index 8756111ad1..489038af12 100644 --- a/Content.Server/ParticleAccelerator/EntitySystems/ParticleAcceleratorSystem.ControlBox.cs +++ b/Content.Server/ParticleAccelerator/EntitySystems/ParticleAcceleratorSystem.ControlBox.cs @@ -6,6 +6,7 @@ using Robust.Server.Player; using Robust.Server.GameObjects; using Robust.Shared.Utility; using System.Diagnostics; +using Content.Shared.CCVar; namespace Content.Server.ParticleAccelerator.EntitySystems; @@ -159,6 +160,17 @@ public sealed partial class ParticleAcceleratorSystem }; _adminLogger.Add(LogType.Action, impact, $"{ToPrettyString(player):player} has set the strength of {ToPrettyString(uid)} to {strength}"); + + + var alertMinPowerState = (ParticleAcceleratorPowerState)_cfg.GetCVar(CCVars.AdminAlertParticleAcceleratorMinPowerState); + if (strength >= alertMinPowerState) + { + var pos = Transform(uid); + _chat.SendAdminAlert(player, Loc.GetString("particle-accelerator-admin-power-strength-warning", + ("machine", ToPrettyString(uid)), + ("powerState", strength), + ("coordinates", pos.Coordinates))); + } } comp.SelectedStrength = strength; diff --git a/Content.Server/ParticleAccelerator/EntitySystems/ParticleAcceleratorSystem.cs b/Content.Server/ParticleAccelerator/EntitySystems/ParticleAcceleratorSystem.cs index aab89c1b7c..c50e054281 100644 --- a/Content.Server/ParticleAccelerator/EntitySystems/ParticleAcceleratorSystem.cs +++ b/Content.Server/ParticleAccelerator/EntitySystems/ParticleAcceleratorSystem.cs @@ -1,9 +1,11 @@ using Content.Server.Administration.Logs; +using Content.Server.Chat.Managers; using Content.Server.Projectiles; using Robust.Shared.Physics.Systems; using Robust.Shared.Map; using Robust.Shared.Timing; using Robust.Server.GameObjects; +using Robust.Shared.Configuration; namespace Content.Server.ParticleAccelerator.EntitySystems; @@ -12,6 +14,8 @@ public sealed partial class ParticleAcceleratorSystem : EntitySystem [Dependency] private readonly IAdminLogManager _adminLogger = default!; [Dependency] private readonly IGameTiming _gameTiming = default!; [Dependency] private readonly IMapManager _mapManager = default!; + [Dependency] private readonly IConfigurationManager _cfg = default!; + [Dependency] private readonly IChatManager _chat = default!; [Dependency] private readonly ProjectileSystem _projectileSystem = default!; [Dependency] private readonly SharedAppearanceSystem _appearanceSystem = default!; [Dependency] private readonly SharedPhysicsSystem _physicsSystem = default!; diff --git a/Content.Shared/CCVar/CCVars.cs b/Content.Shared/CCVar/CCVars.cs index 493bf14c1a..f992d6fbff 100644 --- a/Content.Shared/CCVar/CCVars.cs +++ b/Content.Shared/CCVar/CCVars.cs @@ -699,6 +699,11 @@ namespace Content.Shared.CCVar public static readonly CVarDef AdminAlertExplosionMinIntensity = CVarDef.Create("admin.alert.explosion_min_intensity", 60, CVar.SERVERONLY); + /// + /// Minimum particle accelerator strength to create an admin alert message. + /// + public static readonly CVarDef AdminAlertParticleAcceleratorMinPowerState = + CVarDef.Create("admin.alert.particle_accelerator_min_power_state", 3, CVar.SERVERONLY); /// /// Should the ban details in admin channel include PII? (IP, HWID, etc) diff --git a/Resources/Locale/en-US/particle-accelerator/particle-accelerator-admin.ftl b/Resources/Locale/en-US/particle-accelerator/particle-accelerator-admin.ftl new file mode 100644 index 0000000000..6fb9d5705d --- /dev/null +++ b/Resources/Locale/en-US/particle-accelerator/particle-accelerator-admin.ftl @@ -0,0 +1 @@ +particle-accelerator-admin-power-strength-warning = changed PA power of {$machine} to {$powerState} at {$coordinates:coordinates}