Skip to content

Latest commit

 

History

2 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Deathrun Timer

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.

Current architecture

The enabled plugins are listed in configs/plugins_deathrun.ini and must remain in that order:

  1. deathrun_core.amxx owns database identity, records, ranks, and world-record state.
  2. deathrun_bots.amxx creates the Terrorist finish target.
  3. deathrun_replay.amxx records runners and plays the SQL-backed record ghost.
  4. deathrun_timer.amxx controls run timing and submits results to the core.
  5. 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.

Persistence model

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.

Build

Place the AMX Mod X compiler distribution under tools/amxmodx/, then run:

./build.sh

Only plugins enabled in configs/plugins_deathrun.ini are compiled. Artifacts are written to build/plugins/.

Server setup

  1. Configure the remote database in the game server's addons/amxmodx/configs/sql.cfg.
  2. Ensure the required AMX Mod X modules are enabled.
  3. Copy build/plugins/*.amxx into the server's addons/amxmodx/plugins/ directory.
  4. Copy configs/plugins_deathrun.ini into the server's AMX Mod X config directory, or merge its ordered entries into the active plugin list.
  5. 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.

Runtime validation before release

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.

Website status

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.

About

Continuation of the aLbaneso/Deathrun legacy

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Contributors

Languages