Backend for chess rpg game
Go to file
2022-07-02 14:57:58 +03:00
chess_backend Added daphne support 2022-07-02 14:57:58 +03:00
common added game state base logic, minor changes 2022-07-02 00:05:05 +03:00
game added game state base logic, minor changes 2022-07-02 00:05:05 +03:00
room Added daphne support 2022-07-02 14:57:58 +03:00
.gitignore added character control endpoint 2022-06-04 19:30:54 +03:00
manage.py Initial commit, added base User and Hero models 2022-06-04 16:01:23 +03:00
README.md Added daphne support 2022-07-02 14:57:58 +03:00
requirements.txt added channels basic room consumer, minor updates for base game logic 2022-06-21 11:36:55 +03:00

chess_rpg_backend

DEV branch for backend for chess rpg game


dev server for up to date endpoints(web socket not provided)

installation

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

run

$ daphne -b 0.0.0.0 -p 8000 chess_backend.asgi:application             

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

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