An AMX Mod X 1.10+ timer and leaderboard for Counter-Strike 1.6 Deathrun. The game server keeps player identity, map records, rankings, and the current world-record replay in MySQL. Replay persistence does not depend on a local data file.
The enabled plugins are listed in configs/plugins_deathrun.ini and must remain in that order:
deathrun_core.amxxowns database identity, records, ranks, and world-record state.deathrun_bots.amxxcreates the Terrorist finish target.deathrun_replay.amxxrecords runners and plays the SQL-backed record ghost.deathrun_timer.amxxcontrols run timing and submits results to the core.- The remaining plugins display records, ranks, commands, and optional GeoIP data.
Legacy sources remain in scripting/ for reference, but the build script neither compiles nor enables them. In particular, deathrun_movement_player.sma, deathrun_player_database.sma, and deathrun_map_database.sma are not part of the production path.
The plugins create these normalized tables automatically:
| Table | Purpose |
|---|---|
dr_players |
One identity per SteamID, plus current name and activity timestamps |
dr_maps |
One stable ID per map |
dr_records |
One personal best per player and map |
dr_replays |
The authoritative world-record replay for each map as a LONGBLOB |
dr_replay_uploads |
Tokenized, temporary replay upload staging |
Record submission is conditional: a slower concurrent result cannot overwrite a faster one. Replay publication also checks the authoritative dr_records row, so an outdated server cannot replace a newer world-record ghost. Upload staging older than 24 hours is removed on plugin startup.
The replay format is DRG3-compatible and uses compact delta/key frames. Recording is per player and held in memory during a run. Confirmed world records are uploaded to MySQL in chunks, verified by byte count and CRC32, and then loaded back from the authoritative row. Playback is elapsed-time based and interpolates position and view angles for smoother spectator movement.
For an offshore database, keep the database close enough to the game server for reliable latency, require TLS at the database/network layer where available, restrict the database user to this schema, and allow inbound connections only from the game server and future web server addresses.
Place the AMX Mod X compiler distribution under tools/amxmodx/, then run:
./build.shOnly plugins enabled in configs/plugins_deathrun.ini are compiled. Artifacts are written to build/plugins/.
- Configure the remote database in the game server's
addons/amxmodx/configs/sql.cfg. - Ensure the required AMX Mod X modules are enabled.
- Copy
build/plugins/*.amxxinto the server'saddons/amxmodx/plugins/directory. - Copy
configs/plugins_deathrun.iniinto the server's AMX Mod X config directory, or merge its ordered entries into the active plugin list. - Start on a test map and inspect the AMX Mod X log for schema, authentication, or replay errors.
The timer cvar deathrun_respawn_delay defaults to 2.3 seconds and accepts values from 0.0 through 5.0.
Compilation proves Pawn/API correctness, but the following still require a real ReHLDS/HLDS and MySQL test environment:
- A player can start, die, respawn, finish, and update a personal best.
- Two simultaneous runners do not share recording state.
- A world record uploads, survives a map restart, downloads, and spawns the ghost.
- A database interruption retains the pending replay in memory and resumes upload after recovery.
- Two servers racing on the same map preserve the fastest record and corresponding replay.
- The ghost remains non-solid, damage-proof, visible to spectators, and synchronized through jumps and teleports.
The included website is legacy code and still expects the old per-map schema. Do not deploy it against the normalized production tables yet. Its migration should be handled as a separate phase after game-server runtime validation is complete.