mirror of
https://github.com/evgen-app/chess_rpg_backend.git
synced 2024-11-22 09:37:05 +03:00
added websocket messages to README
This commit is contained in:
parent
df3685b8fe
commit
f9a0950c6c
26
README.md
26
README.md
|
@ -10,4 +10,28 @@ $ docker run -p 6379:6379 -d redis:5
|
||||||
### run
|
### run
|
||||||
```shell
|
```shell
|
||||||
$ python3 manage.py runserver 0.0.0.0:8000
|
$ python3 manage.py runserver 0.0.0.0:8000
|
||||||
```
|
```
|
||||||
|
|
||||||
|
### Описание команд сокетов
|
||||||
|
```json
|
||||||
|
# подключиние к очереди(ws://room/)
|
||||||
|
{
|
||||||
|
"type": "connect",
|
||||||
|
"deck_id": int
|
||||||
|
}
|
||||||
|
|
||||||
|
# коннект к комнате (сообщение от сервера)
|
||||||
|
{
|
||||||
|
"type": "INFO",
|
||||||
|
"opponent_score": int,
|
||||||
|
"coordinates" : [(x: int, y: int, type: str, model_url: url, your: bool), ...],
|
||||||
|
"opponent_online": true,
|
||||||
|
"first": bool
|
||||||
|
}
|
||||||
|
|
||||||
|
# состояние оппонента в комнате(сообщение от сервера)
|
||||||
|
{
|
||||||
|
"type": "INFO",
|
||||||
|
"message": "opponent is online" / "opponent is offline"
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
Loading…
Reference in New Issue
Block a user