ios - How to determine if score for the match has been submitted -


i working on turn based game uses game center. not save match data locally. while game goes on, 1 of players ends game , submit score him self. when other player launches game, gets matches game center (including finished). problem is, can not determine game had submitted score. better understanding list steps of scenerio.

  • bob starts match
  • alice accepts match
  • alice plays & ends turn
  • bob plays & ends turn
  • ...
  • ...
  • ...
  • bob ends match & submits score leaderboard
  • alice launches game , gets game center 10 finished matches.

now how know, matches did submit score. far know can not update match data, after match has finished. can not save flag match data anymore.

do wrong , finish match early? should players have wait other players submit score?

do have save match data locally?

i thought using last turn date of match , save locally "last score submit date".

saving match data or date locally bad multiple devices.

another thing try: if using game center's leaderboards, check context , playerid [1] properties. then, when client notices game g has ended unsure if score posted, first download leaderboard scores local playerid leaderboard , check if context same finished game g's matchid.

if not, post score , leave matchid hint in context property of score.

[1] https://developer.apple.com/library/mac/#documentation/gamekit/reference/gkscore_ref/reference/reference.html#//apple_ref/occ/instm/gkscore/reportscorewithcompletionhandler:


Comments

Popular posts from this blog

c# - DetailsView in ASP.Net - How to add another column on the side/add a control in each row? -

javascript - firefox memory leak -

Trying to import CSV file to a SQL Server database using asp.net and c# - can't find what I'm missing -