Backend for chess rpg game
Go to file
2022-08-01 18:59:42 +03:00
chess_backend added celery 2022-07-30 03:25:43 +03:00
common fixed deck create, added function to generate room 2022-07-28 16:50:17 +03:00
game fixed hero create 2022-08-01 18:23:36 +03:00
media/dump_data updated hero model, add hero model fixture 2022-07-02 16:57:02 +03:00
requirements added celery 2022-07-30 03:25:43 +03:00
room fixed player model, added board state 2022-08-01 18:22:11 +03:00
.gitignore updated hero model, add hero model fixture 2022-07-02 16:57:02 +03:00
docker-compose.yaml Added docker compose 2022-07-02 15:23:49 +03:00
manage.py Initial commit, added base User and Hero models 2022-06-04 16:01:23 +03:00
nginx.conf Added nginx conf 2022-07-02 15:35:45 +03:00
README.md Update README.md 2022-08-01 18:59:42 +03:00

chess_rpg_backend

main 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
$ python3 manage.py loaddata media/dump_data/hero_model_fixture.json
$ docker run -p 6379:6379 -d redis:5

dev run

$ python3 manage.py runserver 0.0.0.0:8000

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