Network

Network

Add-on

The Network add-on, which shares one stock count between every server on the same database.

View as Markdown ·

On this page

#Information

The Network add-on makes every server on the same database count one shared stock. Without it, each server keeps its own count, so an item limited to 10 could be bought 10 times on every server. With it, the stock of an item and each player's purchase limit are counted once across the whole network.

The count is checked and taken in one database step, so two servers can never both sell the last one.

#Installation

To install this add-on, drag and drop the jar file into the PhoenixShop/addons folder of every server that should share stock, then restart them.

circle-exclamation

The add-on requires the Premium edition and a shared MySQL or MariaDB database. It refuses to load on Lite, and on a server that is still on SQLite. See Setup.

#Files

The add-on has no files or settings of its own. It uses the database already set in the plugin's config.

#What is shared

Shared Not shared
How many of a stocked item are left. Shops, prices and every other setting. Each server reads its own shop files.
How many of an item each player has bought against its player limit.
Restocking. The server that notices first refills the stock for everyone.

The restock countdown is not shown to players while the add-on is running.

#Setup

#Database

Every server has to point at the same database, with the same name and the same table prefix, in the database section of the plugin's config:

YAML
database:
  type: mysql
  address: localhost
  name: phoenixshop_db
  port: 3306
  username: phoenixuser
  password: phoenixpassword
  table-prefix: ps

The type can be mysql or mariadb. On sqlite, the default, the add-on refuses to load and the console says to switch, since a file on one server has nothing to share.

#Shop files

Stock is matched between servers by the shop, category and item identifiers. Copy the same shop files to every server, or an item named differently on two servers is counted as two items.

#When the database is unreachable

If the database cannot be reached when the server starts, the add-on does not load and each server counts its own stock again.

If the connection drops while running, items with a stock or a player limit cannot be bought until the database answers again. This stops a player from hopping to another server to get past a limit. Items without a stock or limit are not affected.

#Removing it

Taking the jar out of a server's addons folder puts that server back on its own count.

My Cart
Spider

Your cart is empty

Looks like the spiders padded through here. Pick a plugin and it will show up here. Continue shopping