question

kevingraybusiness avatar image
kevingraybusiness asked

Error during UGC Batch Update

USE CASE: We have a set of UGC items (Levels in our case). We change how they are modeled (such as adding custom display properties), and need to batch update all levels that users have already published.

CODE: We login as an title admin user, and we use the PlayFabEconomyAPI.SearchItemsAsync API in a C# script to grab batches up 50 items at a time, and then iterate over them 1 by 1, editing and posting them back out with the PlayFabEconomyAPI.UpdateDraftItemAsync API.

ERROR: During update, we get a 'Action not authorized by title' error.

QUESTION: Can an admin user even update published items? Are we missing a permission? Is there a better way to batch update all published UGC items?

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

kevingraybusiness avatar image kevingraybusiness commented ·

Figured out part of it: I can use PlayFabAuthenticationAPI.GetEntityTokenAsync to get the entity token of the title entity, which doesn't have the same permission/request limitations.

Leaving this open though, as I would still like to know if there is a better way of batch updating items. Doing them 1 by 1 seems incredibly slow, and a waste of API calls

0 Likes 0 ·

1 Answer

·
Gosen Gao avatar image
Gosen Gao answered

Since UGC items are created and updated by players, usually players only update one item at a time, so PlayFab only supports updating UGC item with API Catalog - Update Draft Item - REST API (PlayFab Economy) | Microsoft Learn.

If the Levels you mentioned are controlled by the title, then you may use Title Data for it. If they are created and updated by players, may I know what is your scenario as a title admin updating player created levels?

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

kevingraybusiness avatar image kevingraybusiness commented ·

The scenario is that I have to refactor a property on levels; when a user submits a level, it has a couple of dynamically calculated properties (such as level difficulty) submitted with it. If I change this calculation later, or introduce a new property like it later, I need to recalculate for all submitted levels.

0 Likes 0 ·
Gosen Gao avatar image Gosen Gao kevingraybusiness commented ·

So you mean that if you change the way the difficulty of a level is calculated, you need to modify the parameters of all existing levels. Is the calculation of level difficulty based on other static level parameters? If so, can this calculation method be stored in Title Data, and the client can calculate the difficulty of the level based on it? In this way, you only need to modify the calculation method stored in Title Data to make all levels change the difficulty parameters.

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.