shinqlx
ShiN0's Quake Live eXtension, implemented in Rust. Most functionality from minqlx should work. Support for Python 3.9 and above should work out of the box.
Some limitations apply for certain minqlx functions maybe used in plugins.
- 32-bit is unsupported. Earlier versions included support for it, but after too long of being untests, we dropped support for that older CPU types.
- Some compatibility might not work, as this implementation is not yet fully tested.
- plugins that use db.zincrby, db.lrem or db.setex need to provide the value and amount parameters through keyword arguments. This might be a breaking change for some plugins, but ensures Python redis 2.0 compatibility for these calls to later versions. We stick with redis >= 5.0.
The documentation is at shinqlx.readthedocs.io. It has a page "Migration from
minqlx" that lists all deviations. The tool plugin_migration (see
plugin_migration/README.md) migrates a whole folder of minqlx plugins. The tool ql_demo
(see ql_demo/README.md) converts the match recordings of shinqlx to Quake Live demos. The console
tool ql_rcon (see ql_rcon/README.md) and the stats viewer ql_stats (see
ql_stats/README.md) talk to the ZMQ interfaces of a server.
Compilation and installation
- Install rust with the default profile and the nightly toolchain and Rust's build tool cargo, and make sure to add the rust-src component:
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh
rustup install nightly --profile default
rustup +nightly component add rust-src
rustup default nightly
- Install Python 3.
sudo apt-get update
sudo apt-get -y install python3 python3-dev python3-venv python3-pip
- Make sure, that you have installed Python 3.9 or later:
python3 --version
- Now you should get Redis, Git and build utils which will be used by minqlx's plugins and for compiling shinqlx:
sudo apt-get -y install redis-server pkg-config libssl-dev git build-essential
Valkey, KeyDB and Dragonfly work in place of Redis; see the Redis class in the database documentation.
- To avoid interference with operating system packages (and future adaptions from Debian v12 onwards for example), I recommend installing a python virtual environment to install the packges that shinqlx/minqlx or your plugins need:
python3 -m venv ~/qlds/.venv
source ~/qlds/.venv/bin/activate
If you need to install additional packages later, you can activate the virtual python environment
with source ~/qlds/.venv/bin/activate anytime, and then run your pip install <library> as you like.
- Install maturin into the virtual python environment:
pip install maturin
- Install shinqlx from pypi source distribution into the virtual python environment (this may take a while):
pip install shinqlx
- Since this may take a while, if you want to see the current progress use run in verbose mode:
pip install -v shinqlx
- Copy the convenience script
run_server_shinqlx.shinto~/qlds, or whatever other directory you might have installed the quake live dedicated server files in. (Note: The remaining sections assume you installed the dedicated server into ~/qlds)
cp run_server_shinqlx.sh ~/qlds/
Note: In your server startup script, you will have to also activate the the python virtual environment where the
different python libraries are installed. I recommend writing a custom script that can be started with supervisord
later on, that calls run_server_shinqlx.sh, i.e.:
#!/bin/bash
basepath="$(dirname $0)"
gameport=`expr $1 + 27960`
rconport=`expr $1 + 28960`
source ~/.quakelive/$gameport/.venv/bin/activate
exec $basepath/run_server_shinqlx.sh \
+set fs_basepath $basepath \
+set net_port $gameport \
+set fs_homepath ~/.quakelive/$gameport \
+set zmq_rcon_password "<a super secret rcon password that no one will ever guess>" \
+set zmq_rcon_port $rconport \
+set zmq_stats_password "<a super secret stats password that sites like qlstats.net will need to know to gather stats from your server>" \
+set zmq_stats_port $gameport
run_server.sh 0 will start a server on port 27960, run_server.sh 1 on port 27961, and so on.
Cargo features
| Feature | Default | Purpose |
|---|---|---|
alloc |
yes | jemalloc (mimalloc on Windows) as global allocator |
steam-query-limit |
yes | rate limit for server queries against reflection and floods |
patches |
no | enables clientkick-fix, zmq-rcon-fix and steam-query-limit |
race-hooks |
no | race maps: touching a start point again keeps the run time, target_init triggers honour their KEEP* spawnflags, experimental |
clientkick-fix |
no | patch for the callvote clientkick lookup in qagame, experimental |
fps-patch |
no | sv_fps can be set from 10 to 250, default 125, see Server frame rate, experimental |
zmq-stats |
no | reads the stats from the ZMQ socket (zmq_stats_enable) with the StatsListener; the stats events work without it, through a hook |
zmq-rcon-fix |
yes | protects against dead RCON clients: drops the engine's "zmq RCON client disconnected" report and limits how long the engine waits for a client (qlx_zmqRconSendTimeout) |
demo-recording |
no | records matches with the view of every player, to be converted to demos with ql_demo, experimental, see Recording matches |
bench-support |
no | exposes internals to the benchmarks, not for production builds |
Enable or disable features when building, e.g. maturin build --release --features patches, or without the query
limit: maturin build --release --no-default-features --features alloc.
The build uses the baseline of the target architecture, so that the result runs on any CPU of it. To optimize for the
machine that builds and runs the server, set RUSTFLAGS="-C target-cpu=native" or the same flag in your own
~/.cargo/config.toml; do not copy such a build to another machine.
Protection against query floods
Quake Live servers can be abused as reflectors by forged server queries. shinqlx contains a rate limit for these
queries (Cargo feature steam-query-limit). How it works, how to configure it, and how to combine it with nftables and
XDP is described in DDOS-PROTECTION.md.
Large matches
With about 20 or more players the end of a match can overrun the 64 reliable commands the engine keeps per client
(a reliable command was cycled out), and an overlong team scoreboard is thrown away by the engine. shinqlx spreads
the burst of castats, prints and chat over several frames and cuts overlong scoreboards back, both on by default. The
page "Reliable commands and scoreboards" of the documentation describes the cvars and the console commands reliable
and scoreboard.
Server frame rate
With the Cargo feature fps-patch the server runs with sv_fps 125 instead of the read-only 40, and other rates from
10 to 250 can be set in server.cfg, with +set sv_fps on the command line (which wins over server.cfg) or in the
console. Experimental.
- The
server.cfgthat comes with the server containsset sv_fps "40". Remove or change that line, or the server keeps running at 40. - A change takes effect with the next map or
map_restart, never in the middle of a match. Only a plugin that forces the value (shinqlx.set_cvarwith the flags-1) changes it at once. - Other values are rejected, because the engine does not check them and crashes with 0. A rejected value at the start leaves the server at 125.
- The engine counts whole milliseconds for each frame, so the rate is 1000 divided by those: 40, 50, 100, 125, 200 and 250 are exact, 60 runs at 62.5 and 80 at 83.3. The log shows the effective rate.
- The limits of the reliable guard count frames and pass faster at higher rates.
Supervisor configuration
I recommend running your ShiNQlx server through a process monitor like supervisor. Unfortunately, due to the nature
Rust handles crashes with its own panic system, some crashes may not result in the server exiting properly for the
supervisor daemon to proper restart your server. Until I can come up with a proper way to solve this, I recommend to add
an event listener configuration to your supervisor configuration to automatically check whether your server port is
still reachable, and restart the server automatically if it's not.
A crash with SIGSEGV ends the server by itself: the handler of the engine runs first, and if it hangs, the process
is ended with the signal (and a core dump) after 10 seconds. SIGTERM and SIGINT make the server execute quit
at the next frame (the engine alone does not end on them while the ZMQ rcon is enabled), and the process is ended after
30 seconds if the server is still there. The check below remains useful for other kinds of hangs.
The supervisor_checks package provides the main means for this.
However, you will have to install the package to your OS pip environment, like so:
sudo pip3 install --break-system-packages supervisor supervisor_checks
After installation, you can configure your server in the supervisor configuration. Here is an
example /etc/supervisor/conf.d/quakelive.conf, running two servers on the same host, and the supervisor_checks
checking every 60 seconds for connectivity to the respective port (27960 and 27961) and restarting the server in case it
stopped responding to TCP connection attempts on the server port:
[program:quakelive]
command = /home/steam/bin/run_server.sh %(process_num)s
user = steam
process_name = qzeroded_%(process_num)s
numprocs = 2
autorestart = true
[eventlistener:ql_heartbeat_0]
command = /usr/local/bin/supervisor_tcp_check -N "quakelive:qzeroded_0" -n ql_heartbeat_0 -r 1 -p 27960
events = TICK_60
[eventlistener:ql_heartbeat_1]
command = /usr/local/bin/supervisor_tcp_check -N "quakelive:qzeroded_1" -n ql_heartbeat_1 -r 1 -p 27961
events = TICK_60
Metadata
Release files for shinqlx 0.9.1
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| shinqlx-0.9.1.tar.gz | 831.3 kB | Without provenance | Details for shinqlx-0.9.1.tar.gz |
Release files / shinqlx-0.9.1.tar.gz
| Download URL | shinqlx-0.9.1.tar.gz |
|---|---|
| Size | 831.3 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
8cd34f5e63ad700ed646e73557c4a48c9151d6e735f9abb9de90d9be160c3cfc
|
|
BLAKE2b-256 checksum How to use checksums |
242797c3f432d4dae29c85ddfdccde75eef79ff914e65ab53967cdff8a7da51b
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
maturin/1.16.0
|
Security for shinqlx 0.9.1
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.