Options
All
  • Public
  • Public/Protected
  • All
Menu

The RoomSnapshot class is used to load a "snapshot" of a room on the server. The snapshot includes all of the room's attributes, plus a list of the clients in the room and a list of the clients observing room.

The RoomSnapshot object is not kept up to date after it is loaded. To update a RoomSnapshot object to match latest the state of the server, pass that object to Orbiter.updateSnapshot method.

Hierarchy

Index

Constructors

constructor

  • Constructor

    Parameters

    • roomID: string

      The fully qualified roomID for this snapshot.

    • Optional password: undefined | string

      The room's password, if required.

    • Optional updateLevels: UpdateLevels

      Indicates the amount of information that should be included

    Returns RoomSnapshot

Properties

Readonly target

target: EventDispatcher

Methods

addEventListener

  • addEventListener(type: string, listener: Function, thisArg: any, priority?: number): boolean
  • Parameters

    • type: string
    • listener: Function
    • thisArg: any
    • Default value priority: number = 0

    Returns boolean

dispatchEvent

  • dispatchEvent(event: Event): void
  • Parameters

    • event: Event

    Returns void

getAttribute

  • getAttribute(name: string): string | null
  • Returns the value of the specified room attribute.

    Parameters

    • name: string

      The attribute's name.

    Returns string | null

    The attribute value.

getAttributes

  • getAttributes(): {} | {} | null
  • Returns an object whose variables represent the names and values of the shared attributes for this snapshot's room. For details and examples, see the Room class's getAttributes() method, which returns an object of the same format.

    Returns {} | {} | null

getListeners

  • getListeners(type: string): EventListener[]
  • Parameters

    • type: string

    Returns EventListener[]

getNumObservers

  • getNumObservers(): number
  • Returns the number of observers in the room represented by this snapshot.

    Returns number

getNumOccupants

  • getNumOccupants(): number
  • Returns the number of occupants in the room represented by this snapshot.

    Returns number

getObserver

  • getObserver(clientID: string): ClientManifest | null
  • Returns a ClientManifest object representing the room observer specified by clientID.

    Parameters

    • clientID: string

    Returns ClientManifest | null

getObservers

  • getObservers(): ClientManifest[]
  • Returns a list of the clients observing the room represented by this snapshot. Each item in the list is a string clientID.

    Returns ClientManifest[]

getOccupant

  • getOccupant(clientID: string): ClientManifest | null
  • Returns a ClientManifest object representing the room occupant specified by clientID.

    Parameters

    • clientID: string

    Returns ClientManifest | null

getOccupants

  • getOccupants(): ClientManifest[]
  • Returns a list of the clients in the room represented by this snapshot. Each item in the list is a string clientID.

    Returns ClientManifest[]

getRoomID

  • getRoomID(): string | null
  • Returns the fully qualified roomID for this room snapshot object.

    Returns string | null

    A string roomID.

getStatus

  • getStatus(): Status | undefined
  • Returns the status of the most recent snapshot load-operation. If a load operation is currently in progress, getStatus() returns null. The possible return values of getStatus() depend on the snapshot type.

    Returns Status | undefined

hasListener

  • hasListener(type: string, listener: Function, thisArg: any): boolean
  • Parameters

    • type: string
    • listener: Function
    • thisArg: any

    Returns boolean

removeEventListener

  • removeEventListener(type: string, listener: Function, thisArg: any): boolean
  • Parameters

    • type: string
    • listener: Function
    • thisArg: any

    Returns boolean

updateInProgress

  • updateInProgress(): boolean | undefined
  • Indicates whether the snapshot is currently loading data. While an update is in progress, further requests to update the snapshot are ignored.

    Returns boolean | undefined