Skip to content

LiveMarket 0.5.0

Choose a tag to compare

@rconpilot rconpilot released this 21 Nov 17:14
· 4 commits to main since this release
33affb5

LiveMarket 0.5.0

MySQL/MariaDB storage backend (optional) — one shared market across every server that points at the same database.

What's new

  • MySQL storage — set storage.type: mysql in config.yml and point storage.mysql at a MySQL or MariaDB database. The driver (Connector/J 8.4.0) is shaded into the plugin jar, so there is nothing extra to install on the server, and the three tables (lm_meta, lm_prices, lm_alerts) are created automatically on first start.
  • One-time migration — when the tables are empty but a data.yml already exists, its prices, history and alerts are copied into the database once, so switching backends never loses market state.
  • Fallback, not failure — if the database cannot be reached at startup, LiveMarket logs an error and keeps running on data.yml instead of refusing to start. A failed save logs a warning and retries on the next scheduled save.
  • Storage refactor — persistence is now a Storage interface with YamlStore (the crash-safe data.yml backend, behaviour unchanged) and MySqlStore backends, sharing one in-memory alert implementation (AbstractStore). Existing config.yml and data.yml files keep working; storage.type defaults to yaml.

Verified

End-to-end on Paper 1.21.11 with Vault, EssentialsX and PlaceholderAPI against a real MariaDB 10.11 server, using a bot player and the built-in debug mode: exact data.yml migration, formula-exact trades on MySQL, restart restores from MySQL, a stopped database falls back to data.yml with a clear error while trades keep working, and MySQL resumes with its own state afterwards. The YAML backend was regression-tested in the same session.

Install

Drop LiveMarket-0.5.0.jar into your server's plugins/ folder and restart. Requires Paper 1.21.x, Vault, and any Vault economy plugin (e.g. EssentialsX). PlaceholderAPI is optional. Existing config.yml / data.yml from 0.4.0 keep working; new options are documented in the bundled config.yml. For MySQL, create an empty database and a user first (CREATE DATABASE livemarket;), then set storage.type: mysql.