English 中文(简体)
GKSessionModeServer和GKSessionModeClient
原标题:Defining GKSessionModeServer and GKSessionModeClient

My problem is that , I have to connect many devices using GameKit framework. Everything works fine with two connections(GKSessionModePeer) I searched a lot on internet on how to connect more than two devices and what I got is, to use GKSessionModeServer and GKSessionModeClient.I read the apple documentation also.

但是,在如何使用<代码>GKSessionModeServer和GKSessionModeClient方面,目前还没有任何明确的削减办法,这些手段将充当服务器,并将充当客户。

如果有人知道如何处理这一问题,或者我应该采取什么做法,请告诉我。

任何帮助都将受到高度赞赏。

最佳回答

我在加梅用了3个装置,但也许会帮助你(在游说中与5个装置合作)。

  1. I dont use GKSessionModeServer/Client, I use GKSessionModePeer.
  2. I do autoconnect - it means that when new device shows up, other devices send connect request to it and it gets accepted automatically (so if we have 3 devices turned on, all of them are connected together)
  3. Once you have all devices connected, you can send fake invitiations by sending normal data packets (I_INVITE_YOU, INVITATION_DECLINED, INVITATION_ACCEPTED) and then disconnecting other devices if you have enough players. You can add devices that disconnected you to you temporary ignore list - reset it if user goes back to main menu or sth
  4. Once you have all the party ingame, they can decide who is who:
  5. If you game doesnt send lots of data, you can do some simple checks against udid or peerid: lets say device with lowest udid is the SERVER, others are CLIENTS
  6. If your game sends tons of data, I ve observed that server should be THE SLOWEST machine - the thing is that when server is fast (works with lets say 50fps), it sends data at similar framerate, so when client is slow (lets say 20fps), it gets about 2 packets from server per frame, which further slows it down. Question is how to decide which device is slowest. I used average fps

它是复杂的,但比标准奥赛邀请计划(有3.1个创伤经历)的工作要好得多。

Regard!

问题回答

暂无回答




相关问题
Code sign Error

I have created a new iPhone application.I have two mach machines. I have created the certificate for running application in iPhone in one mac. Can I use the other mac for running the application in ...

ABPersonViewController Usage for displaying contact

Created a View based Project and added a contact to the AddressBook using ABAddressBookRef,ABRecordRef now i wanted to display the added contact ABPersonViewController is the method but how to use in ...

将音频Clips从Peter改为服务器

我不禁要问,那里是否有任何实例表明从Peit向服务器发送音响。 I m不关心电话或SIP风格的解决办法,只是一个简单的袖珍流程......

• 如何将搜查线重新定位?

我正试图把图像放在搜索条左边。 但是,问题始于这里,搜索条线不能重新布署。

热门标签