Managers room state information, notifies subscribers of changes, and exposes helper methods for interacting with the room.

Hierarchy (view full)

Accessors

  • get generatorVersion(): {
        build: number;
        major: number;
        minor: number;
    }
  • Returns the version of Archipelago the seed was generated from.

    Returns {
        build: number;
        major: number;
        minor: number;
    }

    • build: number
    • major: number
    • minor: number

    All properties will be -1 prior to initial connection.

  • get race(): boolean
  • Experimental

    Returns if this seed was generated with race mode enabled (to be used to obscure unnecessary details to make clients race legal depending on rules).

    Returns boolean

  • get seedName(): string
  • Get the seed name for this room.

    Returns string

    In non-race seeds, this is based on the seed to generate this multi-world, but not exactly the same to prevent reverse engineering. In race seeds, this is completely random.

  • get serverVersion(): {
        build: number;
        major: number;
        minor: number;
    }
  • Returns the version of Archipelago the server is currently running.

    Returns {
        build: number;
        major: number;
        minor: number;
    }

    • build: number
    • major: number
    • minor: number

    All properties will be -1 prior to initial connection.

Methods

  • Removes an existing event listener.

    Type Parameters

    • Event extends
          | "passwordUpdated"
          | "permissionsUpdated"
          | "locationCheckPointsUpdated"
          | "hintCostUpdated"
          | "hintPointsUpdated"
          | "locationsChecked"

    Parameters

    • event: Event

      The event name associated with this listener to remove.

    • listener: ((...args: RoomStateEvents[Event]) => void)

      The callback function to remove.

    Returns this

    This object.

  • Add an event listener for a specific event.

    Type Parameters

    • Event extends
          | "passwordUpdated"
          | "permissionsUpdated"
          | "locationCheckPointsUpdated"
          | "hintCostUpdated"
          | "hintPointsUpdated"
          | "locationsChecked"

    Parameters

    • event: Event

      The event name to listen for.

    • listener: ((...args: RoomStateEvents[Event]) => void)

      The callback function to fire when this event is received.

    Returns this

    This object.

  • Returns a promise that waits for a single specified event to be received. Resolves with the list of arguments dispatched with the event.

    Type Parameters

    • Event extends
          | "passwordUpdated"
          | "permissionsUpdated"
          | "locationCheckPointsUpdated"
          | "hintCostUpdated"
          | "hintPointsUpdated"
          | "locationsChecked"

    Parameters

    • event: Event

      The event name to listen for.

    • clearPredicate: ((...args: RoomStateEvents[Event]) => boolean) = ...

      An optional predicate to check on incoming events to validate if the correct event has been received. If omitted, will return immediately on next event type received.

    Returns Promise<RoomStateEvents[Event]>