Cross-server

Several servers can share one auction house. A listing made on one server can be bought on any other.

  1. Set type: under storage: to mysql, mariadb or mongodb on every server, with the same database and table-prefix.
  2. Set enabled: true under network: and the same Redis server and channel on every server.
  3. Give each server its own server-name: "survival" under network:.
  4. Restart every server.
yaml
storage:
  type: mysql

network:
  enabled: true
  server-name: "survival"
  channel: "auctionhouse"
  redis:
    host: 10.0.0.5
    port: 6379
  • The database decides every sale, so an item can only be sold once even when players on different servers click it at the same moment.
  • Redis tells the other servers what changed, so menus update right away.
  • Sellers are paid on the server they are on. Offline sellers are paid when they next join.
  • SQLite can’t be shared. Cross-server mode is turned off with a warning if type: sqlite under storage: is set.
MongoDB
Use a MongoDB replica set if you can. Purchases are then saved in a single transaction. On a single standalone MongoDB server a failed save is written to the console with the item data so you can give it back.