Saxonberg Server API
    Preparing search index...

    Static API for connection queries (public interface for mudlib).

    Index

    Constructors

    Methods

    • Detach an Interactive from its current holder. After detach, interactive.holder is null. Used at disconnect / cleanup (Interactive.onDestruct calls this).

      No-op when there's no current holder.

      Parameters

      Returns void

    • Get an Interactive by socket ID. Safe read-only operation for mudlib.

      Parameters

      • socketId: string

        Socket ID to look up

      Returns default | undefined

      Interactive or undefined if not found

    • Check if a socket ID has an active connection. Safe read-only operation for mudlib.

      Parameters

      • socketId: string

        Socket ID to check

      Returns boolean

      True if connection exists

    • The connecting player's origin, by playerId. Returns country only (a display name, broadly readable) — the raw IP never leaves the connection layer (the developer-gated IP read is deferred). Empty object when the player isn't connected or geo didn't resolve (localhost / private IP / unknown). The social presence relay reads originOf(player).country for the "from " arrival line.

      Parameters

      • playerId: string

      Returns ConnectionOrigin

    • Record an Interactive's connection origin from its handshake IP: the raw IP is stored transiently on the Interactive (in-memory only — the PII posture) and resolved to a country display name via the offline geo dataset. Called once at connect by the connection layer. A missing / unresolvable IP is a safe no-op.

      Parameters

      • interactive: default
      • ip: string | undefined

      Returns void

    • Route an Interactive to a new holder. Idempotent on the same target.

      This is connection routing, not character control or "operate on this avatar" — target is intentionally the broad HasInteractive set (Login during entry, Avatar during play, any future Bot/Spirit). Code that needs to act on an avatar specifically should narrow with instanceof Avatar (or MixinApi.isCommandGiver for command dispatch).

      Mechanics: removes interactive from its previous holder (if any), adds it to target via the HasInteractiveMixin primitives, and updates interactive.holder.

      Parameters

      Returns void