PacketIdentity
readonly record struct
Represents the identity of a packet type.
Declaration
public readonly record struct PacketIdentity
| Namespace | McProtoNet.Protocol |
| Assembly | McProtoNet.Protocol.dll |
| Source | src/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
| Signature | Description |
|---|---|
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
| Signature | Description |
|---|---|
PacketDirection Direction | The direction the packet travels in. |
string Key | The manifest key of the packet, such as login.toServer.login_start. |
string Name | The name of the packet type. |
ushort Ordinal | The dense index of the packet inside its catalog, ordered by key. |
PacketPhase Phase | The 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