question

drew avatar image
drew asked

Azure Function Rule Trigger: how to get title_player_account info for granting items?

I have an Azure Function which is triggered via a rule.

I want to grant the player an item in this function.

However, the PlayerPlayStreamFunctionExecutionContext does not have the entity info for the player title level, just at the player level.

When I try to grant the item using AddInventoryItemsRequest,m I get an error that player is not a valid type.

How can I get the title_player_account id info from inside an Azure function that was called via a Rule trigger?

Thanks

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

·
Gosen Gao avatar image
Gosen Gao answered

You can get the caller’s title player account id with code below.

FunctionExecutionContext<dynamic> context = JsonConvert.DeserializeObject<FunctionExecutionContext<dynamic>>(await req.ReadAsStringAsync());
var titlePlayerAccountId = context.CallerEntityProfile.Entity.Id;
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.