Backwards-compatible Google delegate — the test-auth seam and any
Google-specific caller route through here. Forwards to the
provider-parameterized path with provider: 'google'.
Find or create User + provider profile from an OAuth profile. The provider-parameterized spine: adding a provider is this argument, not a code fork. For new users, the roster starts empty (char-gen owns character creation). Returns the User's id.
Handle user connection. Loads the authenticated User, spins up an Interactive, and hands off to Login to run the entry procedure.
The read-only broadcast principal (isBroadcast) short-circuits
before any of that: no User load, no Interactive, no Login, no
Avatar — it's registered with the BroadcastFeed as a pure push
target. With no Interactive in the connection registry it can never
run a command (processUserMessage finds no holder) and is never
routed game traffic.
OptionalclientIp: stringAttach a provider profile to an existing User (authenticated link
flow). Data-integrity logic lives here, not in a route handler:
linkedalready-linkedcollision
No merge: a collision is refused with a clear message.Dispatch an inbound wire message. Resolves the Interactive,
looks up the handler in inboundHandlers, and invokes it
with a HandlerContext. Handler bodies live in
backend/inbound/<substrate>.ts — adding a new message type
means adding a handler file there and registering it in
inbound/index.ts. Do not grow this method.
TEST-ONLY: give a user a ready-to-play default character so in-world
E2E tests don't have to walk char-gen first. Mirrors the retired
signup auto-mint (human, lobby, seed defaults), named from the test
handle. Backs the test-auth seam's withCharacter option. Gated on
AUTH_MODE === 'test'; idempotent (no-op if the user already owns a
character).
OptionalstartLocation: stringServer→client push of a ClientStateMixin key. Used when the
server mutates an overlay-shaped client-state key out-of-band
(the style verb is the v1 caller); the client receives the
authoritative value and re-renders without waiting on the
reconnect snapshot. Sibling of sendMessageToInteractive
— bypasses the Sensor pipeline (no frame, no frameId); it's
wire-substrate plumbing, not narrative.
Envelope counterpart to sendMessageToInteractive. Stamps
frameId per-Interactive from the same Interactive.nextFrameId
counter used for prose frames — one ordering primitive across all
server→client traffic.
Send a MessageFrame to a specific Interactive's client. Sole
gateway for game objects to reach Backend — Application owns
Backend communication. Stamps meta.frameId per-Interactive at
send-time so multi-device Avatars receive monotonic streams from
each Interactive's perspective.
Error / auth notifications (raw {type, payload} shapes) go
directly through Backend.sendMessageToSocket and bypass this
chokepoint — they're not Sensor-pipeline frames and have no
frameId to stamp.
Detach a provider from an existing User and delete the orphaned
profile (with its stored tokens). The collision-refuse rule
guarantees single ownership, so deletion is safe.
not-linkedonly-providerunlinkedWire the live broadcast-source push. When the operator changes the
livestream embed sources (config livestream.broadcastSources), fan
the new list to every connected player so the livestream-viewer embed
updates without a reconnect. The welcome snapshot
(ConnectionEstablishedPayload.broadcastSources) is the baseline.
Registered from AppBootstrap.run AFTER the EventRegistry is
bootstrapped (the TwitchRelayReader.boot() precedent) — NOT in
initialize(), which runs in the Server constructor before bootstrap.
StaticdefaultProvider-agnostic default avatar name read at account creation. A
throwaway (char-gen overwrites it), but a Twitch-origin user must
not fall to 'Unnamed'. Google: givenName ?? displayName;
Twitch: displayName ?? login.
Staticget
Sets the class-default policy for Application's instance methods to
Public. Backend wraps every entry call site inExecutionContextApi.runRoot(Backend, ...), so the live frame at Application's top is the network → Application root frame; this decorator is a forward-compatible declaration of intent rather than a runtime intercept (instance methods on Application aren't proxy-mediated). Per-method@CallSecurity(...)on any specific Application method would override.