Obtaining Current High Score and Current High Score's Rank in Initial Score Post

Forums Programming high score, social and ads networks Obtaining Current High Score and Current High Score's Rank in Initial Score Post

This topic contains 3 replies, has 1 voice, and was last updated by  AkumaStreak 4 years, 3 months ago.

Viewing 4 posts - 1 through 4 (of 4 total)
Author Posts
Author Posts
December 29, 2009 at 8:18 pm #219050

AkumaStreak
Participant
@akumastreak

Is there a way to do this?

Currently I do something like this:

[av setTitle:@"Leaderboard Entry Processed"];
if ([sender scoreDidUpdate])
{
[av setMessage:[NSString stringWithFormat:@"%@'s local leaderboard high score of %@ was added to the world leaderboard. This score is ranked #%@ in the world.", [pEntry objectForKey:@"cc_playername"], [GameData instance] pNumberFormatter] stringFromNumber:[pEntry objectForKey:@"cc_score", [GameData instance] pNumberFormatter] stringFromNumber:[NSNumber numberWithUnsignedInt:[sender ranking]]];
}
else
{
[av setMessage:[NSString stringWithFormat:@"%@'s existing world leaderboard high score was not changed. His/her existing high score of %@ is ranked #%@ in the world.", [pEntry objectForKey:@"cc_playername"], [GameData instance] pNumberFormatter] stringFromNumber:[pEntry objectForKey:@"cc_score", [GameData instance] pNumberFormatter] stringFromNumber:[NSNumber numberWithUnsignedInt:[sender ranking]]];
}
[av addButtonWithTitle:@"OK"];
[av show];

This does not work for the second case though, as it’s really just displaying the details about the score I attempted to post. Since I always try to post the score that’s highest in my local leaderboard, I thought this was working initially. However, if I clear local leaderboards, and then submit a new #1 local score later for the same player, and it fails to update (the existing one is higher), I can’t give them nice info. about the existing world leaderboard high score (instead I am putting up info about the score I tried to post with updateScore, which wasn’t even accepted). It would be really nice to be able to get at the existing score/rank in this case so the player knows what they need to shoot for to beat their last high score. Tips?

Thanks.

December 30, 2009 at 1:15 am #269401

AkumaStreak
Participant
@akumastreak

Hmm. I thought getRankForScore required the score as an argument. Guess not. I’ll try that.

December 30, 2009 at 2:01 am #269402

AkumaStreak
Participant
@akumastreak

After looking at a server-side Python file I didn’t think I had to send the score. Now I see I do. Still stuck.

January 5, 2010 at 12:22 am #269403

AkumaStreak
Participant
@akumastreak

No need for this in my current project anymore. Might be useful for others though.

Viewing 4 posts - 1 through 4 (of 4 total)

You must be logged in to reply to this topic.