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 6968387
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T16:26:42+00:00 2026-05-27T16:26:42+00:00

I’m building an application (already on the app store by the way, called MotAMot):

  • 0

I’m building an application (already on the app store by the way, called MotAMot): a boggle, free app.

This game proposes several playing modes: standalone, multi players using the same iDevice and MULTI in which 2 players play the same gameboard at the same time but each using his own iDevices.

I’m using a GKPeerPickerController instance to manage the connection between the 2 devices.

My only concern is that I can’t decide who’s iPhone will play the server role and who’s the client. When a player sends an invitation to the other, its cool, I can decide that this player will be the server.

Say for instance that player 1 invites player 2 to join the game. But at the same time (or just a few seconds after), player 2 invites player 1 before he gets the invitation popup displayed on his device. My question: how can I be sure that player 1 invited player 2 first (or the opposite)? I mean, of course I got some callbacks because I’m implementing the GKPeerPickerControllerDelegate protocol. But it seems that I get the same messages on both devices, regardless of who really initiates the connection.

// New connection
- (void)peerPickerController:(GKPeerPickerController *)picker
          didConnectPeer:(NSString *)peer
               toSession:(GKSession *)session
{
    // Set the session
    [self setCurrentSession:session];

    // I'm implementing the GKSessionDelegate protocol
    [session setDelegate:self];

// I'll handle any received data from my enemy
    [session setDataReceiveHandler:self withContext:nil];

// I'm cleaning the room
    [myPicker setDelegate:nil];
    [myPicker dismiss];
    [myPicker autorelease];
    myPicker = nil;
}


// A peer changed its state
- (void)session:(GKSession *)session peer:(NSString *)peer didChangeState:    (GKPeerConnectionState)state
{
    switch (state)
    {
        case GKPeerStateConnected:
            [self peerConnected:peer];
            break;
         case GKPeerStateDisconnected:
            // Libération de la session
            [currentSession release];
            currentSession = nil;            
            break;
        case GKPeerStateAvailable:
            break;
        case GKPeerStateConnecting:
             break;
        case GKPeerStateUnavailable:
             break;
    }
}

Would someone have any idea on this?

  • 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-05-27T16:26:43+00:00Added an answer on May 27, 2026 at 4:26 pm

    Why can’t you solve this the old fashioned way? Civilization IV for example puts you into a server-room screen, in which case you are the server waiting for clients and it makes sense for you to not accept any new connections.

    I would do something akin to that. it turns out this person had a problem (slightly related) and in my understanding it is solved in a similar way.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

We're building an app, our first using Rails 3, and we're having to build
I'm parsing an RSS feed that has an ’ in it. SimpleXML turns this
I have a string like this: La Torre Eiffel paragonata all’Everest What PHP function
link Im having trouble converting the html entites into html characters, (&# 8217;) i
For some reason, after submitting a string like this Jack’s Spindle from a text
this is what i have right now Drawing an RSS feed into the php,
I have this code to decode numeric html entities to the UTF8 equivalent character.
I have this code: - (void)parser:(NSXMLParser *)parser foundCDATA:(NSData *)CDATABlock { NSString *someString = [[NSString
This could be a duplicate question, but I have no idea what search terms
I know there's a lot of other questions out there that deal with this

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.