Struct SnapshotPacketLossStatistics
Stores packet loss causes and statistics for all received snapshots. Thus, client-only (with one exception).
Access via Network
Inherited Members
Namespace: Unity.NetCode
Assembly: Unity.NetCode.dll
Syntax
public struct SnapshotPacketLossStatistics
Remarks
Very similar approach to Unity.
Fields
NumPacketsAcked
Server-only. Stores the number of snapshots the client has successfully replied that they have acked.
Declaration
public ulong NumPacketsAcked
Field Value
Type | Description |
---|---|
ulong |
NumPacketsCulledAsArrivedOnSameFrame
The Netcode package can only process one snapshot per render frame. If 2 or more arrive on the same frame, we'll delete all but one, without processing them.
Therefore, this form of packet loss is common when your connection jitter is higher than a Network
Declaration
public ulong NumPacketsCulledAsArrivedOnSameFrame
Field Value
Type | Description |
---|---|
ulong |
Remarks
This is also called a "Packet Burst".
NumPacketsCulledOutOfOrder
Counts the number of snapshot packets dropped (i.e. "culled") due to invalid SequenceId. I.e. Implies the packet arrived, but out of order.
Declaration
public ulong NumPacketsCulledOutOfOrder
Field Value
Type | Description |
---|---|
ulong |
NumPacketsDroppedNeverArrived
Detects gaps in Current
Declaration
public ulong NumPacketsDroppedNeverArrived
Field Value
Type | Description |
---|---|
ulong |
NumPacketsReceived
On the client, it counts the number of snapshot packets received by said client from the server. On the server, it stores the number of snapshots sent.
Declaration
public ulong NumPacketsReceived
Field Value
Type | Description |
---|---|
ulong |
Properties
AckPercent
Server-only. Percentage of all snapshot packets sent that the client has acked.
Declaration
public double AckPercent { get; }
Property Value
Type | Description |
---|---|
double |
ArrivedOnTheSameFrameClobberedPacketLossPercent
Percentage of all snapshot packets - that we assume must have been sent to us (based on SequenceId) - which are culled due to arriving on the same frame as another snapshot.
Declaration
public double ArrivedOnTheSameFrameClobberedPacketLossPercent { get; }
Property Value
Type | Description |
---|---|
double |
CombinedPacketLossCount
Count of packets lost in some form.
Declaration
public ulong CombinedPacketLossCount { get; }
Property Value
Type | Description |
---|---|
ulong |
CombinedPacketLossPercent
Percentage of all snapshot packets - that we assume must have been sent to us (based on SequenceId) - which are dropped (for any reason).
Declaration
public double CombinedPacketLossPercent { get; }
Property Value
Type | Description |
---|---|
double |
NetworkPacketLossPercent
Percentage of all snapshot packets - that we assume must have been sent to us (based on SequenceId) - which are lost due to network-caused packet loss.
Declaration
public double NetworkPacketLossPercent { get; }
Property Value
Type | Description |
---|---|
double |
OutOfOrderPacketLossPercent
Percentage of all snapshot packets - that we assume must have been sent to us (based on SequenceId) - which are lost due to arriving out of order (and thus being culled).
Declaration
public double OutOfOrderPacketLossPercent { get; }
Property Value
Type | Description |
---|---|
double |
Methods
ToFixedString()
Formatted dump of statistics for this world-type.
Declaration
public FixedString512Bytes ToFixedString()
Returns
Type | Description |
---|---|
Fixed |
Formatted dump of statistics for this world-type. |
Operators
operator +(SnapshotPacketLossStatistics, SnapshotPacketLossStatistics)
Adds two SnapshotPacketLossStatistics
Declaration
public static SnapshotPacketLossStatistics operator +(SnapshotPacketLossStatistics a, SnapshotPacketLossStatistics b)
Parameters
Type | Name | Description |
---|---|---|
Snapshot |
a | First SnapshotPacketLossStatistics |
Snapshot |
b | Second SnapshotPacketLossStatistics |
Returns
Type | Description |
---|---|
Snapshot |
The resulting sum of the two SnapshotPacketLossStatistics. |
operator -(SnapshotPacketLossStatistics, SnapshotPacketLossStatistics)
Subtracts two SnapshotPacketLossStatistics
Declaration
public static SnapshotPacketLossStatistics operator -(SnapshotPacketLossStatistics a, SnapshotPacketLossStatistics b)
Parameters
Type | Name | Description |
---|---|---|
Snapshot |
a | First SnapshotPacketLossStatistics |
Snapshot |
b | Second SnapshotPacketLossStatistics |
Returns
Type | Description |
---|---|
Snapshot |
The resulting difference of the two SnapshotPacketLossStatistics. |