Website CGI (or page generator) to display Race CTS leaderboards of a Xonotic server.

scuti fd731108c7 narrowed paragraph selection in footer 1 týždeň pred
doc 0a8611065b Limited line width to 80 characters 7 rokov pred
include 4d1816e0ce merged branch 'speed-records', squashed 1 mesiac pred
output fd731108c7 narrowed paragraph selection in footer 1 týždeň pred
queries 4d1816e0ce merged branch 'speed-records', squashed 1 mesiac pred
scripts 9df1f3127b minor function rename 1 týždeň pred
src d549f73a43 corrected typo (of velocity) 3 týždňov pred
templates 4d1816e0ce merged branch 'speed-records', squashed 1 mesiac pred
.gitignore 38fc8210ab merge branch 'params', squashed 3 týždňov pred
LICENSE dad86bc0f2 Added license file 7 rokov pred
Makefile 4d1816e0ce merged branch 'speed-records', squashed 1 mesiac pred
README.md 38fc8210ab merge branch 'params', squashed 3 týždňov pred

README.md

xdfcgi

A common gateway inferface (CGI) program written in C to display Race CTS leaderboards of Xonotic servers. It can also be a static page generator.

Requirements

sqlite-devel python3 python-sqlite

Compiling

make 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).

sqlite3 my-new.db
sqlite > .read schema.sql

python scripts/import-from-xon.py my-new.db ~/.xonotic/data/data/server.db

Usage: (CGI) Queries

  • (none)

    • 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]

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

    • 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

The files allmaps.py, output/leaderboard.css, overview.html, map.html produce the output.

Before executing allmaps.py, copy and modify the templates.

cp templates/overview.html .
cp templates/map.html .

allmaps.py 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

Compilers

  • gcc (GCC) 10.2.1
  • MinGW, GCC 4.7.1

The script scripts/import-from-xon.py is based on https://git.teknik.io/antares/xonotic-py-sqlite3-defrag2db by Antares.