Photon and friend

Hi!

I see that Photon add some friend features, and i would like to know if there is some link about documentation ? I look to google and other and i find nothing about that :/

I'm talking about Photon network and not Photon chat :)!

Haver a good day !

Comments

  • JohnTube
    JohnTube ✭✭✭✭✭
    edited October 2017
    Hi @redskry,

    Photon Realtime, PUN or Photon Network and LoadBalancing API all have an operation called FindFriends which accepts array of UserIDs and return the following per UserId:
    if user is (existent and) online or not
    in case the user is online:
    if user is in game or not
    in case the user is in game:
    GameId (or room name)

    Photon Realtime, PUN or Photon Network and LoadBalancing API do not have AddFriend feature or method or operation. Photon Chat does however.
  • Thanks for your answer !

    So i can know in what room my friend is if is connect?
    The name/ID is set with photonNetwork.name before connect ? ( just in case )

    So with photon PUN , i just have To create a array of string with friend name, call FindFriend , and that all ?


    Thanks for your help !
  • JohnTube
    JohnTube ✭✭✭✭✭
    Hi @redskry,

    The name/ID is set with photonNetwork.name before connect ? ( just in case )
    Please use UserID as friendID (for example facebookID, googleID, PlayFabID, etc.).
    To set UserID properly before connecting (in case you do not use Custom Authentication):
            PhotonNetwork.AuthValues.UserId = userId;
    
    Failure to do so will result in the server generating a random GUID as UserID for your client/user/player.
  • Ok, i was thinking that userID is was a string ..

    So the userID is not unique ?

    Can i check if a user has already a specific idea before I set it ?

    I use custom login with mysql data base
  • JohnTube
    JohnTube ✭✭✭✭✭
    edited October 2017
    Yes UserId is a string.
    Even the GUID is converted to string form in case you wondered.
    And yes UserId should be unique per user. However, Photon allows clients with the same UserID outside of rooms only. Inside rooms, you can't join a room when there is an actor with the same UserID inside (active or inactive).

    Can i check if a user has already a specific idea before I set it ?
    You should do this in your registration or sign up logic.
    Or if you want to disallow simultaneous connections or multiple devices/session for a single UserId you need to implement this in your custom authentication.

    I use custom login with mysql data base
    Good!
  • Okay! Thanks a lot for your help !
    Have a good night !