Microsoft Azure PlayFab logo
    • Multiplayer
    • LiveOps
    • Data & Analytics
    • Add-ons
    • For Any Role

      • Engineer
      • Designer
      • Executive
      • Marketer
    • For Any Stage

      • Build
      • Improve
      • Grow
    • For Any Size

      • Solo
      • Indie
      • AAA
  • Runs on PlayFab
  • Pricing
    • Blog
    • Forums
    • Contact us
  • Sign up
  • Sign in
  • Ask a question
  • Spaces
    • PlayStream
    • Feature Requests
    • Add-on Marketplace
    • Bugs
    • API and SDK Questions
    • General Discussion
    • LiveOps
    • Topics
    • Questions
    • Articles
    • Ideas
    • Users
    • Badges
  • Home /
  • General Discussion /
avatar image
Question by rupert · Nov 23, 2020 at 04:49 PM · CloudScriptFriends

Get FriendsList from CloudScript

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?

Comment

People who like this

0 Show 1
10 |1200 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image rupert · Nov 23, 2020 at 12:46 PM 0
Share

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

2 Replies

· Add your reply
  • Sort: 
avatar image
Best Answer

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.

Comment
rupert

People who like this

1 Show 2 · Share
10 |1200 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image rupert · Nov 24, 2020 at 09:42 AM 0
Share

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!

avatar image rupert rupert · Nov 24, 2020 at 12:52 PM 0
Share

*update*

GetFriendsList returns nothing for another players friends list. But it works if we want to check our own?

avatar image

Answer by rupert · Nov 24, 2020 at 03:11 PM

Got it working using above method.

Comment

People who like this

0 Show 0 · Share
10 |1200 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users

Your answer

Hint: You can notify a user about this post by typing @username

Up to 2 attachments (including images) can be used with a maximum of 524.3 kB each and 1.0 MB total.

Navigation

Spaces
  • General Discussion
  • API and SDK Questions
  • Feature Requests
  • PlayStream
  • Bugs
  • Add-on Marketplace
  • LiveOps
  • Follow this Question

    Answers Answers and Comments

    2 People are following this question.

    avatar image avatar image

    Related Questions

    Limit number of push notifications. 1 Answer

    SharedGroupData Notification on Desktop 1 Answer

    Add Friend using friend request with accept/decline option 1 Answer

    Can We call Cloud Scripts in Unity - void Update() for receiving a friend request ? 2 Answers

    How to access the variables in the cloud script ? 1 Answer

    PlayFab

    • Multiplayer
    • LiveOps
    • Data & Analytics
    • Runs on PlayFab
    • Pricing

    Solutions

    • For Any Role

      • Engineer
      • Designer
      • Executive
      • Marketer
    • For Any Stage

      • Build
      • Improve
      • Grow
    • For Any Size

      • Solo
      • Indie
      • AAA

    Engineers

    • Documentation
    • Quickstarts
    • API Reference
    • SDKs
    • Usage Limits

    Resources

    • Forums
    • Contact us
    • Blog
    • Service Health
    • Terms of Service
    • Attribution

    Follow us

    • Facebook
    • Twitter
    • LinkedIn
    • YouTube
    • Sitemap
    • Contact Microsoft
    • Privacy & cookies
    • Terms of use
    • Trademarks
    • Safety & eco
    • About our ads
    • © Microsoft 2020
    • Anonymous
    • Sign in
    • Create
    • Ask a question
    • Create an article
    • Post an idea
    • Spaces
    • PlayStream
    • Feature Requests
    • Add-on Marketplace
    • Bugs
    • API and SDK Questions
    • General Discussion
    • LiveOps
    • Explore
    • Topics
    • Questions
    • Articles
    • Ideas
    • Users
    • Badges