Home Manual Reference Source
public class | source

Game

Extends:

src/mapping/core.js~Service → Game

User API for games

Users can list, start, join games, and play.

Static Member Summary

Static Public Members
public static get

Get default deployment id associated to Game service

Method Summary

Public Methods
public

available(): *

Lists game types

public

join(objectPattern: {"role": *, "gameId": *, "userId": *, "userName": *}): *

A user joins a game

public

organize(objectPattern: {"type": *, "owner": *, "options": *}): *

Organizes a game

public

play(objectPattern: {"gameId": *, "userId": *, "data": *}): *

Gives some command to the game engine

public

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

Starts a game

public

unjoin(objectPattern: {"role": *, "gameId": *, "userId": *, "userName": *}): *

A user cancels joining a game

Static Public Members

public static get DEFAULT_DEPLOYMENT_ID: string: string source

Get default deployment id associated to Game service

Return:

string

Public Methods

public available(): * source

Lists game types

Returns the list of game types supported by the server and the currently registered game engines.

Return:

*

public join(objectPattern: {"role": *, "gameId": *, "userId": *, "userName": *}): * source

A user joins a game

Params:

NameTypeAttributeDescription
objectPattern {"role": *, "gameId": *, "userId": *, "userName": *}
  • default: {"role":null,"gameId":null,"userId":null,"userName":null}

Return:

*

public organize(objectPattern: {"type": *, "owner": *, "options": *}): * source

Organizes a game

Params:

NameTypeAttributeDescription
objectPattern {"type": *, "owner": *, "options": *}
  • default: {"type":null,"owner":null,"options":null}

Return:

*

public play(objectPattern: {"gameId": *, "userId": *, "data": *}): * source

Gives some command to the game engine

Params:

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

Return:

*

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

Starts a game

Params:

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

Return:

*

public unjoin(objectPattern: {"role": *, "gameId": *, "userId": *, "userName": *}): * source

A user cancels joining a game

Params:

NameTypeAttributeDescription
objectPattern {"role": *, "gameId": *, "userId": *, "userName": *}
  • default: {"role":null,"gameId":null,"userId":null,"userName":null}

Return:

*