Class ProtocolOptions
Network protocol configuration.
public sealed record ProtocolOptions : IEquatable<ProtocolOptions>
- Inheritance
-
ProtocolOptions
- Implements
- Inherited Members
Constructors
ProtocolOptions()
public ProtocolOptions()
Properties
CalculateRemotePlayerStats
When true, the session will calculate the remote player stats on each frame.
public bool CalculateRemotePlayerStats { get; set; }
Property Value
- bool
Defaults to
- See Also
ConsistencyCheckDistance
Offset to be applied to frame on checksum consistency check.
The frame sent is (LastReceivedFrame - ConsistencyCheckOffset
).
public int ConsistencyCheckDistance { get; set; }
Property Value
- int
Defaults to
8
- See Also
ConsistencyCheckEnabled
Enable/Disable consistency check.
public bool ConsistencyCheckEnabled { get; set; }
Property Value
- See Also
ConsistencyCheckInterval
The time to wait before send next consistency check (0 to disable). On each interval one peer requests a frame to other peer which must respond with the state checksum of that frame.
public TimeSpan ConsistencyCheckInterval { get; set; }
Property Value
- TimeSpan
Defaults to
3_000
milliseconds
- See Also
ConsistencyCheckTimeout
Max wait time for non-success consistency checks (0 to disable).
public TimeSpan ConsistencyCheckTimeout { get; set; }
Property Value
- TimeSpan
Defaults to
10_000
milliseconds
- See Also
DelayStrategy
Strategy for applying delay to sending packages, forcing latency. When NetworkLatency is Zero this is ignored.
public DelayStrategy DelayStrategy { get; set; }
Property Value
- DelayStrategy
Defaults to Gaussian
- See Also
DisconnectNotifyStart
The time to wait before the first ConnectionInterrupted timeout will be sent.
public TimeSpan DisconnectNotifyStart { get; set; }
Property Value
- TimeSpan
Defaults to
750
milliseconds
DisconnectTimeout
The session will automatically disconnect from a remote peer if it has not received a packet in the timeout window. You will be notified of the disconnect via Disconnected event.
public TimeSpan DisconnectTimeout { get; set; }
Property Value
- TimeSpan
Defaults to
5_000
milliseconds
DisconnectTimeoutEnabled
Enable or disable the disconnect timeout check DisconnectTimeout
public bool DisconnectTimeoutEnabled { get; set; }
Property Value
- bool
Defaults to
true
KeepAliveInterval
When the time from the last send package until now is greater than this, sends a keep alive packets.
public TimeSpan KeepAliveInterval { get; set; }
Property Value
- TimeSpan
Defaults to
200
milliseconds
MaxPackageQueue
Max allowed pending UDP output messages. When reached removes and ignores the oldest package in the queue in order to make room for the new package.
public int MaxPackageQueue { get; set; }
Property Value
- int
Defaults to
64
MaxPendingInputs
Max allowed pending inputs in sending queue. When reached AddLocalInput(NetcodePlayer, in TInput) will return InputDropped.
public int MaxPendingInputs { get; set; }
Property Value
- int
Defaults to
64
MaxSequenceDistance
Distance to check out-of-order packets.
public int MaxSequenceDistance { get; set; }
Property Value
- int
Defaults to
32_768
MaxSyncRetries
Total number of synchronization request retries. When reached, session will dispatch the SynchronizationFailure event.
public int MaxSyncRetries { get; set; }
Property Value
- int
Defaults to
64
NetworkLatency
Forced network packet sending latency for the current peer. This value is processed using DelayStrategy.
public TimeSpan NetworkLatency { get; set; }
Property Value
- See Also
NetworkPackageStatsEnabled
When true, session will use calculate packages stats.
public bool NetworkPackageStatsEnabled { get; set; }
Property Value
- bool
Defaults to
- See Also
NetworkPackageStatsInterval
The time to wait before recalculate network statistics.
public TimeSpan NetworkPackageStatsInterval { get; set; }
Property Value
- TimeSpan
Defaults to
1000
milliseconds
- See Also
NumberOfSyncRoundTrips
Number of synchronization roundtrips to consider two clients synchronized.
public int NumberOfSyncRoundTrips { get; set; }
Property Value
- int
Defaults to
10
QualityReportInterval
The time to wait before send the next quality report package (determines ping).
public TimeSpan QualityReportInterval { get; set; }
Property Value
- TimeSpan
Defaults to
1000
milliseconds
ReceiveSocketAddressSize
Custom receive socket address size
public int ReceiveSocketAddressSize { get; set; }
Property Value
ResendInputInterval
When the time from the last send input until now is greater than this, resends pending inputs.
public TimeSpan ResendInputInterval { get; set; }
Property Value
- TimeSpan
Defaults to
200
milliseconds
SerializationEndianness
Sets the Endianness used for network communication.
public Endianness SerializationEndianness { get; set; }
Property Value
- Endianness
Defaults to BigEndian
- See Also
ShutdownTime
The time to wait before end the session.
public TimeSpan ShutdownTime { get; set; }
Property Value
- TimeSpan
Defaults to
100
milliseconds
SyncFirstRetryInterval
The time to wait before resend the first synchronization request retry.
public TimeSpan SyncFirstRetryInterval { get; set; }
Property Value
- TimeSpan
Defaults to
500
milliseconds
- See Also
SyncRetryInterval
The time to wait before resend synchronization retries after the first.
public TimeSpan SyncRetryInterval { get; set; }
Property Value
- TimeSpan
Defaults to
1000
milliseconds
- See Also
UdpPacketBufferSize
Number of bytes used on the UdpSocket message buffer.
public int UdpPacketBufferSize { get; set; }
Property Value
- int
Defaults to (NumberOfPlayers * Backdash.Core.Max.CompressedBytes *
2
)
Methods
Equals(ProtocolOptions?)
public bool Equals(ProtocolOptions? other)
Parameters
other
ProtocolOptions
Returns
Equals(object?)
public override bool Equals(object? obj)
Parameters
obj
object
Returns
GetHashCode()
public override int GetHashCode()
Returns
ToString()
public override string ToString()
Returns
Operators
operator ==(ProtocolOptions?, ProtocolOptions?)
public static bool operator ==(ProtocolOptions? left, ProtocolOptions? right)
Parameters
left
ProtocolOptionsright
ProtocolOptions
Returns
operator !=(ProtocolOptions?, ProtocolOptions?)
public static bool operator !=(ProtocolOptions? left, ProtocolOptions? right)
Parameters
left
ProtocolOptionsright
ProtocolOptions