We're looking to get the friends list of the user we're adding in our sendFriendRequest function within CloudScript.
This is so that we can check the count of this list against our maxFriends variable we're passing through client side, that limits the amount of player and ensures no players can go over the limit of friends we set.
Is this possible?
I should add - we want to handle this through CloudScript to limit the amount of API calls we need to do for each request. Handling it all within CloudScript seems the most efficient way to handle things
Answer by Hernando · Nov 24, 2020 at 06:41 AM
Sure, you can retrieve the current friends list for the user with Server/GetFriendsList API from CloudScript.
Thanks. However, there's not much info we can find on handling multiple functions from within CloudScript. Could you give us some pointers? We just want to get a list of friends a user has, count them, and then only proceed if they are below a value.
I have this function working, but it returns a JSON to the client. This means potentially two API calls too if it passes.
Ideally we would like, in our addFriends function, to check the list of friends for args.friendID and then continue from there, instead of handling anything client side.
Thanks for the help!
*update*
GetFriendsList returns nothing for another players friends list. But it works if we want to check our own?