Backend config
What to set on the lobby servers and what to set on the duel servers.
Restart after changing storage or cross-server in database.yml. /md reload does not apply them.
Read Roles and common terms first if lobby, game or the two server-name keys are new to you.
What is the same everywhere
These settings are identical on every lobby and every duel server.
| Setting | Value |
|---|---|
storage.type and storage.mysql.* | mysql, the same database |
cross-server.enabled | true |
cross-server.redis.* | The same Redis host, port, password, database and ssl |
cross-server.secret | The same secret, at least 32 random bytes |
cross-server.assign-timeout-seconds | The same value |
Kits (kits/) | The same kit files |
These settings differ per server:
| Setting | Lobby | Duel server |
|---|---|---|
cross-server.server-name | Its own name from velocity.toml | Its own name from velocity.toml |
cross-server.role | lobby | game |
Lobby server
A lobby holds the players. It queues them, shows the menus and, when it is elected, pairs the network queue.
database.yml
storage:
type: mysql
mysql:
host: db.internal
port: 3306
database: mineduels
username: duels
password: change-this
cross-server:
enabled: true
server-name: lobby-1
role: lobby
redis:
host: redis.internal
port: 6379
password: change-this
database: 0
ssl: false
secret: "paste the shared secret here"
global-chat: false
assign-timeout-seconds: 30
party-away-minutes: 30
disconnect-grace-seconds: 10Other settings on a lobby
| Where | Setting | Purpose |
|---|---|---|
| In game | /md setlobby | The lobby spawn. Players arriving from a duel server land here. |
matchmaking.yml | queue.* | tick-interval, the ranked range and multi-queue are used by the lobby that is the matchmaker. Keep the file identical on all lobbies, because any lobby can be elected. |
matchmaking.yml | queue.server-name | Optional label in the queue action bar. Not the network name. |
guis/server-selector.yml | servers, show-roles | The /servers menu. List servers by their velocity.toml name to give them a display name, a material or a slot. |
guis/lobby-items/ | Hotbar files | The lobby, queue, party and post-match items. |
kits/ | Kit files | The queue menus list these kits. |
The found message, the match-found animation and the queue.match-found effects and delay are played on the lobby the player queued from, before the transfer. The duel server does not repeat the message or the animation for queue matches. Keep matchmaking.yml, messages.yml and animations.yml identical on all lobbies. The duel server still gives queue.match-found.effects again while players wait there.
A lobby does not need arenas. The queue works network-wide without an arena pool on the lobby.
Duel server
A duel server runs the matches. Players are sent there only for an assigned match, and they go back to a lobby afterwards.
database.yml
storage:
type: mysql
mysql:
host: db.internal
port: 3306
database: mineduels
username: duels
password: change-this
cross-server:
enabled: true
server-name: game-1
role: game
redis:
host: redis.internal
port: 6379
password: change-this
database: 0
ssl: false
secret: "paste the shared secret here"
assign-timeout-seconds: 30
return-wait-seconds: 6
hold:
enabled: true
world: ""
x: -1000000
y: 200
z: -1000000
material: black_concrete
wait-max-seconds: 8Other settings on a duel server
| Where | Setting | Purpose |
|---|---|---|
kits/ | Kit files | The same kits as the lobbies. |
arenas/ | Saved arenas | A kit can only be hosted when the server has arenas for it and the pool is ready. The free arena counts in the heartbeat decide which duel server the matchmaker picks. |
config.yml | arena.* | The arena pool: grid and per tick budget. Size it for the number of matches the server hosts at once. |
config.yml | match.arrival-settle-seconds | Minimum seconds between everyone being in the arena and the countdown. Default 2, range 0 to 10. |
config.yml | match.arrival-wait-max-seconds | Longest wait for every client to receive its chunks. Default 6, range 2 to 30. |
config.yml | post-match.game-servers | true gives matches on a duel server the normal post-match stay and items before players go back to their lobby. |
match-start.yml | arrival-box.* | A box of client-side blocks around each player until the fight starts (freeze start mode). Keys: enabled, game-server-only, material (default black_concrete) and roof. |
match-start.yml | elevator.preload | Sends the elevator walls and platform before the countdown. |
| In game | /md setlobby | Optional. Players never wait at the spawn of a duel server. |
Key reference
Core
| Key | Default | Meaning |
|---|---|---|
enabled | false | Turns network mode on. It needs MySQL, a password on Redis and a strong secret. |
server-name | lobby-1 | The exact name from velocity.toml. 1 to 64 characters of letters, digits and _ . : -. |
role | lobby | lobby or game. |
redis.host, port, password, database | localhost, 6379, empty, 0 | The shared Redis. The password cannot be empty. |
redis.ssl | false | Use TLS to Redis. |
secret | empty | The shared secret. Every message is signed with it. |
global-chat | false | Chat lines of this server are sent to the others, and chat of other servers is shown here. Both sides need true. |
chat-server-name | true | With global-chat, show [server-name] before lines from other servers. false shows only Name: message. See Global chat. |
assign-timeout-seconds | 30 | A match is cancelled when its players are not all on the duel server within this time. Range 5 to 300. |
party-away-minutes | 30 | Lobby: party members that stay on a duel server longer than this leave the party. Range 1 to 1440. A player who disconnects from the network leaves the party at once (needs the proxy plugin). |
proxy-server-name | empty | This server's name under [servers] in velocity.toml, when it differs from server-name. |
proxy | empty | The proxy this server sits behind (its proxy-name), when the network has several proxies. The server is in the region of that proxy, if the proxy has one. The old region key was removed: set region on the proxy. See Regions. |
disconnect-grace-seconds | 10 | Duel server: how long the other players of a found match wait for a player who disconnected. If the player reconnects in time the proxy sends them to the duel server. Range 3 to 60. |
Global chat
With global-chat: true on both servers, a line typed on lobby-2-eu appears on lobby-1 like this:
[lobby-2-eu] ClownButSleepy: helloHide the server name in database.yml:
cross-server:
global-chat: true
chat-server-name: falseClownButSleepy: helloThe same setting applies to the console line. The wording lives in messages.yml:
cross-server:
global-chat: "<server-tag><white><player></white><dark_gray>:</dark_gray> <gray><message>"
global-chat-server-tag: "<dark_gray>[<gray><server></gray>]</dark_gray> "<server-tag> is the global-chat-server-tag line, or nothing when chat-server-name is false. Restyle the tag in global-chat-server-tag:
cross-server:
global-chat-server-tag: "<aqua><server></aqua> <dark_gray>|</dark_gray> "lobby-2-eu | ClownButSleepy: helloUpdate note: when messages.yml is updated, an untouched global-chat line is replaced with the <server-tag> version. A line you changed is kept. If you turned chat-server-name off and your own line has no <server-tag>, the plugin logs a warning at startup and the name stays in the line. Add <server-tag> to your line to use the setting. A restart is needed after changing chat-server-name.
Duel server only
| Key | Default | Meaning |
|---|---|---|
return-wait-seconds | 6 | After a match the server asks the proxy to move the player to a lobby and waits this long for them to leave. If they are still there, they are teleported out of the arena instead. Range 2 to 9. |
hold.enabled | true | Players wait on a block of their own until everyone of their match is loaded. false makes them wait in the arena. |
hold.world | empty | The world of the waiting blocks. Empty uses the arena world. |
hold.x, y, z | -1000000, 200, -1000000 | Where the row of waiting blocks starts. Choose a spot far from every arena. Each player gets a spot 4 blocks further along x. |
hold.material | black_concrete | The block under the waiting players. It must be a solid block. |
hold.wait-max-seconds | 8 | The longest to wait for a client that does not report its world as loaded. Range 2 to 60. |
Redis message protection
The defaults suit most networks. All servers and the proxy should use the same values.
| Key | Default | Meaning |
|---|---|---|
max-message-bytes | 65536 | Larger messages are refused. Range 4096 to 262144. |
window-seconds | 30 | Messages whose timestamp differs from the local clock by more than this are refused. Range 5 to 120. |
nonce-capacity | 50000 | How many message ids are remembered to refuse repeats. Range 1000 to 1000000. |
limits.pre-auth | 2000 | Messages per second accepted before they are checked. |
limits.heartbeat | 5 | Heartbeats per second accepted from one server. |
limits.chat | 20 | Chat messages per second accepted from one server. |
limits.other | 100 | Other messages per second accepted from one server. |
Single server or network
| Setup | cross-server.enabled | storage.type | role |
|---|---|---|---|
| One Paper server | false | sqlite is fine | not used |
| Velocity network | true on every backend | mysql | lobby or game per server |
With storage.type: sqlite and enabled: true, cross-server stays disabled. Fix the storage or turn cross-server off.