Hi
I'm using Unity3D
I'm trying to save score with additional data using this method:
public void saveUserScore(string userName, int numLevel, double score, LeaderboardCallBack.LeaderboardDelegate callback){
scoreBoardService = sp.BuildScoreBoardService();
Dictionary<string, object> jsonDoc = new Dictionary<string, object> ();
jsonDoc.Add("level",("level"+numLevel.ToString()));
App42API.SetDbName(Constant_App42.dbName);
scoreBoardService.AddJSONObject(Constant_App42.collectionLeaderboards, jsonDoc);
scoreBoardService.SaveUserScore(Constant_App42.gameName, userName, score, callback);
}
And then i'm trying to get user score from facebook using this method:
public void GetTopNRankersFromFacebook(int countRank, int numLevel, LeaderboardCallBack.LeaderboardDelegate callback){
scoreBoardService = sp.BuildScoreBoardService();
String key1 = "level";
String value1 = ("level" + numLevel.ToString ());
Query query = QueryBuilder.Build(key1, value1, Operator.EQUALS);
App42API.SetDbName(Constant_App42.dbName);
scoreBoardService.SetQuery(Constant_App42.collectionLeaderboards, query);
App42Log.SetDebug(true);
leaderboardCallback.setLeaderboardCallback (callback);
scoreBoardService.GetTopNRankersFromFacebook(Constant_App42.gameName, FB.AccessToken, countRank, callback);
}
For example, i save score to the app42 server:
name score additional info
key value
user1 200 level level1
user1 270 level level1
user2 350 level level1
user3 400 level level2
I want to get 2 users with the highscore in level1 and i call my method GetTopNRankersFromFacebook(2, 1, callback)
i should get user2 with score 350 and user1 with score 270.
But i got user3 with score 400 from level2 and user2 with score 350 from level1.
Why does it happen?