question

drew avatar image
drew asked

EconomyV2, how to grant items from Azure Queue Function?

hi,

I am trying to grant the user a welcome gift when the account is created.

I created an Azure Queue Function and registered in PlayFab, and created a rule to fire on player_added_title event, and although there is no documentation on what context is associated with it from PlayFab proxy, the best I can tell from looking at the queue is it looks like its getting a PlayerPlayStreamFunctionExecutionContext.

However, in order to grant the player a gift via AddInventoryItems or ExecuteInventoryOperations, it is required that I have the title_player_account ID. This ID is not found at all in the payload for ExecuteInventoryOperations. It only contains the ID for the master_player_account.

1) Is it possible to grant items to the player using only the master_player_account ID? I have tried in the past but it fails.

2) how can I grant user an item using Azure Queue Function? I don't see any EntityToken provided for the player from inside this payload, so I have no idea how to get the title_player_account info.

thanks

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

·
Gosen Gao avatar image
Gosen Gao answered

1) Is it possible to grant items to the player using only the master_player_account ID? I have tried in the past but it fails.

No, you have to use title_player_account ID for that.

2) how can I grant user an item using Azure Queue Function? I don't see any EntityToken provided for the player from inside this payload, so I have no idea how to get the title_player_account info.

With master_player_account ID(PlayFabId), you can use API Account Management - Get Title Players From Master Player Account Ids - REST API (PlayFab Profiles) | Microsoft Learn or Account Management - Get User Account Info - REST API (PlayFab Server) | Microsoft Learn to get the corresponding title_player_account ID.

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.

drew avatar image drew commented ·

thanks @Gosen Gao, that clarifies things and I got it working now. Is there plans for EconomyV2 to have support for granting items on account creation? It's a really nice and common feature needed for Economy

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

You can set up a Rule with event player_added_title to execute an Azure Function which will grant items to the new accounts.

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.