Options
All
  • Public
  • Public/Protected
  • All
Menu

The ClientSnapshot class is used to load a "snapshot" of a client on the server. The snapshot includes all of the client's attributes, a list of the rooms the client is in, and a list of rooms the client is observing. If the client is currently logged in under a user account, the snapshot also includes the userID for that account.

Hierarchy

Index

Constructors

constructor

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, scope: string): string | null
  • Returns the value of the specified client attribute.

    Parameters

    • name: string

      The attribute's name.

    • scope: string

      The attribute's scope. For global client attributes, specify scope null. For attributes scoped to a room, specify the room's id.

    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 client. The object is a map of fully qualified attribute name/value pairs. For details and examples, see the Client.getAttributes method, which returns an object of the same format.

    Returns {} | null

getClientID

  • getClientID(): string | null
  • Returns the clientID for this client snapshot object.

    Returns string | null

    A string clientID.

getListeners

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

    • type: string

    Returns EventListener[]

getObservedRoomIDs

  • getObservedRoomIDs(): string[] | null
  • Returns a list of the rooms observed by the client represented by this snapshot. Each item in the list a fully qualified string roomID.

    Returns string[] | null

getOccupiedRoomIDs

  • getOccupiedRoomIDs(): string[] | null
  • Returns a list of the rooms containing the client represented by this snapshot. Each item in the list a fully qualified string roomID.

    Returns string[] | null

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

getUserID

  • getUserID(): string | null
  • If the client represented by this snapshot object is logged in under a user account, getUserID() returns that account; otherwise, getUserID() returns null.

    Returns string | null

    A string userID.

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