PlayFab is giving me trouble in the Registration... (HTTP 409)

Hello :wink:

I’m trying to register/login with PlayFab. That works, but PlayFab just doesn’t like me.

As you can see in the picture I want to set some data.
Nickname, password, email and the nation the player wants to play with.

Now PlayFab only transmits the email and password during the registration process. It’s surprisingly inflexible.

This means I have to set the DisplayName (the nickname, so to speak) manually using the following:

void SetDisplayName() // SetDisplayName
{
    var request2 = new UpdateUserTitleDisplayNameRequest
    {
        DisplayName = usernameInput.text,
    };
    PlayFabClientAPI.UpdateUserTitleDisplayName(request2, OnDisplayNameUpdate, OnError);
}

Actually, that works…

In order to save the nation :sunglasses:, I now have to create a new entry in the PlayerData.
This works with:

 void SetUserData() //Adds nation tag to PlayFab UserData
{
     PlayFabClientAPI.UpdateUserData(new UpdateUserDataRequest()
     {
         Data = new Dictionary<string, string>() {
         {"Nation", NationDropdown.output},
         //{"NationTag", NationDropdown.nationTag}
     }
     },
     result => Debug.Log("Successfully updated user data with nation and nationTag"),
     error => {
         Debug.Log("Got error setting user data for nation stuff!");
         Debug.Log(error.GenerateErrorReport());
     });
}

This also works…actually, but when I want to call both functions during the registration process, it just does one of them and then throws a HTTP 409 error at me. They do hurt. :rage:
There is even a post about this in the PlayFabForum:
https://community.playfab.com/questions/38752/http11-409-conflict-on-updateuserdata-and-addorupd.html

Unfortunately the problem is not really solved there.

Basically my solutions work, because I had already successfully got both info entered, just not for the same player.
So if I register two players one after the other, it adds DisplayName to the first one and fail with adding the nation, with the second player it is usually the other way around…

My solution was, since PlayFab inevitably carries out the login after registration, to move SetUserData() to the next scene, where a query is then automatically carried out as to whether the player’s nation has already been set. If not, this should be done after registration, so to speak, without the player having to do anything.

But now the game gives me the following error:
Assets\Scripts\DivisionManager.cs(23,9): error CS7036: There is no argument given that corresponds to the required formal parameter ‘myPlayFabId’ of ‘DivisionManager.GetUserData(string)’

So it doesn’t recognize the logged in player. I got the code from the PlayFab documentation. So the question is, how do I fix this or do you even have a better solution?

I don’t understand why you can’t simply specify what you want to have entered when registering.

I’ll upload my scripts if anyone wants to bother. However, due to a lot of testing, they are extremely untidy.

Does somebody has any idea?
Best regards
Toby

9778779–1402041–DivisionManager.cs (1.85 KB)
9778779–1402044–NationDropdown.cs (1.57 KB)
9778779–1402047–PlayFabManager.cs (4.31 KB)