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 /
  • Bugs /
avatar image
Question by Brendan · Mar 26, 2017 at 09:36 PM · CloudScriptIn-Game Economy

Cloud Script issue with granting items

Question from a developer:

I am currently experiencing an issue with one of my CloudScript functions that is called from the client to unlock a random item from my PlayFab catalog. The function gets a random item using drop tables, verifies that the client has enough currency to purchase the item, and if so deducts the appropriate amount from their balance before granting them the item. A JSON object is returned to the user containing a success flag, the item id, item class, and their new balance.

The issue I am having is that the item class is sometimes null, which should be impossible given that all items in the catalog have a class. I used bulk edit to give the items classes as they were not initially assigned when I entered the items. The value for the item class is coming from the response to the GrantItemsToUser function in the server API.

I cannot figure out what is going on here, if there is some reason why this would happen or there is a bug somewhere. Have you heard of anything like this happening before?

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 · Mar 26, 2017 at 09:36 PM

No, I can't say that what you're seeing has ever been reported by anyone else. So that we can have a look, what is the Title ID in question, what is the handler in your Cloud Script named, what parameters are being passed in when you call it, and what is an example of a response you're getting back with bad or missing values?

Comment
mikewakid

People who like this

1 Show 5 · 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 mikewakid · Mar 26, 2017 at 11:20 PM 0
Share

Hi Brendan. The Title ID is 8291, handler is named "unlockRandomSkin", and it takes no parameters. An example response when working correctly would be: {"success":true,"itemId":"striped_burgundy_gold_white","itemClass":"Body","balance":4137} and when not {"success":true,"itemId":"striped_lblue_mint_malibu_blue","balance":4237}, notice the missing itemClass property in the JSON in the second example. It appears that this is happening consistently for certain items same items, which all have "Body" classes in my catalog. This seems to be caused by itemClass having a null value in the GrantItemsToUser response, but they should not.

avatar image Brendan ♦♦ mikewakid · Mar 27, 2017 at 12:45 AM 0
Share

I created a test account in your title (52EFA36C254645EB - feel free to delete it) and ran it through your unlockRandomSkin handler 100 times, and was no table to reproduce this - in all cases, the ItemClass was in the response info. Is there a specific set of steps to your repro?

avatar image mikewakid Brendan ♦♦ · Mar 27, 2017 at 01:34 AM 0
Share

It appears to happen randomly but it seems be with certain items. Some things that may be noting are:

1) The items did not have an item class when they were created and were bulk edited later.

2) Items were also bulk edited as stackable after they were created and the unlocked skins can be duplicates of items already in the player's inventory.

3) The account I've been testing on may have had some of the unlocked items already in its inventory before the above bulk edits or using the CloudScript function.

I am going to test on a fresh account and see if I can reproduce the problem. Since the CloudScript method seems to be working as intended for you it leaves me to believe the issue is either in my client code or something related to the above points. I will post again with the results on a new account.

Show more comments
avatar image mikewakid · Mar 27, 2017 at 01:58 AM 0
Share

Confirming that it is working as intended with the new account, everything makes sense with your explanation. Thanks Brendan!

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

    Server API - Possible Bug: You only get Friend tags with the GetFriendList call if the parameter ProfileConstraints is null 1 Answer

    server.AddSharedGroupMember returns Invalid Shared Group ID 1 Answer

    Don't know how to send values to azure function via cloudscript with Unity 1 Answer

    Restore Purchases on iOS increases Value To Date (VTD) Incorrectly 1 Answer

    Scheduled Task Not running as expected 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