Documentation menu

Registries

Redis

Servers add themselves to a Redis you run and report their player counts every few seconds.

With "backend": "redis", every server writes itself into a Redis database and reads everyone else from it. New servers appear by themselves, and /play sees real player counts.

mods/Link_Link/link.jsonJSON
{
  "serverId": "sw-1",
  "group": "skywars",
  "host": "play.example.com",
  "port": 5521,
  "backend": "redis",
  "redis": {
    "url": "redis://:your-password@10.0.0.5:6379/0",
    "namespace": "link"
  }
}

Set it up

  1. Make sure every server can reach your Redis, and that the Redis has a password.
  2. Put the redis block in link.json on every server, with its own serverId, group, host and port.
  3. Start the servers. The first one to connect creates the network secret in Redis. The others read it, so there is nothing to copy.

host is required with Redis. It is the address players are sent to, so it must be reachable from a player’s game.

Put a password on that Redis. Anyone who can write to it can add a server to your network and sign transfers. Use rediss:// in the URL for TLS.

How it works

  • Every 3 seconds, each server writes its current player count and reads the list.
  • Each server’s entry expires 15 seconds after its last write, so a server that crashes drops out of /play by itself.
  • A server that shuts down cleanly removes itself right away.

Link uses these keys, under your namespace:

KeyHolds
link:secretThe network secret, created by the first server
link:serversThe ids of every server that has registered
link:server:<id>That server’s details, expiring with its heartbeat

Several networks, one Redis

Give each network its own namespace. Networks with different namespaces don’t see each other and have different secrets.

Something wrong or missing on this page? Open an issue on GitHub.