Why a proxy needs MirageRoster
#A proxy only counts sessions that connected through it. Bots are created on the backend and never touch the proxy, so without help the network player count, the proxy MOTD and every server selector that asks the proxy report the roster as if it were not there.
With proxy.enabled: true each backend publishes its roster over plugin messaging. The proxy half of MirageRoster (in the same jar) adds those numbers back and pushes a network-wide snapshot back down, which the backends expose as placeholders, so a hub GUI can show per-server counts that include bots.
The proxy plugin also works when proxy.enabled is off: it falls back to pinging each backend, and a backend's own ping already includes its bots. Plugin messaging adds the bot names for the hover sample and the per-server placeholders on top.
Setup
#- Install MirageRoster on each backend and fill in its
license.yml(see Installation). - Put the same jar into the proxy's
plugins/folder (Velocity or BungeeCord) and start the proxy once. - Fill in the proxy's
license.yml:plugins/mirageroster/license.ymlon Velocity,plugins/MirageRoster/license.ymlon BungeeCord. Restart the proxy. - On every backend set
proxy.enabled: true. - Check the message secret (next section; on Velocity with modern forwarding there is nothing to set).
/mirage reloadon the backends, then check with/mirage netwhile a real player is online.
The message secret
#The proxy signs every message it sends to a backend, and a backend believes only a message that is signed with the shared secret, recent and not seen before. A message a player sends through the proxy is never signed, so it is ignored. Without this a client could make a backend count bots that are not there, send bots away or bring them up (when travel is on) or have the backend start sending its roster to a player, wherever MirageRoster is missing from the proxy or did not load there.
- Velocity with modern forwarding: nothing to set. The proxy part signs with Velocity's forwarding secret (the
VELOCITY_FORWARDING_SECRETvariable, Velocity's configuration, orforwarding.secretnext to the proxy), and every backend uses Paper'sproxies.velocity.secret, which modern forwarding needs to hold the same value anyway. Any length works: Velocity generates 12 characters and that is fine. If the proxy part cannot read the forwarding secret (a forwarding secret file in an unusual place), the proxy console says so once: setsecret=inconfig.propertiesto the same value. - BungeeCord, Waterfall or anywhere else: there is no secret to borrow. Set the same value, 8 characters or more, as
proxy.secreton every backend and assecret=in the proxy'sconfig.properties(plugins/MirageRosteron BungeeCord). - No secret at all: the backend switches the proxy link off with one warning in the console that says what to set, and the proxy part sends nothing to the backends (it keeps counting from pings). A message that is not signed is never believed.
- Updating. Put the same release on the proxy and the backends. With a secret of 16 or more characters set explicitly, the old and the new signature are both understood, so either side can go first. With Velocity's default secret an older proxy part never signed anything: a backend of this release ignores its messages (the console says why) until the proxy part is updated, and counts come from pings meanwhile.
# plugins/mirageroster/config.properties on the proxy
secret=change-me-to-a-long-random-value
# config.yml on every backend
proxy:
enabled: true
secret: "change-me-to-a-long-random-value"
proxy settings (backend config.yml)
#| Key | Default | Description |
|---|---|---|
proxy.enabled | false | Publish this server's roster to the proxy. |
proxy.server-name | "" | How this server names itself to the proxy. Blank = detected the first time a real player is online. Set it if the detected name does not match what the proxy calls this server. |
proxy.secret | "" | Shared secret, see above. 8 characters or more. Blank on Velocity with modern forwarding: Paper's proxies.velocity.secret is used. |
proxy.push-interval-seconds | 10 | Seconds between roster pushes while at least one real player is connected. |
proxy.sample-limit | 24 | Bot names sent with each push for the proxy's hover sample. |
proxy.include-bots-in-network-count | true | Bots count toward the network total the proxy reports. |
proxy.accept-network-snapshot | true | Accept the snapshot the proxy sends back and expose %mirageroster_net_total% and %mirageroster_net_<server>%. |
proxy.answer-bungee-placeholders | true | Also answer %bungee_<server>% and %bungee_total% from that snapshot. Never overrides an installed bungee expansion. |
proxy.count-correction | true | Fix %bungee_*% and every other BungeeCord "PlayerCount" answer at the source, so selectors and scoreboards never read the brief low number before the proxy plugin corrects it. Needs the proxy plugin from the same release. |
The placeholders are described on Placeholders and integrations.
SkinsRestorer on the proxy
#Most Velocity and BungeeCord networks that run offline-mode use SkinsRestorer on the proxy. The proxy part of MirageRoster detects it and lets the backends' bots wear the skins it gives their names: a skin set with /skin set, SkinsRestorer's own lookup for premium names, and custom or URL skins stored in it.
- Put the MirageRoster jar on the proxy (same release as the backends) and set
proxy.enabled: trueon every backend. Nothing else is needed on the backend; SkinsRestorer there, if installed, can stay in proxy mode. - A bot asks the proxy before it spawns. The question travels inside a real player's connection, so on an empty backend the bots log in with the last skin the proxy gave them (kept in
cache/skinsrestorer/) or their usual one, and are corrected a few seconds after the first player arrives, with no join or leave message. /miragenet skinson the proxy shows whether SkinsRestorer was found and how many skins it answered./mirage skin statuson a backend shows the same from that side.- The answer is the one SkinsRestorer gives a player with the bot's name and offline UUID, so a skin set on the proxy for that player is found.
Proxy config.properties keys (added at the end of an existing file when missing; nothing already in it is changed):
| Key | Default | Description |
|---|---|---|
skinsrestorer-enabled | true | Answer backends' skin requests from SkinsRestorer on this proxy, when it is installed. |
skinsrestorer-timeout-seconds | 15 | How long one lookup may take (SkinsRestorer may ask Mojang) before the backend is told to try again later. 1 to 120. |
skinsrestorer-threads | 3 | Lookups running side by side. 1 to 8. |
skinsrestorer-allow-skin-names | true | Let a backend ask for a skin by a SkinsRestorer skin name (integration.skinsrestorer.skins in its config). Off = backends only get the skin SkinsRestorer gives a player of the bot's own name. |
The backend's integration.skinsrestorer keys are on Configuration.
Bots travelling between servers
#Bots can move between the servers of the network the way players do.
- The servers that travel must share a roster: the same names in every server's identity list.
- The proxy plugin must be from the same release.
- A move is arrive-then-depart: the bot comes online on the destination first and only then leaves, so the network count never dips.
- A bot online on one server is never brought up on another. The proxy tells every server which identities are elsewhere, and a bot sharing its name with a real player online anywhere steps aside.
- Join and leave messages follow each server's usual settings, as for a real player switching servers.
- Where a bot goes is the proxy's choice: servers with more real players draw more bots, servers already full of bots draw fewer.
| Key | Default | Description |
|---|---|---|
proxy.travel.enabled | false | Let bots wander to other servers. |
proxy.travel.chance-per-hour | 0.5 | How often an average bot wanders off. 0.5 = about once every two hours. |
proxy.travel.min-stay-minutes | 15 | A bot stays at least this long after arriving before it may wander again. |
proxy.travel.max-requests-per-minute | 2 | Most wander requests this server sends per minute. |
Operators can also move bots by hand on the proxy:
/miragenet move <bot> [server]
/miragenet find <bot>
/miragenet where
/miragenet travel
The backend's /mirage net menu opens the network screen with every server, its bots and players, and buttons to move bots.
Sharing data between servers
#Bot state can be shared through one database when several servers run one roster. Set storage.type to mysql, mariadb or mongodb on every server and point them at the same database. Optionally add storage.redis as a shared cache in front of it; it helps most when several servers boot at once. See Configuration.
Play time, statistics and ranks are derived from each bot's UUID, so a bot gets the same history and rank on every server of the network.
Commands that never reach the backend
#Friend or party commands handled by a proxy plugin never reach the backend, so MirageRoster cannot answer them for a bot (social.command-overrides only sees commands that run on the backend).
Found a mistake or something missing? Open a ticket on Discord.
Report an issue