Subscription to lobby events

private static async Task SubscribeToLobbyEvent(string localLobbyId, LobbyEventCallbacks callbacks)
{
try
{
Debug.Log("[LobbyManager] Subscribing to lobby callbacks started. {_lobby}."); await Lobbies.Instance.SubscribeToLobbyEventsAsync(localLobbyId, callbacks); Debug.Log(β€œ[LobbyManager] Subscribing to lobby callbacks ended. {_lobby}.”);
}
catch (LobbyServiceException ex)
{
Debug.Log("[LobbyManager] Subscribing to lobby callbacks failed. {_lobby}."); switch (ex.Reason) { case LobbyExceptionReason.AlreadySubscribedToLobby: Debug.LogWarning( β€œ[LobbyManager] Already subscribed to lobby[{localLobbyId}]. We did not need to try and subscribe again. Exception Message: {ex.Message}”);
break;
case LobbyExceptionReason.SubscriptionToLobbyLostWhileBusy:
Debug.LogError(
"[LobbyManager] Subscription to lobby events was lost while it was busy trying to subscribe. Exception Message: {ex.Message}"); callbacks.LobbyChanged -= OnLobbyChanged; throw; case LobbyExceptionReason.LobbyEventServiceConnectionError: Debug.LogError(β€œ[LobbyManager] Failed to connect to lobby events. Exception Message: {ex.Message}”);
callbacks.LobbyChanged -= OnLobbyChanged;
throw;
default:
callbacks.LobbyChanged -= OnLobbyChanged;
throw;
}
}

In some cases my game stuck in await Lobbies.Instance.SubscribeToLobbyEventsAsync(localLobbyId, callbacks); it doesn’t catch any exception and not printing the log after it anyone can know what is the issue ?

1 Like

I am also facing this issue, Lobby version 1.2.0 and several different Unity versions (2022.3.0f1 is one of them).

Same issue here, stuck at await Lobbies.Instance.SubscribeToLobbyEventsAsync

same issue here anyone find a solution ?

Hey everyone, apologies for the belated reply to this thread.

While we recommend using the Multiplayer Services SDK for new projects, we also understand that this may not be practical for existing code.

Given that, we have not been able to replicate this issue using the attached code, which is a modified version of what was originally provided. We have tested in a URP template using both the standalone Lobby package (1.2.2) and the bundled package in Multiplayer Services SDK (v1.1.0) with Unity 6000.0.23f1, and the standalone package with 2022.3.39f1 and 2021.3.34f1.

If you continue to experience issues with await LobbyService.Instance.SubscribeToLobbyEventsAsync, please provide your:

  • Unity version(s)
  • Lobby version(s)
  • Operating system
  • Region and network conditions (e.g. Europe using VPN)
  • Sample code that reproduces the issue

Thanks in advance!

LobbyStandaloneBehaviour.cs (3.1 KB)