Content update for NetEntities (#18935)
This commit is contained in:
@@ -40,11 +40,11 @@ public sealed partial class DeviceListComponent : Component
|
||||
[Serializable, NetSerializable]
|
||||
public sealed class DeviceListComponentState : ComponentState
|
||||
{
|
||||
public readonly HashSet<EntityUid> Devices;
|
||||
public readonly HashSet<NetEntity> Devices;
|
||||
public readonly bool IsAllowList;
|
||||
public readonly bool HandleIncomingPackets;
|
||||
|
||||
public DeviceListComponentState(HashSet<EntityUid> devices, bool isAllowList, bool handleIncomingPackets)
|
||||
public DeviceListComponentState(HashSet<NetEntity> devices, bool isAllowList, bool handleIncomingPackets)
|
||||
{
|
||||
Devices = devices;
|
||||
IsAllowList = isAllowList;
|
||||
|
||||
@@ -62,10 +62,10 @@ public sealed partial class NetworkConfiguratorComponent : Component
|
||||
[Serializable, NetSerializable]
|
||||
public sealed class NetworkConfiguratorComponentState : ComponentState
|
||||
{
|
||||
public readonly EntityUid? ActiveDeviceList;
|
||||
public readonly NetEntity? ActiveDeviceList;
|
||||
public readonly bool LinkModeActive;
|
||||
|
||||
public NetworkConfiguratorComponentState(EntityUid? activeDeviceList, bool linkModeActive)
|
||||
public NetworkConfiguratorComponentState(NetEntity? activeDeviceList, bool linkModeActive)
|
||||
{
|
||||
ActiveDeviceList = activeDeviceList;
|
||||
LinkModeActive = linkModeActive;
|
||||
|
||||
@@ -60,7 +60,7 @@ public abstract class SharedDeviceListSystem : EntitySystem
|
||||
|
||||
private void GetDeviceListState(EntityUid uid, DeviceListComponent comp, ref ComponentGetState args)
|
||||
{
|
||||
args.State = new DeviceListComponentState(comp.Devices, comp.IsAllowList, comp.HandleIncomingPackets);
|
||||
args.State = new DeviceListComponentState(GetNetEntitySet(comp.Devices), comp.IsAllowList, comp.HandleIncomingPackets);
|
||||
}
|
||||
|
||||
private void HandleDeviceListState(EntityUid uid, DeviceListComponent comp, ref ComponentHandleState args)
|
||||
@@ -70,7 +70,7 @@ public abstract class SharedDeviceListSystem : EntitySystem
|
||||
return;
|
||||
}
|
||||
|
||||
comp.Devices = state.Devices;
|
||||
comp.Devices = EnsureEntitySet<DeviceListComponent>(state.Devices, uid);
|
||||
comp.HandleIncomingPackets = state.HandleIncomingPackets;
|
||||
comp.IsAllowList = state.IsAllowList;
|
||||
}
|
||||
|
||||
@@ -18,7 +18,7 @@ public abstract class SharedNetworkConfiguratorSystem : EntitySystem
|
||||
private void GetNetworkConfiguratorState(EntityUid uid, NetworkConfiguratorComponent comp,
|
||||
ref ComponentGetState args)
|
||||
{
|
||||
args.State = new NetworkConfiguratorComponentState(comp.ActiveDeviceList, comp.LinkModeActive);
|
||||
args.State = new NetworkConfiguratorComponentState(GetNetEntity(comp.ActiveDeviceList), comp.LinkModeActive);
|
||||
}
|
||||
|
||||
private void HandleNetworkConfiguratorState(EntityUid uid, NetworkConfiguratorComponent comp,
|
||||
@@ -29,7 +29,7 @@ public abstract class SharedNetworkConfiguratorSystem : EntitySystem
|
||||
return;
|
||||
}
|
||||
|
||||
comp.ActiveDeviceList = state.ActiveDeviceList;
|
||||
comp.ActiveDeviceList = EnsureEntity<NetworkConfiguratorComponent>(state.ActiveDeviceList, uid);
|
||||
comp.LinkModeActive = state.LinkModeActive;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user