Platforms to show: All Mac Windows Linux Cross-Platform

GKMatchRequestMBS class

Type Topic Plugin Version macOS Windows Linux iOS Targets
class GameKit MBS MacFrameworks Plugin 12.3 ✅ Yes ❌ No ❌ No ❌ No Desktop only
A GKMatchRequest object is used to specify the parameters for a new match.
Example
// ask Game Center to find 1 to 3 other players for a match
// The player must be signed in, see GKLocalPlayerMBS.
// MyGameKit is a subclass of GameKitMBS with the findMatchForRequestCompleted event implemented.
// Kit is a property of the window: Kit As MyGameKit
Kit = New MyGameKit

Var request As New GKMatchRequestMBS
request.minPlayers = 2
request.maxPlayers = 4
request.defaultNumberOfPlayers = 2
request.inviteMessage = "Let's play!"

GKMatchmakerMBS.sharedMatchmaker.findMatchForRequest request

// in MyGameKit:
Sub findMatchForRequestCompleted(MatchMaker As GKMatchmakerMBS, request As GKMatchRequestMBS, match As GKMatchMBS, TurnBasedMatch As GKTurnBasedMatchMBS, error As NSErrorMBS, tag As Variant) Handles findMatchForRequestCompleted
If error <> Nil Then
System.DebugLog error.localizedDescription
ElseIf match <> Nil Then
System.DebugLog "Match found, waiting for " + match.expectedPlayerCount.ToString + " more players."
End If
End Sub

A GKMatchRequest object is passed to the GKMatchmaker object to programmatically search for other players, or to a GKMatchmakerViewController (GKMatchmakerPanel on OS X) object when your game wants to present the default user interface to the player.

This class has no subclasses.

Xojo Developer Magazine

Some methods using this class:

Some events using this class:

Some related classes:


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


GKMatchMBS   -   GKPlayerMBS


The biggest plugin in space...