Home Manual Reference Source
import {GameEngine} from 'zetapush-js/src/mapping/services.js'
public class | source

GameEngine

Extends:

src/mapping/core.js~Service → GameEngine

Game Engine API

The Game Engine API is for game engine clients, not end-users.

Static Member Summary

Static Public Members
public static get

Get default deployment id associated to GameEngine service

Method Summary

Public Methods
public

join_result(objectPattern: {"msgId": *, "payload": *, "error": *, "callerId": *}): *

Notify the result for a join request

public

organize_result(objectPattern: {"msgId": *, "payload": *, "error": *, "callerId": *}): *

Notify the result for an organization request

public

register(objectPattern: {"maxGames": *, "gameInfo": *, "location": *}): *

Registers a game engine

public

start_result(objectPattern: {"gameId": *}): *

Notify the result for a start request

public

state(objectPattern: {"status": *, "gameId": *, "data": *}): *

Notify a game event

public

unjoin_result(objectPattern: {"msgId": *, "payload": *, "error": *, "callerId": *}): *

Notify the result for an unjoin request

Static Public Members

public static get DEFAULT_DEPLOYMENT_ID: string: string source

Get default deployment id associated to GameEngine service

Return:

string

Public Methods

public join_result(objectPattern: {"msgId": *, "payload": *, "error": *, "callerId": *}): * source

Notify the result for a join request

A Game Engine notifies the STR of the result of a join request that it received on join_callback

Params:

NameTypeAttributeDescription
objectPattern {"msgId": *, "payload": *, "error": *, "callerId": *}
  • default: {"msgId":null,"payload":null,"error":null,"callerId":null}

Return:

*

public organize_result(objectPattern: {"msgId": *, "payload": *, "error": *, "callerId": *}): * source

Notify the result for an organization request

A Game Engine notifies the STR of the result of an organization request that it received on organize_callback

Params:

NameTypeAttributeDescription
objectPattern {"msgId": *, "payload": *, "error": *, "callerId": *}
  • default: {"msgId":null,"payload":null,"error":null,"callerId":null}

Return:

*

public register(objectPattern: {"maxGames": *, "gameInfo": *, "location": *}): * source

Registers a game engine

A client registers itself to the STR as a Game Engine. The STR may, from now on, dispatch game of the given game type to said client. Unregistration is done automatically on logoff.

Params:

NameTypeAttributeDescription
objectPattern {"maxGames": *, "gameInfo": *, "location": *}
  • default: {"maxGames":null,"gameInfo":null,"location":null}

Return:

*

public start_result(objectPattern: {"gameId": *}): * source

Notify the result for a start request

A Game Engine notifies the STR of the result of a start request that it received on start_callback

Params:

NameTypeAttributeDescription
objectPattern {"gameId": *}
  • default: {"gameId":null}

Return:

*

public state(objectPattern: {"status": *, "gameId": *, "data": *}): * source

Notify a game event

A Game Engine notifies the STR of some arbitrary game event.

Params:

NameTypeAttributeDescription
objectPattern {"status": *, "gameId": *, "data": *}
  • default: {"status":null,"gameId":null,"data":null}

Return:

*

public unjoin_result(objectPattern: {"msgId": *, "payload": *, "error": *, "callerId": *}): * source

Notify the result for an unjoin request

A Game Engine notifies the STR of the result of an unjoin request that it received on unjoin_callback

Params:

NameTypeAttributeDescription
objectPattern {"msgId": *, "payload": *, "error": *, "callerId": *}
  • default: {"msgId":null,"payload":null,"error":null,"callerId":null}

Return:

*