cast.receiver. games
This is the chrome.cast.games namespace.
Classes
Event
Event used by cast.receiver.games.GameManager
. The constructor has no parameters to allow a pool of events to be pre-allocated. Note that properties are declared via prototype to allow exporting via automatic extern generator.
GameManager
Used to determine who is connected to the receiver, who is ready to play, and who is playing the game on the receiver.
GameManagerConfig
Used by the constructor of cast.receiver.games.GameManager
to configure the game manager.
GameManagerResult
Represents the status code and error details from processing a game manager request.
PlayerInfo
Represents player information maintained by the game manager.
Interface
GameManagerListener
Enumerations
EventType
string
Event types dispatched by cast.receiver.games.GameManager
.
Value |
|
---|---|
UNKNOWN |
The event is undefined. |
PLAYER_AVAILABLE |
Fired when the game manager receives a request that changes the player state to |
PLAYER_READY |
Fired when the game manager receives a request that changes the player state to |
PLAYER_IDLE |
Fired when the game manager receives a request that changes the player state to |
PLAYER_PLAYING |
Fired when the game manager receives a request that changes the player state to |
PLAYER_DROPPED |
Fired when the game manager receives a request that changes the player state to |
PLAYER_QUIT |
Fired when the game manager receives a request that changes the player state to |
GAME_MESSAGE_RECEIVED |
Fired when the game manager receives a game specific message. |
GAME_LOADING |
Fired when the game manager receives a request that changes gameplay state to |
GAME_RUNNING |
Fired when the game manager receives a request that changes gameplay state to |
GAME_PAUSED |
Fired when the game manager receives a request that changes gameplay state to |
GAME_SHOWING_INFO_SCREEN |
Fired when the game manager receives a request that changes gameplay state to |
LOBBY_OPEN |
Fired when the game manager receives a request that changes lobby state to
|
LOBBY_CLOSED |
Fired when the game manager receives a request that changes lobby state to
|
PLAYER_DATA_CHANGED |
Fired when the game manager receives a request that changes player data. |
GAME_DATA_CHANGED |
Fired when the game manager receives a request that changes game data. |
GAME_STATUS_TEXT_CHANGED |
Fired when the game manager receives a request that changes game status text. |
GameplayState
number
Represents the game states during gameplay.
Value |
|
---|---|
UNKNOWN |
Unknown game state. |
LOADING |
Game state for when the game is loading. |
RUNNING |
Game state for when the game is running. |
PAUSED |
Game state for when the game is paused. |
SHOWING_INFO_SCREEN |
Game state for when the game is showing an information screen. |
LobbyState
number
Represents the game lobby states.
Value |
|
---|---|
UNKNOWN |
Unknown lobby state. |
OPEN |
Lobby is open and accepting players to join. |
CLOSED |
Lobby is closed and not accepting players. |
PlayerState
number
Represents the player states.
Value |
|
---|---|
UNKNOWN |
Unknown player state. |
DROPPED |
The player is no longer connected to the receiver because of a network drop. |
QUIT |
The player has manually chosen to disconnect from the receiver. |
AVAILABLE |
The player is connected to the receiver and available to join a game. |
READY |
The player is connected to the receiver, and ready to enter the game. |
IDLE |
The player is connected to the receiver, in the game, and idle. |
PLAYING |
The player is connected to the receiver, in the game, and actively playing. |
StatusCode
number
Represents types of status codes from processing game manager requests.
Value |
|
---|---|
SUCCESS |
Status code indicating no error (success). |
INVALID_REQUEST |
Status code indicating the request is invalid or contains invalid parameters. |
NOT_ALLOWED |
Status code indicating that the request was disallowed and could not be completed. |
INCORRECT_VERSION |
Status code indicating the SDK version in the request does not match the version expected by the game manager. |
TOO_MANY_PLAYERS |
Status code indicating the number of players connected and available on the receiver is greater than the maximum number of players specified in the configuration object for the receiver game. |
Properties
EventType
string
Event types dispatched by cast.receiver.games.GameManager
.
Value |
|
---|---|
UNKNOWN |
The event is undefined. |
PLAYER_AVAILABLE |
Fired when the game manager receives a request that changes the player state to |
PLAYER_READY |
Fired when the game manager receives a request that changes the player state to |
PLAYER_IDLE |
Fired when the game manager receives a request that changes the player state to |
PLAYER_PLAYING |
Fired when the game manager receives a request that changes the player state to |
PLAYER_DROPPED |
Fired when the game manager receives a request that changes the player state to |
PLAYER_QUIT |
Fired when the game manager receives a request that changes the player state to |
GAME_MESSAGE_RECEIVED |
Fired when the game manager receives a game specific message. |
GAME_LOADING |
Fired when the game manager receives a request that changes gameplay state to |
GAME_RUNNING |
Fired when the game manager receives a request that changes gameplay state to |
GAME_PAUSED |
Fired when the game manager receives a request that changes gameplay state to |
GAME_SHOWING_INFO_SCREEN |
Fired when the game manager receives a request that changes gameplay state to |
LOBBY_OPEN |
Fired when the game manager receives a request that changes lobby state to
|
LOBBY_CLOSED |
Fired when the game manager receives a request that changes lobby state to
|
PLAYER_DATA_CHANGED |
Fired when the game manager receives a request that changes player data. |
GAME_DATA_CHANGED |
Fired when the game manager receives a request that changes game data. |
GAME_STATUS_TEXT_CHANGED |
Fired when the game manager receives a request that changes game status text. |
GameplayState
number
Represents the game states during gameplay.
Value |
|
---|---|
UNKNOWN |
Unknown game state. |
LOADING |
Game state for when the game is loading. |
RUNNING |
Game state for when the game is running. |
PAUSED |
Game state for when the game is paused. |
SHOWING_INFO_SCREEN |
Game state for when the game is showing an information screen. |
LobbyState
number
Represents the game lobby states.
Value |
|
---|---|
UNKNOWN |
Unknown lobby state. |
OPEN |
Lobby is open and accepting players to join. |
CLOSED |
Lobby is closed and not accepting players. |
PlayerState
number
Represents the player states.
Value |
|
---|---|
UNKNOWN |
Unknown player state. |
DROPPED |
The player is no longer connected to the receiver because of a network drop. |
QUIT |
The player has manually chosen to disconnect from the receiver. |
AVAILABLE |
The player is connected to the receiver and available to join a game. |
READY |
The player is connected to the receiver, and ready to enter the game. |
IDLE |
The player is connected to the receiver, in the game, and idle. |
PLAYING |
The player is connected to the receiver, in the game, and actively playing. |
StatusCode
number
Represents types of status codes from processing game manager requests.
Value |
|
---|---|
SUCCESS |
Status code indicating no error (success). |
INVALID_REQUEST |
Status code indicating the request is invalid or contains invalid parameters. |
NOT_ALLOWED |
Status code indicating that the request was disallowed and could not be completed. |
INCORRECT_VERSION |
Status code indicating the SDK version in the request does not match the version expected by the game manager. |
TOO_MANY_PLAYERS |
Status code indicating the number of players connected and available on the receiver is greater than the maximum number of players specified in the configuration object for the receiver game. |