Host

interface Host

What the harness is built over: the simulation, and the render side.

world must be a getter, not a captured reference. Loading a save replaces the world wholesale, and a host that copied the reference in at construction leaves the harness — and therefore the debug overlay — reporting on the world that was thrown away while the frame loop runs the new one. That split brain looked exactly like "load silently does nothing" from the outside. openSession is the one implementation; it gets this right once.

devtools/src/harness.ts:481

Members

canFlyreadonly

canFly: boolean

The trusted host capability: whether this host's walkers may fly. Never read off a save — a replaced world's walkers are given this one.

nowreadonly

now: () → number | null

The host's clock, for the things here that measure rather than simulate.

Null where the host has none, and the terrain baseline then reports "not timed" rather than reaching for performance.now() itself — which nothing below apps/ is allowed to do.

renderreadonly

render: RenderHost

worldreadonly

world: World

authority

authority() → AuthorityPort

Whoever owns the part of the simulation this client does not.

Always present: a solo player has a LocalAuthority, which is an implementation rather than the absence of one, and openSession supplies it when a caller does not.

controlPlayer

controlPlayer(id: EntityId) → void

Transfer control without replacing the world or rebuilding its adapters.

idEntityId
Undocumented

player

player() → EntityId | null

The entity the camera follows.

pool

pool() → WorkerPool | null

replaceWorld

replaceWorld(world: World, player: EntityId | null) → void

Replace the running world (used by load).

worldWorld
Undocumented
playerEntityId | null
Undocumented