I'm having trouble figuring out how to reinvite a disconnected player in a good way, using the GKMatch class for the Game Center. The game is a 1 vs. 1 game.
When I detect a disconnected player, I try to reinvite that specific player to the match with this call:
[[GKMatchmaker sharedMatchmaker] addPlayersToMatch:theMatch matchRequest:request completionHandler:^(NSError *error)
This works as it's supposed to do. When the other player has established the connection he gets reinvited and the match can continue. But this leaves a problem I haven't been able to solve. Here comes the scenario:
- Player 1 disconnects.
- Player 2 leaves the match while Player 1 is disconnected.
- Player 1 reconnects and detects that he lost connection to Player 2 and tries to reconnect to player2.
- Player 2 is looking for a new match, which he is doing with the matchmakerViewController.
- Player 2 suddenly joins the old match with Player 1, which he had left.
So my problem is that the matchmakerViewController let's players join old matches if they're reinvited. Is there a better way to handle this reconnection scenario so people won't get invited back to old matches?