Skip to content
Get started

Lobby

View as Markdown

The lobby is the reference for proxy bundles. Velocity stands in front of two Paper servers, lobby and arena. Every player can type /lobby, and a player kicked from a game lands back in the lobby with a message that says why.

Source: examples/lobby.

  • Rules for the proxy. proxy/Lobby.ts imports no Java. The Lobby component has three messages (AskedForLobby, Kicked, Connected) and two Commands (Connect, Tell).
  • The proxy half. proxy/velocity.ts default-exports Velocity.make(...) from @minekube/velocity. It registers /lobby with Velocity.command, turns Velocity’s kick event into a message, and implements Connect with a connection request whose result is the Connected message.
  • Servers by selector. In the dev network, Velocity finds lobby and arena by label selectors (stage=lobby, game=arena), through the registry. See Labels and selectors.
  • A swap on the proxy. lobby.e2e.ts swaps the proxy bundle for a new revision while the client stays connected, then a backend kicks the player.
  • Every client version. matrix.e2e.ts joins with the official client of each protocol version Velocity lists. Each one must land in the lobby, get /lobby’s answer and survive a kick, on one connection.

From the repository:

Terminal window
mk server --network
mk dev examples/lobby

Join localhost. bun test examples/lobby runs the rules and replays recordings/lobby-and-kick.ndjson. bun run test:e2e and bun run test:matrix run the end-to-end tests. They need the dev network and Java 25, and the matrix downloads a few GB of clients on its first run.

Was this helpful?