Sign In Register

How can we help you today?

Start a new topic
Answered

GetLeaderboardEntriesRequest: Test Harness vs Unity API

Hi,


I'm trying to query a players leader board entry from cloud code, but am seeing a difference in the test harness response compared to that of the Unity API. The query that I am running within the cloud code event without any attributes is as follows:


 

var MyLead = Spark.sendRequest({"@class": ".GetLeaderboardEntriesRequest", "leaderboards": "GS"});
var MyStats = {
    "Rank": MyLead.GS.rank,
    "Dn": MyLead.GS.DN,
    "Score": MyLead.GS.SP
}

Spark.setScriptData("My", MyStats);

 In the test harness the data response comes back exactly as expected with all the correct scriptData. However when called from within Unity the response comes back with all null values for the defined elements. I've tried a similar query using the LeaderboardDataRequest and SocialLeaderboardDataRequest which both work just fine from the test harness or Unity. Any ideas what might be causing this?


Best Answer
Hi Nick,
Can you try implementing a more recent version of the SDK that I have attached. This should resolve the issue.

If it doesn't can you let me know.

Kind regards,
Jamie

 


Nick,


Can you provide the Unity code you are using?  We will try and replicate here if required.


John.

Hi,


The Unity code is just a basic logeventrequest, as shown below:

  

GameSparksApi.logEventRequest("GL").sendAsync(
            delegate(IDictionary<string, object> response)
            {
            HandleLog(response["@class"].ToString(), null, LogType.Log);
            }
            );

  Thanks

Answer
Hi Nick,
Can you try implementing a more recent version of the SDK that I have attached. This should resolve the issue.

If it doesn't can you let me know.

Kind regards,
Jamie

 

Yep the data seems to be coming down through Unity now.


I'm noticing however that the rank data from this type of request does not seem to correlate with either the LeaderboardDataRequest or SocialLeaderboardDataRequest rank data. Can you explain where this data is pulled from as I cannot seem to find these values in any of the leaderboard databases.

Login to post a comment