OpenFeint - Unlocking Achievements

Are we required to keep track of the unlocked achievements in order to not send unnecessary requests to OpenFeint? At the moment my game sends unlocking requests every time it’s played even though achievements have already been unlocked. And how about high score? Should I keep track of that myself in my app and only send a new request when I know I have a higher score to submit?

Is it possible to keep track of these things with Corona? How do I know that OpenFeint has registered certain information? Should I worry about these things? [import]uid: 13507 topic_id: 17094 reply_id: 317094[/import]

OF keeps track for you and you don’t have to care, i.e. if an achievement is already unlocked, nothing happens. and a new highscore is posted only when it’s higher than previous scores.

-finefin [import]uid: 70635 topic_id: 17094 reply_id: 64244[/import]

Thanks finefin, but does it mean that OpenFeint doesn’t mind if my game sends lots of unnecessary requests? [import]uid: 13507 topic_id: 17094 reply_id: 64284[/import]

indeed. OF doesn’t mind… it knows how to handle multiple requests locally and only sends the info to the OF-servers when necessary.

-finefin [import]uid: 70635 topic_id: 17094 reply_id: 64286[/import]

Ok, cool. Thanks finefin for the swift reply! [import]uid: 13507 topic_id: 17094 reply_id: 64323[/import]

If you want to avoid sending the requests you could do something like

  
local achievements = {"882424", "5343"}  
local isUnlocked = {false, false}  
local achievementID = 1  
  
--When unlocking the achievement  
  
if isUnlocked[achievements[achievementID]] == false then  
 --unlock openfeint achievement  
  
 --Set the achivement type to unlocked now so it doesn't get requested again  
 isUnlocked[achievements[achievementID]] = true  
  
 --you would also want to save the isUnlocked[achievements[achievementID]] to a file also :)  
end  

[import]uid: 84637 topic_id: 17094 reply_id: 64350[/import]

Thanks Danny, but how do I know that the achievement really unlocks ( what if my device is offline or for some other reason the unlocking request doesn’t go through ) ? [import]uid: 13507 topic_id: 17094 reply_id: 64435[/import]

thanks, Danny.

If you want to keep track of the achievements aside from OF or GC, that approach would be recommended.

-finefin [import]uid: 70635 topic_id: 17094 reply_id: 64436[/import]