question

Radomyr avatar image
Radomyr asked

Timeout while buying huge bundle

Hello!

I catch a timeout error when I try to ValidateGooglePlayPurchase and apply bundle fo inventory, or just very long responce time from API.

It happens when I try to buy huge bundle, filled with huge amound of items from catalog - consumable items which represents consumable by time boosters: for example, 480 (minutes) unlimited life and 360 (minutes) unlimited hint booster. Looks like API, after valifatioon, grant every of those 840 items separetely and falls by timeout.

Looks like I can't override adding items to inventory in this case. Also, I can't use ModifyItemUsesAsync in cloud function because modifiyind inventory item in this way don't affects Expires date. Also, creating bundle of bundles (for example, creating adding 8 "1-hour" bundles with 60 "1-munte" items each) leads to same result - timeout. How can I buy huge bundles like this?

apisunity3dsdks
10 |1200

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

Radomyr avatar image
Radomyr answered

Found workaround: to decrease items count in bundle you can create few items with "Time group name" but with different consumption amounts - one item for minutes, one for hour, etc.. After this, add to bundle minimum amount of items, and after adding any of each item - "Expiration" will be updated on all items in inventory.

Only one trick: you need to select all posible "unlimited variants" items from inventory to change if you really have one now.

P.S.: (for playfab suport) but will be better to add api with int argument to fill how much items we need to grant for user

10 |1200

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

Made Wang avatar image
Made Wang answered

It does take a long time to buy a bundle with hundreds of items at once. I did a test and when there are 900 items in a bundle, it takes about 25 seconds from purchase to returning the result, but I don't get a timeout error.

For granting a large number of duplicate consumables at once, you can grant a single item to the player, and then call ModifyItemUses to modify the usage count to reduce API calls, but this API will not modify the remaining time. You can refer to Timed Consumables - PlayFab | Microsoft Docs for how consumables are timed.

I did the test based on your description and can create the bundle you said. Did you create it in Game Manager? The timeout error in Game Manager is usually a network problem, you can try to test in other network environment.

Also note that there are some limitations on bundles and player inventory, which you can check in Game Manager->Title settings->Limits.

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.

Radomyr avatar image Radomyr commented ·

900 items it was example) In situation from my project - we have top costs package with 1419 items (almost all of them is consumable by time) and 110000 currency and at buying of this package I catch timeout. Also, I tested increasing items count to 3600 items and catch timeout + order cancelation from Google Play.

Does PlayFab have workaround about this? Main problem is that this purchase for real money from user and user can't wait half of minute after spending 50$. And, also, because of ValidateGooglePlayPurchase we can't use ModifyItemUses.

0 Likes 0 ·

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.