Create second peer on client?

Options
Hi! Is there an example project or example code on how one would create a second peer on the client (to poll the lobby room list)? (I'm seeing an older thread here on this but without answers.) The functions I'm using to create the first peer, like if (!PhotonNetwork.IsConnected)) { PhotonNetwork.ConnectUsingSettings() }, seem to be more global and singular in nature. Thanks!

Comments

  • JohnTube
    JohnTube ✭✭✭✭✭
    Options
    Hi @Philipp,

    PhotonNetwork is static and is for the PUN client only.
    To create a second Photon client, use LoadBalancingClient class.
    Follow Photon Realtime code / documentation.
  • Philipp
    Options
    Thank you! So I'm currently looking at this API page.

    Is there a skeleton code example of the flow I need to use?
    I.e. Connect, PollAvailableRoomsAndOnlineCounts, Disconnect?

    Thanks!
  • Philipp
    Philipp
    edited August 2019
    Options
    If anyone stumbles on this via search, skeleton code is now available here.