Using it

Network setup (Velocity and BungeeCord)

On a network, purgatory is its own backend server. The proxy sends purgatory-banned players there, blocks them from every other server, and refuses hard-banned players at login. All servers and the proxy share one MySQL database.

  1. Create a MySQL or MariaDB database.
  2. On every backend, set storage.type: MYSQL with the same database and credentials, a different server-name for each server, and network.purgatory-server to the purgatory backend's name in your proxy.
  3. On the purgatory backend only, set network.this-is-purgatory-server: true. It then hosts the purgatory world.
  4. Put the same jar on the proxy and start it once. Then edit plugins/mcbans/config.yml on Velocity or plugins/mcBans/config.yml on BungeeCord: the MySQL details, purgatory.server and purgatory.release-server.
  5. Restart everything and run /mcbans info on a backend to confirm the mode.
network:
  mode: auto
  purgatory-server: "purgatory"
  this-is-purgatory-server: false
  route-timeout-seconds: 8

network.mode is auto (proxy mode when the backend is behind a proxy and a purgatory server is set), single or proxy. route-timeout-seconds is how long a purgatory-banned player may stay on a backend before being disconnected, if the proxy did not move them.

Proxy config#

mysql:
  host: "localhost"
  port: 3306
  database: "mcbans"
  username: "root"
  password: ""
  ssl: false
  pool-size: 4
  # Must match storage.table-prefix on the backends.
  table-prefix: "mcbans_"

purgatory:
  # Must match purgatory.enabled on the backends.
  enabled: true
  # The purgatory backend's name in the proxy's server list.
  server: "purgatory"
  # Where players go when they are released from purgatory.
  release-server: "lobby"

The proxy messages (messages.ban-screen, purgatory-unavailable, sent-to-purgatory, released) use & color codes. The ban screen supports {reason}, {staff}, {duration}, {expires}, {id}, {date} and {appeal}. Restart the proxy after changing this file.

MySQL is required

A network needs storage.type: MYSQL on every server and on the proxy, with the same table-prefix. YAML and SQLite only work on a single server.