Ali Şahan Yalçın
DocsLobby data

Lobbies

Lobby data

The shared key and value store every member can read, and searches can filter on.

Lobby data is a small store of text keys and values attached to a lobby. It does two jobs:

  • It carries settings every member should see, like the map and game mode.
  • It is what lobby searches filter on.
  • Anything you want visible in a lobby browser has to live here, because a search reads lobby data and nothing else.

    Writing

    Set Lobby Data takes a lobby, a key and a value. Host only.

    Typical use, straight after creating a lobby:

    KeyValue
    nameAlisahan's game
    mapWarehouse
    modedeathmatch
    version1.4.2

    The keys are entirely your choice. Pick a set, write them down, and use the same ones in your search filters.

    Reading

  • Get Lobby Data reads one key.
  • Get All Lobby Data returns everything as a map, which is what you usually want when building a browser row.
  • Delete Lobby Data removes a key. Host only.
  • Search results already include this map, so you do not need to call anything extra for lobbies you found through a search.

    Size limits

    Steam caps a single value at 8192 bytes, and keys at 255 characters. Lobby data is for small settings, not for content.

    If you need to move more than that, send it over the networking layer once players are connected.

    Publishing a game server

    When the host starts the match, they publish where everyone should connect:

  • Set Lobby Game Server takes an address and port, or a Steam ID for a Steam game server.
  • Every member receives On Lobby Game Created.
  • Each member then travels themselves. Travel To Lobby Game Server does that for you.
  • WARNING: Steam does not move anybody. It only tells them where to go. A game that publishes a server and does not handle On Lobby Game Created on the clients is the reason "the host started the match and nobody followed" happens.

    Version gating

    Publishing your build version as lobby data lets you keep incompatible players out before they join rather than after:

  • Host publishes version.
  • Searchers compare it to their own version.
  • Grey out mismatched lobbies rather than hiding them, so a player can see their friend's lobby and understand why they cannot join it.
  • The Sessions layer does this for you if you would rather not build it.

    Where to go next

    Chat and invites.