Interface IGameNetworkPacket
- Namespace
- Moongate.Network.Packets.Interfaces
- Assembly
- Moongate.Network.Packets.dll
Defines the contract for parsing and writing a game network packet.
public interface IGameNetworkPacket
Properties
Length
Gets the packet length. Use -1 for variable-length packets.
int Length { get; }
Property Value
OpCode
Gets the packet opcode identifier.
byte OpCode { get; }
Property Value
Methods
TryParse(ReadOnlySpan<byte>)
Attempts to parse packet data from the given input span.
bool TryParse(ReadOnlySpan<byte> data)
Parameters
dataReadOnlySpan<byte>Raw packet bytes.
Returns
- bool
truewhen parsing succeeds; otherwisefalse.
Write(ref SpanWriter)
Writes packet bytes to the target span writer.
void Write(ref SpanWriter writer)
Parameters
writerSpanWriterDestination writer.