Now the game updates itself when users leave.
Currently, numberOfPlayers doesn’t get updated (we talked about tracking the difference between ‘total number of players, once-upon-a-time’ and ‘current active players,’ so I kept numberOfPlayers as the number who’ve ever been in the game.) We will probably want to update this later, to take into account whether the game has started or not.
Also, when you empty out the cycle when ‘cleaning up game’ I was hoping to be able to update the users’ currentGameID to nil/null, but Parse won’t let me update the users when they aren’t logged in.
This might require some CloudCode (javascript!) or a check when users log in that they are actually in the game they think they are in.