title: GameKit bluetooth
body: <p>I'm trying to understand the basic steps required for a game I'm trying to make using GameKit for bluetooth connections. I only have 1 device, so I can't test out my ideas very easily.</p>
  
  <p>The game involves a maximum of 2 players over bluetooth via GameKit and the only data to send/receive is a 'shot' which includes position and direction data only.</p>
  
  <p>This is what I think should happen, I really just want someone to point out any mistakes I've made:</p>
  
  <ul>
  <li><p>The game starts by presenting a GKPeerPickerController with a connectionTypeMask of 'GKPeerPickerConnectionTypeNearby' and setting it's delegate to 'self'.</p></li>
  <li><p>The GKPeerPickerController delegate method 'peerPickerController:didConnectPeer:toSession:' is implemented and sets the sessions dataReceiveHandler to self. The peerID is added to an NSMutableArray which holds all peer IDs connected. (There should only be 1 peer connected at any time).</p></li>
  <li><p>To enforce only 1 peer connection per game the method 'session:didReceiveConnectionRequestFromPeer:' checks the 'count' property of the NSMutableArray which holds the connected peerIDs. If 'count'>0 then we respond by calling: 'denyConnectionFromPeer:' else, we call: 'acceptConnectionFromPeer:error:'</p></li>
  <li><p>To send a shot, the game calls: 'sendData:toPeers:withDataMode:error:'</p></li>
  <li><p>To receive shots, the game responds to: 'receiveData:fromPeer:inSession:context:'</p></li>
  </ul>
  
  <p>Are there any steps missing? For example, if a user tries to connect to me before I connect to them, what will happen with my GKPeerPickerController? How do I know to dismiss it?</p>
  
  <p>And without another iPhone/iPod I can't test.</p>