Backend for chess rpg game
Go to file
2022-07-02 14:24:06 +03:00
chess_backend Added stable version for stable branch 2022-07-02 14:24:06 +03:00
common Added stable version for stable branch 2022-07-02 14:24:06 +03:00
game Added stable version for stable branch 2022-07-02 14:24:06 +03:00
room Added stable version for stable branch 2022-07-02 14:24:06 +03:00
.gitignore Added stable version for stable branch 2022-07-02 14:24:06 +03:00
manage.py Added stable version for stable branch 2022-07-02 14:24:06 +03:00
README.md Added stable version for stable branch 2022-07-02 14:24:06 +03:00
requirements.txt Added stable version for stable branch 2022-07-02 14:24:06 +03:00

chess_rpg_backend

Backend for chess rpg game

installation

$ python3 manage.py makemigrations & python3 manage.py migrate
$ docker run -p 6379:6379 -d redis:5

run

$ python3 manage.py runserver 0.0.0.0:8000  

Описание команд сокетов

# подключиние к очереди(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"
}