2023-05-26 00:08:22 +02:00
|
|
|
|
using Content.Shared.DeviceNetwork.Systems;
|
|
|
|
|
|
using Robust.Shared.GameStates;
|
2022-06-10 03:28:24 +02:00
|
|
|
|
|
2023-05-07 08:07:24 +02:00
|
|
|
|
namespace Content.Shared.DeviceNetwork.Components;
|
2022-06-10 03:28:24 +02:00
|
|
|
|
|
2023-09-28 16:20:29 -07:00
|
|
|
|
[RegisterComponent, NetworkedComponent, AutoGenerateComponentState]
|
2022-09-05 17:55:44 -07:00
|
|
|
|
[Access(typeof(SharedDeviceListSystem))]
|
2023-08-22 18:14:33 -07:00
|
|
|
|
public sealed partial class DeviceListComponent : Component
|
2022-06-10 03:28:24 +02:00
|
|
|
|
{
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// The list of devices can or can't connect to, depending on the <see cref="IsAllowList"/> field.
|
|
|
|
|
|
/// </summary>
|
2023-09-28 16:20:29 -07:00
|
|
|
|
[DataField, AutoNetworkedField]
|
2022-06-10 03:28:24 +02:00
|
|
|
|
public HashSet<EntityUid> Devices = new();
|
|
|
|
|
|
|
2022-09-05 18:22:39 -07:00
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// The limit of devices that can be linked to this device list.
|
|
|
|
|
|
/// </summary>
|
|
|
|
|
|
[ViewVariables(VVAccess.ReadWrite)]
|
2023-09-28 16:20:29 -07:00
|
|
|
|
[DataField]
|
2022-09-05 18:22:39 -07:00
|
|
|
|
public int DeviceLimit = 32;
|
|
|
|
|
|
|
2022-06-10 03:28:24 +02:00
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// Whether the device list is used as an allow or deny list
|
|
|
|
|
|
/// </summary>
|
|
|
|
|
|
[ViewVariables(VVAccess.ReadWrite)]
|
2023-09-28 16:20:29 -07:00
|
|
|
|
[DataField, AutoNetworkedField]
|
2022-06-10 03:28:24 +02:00
|
|
|
|
public bool IsAllowList = true;
|
|
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// Whether this device list also handles incoming device net packets
|
|
|
|
|
|
/// </summary>
|
|
|
|
|
|
[ViewVariables(VVAccess.ReadWrite)]
|
2023-09-28 16:20:29 -07:00
|
|
|
|
[DataField, AutoNetworkedField]
|
|
|
|
|
|
public bool HandleIncomingPackets;
|
2023-12-21 23:18:40 -05:00
|
|
|
|
|
|
|
|
|
|
[DataField, Access(typeof(SharedNetworkConfiguratorSystem))]
|
|
|
|
|
|
public HashSet<EntityUid> Configurators = new();
|
2022-09-05 17:55:44 -07:00
|
|
|
|
}
|