Storage

Player data lives in SQLite by default, with MySQL as the option for a network.

What is stored

  • Job levels, xp, and prestige counts
  • Farmpoint balances
  • Monthly ranking points, this month and last
  • Unclaimed level rewards and staged ranking rewards

SQLite

storage:
  type: sqlite
  sqlite:
    file: "data.db"

One file in plugins/CoreJobs. Nothing to install and nothing to set up.

That file is your backup

Copy data.db while the server is stopped. That is the whole save.

MySQL

storage:
  type: mysql
  mysql:
    host: "localhost"
    port: 3306
    database: "corejobs"
    username: "root"
    password: ""
    properties: "useSSL=false&allowPublicKeyRetrieval=true&characterEncoding=utf8"
    table-prefix: "corejobs_"
Key What it does
host and port Where the server is
database Must exist already, the plugin creates tables but not the database
username and password An account with rights on that database
properties Extra connection flags joined with &. The defaults suit a normal MySQL 8, leave them alone unless your host tells you otherwise
table-prefix Keeps CoreJobs tables apart from other plugins sharing the database
  1. Create the database
    CREATE DATABASE corejobs; and a user with rights on it.

  2. Fill in config.yml
    Set type: mysql and the credentials.

  3. Restart the server
    Tables are created on connect.

  4. Check the console
    A connection failure is loud. Fix it before players log in.

Switching does not carry data

Changing type points the plugin at an empty store. Levels and farmpoints do not migrate themselves. Decide before your players start earning, or plan to move the rows yourself.

Sharing data across servers

Point every server at the same MySQL database with the same table-prefix. Job levels and farmpoints then follow the player between servers.

One writer per player at a time

Data is loaded on join and written on leave. A player logged into two servers at once on the same database can have one session overwrite the other.

Cached reads

Leaderboards and placeholders read a cached copy, not the database. A scoreboard on every player costs the same as a scoreboard on one.

The copy is rebuilt every leaderboards.refresh-seconds, and sooner when a player levels or prestiges, with leaderboards.min-delay-seconds as the shortest gap between two of those early rebuilds. A level up also writes that player’s row out straight away, so the rebuild has the new level to read.