Country Leaderboards

0 votes

Hello,

We currently have a friends & world leaderboard. But i am wondering if we also can do this on country level.

if i am right it is something to do with:

Saving:

sp = AppConstant.GetServce();
scoreService = AppConstant.GetScoreService(sp);
App42API.SetDbName("PLAYERS");
Dictionary<string, object> jsonDoc = new Dictionary<string, object> ();  
jsonDoc.Add("country",FBprofile["country"].ToString());  
scoreService.AddJSONObject("country", jsonDoc); 
scoreService.SaveUserScore(AppConstant.GameName, fbusername, Convert.ToDouble(score), this);

Loading:

sp = AppConstant.GetServce();
scoreService = AppConstant.GetScoreService(sp);
Query query = QueryBuilder.Build("country", FBprofile["country"], Operator.EQUALS);
App42API.SetDbName("PLAYERS");
scoreService.SetQuery("country", query);
scoreService.GetTopNRankers(AppConstant.GameName, 20,this);

But for some reason it shows all highscores, i checked the database it saves the country in the database. So the saving part goes good but the loading part doesnt work at the moment.

Thanks for your time.

With kind regards,
Vasco Rouw

asked Jun 20, 2014 in App42 Cloud API-BaaS by VascoGames (16 points)

1 Answer

+1 vote
 
Best answer

use scoreService.GetTopNTargetRankersinstead of GetTopNRankers

See this http://api.shephertz.com/app42-docs/leaderboard-service/?sdk=unity#get_top_n_target_rankers

 

answered Jun 20, 2014 by ajay123 (899 points)
selected Jun 20, 2014 by VascoGames
Thank you very much Ajay123. I missed that one lol.

But now i have the next problem , i cannot find GetUserTargetRanking.
For example on the global leaderboards we use GetUserRanking. If the user is on place 123 it will show the rankings from 120 till 140.

Do you know a solution on that ?

With kind regards,
Vasco Rouw
GetUserTargetRanking
Download Widgets
Welcome to ShepHertz Product line forum, where you can ask questions and receive answers from the community. You can also reach out to us on support@shephertz.com
...