question

sammybechara2 avatar image
sammybechara2 asked

I have problems sending the player information to the servers of Playfab

using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using PlayFab.ClientModels;
using PlayFab;


public class SetVariables : MonoBehaviour
{

	public void TryToAddUserData()
	{
		Debug.Log("Attempting to Add Currency...");
		SetUserData ();
	}


	void SetUserData()
	{
        UpdateUserDataRequest request = new UpdateUserDataRequest ();


		request.Data = new Dictionary<string, string>();


		request.Data.Add ("Inteligencia Etica", "1");
		request.Data.Add ("Inteligencia Emocional", "2");
		request.Data.Add ("Inteligencia Inclusiva", "3");
		request.Data.Add ("Inteligencia Social", "4");
		request.Data.Add ("Empatia", "5");
		request.Data.Add ("Autoconocimiento", "6");
		request.Data.Add ("Control de Impulsos", "7");
		request.Data.Add ("Alimentacion Precaria", "8");
		request.Data.Add ("Habilidades de Combate", "9");
		request.Data.Add ("Uso de Armas", "10");
		request.Data.Add ("Tratamiento de Heridos", "11");
		request.Data.Add ("Evacuación de Emergencia", "12");


        PlayFabClientAPI.UpdateUserData(request, (result) =>
		{
			Debug.Log("Successfully updated user data");
		}, (error) =>
		{
			Debug.Log(error.ErrorDetails);
		});
	}
}


this is in the Error

System.Collections.Generic.Dictionary`2[System.String,System.Collections.Generic.List`1[System.String]]
UnityEngine.Debug:Log(Object)
SetVariables:<SetUserData>m__1(PlayFabError) (at Assets/SetVariables.cs:43)
PlayFab.<UpdateUserData>c__AnonStorey1B:<>m__0(String, String) (at Assets/Playfab/PlayFabSDK/Public/PlayFabClientAPI.cs:892)
PlayFab.Internal.<MakeRequest>c__Iterator0:MoveNext() (at Assets/Playfab/PlayFabSDK/Internal/PlayFabHTTP.cs:53)
UnityEngine.SetupCoroutine:InvokeMoveNext(IEnumerator, IntPtr)
unity3ddata
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

·
brendan avatar image
brendan answered

Can you please provide the complete response you get back from the PlayFab service? The error response will contain an errorMessage, among other things, which will help to clarify the specific issue.

I suspect that the issue is due to trying to write to too many player data keys in a single call. Given that your data is quite small, I'd recommend collapsing all of that into a single Key/Value pair, composed in a JSON object.

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.