Poll for updates
Poll a lobby to retrieve its state to keep data current.
Read time 1 minuteLast updated 15 hours ago
The Lobby service enables players to find and connect with other players. It provides a lightweight, non-realtime way to share data and jump into scenarios that best fit the player’s needs without requiring a dedicated game server. Players can also use this to establish a real-time connection with each other (for example, by using the Relay service). The data in a lobby can change and might occasionally need to be polled. The following list details example scenarios where polling might be required:
- A player’s real-time Lobby updates arrived out-of-order and the most recent lobby needs to be reloaded
- Connection info (how to establish a real-time connection) isn’t populated yet
- The real-time connection is lost and new connection info is required (for example, finding out if the host has changed or if the connection information has changed)
- When storing and retrieving not frequently updated data about the player
try{ var lobby = await LobbyService.Instance.GetLobbyAsync("lobbyId");}catch (LobbyServiceException e){ Debug.Log(e);}