Skip to content

five-on-it / packages/protocol/src/snapshot-acked / AckedDecoder

Class: AckedDecoder ​

Defined in: packages/protocol/src/snapshot-acked.ts:392

The client's side of the acked snapshots: the states of its last frames, and every frame turned whole.

Constructors ​

Constructor ​

new AckedDecoder(): AckedDecoder

Returns ​

AckedDecoder

Properties ​

dropped ​

dropped: number = 0

Defined in: packages/protocol/src/snapshot-acked.ts:401

Frames dropped: their base not held, malformed, or failing their check.


failures ​

failures: number = 0

Defined in: packages/protocol/src/snapshot-acked.ts:405

Checks that failed (never, unless a frame went astray in a way nothing else caught).


stale ​

stale: number = 0

Defined in: packages/protocol/src/snapshot-acked.ts:403

Frames not newer than the last applied.

Accessors ​

ack ​

Get Signature ​

get ack(): number

Defined in: packages/protocol/src/snapshot-acked.ts:408

The newest tick applied: what the client acknowledges (0 before any).

Returns ​

number


framesHeld ​

Get Signature ​

get framesHeld(): number

Defined in: packages/protocol/src/snapshot-acked.ts:413

How many states the client keeps (at most HELD_RING).

Returns ​

number

Methods ​

decode() ​

decode(bytes): AckedFrame | undefined

Defined in: packages/protocol/src/snapshot-acked.ts:428

Decodes an acked frame onto the state of its base; undefined for another kind of frame, a stale one, one whose base is not held, or a malformed one.

Parameters ​

bytes ​

Uint8Array

Returns ​

AckedFrame | undefined


reset() ​

reset(): void

Defined in: packages/protocol/src/snapshot-acked.ts:418

Forgets every state (a switch from another kind of snapshots: a keyframe comes first).

Returns ​

void