Connect several servers
Announce a server's events to the whole network and send players to them with a click.
By the end of this page the servers of your network announce their events to each other, and a player in the lobby clicks the line of an event on the arena server and is connected and put into it. A single server needs nothing on this page: switched off, which is how it ships, no channel is opened and every join takes the local path it always took.
Before you start#
- Redis on in
database.ymlon every server. - A different
server-idon every server (the Redis block ofdatabase.yml). The proxy and the announcements address a backend by it. ExyliaProxyUtilson the proxy: it moves the player between servers.- The same database on every server, so arenas and statistics are read from one place.
If any of those is missing the plugin stays quiet, says so once in the console and keeps working as a single server.
database.redis and network.enabled are separate switches on purpose. A server may share a cache with the network and still want its events to itself.
Steps#
Turn it on in each server
Set network.enabled: true in config.yml and restart.
network:
enabled: true
return-on-end: trueCheck the link
Run /eventsadmin network on each server. It waits two seconds for the others to answer, then prints the lines described in Checking the network.
Start an event
On the server that owns an arena, start an event. On the others, run /events start <id> for an arena that lives elsewhere: the start is handed to the owner.
Check that it works#
/eventsadmin network must show this server's server-id, network events on, and the other backends under "servers answering". Then start an event on the arena server and, from the lobby server, click the announcement line: the player is connected, placed in the event and teleported to its lobby spawn. What travels is the announcement and the intent to join, never a location.
Going further#
enabledbooleanpor defecto falseWhether this server announces its events to the rest of the network, and accepts the players other servers send to them.
return-on-endbooleanpor defecto trueWhether a player the network brought here is sent back to the server they came from once their event lets go of them: it ended, they left, or they arrived to find it already full. It only undoes a move this plugin made; a player who walked onto this server by themselves is never moved. Turn it off on a server players are meant to stay on.
Arenas belong to a backend#
An arena records the server it was configured on. That server is the only one that may edit it, start it, or write it back — the rule that keeps a shared database safe, since no other backend has the world the arena is in and would save a row full of places it cannot see.
- The admin configuration list shows each arena's server.
/events start <id>on an arena that lives elsewhere hands the start to the server that owns it, and reports back whether it started. Every limit — cooldowns, event caps — is applied by the server that owns the arena, not by the one that asked.- Tab completion offers the whole network's startable arenas, local and remote alike.
An arena configured before any of this names no server, and the world decides instead: it belongs to whichever backend has the world it is in. On a lone server that is always the local one, so nothing an admin already configured changes or has to be touched.
A server without Redis owns every arena in its database, whatever server name they were saved under
and whatever server-id says now: off a network the database is its alone.
Renaming a server#
A server that played alone as server-1 and then joins a network under another name lists its old
name in previous-ids, in the Redis block of database.yml:
database:
redis:
enabled: true
server-id: events
previous-ids:
- server-1previous-idslistpor defecto []Names this server ran under before. Arenas saved under one of them stay this server's, and are
rewritten under the current server-id when they load, so the other backends — which only know the
current name — send their starts to the right place. Never list a name another server of the network
is using.
Arena ownership is stored inside the arena's existing settings, so an existing database is not altered and nothing has to be migrated.
Checking the network#
/eventsadmin network waits two seconds for the other servers to answer, then reports:
| Line | What it says |
|---|---|
| The header | This server's server-id. |
| Network events | Whether this server's channel is open. Off points at network.enabled in config.yml. |
| Servers answering | The backends that answered. None means no other server shares this Redis and key prefix. |
| Arenas on other servers | How many arenas in the database belong to another backend. |
It runs from the console as well.
Lobbies, event ids and messages
One lobby per backend#
The main lobby is stored per server-id in events_server_settings. Backends sharing one database
used to share one lobby row, so the last admin to set theirs moved everybody else's — to a world only
their server has. Each server now answers for its own and reads nobody else's.
The single row an older version wrote is adopted once, by the one server whose world it is actually in. On a lone server that is always true and the lobby is kept without anyone doing anything.
Network-wide event ids#
An event that travels is addressed as server:event. Ids without a server in them are local, which
is every id an admin ever types — a configuration id can only contain a-z, 0-9, _ and -, so
the two can never be confused.
Messages stay local#
Only the facts travel: the event, its type, its state, how many players it holds and who started it.
Every server renders them through its own messages.yml, so a network running two languages keeps
both.
Something missing on this page? Tell us on Discord