In-game tools · function

observeSession

Watch a session for one frame.

Explained in In-game tools.

function observeSession(recorder: SessionRecorder, session: SessionLike): void
import { observeSession } from '@driftengine/tools';

Parameters

ParameterTypeDescription
recorderSessionRecorder
sessionSessionLike

In depth

desync is latched rather than an event, which is the whole reason this is not one line at the call site. A session keeps answering with the same disagreement on every frame until the next one arrives, so appending what it reads turns one divergence into sixty a second and buries the tick somebody is looking for under copies of itself. A disagreement is new when its tick and peer differ from the last one kept.

Bounded, because a session that desyncs every tick would otherwise grow an array forever behind a panel nobody has open.