Hi, app42 support team:
I call SaveUserScore to store scores and addtionnal data.
And I call GetTopNRankers to get the top 6 rank.
my code:
1. call 4 times:
ScoreBoardResponse callBack = new ScoreBoardResponse ();
Dictionary<string, object> jsonDoc = new Dictionary<string, object> ();
jsonDoc.Add("name","Stephen");
jsonDoc.Add("LV", 2); // LV is different every time.(4, 5, 6)
App42API.SetDbName("Player1");
mScoreBoardService.AddJSONObject( "addtionnalData", jsonDoc);
mScoreBoardService.SaveUserScore("LeaderBoardTest", "fearless", 179, callBack);
2. call 1 times:
String key1 = "name";
String value1 = "Stephen";
Query query = QueryBuilder.Build(key1, value1, Operator.EQUALS);
App42API.SetDbName("Player1");
mScoreBoardService.SetQuery("addtionnalData", query);
mScoreBoardService.GetTopNRankers( "LeaderBoardTest", 6, callBack );
Question:
I get 4 additionnal data for the user: "fearless"
53f0e34ee4b09d4fe2471842 : {"name":"Stephen", "LV":"2", "_$acl":[ {"PUBLIC":"R"} ]}
53f0e34ee4b09d4fe2451450 : {"name":"Stephen", "LV":"4", "_$acl":[ {"PUBLIC":"R"} ]}
53f0e34ee4b09d4fe2447847 : {"name":"Stephen", "LV":"5", "_$acl":[ {"PUBLIC":"R"} ]}
53f0e34ee4b09d4fe2429890 : {"name":"Stephen", "LV":"6", "_$acl":[ {"PUBLIC":"R"} ]}
eg:
user score LV(additional data)
fearless 179 2
fearless 181 4
fearless 182 5
fearless 183 6
adf 153 1
but I call GetTopNRankers, I get:
fearless 183 2, 4, 5, 6 // Question1: there: i dinn't know which LV I should use?????
adf 153 1
I only want to get "fearless 183 the latest LV".
Please help me, thanks!
Question 2: Is there a way to store one addtional data for one user???