Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <ol> <li><p>I think that in your particular case the problem is that your 3G ISP restricts connections from necessary ports. <a href="http://support.apple.com/kb/HT4307?viewlocale=en_US&amp;locale=en_US" rel="nofollow">The Apple docs</a> say:</p> <blockquote> <p>To use Game Center ... port forwarding must be enabled for ports 443 (TCP), 3478-3497 (UDP), 4398 (UDP), 5223 (TCP), 16384-16387 (UDP), and 16393-16472 (UDP)</p> </blockquote> <p>I faced this issue too when trying to play on iPad connected via bluetooth to iPhone: there was "Connecting..." screen on each device. But when I use built-in iPad 3G (with a different tariff plan) everything goes fine.</p></li> <li><p>Just remind, in a normal match-making scenario <code>match:player:didChangeState:</code> may not be called. You should also check <code>match.expectedPlayerCount</code>:</p> <pre><code>- (void)matchmakerViewController:(GKMatchmakerViewController *)viewController didFindMatch:(GKMatch *)theMatch { //... if (theMatch.expectedPlayerCount == 0) { NSLog(@"Ready to start match!"); } } </code></pre></li> <li><p>Also I expected a similar problem with "Connecting..." screen, but on Wifi network. And it was reproduced only on iOS6 and after I tried rematch via <code>-[GKMatch rematchWithCompletionHandler:^(GKMatch *match, NSError *error) {}]</code> before.</p> <p>One device hanged on "Connecting..." screen but on the other <code>matchmakerViewController:didFindMatch:</code> was successfully called, but what is interesting is that <code>match.expectedPlayerCount</code> was <code>0</code> <strong>and</strong> <code>match.playerIDs</code> array was empty at the same time.</p> <p>I think such error occurred because I tried to find a new match while previous match tried to reconnect on background thread in the same time. And because of that new match was obtained <em>corrupted</em>. </p> <p>The decision is to wait for <em>rematchCompletion</em> being called and only then try to find new match. There is no interface in <code>GKMatch</code> to cancel rematch, so I use <code>[[GKMatchmaker sharedMatchmaker] cancel]</code> and after several seconds <em>rematchCompletion</em> is called with error and we are ready to start finding new match.</p> <p>Also I figured out that old unsued GKMatch instances are not deallocated and continue to live somewhere in GameKit framework. And they may probably cause problems if the work with them is not finished correctly (i.e. not disconnected, or rematch is not canceled in my case ). So do not forget to call <code>-[GKMatch disconnect]</code> and finish any other kind of work before removing the last strong reference to the match object .</p></li> </ol>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload