Saxonberg Server API
    Preparing search index...

    Sets the class-default policy for Application's instance methods to Public. Backend wraps every entry call site in ExecutionContextApi.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.

    Index

    Methods

    • 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'.

      Parameters

      • profile: PassportGoogleProfile

      Returns Promise<string>

    • 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.

      Parameters

      Returns Promise<string>

    • 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.

      Parameters

      • userId: string
      • sessionId: string
      • socketId: string
      • isBroadcast: boolean = false
      • OptionalclientIp: string

      Returns Promise<void>

    • Attach a provider profile to an existing User (authenticated link flow). Data-integrity logic lives here, not in a route handler:

      • profile unowned → attach → linked
      • profile already on user → no-op → already-linked
      • profile owned elsewhere → refuse, no write → collision No merge: a collision is refused with a clear message.

      Parameters

      Returns Promise<LinkResult>

    • 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.

      Parameters

      Returns Promise<void>

    • 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).

      Parameters

      • userId: string
      • name: string = 'Tester'
      • OptionalstartLocation: string

      Returns Promise<void>

    • Server→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.

      Parameters

      • interactive: default
      • key: string
      • value: unknown

      Returns void

    • 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.

      Parameters

      • interactive: default
      • template: EnvelopeTemplate

      Returns void

    • 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.

      Parameters

      • interactive: default
      • frame: MessageFrame

      Returns void

    • 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 linked → no-op → not-linked
      • removal would orphan → refuse → only-provider
      • otherwise clear + delete → unlinked

      Parameters

      • userId: string
      • provider: AuthProvider

      Returns Promise<UnlinkResult>

    • Wire 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.

      Returns void

    • Provider-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.

      Parameters

      Returns string