Backend for chess rpg game
Go to file
2022-07-01 15:12:32 +03:00
chess_backend added connection to room algorithm, minor changes for player model 2022-06-25 12:36:47 +03:00
common added connection to room algorithm, minor changes for player model 2022-06-25 12:36:47 +03:00
game added connection to room algorithm, minor changes for player model 2022-06-25 12:36:47 +03:00
room added message + scope status on opponent online/offline 2022-06-26 19:23:18 +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 websocket messages to README 2022-07-01 15:12:32 +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"
}