-
Notifications
You must be signed in to change notification settings - Fork 0
Commands
Jiří Petruželka edited this page Dec 1, 2013
·
24 revisions
Výstup kromě error je obalený v ['result' => ...]
Returns:
errors: [string[]]
Expects:
command: create_game
name [string]
language: [string] // 2-char code
player_limit [integer > 0]
time_limit [integer > 0] // seconds
round_limit [integer > 0] // no. of rounds
evaluation ["auto"|"manual"]
categories [string, CSV]
player_name [string]
Returns:
game_id [integer]
admin_token [string]
player_id [integer]
player_token [string]
Expects:
command: start_game
id [integer]
admin_token [string]
Returns:
void
Adds message:
round_started { round: 1, timestamp [time of start] }
Expects:
command: stop_game
id [integer]
admin_token [string]
Returns:
void
Adds message:
game_ended
Expects:
command: get_players
token [string]
id [integer]
Returns:
string[]
Expects:
command: get_games
game_filter [json:game_filters]
Returns:
[
id [integer]
language [string:2]
name [string]
player_count [integer]
player_total [integer]
evaluation [string]
time_limit [integer]
round_limit [integer]
categories [string:csv]
is_running [bool]
]
JSON:game_filters
not_full:bool
language:"language_code"
Expects:
command: get_scores
game_id [integer]
Returns:
[
player1_name => score,
player2_name => score,
...
]
Expects:
command: join_game
game_id [integer]
player_name [string]
Returns:
player_id [integer]
player_token [string]
Expects:
command: leave_game
game_id [integer]
token [string]
Returns:
void
Adds message:
left_game
Expects:
command: post_message
game_id [integer]
token [string]
type [string]
data [string]
Returns:
void
Expects:
command: leave_game
game_id [integer]
token [string]
* since_id [integer]
Returns:
[
id [integer]
type [string]
data [string]
], ...
Expects:
command: post_message
action: send_words
game_id [integer]
token [string]
words [string, CSV]
- left_game
- joined_game
- chat
- round_started (+ evaluation)
- round_ended
- game_finished (intentional)
- game_ended (unintentional)