XMPP 通过 Wi-Fi 在两台 iPad 之间交换游戏信息,好方法吗?
昨天刚拿到我的 iPad,我想开始为全球的一个小社区在 iPad 之间编写一个分布式游戏,所以没有蓝牙。
我听说过 XMPP 协议可以在两台 PC 之间进行数据交换,例如 SO 上的这个线程
基本上,该方法是一种分散的解决方案,一旦在两个 iPad 之间建立了有效的连接,就不需要服务器参与。两台iPad可以使用XMPP进行通信。我知道大部分数据都是文本的,尽管一些图像也将通过网络传输。
我现在关心的只是概念验证。这是一个好方法吗?由于Wi-Fi信号强度差而导致连接中断,如何重新连接?有更好的方法来做这种事情吗?
我是 iPad 游戏编程新手,因此欢迎并赞赏任何建议。
Just got my iPad yesterday and I wanna start programming a distributed game between iPads for a little community across the globe, so no blue-tooth.
I've heard of the XMPP protocol to enable data exchange between two PCs, such like this thread on SO
Basically, the approach is a decentralized solution, once a valid connection is established between two iPads, there is no need for the server to be involved. The two iPad can communicate using XMPP. I know the majority of the data would be textual, although some images are also to be transferred across the net.
My concern at the moment is just proof of concept. Is this a good approach? How to re-connect if the connection is broken due to poor Wi-Fi signal strength? Is there a better way to do this sort of thing?
I am new to iPad game programming so any suggestion is welcomed and appreciated.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
为此,您应该使用 GameKit。这更容易,并且不需要帐户。此外,所有设备查找功能都已实现。 (Apple 专有格式,仅限 iOS)
You should use GameKit for this. It's way easier and doesn't need accounts. Also all the device finding stuff is already implemented. (Apple proprietary format, iOS only)