Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 9158271
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 17, 20262026-06-17T13:12:28+00:00 2026-06-17T13:12:28+00:00

I have created a card game using GameCenter and the Real Time server-client networking

  • 0

I have created a card game using GameCenter and the Real Time server-client networking strategy. While testing in the sand box, the game works flawlessly (makes the connection, picks the best host, sends/receives data) and sometimes the game actually even completes without an issue. However, MOST of the time, on both devices I will receive a match:player:didChangeState: callback informing me that the opposing user has disconnected. It happens frustratingly often, and does not seem to have anything to do with inactivity or a timeout. My thoughts are I may be dealing with normal network latency on the GameCenter servers, since there were rare cases where the player seems to reconnect and sends data again. Is anyone else dealing with these issues using GKMatch and Real Time GameCenter? I am testing the app on an iPhone 5 and iPhone 4 both running iOS 6.1 and connected to the same wifi network.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-17T13:12:29+00:00Added an answer on June 17, 2026 at 1:12 pm

    While I didn’t find an exact solution for the disconnects, I patched my problem with the following. Also, to prevent losing messages sent during a disconnect: I implemented a “response” handler that detects whether the message was actually received by the opponent (since the Reliable data send mode does not error out when a message isn’t received by the opponent due to connection issues).

    When the game is started, I determine a user to be the host (chooseBestHostPlayerWithCompletionHandler:^), and when I detect a disconnect the host player re-invites the non-server player back to the game. This works whether the game was started by invitation OR “Play Now”. It solved my issue of the “ShouldReconnect” which only works with 1v1 and Invitation matches. When the non-host player accepts the invite, I complete the matchmaking programmatically to prevent the MatchMakerViewController from having to appear omn screen. Once reconnected the match resumes without issue.

    - (void)reinvitePlayer {
        GKMatchRequest *request = [[GKMatchRequest alloc] init];
        request.minPlayers = 2;
        request.maxPlayers = 2;
        request.playersToInvite = @[_opponent.playerID];
        request.inviteMessage = @"Reconnect?";
        request.inviteeResponseHandler = ^(NSString *playerID, GKInviteeResponse response)
        {
            DLog(@"Player response = %i.",response);
            // [self updateUIForPlayer: playerID accepted: (response == GKInviteeResponseAccepted)];
        };
        [[GKMatchmaker sharedMatchmaker] addPlayersToMatch:_match matchRequest:request completionHandler:^(NSError *error) {
            if (error != nil) {
                DLog(@"Unable to add player to match.");
            } else {
                DLog(@"Successfully reconnected");
                [[GKMatchmaker sharedMatchmaker] finishMatchmakingForMatch:_match];
            }
        }];
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'd like to use PlayN to create a client/server card game, e.g. Hearts. While
I have a card game I created in android and it is possible to
I have created a provisional profile using 'Non Wild Card App ID'. Which does
I am writing card game using Silverlight and HttpPollingDuplex . I have 4 seperate
I am creating an android card game. I have created a playing card class
I have created an android application that calls (using kSOAP library) a SOAP based
I have a card game program, and so far, the chat works great back
I have a card-game application which makes use of Single Table Inheritance. I have
I am looking to make a card game in Flash CS4 using AS3 and
I have created some C++ classes to model a Solitaire game as a learning

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.