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:
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?
Launch your Settings app. Scroll around and look for "Game Center". When you find "Game Center", click it. Enter your Apple ID (it's an email address) and your password.
Go to Settings > Game Center > Sign out and sign back in. If it continues, try connecting to a different Wi-Fi network or try from cell network. You can find additional details in. For the issue with Wallet and if you're still unable to connect to Game Center, reach out to Apple directly.
When you sign in with your Apple ID, you will be signed in to Game Center automatically. Game Center allows you to engage in game-related activities such as participation in leaderboards; multiplayer games; finding, viewing, and challenging friends; and tracking achievements.
You could provide an option to the player that still is connected, to either re-invite, or quit. You could also remove the matchmaking request to the player that left if the other player leaves.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With