PUN 2 Friends List in Game Room

It appears that I cannot query "PhotonNetwork.FindFriends" inside a game room. Is that correct? I can call that before joining a room, but once I join a room, I can't call it. Is there a way to get the status of your friends while your in a room?

Thanks!

Comments

  • Hi @jpac,

    Is that correct?
    Yes, that's correct.
    Is there a way to get the status of your friends while your in a room?
    Not out of the box. You will need to have a separate client (LoadBalancingClient) that stays connected to the Master Server (not joined to the room) to call FindFriends. Having a separate client means having an extra CCU. Or you could use Photon Chat and make use of its 'user status' feature. Using Photon Chat means having a Photon Chat AppId and a Photon Chat plan.
  • jpacjpac
    @JohnTube

    Thanks for the reply and confirming my suspicions. Can you tell me what you mean by a separate client that stays connected to the master server. Am I able to connect to the master server twice on a single device -- and have one connect to the room and leave the other for the master server? Does your plugin support this? I'm fine with the extra CCU for this, but I'm curious on the implementation.

    Thanks!
    Jeff.
  • JohnTubeJohnTube mod
    edited May 16
    Hi @jpac,

    PhotonNetwork.NetworkingClient (LoadBalancingClient) is the PUN client. The main client you want to use for everything.
    Create another LoadBalancingClient instance separately independently and handle it on its own: connect to master server, stay there to call operations there like FindFriends or keep getting app stats etc.
Sign In or Register to comment.