Class CommandsMessage
COMMANDS (0x83): u32 clientTick | varu count ≥ 1 | (varu cmdTypeIdx | u16 seq | fields)*, the client's batch for one rendered frame.
public static class CommandsMessage
- Inheritance
-
CommandsMessage
- Inherited Members
Remarks
Validated whole before anything is delivered (03-wire-protocol § 8: known type → length consumed exactly → decode). The message is decoded once into a checking sink — every type known, every enum value within its names (W13), not a byte left over — and only then decoded again into the caller's sink, so a malformed tail can never deliver the valid commands in front of it. Commands are small and rate-limited; decoding twice costs nothing measurable.
Methods
Read<TSink>(ReadOnlySpan<byte>, CatalogPlan, ref TSink)
Validates, then decodes, a whole COMMANDS message, type byte included.
public static void Read<TSink>(ReadOnlySpan<byte> message, CatalogPlan plan, ref TSink sink) where TSink : ICommandSink, allows ref struct
Parameters
messageReadOnlySpan<byte>The message.
planCatalogPlanThe session's compiled catalog.
sinkTSinkReceives the commands, only once the whole message has been validated.
Type Parameters
TSinkThe sink type.
Exceptions
- WireFormatException
The message is malformed; nothing reached
sink.
Write(ref WireWriter, uint, IReadOnlyList<(MessagePlan Type, ushort Seq, RecordValues Values)>)
Writes a COMMANDS message, type byte included.
public static void Write(ref WireWriter w, uint clientTick, IReadOnlyList<(MessagePlan Type, ushort Seq, RecordValues Values)> commands)
Parameters
wWireWriterThe writer.
clientTickuintThe client's tick for the batch.
commandsIReadOnlyList<(MessagePlan Type, ushort Seq, RecordValues Values)>At least one command: its type, sequence and field values.