Lobby Service
The Lobby Service is a middleware API for rooms
enabling players to create and find exisiting matches. It can be useful for games that are looking to have a player-driven server browsing (an alternative to a matchmaker).
Check out Bullet Mania, a showcase game that uses our Lobby Service.
Features
With our managed Lobby Service, you can:
- Rate limit the number of lobbies a player can create (defaults to 10 lobbies per hour).
- Create and update lobby configurations as JSON blobs.
- Create private lobbies to allow for a
room
code sharing system. - List active public lobbies to allow for a server browsing system.
CreateRoom vs. CreateLobby
CreateRoom is an admin API call, called on behalf of a developer, and CreateLobby is a player API call, called on behalf of a player.
CreateRoom | CreateLobby |
---|---|
Create a room in a specified region | Create a room in a specified region |
Call from server or middleware (i.e. matchmaker) | Call from client code |
Developer authentication | Player authentication |
- | Rate limit players on lobby creation |
- | Create and update lobby configuration |
Developer authentication used in CreateRoom
is a secret token that players should never have access to, do not expose it to the client at any point.
We require a secret token to call the CreateRoom
endpoint because it schedules compute on our platform that you'll pay for. If players could call CreateRoom
directly then they could spam room creation and run up your bill. Our Lobby Service has player authentication and rate limiting to prevent this scenario.
Manage lobby configuration
If you need to configure lobby metadata, we offers two ways to do so:
initialConfig
: pass in user input to initialize the game. Immutable and must be smaller than 64KB.- Example use-cases:
- Number of players in the room
- Map selection
- Example use-cases:
state
: set by your game server code and accessible by both game client and server. Store custom JSON blobs that persist forever. Must be smaller than 1MB.- Example use-cases:
- Live player count to enforce max number of clients
- Persist end-game data like winner and final scores
- Example use-cases:
