dashwire_replication library

Replicated state for dashwire, a property schema with permission axes, snapshot/delta sync, relevancy, spawning, and RPCs.

Classes

Codec<T>
Encodes values of T for the wire.
Codecs
Built-in codecs.
HostConfig
Server-side replication tuning.
LagCompensation<K, V>
Server-side per-tick history for lag-compensated rewind.
MemoryRoomStore
A RoomStore for tests and single-process setups.
NetId
Network identity of a replicated object, a (session, index) pair.
NetIdAllocator
Mints NetIds from one session.
Predictor<I, S>
Client-side prediction with authoritative input-replay reconciliation.
RelevancyFilter
Contributes ids to a peer's relevant set each tick.
Rep<T>
A replicated field holding a T.
RepField
Type-erased base of Rep, what the sync pipeline iterates.
Replica
Base class for replicated objects.
ReplicaRegistry
Factory table for spawnable replica types plus the schema hash.
ReplicationClient
The receiving end of replication.
ReplicationHost
The authoritative end of replication.
Room
One fixed-tick simulation, its peers, and its replication state. The unit of scaling, one room per isolate/process, state never spans rooms.
RoomStore
Where room snapshots persist between sessions. Implement over any store (files, a database, object storage).
RpcEndpoint<T>
A remote-procedure endpoint declared on a Replica.
SpatialGridFilter
Grid-bucketed spatial relevancy in 2D.
StructCodec<T>
Convenience for building one-off payload codecs for RPC argument records.
TransformReplica
A Replica carrying a world pose, the conventional base for anything an engine-side transform component can drive.

Enums

Authority
Who may write a field.
Delivery
ReadScope
Who receives a field.
RpcTarget
Where an RPC executes.
SendMode
How a replicated field travels.

Constants

voidCodec → const Codec<Object?>
An empty-args codec for RPCs with no payload; call such endpoints with null.

Functions

encodeAllFields(Replica replica) Uint8List
Bytes helper shared by tests and engine adapters.

Typedefs

Divergence<S> = bool Function(S predicted, S authoritative)
Whether a predicted state has diverged from the authoritative one enough to warrant a correction.
Interpolate<V> = V Function(V a, V b, double t)
Interpolates between two recorded values at fraction t in [0, 1].
Quat = (double, double, double, double)
Quaternion as (x, y, z, w).
SimulateStep<I, S> = S Function(S state, I input, double dt)
Deterministic per-tick simulation step, shared by the server and the predicting client so the two agree. Advances state by one fixed dt under input.
Vec3 = (double, double, double)
Three-component vector as a dependency-free record. Engine layers adapt their own vector types at the boundary.