Lobbies
Lobby players and the host
List who is in a lobby, find the host, and react when people come and go.
Listing everyone
Call Get Lobby Members with a lobby ID. You get an array of Steam Lobby Member:
| Field | Meaning |
|---|---|
| Player | Their Steam ID |
| Persona Name | Their Steam display name, ready to show |
| Is Local Player | True for the player holding this copy of the game |
| Is Owner | True for the host |
That is everything a player list widget needs, with no follow up calls.
For just a count, use Get Lobby Member Count.
Finding the host
Two ways, depending on what you need:
The host is whoever created the lobby. If they leave, Steam picks a new one automatically.
Reacting to people joining and leaving
Bind On Lobby Member Changed on the SteamForge Lobbies subsystem:
| Output | Meaning |
|---|---|
| Lobby | Which lobby |
| Member | Who changed |
| Change | Entered, Left, Disconnected, Kicked or Banned |
The usual handler simply calls Get Lobby Members again and rebuilds the list.
Disconnected is worth treating differently from Left. Left means they chose to go. Disconnected means they crashed or lost connection, which is the case host migration exists for.
Per player data
Each member can publish their own key and value pairs, which is how you carry a chosen team, character or ready state.
A ready check is the classic use:
ready and value 1.ready value, and update your UI.On Lobby Data Changed
This fires for both kinds of change. The Member output tells you which:
Check with Is Valid (Steam ID) before assuming.
Where to go next
Lobby data, for the shared settings everyone reads.