Hello:) During registration, the password and email address will be given. But I would also like to have a DisplayName created, since the UserID is rather useless for the game itself. I would also like to assign the player a nation. In my game, a nation is a faction that the player then belongs to.
I created a SetDisplayName() for the DisplayName and a SetUserData() function for the Nation. Both work, but not together because PlayFab is one Gives HTTP 409 error message. According to the following post, two operations cannot run at the same time:
I find it strange that the registry doesn't directly allow something like this. Anyway, I have now postponed the second operation until after registration, more precisely it is postponed after loading the next scene, where it is called in a Start() function.
An if() query is used to check whether a nation has already been assigned and if not, this is determined based on the input brought back from the previous scene.
This is the problem at the moment, it is being checked whether in the UserData has already been assigned a “Nation” entry for the logged in player. If so, I would like to get back which entry that is, if not, it should be made up: void GetUserData(string myPlayFabId) // Check if nation is set. { PlayFabClientAPI.GetUserData(new GetUserDataRequest() { PlayFabId = myPlayFabId, Keys = null }, result => { Debug.Log("Got user data:"); if (result.Data == null || !result.Data.ContainsKey("Nation")) SetUserData(); else Debug.Log("Nation: " + result.Data["Nation"].Value); }, (error) => { Debug.Log("Got error retrieving user data:"); Debug.Log(error.GenerateErrorReport()); }); }
The error I have is the following: 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)'
Can someone help me with that? I got this from here: https://learn.microsoft.com/en-us/gaming/playfab/features/playerdata/quickstart