I have a mobile game with achievements on android, so the achievements are using Google Play Services.
For a couple of reasons, I must track the progress on the achievements locally (or so I think) because:
- If the user is not connected to the internet
- Some achievements have complex "step" that the simple increment system provided by the Google Play Service (number of steps, current step) cannot track.
When the game starts, the local copy data on the achievements is synced with what is on Google's server. Either
- both are the same, do nothing
- the local copy has more progress than what is shown on Google's: so update Google data (that happens if you play offline)
- the copy on Google's server show more progress than locally: so update the local data (that happens if you play on a different device)
Clearly, there's a way to abuse the system here. Given two players with different achievement progress (Player_A (lots of achievements), Player_B (few achievements)) they can do the following:
- Using Player_B's device, Player_B signs out of his account
- Player_A signs in (the current active Google Account is now Player_A)
- Start the game
- All of Player_A's achievements are synced locally (they had more progress than the previous local version of Player_B)
- Player_A signs out and Player_B signs in
- Re-start the game: the local copy will show as more advanced than Player_B achievements, therefore they will get updated.
How do people deal with this problem? Not care? Key the local achievement progress to the logged in player (which causes some problems)? Not to track anything related to the achievements locally (but how to deal/detect being offline?)