question

vincentpiedeloup avatar image
vincentpiedeloup asked

How to manage Friend list manually without errors and API request limit

I try to update manually the friend list (mostly because EPIC games sdk is not present)

The client sent the whole friend list, by user name, I try to add all the friends.

One by one, I try to add friends, I have 2 kind of errors.
- Friend allrealy there
- Friend don't have playfab ID

In both cases, I have an overloaded API access if I sent more than 25 friends.

Is there a way to add a list of all friend in one call and Playfab accept in all case (eventlually with list of failled friend and error.

But honestly I don't care if a friend is allready there or if the guy don't have playfab ID.

Platform SDK don't allow us to only get friend who bought the game.

Maybe I miss something, but I don't find how to do that.

CloudScriptFriends
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

·
Rick Chen avatar image
Rick Chen answered

You may write a CloudScript to add a list of friends. For example:

handlers.AddFriends = function(args, context){
for(var i =0; i<args.FriendList.length; i++){
try{  server.AddFriend( 
{ 
PlayFabId: currentPlayerId, 
FriendPlayFabId: args.FriendList[i] 
} 
);  }  catch(error){ 
log.info(error);  }  }  return true;}

Then the client can call this Function and pass a list of friends’ PlayFabId in the function parameter. If there is an entry in the list that is not a PlayFab ID, the function will skip it.

If you are not familiar with CloudScript, you can check out this document: CloudScript quickstart

Please feel free to ask if you have any further questions.

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.

vincentpiedeloup avatar image vincentpiedeloup commented ·

That was exaclty what I did, but every AddFriend, count as 1 API access even for error.

My "problem" is the XBOX friend list can contain up to 4K friends, even 10K for sony (IDK for steam or epic) so it's quitte easy to burn the playfab, basic 25 API limit.

I get the playfab existing FL before to catch the friends already there to avoir adding them, but it's impossible to get the "not existing" ones.

0 Likes 0 ·
Rick Chen avatar image Rick Chen ♦ vincentpiedeloup commented ·

I am afraid that it is currently not supported for Azure Function or CloudScript to proceed with this large amount of API calls or adding a big list of friends at once. You could have your own server to proceed with adding friends one by one.

You can post a thread of adding a big list of friends in one call in the Feature Request forum.

0 Likes 0 ·
vincentpiedeloup avatar image vincentpiedeloup commented ·

That's what I feared :) thanks.
I'll go check the feature request forum.

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.