Is BoltNetwork.SessionList valid within BoltStartDone()?

Options
Good evening. I'm wondering if BoltNetwork.SessionList has a list of active sessions when BoltStartDone() is called. I want to connect as a client and check for an open game, and if there's no active game, restart as a server and create one.

Thanks.

Comments

  • ramonmelo
    Options
    Hello @psychogears ,

    The list of sessions is updated asynchronously, as your peer needs to connect to the Photon Cloud and retrieve this information. For this particular case, we provide the `SessionListUpdated`callback that will fire every time this list has changed.

    If you look at our latest release version of the Getting Started tutorial, we've included an example menu showing how you can start the game as a client, and then restart as a server if no room was found after some delay (needed to wait for updates from the cloud services). You can check it here: https://github.com/BoltEngine/Bolt-Sample/blob/v1.2.10/GettingStarted/Scripts/Menu.cs