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.
Comments
Post a Comment