Skip to main content

PacketIdentity

readonly record struct

Represents the identity of a packet type.

Declaration

public readonly record struct PacketIdentity
NamespaceMcProtoNet.Protocol
AssemblyMcProtoNet.Protocol.dll
Sourcesrc/McProtoNet.Protocol/Flow/PacketIdentity.cs#L49 ↗

Remarks

A catalog is one pair of phase and direction. The ordinal is dense only within a single catalog, so it does not identify a packet on its own. It is stable across builds and is used to index dispatch tables and subscription slots.

Constructors

SignatureDescription
PacketIdentity(string Key, string Name, PacketPhase Phase, PacketDirection Direction, ushort Ordinal)Represents the identity of a packet type.

PacketIdentity(string, string, PacketPhase, PacketDirection, ushort)

public PacketIdentity(string Key, string Name, PacketPhase Phase, PacketDirection Direction, ushort Ordinal)

Represents the identity of a packet type.

Parameters: Key (String), Name (String), Phase (PacketPhase), Direction (PacketDirection), Ordinal (UInt16)

Properties

SignatureDescription
PacketDirection DirectionThe direction the packet travels in.
string KeyThe manifest key of the packet, such as login.toServer.login_start.
string NameThe name of the packet type.
ushort OrdinalThe dense index of the packet inside its catalog, ordered by key.
PacketPhase PhaseThe connection phase the packet belongs to.

Direction

public PacketDirection Direction { get; init; }

The direction the packet travels in.

Returns: PacketDirection

Key

public string Key { get; init; }

The manifest key of the packet, such as login.toServer.login_start.

Returns: String

Name

public string Name { get; init; }

The name of the packet type.

Returns: String

Ordinal

public ushort Ordinal { get; init; }

The dense index of the packet inside its catalog, ordered by key.

Returns: UInt16

Phase

public PacketPhase Phase { get; init; }

The connection phase the packet belongs to.

Returns: PacketPhase