Project Structure
Services and their jobs
BlueDragon is split into a few crucial services:
- Our Minestom implementation runs all the games.
- Velocity routes players between game servers and handles features like the Jukebox.
- Puffin handles all of the coordination and messaging between services. Its main job is managing the player queue and ensuring that a minimum number of game instances are available.
- MongoDB stores player profile information and permissions.
- LuckPerms handles player permissions and ranks.
Messaging
These services need to communicate with each other to perform important tasks like queueing for games, sending players between servers, and handling parties.
We have proto
(Protocol buffer) files in a GitHub repository that define our schema, and then we use the Protobuf Gradle plugin to generate Java and Kotlin clients to use across our applications.
Whenever a game server or proxy starts up, it attempts to create a gRPC channel to Puffin. Using the shared schema, they can communicate in a binary format with an automatically-generated client and server.
Learn more about gRPC in their documentation.
Service | Initiates a Connection With | Responsibilities (and proto file links) |
---|---|---|
Game Server | Agones Sidecar Container | Server healthchecks, readiness, and reservations |
Game Server | Puffin | Player tracking, queueing, game state tracking, parties, receiving chat messages |
Proxy | Puffin | Sending players, finding available lobbies, discovering game server IPs |
gRPC channels are bidirectional, so once a connection is established, messages can flow both ways.