Right way to cache GKScores

Discussion in 'Public Game Developers Forum' started by Ologon, Sep 2, 2012.

  1. Ologon

    Ologon Active Member

    May 25, 2012

    I'm adding game center support to my game and I was wondering what's the right way to cache scores. According to the apple guide, GKScores can be cached using the NSCoding protocol then restored after.

    However if the date the score was achieved isn't of any important use, wouldn't be better to just create a new GKScore object everytime instead of caching it? The advantage with this method is that it's harder to hack and easier to implement.

    Any advice is welcome :D
  2. Devcade

    Devcade Member

    Feb 23, 2012
    #2 Devcade, Sep 4, 2012
    Last edited: Sep 4, 2012
    A GKScore contains more than just time. It also contains the PlayerID.

    How do you expect to submit a score without a valid PlayerID?
    Or...do you want to submit a score that belongs to another player?

    So, if Apple says store the whole thing, then I recommend doing it.

    And if you want to protect it, use NSData to store a hash to prevent tampering.

Share This Page