TDXDevelopment
TDX VotePlusGuides

Multi-server isolation

Run VotePlus across Survival / Skyblock / Prison on one MySQL DB without crossed wires.

If you run a network, Survival, Skyblock, Prison, etc., and want all of them to use a single MySQL database for VotePlus, you need to be deliberate about which counters are shared and which are isolated. This guide walks the whole topology end-to-end so you don't end up with diamonds being given out twice for the same vote.

What's shared, what's isolated

Counter / stateShared across servers?Why
Per-player vote totalsNo (per server-id)A vote on Skyblock shouldn't double-pay rewards on Survival.
Per-player streaksNo (per server-id)Streaks track engagement with this server.
Per-player milestonesNo (per server-id)A milestone reward shouldn't fire twice for the same player.
Per-player offline queueNo (per server-id)The reward pool is per-server.
Monthly standings and historyNo (per server-id)Each server has its own winners and runs its own month-end payout.
Vote-party counterYes (global)The party is a network-wide event by design.

The single config knob that drives this is mysql.server-id in config.yml. Set it to a unique value per backend and you get clean per-server isolation for player counters while keeping the global party counter shared.

Setup

Pick your server-ids

Pick a short, unique string per backend:

BackendSuggested server-id
Survivalsurvival
Skyblockskyblock
Prisonprison
Creativecreative

These never appear in player-facing strings. They become part of the table names (tdxvp_survival_players and so on), so stick to lowercase letters, digits and underscores. Anything else is stripped.

Create one database, point all servers at it

CREATE DATABASE tdx_voteplus CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;
CREATE USER 'tdx'@'%' IDENTIFIED BY 'a-strong-password';
GRANT ALL PRIVILEGES ON tdx_voteplus.* TO 'tdx'@'%';

Then in every server's plugins/TDXVotePlus/config.yml, point the mysql: block at the same database, but give each one its own server-id:

plugins/TDXVotePlus/config.yml (Survival)
general:
  storage: mysql

mysql:
  host: "db.your-host.tld"
  port: 3306
  database: "tdx_voteplus"
  username: "tdx"
  password: "a-strong-password"
  server-id: "survival"
plugins/TDXVotePlus/config.yml (Skyblock)
general:
  storage: mysql

mysql:
  host: "db.your-host.tld"
  port: 3306
  database: "tdx_voteplus"
  username: "tdx"
  password: "a-strong-password"
  server-id: "skyblock"

Decide on your Votifier topology

This is the part that bites people. Votifier listens on each backend on its own, so a vote only lands on the server (or servers) it is sent to. There are two common setups, and they behave very differently once every backend has its own server-id.

Option A, one Votifier endpoint (recommended)

Every vote site points at one backend's Votifier port, for example Survival's. Only that server hears about votes.

  • A vote is counted once, on that server. If the player is offline it waits in that server's offline queue and is paid when they next log into that server, not any other.
  • The vote party counter moves by one per vote.
  • Tell your players where they collect: "vote rewards are paid on Survival".

Option B, NuVotifier forwarding to every backend

The proxy receives the vote and forwards a copy to each backend. With a server-id per backend, every copy is a full vote on that server.

  • The player is rewarded once per server: three backends means three sets of rewards, three streak days, three milestone ticks, each paid when they visit that server.
  • The shared vote party counter moves by one per backend, so with three backends a party fires three times as fast. Raise the threshold to match.

Use Option B only if you really want each server's economy to pay for the same vote. If you are not sure, use Option A.

Restart all backends

Each backend will create its own row in the per-server tables on first connect. The vote-party counter is global, so the first backend to start gets the existing counter; subsequent ones see the same value.

Run /voteplus party on any backend to confirm, the counter should match across all of them.

Verifying the isolation works

The fastest sanity check:

  1. Run /testvote YourName on Survival.
  2. Open /vote on Survival → your vote count increased.
  3. Open /vote on Skyblock → your vote count is unchanged.
  4. Run /voteplus party on either server → the shared counter went up by 1 (or by the number of backends, with forwarding).

If steps 2 and 3 give the same number, your server-id isn't being applied, double-check that the value differs between the two backends and that both are actually using storage: mysql, not SQLite.

Once a backend has been running with a given server-id, don't rename it. The id is part of the table names, so a new id means a fresh set of empty tables and the old counters are left behind in the old ones. If you must rename one, stop the server and rename its tables first, for example RENAME TABLE tdxvp_old_players TO tdxvp_new_players, for each of players, votes, vote_days, offline_queue, monthly_history and pending_rewards.