Storage
Where SeasonForge keeps player progress, SQLite or MySQL and MariaDB, when it saves, and how claims stay safe.
SeasonForge keeps every player's progress in a database. Out of the box that is a single SQLite file and there is nothing to set up. Use MySQL or MariaDB when several servers share one Battle Pass, or when you want the data in your own database server.
Choosing a database
storage.type | Use it when | Setup |
|---|---|---|
SQLITE | One server. The default. | None. The file is plugins/SeasonForge/seasonforge.db. |
MYSQL | Several servers, or your host gives you a MySQL database | Fill in host, port, database, username, password |
MARIADB | The same, on a MariaDB server | Same as MySQL |
storage:
type: MYSQL
host: db.example.net
port: 3306
database: seasonforge
username: seasonforge
password: "your password"
use-ssl: false
table-prefix: "sf_"
pool-size: 6
save-interval: 300The tables are created on the first start. If the database cannot be reached, SeasonForge says so in the console and turns itself off, check the storage section and restart.
Switching storage.type does not move existing data. A server that changes from SQLite to MySQL starts with an empty database.
What is stored
Everything is kept per player and per season:
| What | Notes |
|---|---|
| Level, XP and premium | One row per player per season |
| Claimed rewards | One row per player, season, level and track, so a reward can never be claimed twice |
| Quest progress | Per quest, with the reset period it belongs to. NONE quests are kept outside any season. |
| Shop purchases | Per item, with the limit period it belongs to |
| Saved reward items | Items kept for later with rewards.inventory-full: PENDING |
| Season history | Which season is running, which ones ended and when, and the last reset times |
All tables start with storage.table-prefix (sf_players, sf_claims, sf_quests, sf_purchases, sf_pending_rewards, sf_meta, sf_seasons).
Old seasons are never deleted. They stay in the database under their season id, which is why starting an old season again picks its progress back up. Only /battlepass admin season reset and /battlepass admin reset <player> delete progress, and only for the running season.
When it saves
- Player data is loaded while the player logs in, before they are in the world, and kept in memory while they play.
- Changes are saved every
storage.save-intervalseconds (300 by default), when the player leaves, and when the server stops. - Claims, shop purchases, premium changes and completed quests are saved straight away.
- All database work runs off the main server thread, one statement after another, so a save from leaving always lands before the next load.
Claims and purchases are saved first
A crash or a fast double click can never hand out a reward twice: the claim is in the database before anything is given. Shop purchases work the same way, with the currency refunded if the save fails or the player leaves before it finishes.
Several servers on one database
Point every server at the same MySQL or MariaDB database with the same table-prefix. A player's progress is loaded fresh each time they join a server and saved when they leave, so moving between servers keeps their level, claims and quests.
- Run the same season folders on every server, with the same season ids.
- Quest progress made on one server is saved on the interval, on leave and on completion. Leaving one server and joining the next carries it over.
Admin commands for an offline player edit the database directly, and the change shows on whichever server they join next. For a player who is online, run the command on the server they are playing on, otherwise that server's next save writes over it.