PhotonNetwork.Friends has no definition

Options
I'm having trouble using PhotonNetwork.FindFriends because PhotonNetwork.Friends just does not exist,
has anyone else had this issue?

Comments

  • JohnTube
    JohnTube ✭✭✭✭✭
    Options
    Hi @AaronL,

    You are looking for something from PUN2 in PUN1
    PUN2 docs are here ICYMI.
    As explained in the "Migration Notes":

    PhotonNetwork.Friends is gone. You can get friends list from IMatchmakingCallbacks.OnFriendListUpdate(List<FriendInfo> friendList) callback and optionally cache it.
  • Msico
    Options
    Here's what I'm doing, in a class that extends MonoBehaviourPunCallbacks.
    	public void CheckAllFriends()
    {
    string[] dummylist = new string[FriendIDList.Count];
    for(int x = 0; x < dummylist.Length; x++) {
    dummylist [x] = FriendIDList [x];
    }
    PhotonNetwork.FindFriends (dummylist);
    }


    public override void OnFriendListUpdate(List friendList)
    {
    for (int x = 0; x < friendList.Count; x++) {
    FriendInfo friend = friendList [x];
    Debug.LogFormat ("{0}", friend);
    if (friend.IsInRoom) {
    newspecificroomname = friend.Room;
    } else if(friend.IsOnline) {
    //not sure how to invite friend to a new room
    }
    }
    }