question

Reid Taylor avatar image
Reid Taylor asked

2 Way confirmation Friend Request...

Hi, I'm working on friend requests and I saw a few people ask how to do it. They were all answered with this link. The problem is Step 2. I know how to add player 2 as a friend from player 1. But I don't know how to tell player 2 to add player 1 as friend from player 1?

Friends
10 |1200

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

1 Answer

·
Ivan Cai avatar image
Ivan Cai answered

Are you confused about the step 2 which is shown below?

  • Use AddFriend on both players, setting each in the other player's friend list.

If this is the case, the operation of "Use AddFriend on both players" is not a client operation. The operation of adding each other as friends is done by calling Server.API “AddFriend” twice on the server side, once for player 1 adding player 2, and once for player 2 adding player 1.

3 comments
10 |1200

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Reid Taylor avatar image Reid Taylor commented ·

Thanks for the reply! I think I get where this is going.You're saying that I'm using client side api which only allows me to add friends from current client, but when you use ServerApi, you send in playFabIds through the request?

0 Likes 0 ·
Ivan Cai avatar image Ivan Cai ♦ Reid Taylor commented ·

Yes, it is sent to cloudscript via the request in the PlayFabClientAPI ExecuteCloudScript.

0 Likes 0 ·
Reid Taylor avatar image Reid Taylor commented ·
0 Likes 0 ·

Write an Answer

Hint: Notify or tag a user in this post by typing @username.

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.