Documentation

Multiplayer Services SDK

All Services

Multiplayer Services SDK

Get joined sessions

Retrieve a list of all sessions that the current player has joined.
Read time 1 minuteLast updated a day ago

If players need to determine their current session membership, they can use the GetJoinedSessionIds API. This API returns a list of session IDs for the lobbies that the active player is currently a member of. One common use for GetJoinedSessionIds is handling unexpected disconnects. If a game crashes or the user disconnects from a session for any reason, you can use this API to get a list of all sessions a player is a member of and then use the GetSession API to retrieve the full session details or Reconnect to a session.
Note
You can't get a private lobby unless you're a member of the lobby.
The following code sample shows how to get a player’s joined sessions:
using Unity.Services.Multiplayer;using UnityEngine;// ...try{ // Fetches a list of all session IDs the current authenticated user is a part of var sessionIds = await MultiplayerService.Instance.GetJoinedSessionIdsAsync();}catch (SessionException e){ // Multiplayer Services uses SessionException for API errors Debug.Log(e);}