⚙️Multiserver

LightCoins is designed for single server setups and for big multi server setups with velocity as proxy.

LightCoins supports different possibilities for storing and sharing balances across servers. Here are the settings for these options.

// core.yml in LightCore
# This system is used for synchronising data between multiple servers.
# You NEED to have a Redis Server running to use this system on multiple servers !!!
# INFO: If you are using a Pterodactyl Redis Server, you can use the docker
#       internal network to connect to the redis server:
#        - Default Docker Network Host: 172.18.0.1
#        - Default Port: 6379
server-synchronisation:
  # If enabled, the server synchronisation system will be enabled.
  # If you have only one server, you can leave this disabled.
  enable: false
  # How should we synchronise the data between the servers?
  # - mysql -> Use the mysql Database for server synchronisation
  # - redis -> Use a Redis Server (pub/sub channels) for server synchronisation (RECOMMENDED)
  type: mysql
  redis:
    # Only enable this if you have a redis server running,
    # and you want to use the server synchronisation system without the mysql database synchronisation.
    enable: false
    # The host of the redis server.
    host: localhost
    # The port of the redis server.
    port: 6379
    # The password of the redis server.
    password: YourSecretPassword
# The Storage system for all my plugins
# All sub plugins will use this storage system
storage:
  # possible values:
  # - sqlite -> for a SQLite database (local file)
  # - mysql -> for a MySQL database
  # - mariadb -> for a MariaDB database (recommended over MySQL)
  type: sqlite
  host: 127.0.0.1
  port: 3306
  database: databaseName
  username: username
  password: YourSecretPassword
  advanced:
    # Don't change any values here if you don't know what you're doing.
    connection-timeout: 60000
    idle-timeout: 600000
    keep-alive-time: 0
    max-life-time: 1800000
    minimum-idle: 10
    # The maximum pool size of the connection pool for the database.
    # Bigger pool size = more performance, but more RAM/CPU usage.
    # If you installed more than 3 plugins from me, you should increase this value.
    # For example: 3 plugins -> 15, 4 plugins -> 20, 5 plugins -> 25
    # Default value is 10.
    maximum-pool-size: 10
    leak-detection-threshold: 0
    connection-test-query: "SELECT 1"
    character-encoding: "utf8"

MySQL is NOT for sharing balances between servers

It is not recommended to use type: mysql for multi-server setups, as LightCoins interacts directly with the database connection to retrieve data. You can still use this option as long as your network has fewer than approximately 50 players. If you have more than 50 players, I highly recommend setting up a Redis server and using type: redis. With Redis, all servers are synchronized in real-time with zero lag, regardless of the number of players, even with thousands. Another major benefit is that you can pay, add, remove, or set balances for players on different servers in real-time. This is not possible with type: mysql !

Player messages across servers

If you want, for example, a player to receive a notification when another player sends them money, even if they are on a different server, simply install LightCore into your Velocity proxy plugin directory and restart it.

Last updated