Unrestrict device net ids (#8332)

This commit is contained in:
wrexbe
2022-05-22 07:36:21 -07:00
committed by GitHub
parent a1b2a9c142
commit 6fa431cfce
3 changed files with 24 additions and 33 deletions

View File

@@ -8,25 +8,21 @@ namespace Content.Server.DeviceNetwork.Components
[Friend(typeof(DeviceNetworkSystem), typeof(DeviceNet))]
public sealed class DeviceNetworkComponent : Component
{
/// <summary>
/// Valid device network NetIDs. The netID is used to separate device networks that shouldn't interact with
/// each other e.g. wireless and wired.
/// </summary>
[Serializable]
public enum ConnectionType
public enum DeviceNetIdDefaults
{
Private,
Wired,
Wireless,
Apc
Apc,
Reserved = 100,
// Ids outside this enum may exist
// This exists to let yml use nice names instead of numbers
}
// TODO allow devices to join more than one network?
// TODO if wireless/wired is determined by ConnectionType, what is the point of WirelessNetworkComponent & the
// other network-type-specific components? Shouldn't DeviceNetId determine conectivity checks?
[DataField("deviceNetId")]
public ConnectionType DeviceNetId { get; set; } = ConnectionType.Private;
public DeviceNetIdDefaults NetIdEnum { get; set; }
public int DeviceNetId => (int) NetIdEnum;
/// <summary>
/// The frequency that this device is listening on.