Bluetooth Multiplayer Works, want it Online?

Discussion in 'iOS Programming' started by ArtOfWarfare, Aug 16, 2011.

  1. ArtOfWarfare, Aug 16, 2011
    Last edited: Aug 16, 2011

    macrumors 604


    Nov 26, 2007
    Okay, so I've made a two player game that works using Game Kit and bluetooth right now. It was pretty easy to set up and does exactly what I want it to.

    Now I'd like to make my game work online. What's the easiest way I can go from what I have now, to having it work online?

    I don't know how to do any programming with servers or anything, and I don't want to spend money to buy/rent servers (I don't expect the game to be popular enough to be worth spending money on... it's more just an exercise for me to figure out how it's done.)
  2. ArtOfWarfare, Aug 18, 2011
    Last edited: Aug 18, 2011

    thread starter macrumors 604


    Nov 26, 2007
    It looks like Game Center / Game Kit might be capable of doing this for me... but I don't understand the documentation.

    Right now, I have this for finding another player via bluetooth:

        findItFirstPeerPicker = [[GKPeerPickerController alloc] init];
        findItFirstPeerPicker.delegate = self;
        findItFirstPeerPicker.connectionTypesMask = GKPeerPickerConnectionTypeNearby;
        [findItFirstPeerPicker show];
    - (GKSession *)peerPickerController:(GKPeerPickerController *)picker sessionForConnectionType:(GKPeerPickerConnectionType)type
        GKSession *session = [[GKSession alloc] initWithSessionID:@"com.TaylorMarks.FindItFirst" displayName:nil sessionMode:GKSessionModePeer];
        return [session autorelease];
    - (void)peerPickerController:(GKPeerPickerController *)picker didConnectPeer:(NSString *)peerID toSession:(GKSession *)session
        self.findItFirstSession = session;
        session.delegate = self;
        picker.delegate = nil;
        [picker dismiss];
        [picker autorelease];
    Would changing my game to work online be a simple matter of changing findItFirstPeerPicker.connectionTypesMask = GKPeerPickerConnectionTypeNearby; to findItFirstPeerPicker.connectionTypesMask = GKPeerPickerConnectionTypeOnline;

    in the first code snippet?

    The reason I'm confused is this statement in the documentation:
    How do I program my own UI? Where am I getting the data from that it displays?

Share This Page