Class DeviceNetworkSystem
Entity system that handles everything device network related.
Device networking allows machines and devices to communicate with each other while adhering to restrictions like range or being connected to the same powernet.
Inheritance
System.Object
DeviceNetworkSystem
Assembly: Content.Server.dll
Syntax
public sealed class DeviceNetworkSystem : EntitySystem
Methods
|
Improve this Doc
View Source
ConnectDevice(EntityUid, DeviceNetworkComponent)
Connect an entity with a DeviceNetworkComponent. Note that this will re-use an existing address if the
device already had one configured. If there is a clash, the device cannot join the network.
Declaration
public bool ConnectDevice(EntityUid uid, DeviceNetworkComponent device = null)
Parameters
Returns
Type |
Description |
System.Boolean |
|
|
Improve this Doc
View Source
DisconnectDevice(EntityUid, DeviceNetworkComponent, Boolean)
Disconnect an entity with a DeviceNetworkComponent.
Declaration
public bool DisconnectDevice(EntityUid uid, DeviceNetworkComponent device, bool preventAutoConnect = true)
Parameters
Returns
Type |
Description |
System.Boolean |
|
|
Improve this Doc
View Source
Initialize()
Declaration
public override void Initialize()
|
Improve this Doc
View Source
IsAddressPresent(Int32, Nullable<String>)
Checks if an address exists in the network with the given netId
Declaration
public bool IsAddressPresent(int netId, string? address)
Parameters
Type |
Name |
Description |
System.Int32 |
netId |
|
System.Nullable<System.String> |
address |
|
Returns
Type |
Description |
System.Boolean |
|
|
Improve this Doc
View Source
IsDeviceConnected(EntityUid, DeviceNetworkComponent)
Checks if a device is already connected to its network
Declaration
public bool IsDeviceConnected(EntityUid uid, DeviceNetworkComponent device)
Parameters
Returns
Type |
Description |
System.Boolean |
True if the device was found in the network with its corresponding network id
|
|
Improve this Doc
View Source
QueuePacket(EntityUid, Nullable<String>, NetworkPayload, Nullable<UInt32>, Nullable<Int32>, DeviceNetworkComponent)
Sends the given payload as a device network packet to the entity with the given address and frequency.
Addresses are given to the DeviceNetworkComponent of an entity when connecting.
Declaration
public bool QueuePacket(EntityUid uid, string? address, NetworkPayload data, uint? frequency = null, int? network = null, DeviceNetworkComponent device = null)
Parameters
Type |
Name |
Description |
EntityUid |
uid |
The EntityUid of the sending entity
|
System.Nullable<System.String> |
address |
The address of the entity that the packet gets sent to. If null, the message is broadcast to all devices on that frequency (except the sender)
|
NetworkPayload |
data |
The data to be sent
|
System.Nullable<System.UInt32> |
frequency |
The frequency to send on
|
System.Nullable<System.Int32> |
network |
|
DeviceNetworkComponent |
device |
|
Returns
Type |
Description |
System.Boolean |
Returns true when the packet was successfully enqueued.
|
|
Improve this Doc
View Source
RandomizeAddress(EntityUid, DeviceNetworkComponent)
Declaration
public void RandomizeAddress(EntityUid uid, DeviceNetworkComponent device = null)
Parameters
|
Improve this Doc
View Source
SetAddress(EntityUid, String, DeviceNetworkComponent)
Declaration
public void SetAddress(EntityUid uid, string address, DeviceNetworkComponent device = null)
Parameters
|
Improve this Doc
View Source
SetReceiveAll(EntityUid, Boolean, DeviceNetworkComponent)
Declaration
public void SetReceiveAll(EntityUid uid, bool receiveAll, DeviceNetworkComponent device = null)
Parameters
|
Improve this Doc
View Source
SetReceiveFrequency(EntityUid, Nullable<UInt32>, DeviceNetworkComponent)
Declaration
public void SetReceiveFrequency(EntityUid uid, uint? frequency, DeviceNetworkComponent device = null)
Parameters
|
Improve this Doc
View Source
SetTransmitFrequency(EntityUid, Nullable<UInt32>, DeviceNetworkComponent)
Declaration
public void SetTransmitFrequency(EntityUid uid, uint? frequency, DeviceNetworkComponent device = null)
Parameters
|
Improve this Doc
View Source
SubscribeToDeviceShutdown(EntityUid, EntityUid, DeviceNetworkComponent, DeviceNetworkComponent)
Declaration
public void SubscribeToDeviceShutdown(EntityUid subscriberId, EntityUid targetId, DeviceNetworkComponent subscribingDevice = null, DeviceNetworkComponent targetDevice = null)
Parameters
|
Improve this Doc
View Source
UnsubscribeFromDeviceShutdown(EntityUid, EntityUid, DeviceNetworkComponent, DeviceNetworkComponent)
Declaration
public void UnsubscribeFromDeviceShutdown(EntityUid subscriberId, EntityUid targetId, DeviceNetworkComponent subscribingDevice = null, DeviceNetworkComponent targetDevice = null)
Parameters
|
Improve this Doc
View Source
Update(Single)
Declaration
public override void Update(float frameTime)
Parameters
Type |
Name |
Description |
System.Single |
frameTime |
|