Platforms to show: All Mac Windows Linux Cross-Platform
Back to GKMatchMBS class.
GKMatchMBS.chooseBestHostPlayer(tag as Variant = nil)
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
method | GameKit | MBS MacFrameworks Plugin | 13.0 | ✅ Yes | ❌ No | ❌ No | ❌ No | Desktop only |
Calling this method causes Game Kit to attempt to estimate which player has the best overall network connection using a variety of metrics such as bandwidth, latency and network reliability. Typically, you call this method when your game implements a client-server model on top of the match's peer-to-peer connection. See "Designing Your Network Game" in Game Center Programming Guide.
When this method is called, it creates a new background task to handle the request. The method then returns control to your game. Later, when the task is complete, Game Kit calls your GKMatchMBS.chooseBestHostPlayerCompleted event.
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
method | GameKit | MBS MacFrameworks Plugin | 12.3 | ✅ Yes | ❌ No | ❌ No | ❌ No | Desktop only |
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
method | GameKit | MBS MacFrameworks Plugin | 12.3 | ✅ Yes | ❌ No | ❌ No | ❌ No | Desktop only |
Your application should call disconnect before releasing the match object. Calling disconnect notifies other players that you have left the match.
GKMatchMBS.expectedPlayerCount as Integer
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
method | GameKit | MBS MacFrameworks Plugin | 12.3 | ✅ Yes | ❌ No | ❌ No | ❌ No | Desktop only |
The value of this property is decremented whenever a player connects to the match. When its value reaches zero, all expected players are connected, and your game can begin the match.
GKMatchMBS.playerIDs as string()
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
method | GameKit | MBS MacFrameworks Plugin | 12.3 | ✅ Yes | ❌ No | ❌ No | ❌ No | Desktop only |
The playerIDs property initially includes the player identifiers for any players already connected to the match; the array may initially be empty. As each player connects to the match, that player's player identifier is added to the array.
GKMatchMBS.rematch(tag as Variant = nil)
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
method | GameKit | MBS MacFrameworks Plugin | 13.0 | ✅ Yes | ❌ No | ❌ No | ❌ No | Desktop only |
Calling this method uses auto-matching to recreate a previous match. A new match with the same set of players is created and returned. If your game attempts to recreate matches using this method, each instance of your game on each device should call this method.
When this method is called, it creates a new background task to handle the request. The method then returns control to your game. Later, when the task is complete, Game Kit calls GKGameKitMBS.rematchCompleted event.
GKMatchMBS.sendDataToAllPlayers(data as Dictionary, mode as Integer, byref error as NSErrorMBS) as boolean
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
method | GameKit | MBS MacFrameworks Plugin | 12.3 | ✅ Yes | ❌ No | ❌ No | ❌ No | Desktop only |
data: The game data to send.
mode: The mechanism used to send the data.
error: If the data could not be queued, on return, this parameter holds an NSError object describing the error.
Return true if the data was successfully queued for transmission; false if the match was unable to queue the data.
The match queues the data and transmits it when the network becomes available.
GKMatchMBS.sendDataToPlayers(players() as string, data as Dictionary, mode as Integer, byref error as NSErrorMBS) as boolean
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
method | GameKit | MBS MacFrameworks Plugin | 12.3 | ✅ Yes | ❌ No | ❌ No | ❌ No | Desktop only |
data: The game data to be sent.
players: An array containing the identifier strings for the list of players who should receive the data.
mode: The mechanism used to send the data.
error: If the data could not be queued, on return, this parameter holds an NSError object describing the error.
Returns true if the data was successfully queued for transmission; false if the match was unable to queue the data.
The match queues the data and transmits it when the network becomes available.
GKMatchMBS.voiceChatWithName(name as string) as GKVoiceChatMBS
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
method | GameKit | MBS MacFrameworks Plugin | 12.3 | ✅ Yes | ❌ No | ❌ No | ❌ No | Desktop only |
Returns an voice chat object for the voice channel, or nil if an error occurred.
Calling this method joins a voice channel, creating it if necessary. Your application should retain the voice chat object returned by this method. All participants who join a channel with the same name are connected to each other.
A single match can have multiple voice chat channels, and any player in the match can join multiple channels simultaneously. For example, a team-based game might create a channel for each team, and a single channel that includes all of the players.
Voice chat objects are dependent on the network connection provided by the match. When the player disconnects from the match, all voice channels associated with that match stop working. Typically, you should release any voice channels you joined before calling calling disconnect on the match.
Parental controls may prevent a player from joining a voice chat. If the player is not permitted to join the voice channel, a nil object is returned to your application.
The items on this page are in the following plugins: MBS MacFrameworks Plugin.