Storage
Where zRivals Duels keeps its data, SQLite or MySQL, what is stored, and backups.
Stats, seasons, match history, wagers, snapshots and rewards are kept in a database. SQLite works with no setup at all. MySQL lets several servers share one set of stats, or suits you if you already run a database.
Settings
storage:
# Where data is saved: SQLITE (a file in the plugin folder) or MYSQL
type: SQLITE
mysql:
# MySQL server address
host: localhost
# MySQL server port
port: 3306
# Database name
database: zrivalsduels
# MySQL user name
username: root
# MySQL password
password: ""
# Connect over SSL
use-ssl: falseThe default. Everything is saved in plugins/zRivalsDuels/database.db. Nothing to set up.
Storage settings are read when the server starts. /duel admin reload does not switch databases, restart instead. Switching type does not copy data from one database to the other.
What is stored
All tables start with zrd_.
| Table | What it holds |
|---|---|
zrd_players | Each player's name and lifetime stats: wins, losses, draws, total duels, ranked games, best MMR, best rank, best position, season wins and top 3 finishes |
zrd_season_stats | Each player's MMR, ranked wins, losses and games, best MMR and best rank for each season |
zrd_seasons | Every season's number, name, start, end and whether it is finalised |
zrd_season_results | The final leaderboard of every finished season |
zrd_matches | Match history: players, hashed IP addresses, mode, kit, arena, winner, how it ended, MMR before and after, wager |
zrd_escrow | Held, settled and refunded wager stakes, and whether each payout was delivered |
zrd_snapshots | Saved player state during a duel, until they are restored |
zrd_reward_grants | Every reward part, its status, and for real money who marked it paid |
zrd_opponent_history | Ranked games per player pair, for the same opponent limit |
zrd_schema | The database layout version. Updates bring the tables up to date on start |
Every database read and write happens off the main server thread, so a slow database never freezes the server. Online players' stats and the leaderboard are kept in memory for commands, menus and placeholders.
Files outside the database
| Path | What it holds |
|---|---|
kits/ | One file per kit |
arenas/ | One file per arena |
data/reward-items.yml | Items saved into reward sets |
data/kit-edit/ | Staff inventories saved by /duel kit load, until /duel kit restore |
logs/real-money.log | A line for every real money reward granted or marked paid |
Backups
- SQLite: stop the server and copy
database.db, or copy it while nobody is in a duel. - MySQL: use your usual database backup, for example
mysqldump zrivalsduels. - Also keep
kits/,arenas/anddata/, they are not in the database.
Do not delete zrd_snapshots or zrd_escrow rows by hand. They hold players' real inventories and held wagers until those are given back.