objective c - How to tell the host from the client in iPhone bluetooth with GameKit -


I have created a multiplayer game using the GKK framework, where 2 iPhone / iPod connects to each other via Bluetooth You can. / P>

I'm thinking of a way to choose which devices will be able to play first. Therefore, the logical solution is to choose the host of connection. Is there a server and client in GKSession? Are they all companions? Which route can I get, what do I need?

Basically, this is for you to configure like session

From Apple's documentation:

The session detects other peers on the network based on a session mode that is set to start the session. Your application session can configure the server, which advertises a service type on the network; A customer who searches for the ad server; Or a coworker who advertises as a server and searches together like a customer.

To act as a server, a copy of your application initiates the session by INS VESSATION ID: displayName: sessionMode: After either session mode of GKSessionModeServer or GKSessionModePeer app configured session, This sets the available available properties of the session by yes.

Starts the session by calling the initWithSessionID to copy the copy of your application that acts as a client: displayName: sessionMode: After configuring the mode session of GKSessionModeClient or GKSessionModeClier or GKSessionModePeer with the session, your The application searches the network for the ad server by setting the available assets for the session. YES If the session is configured with GKSessionModePeer session mode, then it will be used as a server in itself. He advertises, as described above.

Therefore, if you use GKSessionModePeer to start a session, then your colleagues (both server and client) if you want to separate a server from your customers , Then start it with GKSessionModeServer.

Kind regards


Comments

Popular posts from this blog

c++ - Linux and clipboard -

What is expire header and how to achive them in ASP.NET and PHP? -

sql server - How can I determine which of my SQL 2005 statistics are unused? -