Game
Extends:
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 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:
Name | Type | Attribute | Description |
objectPattern | {"role": *, "gameId": *, "userId": *, "userName": *} |
|
Return:
* |
public organize(objectPattern: {"type": *, "owner": *, "options": *}): * source
Organizes a game
Params:
Name | Type | Attribute | Description |
objectPattern | {"type": *, "owner": *, "options": *} |
|
Return:
* |
public play(objectPattern: {"gameId": *, "userId": *, "data": *}): * source
Gives some command to the game engine
Params:
Name | Type | Attribute | Description |
objectPattern | {"gameId": *, "userId": *, "data": *} |
|
Return:
* |
public start(objectPattern: {"gameId": *}): * source
Starts a game
Params:
Name | Type | Attribute | Description |
objectPattern | {"gameId": *} |
|
Return:
* |
public unjoin(objectPattern: {"role": *, "gameId": *, "userId": *, "userName": *}): * source
A user cancels joining a game
Params:
Name | Type | Attribute | Description |
objectPattern | {"role": *, "gameId": *, "userId": *, "userName": *} |
|
Return:
* |