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 /
  • API and SDK Questions /
avatar image
Question by Dean May · Jun 14, 2019 at 08:22 PM · apisCloudScriptIn-Game Economy

Is there a way to get Limited Edition Count Available from server or client API?

I am currently attempting to use CloudScript to generate a dispersal to players in a shared group of limited edition catalog items. Based on the API docs, the only way I can get the CURRENT (not initial) limited edition availability is via the Admin API CheckLimitedEditionItemAvailability. Being that I think I read that the Admin API gets throttled more easily, and it isn't officially supported via CloudScript (though I have been able to call it like a custom http endpoint from CloudScript successfully), is there another way to get the limited edition current amount without having to call the above method once per catalog entry where IsLimitedEdition is true? I think but am not sure that the throttling may be causing issues in this CloudScript function (I have implemented polly-js to allow retries, but that probably is making matters worse if the throttling is the issue).

Comment

People who like this

0 Show 0
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

1 Reply

· Add your reply
  • Sort: 
avatar image
Best Answer

Answer by Brendan · Jun 15, 2019 at 12:23 AM

It sounds like you may be describing something that isn't supported in Cloud Script. Bear in mind that Cloud Script has a very limited amount of CPU time and number of API endpoints you can call, so trying to use it to distribute to a non-trivial set of players is something you'd need to do from a custom game server or a script (we'll be updating to support Azure Functions later this year, so that will then be an option for longer-running scripts). But also, it is correct to say that we do not support calling Admin API endpoints from Cloud Script.

If it is a tiny set of players, what is it you want to do if there aren't enough of the item for all players to have one? If you simply try to grant the items, you would get back an error if you're attempting to grant one past its limit, so that may be the simplest way to implement this, in that case.

Comment

People who like this

0 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 Dean May · Jun 15, 2019 at 02:14 AM 0
Share

Thanks for the feedback, Brendan.

Perhaps when I said "dispersal" it wasn't quite the right term. I want to divide up the limited edition items that are left based on the number players "online" who are in a shared group and notify each of the clients of how many of each limited edition catalog item in a certain store that they can show in game, and grant them one when they "find" it in game. I definitely will be using a custom game server so moving this out of CloudScript makes sense to me.

My issue is that I want to make sure that we aren't getting to the point of attempting a grant that will fail and disappoint a user by ensuring I'm only providing information on limited editions that are available now, not what we started with (obviously I have a buffer of a few items in place since nothing is perfectly "real-time"). I don't want to have do something separate to track availability as the limited edition functionality already does that well, but I want to be able to query that amount pretty regularly from the game server and want to make sure that won't be an issue. Is the Admin endpoint throttled more than the others, or are the API call frequency limitations similar?

avatar image Brendan ♦♦ Dean May · Jun 15, 2019 at 02:21 AM 0
Share

Admin API calls are rate limited higher than Client calls, but lower than Server (since they're generally used for tools that are run at one location). You could technically use the Admin API from your server, but there's a fundamental issue with what you're describing. If you have more than one server making this call, you can wind up with each of them trying to use all of the remaining items, which would result in you being in the same situation - unable to give players what you wanted to. If you want to distribute this the way you describe, I'd use a Redis Int to track the number remaining, so that you can have the servers first subtract from that, and then grant as many items as they subtracted from the Int.

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

    Cloud Script execution API requests issued limit for standard tier(new plan) ? 1 Answer

    Optimal way to add multiple currencies and items with CloudScript without bundles or drop tables. 1 Answer

    Virtual Currency subtract / add cause recalculation of the recharge rate 1 Answer

    Getting item,How to get ItemInstanceId in GrantItemsToUse 1 Answer

    Saving data in Unity on Pause/Quit/Lose Focus 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