air alarm now sends the count of known devices, rather than all types of devices
This commit is contained in:
@@ -15,10 +15,10 @@ public sealed class AirAlarmComponent : Component
|
|||||||
|
|
||||||
[ViewVariables] public AirAlarmTab CurrentTab { get; set; }
|
[ViewVariables] public AirAlarmTab CurrentTab { get; set; }
|
||||||
|
|
||||||
public Dictionary<string, IAtmosDeviceData> DeviceData = new();
|
public readonly HashSet<string> KnownDevices = new();
|
||||||
public Dictionary<string, GasVentPumpData> VentData = new();
|
public readonly Dictionary<string, GasVentPumpData> VentData = new();
|
||||||
public Dictionary<string, GasVentScrubberData> ScrubberData = new();
|
public readonly Dictionary<string, GasVentScrubberData> ScrubberData = new();
|
||||||
public Dictionary<string, AtmosSensorData> SensorData = new();
|
public readonly Dictionary<string, AtmosSensorData> SensorData = new();
|
||||||
|
|
||||||
public HashSet<NetUserId> ActivePlayers = new();
|
public HashSet<NetUserId> ActivePlayers = new();
|
||||||
|
|
||||||
|
|||||||
@@ -182,6 +182,7 @@ public sealed class AirAlarmSystem : EntitySystem
|
|||||||
{
|
{
|
||||||
ForceCloseAllInterfaces(uid);
|
ForceCloseAllInterfaces(uid);
|
||||||
component.CurrentModeUpdater = null;
|
component.CurrentModeUpdater = null;
|
||||||
|
component.KnownDevices.Clear();
|
||||||
component.ScrubberData.Clear();
|
component.ScrubberData.Clear();
|
||||||
component.SensorData.Clear();
|
component.SensorData.Clear();
|
||||||
component.VentData.Clear();
|
component.VentData.Clear();
|
||||||
@@ -232,6 +233,7 @@ public sealed class AirAlarmSystem : EntitySystem
|
|||||||
{
|
{
|
||||||
if (AccessCheck(uid, args.Session.AttachedEntity, component))
|
if (AccessCheck(uid, args.Session.AttachedEntity, component))
|
||||||
{
|
{
|
||||||
|
component.KnownDevices.Clear();
|
||||||
component.VentData.Clear();
|
component.VentData.Clear();
|
||||||
component.ScrubberData.Clear();
|
component.ScrubberData.Clear();
|
||||||
component.SensorData.Clear();
|
component.SensorData.Clear();
|
||||||
@@ -384,8 +386,6 @@ public sealed class AirAlarmSystem : EntitySystem
|
|||||||
|
|
||||||
// Save into component.
|
// Save into component.
|
||||||
// Sync data to interface.
|
// Sync data to interface.
|
||||||
// _airAlarmDataSystem.UpdateDeviceData(uid, args.SenderAddress, data);
|
|
||||||
//
|
|
||||||
switch (data)
|
switch (data)
|
||||||
{
|
{
|
||||||
case GasVentPumpData ventData:
|
case GasVentPumpData ventData:
|
||||||
@@ -402,6 +402,8 @@ public sealed class AirAlarmSystem : EntitySystem
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
controller.KnownDevices.Add(args.SenderAddress);
|
||||||
|
|
||||||
UpdateUI(uid, controller);
|
UpdateUI(uid, controller);
|
||||||
|
|
||||||
return;
|
return;
|
||||||
@@ -500,7 +502,7 @@ public sealed class AirAlarmSystem : EntitySystem
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
var deviceCount = alarm.VentData.Count + alarm.ScrubberData.Count + alarm.SensorData.Count;
|
var deviceCount = alarm.KnownDevices.Count;
|
||||||
|
|
||||||
if (!_atmosAlarmable.TryGetHighestAlert(uid, out var highestAlarm))
|
if (!_atmosAlarmable.TryGetHighestAlert(uid, out var highestAlarm))
|
||||||
{
|
{
|
||||||
|
|||||||
Reference in New Issue
Block a user