Can I tell an iOS Gamecenter automatch from an explicit invitation?

那年仲夏 提交于 2020-01-04 05:56:14

问题


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.


回答1:


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.



来源:https://stackoverflow.com/questions/8842462/can-i-tell-an-ios-gamecenter-automatch-from-an-explicit-invitation

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!