Storage¶
Where player stats are saved. SQLite is the default and needs no setup. MySQL lets several servers share one set of stats.
Stats are wins, kills, deaths, territory, streaks, and time played. They are saved automatically and survive restarts.
Choosing a backend¶
Set the type in config.yml:
| Type | Best for | Setup |
|---|---|---|
sqlite |
A single server | None. This is the default. |
mysql |
Several servers sharing stats | A MySQL or MariaDB server you provide |
An unknown value falls back to SQLite, so you cannot break stats with a typo.
SQLite saves to a single file inside the plugin folder. Nothing to install.
| Key | What it does | Default |
|---|---|---|
sqlite.file |
Database file name in the plugin folder | stats.db |
sqlite.pool-size |
Connection pool size (small is fine for a local file) | 4 |
Use this if you run more than one server and want them to share stats. You need a database that already exists on your MySQL or MariaDB server.
stats:
type: mysql
mysql:
host: localhost
port: 3306
database: zfrostboats
username: root
password: ""
pool-size: 10
use-ssl: false
| Key | What it does | Default |
|---|---|---|
mysql.host |
Database server address | localhost |
mysql.port |
Database server port | 3306 |
mysql.database |
Database (schema) name, must already exist | zfrostboats |
mysql.username |
Login username | root |
mysql.password |
Login password | empty |
mysql.pool-size |
Maximum pooled connections | 10 |
mysql.use-ssl |
Require an SSL/TLS connection | false |
Create the database first
The plugin creates its own tables, but the database (schema) named in database must already exist on your server. Create it before switching.
The MySQL driver loads only when you pick MySQL
The MySQL/MariaDB driver is not bundled or downloaded unless you actually set type: mysql. The first time you switch to MySQL and restart, the plugin downloads the small driver once into plugins/zFrostBoats/libraries/. If that server has no internet at the time, it stays on SQLite and logs the exact file name to drop into that folder instead, so it never blocks startup.
First start downloads helper files¶
To keep the jar small, the helper libraries for the default SQLite backend are downloaded once the first time the plugin runs. This needs internet on the first start only; after that, no internet is needed.
The MySQL driver is separate: it is fetched only if you choose the MySQL backend (see the note above), so a default SQLite server never downloads it.
Switching backends¶
Switching from SQLite to MySQL (or back) starts a fresh set of stats in the new backend. Existing stats are not moved across automatically.
Saving never lags the game
All database work runs in the background, off the main game thread, so stats never cause lag.
After changing storage settings, restart the server so the new connection is used.