Networking · class
AuthorityHost
The machine whose world is the truth.
Explained in Networking and rollback.
class AuthorityHost<S>import { AuthorityHost } from '@driftengine/network';Constructor
new
constructor(options: AuthorityOptions<S>)| Parameter | Type | Description |
|---|---|---|
options | AuthorityOptions<S> |
Accessors
| Name | Type | Description |
|---|---|---|
publishedStatesget | number | How many state messages have gone out. For a consumer measuring what replication costs. |
Methods
poll
poll(): voidadvance
advance(dt: number, tick: number): voidTake a tick, then publish if this is a publishing tick.
| Parameter | Type | Description |
|---|---|---|
dt | number | |
tick | number |
More
The state is encoded after the step, so it describes the world at the end of tick, and
a client applying it reconciles at tick + 1. Publishing before the step would send the world
as it was when the tick began, which is the state the client already had.