Struct NetworkSimulatorParameter
Parameters for the global network simulator.
Implements
Inherited Members
Namespace: Unity.Networking.Transport
Assembly: Unity.Networking.Transport.dll
Syntax
[Serializable]
public struct NetworkSimulatorParameter : INetworkParameterRemarks
These parameters are for the global network simulator, which applies to all traffic going through a NetworkDriver (including control traffic). For the parameters of SimulatorPipelineStage, refer to SimulatorUtility.Parameters.
We recommend using SimulatorPipelineStage to simulate network conditions as it has more features than the global one (which is only intended for specialized use cases).
Fields
ReceiveMtu
Maximum packet length to process when receiving messages.
Declaration
public float ReceiveMtuField Value
| Type | Description | 
|---|---|
| float | Maximum size in bytes. | 
ReceivePacketLossPercent
Percentage of received packets to drop (0-100).
Declaration
public float ReceivePacketLossPercentField Value
| Type | Description | 
|---|---|
| float | Packet loss percentage. | 
SendDelayMS
Fixed delay to apply to sent packets.
Declaration
public uint SendDelayMSField Value
| Type | Description | 
|---|---|
| uint | Delay in milliseconds. | 
SendDuplicatePercent
Percentage of sent packets to duplicate (0-100).
Declaration
public float SendDuplicatePercentField Value
| Type | Description | 
|---|---|
| float | Packet duplicate percentage. | 
SendJitterMS
Delay variance to apply to sent packets.
Declaration
public uint SendJitterMSField Value
| Type | Description | 
|---|---|
| uint | Delay in milliseconds. | 
SendPacketLossPercent
Percentage of sent packets to drop (0-100).
Declaration
public float SendPacketLossPercentField Value
| Type | Description | 
|---|---|
| float | Packet loss percentage. | 
Methods
Validate()
Checks if the values for all fields are valid. This method will be automatically called when adding parameters to the NetworkSettings.
Declaration
public bool Validate()Returns
| Type | Description | 
|---|---|
| bool | True if the parameter is valid, false otherwise. |