How can I use the JoinSessionLobby/OnSessionListUpdated to receive a list of sessions one can join?

Hi,

I am trying to implement some custom lobbies. 

Fusion provides the JoinSessionLobby, StartGame and the OnSessionListUpdated callback. Now... how can I get these session list updated callbacks because if I use StartGame and create multiple players on multiple shared sessions with StartGame, it never gets called. If I use JoinSessionLobby then this gets called (although with an empty list) but the other callbacks don't and as a result my player doesn't spawn.


The result I get from JoinSessionLobby is OK - TRUE and ShutdownReason OK

Best Answer

Answers

  • digicamlux
    edited March 2022 Answer ✓

    Hello,

    Yes, you can use JoinSessionLobby to connect to a lobby and the OnSessionListUpdated to join a game session listed in the lobby based on its SessionInfo.

    The answer to your question about how you can implement this: Check out this Sample project from Fusion, it is done here: https://doc.photonengine.com/en-us/fusion/current/samples/fusion-application-loop

    They have implemented the exact same behavior you're looking for.

    Kind regards

  • Thank you so much for the reply, I will take a look but just by checking out the page it seems like it is doing pretty much what I want. :)

  • Does the sample project create it's own custom lobbies?

    From this line in App.cs, I can see that the app is joining a custom lobby, but can't find a place where it is hosting these lobbies (if necessary at all).

    var result = await _runner.JoinSessionLobby(SessionLobby.Custom, lobbyId);