Platforms to show: All Mac Windows Linux Cross-Platform

Back to GKMatchmakerViewControllerMBS class.

GKMatchmakerViewControllerMBS.addPlayersToMatch(match as GKMatchMBS)

Type Topic Plugin Version macOS Windows Linux iOS Targets
method GameKit MBS MacFrameworks Plugin 12.3 ✅ Yes ❌ No ❌ No ❌ No Desktop only
Adds a player to the match.

match: An existing match that you want to add players to.

Your game calls this method prior to presenting the view controller to the player. Calling this method instructs the view controller to add new players to the provided match rather than creating a new match.

When called, this method sets the delegate on the match to nil and updates the view controller's user interface to display the players already connected to the match.

Important Only one device connected to the match should call this method.

GKMatchmakerViewControllerMBS.Constructor   Private

Type Topic Plugin Version macOS Windows Linux iOS Targets
method GameKit MBS MacFrameworks Plugin 14.2 ✅ Yes ❌ No ❌ No ❌ No Desktop only
The private constructor.

See also:

GKMatchmakerViewControllerMBS.Constructor(invite as GKInviteMBS)

Type Topic Plugin Version macOS Windows Linux iOS Targets
method GameKit MBS MacFrameworks Plugin 12.3 ✅ Yes ❌ No ❌ No ❌ No Desktop only
Initializes a matchmaker view controller to respond to an invitation received from another player.

invite: The invitation received from the other player.

The user is allowed to join the match that the user was invited to, but is not allowed to invite others to the match.

See also:

GKMatchmakerViewControllerMBS.Constructor(request as GKMatchRequestMBS)

Type Topic Plugin Version macOS Windows Linux iOS Targets
method GameKit MBS MacFrameworks Plugin 12.3 ✅ Yes ❌ No ❌ No ❌ No Desktop only
Initializes a matchmaker view controller to create a new match.

request: A request containing the characteristics for the desired match.
Your game uses this Constructor when it wants the local user to create a new match.

See also:

GKMatchmakerViewControllerMBS.DefaultInvitationMessage as string

Type Topic Plugin Version macOS Windows Linux iOS Targets
property GameKit MBS MacFrameworks Plugin 12.3 ✅ Yes ❌ No ❌ No ❌ No Desktop only
The default invitation message used to initialize an invitation.

Your game sets this property to change the default invitation text displayed when the local player creates a new invitation. The local player may edit the text before sending the invitation.
(Read and Write computed property)

GKMatchmakerViewControllerMBS.Hosted as boolean

Type Topic Plugin Version macOS Windows Linux iOS Targets
property GameKit MBS MacFrameworks Plugin 12.3 ✅ Yes ❌ No ❌ No ❌ No Desktop only
A Boolean value that indicates whether the match is hosted or peer-to-peer.

The value of the hosted property determines which events of GameKitMBS are called when the match is complete. If true, this is a hosted match, and the delegate's matchmakerViewControllerDidFindPlayers method is to provide the list of players to your game. If false, this is a peer-to-peer match, and matchmakerViewControllerDidCreateMatch is called with a GKMatch object. The default value is false.

Hosted matches require you to provide a server that hosts the participants in the match.
(Read and Write computed property)

GKMatchmakerViewControllerMBS.matchRequest as GKMatchRequestMBS

Type Topic Plugin Version macOS Windows Linux iOS Targets
method GameKit MBS MacFrameworks Plugin 12.3 ✅ Yes ❌ No ❌ No ❌ No Desktop only
The configuration for the desired match. (read-only)

GKMatchmakerViewControllerMBS.setHostedPlayer(playerID as string, connected as boolean)

Type Topic Plugin Version macOS Windows Linux iOS Targets
method GameKit MBS MacFrameworks Plugin 12.3 ✅ Yes ❌ No ❌ No ❌ No Desktop only
Updates a player's status on the view to show that the player has connected or disconnected from your server.

playerID: The identifier string for a player that connected to the external server.
connected: Optional, a Boolean value that states whether the player is connected to the hosted match.

When setting up a hosted match, each device should instantiate a matchmaker view controller and display it to the player. Then, when a new player connects to your server, your server should notify all participating devices already connected to your server. Each participating device should then call this method to update that player's status in the matchmaking interface. Similarly, if a player disconnects from the server, your server should inform each device so that the devices can update their user interface.

The items on this page are in the following plugins: MBS MacFrameworks Plugin.


The biggest plugin in space...