Sign In Register

How can we help you today?

Start a new topic

GetIntList


Not sure what is happening here (in Unity with C#).   

		new AccountDetailsRequest ().Send ((playerAccountResponse) =>
			{
				if (playerAccountResponse.HasErrors) {
					output.LineAdd ("Error retrieving player's data\n");
				} else {
					output.LineAdd ("Player's data retrieved\n");

					Debug.Log("****************");

					GSData test = playerAccountResponse.ScriptData;

					object[] test2 = test.GetObjectList("games").ToArray();
					Debug.Log("object[]:"+test2.Length);

					double[] test3 = test.GetDoubleList("games").ToArray();
					Debug.Log("double[]:"+test3.Length);

					int[] test4 = test.GetIntList("games").ToArray();
					Debug.Log("int[]:"+test4.Length);

					Debug.Log("****************");

				}
			});

  I get no error from GetObjectList and GetDoubleList, giving me the correct length output of 4, but GetIntList gives me a "GS: System.InvalidCastException: Cannot cast from source type to destination type." on the Debug.Log line as test4 is apparently null.


 The player ScriptData look like:

"scriptData": {
  "games": [
   1,
   2,
   3,
   5
  ]
 },


Is it a bug of some kind? Or am I missing something obvious?




1 person has this question
1 Comment

Hey Gabriel,

Your script looks fine to me, and i've tested this call myself trying to recreate your scriptData and it all works fine.
Did you manage to figure out what was wrong?

Thanks,
Sean