我可以区分 iOS Gamecenter 自动匹配和明确邀请吗?

发布于 2024-12-26 17:23:53 字数 248 浏览 2 评论 0原文

在我的多人 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 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

被翻牌 2025-01-02 17:23:53

我也有同样的问题,并最终得出结论,唯一的方法是自己跟踪并发送消息。

就我而言,发起方跟踪游戏的启动方式,并将该信息作为用于设置游戏的初始消息序列的一部分发送。

遗憾的是,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.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文