Remove devices from device lists when they get deleted (#16783)

* Implement device network device shutdown subscribtion
Implement removing devices from device lists when they get deleted

* Improve name and doc comment for DeviceShutDownEvent

* Change ShutdownSubscriber data field tag

* Change UpdateRemovalSubscription name to UpdateShutdownSubscription
This commit is contained in:
Julian Giebel
2023-05-26 00:08:22 +02:00
committed by GitHub
parent a02753545d
commit 2bb1fde4dc
8 changed files with 157 additions and 67 deletions

View File

@@ -101,5 +101,13 @@ namespace Content.Server.DeviceNetwork.Components
[ViewVariables(VVAccess.ReadWrite)]
[DataField("sendBroadcastAttemptEvent")]
public bool SendBroadcastAttemptEvent = false;
/// <summary>
/// A list of entities that get sent the <see cref="DeviceShutDownEvent"/> when this entity gets deleted.<br/><br/>
/// When a device subscribes to the deletion of another device the entity id of the device being subscribed
/// to also gets saved on the subscribing device.
/// </summary>
[DataField("ShutdownSubscribers")]
public HashSet<EntityUid> ShutdownSubscribers = new();
}
}