通过游戏中心共享保存的游戏数据?
我正在尝试确定游戏中心是否适合我。这是我的情况:
我正在构建一个应用程序,允许用户创建自己的音乐作品。我计划使作品可通过文本文件(可能是 xml 或 json 格式)导出和加载。我想让用户与朋友分享他们的作品。在我看来,Game Kit 是 iOS 的默认社交网络,所以它似乎值得一看。然而,游戏套件的社交方面似乎主要是为实时、同时玩而设计的。有没有办法通过游戏中心以非实时的方式与朋友分享数据?有没有办法向游戏中心联系人发送消息?
I'm trying to figure out if game center is the right tool for me. Here's my situation:
I'm building an app which allows users to create their own musical compositions. I plan to make the compositions exportable and loadable via text file (xml or json format, probably). I'd like to allow users to share their compositions with friends. It seems to me that game kit is the default social network for iOS, so it seems worth looking at. However, the social aspect of game kit seems to be designed mainly for real-time, simultaneous play. Is there any way to share data with friends in a non-realtime way via game center? Is there even a way to send game center contacts a message?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
如果您查看 GameKit 中的对等网络文档,您可能会准确地找到您正在寻找的内容,但有一个微小的例外。它仅适用于 wifi/蓝牙连接。
我对你的描述的看法是使用一个托管这些作品的私人服务器。如果您熟悉 Java 和/或 Python,我建议您使用 Google App Engine 作为服务器。这样头痛就会减轻一些。
您也可以使用 GameKit,但正如您所描述的,它更适合实时通信。
如果您实施邀请处理程序,您可以“邀请”其他玩家接收该作品,但如果他们拒绝,您将不得不稍后手动重试。
您通过开放的“GameKit 连接”发送的内容可以是您喜欢的“任何内容”,填充到 NSData 对象中,因此没有任何限制。
我希望这可以帮助您朝着正确的方向前进,祝您好运!
If you look at the documentation for peer-to-peer networking in GameKit, you will probably find exactly what you are looking for, with a tiny exception. It is only for wifi/bluetooth connectivity.
The way I would go with your description is a private server that hosts the compositions. If you are familiar to Java and/or Python, I'd recommend using Google App Engine for the server. That would make the headache a little bit less.
You can use GameKit too, but as you describe it, it's more for real-time communication.
If you implement invitation handlers, you could "invite" another player to receive the composition, but if they reject you will have to retry manually at a later point.
The contents of what you sent over an open "GameKit connection" can be "anything" you like, stuffed into a NSData object, so there is no limits there.
I hope this helps you a tiny bit in the right direction, good luck!