|
@@ -8,34 +8,39 @@ A common gateway inferface (CGI) program written in C to display Race CTS leader
|
|
|
The first is only needed for compilation of the C program. The latter two are only for the auxiliary script `allmaps.py`.
|
|
|
|
|
|
## Compiling
|
|
|
-`make` makes a CGI program.
|
|
|
+`make` makes a static page generator.
|
|
|
|
|
|
-`make staticgen` makes a static page generator.
|
|
|
+`make cgi` makes a CGI program.
|
|
|
|
|
|
## Usage: Import data from Xonotic
|
|
|
|
|
|
-This program uses an sqlite3 database file created from `~/.xonotic/data/data/server.db` (text).
|
|
|
+This program uses an sqlite3 database file created from `~/.xonotic/data/data/server.db` (text).
|
|
|
|
|
|
sqlite3 my-new.db
|
|
|
sqlite > .read schema.sql
|
|
|
|
|
|
python scripts/import-from-xon.py my-new.db ~/.xonotic/data/data/server.db
|
|
|
|
|
|
-## Usage: CGI Query Strings
|
|
|
-The program queries the database `db/cts.db` (`./src/dbquery.c`, function `static bool executequery`)
|
|
|
+## Usage: (CGI) Queries
|
|
|
|
|
|
* `(none)`
|
|
|
- - Query file: `queries/mranks.sql`
|
|
|
- - Requests the map list of the server and related data.
|
|
|
+ - file: `queries/mranks.sql`
|
|
|
+ - Requests the map list of the server, the best times scored per map and by which player.
|
|
|
+
|
|
|
+* `?fastest-players`
|
|
|
+ - file: `queries/fastest-players.sql`
|
|
|
+ - Requests the map list of the server, the highest velocities attained per map and by which player.
|
|
|
|
|
|
* `?map=[map name]`
|
|
|
- - Query file: `queries/mleaderboard-ojoin.sql`
|
|
|
+ - file: `queries/mleaderboard-ojoin.sql`
|
|
|
- Requests the leaderboard of the map.
|
|
|
|
|
|
* `?player=[clientid]`
|
|
|
- - Query file: `queries/rplayers.sql`
|
|
|
+ - file: `queries/rplayers.sql`
|
|
|
- Requests a player's ranks for all maps leaderboards s/he is present on.
|
|
|
|
|
|
+`queries/fastest-player-of-map.sql` is used exclusively by the python script `scripts/allmaps.py`.
|
|
|
+
|
|
|
## Usage: Static Page Generation
|
|
|
|
|
|
python scripts/allmaps.py
|