我可以区分 iOS Gamecenter 自动匹配和明确邀请吗?
在我的多人 iOS 游戏中,一名玩家必须成为“主机”并决定某些游戏设置。当他通过 GC 邀请朋友时,很明显他处于主导地位,但是当人们通过自动匹配聚集在一起时,我需要执行一个抽吸程序,只将一个人带到做出选择的对话框中。 现在我不知道如何区分自动连接和由一侧明确启动的设置。 有什么想法是否可以从某些 API 行为中扣除?我认为 didFindMatch 调用总是会返回至少一个已邀请的玩家,如果它不是完全自动的(这至少是一个观察),但是文档没有明确证实这一点,并指出它最初可能是空的。
In my multiplayer iOS game, one player has to be the "host" and decide on certain game settings. When he invites friends via GC, it's clear that he is in the driver's seat, however when people are brought together by automatch, I need to do a draw-straw procedure to bring just one to the dialog of making the choices.
Right now I have no clue how I can tell an automatched connection from a setup that was initiated clearly by one side.
Any ideas whether it can be deducted from certain API behaviours? I thought that the didFindMatch call always comes back with at least one invited player already if it was not purely automatched (that is at least an observation), however the documentation does not clearly confirm that and states that it maybe initially empty.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我也有同样的问题,并最终得出结论,唯一的方法是自己跟踪并发送消息。
就我而言,发起方跟踪游戏的启动方式,并将该信息作为用于设置游戏的初始消息序列的一部分发送。
遗憾的是,API 似乎没有提供此信息,因为它似乎很有用,并且应该可以随时供游戏中心使用。
I had this same question and have eventually concluded that the only way was to track and message this myself.
In my case, the initiator side tracks how the game was started, and sends that information as part of the initial messaging sequence that is used to setup the game.
It is a shame that the API doesn't appear to provide this information as it seems to be useful and should be readily available to Game Center.