LocalAuthority

class LocalAuthority
local.ts:56

Members

constructor

constructor(options: LocalAuthorityOptions) → LocalAuthority
optionsLocalAuthorityOptions
Undocumented

join

join(partition: PartitionKey, hello: ClientHello) → Promise<Result<Joined, string>>

Enter a partition. Resolves once the authority has accepted or refused.

Refusal is a Result, not a rejection, because a version mismatch is an answer rather than a failure — the save loader treats a newer schema the same way (ADR-0007), and for the same reason: proceeding anyway loses data that looks like it was preserved.

partitionPartitionKey
Undocumented
helloClientHello
Undocumented

leave

leave() → void

status

status() → AuthorityStatus

submit

submit(_intent: Intent) → void

Accepted and dropped, because there is nobody to relay it to.

Intent is outbound only even when there is a server: the client applies its own control input locally at 64 Hz and sends it on so that other clients can see the ship move. With no other clients the send has no recipient — it is not that the local case skips a step, it is that the step has no content. Counting them is what makes that visible on the overlay instead of merely true.

_intentIntent
Undocumented

subscribe

subscribe(handler: (update: AuthorityUpdate) → void) → () → void

Authoritative state for entities this client does not own.

Changes only — the current state is status(). A handler is never called with the entities the client said it owns; an authority that echoed a client's own ship back at it would be fighting the local simulation.

handler(update: AuthorityUpdate) → void
Undocumented