Clear and reregister devices for atmos alarms (#11391)
* deregister sensors upon device list update and re-register after clearing devices * fire alarms, too * adds the last set of known devices to the device list update event * update UI upon clearing everything out * addresses reviews
This commit is contained in:
@@ -15,6 +15,11 @@ public sealed class AtmosDeviceNetworkSystem : EntitySystem
|
||||
/// </summary>
|
||||
public const string RegisterDevice = "atmos_register_device";
|
||||
|
||||
/// <summary>
|
||||
/// Deregister a device's address on this device.
|
||||
/// </summary>
|
||||
public const string DeregisterDevice = "atmos_deregister_device";
|
||||
|
||||
/// <summary>
|
||||
/// Synchronize the data this device has with the sender.
|
||||
/// </summary>
|
||||
@@ -32,6 +37,16 @@ public sealed class AtmosDeviceNetworkSystem : EntitySystem
|
||||
_deviceNet.QueuePacket(uid, address, registerPayload);
|
||||
}
|
||||
|
||||
public void Deregister(EntityUid uid, string? address)
|
||||
{
|
||||
var deregisterPayload = new NetworkPayload
|
||||
{
|
||||
[DeviceNetworkConstants.Command] = DeregisterDevice
|
||||
};
|
||||
|
||||
_deviceNet.QueuePacket(uid, address, deregisterPayload);
|
||||
}
|
||||
|
||||
public void Sync(EntityUid uid, string? address)
|
||||
{
|
||||
var syncPayload = new NetworkPayload
|
||||
|
||||
Reference in New Issue
Block a user