Platforms to show: All Mac Windows Linux Cross-Platform
GKTurnBasedMatchMBS class
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
class | GameKit | MBS MacFrameworks Plugin | 12.3 | ✅ Yes | ❌ No | ❌ No | ❌ No | Desktop only |
A turn-based match uses a store-and-forward approach to share data between the participants. When a player participating in the match performs actions to advance the state of the match, your game uploads data to Game Center that defines the new state of the match and tells Game Center which player act next in the match. Later, when the next player launches your game, it downloads the match data from Game Center and continues the match. Players continue to take turns acting (based on whatever internal logic your game implements) until the match ends. A key advantage of turn-based matches is that a player may participate in multiple matches simultaneously.
see also
https://developer.apple.com/library/mac/#documentation/GameKit/Reference/GKTurnBasedMatch_Ref/Reference/Reference.html
- property Handle as Integer
- 21 methods
- method acceptInvite(tag as Variant = nil)
- method Constructor
- method creationDate as date
- method currentParticipant as GKTurnBasedParticipantMBS
- method declineInvite(tag as Variant = nil)
- method endMatchInTurnWithMatchData(matchData as Dictionary, tag as Variant = nil)
- method endTurnWithNextParticipant(nextParticipant as GKTurnBasedParticipantMBS, matchData as Dictionary, tag as Variant = nil)
- method endTurnWithNextParticipants(nextParticipants() as GKTurnBasedParticipantMBS, timeout as Double, matchData as Dictionary, tag as Variant = nil)
- method loadMatchData(tag as Variant = nil)
- method matchData as Dictionary
- method matchDataMaximumSize as Integer
- method matchID as string
- method message as string
- method participantQuitInTurnWithOutcome(matchOutcome as Integer, nextParticipant as GKTurnBasedParticipantMBS, matchData as Dictionary, tag as Variant = nil)
- method participantQuitInTurnWithOutcome(matchOutcome as Integer, nextParticipants() as GKTurnBasedParticipantMBS, timeout as Double, matchData as Dictionary, tag as Variant = nil)
- method participantQuitOutOfTurnWithOutcome(matchOutcome as Integer, tag as Variant = nil)
- method participants as GKTurnBasedParticipantMBS()
- method rematch(tag as Variant = nil)
- method remove(tag as Variant = nil)
- method saveCurrentTurnWithMatchData(matchData as Dictionary, tag as Variant = nil)
- method status as Integer
- 6 shared methods
- shared method Available as boolean
- shared method findMatchForRequest(request as GKMatchRequestMBS, tag as Variant = nil)
- shared method loadMatches(tag as Variant = nil)
- shared method loadMatchWithID(matchID as string, tag as Variant = nil)
- shared method TimeoutDefault as Double
- shared method TimeoutNone as Double
- 10 constants
Constants
Constant | Value | Description |
---|---|---|
GKTurnBasedMatchStatusEnded | 2 |
One of the states a match can enter.
The match has been completed. |
GKTurnBasedMatchStatusMatching | 3 |
One of the states a match can enter.
The match is currently being played. |
GKTurnBasedMatchStatusOpen | 1 |
One of the states a match can enter.
Game Center is still searching for other players to join the match. |
GKTurnBasedMatchStatusUnknown | 0 |
One of the states a match can enter.
The match is in an unexpected state. |
GKTurnBasedParticipantStatusActive | 4 |
One of the states the participant is in during the match.
The participant has joined the match and is an active player in it. |
GKTurnBasedParticipantStatusDeclined | 2 |
One of the states the participant is in during the match.
The participant declined the invitation to join the match. When any participant declines an invitation to join a match, the match is automatically terminated. |
GKTurnBasedParticipantStatusDone | 5 |
One of the states the participant is in during the match.
The participant has exited the match. Your game sets the matchOutcome property to state why the participant left the match. |
GKTurnBasedParticipantStatusInvited | 1 |
One of the states the participant is in during the match.
The participant was invited to the match, but has not responded to the invitation. |
GKTurnBasedParticipantStatusMatching | 3 |
One of the states the participant is in during the match.
The participant is an unfilled position in the match that Game Center promises to fill when needed. When your game sets this participant as the current participant in the match, Game Center fills the position and updates the status and playerID properties. |
GKTurnBasedParticipantStatusUnknown | 0 |
One of the states the participant is in during the match.
The participant is in an unexpected state. |
This class has no sub classes.
Some events using this class:
- GameKitMBS.endMatchInTurnWithMatchDataCompleted(match as GKTurnBasedMatchMBS, matchData as Dictionary, error as NSErrorMBS, tag as Variant)
- GameKitMBS.endTurnWithNextParticipantsCompleted(match as GKTurnBasedMatchMBS, nextParticipants() as GKTurnBasedParticipantMBS, timeout as Double, matchData as Dictionary, error as NSErrorMBS, tag as Variant)
- GameKitMBS.handleTurnEventForMatch(match as GKTurnBasedMatchMBS, didBecomeActive as boolean)
- GameKitMBS.loadMatchDataCompleted(match as GKTurnBasedMatchMBS, matchData as Dictionary, error as NSErrorMBS, tag as Variant)
- GameKitMBS.matchEnded(player as GKPlayerMBS, match as GKTurnBasedMatchMBS)
- GameKitMBS.participantQuitInTurnWithOutcomeCompleted(match as GKTurnBasedMatchMBS, matchOutcome as Integer, nextParticipant as GKTurnBasedParticipantMBS, nextParticipants() as GKTurnBasedParticipantMBS, timeout as Double, matchData as Dictionary, error as NSErrorMBS, tag as Variant)
- GameKitMBS.receivedTurnEventForMatch(player as GKPlayerMBS, match as GKTurnBasedMatchMBS, didBecomeActive as boolean)
- GameKitMBS.saveCurrentTurnWithMatchDataCompleted(match as GKTurnBasedMatchMBS, matchData as Dictionary, error as NSErrorMBS, tag as Variant)
- GameKitMBS.turnBasedMatchmakerViewControllerDidFindMatch(viewController as Variant, match as GKTurnBasedMatchMBS)
- GameKitMBS.turnBasedMatchmakerViewControllerPlayerQuitForMatch(viewController as Variant, match as GKTurnBasedMatchMBS)
Xojo Developer Magazine
- 12.6, pages 33 to 35: Writing OS X Apps for Game Center, Part 3: Turn-Based Games by Tom Baumgartner
- 12.6, page 29: Writing OS X Apps for Game Center, Part 3: Turn-Based Games by Tom Baumgartner
- 12.6, page 25: Writing OS X Apps for Game Center, Part 3: Turn-Based Games by Tom Baumgartner
- 12.5, page 32: Writing OS X Apps for Game Center, Part 2: Requesting a Match by Tom Baumgartner
The items on this page are in the following plugins: MBS MacFrameworks Plugin.
GKTurnBasedMatchmakerViewControllerMBS - GKTurnBasedParticipantMBS