I've been a Unity developer for around 6 years. I just started a new job and it has me working on some server code. I'm not used to server code and I'm pretty sure that I'm running into some very new guy problems that have me completely hung up. Maybe you guys can help?

I am asking here because I cannot see if this is a Unity issue or a JavaScript issue.

The goal is to collect information from different data tables and collect them into an array of objects that I can send back to Unity.

On my test server, I receive no errros with this code :


function loadPVPUsers( request, response)

   var dict=[];

   var players=[];
   var avatars=[];
   var username=[];
   var count=0;

   var query = new Parse.Query(Parse.Object.extend("player"));
       for (var i = 0; i < results.length; i++)
          var object=results[i];
          var avatar = object.get("avatarCardId");
       var final=0;

       for(var i=0;i<count;i++)
         var playerId = players[i];
         var uName = username[i];

          query = new Parse.Query(Parse.Object.extend("playerCards"));

                username : uName,
                attack : 20,
                defense : 50,
                level : 1,
                cardname : "Harold Zoidberg",
                rarity : 0,
                userID : playerId,


When I run this through Unity, I receive this error “Cannot cast from source type to destination type”. On my server I receive "Result: ReferenceError: name is not defined" which I find odd because I do not have a valued called "name".

I am attempting to retrieve my data with this ParseCloud function in Unity :


ParseCloud.CallFunctionAsync<IDictionary<string,object>>("loadPVPUsers", new Dictionary<string, object>())
         .ContinueWith(t => {

I'm hoping someone can help me debug (my entire team went on vacation.) I'm sorry if this is the wrong place to ask for this? I haven't had any luck finding a good source (StackOverflow totally failed me.) If anything, could you direct me to a good location?