Advertise Mobile SDKs Books Events Forum News Social Networking Support Us
Follow @iphonedevsdk on Twitter

Interface 2, Advanced iOS
Mockup & Code Gen
($9.99)

Make your own iPhone apps
and run them live!
(free)

Pic Frame Dynamo: Photo Editing
($0.99)

Abiliator
($1.99)

Want your application or service advertised on iPhone Dev SDK?

Go Back   iPhone Dev SDK Forum > iPhone SDK Development Forums > iPhone SDK Game Development

Reply
 
LinkBack Thread Tools Display Modes
Old 10-04-2011, 12:14 PM   #1 (permalink)
Registered Member
 
Rudy's Avatar
 
Join Date: Mar 2009
Location: Ottawa, Canada
Posts: 1,425
Rudy is on a distinguished road
Default OpenFeint get rank

I'm working on integrating OF in a game and I want to get the rank of the score I just submitted (using [OFHighscoreService submitScore]). I don't want the best rank the user has. (the leaderboard allows multiple entries)

How would I get that information?
__________________
My Games:

My Blog
13" Macbook Air 1.7Ghz Core i5, 4GB DDR3, Intel HD Graphics 3000
iPhone 4S - PSPGo - 3DS - Wii - PS3 - 360
Rudy is offline   Reply With Quote
Old 10-05-2011, 07:56 AM   #2 (permalink)
Registered Member
 
Rudy's Avatar
 
Join Date: Mar 2009
Location: Ottawa, Canada
Posts: 1,425
Rudy is on a distinguished road
Default

Well I just figured that if you check "allow worse score" it actually REMOVES the highest score and add the new lower score Not what I wanted lol
__________________
My Games:

My Blog
13" Macbook Air 1.7Ghz Core i5, 4GB DDR3, Intel HD Graphics 3000
iPhone 4S - PSPGo - 3DS - Wii - PS3 - 360
Rudy is offline   Reply With Quote
Old 10-05-2011, 11:57 AM   #3 (permalink)
Registered Member
 
headkaze's Avatar
 
Join Date: Feb 2010
Posts: 359
headkaze is on a distinguished road
Default

I think [OFHighScoreService getHighScoreForUser... will get the best score so probably not what you're after.

The only way I know would be to use [OFHighScoreService getPage:... and then in the callback find the submitted score and get the rank from that.
__________________
Headsoft | Jungool
headkaze is offline   Reply With Quote
Old 10-05-2011, 12:45 PM   #4 (permalink)
Registered Member
 
Rudy's Avatar
 
Join Date: Mar 2009
Location: Ottawa, Canada
Posts: 1,425
Rudy is on a distinguished road
Default

Quote:
Originally Posted by headkaze View Post
I think [OFHighScoreService getHighScoreForUser... will get the best score so probably not what you're after.

The only way I know would be to use [OFHighScoreService getPage:... and then in the callback find the submitted score and get the rank from that.
Yea I figured there's no way to have more than one score so what I wanted to do won't work.... pretty lame
__________________
My Games:

My Blog
13" Macbook Air 1.7Ghz Core i5, 4GB DDR3, Intel HD Graphics 3000
iPhone 4S - PSPGo - 3DS - Wii - PS3 - 360
Rudy is offline   Reply With Quote
Old 10-05-2011, 03:16 PM   #5 (permalink)
Registered Member
 
headkaze's Avatar
 
Join Date: Feb 2010
Posts: 359
headkaze is on a distinguished road
Default

I believe OF stores scores locally too so they can queued for submission later or when the user is not online. I used this to submit awards because otherwise it would cause a stutter in the game doing it in realtime.

Maybe you could access the locally stored scores or perhaps store them yourself in NSUserDefaults?

If you have any success please let us know.
__________________
Headsoft | Jungool

Last edited by headkaze; 10-05-2011 at 03:18 PM.
headkaze is offline   Reply With Quote
Old 10-05-2011, 04:06 PM   #6 (permalink)
Registered Member
 
Rudy's Avatar
 
Join Date: Mar 2009
Location: Ottawa, Canada
Posts: 1,425
Rudy is on a distinguished road
Default

Quote:
Originally Posted by headkaze View Post
I believe OF stores scores locally too so they can queued for submission later or when the user is not online. I used this to submit awards because otherwise it would cause a stutter in the game doing it in realtime.

Maybe you could access the locally stored scores or perhaps store them yourself in NSUserDefaults?

If you have any success please let us know.
Not quite what I wanted, I wanted to store all the submitted scores and give the user his rank (for the game he just played) at the end of each game
__________________
My Games:

My Blog
13" Macbook Air 1.7Ghz Core i5, 4GB DDR3, Intel HD Graphics 3000
iPhone 4S - PSPGo - 3DS - Wii - PS3 - 360
Rudy is offline   Reply With Quote
Old 10-05-2011, 04:28 PM   #7 (permalink)
Registered Member
 
headkaze's Avatar
 
Join Date: Feb 2010
Posts: 359
headkaze is on a distinguished road
Default

Why can't you use [OFHighScoreService getPage: then? It will give you a list of scores in the callback which you can check against the username and tell what rank they're at.
__________________
Headsoft | Jungool
headkaze is offline   Reply With Quote
Old 10-05-2011, 08:03 PM   #8 (permalink)
Registered Member
 
Rudy's Avatar
 
Join Date: Mar 2009
Location: Ottawa, Canada
Posts: 1,425
Rudy is on a distinguished road
Default

Quote:
Originally Posted by headkaze View Post
Why can't you use [OFHighScoreService getPage: then? It will give you a list of scores in the callback which you can check against the username and tell what rank they're at.
The problem I'm having is that OpenFeint doesn't allow you to have more than one score per user in the leaderboard (it replaces the other score when you submit a new one). That right there makes what I wanted to do impossible
__________________
My Games:

My Blog
13" Macbook Air 1.7Ghz Core i5, 4GB DDR3, Intel HD Graphics 3000
iPhone 4S - PSPGo - 3DS - Wii - PS3 - 360
Rudy is offline   Reply With Quote
Old 10-05-2011, 08:31 PM   #9 (permalink)
Registered Member
 
headkaze's Avatar
 
Join Date: Feb 2010
Posts: 359
headkaze is on a distinguished road
Default

Of course you're right it only actually stores your highest score but if you get the leaderboard you could calculate what it's rank would be based on the other scores.
__________________
Headsoft | Jungool
headkaze is offline   Reply With Quote
Old 10-05-2011, 08:32 PM   #10 (permalink)
Registered Member
 
Rudy's Avatar
 
Join Date: Mar 2009
Location: Ottawa, Canada
Posts: 1,425
Rudy is on a distinguished road
Default

Quote:
Originally Posted by headkaze View Post
Of course you're right it only actually stores your highest score but if you get the leaderboard you could calculate what it's rank would be based on the other scores.
I guess that's a solution.... I'll look into it
__________________
My Games:

My Blog
13" Macbook Air 1.7Ghz Core i5, 4GB DDR3, Intel HD Graphics 3000
iPhone 4S - PSPGo - 3DS - Wii - PS3 - 360
Rudy is offline   Reply With Quote
Reply

Bookmarks

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



» Advertisements
» Online Users: 387
11 members and 376 guests
7twenty7, apatsufas, comicool, Creativ, Dalia, dansparrow, Duncan C, HemiMG, Murphy, pbart, Tomsky
Most users ever online was 1,387, 04-10-2012 at 04:21 AM.
» Stats
Members: 175,676
Threads: 94,127
Posts: 402,915
Top Poster: BrianSlick (7,990)
Welcome to our newest member, jleannex55
Powered by vBadvanced CMPS v3.1.0

All times are GMT -5. The time now is 06:56 AM.
Powered by vBulletin® Version 3.8.0
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.3.0