Backend for chess rpg game
Go to file
2022-07-02 00:05:17 +03:00
chess_backend added game state base logic, minor changes 2022-07-02 00:05:05 +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 game state base logic, minor changes 2022-07-02 00:05:05 +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 Update README.md 2022-07-01 15:13:28 +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

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"
}