Class LatencySimulator
Inheritance
System.Object
LatencySimulator
Inherited Members
System.Object.Equals(System.Object)
System.Object.Equals(System.Object, System.Object)
System.Object.GetHashCode()
System.Object.GetType()
System.Object.MemberwiseClone()
System.Object.ReferenceEquals(System.Object, System.Object)
System.Object.ToString()
Namespace: FishNet.Managing.Transporting
Assembly: FishNet.Runtime.dll
Syntax
[Serializable]
public class LatencySimulator
Methods
AddOutgoing(Byte, ArraySegment<Byte>, Boolean, Int32)
Adds a packet for simulation.
Declaration
public void AddOutgoing(byte channelId, ArraySegment<byte> segment, bool toServer = true, int connectionId = -1)
Parameters
Type | Name | Description |
---|---|---|
System.Byte | channelId | |
System.ArraySegment<System.Byte> | segment | |
System.Boolean | toServer | |
System.Int32 | connectionId |
GetEnabled()
Gets the enabled value of simulator.
Declaration
public bool GetEnabled()
Returns
Type | Description |
---|---|
System.Boolean |
GetLatency()
Gets the latency value.
Declaration
public long GetLatency()
Returns
Type | Description |
---|---|
System.Int64 |
GetOutOfOrder()
Out of order chance, 1f is a 100% chance to occur.
Declaration
public double GetOutOfOrder()
Returns
Type | Description |
---|---|
System.Double |
GetPacketLost()
Gets packet loss chance. 1f is a 100% chance to occur.
Declaration
public double GetPacketLost()
Returns
Type | Description |
---|---|
System.Double |
Initialize(NetworkManager, Transport)
Declaration
public void Initialize(NetworkManager manager, Transport transport)
Parameters
Type | Name | Description |
---|---|---|
NetworkManager | manager | |
Transport | transport |
IterateOutgoing(Boolean)
Simulates pending outgoing packets.
Declaration
public void IterateOutgoing(bool toServer)
Parameters
Type | Name | Description |
---|---|---|
System.Boolean | toServer | True if sending to the server. |
RemovePendingForConnection(Int32)
Removes pending or held packets for a connection.
Declaration
public void RemovePendingForConnection(int connectionId)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | connectionId |
Reset()
Stops both client and server.
Declaration
public void Reset()
SetEnabled(Boolean)
Sets the enabled value of simulator.
Declaration
public void SetEnabled(bool value)
Parameters
Type | Name | Description |
---|---|---|
System.Boolean | value | New value. |
SetLatency(Int64)
Sets a new latency value.
Declaration
public void SetLatency(long value)
Parameters
Type | Name | Description |
---|---|---|
System.Int64 | value | Latency as milliseconds. |
SetOutOfOrder(Double)
Sets out of order chance. 1f is a 100% chance to occur.
Declaration
public void SetOutOfOrder(double value)
Parameters
Type | Name | Description |
---|---|---|
System.Double | value | New Value. |
SetPacketLoss(Double)
Sets packet loss chance. 1f is a 100% chance to occur.
Declaration
public void SetPacketLoss(double value)
Parameters
Type | Name | Description |
---|---|---|
System.Double | value | New Value. |