question

simon-3 avatar image
simon-3 asked

Admin.GetUserAccountInfo and multiple titles

Hello guys,

I'm facing an issue I can't solve in a way that suits me. Here are the details: - We have multiple titles (used as multiple environments, i.e. dev/staging/live etc...) - Let's say for this example that we have Dev and Main title (resp. 0DEV and 1MAI title IDs) - When a player creates an account from our build, it will be created on Main (in my case this is done daily by QAs f.e.) - We have some automated process to write some UserPublisherInternalData for those created account - Process is: get PlayFabId from Email (PlayFabAdminAPI.GetUserAccountInfo), then use that PF ID for PlayFabAdminAPI.UpdateUserPublisherInternalData)

My problem is that I can update user internal pub data using Main TitleID and Secret, but it doesn't work if I try to do it using Dev endpoints

It baffles me, as what I wanna retrieve is the "Master player account ID", which is common to both titles... What I observed is that if the account log in Dev once, I can then use Dev title to update its data. The error being quite explicit ("Title not activated"), I tried using the "IgnoreMissingTitleActivation" but then it just fails with a "User not found" error.

Example code:

     from playfab import PlayFabAdminAPI, PlayFabSettings, PlayFabErrors
        
     PlayfabDeveloperSecretKeyEnvVarName = "PlayfabDeveloperSecretKey"
     PlayFabSettings.TitleId = "0DEV" #or 1MAI for Main env
     PlayFabSettings.DeveloperSecretKey = "whatever"
        
     email = "simon@darewise.com" #account created and logged only in Main
        
     print(f"Fetching {email} account")
     request = {"Email": email} #Can use "IgnoreMissingTitleActivation": True
     PlayFabAdminAPI.GetUserAccountInfo(request, onUserInfo)
        
        
     def onUserInfo(success, failure):
         if success is None:
             print(f"Failed to retrieve account: {failure['errorMessage']}")
         else:
             playfabId = success["UserInfo"]["PlayFabId"]
             payload = "Some internal pub user data"
             request = {"PlayFabId": playfabId, "Data": {"my_data": payload}}
             PlayFabAdminAPI.UpdateUserPublisherInternalData(request, another_callback)
        
     def another_callback:
        print("done")

So basically: how can I get this working? Am I mis-using the IgnoreMissingTitleActivation flag? Is there a "Master API" that would not require my user to log once in each title to be able to handle it from any of them?

Thanks for your help, it drives me crazy as I spent a lot of time reading doc and code examples but could not find any solution.

Player Datasdks
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.

simon-3 avatar image simon-3 commented ·

Up for this showerthough: maybe IgnoreMissingTitleActivation means "Ignore accounts not activated for this title" instead of "Get accounts regardless of their activation status for this title"?... :/

0 Likes 0 ·

1 Answer

·
Xiao Zha avatar image
Xiao Zha answered

When a player account is created, it is first created as a Master Player Account and this global player account has all the identity information, like email address or account linking to other systems. Then, in each Title environment operated by the player, a Title Player Account will be created that shadows the Master Player Account and allows for title-specific data and context to be kept for the player.

And the GetUserAccountInfo API is used to retrieve the relevant details for a specified user, which contains title-specific data and context for the player, and these specific title info for the player requires you to log in to have a Title Player Account under your Dev title. So, you have to log the same player in your Dev title to be able to use the GetUserAccoutInfo API and get the PlayFabId in API result.

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

simon-3 avatar image simon-3 commented ·

Ok, crystal clear. But then, how can I retrieve PlayFab Master Player Account ID from user's email from then? There is no "Master API", all API I know about need to target a specific title (through TitleID+SecretKey).

0 Likes 0 ·
Xiao Zha avatar image Xiao Zha simon-3 commented ·

PlayFab does not provide such feature that allows you to retrieve PlayFab Master Player Account ID from user's email in other Title without logging into the Title. You can post feature requests for it. Also, as I mentioned above, you could log the same player in your Dev title to be able to use the GetUserAccoutInfo API to get the PlayFabId with the email.

1 Like 1 ·
simon-3 avatar image simon-3 Xiao Zha commented ·

Thanks for clarification and confirmation. We'll sort this out with a "log to all Titles endpoints" or smthg.

(sorry I was off for a couple of weeks)

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.