Website CGI to display Race CTS leaderboards of a Xonotic server.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
scuti 2c368021e7 staticgen (#2) 6 months ago
doc Limited line width to 80 characters 5 years ago
output staticgen (#2) 6 months ago
queries staticgen (#2) 6 months ago
src staticgen (#2) 6 months ago
Makefile staticgen (#2) 6 months ago staticgen (#2) 6 months ago staticgen (#2) 6 months ago
template-generic.html staticgen (#2) 6 months ago
template_map-generic.html staticgen (#2) 6 months ago


A common gateway inferface (CGI) program written in C to display data related to Race CTS leaderboards of Xonotic servers. It may also serve as a static page generator.


sqlite-devel python3 python-sqlite

The first is only needed for compilation of the C program. The latter two are only for the auxiliary script


make makes a CGI program.

make staticgen makes a static page generator.

Usage: CGI Query Strings

The program queries the database db/cts.db (./src/dbquery.c, function static bool executequery)

  • (none)

    • Query file: queries/mranks.sql
    • Requests the map list of the server and related data.
  • ?map=[map name]

    • Query file: queries/mleaderboard-ojoin.sql
    • Requests the leaderboard of the map.
  • ?player=[clientid]

    • Query file: queries/rplayers.sql
    • Requests a player's ranks for all maps leaderboards s/he is present on.

Usage: Static Page Generation

The CGI program is still invoked in static generation. The files, output/leaderboard.css, template.html, template_map.html help produce the output.

Before executing, copy and modify the templates.

cp ./template-generic.html ./template.html
cp ./template_map-generic.html ./template_map.html outputs an html file for all distinct maps in the database. The leaderboards for each map (equivalent to ?map=[map name]) are in output/maps/.


Game Versions Used Under:

  • Xonotic 0.8.1
  • Xonotic 0.8.2


  • gcc (GCC) 10.2.1
  • MinGW, GCC 4.7.1

This program uses an sqlite3 database file created from ~/.xonotic/data/data/server.db.

The database may be built using xonotic-py-sqlite3-defrag2db.