Xojo Developer Conference
25/27th April 2018 in Denver.
MBS Xojo Conference
6/7th September 2018 in Munich, Germany.

Platforms to show: All Mac Windows Linux Cross-Platform

GameKitMBS class

Type Topic Plugin Version macOS Windows Linux Console & Web iOS
class GameKit MBS MacFrameworks Plugin 12.3 Yes No No Yes, macOS only No
Function: The central plugin class for GameKit.
Notes:
Events from various objects end here, so you can implement them in a central subclass of GameKitMBS.
For most events, we carry a "tag as Variant" parameter, so you can pass a window, some object or whatever value you need.

Also we defined that matchdata is a dictionary. This way you can store various values inside including arrays (e.g. array of variant). As data is serialized over the network, you can't pass Real Studio objects.

The plugin makes sure that all events run on the main thread, so please make sure you don't block main thread.
Please create only one instance of your GameKitMBS subclass.

GameKit classes are available in OS X v10.8 and later.
Please review Apple's documentation for more details and a guide.

Feedback, Comments & Corrections

GameKit Error Constants

Constant Value Description
GKErrorAuthenticationInProgress 7 The local player is currently authenticating.
GKErrorCancelled 2 The requested operation was canceled.
GKErrorChallengeInvalid 19 The challenge was invalid.
Available on Mac OS X 10.8.2 and newer.
GKErrorCommunicationsFailure 3 An error occurred when communicating with Game Center.
GKErrorGameUnrecognized 15 nGame Center does not recognize the application that made the request. Make sure the bundle identifier is set properly for the application.one
GKErrorInvalidCredentials 5 The operation failed because the player's user name or password or both are incorrect.
GKErrorInvalidParameter 17 One or more of the parameters was incorrect.
For example, this error code may be returned if your application attempts to post a score and provides a category string that does not match a category you configured for your leaderboards on iTunes Connect.
GKErrorInvalidPlayer 8 A player object or identifier is invalid.
GKErrorMatchRequestInvalid 13 The match request's properties are impossible to fulfill. For example, the minimum number of players cannot be larger than the maximum number of players.
GKErrorNotAuthenticated 6 The local player has not been authenticated.
GKErrorNotSupported 16 The device does not support Game Center.
GKErrorOffline 25 The user went offline.
In Mac OS X 10.8.2 and newer this constant has value 25. In older versions it has value 19.
GKErrorParentalControlsBlocked 10 The feature has been blocked by the user.
GKErrorScoreNotSet 9 A score value was not set before attempting to post the score.
GKErrorTurnBasedInvalidParticipant 22 One of the participant objects you provided was invalid.
Available on Mac OS X 10.8.2 and newer.
GKErrorTurnBasedInvalidState 24 The requested operation could not be completed because the session is in an invalid state.
Available on Mac OS X 10.8.2 and newer.
GKErrorTurnBasedInvalidTurn 23 The requested operation could not be completed because the specified participant does not have the required turn state.
Available on Mac OS X 10.8.2 and newer.
GKErrorTurnBasedMatchDataTooLarge 20 Your game submitted data that exceeded the maximum size that Game Center permits for a turn-based game.
Available on Mac OS X 10.8.2 and newer.
GKErrorTurnBasedTooManySessions 21 The requested operation could not be completed because it would exceed the maximum number of sessions.
Available on Mac OS X 10.8.2 and newer.
GKErrorUnderage 14 The feature is disabled because the local player is underage.
GKErrorUnexpectedConnection 18 An unexpected player has connected to a match.
GKErrorUnknown 1 An unexpected error occurred.
GKErrorUserDenied 4 The operation was denied by the user.

Response Constants

Constant Value Description
GKInviteeResponseAccepted 0 The player accepted the invitation.
Available on Mac OS X 10.8.2 and newer.
GKInviteeResponseDeclined 1 The player rejected the invitation.
Available on Mac OS X 10.8.2 and newer.
GKInviteeResponseFailed 2 The invitation was unable to be delivered.
Available on Mac OS X 10.8.2 and newer.
GKInviteeResponseIncompatible 3 The invitee is not running a compatible version of your game.
Available on Mac OS X 10.8.2 and newer.
GKInviteeResponseNoAnswer 5 The invitation timed out without an answer.
Available on Mac OS X 10.8.2 and newer.
GKInviteeResponseUnableToConnect 4 The invitee could not be contacted.
Available on Mac OS X 10.8.2 and newer.

Invite Responses

Constant Value Description
GKInviteRecipientResponseAccepted 0 The player accepted the invitation.
Available in OS X v10.10 and later.
GKInviteRecipientResponseDeclined 1 The player rejected the invitation.
Available in OS X v10.10 and later.
GKInviteRecipientResponseFailed 2 The invitation was unable to be delivered.
Available in OS X v10.10 and later.
GKInviteRecipientResponseIncompatible 3 The invitee is not running a compatible version of your game.
Available in OS X v10.10 and later.
GKInviteRecipientResponseNoAnswer 5 The invitation timed out without an answer.
Available in OS X v10.10 and later.
GKInviteRecipientResponseUnableToConnect 4 The invitee could not be contacted.
Available in OS X v10.10 and later.

This class has no sub classes.

Some examples which use this class:


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


FSEventsMBS   -   GammaFadeMBS




Links
MBS Xojo Plugins