FindFriends failed when in the room

Hi, Photon team:
I use pun, my app will be online, but I encounter a problem:
1. When I join in a room, and I call PhotonNetwork.FindFriends(mAllFriendNameList.ToArray()),
it give me an error: "FindFriends failed to apply the result, as a required value wasn't provided or the friend list length differed from result."

But when I join in a lobby, I call PhotonNetwork.FindFriends(mAllFriendNameList.ToArray()), it works OK.
So I think it may be a bug when I call PhotonNetwork.FindFriends(mAllFriendNameList.ToArray()) in a room.

Can you tell me how to solve it ?


  • Hi,
    FindFriends is available only if you are connected to Master Server (most likely in lobby).
    So all works as expected but error message is not correct. Must be "You are not connected to Master Server".
  • Hi, vadim:
    I call FindFriends(...) in the update() function every 10 seconds
    When I join in the room, I think I have connected to Master Server, because I can play with other players.
    And it is very surprised that in the lobby all is ok, but when I play in the room, FindFriends give this error.

    I use the same code in the room and in the lobby.

    And there is the same problem at this link: viewtopic.php?f=17&t=4494

    I use PUN.
    Thank you!
  • PUN client disconnects from Master Server before joining the room. It connects to other (Game) Server which does not support FindFriend command.
    Without insignificant details, you may consider 'in lobby' as 'connected to Master '.
    Then problem is that you need friends info while connected to the room. And pretty frequent. What are you trying to do? Looks like FindFriends was not designed for that.
  • Hi, vadim:
    Thanks for your reply, I want to write a friends system, I can view my friends' status such as online, room info.
    If my friend is in a room, i can join in his room even if i was in another room.
    But if I get the latest status of the friends, I must call the FindFriends(..) to update player's status.
    Thank you!
  • I want to get the player's status in the room, is there a way to finish it ?
    And I think it will be perfect to let me view other player's status in the room.
  • Find Friends does not work in a room. It only works on the Master Server and this is very unlikely to change. We consider more frequent updates to have few benefits but a lot of drawbacks on the server-side.

    If you want to get more info about friends, use Photon Chat.
    It's independent of the server you are on and each user can set a state which friends get "pushed" instead of having to pull it. The friend list has to be set only once and: You can chat with anyone in any room.