Options
All
  • Public
  • Public/Protected
  • All
Menu

Hierarchy

  • BaseService
    • MessagesService

Index

Constructors

Properties

Accessors

Methods

Constructors

constructor

  • Returns MessagesService

Properties

container

container: DIContainer = <any>null

Accessors

Protected events

  • get events(): EventEmitter
  • Returns EventEmitter

Methods

_boot

  • _boot(): void
  • Returns void

listen

  • listen(messageID: string, callback: Function): void
  • Add a listener for a certain messageID

    Parameters

    • messageID: string

      message identifier to listen for

    • callback: Function

      Function to be called when messages with messageID are received

    Returns void

send

  • send(messageID: string, recipientID: string, payload?: any): Promise<boolean>
  • Send a realtime message to a certain player.

    Parameters

    • messageID: string

      string identifier for the message to be sent

    • recipientID: string

      player id to who the message will be sent

    • Default value payload: any = null

      data to be sent with the message

    Returns Promise<boolean>

setContainer

  • setContainer(container: DIContainer): this
  • Parameters

    • container: DIContainer

    Returns this

unlisten

  • unlisten(messageID: string, callback: Function): void
  • Removes a listener for a certain messageID

    Parameters

    • messageID: string

      message identifier to stop listen for

    • callback: Function

      The callback to stop calling

    Returns void

Generated using TypeDoc