question

miculkaj avatar image
miculkaj asked

GrantedItemInstance UsesIncrementedBy unexpected behaviour

Hi,

I´m using CloudScript where I´m granting items to user in my method. My method looks like this:

    //obtainedItemsList is filled before
    var GrantItemsToUsersRequest = {
        "ItemGrants" : obtainedItemsList
    };
    var GrantItemsToUsersResult = server.GrantItemsToUsers(GrantItemsToUsersRequest);
    return GrantItemsToUsersResult.ItemGrantResults;

The problem is that when I`m parsing result on the client, I´m experiencing unexpected behaviour at GrantedItemInstance property UsesIncrementedBy. From docs I would expect that this property signalizes amount of the added items (or item usages) to the user´s inventory after GrantItemsToUsers call, but I´m seeing something else - for example my inventory is empty, I obtain two shields and UsesIncrementedBy value is three. Sometimes the value fits to real situation but sometimes it differs from real added item usages. Can you tell me more about this behvaiour, please? Could it also be a bug?

All the items I´m obtaining are set to stackable and to consumable by count 1.

Thanks in advance for your answers!

apis
10 |1200

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

brendan avatar image
brendan answered

Thanks - that was exactly what we needed to review the scenario. We've reproduced this behavior (feel free to delete PlayFab ID 31FC965B0EC8797F - we used it solely for testing), and have filed a bug against it. Here's what we're seeing:

When a new stack is created in player inventory, if multiples of the item are being added, the RemainingUses is correct, but the UsesIncrementedBy is one less than double the amount added. Subsequent calls, adding more to the stack, always have the correct RemainingUses and UsesIncrementedBy. We'll get that fixed as soon as possible.

1 comment
10 |1200

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

miculkaj avatar image miculkaj commented ·

Thanks for your quick help! I´ll be looking forward for the fix :)

0 Likes 0 ·
brendan avatar image
brendan answered

Can you let us know the Title ID and the specifics of what you're passing in (in obtainedItemsList)?

10 |1200

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

miculkaj avatar image
miculkaj answered

Sure, my Title ID is 3D19 and the content passed to obtainedItemsList is little bit complicated - basically it is a result of three drop tables packed in the bundle, but I´m evaluating these drop tables directly on the server (via EvaluateRandomResultTable method) and if the result is card (which is item defined in my catalog), I´m doing more extra operations which copy CustomData from catalog to obtained item CustomData property (this is how I ensure that CustomData are initialized on client´s inventory item instances).

But I´m experiencing my problem on the simple items like a shields (and other items specific to my game), which are just items set to stackable and consumable by count 1.

Is my specification enough? I can give you a code or more specific answer, if you ask me what exactly do you need to know.

Thanks for helping!

,
10 |1200

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

brendan avatar image
brendan answered

Understood, but you presented a specific repro case above. Can you let us know the actual values of the parameters you're passing into the GrantItemsToUsers call?

10 |1200

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

miculkaj avatar image
miculkaj answered

Ok, I just runned my method now and this is what is passed to GrantItemsToUsers. User always obtains bundle, in this particular example he obtains 500 coins, one basic dumbbell (game specific item) and five shields:

[ 
  { "PlayFabId":"9EEB2D1FA0456262","ItemId":"coinsBundle500"},
  { "PlayFabId":"9EEB2D1FA0456262","ItemId":"dumbbellBasic1Bundle"},
  { "PlayFabId":"9EEB2D1FA0456262","ItemId":"shields5Bundle"}
]

10 |1200

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

namit avatar image
namit answered

I just tried and got the same error. Has this been fixed yet?

5 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.

brendan avatar image brendan commented ·

No, the fix for this is part of a broader set of changes being made to the inventory service. We'll have it fixed as soon as possible.

0 Likes 0 ·
namit avatar image namit brendan commented ·

Thanks. I would use a workaround with RemainingUses till then.

0 Likes 0 ·
namit avatar image namit namit commented ·

I just tried using RemainingUses, even that is unset in my case. So, I am eagerly waiting for a fix.

0 Likes 0 ·
Show more comments

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.