cGame center all scores = zero

Hi,

I have looked around the forums and seen a few topics on this, but nothing that seems to fix my issue.  My game is live.  I first noticed the problem while testing but read somewhere that the problem might be a testing issue so I decided to publish and see what happens.  On itunes connect I can see that there are at least 50 scores, but they are all zero.  

 I think it must be something to do with my setup as the code is “adding” a high score, its just zero for everyone.  I think I have set up itunes correctly, but I may be wrong.

Below is my code.  I tried [lua]tonumber(score)[/lua] and [lua]score[/lua].  Score is a number anyway, but I was clutching at straws.

[lua]

local leaderboardID = “com.zeroIQTest.BestScore”

– some other code

public.leaderBoardSubmit = function(score)

local function requestCallback( event )

    if ( event.type == “setHighScore” ) then

        – High score has been set

        print(“setHighScore callback” )

        table.print_r(event)

    end

end

print("----------------the score is ", score) – this prints correctly so I know score is getting here

– this is my original code,  commented to test fixed value

– gameNetwork.request( “setHighScore”,

–     {

–         localPlayerScore = { category=leaderboardID, value=tonumber(score) },

–         listener = requestCallback

–     }

– )

– added this code to test fixed value

gameNetwork.request( “setHighScore”,

    {

        localPlayerScore = { category=leaderboardID, value=25 },

        listener = requestCallback

    }

)

end

[/lua]

This is what is printed out in the callback.

table: 0x622a670 { [provider] =\> "gamecenter" [type] =\> "setHighScore" [data] =\> table: 0x622a670 { [value] =\> 25 [category] =\> "com.zeroIQTest.BestScore" } }

Any ideas on where I am going wrong?

Thanks, 

Craig

I think it might be your sort order.  Low to high means that 0 is a better score than 100. Try changing that to “High to Low” and see if that changes things for you.

Rob

Awesome thanks Rob.  I can’t believe I missed that.  Unfortunately, I couldn’t edit the published one so I now have an extra leaderboard as you cannot delete old one…

Live and learn…

Craig

I think it might be your sort order.  Low to high means that 0 is a better score than 100. Try changing that to “High to Low” and see if that changes things for you.

Rob

Awesome thanks Rob.  I can’t believe I missed that.  Unfortunately, I couldn’t edit the published one so I now have an extra leaderboard as you cannot delete old one…

Live and learn…

Craig