Add atmos device logs (#5743)
This commit is contained in:
@@ -1,4 +1,5 @@
|
|||||||
using System;
|
using System;
|
||||||
|
using Content.Server.Administration.Logs;
|
||||||
using Content.Server.Atmos.Piping.Binary.Components;
|
using Content.Server.Atmos.Piping.Binary.Components;
|
||||||
using Content.Server.Atmos.Piping.Components;
|
using Content.Server.Atmos.Piping.Components;
|
||||||
using Content.Server.NodeContainer;
|
using Content.Server.NodeContainer;
|
||||||
@@ -6,6 +7,7 @@ using Content.Server.NodeContainer.Nodes;
|
|||||||
using Content.Shared.Atmos;
|
using Content.Shared.Atmos;
|
||||||
using Content.Shared.Atmos.Piping;
|
using Content.Shared.Atmos.Piping;
|
||||||
using Content.Shared.Atmos.Piping.Binary.Components;
|
using Content.Shared.Atmos.Piping.Binary.Components;
|
||||||
|
using Content.Shared.Database;
|
||||||
using Content.Shared.Examine;
|
using Content.Shared.Examine;
|
||||||
using Content.Shared.Interaction;
|
using Content.Shared.Interaction;
|
||||||
using Content.Shared.Popups;
|
using Content.Shared.Popups;
|
||||||
@@ -22,6 +24,7 @@ namespace Content.Server.Atmos.Piping.Binary.EntitySystems
|
|||||||
public class GasPressurePumpSystem : EntitySystem
|
public class GasPressurePumpSystem : EntitySystem
|
||||||
{
|
{
|
||||||
[Dependency] private UserInterfaceSystem _userInterfaceSystem = default!;
|
[Dependency] private UserInterfaceSystem _userInterfaceSystem = default!;
|
||||||
|
[Dependency] private AdminLogSystem _adminLogSystem = default!;
|
||||||
|
|
||||||
public override void Initialize()
|
public override void Initialize()
|
||||||
{
|
{
|
||||||
@@ -111,12 +114,16 @@ namespace Content.Server.Atmos.Piping.Binary.EntitySystems
|
|||||||
private void OnToggleStatusMessage(EntityUid uid, GasPressurePumpComponent pump, GasPressurePumpToggleStatusMessage args)
|
private void OnToggleStatusMessage(EntityUid uid, GasPressurePumpComponent pump, GasPressurePumpToggleStatusMessage args)
|
||||||
{
|
{
|
||||||
pump.Enabled = args.Enabled;
|
pump.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, pump);
|
DirtyUI(uid, pump);
|
||||||
}
|
}
|
||||||
|
|
||||||
private void OnOutputPressureChangeMessage(EntityUid uid, GasPressurePumpComponent pump, GasPressurePumpChangeOutputPressureMessage args)
|
private void OnOutputPressureChangeMessage(EntityUid uid, GasPressurePumpComponent pump, GasPressurePumpChangeOutputPressureMessage args)
|
||||||
{
|
{
|
||||||
pump.TargetPressure = Math.Clamp(args.Pressure, 0f, Atmospherics.MaxOutputPressure);
|
pump.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, pump);
|
DirtyUI(uid, pump);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,4 +1,5 @@
|
|||||||
using System;
|
using System;
|
||||||
|
using Content.Server.Administration.Logs;
|
||||||
using Content.Server.Atmos.EntitySystems;
|
using Content.Server.Atmos.EntitySystems;
|
||||||
using Content.Server.Atmos.Piping.Binary.Components;
|
using Content.Server.Atmos.Piping.Binary.Components;
|
||||||
using Content.Server.Atmos.Piping.Components;
|
using Content.Server.Atmos.Piping.Components;
|
||||||
@@ -6,6 +7,7 @@ using Content.Server.NodeContainer;
|
|||||||
using Content.Server.NodeContainer.Nodes;
|
using Content.Server.NodeContainer.Nodes;
|
||||||
using Content.Shared.Atmos;
|
using Content.Shared.Atmos;
|
||||||
using Content.Shared.Atmos.Piping.Binary.Components;
|
using Content.Shared.Atmos.Piping.Binary.Components;
|
||||||
|
using Content.Shared.Database;
|
||||||
using Content.Shared.Examine;
|
using Content.Shared.Examine;
|
||||||
using Content.Shared.Interaction;
|
using Content.Shared.Interaction;
|
||||||
using Content.Shared.Popups;
|
using Content.Shared.Popups;
|
||||||
@@ -24,6 +26,7 @@ namespace Content.Server.Atmos.Piping.Binary.EntitySystems
|
|||||||
[Dependency] private readonly IGameTiming _gameTiming = default!;
|
[Dependency] private readonly IGameTiming _gameTiming = default!;
|
||||||
[Dependency] private readonly AtmosphereSystem _atmosphereSystem = default!;
|
[Dependency] private readonly AtmosphereSystem _atmosphereSystem = default!;
|
||||||
[Dependency] private UserInterfaceSystem _userInterfaceSystem = default!;
|
[Dependency] private UserInterfaceSystem _userInterfaceSystem = default!;
|
||||||
|
[Dependency] private AdminLogSystem _adminLogSystem = default!;
|
||||||
|
|
||||||
public override void Initialize()
|
public override void Initialize()
|
||||||
{
|
{
|
||||||
@@ -116,14 +119,17 @@ namespace Content.Server.Atmos.Piping.Binary.EntitySystems
|
|||||||
private void OnToggleStatusMessage(EntityUid uid, GasVolumePumpComponent pump, GasVolumePumpToggleStatusMessage args)
|
private void OnToggleStatusMessage(EntityUid uid, GasVolumePumpComponent pump, GasVolumePumpToggleStatusMessage args)
|
||||||
{
|
{
|
||||||
pump.Enabled = args.Enabled;
|
pump.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, pump);
|
DirtyUI(uid, pump);
|
||||||
}
|
}
|
||||||
|
|
||||||
private void OnTransferRateChangeMessage(EntityUid uid, GasVolumePumpComponent pump, GasVolumePumpChangeTransferRateMessage args)
|
private void OnTransferRateChangeMessage(EntityUid uid, GasVolumePumpComponent pump, GasVolumePumpChangeTransferRateMessage args)
|
||||||
{
|
{
|
||||||
pump.TransferRate = Math.Clamp(args.TransferRate, 0f, Atmospherics.MaxTransferRate);
|
pump.TransferRate = Math.Clamp(args.TransferRate, 0f, Atmospherics.MaxTransferRate);
|
||||||
|
_adminLogSystem.Add(LogType.AtmosVolumeChanged, LogImpact.Medium,
|
||||||
|
$"{EntityManager.ToPrettyString(args.Session.AttachedEntity!.Value):player} set the transfer rate on {EntityManager.ToPrettyString(uid):device} to {args.TransferRate}");
|
||||||
DirtyUI(uid, pump);
|
DirtyUI(uid, pump);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private void DirtyUI(EntityUid uid, GasVolumePumpComponent? pump)
|
private void DirtyUI(EntityUid uid, GasVolumePumpComponent? pump)
|
||||||
|
|||||||
@@ -1,4 +1,5 @@
|
|||||||
using System;
|
using System;
|
||||||
|
using Content.Server.Administration.Logs;
|
||||||
using Content.Server.Atmos.Piping.Components;
|
using Content.Server.Atmos.Piping.Components;
|
||||||
using Content.Server.Atmos.Piping.Trinary.Components;
|
using Content.Server.Atmos.Piping.Trinary.Components;
|
||||||
using Content.Server.NodeContainer;
|
using Content.Server.NodeContainer;
|
||||||
@@ -7,6 +8,7 @@ using Content.Server.UserInterface;
|
|||||||
using Content.Shared.Atmos;
|
using Content.Shared.Atmos;
|
||||||
using Content.Shared.Atmos.Piping;
|
using Content.Shared.Atmos.Piping;
|
||||||
using Content.Shared.Atmos.Piping.Trinary.Components;
|
using Content.Shared.Atmos.Piping.Trinary.Components;
|
||||||
|
using Content.Shared.Database;
|
||||||
using Content.Shared.Interaction;
|
using Content.Shared.Interaction;
|
||||||
using Content.Shared.Popups;
|
using Content.Shared.Popups;
|
||||||
using JetBrains.Annotations;
|
using JetBrains.Annotations;
|
||||||
@@ -23,6 +25,7 @@ namespace Content.Server.Atmos.Piping.Trinary.EntitySystems
|
|||||||
{
|
{
|
||||||
[Dependency] private IGameTiming _gameTiming = default!;
|
[Dependency] private IGameTiming _gameTiming = default!;
|
||||||
[Dependency] private UserInterfaceSystem _userInterfaceSystem = default!;
|
[Dependency] private UserInterfaceSystem _userInterfaceSystem = default!;
|
||||||
|
[Dependency] private AdminLogSystem _adminLogSystem = default!;
|
||||||
|
|
||||||
public override void Initialize()
|
public override void Initialize()
|
||||||
{
|
{
|
||||||
@@ -110,12 +113,17 @@ namespace Content.Server.Atmos.Piping.Trinary.EntitySystems
|
|||||||
private void OnToggleStatusMessage(EntityUid uid, GasFilterComponent filter, GasFilterToggleStatusMessage args)
|
private void OnToggleStatusMessage(EntityUid uid, GasFilterComponent filter, GasFilterToggleStatusMessage args)
|
||||||
{
|
{
|
||||||
filter.Enabled = args.Enabled;
|
filter.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, filter);
|
DirtyUI(uid, filter);
|
||||||
}
|
}
|
||||||
|
|
||||||
private void OnTransferRateChangeMessage(EntityUid uid, GasFilterComponent filter, GasFilterChangeRateMessage args)
|
private void OnTransferRateChangeMessage(EntityUid uid, GasFilterComponent filter, GasFilterChangeRateMessage args)
|
||||||
{
|
{
|
||||||
filter.TransferRate = Math.Clamp(args.Rate, 0f, Atmospherics.MaxTransferRate);
|
filter.TransferRate = Math.Clamp(args.Rate, 0f, Atmospherics.MaxTransferRate);
|
||||||
|
_adminLogSystem.Add(LogType.AtmosVolumeChanged, LogImpact.Medium,
|
||||||
|
$"{EntityManager.ToPrettyString(args.Session.AttachedEntity!.Value):player} set the transfer rate on {EntityManager.ToPrettyString(uid):device} to {args.Rate}");
|
||||||
DirtyUI(uid, filter);
|
DirtyUI(uid, filter);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,10 +1,12 @@
|
|||||||
using System;
|
using System;
|
||||||
|
using Content.Server.Administration.Logs;
|
||||||
using Content.Server.Atmos.Piping.Components;
|
using Content.Server.Atmos.Piping.Components;
|
||||||
using Content.Server.Atmos.Piping.Trinary.Components;
|
using Content.Server.Atmos.Piping.Trinary.Components;
|
||||||
using Content.Server.NodeContainer;
|
using Content.Server.NodeContainer;
|
||||||
using Content.Server.NodeContainer.Nodes;
|
using Content.Server.NodeContainer.Nodes;
|
||||||
using Content.Shared.Atmos;
|
using Content.Shared.Atmos;
|
||||||
using Content.Shared.Atmos.Piping.Trinary.Components;
|
using Content.Shared.Atmos.Piping.Trinary.Components;
|
||||||
|
using Content.Shared.Database;
|
||||||
using Content.Shared.Interaction;
|
using Content.Shared.Interaction;
|
||||||
using Content.Shared.Popups;
|
using Content.Shared.Popups;
|
||||||
using JetBrains.Annotations;
|
using JetBrains.Annotations;
|
||||||
@@ -19,6 +21,8 @@ namespace Content.Server.Atmos.Piping.Trinary.EntitySystems
|
|||||||
public class GasMixerSystem : EntitySystem
|
public class GasMixerSystem : EntitySystem
|
||||||
{
|
{
|
||||||
[Dependency] private UserInterfaceSystem _userInterfaceSystem = default!;
|
[Dependency] private UserInterfaceSystem _userInterfaceSystem = default!;
|
||||||
|
[Dependency] private AdminLogSystem _adminLogSystem = default!;
|
||||||
|
|
||||||
public override void Initialize()
|
public override void Initialize()
|
||||||
{
|
{
|
||||||
base.Initialize();
|
base.Initialize();
|
||||||
@@ -134,12 +138,16 @@ namespace Content.Server.Atmos.Piping.Trinary.EntitySystems
|
|||||||
private void OnToggleStatusMessage(EntityUid uid, GasMixerComponent mixer, GasMixerToggleStatusMessage args)
|
private void OnToggleStatusMessage(EntityUid uid, GasMixerComponent mixer, GasMixerToggleStatusMessage args)
|
||||||
{
|
{
|
||||||
mixer.Enabled = args.Enabled;
|
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);
|
DirtyUI(uid, mixer);
|
||||||
}
|
}
|
||||||
|
|
||||||
private void OnOutputPressureChangeMessage(EntityUid uid, GasMixerComponent mixer, GasMixerChangeOutputPressureMessage args)
|
private void OnOutputPressureChangeMessage(EntityUid uid, GasMixerComponent mixer, GasMixerChangeOutputPressureMessage args)
|
||||||
{
|
{
|
||||||
mixer.TargetPressure = Math.Clamp(args.Pressure, 0f, Atmospherics.MaxOutputPressure);
|
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);
|
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;
|
float nodeOne = Math.Clamp(args.NodeOne, 0f, 100.0f) / 100.0f;
|
||||||
mixer.InletOneConcentration = nodeOne;
|
mixer.InletOneConcentration = nodeOne;
|
||||||
mixer.InletTwoConcentration = 1.0f - mixer.InletOneConcentration;
|
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);
|
DirtyUI(uid, mixer);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -55,4 +55,9 @@ public enum LogType
|
|||||||
Thirst = 51,
|
Thirst = 51,
|
||||||
Electrocution = 52,
|
Electrocution = 52,
|
||||||
CrayonDraw = 39,
|
CrayonDraw = 39,
|
||||||
|
AtmosPressureChanged = 54,
|
||||||
|
AtmosPowerChanged = 55,
|
||||||
|
AtmosVolumeChanged = 56,
|
||||||
|
AtmosFilterChanged = 57,
|
||||||
|
AtmosRatioChanged = 58,
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user