TDXDevelopment
TDX VotePlusConfiguration

storage

SQLite vs MySQL, MySQL credentials, per-server isolation.

VotePlus ships with two storage backends. SQLite is the default and needs zero setup. MySQL is what you want when several servers should share vote data, or when you already run a central database.

Changing anything on this page needs a full restart. /voteplus reload does not reopen the database connection.

Choosing a backend

BackendWhen to use it
SQLiteA single server. The file lives at plugins/TDXVotePlus/voteplus.db.
MySQLSeveral servers sharing one database, or you want your existing database backups to cover vote data. Works with MySQL 8+ and MariaDB 10.5+.

SQLite

plugins/TDXVotePlus/config.yml
general:
  storage: sqlite

That is the entire configuration. The database file is created on first start and runs in WAL mode, so you will see voteplus.db-wal and voteplus.db-shm next to it while the server is running. Back up all three together, or stop the server first.

MySQL

plugins/TDXVotePlus/config.yml
general:
  storage: mysql

mysql:
  host: "localhost"
  port: 3306
  database: "tdxvoteplus"
  username: "root"
  password: ""
  table-prefix: "tdxvp_"
  server-id: ""
  pool-size: 10

Reference

KeyTypeDefaultNotes
hoststringlocalhostDNS name or IP of the database host.
portint3306
databasestringtdxvoteplusMust already exist. The plugin creates its own tables on first connect.
usernamestringrootNeeds CREATE, ALTER and full read and write access in that database.
passwordstringemptyTreat as a secret, see the warning below.
table-prefixstringtdxvp_Put in front of every table name. Change it only if it clashes with another plugin.
server-idstringemptyPer-server isolation key, see below.
pool-sizeint10Maximum connections in the pool. 10 is plenty for most servers, go to 20 at 200+ players.

The connection does not use SSL and there is no key to switch it on. Keep the database on the same machine or a private network.

Treat mysql.password like a password. Restrict file permissions on config.yml so only the server process can read it, and rotate the credential if you suspect it has leaked.

Per-server isolation

If you run more than one game server against the same MySQL database and want each to keep its own player counters, streaks, milestones and offline queue, give every server its own mysql.server-id:

plugins/TDXVotePlus/config.yml
mysql:
  server-id: "skyblock"

The id becomes part of the table names, so this server reads and writes tdxvp_skyblock_players and so on. Only lowercase letters, digits and underscores are kept, anything else is stripped. Leave it empty for a single server, or when you really do want all servers to share one pool of vote data.

The vote party counter is always shared between servers on the same database, whatever their server-id, so a party fires on the whole network at once.

Sharing one pool of vote data instead

With server-id left empty, every server on the database reads and writes the same player records: one vote total, one streak, one set of claimed milestones and one offline queue for the whole network. Two rules keep that clean:

  • Send votes to one server only. If NuVotifier forwards each vote to every backend, every backend counts it.
  • Use v1.3.5 or newer on every server. Older versions kept a copy of each player in memory for the whole uptime and saved it back on quit, which overwrote votes counted on another server.

A server loads a player's record when they join, so the numbers a player sees are as fresh as their last join on that server. A queued offline vote is paid on whichever server the player joins first.

How votes reach your servers (one Votifier endpoint, or NuVotifier forwarding to every backend) decides where offline votes are paid and whether a vote is rewarded once or once per server. Read Multi-server isolation before you set this on a live network.