Skip to main content

Lobby Service

The Lobby Service is a middleware API for rooms enabling players to create and find existing 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.

Lobby Service

Features

With our managed Lobby Service, you can:

  1. Rate limit the number of lobbies a player can create (defaults to 10 lobbies per hour).
  2. Create and update lobby configurations as JSON blobs.
  3. Create private lobbies to allow for a room code sharing system.
  4. 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.

CreateRoomCreateLobby
Create a room in a specified regionCreate a room in a specified region
Call from server or middleware (i.e. matchmaker)Call from client code
Developer authenticationPlayer 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

Configure and manage lobby metadata using roomConfig. User input can be stored in roomConfig to initialize a match when CreateLobby() is called. However, once a match is initialized, only your game server code can update roomConfig using UpdateRoomConfig(). roomConfig can be any string including a stringified JSON but must be <= 10k characters.

roomConfig is accessible by both game client and server. Here are a couple ways to use roomConfig:

  • user input to initialize a match using CreateLobby()
    • Example use-cases:
      • Number of players allowed in the room
      • Map selection
  • game server code updates match progress using UpdateRoomConfig()
    • Example use-cases:
      • Live player count to enforce max number of clients
      • Persist end-game data like winner and final scores