question

michaelbrune avatar image
michaelbrune asked

How do you get a title_player_account ID inside of an Azure Function called via PlayerPlaystream events

Hey All,

I feel like this is a pretty basic question but I can't find a good solution to it. So I have a C# Azure function setup with a Player Playstream event: Playfab.player_created So looking at the PlayerPlayStreamFunctionExecutionContext I can't see any way to easily grab the title player account id. What's the best way to grab a title player account id from a player playstream event?

Thanks,

Michael Brune

PlayStream
10 |1200

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

Ivan Cai avatar image
Ivan Cai answered

In player_created event, we can get player's master account id(playfabid), but we really can't get the player's title account id. You should try to call GetTitlePlayersFromMasterPlayerAccountIds or GetAccountInfo API to grab title player account 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.

Tim Koppers avatar image
Tim Koppers answered

You could do something like this :

GetUserAccountInfoRequest userAccountInfoRequest = new GetUserAccountInfoRequest(){
                
//PlayFabId = context.CallerEntityProfile?.Lineage.MasterPlayerAccountIdPlayFabId = context.PlayerProfile?.PlayerId
};

PlayFabResult<GetUserAccountInfoResult> userAccountResult = await serverApi.GetUserAccountInfoAsync(userAccountInfoRequest);

string accountId = userAccountResult.Result.UserInfo.TitleInfo.TitlePlayerAccount.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.