Options
All
  • Public
  • Public/Protected
  • All
Menu

Class ParticipantClient

Hierarchy

Implements

Index

Constructors

constructor

Properties

clientType

clientType: ClientType

The type this client instance is running as.

Protected socket

The client's socket.

state

state: IState

The client's state store.

Static defaultMaxListeners

defaultMaxListeners: number

Methods

addListener

  • addListener(event: string | symbol, listener: Function): this
  • Parameters

    • event: string | symbol
    • listener: Function

    Returns this

close

  • close(): void
  • Closes and frees the resources associated with the interactive connection.

    Returns void

createControls

createGroups

createScene

createScenes

deleteControls

deleteGroup

deleteScene

emit

  • emit(event: string | symbol, ...args: any[]): boolean
  • Parameters

    • event: string | symbol
    • Rest ...args: any[]

    Returns boolean

eventNames

  • eventNames(): (string | symbol)[]
  • Returns (string | symbol)[]

execute

  • execute(method: "updateWorld", params: IWorldUpdate, discard: false): Promise<ISceneDataArray>
  • execute(method: "createControls", params: ISceneData, discard: false): Promise<ISceneData>
  • execute(method: "ready", params: onReadyParams, discard: false): Promise<void>
  • execute(method: "capture", params: ITransactionCapture, discard: false): Promise<void>
  • execute(method: "getTime", params: null, discard: false): Promise<object>
  • execute(method: "getScenes", params: null, discard: false): Promise<ISceneDataArray>
  • execute<K>(method: "giveInput", params: K, discard: false): Promise<void>
  • execute(method: "updateControls", params: ISceneData, discard: false): Promise<void>
  • execute(method: "deleteControls", params: ISceneControlDeletion, discard: false): Promise<void>
  • execute(method: "getParticipantsByMixerID", params: IParticipantQuery, discard: false): Promise<IParticipantQueryResult>
  • execute<T>(method: string, params: T, discard: boolean): Promise<any>
  • updateWorld, Updates the top-level world state of the session

    Parameters

    Returns Promise<ISceneDataArray>

  • createControls will instruct the server to create your provided controls in the active, project. Participants will see the new controls as they are added.

    Parameters

    • method: "createControls"
    • params: ISceneData
    • discard: false

    Returns Promise<ISceneData>

  • ready allows you to indicate to the server the ready state of your GameClient. By specifying isReady false you can pause participant interaction whilst you setup scenes and controls.

    Parameters

    Returns Promise<void>

  • capture is used to capture a spark transaction that you have received from the server.

    Parameters

    Returns Promise<void>

  • getTime retrieves the server's unix timestamp. You can use this to synchronize your clock with the servers. See ClockSync for a Clock Synchronizer.

    Parameters

    • method: "getTime"
    • params: null
    • discard: false

    Returns Promise<object>

  • getScenes retrieves scenes stored ont he server. If you've used the studio to create your project, then you can use this to retrieve the scenes and controls created there.

    Parameters

    • method: "getScenes"
    • params: null
    • discard: false

    Returns Promise<ISceneDataArray>

  • giveInput is used to send participant interactive events to the server. These events will be received by the corresponding GameClient.

    Type parameters

    Parameters

    • method: "giveInput"
    • params: K
    • discard: false

    Returns Promise<void>

  • updateControls is used to update control properties within a scene, such as disabling a control.

    Parameters

    • method: "updateControls"
    • params: ISceneData
    • discard: false

    Returns Promise<void>

  • deleteControls will delete the specified controls from the server. Participants will see these controls vanish and will not be able to interact with them.

    Parameters

    Returns Promise<void>

  • Queries the server for a list of participants who match the provided userIDs. Future enhancements may allow for querying by other properties

    Parameters

    Returns Promise<IParticipantQueryResult>

  • Execute will construct and send a method to the server for execution. It will resolve with the server's reply. It is recommended that you use an existing Client method if available instead of manually calling execute.

    Type parameters

    • T

    Parameters

    • method: string
    • params: T
    • discard: boolean

    Returns Promise<any>

getGroups

getMaxListeners

  • getMaxListeners(): number
  • Returns number

getOptions

getScenes

getTime

  • getTime(): Promise<number>

giveInput

  • giveInput<T>(input: T): Promise<void>

listenerCount

  • listenerCount(type: string | symbol): number
  • Parameters

    • type: string | symbol

    Returns number

listeners

  • listeners(event: string | symbol): Function[]
  • Parameters

    • event: string | symbol

    Returns Function[]

on

  • on(event: string | symbol, listener: Function): this
  • Parameters

    • event: string | symbol
    • listener: Function

    Returns this

once

  • once(event: string | symbol, listener: Function): this
  • Parameters

    • event: string | symbol
    • listener: Function

    Returns this

open

prependListener

  • prependListener(event: string | symbol, listener: Function): this
  • Parameters

    • event: string | symbol
    • listener: Function

    Returns this

prependOnceListener

  • prependOnceListener(event: string | symbol, listener: Function): this
  • Parameters

    • event: string | symbol
    • listener: Function

    Returns this

processMethod

ready

  • ready(_: boolean): Promise<void>

removeAllListeners

  • removeAllListeners(event?: string | symbol): this
  • Parameters

    • Optional event: string | symbol

    Returns this

removeListener

  • removeListener(event: string | symbol, listener: Function): this
  • Parameters

    • event: string | symbol
    • listener: Function

    Returns this

reply

  • reply(reply: Reply): void

setCompression

  • Begins a negotiation process between the server and this client, the compression preferences of the client are sent to the server and then the server responds with the chosen compression scheme.

    Parameters

    Returns Promise<void>

setMaxListeners

  • setMaxListeners(n: number): this
  • Parameters

    • n: number

    Returns this

setOptions

synchronizeGroups

  • synchronizeGroups(): Promise<IGroup[]>

synchronizeScenes

  • synchronizeScenes(): Promise<IScene[]>

synchronizeState

updateControls

updateGroups

updateParticipants

updateScenes

Static listenerCount

  • listenerCount(emitter: EventEmitter, event: string | symbol): number
  • Parameters

    • emitter: EventEmitter
    • event: string | symbol

    Returns number

Generated using TypeDoc