A number identifying a subset of players allowed to join the match.
- iOS 4.0+
- macOS 10.8+
- Mac Catalyst 13.0+
- tvOS 9.0+
- watchOS 3.0+
If your game sets the
player property, only players whose requests share the same
player value are automatched by Game Center. Setting the
player property to
0 allows the player to be matched into any waiting match. Set the
player property to a nonzero number to match the player only with players whose match request shares the same player group number. The value of a player group is arbitrary. For example, you could define different
player values to implement any of the following filters:
A game could restrict players based on skill level.
A game that provides multiple game modes could use it to filter players into the specific game they want to play.
A game that provides bonus content through in-app purchase could match players who own the same content with each other.
Listing 1 shows how you might configure a match request that uses a player group. In this example, the player group value is calculated by choosing both the map the player wants to play on and the rules set under which the player wants to play. A constant for each is chosen and the two are bitwise ORed together to create a unique number for the player group. Game Center only searches for other players with the same map and group combination.