我可以通过明确的邀请告诉iOS Gamecenter自动匹配吗? [英] Can I tell an iOS Gamecenter automatch from an explicit invitation?

查看:96
本文介绍了我可以通过明确的邀请告诉iOS Gamecenter自动匹配吗?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在我的多人iOS游戏中,一个玩家必须是主机",并决定某些游戏设置.当他通过GC邀请朋友时,很明显他在驾驶员座位上,但是当人们通过自动匹配将他们召集到一起时,我需要执行草拟程序,以便在进行选择时只显示一个对话框. 现在,我不知道如何从一个由一侧明确发起的设置中分辨出一个自动匹配的连接. 是否可以从某些API行为中推断出任何想法?我认为didDindMatch调用如果不是完全自动匹配的(至少是观察结果),总是已经至少邀请了一名玩家返回,但是文档并没有明确确认这一点,并指出它最初可能是空的.

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.

推荐答案

我也遇到了同样的问题,并最终得出结论,唯一的办法就是自己跟踪和发送消息.

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.

可惜的是,API似乎没有提供此信息,因为它似乎很有用,并且应该可以在Game Center上随时使用.

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.

这篇关于我可以通过明确的邀请告诉iOS Gamecenter自动匹配吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆