Strategická: Podtržítko pro konzistenci
This commit is contained in:
parent
3bc785763c
commit
3c003403bb
2 changed files with 5 additions and 5 deletions
|
@ -11,7 +11,7 @@ Parametry:
|
||||||
- `main` - Hlavní hra
|
- `main` - Hlavní hra
|
||||||
- `test_{0,1,..}` Testovací hra daného uživatele (číslo je jako který tým hrají)
|
- `test_{0,1,..}` Testovací hra daného uživatele (číslo je jako který tým hrají)
|
||||||
- round_id: To zjistí z otazu na stav
|
- round_id: To zjistí z otazu na stav
|
||||||
- min_round: Validní odpovědi pouze pokud je tento nebo pozdější tah, jinak "too-early"
|
- min_round: Validní odpovědi pouze pokud je tento nebo pozdější tah, jinak "too_early"
|
||||||
|
|
||||||
Stav:
|
Stav:
|
||||||
GET na `/api/state?game=<jmeno_hry>&token=<token>&min_round=<min_round>`
|
GET na `/api/state?game=<jmeno_hry>&token=<token>&min_round=<min_round>`
|
||||||
|
@ -40,7 +40,7 @@ GET na `/api/state?game=<jmeno_hry>&token=<token>&min_round=<min_round>`
|
||||||
nebo
|
nebo
|
||||||
|
|
||||||
{
|
{
|
||||||
status: "working" nebo "too-early" # Server počítá následující stav nebo je některý z předchozích tahů, klient má počkat
|
status: "working" nebo "too_early" # Server počítá následující stav nebo je některý z předchozích tahů, klient má počkat
|
||||||
wait: <float> # Jak dlouho má klient čekat, než se zeptá znovu
|
wait: <float> # Jak dlouho má klient čekat, než se zeptá znovu
|
||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
@ -87,7 +87,7 @@ nebo
|
||||||
nebo
|
nebo
|
||||||
|
|
||||||
{
|
{
|
||||||
status: "too-late"
|
status: "too_late"
|
||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
|
||||||
|
|
|
@ -38,7 +38,7 @@ def api_state():
|
||||||
min_round = args_get("min_round", int, True)
|
min_round = args_get("min_round", int, True)
|
||||||
if min_round is not None and min_round > game.current_round:
|
if min_round is not None and min_round > game.current_round:
|
||||||
return json.dumps({
|
return json.dumps({
|
||||||
"status": "too-early",
|
"status": "too_early",
|
||||||
"wait": 5.0,
|
"wait": 5.0,
|
||||||
})
|
})
|
||||||
state = game.current_state()
|
state = game.current_state()
|
||||||
|
@ -58,7 +58,7 @@ def api_state():
|
||||||
def api_action():
|
def api_action():
|
||||||
def to_late():
|
def to_late():
|
||||||
return json.dumps({
|
return json.dumps({
|
||||||
"status": "too-late",
|
"status": "too_late",
|
||||||
})
|
})
|
||||||
team = get_context()
|
team = get_context()
|
||||||
game = team.game
|
game = team.game
|
||||||
|
|
Loading…
Reference in a new issue