Lobby network
The lobby network is the reference for network 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-network.
What it shows
Section titled “What it shows”- Rules for the proxy.
network/Lobby.tsimports no Java. TheLobbycomponent has three messages (AskedForLobby,Kicked,Connected) and two Commands (Connect,Tell). - The proxy half.
network/velocity.tsdefault-exportsNetwork.make(...)from@minekube/network. It registers/lobbywithNetwork.command, turns Velocity’s kick event into a message, and implementsConnectwith a connection request whose result is theConnectedmessage. - Servers by selector. In the dev network, Velocity finds
lobbyandarenaby label selectors (stage=lobby,game=arena), through the registry. See Labels and selectors. - A swap on the proxy.
lobby-network.e2e.tsswaps the network bundle for a new revision while the client stays connected, then a backend kicks the player. - Every client version.
matrix.e2e.tsjoins 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.
Run it
Section titled “Run it”From the repository:
mk server --networkmk dev examples/lobby-networkJoin localhost. bun test examples/ runs the rules and replays recordings/. 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.
Read next
Section titled “Read next”- Network bundles: how a network bundle is written.
- Run the dev network: what
mk server --networkstarts.
Was this helpful?
Thanks for the feedback.