question

daniel-5 avatar image
daniel-5 asked

Is checking GrantedItemInstance.Result required for GrantItemsToUsers calls?

When parsing successful responses (no errors) from calls to GrantItemsToUsers(..), do we need to iterate through the ItemGrantResults and examine if the GrantedItemInstance.Result is true before determining that the item had been successfully granted?

Or can we just rely on the fact that the GrantItemsToUsers API call returned successfully and thus the items should be granted?

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.

1 Answer

·
Seth Du avatar image
Seth Du answered

It is required if you want to confirm each of them have received the item. However, if the items and catalog are configured properly, there is only a rare chance of failure. In this scenario, you may inform the players to report it to you for a manual fix. Iteratively checking all the result is feasible, but may take time and cost resources.

GrantItemsToUsers usually won’t return error callback and only “player_inventory_item_added” events will be generated for each player after a successful grant, which means it is not convenient to monitor. You cannot rely on the HTTP code to know the grant result.

10 |1200

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

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.