Handles game state events from the DotA 2 game client and exposes functions to listen to specific in-game events. The game client reports either player or observer events depending on if the current user is playing or observing a game. The player game state event payload will be a subset of the observable game state, mostly including global map and current play state.

Hierarchy

  • GameStateServer

Constructors

  • Game state server constructor.

    Parameters

    • url: string = "/"

      (Optional) Path where game state event data from the client is received, defaults to "/".

    • debug: boolean = false

      (Optional) Whether to log more information, defaults to false.

    Returns GameStateServer

Properties

debug: boolean
events: EventEmitter
server: Server<typeof IncomingMessage, typeof ServerResponse>
url: string

Methods

  • Parameters

    • req: IncomingMessage
    • res: ServerResponse<IncomingMessage>

    Returns Promise<void>

  • Starts the game state integration server on the specified host and port. This should match the game state integration configuration in the DotA 2 game client.

    Parameters

    • port: number = 9001

      (Optional) Port number, defaults to 9001.

    • host: string = "127.0.0.1"

      (Optional) Host name, defaults to "127.0.0.1".

    Returns void

  • Parameters

    • req: IncomingMessage

    Returns Promise<[number, string]>

Generated using TypeDoc