Skip to main content

Crate synctick

Crate synctick 

Source
Expand description

Engine-independent server-sequenced deterministic sessions.

Implement Game and Simulation, then use host, dedicated_server, connect or replay. Transport channels and replay envelopes are private.

Re-exports§

pub use codec::Wire;
pub use hashing::StableHash;
pub use hashing::StateHasher;
pub use hashing::stable_hash;

Modules§

codec
Bounded game payloads. Implement Wire with the same field order in all three operations. Validation must traverse the full shape without allocating.
hashing
Stable state fingerprints for a known game schema, independent of the wire codec.

Structs§

ClientConfig
CommandSender
Input
ReplayOutcome
ServerConfig
Fixed-duration sessions only. Queue capacity is local; the duration is saved and adopted by clients and resumed sessions.
SessionControl
Presentation status never enters deterministic simulation state.
SessionHandle
Owns worker shutdown. Explicit shutdown/join returns the retained terminal result; Drop also cancels and joins, logging otherwise unobserved failures.
Tick

Enums§

DesyncPolicy
LoadingPhase
ParticipantId
Session-local origin, not an authenticated account. Remote IDs come from the connection, never from the command payload. Host cannot be impersonated by selecting a remote numeric ID.
SessionError
SessionStatus
SubmitError

Traits§

Game
Supply only game rules, initialization, commands and state fingerprinting. The factory runs on the worker thread; the simulation need not be Send.
Simulation
Deterministic state, owned exclusively by the session worker.

Functions§

connect
Connect a replica. The server’s validated header supplies initialization and timing.
dedicated_server
Start an authority without a local participant. Its command handle stays disabled.
host
Start an authority with a local participant and optional remote participants.
replay
Replay synchronously on the calling thread. Pass a control to support signals.

Type Aliases§

SessionResult

Derive Macros§

StableHash
Hash fields in declaration order, with explicit byte tags for enums.
Wire
Generate bounded codec passes for structs and explicitly tagged enums.