Table of Contents

Interface ITickSink

Namespace
Typhon.Protocol
Assembly
Typhon.Protocol.dll

Receives a decoded TICK, block by block, in stream order — the blocks Read<TSink>(ReadOnlySpan<byte>, CatalogPlan, ref TSink, TickBlocks) was asked for. Field values arrive through the IFieldSink members between the record call that opened them and the next record call.

public interface ITickSink : IFieldSink
Inherited Members

Methods

Ack(ushort, byte)

A command rejection.

void Ack(ushort seq, byte reason)

Parameters

seq ushort

The rejected command's sequence.

reason byte

The reason code (AckReasons).

AggregateCell(uint, scoped ReadOnlySpan<uint>)

One changed cell's counts, one per Archetypes entry.

void AggregateCell(uint cell, scoped ReadOnlySpan<uint> counts)

Parameters

cell uint

The row-major cell index.

counts ReadOnlySpan<uint>

The counts; valid only for the duration of the call.

BeginAggregate(CatalogGrid, bool)

An AGG block begins.

void BeginAggregate(CatalogGrid grid, bool reset)

Parameters

grid CatalogGrid

The grid.

reset bool

Whether every cell not listed is now empty.

BeginEntities(ArchetypePlan)

An ENTITIES block begins.

void BeginEntities(ArchetypePlan archetype)

Parameters

archetype ArchetypePlan

Its archetype.

BeginTick(uint, TickFlags, uint)

A frame begins.

void BeginTick(uint tick, TickFlags flags, uint periodUs)

Parameters

tick uint

The frame's tick.

flags TickFlags

The frame's flags.

periodUs uint

The elapsed interval's period when Period is set, otherwise 0.

Debug(byte, scoped ReadOnlySpan<byte>)

A DEBUG sub-block.

void Debug(byte subType, scoped ReadOnlySpan<byte> payload)

Parameters

subType byte

The sub-block type.

payload ReadOnlySpan<byte>

Its bytes; valid only for the duration of the call.

EndTick()

The frame ends.

void EndTick()

Enter(uint, scoped ReadOnlySpan<double>, scoped ReadOnlySpan<double>, uint, byte)

An enter record: its position, then every public field in wire order through the field members.

void Enter(uint netId, scoped ReadOnlySpan<double> position, scoped ReadOnlySpan<double> velocity, uint t0, byte epoch)

Parameters

netId uint

The entity.

position ReadOnlySpan<double>

The position, empty when the archetype is not spatial.

velocity ReadOnlySpan<double>

The velocity per tick, empty unless the archetype moves linearly.

t0 uint

The segment's start tick, 0 unless the archetype moves.

epoch byte

The teleport counter, 0 unless the archetype moves.

Event(MessagePlan)

An event: its fields follow through the field members.

void Event(MessagePlan type)

Parameters

type MessagePlan

The event type.

Ext(uint, scoped ReadOnlySpan<byte>)

An EXT block.

void Ext(uint appTypeId, scoped ReadOnlySpan<byte> payload)

Parameters

appTypeId uint

The application's payload type.

payload ReadOnlySpan<byte>

Its bytes; valid only for the duration of the call.

Leave(uint)

A leave. Applied last in the frame by a store, so an event can still resolve the entity.

void Leave(uint netId)

Parameters

netId uint

The entity.

Metric(MetricPlan, int, double)

One metric value.

void Metric(MetricPlan metric, int valueIndex, double value)

Parameters

metric MetricPlan

The metric.

valueIndex int

Which value of a labelled metric, 0 for a scalar.

value double

The value.

Segment(uint, scoped ReadOnlySpan<double>, scoped ReadOnlySpan<double>, uint, byte)

A motion segment.

void Segment(uint netId, scoped ReadOnlySpan<double> position, scoped ReadOnlySpan<double> velocity, uint t0, byte epoch)

Parameters

netId uint

The entity.

position ReadOnlySpan<double>

The segment's start position.

velocity ReadOnlySpan<double>

The velocity per tick, empty for the none model.

t0 uint

The segment's start tick.

epoch byte

The teleport counter; never interpolate across a change.

Self(ArchetypePlan, uint, ushort, byte)

The SELF block: the owner groups in ownerMask follow through the field members.

void Self(ArchetypePlan archetype, uint netId, ushort lastSeq, byte ownerMask)

Parameters

archetype ArchetypePlan

The controlled entity's archetype.

netId uint

The controlled entity.

lastSeq ushort

The highest command sequence drained into a tick at or before this frame's.

ownerMask byte

Bit i set when owner group i is carried.

Source(ushort, byte, ushort)

A source lifecycle entry.

void Source(ushort requestId, byte status, ushort code)

Parameters

requestId ushort

The client-chosen request id.

status byte

Applied or Error.

code ushort

The error code, 0 when applied.

State(uint, byte)

A state record: the fields of the groups in groupMask follow through the field members.

void State(uint netId, byte groupMask)

Parameters

netId uint

The entity.

groupMask byte

Bit i set when group i is carried.

UnknownBlock(byte)

A block of a type this library does not know, skipped.

void UnknownBlock(byte blockType)

Parameters

blockType byte

The type byte.