gameNetwork.request( "loadScores") only returns one score

I’m playing around with the gameNetwork stuff and have two questions:

1. In the docs for the “setHighScore” you can read:

"If the high score is not higher than the one currently on the server, the server will keep the highest value."

Does this mean that to get on the high score list you have to beat the current top score? So that even if you actually have the second best score you will not end up on the list (which can be 25 entries long if I’m nt mistaken)?

2. “loadScored” returns only one entry

Or so it seems. I try to fetch the high score list like this:

requestCallback = function (event) if ( event.type == "loadScores" ) then if (#event.data \> 0) then for i=1, #event.data do print("\playerID: " .. event.data[i].playerID) print("category: " .. event.data[i].category) print("value: " .. event.data[i].value) print("date: " .. event.data[i].date) print("formattedValue:" .. event.data[i].formattedValue) print("rank: " .. event.data[i].rank) print("unixTime: " .. event.data[i].unixTime) end end end end gameNetwork.request( "loadScores", { leaderboard = { category = "CgkIyvfB5t8eEAIQAA", playerScope = "Global", -- Global, FriendsOnly timeScope = "AllTime", -- AllTime, Week, Today range = { 1,5 }, playerCentered = false }, listener = requestCallback } ) 

Even if I have put several (sequentionally higher) scores with “setHighScore”, only the last one seems to be listed. Typically this is the output of the code above: 

playerID: 198283707555384661187 category: CrkIyzfB4t8eE2yRqA value: 180 date: Tue Dec 30 00:38:28 CET 2014 formattedValue:180 rank: 1 unixTime: 1419896308805

How can I get to the whole list?

Hi @runewinse,

I’m not an absolute authority on GameCenter, but for #1, I believe the previous sentence in our docs is important:

“…this function sets a high score for the currently logged-in user for the specified leaderboard (category).”

So, that means that it will submit the score for that specific player, on that specific leaderboard, and it will silently do nothing only if the submitted score doesn’t exceed the current high score for that player (not the overall leading player on the leaderboard). So, if the top 3 scores are like this…

Gollum: 5000

Bilbo: 4000

Gandalf: 3000

…and your current player is Gandalf, submitting a score of 4500 should move him up into slot #2 on the leaderboard, even though he hasn’t beaten Gollum’s score of 5000.


For #2, did you submit several “high scores” for the same player? That would only submit the highest score for that player, not submit all of those scores for that particular player. So, it would seem logical that you wouldn’t get 5 results in the “loadScores” event.data table for the same player.

Best regards,

Brent

Hi Brent,

I have only tested with one player and that most certainly explains both #1 and #2.

Thanks!

-Rune

Hi @runewinse,

I’m not an absolute authority on GameCenter, but for #1, I believe the previous sentence in our docs is important:

“…this function sets a high score for the currently logged-in user for the specified leaderboard (category).”

So, that means that it will submit the score for that specific player, on that specific leaderboard, and it will silently do nothing only if the submitted score doesn’t exceed the current high score for that player (not the overall leading player on the leaderboard). So, if the top 3 scores are like this…

Gollum: 5000

Bilbo: 4000

Gandalf: 3000

…and your current player is Gandalf, submitting a score of 4500 should move him up into slot #2 on the leaderboard, even though he hasn’t beaten Gollum’s score of 5000.


For #2, did you submit several “high scores” for the same player? That would only submit the highest score for that player, not submit all of those scores for that particular player. So, it would seem logical that you wouldn’t get 5 results in the “loadScores” event.data table for the same player.

Best regards,

Brent

Hi Brent,

I have only tested with one player and that most certainly explains both #1 and #2.

Thanks!

-Rune