From: Trevor Day Date: Sun, 14 Jan 2024 04:05:45 +0000 (-0800) Subject: Add admin logs for thermomachines (#24056) X-Git-Url: https://git.smokeofanarchy.ru/gitweb.cgi?a=commitdiff_plain;h=7a84f9e2038d4f0d9c776a4e1a91b83a4997a43e;p=space-station-14.git Add admin logs for thermomachines (#24056) --- diff --git a/Content.Server/Atmos/Piping/Unary/EntitySystems/GasThermoMachineSystem.cs b/Content.Server/Atmos/Piping/Unary/EntitySystems/GasThermoMachineSystem.cs index eec610ffa6..8e065921fe 100644 --- a/Content.Server/Atmos/Piping/Unary/EntitySystems/GasThermoMachineSystem.cs +++ b/Content.Server/Atmos/Piping/Unary/EntitySystems/GasThermoMachineSystem.cs @@ -15,6 +15,8 @@ using JetBrains.Annotations; using Robust.Server.GameObjects; using Content.Server.Power.EntitySystems; using Content.Server.UserInterface; +using Content.Shared.Administration.Logs; +using Content.Shared.Database; using Content.Shared.Examine; namespace Content.Server.Atmos.Piping.Unary.EntitySystems @@ -27,6 +29,7 @@ namespace Content.Server.Atmos.Piping.Unary.EntitySystems [Dependency] private readonly PowerReceiverSystem _power = default!; [Dependency] private readonly NodeContainerSystem _nodeContainer = default!; [Dependency] private readonly DeviceNetworkSystem _deviceNetwork = default!; + [Dependency] private readonly ISharedAdminLogManager _adminLogger = default!; public override void Initialize() { @@ -110,7 +113,8 @@ namespace Content.Server.Atmos.Piping.Unary.EntitySystems private void OnToggleMessage(EntityUid uid, GasThermoMachineComponent thermoMachine, GasThermomachineToggleMessage args) { - _power.TogglePower(uid); + var powerState = _power.TogglePower(uid); + _adminLogger.Add(LogType.AtmosPowerChanged, $"{ToPrettyString(args.Session.AttachedEntity)} turned {(powerState ? "On" : "Off")} {ToPrettyString(uid)}"); DirtyUI(uid, thermoMachine); } @@ -121,6 +125,7 @@ namespace Content.Server.Atmos.Piping.Unary.EntitySystems else thermoMachine.TargetTemperature = MathF.Max(args.Temperature, thermoMachine.MinTemperature); thermoMachine.TargetTemperature = MathF.Max(thermoMachine.TargetTemperature, Atmospherics.TCMB); + _adminLogger.Add(LogType.AtmosTemperatureChanged, $"{ToPrettyString(args.Session.AttachedEntity)} set temperature on {ToPrettyString(uid)} to {thermoMachine.TargetTemperature}"); DirtyUI(uid, thermoMachine); } diff --git a/Content.Shared.Database/LogType.cs b/Content.Shared.Database/LogType.cs index 1d5dbcc3b4..b3cdc60209 100644 --- a/Content.Shared.Database/LogType.cs +++ b/Content.Shared.Database/LogType.cs @@ -94,4 +94,5 @@ public enum LogType /// A client has sent too many chat messages recently and is temporarily blocked from sending more. /// ChatRateLimited = 87, + AtmosTemperatureChanged = 88, }