Manage a turn based game session.
The turn-game module will:
redis_games redis database.redis_games.redis_auth database to check requester identity.RULES_PORT_8080_TCP_ADDR - IP of the rules serviceRULES_PORT_8080_TCP_PORT - Port of the rules serviceCHAT_PORT_8080_TCP_ADDR - IP of the chat service (optional)CHAT_PORT_8080_TCP_PORT - Port of the chat service (optional)NOTIFICATIONS_PORT_8080_TCP_ADDR - IP of the notifications serviceNOTIFICATIONS_PORT_8080_TCP_PORT - Port of the notifications serviceAPI_SECRET - Secret key used to send notificationsREDIS_AUTH_PORT_6379_TCP_ADDR - IP of the AuthDB redisREDIS_AUTH_PORT_6379_TCP_PORT - Port of the AuthDB redisREDIS_GAMES_PORT_6379_TCP_ADDR - IP of the games redisREDIS_GAMES_PORT_6379_TCP_PORT - Port of the games redisAll requests made to the turngame API require an auth token, passed in the request URL.
+ Parameters
+ token (string) ... User authentication token
+ id (string) ... ID of the game
{
"id": "ab12345789",
"type": "triominos/v1",
"players": [ "some_username_1", "some_username_2" ],
"turn": "some_username_1",
"status": "active",
"gameData": { ... }
}
Possible status:
inactiveactivegameoverUse the appropriate rules-api service to initiate a new game.
{
"type": "triominos/v1",
"players": [ "some_username_1", "some_username_2" ],
"gameConfig": {
... game specific data to be passed to the rules-api ...
}
}
{
"id": "1234",
"type": "triominos/v1",
"players": [ "some_username", "other_username" ],
"turn": "some_username",
"status": "inactive",
"gameData": {
... game specific data ...
}
}
+ Parameters
+ token (string) ... Authentication token
+ id (string) ... ID of the game
Add a move, optionally trigger a chat system event (if "chatEvent" is provided).
{
"moveData": { ... },
"chatEvent": "pass"
}
{
"id": "string",
"type": "triominos/v1",
"players": [ "some_username", "other_username" ],
"turn": "other_username",
"status": "active",
"gameData": {
... game specific data ...
},
"moveResult" {
... game specific data ...
}
}
{
"code": "InvalidPosition"
}
List of codes will be application dependent, as returned by the rules-api
[
{
"player": "some_username",
"move": { ... }
},
{
"player": "other_username",
"move": { ... }
},
{
"player": "some_username",
"move": { ... }
}
]
Content type
Image
Digest
sha256:70c758add…
Size
369.9 MB
Last updated
over 5 years ago
docker pull ganomede/turngame