DUXPLIMA Documentation

Overview

What is stored, the tables, sharing one database across servers, keeping one server apart, and moving off SQLite.

The database holds what a player has done, their record and their place on every board, and the own inventory of every player who is fighting right now. Settings and the kit are files and are not in it.

BackendFor
SQLiteOne server. The default, a file with nothing to set up
MySQL and MariaDBA network sharing records and boards
PostgreSQLThe same, on PostgreSQL

The backend is set in the storage block of config.conf. It is opened once, so a change needs a restart. The tables are created and moved forward on their own at the start.

The tables

Every table name starts with storage.table-prefix, uxmhubpvp_ by default.

TableHolds
uxmhubpvp_statsOne row per player: kills, deaths, streak and best streak
uxmhubpvp_inventoryOne row per player who is fighting: their own items, the slot they held, and when it was saved. Deleted when the items are back
uxmhubpvp_boardOne row per player, board, period and window: the score and when it was reached
uxmhubpvp_nameThe name each player last played under, for the boards and reset
uxmhubpvp_schema_historyThe version the tables are at

/uxmhubpvp doctor names the backend, where the rows are, the prefix and the schema version.

A network

Point every server at the same MySQL, MariaDB or PostgreSQL database with the same table-prefix, and the servers share each player's record and board standings. A player who fights on one server reads the same record on another.

  • sync-seconds (2 by default) is how often a server reads what the others changed for the players who are on it. 0 turns it off.
  • The boards are read from the database every leaderboard.refresh-seconds, so every server shows the same board.
  • Write the same leaderboard.time-zone and week-starts on every server, or their weeks end at different times.
  • A saved inventory is shared too: a player whose server crashed mid-fight gets their items back on whichever server of the network they join next.
  • Copy kit.conf to every server that should hand out the same kit.

Keeping one server apart

local-only = true on one server keeps its rows in its own SQLite file, whatever type says, under the same prefix. Use it for a server of the network that should not touch the shared records, such as a build or test server. Keep the rest of the storage block the same everywhere and set this on that one server alone.

Moving off SQLite

  1. Create the database and a user on the database server.
  2. Set type, host, port, database, username and password, and copy-from-file = true.
  3. Restart once. The rows of the SQLite file are copied into the empty tables, and the console says how many.
  4. Leave copy-from-file on or turn it off: tables that already hold rows are never copied into again, so nothing is copied twice.

The SQLite file is left where it is, as a backup.

Erasing a player

/uxmhubpvp reset <player> deletes the player's record and every board row they hold, in every period and window, on every server sharing the database. A saved inventory is never touched by reset.

Related: config.conf, SQLite, MySQL and MariaDB