问题
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