Retrieving "friends" from my REST highscore webservice, a perfomance question

Member
Posts: 249
Joined: 2008.10
Post: #1
Hi mates!

I have one problem. My game uses facebook connect to retrieve player's facebook id (and his/her friends), then I save his highscore in my REST web server (using POST on http://www.example.com/highscore).
Retrieving all highscores is easy, just send GET to that address, but my problem is retrieving friend's highscores. The only way I think is retrieving friend's scores one-to-one, and if player has 300 friends, this means sending 300 GET requests to my server.
I don't know if this is the correct way, probably not, but no idea how to do this in a different way using a REST web service.

Do you know how Doodle Jump or Spider solves this problem?
What do you think?

Thanks in advance!
Quote this message in a reply
Luminary
Posts: 5,143
Joined: 2002.04
Post: #2
Quote this message in a reply
Member
Posts: 249
Joined: 2008.10
Post: #3
OneSadCookie Wrote:GET http://www.example.com/friendscores?user=me
or if you prefer...
GET http://www.example.com/friendscores/me

Thanks, but the problem is that I have to send all friends id of current player to my server, in order to know how of them have a highscore in my server. Do you understand me?
Quote this message in a reply
Moderator
Posts: 385
Joined: 2002.08
Post: #4
Can you store the user's friend ids on the server? If so, OSC's solution is by far the easiest.

If you send the user's id to the server, it could query facebook directly for the friends also.

Does this help clarify?

KB Productions, Car Care for iPhone/iPod Touch
@karlbecker_com
All too often, art is simply the loss of practicality.
Quote this message in a reply
Member
Posts: 249
Joined: 2008.10
Post: #5
funkboy Wrote:Can you store the user's friend ids on the server? If so, OSC's solution is by far the easiest.

If you send the user's id to the server, it could query facebook directly for the friends also.

Does this help clarify?

So, you mean, apart from using facebook connect in my game, use also facebook in my server side to avoid those 300 requests, isn't it?
Quote this message in a reply
Moderator
Posts: 385
Joined: 2002.08
Post: #6
riruilo Wrote:So, you mean, apart from using facebook connect in my game, use also facebook in my server side to avoid those 300 requests, isn't it?
That's one way to do it, and would reduce hitting the server so much.

KB Productions, Car Care for iPhone/iPod Touch
@karlbecker_com
All too often, art is simply the loss of practicality.
Quote this message in a reply
Member
Posts: 249
Joined: 2008.10
Post: #7
funkboy Wrote:That's one way to do it, and would reduce hitting the server so much.

There is one problem.
User uses facebook connect dialog inside my game, where he/she writes his/her password and login. But using that dialog, I don't know his password, so I cannot send ti to my server, and if my server doesn't have that password, it cannot interact with facebook.

What do you think?
Quote this message in a reply
Post Reply 

Possibly Related Threads...
Thread: Author Replies: Views: Last Post
  Saving scores for facebook users to compare with their friends roguekiwi 4 10,435 Sep 13, 2011 09:01 PM
Last Post: roguekiwi
  persistent highscore after updates Newbrof 1 2,411 Feb 2, 2010 02:35 AM
Last Post: Newbrof
  Perfomance (FPS) problems in OpenGL and SDL. Help. riruilo 12 5,860 Oct 15, 2009 06:58 PM
Last Post: AnotherJake
  How can I share my game with my friends? riruilo 16 7,269 Apr 10, 2009 06:21 AM
Last Post: Fred9000