Add atmos device logs (#5743)
This commit is contained in:
@@ -1,10 +1,12 @@
|
||||
using System;
|
||||
using Content.Server.Administration.Logs;
|
||||
using Content.Server.Atmos.Piping.Components;
|
||||
using Content.Server.Atmos.Piping.Trinary.Components;
|
||||
using Content.Server.NodeContainer;
|
||||
using Content.Server.NodeContainer.Nodes;
|
||||
using Content.Shared.Atmos;
|
||||
using Content.Shared.Atmos.Piping.Trinary.Components;
|
||||
using Content.Shared.Database;
|
||||
using Content.Shared.Interaction;
|
||||
using Content.Shared.Popups;
|
||||
using JetBrains.Annotations;
|
||||
@@ -19,6 +21,8 @@ namespace Content.Server.Atmos.Piping.Trinary.EntitySystems
|
||||
public class GasMixerSystem : EntitySystem
|
||||
{
|
||||
[Dependency] private UserInterfaceSystem _userInterfaceSystem = default!;
|
||||
[Dependency] private AdminLogSystem _adminLogSystem = default!;
|
||||
|
||||
public override void Initialize()
|
||||
{
|
||||
base.Initialize();
|
||||
@@ -134,12 +138,16 @@ namespace Content.Server.Atmos.Piping.Trinary.EntitySystems
|
||||
private void OnToggleStatusMessage(EntityUid uid, GasMixerComponent mixer, GasMixerToggleStatusMessage args)
|
||||
{
|
||||
mixer.Enabled = args.Enabled;
|
||||
_adminLogSystem.Add(LogType.AtmosPowerChanged, LogImpact.Medium,
|
||||
$"{EntityManager.ToPrettyString(args.Session.AttachedEntity!.Value):player} set the power on {EntityManager.ToPrettyString(uid):device} to {args.Enabled}");
|
||||
DirtyUI(uid, mixer);
|
||||
}
|
||||
|
||||
private void OnOutputPressureChangeMessage(EntityUid uid, GasMixerComponent mixer, GasMixerChangeOutputPressureMessage args)
|
||||
{
|
||||
mixer.TargetPressure = Math.Clamp(args.Pressure, 0f, Atmospherics.MaxOutputPressure);
|
||||
_adminLogSystem.Add(LogType.AtmosPressureChanged, LogImpact.Medium,
|
||||
$"{EntityManager.ToPrettyString(args.Session.AttachedEntity!.Value):player} set the pressure on {EntityManager.ToPrettyString(uid):device} to {args.Pressure}kPa");
|
||||
DirtyUI(uid, mixer);
|
||||
}
|
||||
|
||||
@@ -149,6 +157,8 @@ namespace Content.Server.Atmos.Piping.Trinary.EntitySystems
|
||||
float nodeOne = Math.Clamp(args.NodeOne, 0f, 100.0f) / 100.0f;
|
||||
mixer.InletOneConcentration = nodeOne;
|
||||
mixer.InletTwoConcentration = 1.0f - mixer.InletOneConcentration;
|
||||
_adminLogSystem.Add(LogType.AtmosRatioChanged, LogImpact.Medium,
|
||||
$"{EntityManager.ToPrettyString(args.Session.AttachedEntity!.Value):player} set the ratio on {EntityManager.ToPrettyString(uid):device} to {mixer.InletOneConcentration}:{mixer.InletTwoConcentration}");
|
||||
DirtyUI(uid, mixer);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user