Code for checkmate 2015. Made using Python 3.4 and Django 1.8.
In this checkmate, there will be 2 (or more) servers. There will be one server running Django and housing the database. The other server(s) will have all frontend stuff (HTML pages, images, css, js, etc.). Those will be simple fileservers. The users will load HTML pages from one of the fileservers. JS code will make ajax calls to the Django backend server.
- All frontend files are in the folder named
static
. - All backend non-database data (like config and questions) is stored in the folder named
data
. - API endpoints are documented in endpoints.html.
- If you are on a linux system, write
make prepare
in terminal opened in the project's root. This will set up everything for you. If you are on Windows, you'll have to look atMakefile
and manually run all steps listed in it under the heading 'prepare'. - Run
python3 manage.py createsuperuser
if you want an administrator.
- Use
scripts/status.py
to control registration and access to the game. Its command line arguments are documented below. - Run
python3 scripts/end_game.py
to end the game. This will also close registration and disallow access to game. - During the game or after it, run
python3 scripts/get_cheaters.py
to get a list of all users who have created multiple accounts using the same IP address.
There are 3 portals: registration portal, game portal, leaderboard portal
- When the registration portal is open, people can register and get a team account
- When the game portal is open, people can play checkmate
- When the leaderboard portal is open, anyone can see the leaderboard
Running the script:
python3 scripts/status.py
: shows the status of all portalspython3 scripts/status.py (open|close)
: open or close all portalspython3 scripts/status.py [portal_name]
: shows the status of the specified portalpython3 scripts/status.py [portal_name] (open|close)
: open or close the specified portal