How to find a friends ?
I have no idea how to use method
instance:findFriends (friendsToFind)
Requests Master server for actors online status and joined rooms.
Override onFindFriendsResult to handle request results.
Parameters:
friendsToFind: table Actors names array.
How can i get the actor's names ? or friends names
How can i set names of the actor ?
instance:setName(name) method doesn't working for me so far.
Please help me....
Thank you in advance.
Bhavin
instance:findFriends (friendsToFind)
Requests Master server for actors online status and joined rooms.
Override onFindFriendsResult to handle request results.
Parameters:
friendsToFind: table Actors names array.
How can i get the actor's names ? or friends names
How can i set names of the actor ?
instance:setName(name) method doesn't working for me so far.
Please help me....
Thank you in advance.
Bhavin

0
Answers
Override onFindFriendsResult in your client. As soon as server replies, this method will be called with requested friends infos as parameter:
Yes, i just got working findFriends method and getting response in onFindFriendsResult(...) also.
I am just worried now that i am not getting roomId for the Actor.
And always getting online == false , even when i that particular friend(actor) joined room already.
Thanks.
Bhavin
1. connect one player to the lobby and set a name --> "player1"
2. connect 2nd player to the lobby and set a name --> "player2"
3. now call findFriends({"player1"}) from player2's deviceand got result :
playerName == player1
roomId == "" or nil
online == false
4. now create room from player1 and set name "room1"
5. now call findFriends({"player1"}) method once again and see the same result as step 3..
Now what is wrong here ?
I can't get player correct status and room Id ...
Please help me.
Actually i want functionality like this:
When player comes up and joined to the lobby, he wants to join a room in which his friend is joined.
So finding friends with name and get room name (roomId) , so we can then join that room.
What should i do here ?
Thank you.
Bhavin
Is there anything wrong with my code ?
Please help me.
I can't move on without findFriends method working..
Thank you.
Bhavin
2. client:setUserId("player1") method should be used. Friends are searched by userId's in fact. not by player name set via client:myActor():setName.
There is some mess with ids and names in Photon currently. Sorry for that. We will sort it out.
Thanks For the reply.
I just test with setUserId and then try findFriends() method and it's working now.
now i have just one question :smile :
I can client:setUserId(userId) just after client instance created ?
so will be like this :
is that looks okay or i need to set it after join Lobby ?
Thank you so much for the solution Man...
Bhavin
Right after client instance creation is perfect.