Networking · interface

Replicator

What a consumer packs and unpacks.

Explained in Networking and rollback.

interface Replicator
import type { Replicator } from '@driftengine/network';

In depth

encode answers -1 when the state does not fit, for the reason the wire encoders do: the caller is a frame loop and AGENTS.md forbids throwing in one.

Methods

encode

encode(into: Uint8Array, tick: number): number
ParameterTypeDescription
intoUint8Array
ticknumber

apply

apply(from: Uint8Array, tick: number): void
ParameterTypeDescription
fromUint8Array
ticknumber