Apple GameKit - 如何将多个 iPhone 连接到一个 Ipad 作为服务器但具有不同的 Bundle ID
我正在浏览 iOS 开发者库,寻找一种方法来实现 iPad Scrabble 应用程序的功能,即在 iPad 上托管游戏并让多部 iPhone 通过蓝牙连接到它。
我知道如果每个人都拥有具有相同捆绑包标识符的应用程序,则可以使用 GameKit 玩多人游戏。问题是,在 Scrabble 的情况下,您下载了 2 个不同的应用程序,它们仍然可以相互连接。
这让我很困惑,因为开发者库指出:
注意:匹配只能与相同的其他副本进行 应用程序(即共享同一包的应用程序 标识符)。您无法在两个不同的人之间进行匹配 应用程序。
知道如何实现这一点吗?我基本上希望 iPhone 上有一个免费的应用程序,可以显示从 iPad 上的服务器调用的内容。
谢谢!
I was going through the iOS Developer Library looking for a way to achieve what the iPad Scrabble app does, which is to host a game on an iPad and have multiple iPhones connect to it via Bluetooth.
I know it could be possible to play a multiplayer game using the GameKit if everyone had the app with the same Bundle Identifier. The problem is, in the Scrabble case, you download 2 different apps, and they can still connect to each other.
This puzzles me since the developper library states:
Note: Matchmaking can be done only with other copies of the same
application (that is, applications that share the same bundle
identifier). You cannot perform matchmaking between two different
applications.
Any idea how this could be achieved? I basically would like a free app on iPhone displaying stuff called from the server on the iPad.
Thanks!
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
所以你不能使用游戏中心提供的匹配,但你可以使用
initWithSessionID:displayName:sessionMode:
手动创建 GKSession 并为不同的应用程序传递相同的会话 ID,并且你需要创建自己的会话选择器视图和实现 GKSessionDelegate
https://developer.apple.com/library/ios/#DOCUMENTATION/NetworkingInternet/Conceptual/GameKit_Guide/GameKitConcepts/GameKitConcepts.html#//apple_ref/doc/uid/TP40008304-CH100-SW18
so you cannot using match making that provided by game center but you can manually create GKSession using
initWithSessionID:displayName:sessionMode:
and pass same session ID for different applicationand you need to make your own session picker view and implement GKSessionDelegate
https://developer.apple.com/library/ios/#DOCUMENTATION/NetworkingInternet/Conceptual/GameKit_Guide/GameKitConcepts/GameKitConcepts.html#//apple_ref/doc/uid/TP40008304-CH100-SW18