Get user rank in Le...
 
Notifications
Clear all

Get user rank in Leaderboard and friend system

2 Posts
2 Users
0 Reactions
657 Views
(@g3studio)
Posts: 5
Active Member
Topic starter
 

 

Dear sirs,

I just bought the component. it's really simple and cool.   I checked the all document and code. 

 

I found 2 functions for making game. 

First, leader board.   If we have over 10,000 people each leader board, It's hard to get my rank no.

In this system, We have to load all data until finding my name..

 

Give a guide to get my personal rank  and my rank page no . 

  (example : there are 100 pages(1000 users),  each page 10 users.   if I am in 9 page and rank is 950, we have to know the rank and page number )

 

Next , friend system.

if user1 add the user2, user2 have to accept the  user1's request. 

Now just user1 add the user2, user2 don't konw this situation.

 

please, solve this issue. Cool

 

 

 

  

 

 

 

 

 

 
Posted : 17/10/2013 9:39 am
(@skaredcreations)
Posts: 805
Prominent Member Admin
 

Hi and thank you for your purchase.

About your questions, the Friends logic doesn't currently implement neither notifications nor acceptance/confirmation of the friendship, for now it's just a plain way to have a list of friends to interact with in your gameplay logic. We're working to a new update that should be ready by next month with few additions (mainly Achievements) and we will see if can improve the Friends logic and features too before releasing it.

Of course you're right, it's missing a function to get the score/rank/page for a specific user, so I implemented it right now from your question and here is an update for you attached to this post (and anyone needs it, I will include this code in the next official update).

How it works:

  • the web service users.php now accepts a new action "highscore" that requires few parameters in the request (Id, IdLeaderboard, Interval, Limit [optional, by default as usual the constant DEFAULT_LIST_LIMIT in config.php) and returns a JSON object with properties Score, Rank and Page
  • has been added a new method CB_Leaderboard::LoadHighscoreForAccount in the web app
  • has been added a new method CBManager.LeaderboardHighscoreForAccount in the Unity client
  • you will find how to use the new method in Unity inside the demo code (you can overwrite DemoGUI.cs if you're testing the Combu demo project)

As you see it's pretty simple to extend, about your question on performance we haven't received any issue report about it and even if the highscore order is at runtime through an ORDER BY clause though we have indexes on the ordered fields and the results are paged and (should be) restricted in time intervals so it should hopefully not be a big deal for most. We were also considering and doing some tests to support a No-Sql database besides MySQL, but it's a long run and cannot define an ETA.

 

PS: please don't forget to write a review on Asset Store if you're enjoying Combu to help us spread it :)

FRANCESCO CROCETTI @ SKARED CREATIONS

 
Posted : 17/10/2013 12:41 pm
Share: