Saxonberg Server API
    Preparing search index...

    Public shape provided by HasInteractiveMixin.

    Witness hooks (optional methods) — fire from ConnectionApi:

    • onConnectionAttached(conn) / onConnectionDetached() — per-connection events, fire on every transfer/detach.
    • onLinkdead() / onLinkRestored() — presence transitions, fire only when the connection count crosses 0/1.
    interface HasInteractive {
        addInteractive(interactive: default): void;
        clearInteractives(): void;
        getClientState<T = unknown>(key: string): T;
        getInteractives(): ReadonlySet<default>;
        getPortraitUrl(): Promise<string>;
        hasInteractive(interactive: default): boolean;
        isConnected(): boolean;
        isLinkdead(): boolean;
        onConnectionAttached?(conn: default): void;
        onConnectionDetached?(): void;
        onLinkdead?(): void;
        onLinkRestored?(): void;
        pushClientStateUpdate(key: string, value: unknown): void;
        removeInteractive(interactive: default): boolean;
        setClientState(key: string, value: unknown): void;
        snapshotClientState(): Record<string, unknown>;
    }
    Index

    Methods

    • Return the stored value for a schema-declared key, or the default if the host has not written it. Throws on unknown keys — declarations live on static clientStateSchema.

      Type Parameters

      • T = unknown

      Parameters

      • key: string

      Returns T

    • Resolve the display portrait URL for this connected identity. Chain: the identity.portrait setting (empty on a Login, value- or-unset on an Avatar) → the connected account's Google photo → empty (the client renders a generated placeholder). Lives here, on the connection layer, so the portrait is available from the moment of connection — on a Login (start screen / character-select) as well as an in-world Avatar.

      Returns Promise<string>

    • Push an authoritative client-state value to every connected Interactive on this host (server→client client-state-update). Used after server-initiated mutations (the style verb) so the client re-renders without waiting on a reconnect snapshot. Caller is responsible for having already called setClientState and persisted; this is the push half only.

      Parameters

      • key: string
      • value: unknown

      Returns void

    • Validate key + value against the static schema, then persist. Throws on unknown keys or when the entry's optional validator rejects.

      Parameters

      • key: string
      • value: unknown

      Returns void