Setup
Set up Mirror: regions for lobbies and game servers, the Aegis config, turning mirrored matches on, and the TCP link between regions.
Before you start
You need a working Duels network with Robotricks, and at least two regions. Each region needs its own Duels lobby and Duels game servers. See Duels installation and Robotricks installation.
Mirror decides a player's region from the server they are on when they queue. Players in an EU lobby count as EU and players in a US lobby count as US.
Install
Products are delivered through your personal Aegis loader. If the loader is not on the server yet, follow Installation first.
Set each server's region
Give every lobby and game server the region it runs in. Lobby and game servers in the same region must use the same value.
serverId: duels-game-1
region: eu
group: duels-gameThe NEXUS_REGION environment variable overrides region.
Add Mirror to every game server
Add Mirror on every Duels game server in every region. It is not needed on lobbies.
products:
DuelsGame:
enabled: true
release: latest
channel: stable
required: true
Robotricks:
enabled: true
release: latest
channel: stable
required: true
Mirror:
enabled: true
release: latest
channel: stable
required: trueTurn on mirrored matches
On every game server, set mirror: true in Scaffold's config. You can set the SCAFFOLD_MIRROR environment variable to true instead.
gameServer: true
mirror: trueLeave mirror: false on your lobbies.
Open the link between regions
Every game server listens on TCP port 25599 and connects to the other region's game server on the same port. See The link below.
Restart
Restart the game servers. The console logs [mirror] listening on 25599 when Mirror is ready.
The link
When a mirrored match starts, the game server with the alphabetically first server id waits for the connection and the other one dials it. The dialling server tries every second for about 15 seconds.
A server is reached at this address:
<serverId>.<group>.<domain><serverId>is the Kernel server id of the other game server, such asduels-game-1.<group>is that server id up to its last-, such asduels-game.<domain>isdomaininplugins/Mirror/mirror.. It isyml nexus.by default.svc. cluster. local
So duels-game-1 with the domain eu.example.net must resolve as duels-game-1. from every other region. Set up DNS so each game server's name points at that server, and allow the Mirror port between them.
Check it works
- Queue the same kit for 1v1 from lobbies in two regions.
- Each player should land on a game server in their own region, facing the other player's skin.
- The guest server logs
diallingand the host logswaiting for, both followed by the other server's id. A log line saying the matchcould not reacha server means the address or port is wrong.