GooglePlayGameServices
GPlayAchievement
Events:
- onImageLoaded (URI As String, Drawable As BitmapDrawable)
Fields:
- STATE_HIDDEN As Int
- STATE_REVEALED As Int
- STATE_UNLOCKED As Int
- TYPE_INCREMENTAL As Int
- TYPE_STANDARD As Int
Functions:
- GetRevealedImage (ImageView As ImageView) As String
Loads the achievement's revealed image icon and fills the given ImageView.
Returns the URI of the image, or an empty string if the achievement has no revealed image.
- GetRevealedImage2 As String
Loads the achievement's revealed image icon and raises an onImageLoaded event when the load is complete.
Returns the URI of the image, or an empty string if the achievement has no revealed image.
- GetUnlockedImage (ImageView As ImageView) As String
Loads the achievement's unlocked image icon and fills the given ImageView.
Returns the URI of the image, or an empty string if the achievement has no unlocked image.
- GetUnlockedImage2 As String
Loads the achievement's unlocked image icon and raises an onImageLoaded event when the load is complete.
Returns the URI of the image, or an empty string if the achievement has no unlocked image.
- IsInitialized As Boolean
Properties:
- AchievementId As String [read only]
Retrieves the ID of this achievement.
- CurrentSteps As Int [read only]
Retrieves the number of steps this user has gone toward unlocking this achievement; only applicable for TYPE_INCREMENTAL achievement types.
- Description As String [read only]
Retrieves the description for this achievement.
- FormattedCurrentSteps As String [read only]
Retrieves the number of steps this user has gone toward unlocking this achievement (formatted for the user's locale); only applicable for TYPE_INCREMENTAL achievement types.
- FormattedTotalSteps As String [read only]
Retrieves the total number of steps necessary to unlock this achievement, formatted for the user's locale; only applicable for TYPE_INCREMENTAL achievement types.
- LastUpdatedTimestamp As Long [read only]
Retrieves the timestamp (in milliseconds since epoch) at which this achievement was last updated. If the achievement has never been updated, this will return -1.
- Name As String [read only]
Retrieves the name of this achievement.
- Player As GPlayPlayer [read only]
Retrieves the player information associated with this achievement.
- State As Int [read only]
Retrieves the state of the achievement - one of STATE_UNLOCKED, STATE_REVEALED, or STATE_HIDDEN.
- TotalSteps As Int [read only]
Retrieves the total number of steps necessary to unlock this achievement; only applicable for TYPE_INCREMENTAL achievement types.
- Type As Int [read only]
Retrieves the type of this achievement - one of TYPE_STANDARD or TYPE_INCREMENTAL.
- XpValue As Long [read only]
Retrieves the XP value given to players for unlocking this achievement.
GPlayAchievements
Fields:
- RESULTMAP_ACHIEVEMENT_ID As String
- RESULTMAP_ACHIEVEMENTS As String
- RESULTMAP_STATUS_CODE As String
- STATUS_ACHIEVEMENT_NOT_INCREMENTAL As Int
- STATUS_ACHIEVEMENT_UNKNOWN As Int
- STATUS_ACHIEVEMENT_UNLOCK_FAILURE As Int
- STATUS_ACHIEVEMENT_UNLOCKED As Int
- STATUS_OK As Int
Functions:
- GetAchievementsIntent As android.content.Intent
Gets an intent to show the list of achievements for a game. This intent must be invoked with StartActivityForResult.
A RESULT_RECONNECT_REQUIRED may be returned as the result code in the onActivityResult event if the Google API client ends up in an inconsistent state.
- Increment (Id As String, NumSteps As Int)
Increments an achievement by the given number of steps. The achievement must be an incremental achievement. Once an achievement reaches at least the maximum number of steps, it will be unlocked automatically. Any further increments will be ignored.
Use this function if you don't need to know the status of the operation immediately. For most applications, this will be the preferred function to use, though note that the update may not be sent to the server until the next sync. See IncrementImmediate if you need the operation to attempt to communicate to the server immediately or need to have the status code delivered to your application.
Id: The ID of the achievement to increment.
NumSteps: The number of steps to increment by. Must be greater than 0.
- IncrementImmediate (Id As String, NumSteps As Int) As GPlayPendingResult
Increments an achievement by the given number of steps. The achievement must be an incremental achievement. Once an achievement reaches at least the maximum number of steps, it will be unlocked automatically. Any further increments will be ignored.
This function will attempt to update the user's achievement on the server immediately, and will return a PendingResult that can be used to retrieve the result.
Id: The ID of the achievement to increment.
NumSteps: The number of steps to increment by. Must be greater than 0.
- Initialize
- IsInitialized As Boolean
- Load (ForceReload As Boolean) As GPlayPendingResult
Asynchronously loads achievement data for the currently signed in player.
ForceReload: If True, this call will clear any locally cached data and attempt to fetch the latest data from the server. This would commonly be used for something like a user-initiated refresh. Normally, this should be set to False to gain advantages of data caching.
- Reveal (Id As String)
Reveals a hidden achievement to the currently signed in player. If the achievement is already visible, this will have no effect.
Use this function if you don't need to know the status of the operation immediately. For most applications, this will be the preferred function to use, though note that the update may not be sent to the server until the next sync. See RevealImmediate if you need the operation to attempt to communicate to the server immediately or need to have the status code delivered to your application.
Id: The achievement ID to reveal
- RevealImmediate (Id As String) As GPlayPendingResult
Reveals a hidden achievement to the currently signed in player. If the achievement is already visible, this will have no effect.
This function will attempt to update the user's achievement on the server immediately, and will return a PendingResult that can be used to retrieve the result.
Id: The ID of the achievement to reveal.
- SetSteps (Id As String, NumSteps As Int)
Sets an achievement to have at least the given number of steps completed. Calling this function while the achievement already has more steps than the provided value is a no-op. Once the achievement reaches the maximum number of steps, the achievement will automatically be unlocked, and any further mutation operations will be ignored.
Use this function if you don't need to know the status of the operation immediately. For most applications, this will be the preferred function to use, though note that the update may not be sent to the server until the next sync. See SetStepsImmediate if you need the operation to attempt to communicate to the server immediately or need to have the status code delivered to your application.
Id: The ID of the achievement to modify.
NumSteps: The number of steps to set the achievement to. Must be greater than 0.
- SetStepsImmediate (Id As String, NumSteps As Int) As GPlayPendingResult
Sets an achievement to have at least the given number of steps completed. Calling this function while the achievement already has more steps than the provided value is a no-op. Once the achievement reaches the maximum number of steps, the achievement will automatically be unlocked, and any further mutation operations will be ignored.
This function will attempt to update the user's achievement on the server immediately, and will return a PendingResult that can be used to retrieve the result.
Id: The ID of the achievement to modify.
NumSteps: The number of steps to set the achievement to. Must be greater than 0.
- Unlock (Id As String)
Unlocks an achievement for the currently signed in player. If the achievement is hidden this will reveal it to the player.
Use this function if you don't need to know the status of the operation immediately. For most applications, this will be the preferred function to use, though note that the update may not be sent to the server until the next sync. See UnlockImmediate if you need the operation to attempt to communicate to the server immediately or need to have the status code delivered to your application.
Id: The achievement ID to unlock
- UnlockImmediate (Id As String) As GPlayPendingResult
Unlocks an achievement for the currently signed in player. If the achievement is hidden this will reveal it to the player.
This function will attempt to update the user's achievement on the server immediately, and will return a PendingResult that can be used to retrieve the result.
Id: The ID of the achievement to unlock.
GPlayConnection
Events:
- onClientConnected
- onConnectionFailed (ErrorCode As Int, ErrorMsg As String, Resolvable As Boolean)
- onConnectionSuspended (Cause As Int, CauseMsg As String)
- onGivingUp (ErrorCode As Int, ErrorMsg As String, ResolveCode As Int, ResolveMsg As String)
- onSignInFailed (ReasonCode As Int, ReasonMsg As String)
- onSignInSucceeded
- onSignOutComplete (StatusCode As Int)
Fields:
- DEBUG As Boolean
- RESULT_API_UNAVAILABLE As Int
- RESULT_CANCELED As Int
- RESULT_DEVELOPER_ERROR As Int
- RESULT_INTERNAL_ERROR As Int
- RESULT_INTERRUPTED As Int
- RESULT_INVALID_ACCOUNT As Int
- RESULT_LICENSE_CHECK_FAILED As Int
- RESULT_NETWORK_ERROR As Int
- RESULT_RESOLUTION_REQUIRED As Int
- RESULT_RESTRICTED_PROFILE As Int
- RESULT_SERVICE_DISABLED As Int
- RESULT_SERVICE_INVALID As Int
- RESULT_SERVICE_MISSING As Int
- RESULT_SERVICE_MISSING_PERMISSION As Int
- RESULT_SERVICE_UPDATING As Int
- RESULT_SERVICE_VERSION_UPDATE_REQUIRED As Int
- RESULT_SIGN_IN_FAILED As Int
- RESULT_SIGN_IN_REQUIRED As Int
- RESULT_SUCCESS As Int
- RESULT_TIMEOUT As Int
- STATE_CONNECTED As Byte
- STATE_CONNECTING As Byte
- STATE_DISCONNECTED As Byte
- STATE_NAMES As String()
- STATE_SIGNED_IN As Byte
- STATE_UNCONFIGURED As Byte
- SUSPD_CAUSE_NETWORK_LOST As Int
- SUSPD_CAUSE_SERVICE_DISCONNECTED As Int
Functions:
- Connect (FirstAttempt As Boolean)
Connects the client to Google Play services in the background. If successful, triggers the onClientConnected event, then signs the user in. Otherwise, triggers onConnectionFailed.
FirstAttempt: If True, checks whether the Google Play Services are available and up-to-date on the device, then tries to connect. If False, reconnects automatically the client if found disconnected.
Should be called from the Click event of a Sign-in button (FirstAttempt = True) to initiate the connection and from Activity_Resume to re-establish a lost connection (FirstAttempt = False). You can also set FirstAttempt to True in Activity_Resume if you want to try to sign in without waiting for an user action.
- Disconnect (SignOut As Boolean)
Disconnects the Google API client. Should be called from Activity_Pause or from the Click event of a Sign-out button.
SignOut: Whether the user is signed out before disconnecting.
- Initialize (Options As GPlayConnectionOptions, EventPrefix As String)
Creates an instance of Google API client and specifies the Play services and scopes to use. This function should be called from Activity_Create.
EventPrefix: Prefix of events.
- Initialize2 (AccountName As String, Options As GPlayConnectionOptions, EventPrefix As String)
Creates an instance of Google API client and specifies the Play services and scopes to use. This function should be called from Activity_Create.
AccountName: Account name on the device that should be used. If this is empty, the client will use the current default account for Google Play services for this application.
EventPrefix: Prefix of events.
- IsConnected As Boolean
Returns whether the client is connected.
- IsInitialized As Boolean
- IsSignedIn As Boolean
Returns whether the client is connected and the user is signed in.
- Reconnect
Closes the current connection to Google Play services and creates a new connection in the background.
- RequiresAuthentication As Boolean
Does one of the connected APIs require the user to authenticate?
- ShowErrorDialog (ErrorCode As Int)
Displays a dialog to address the provided ErrorCode. The error has to be user-recoverable.
This dialog displays a localized message about the error and upon user confirmation (by tapping on dialog) will direct them to the Play Store if Google Play services is out of date or missing, or to system settings if Google Play services is disabled on the device.
ErrorCode: The error code returned by onConnectionFailed.
- SignOut
Asynchronously signs the current user out and raises an onSignOutComplete event when done.
This call doesn't disconnect the Google API Client. As no user is signed in after this call is completed, subsequent calls to this client will very likely fail. You should either call Disconnect or Activity.Finish after this call.
Properties:
- ConnectionState As Byte [read only]
Gets the connection state (byte).
- ConnectionStateStr As String [read only]
Gets the connection state (string).
- GameRequests As List [read only]
Returns the list of GameRequests received when connecting the client.
- InvitationID As String [read only]
Returns the invitation ID received through an invitation notification.
- Room As GPlayRoom [read only]
Returns the Room object received when connecting the client.
- TurnBasedMatch As GPlayTurnBasedMatch [read only]
Returns the TurnBasedMatch object received when connecting the client.
GPlayConnectionOptions
Fields:
- GamesAPI As Boolean
Whether you want to access the Games API (default = True). This API requires the user to authenticate.
- GravityForPopup As Int
Specifies the part of the screen at which games service popups (for example, "welcome back" or "achievement unlocked" popups) will be displayed.
- NearbyConnectionsAPI As Boolean
Whether you want to access the Nearby Connections API to communicate with nearby devices (default = False). This API does not require the user to authenticate.
- SavedGamesAPI As Boolean
Whether you want to access the Drive API to load and save games (default = False). This API requires the user to authenticate.
- ShowConnectionPopup As Boolean
Whether a "connecting" popup should be displayed automatically at the start of the sign-in flow (default = True).
GPlayGame
Events:
- onImageLoaded (URI As String, Drawable As BitmapDrawable)
Functions:
- AreSnapshotsEnabled As Boolean
Indicates whether or not this game supports snapshots.
- GetFeaturedImage (ImageView As ImageView) As String
Loads the game's featured (banner) image from Google Play and fills the given ImageView.
Returns the URI or an empty string if the game has no featured image.
- GetFeaturedImage2 As String
Loads the game's featured (banner) image from Google Play and raises an onImageLoaded event when the load is complete.
Returns the URI or an empty string if the game has no featured image.
- GetHiResImage (ImageView As ImageView) As String
Loads the game's hi-res image and fills the given ImageView.
Returns the URI or an empty string if the game has no hi-res image.
- GetHiResImage2 As String
Loads the game's hi-res image and raises an onImageLoaded event when the load is complete.
Returns the URI or an empty string if the game has no hi-res image.
- GetIconImage (ImageView As ImageView) As String
Loads the game's icon and fills the given ImageView.
Returns the URI or an empty string if the game has no icon.
- GetIconImage2 As String
Loads the game's icon and raises an onImageLoaded event when the load is complete.
Returns the URI or an empty string if the game has no icon.
- HasGamepadSupport As Boolean
Indicates whether or not this game is marked as supporting gamepads.
- IsInitialized As Boolean
- IsRealTimeMultiplayerEnabled As Boolean
Indicates whether or not this game supports real-time multiplayer.
- IsTurnBasedMultiplayerEnabled As Boolean
Indicates whether or not this game supports turn-based multiplayer.
Properties:
- AchievementTotalCount As Int [read only]
Retrieves the number of achievements registered for this game.
- ApplicationId As String [read only]
Retrieves the application ID for this game.
- Description As String [read only]
Retrieves the description of this game.
- DeveloperName As String [read only]
Retrieves the name of the developer of this game.
- DisplayName As String [read only]
Retrieves the display name for this game.
- LeaderboardCount As Int [read only]
Gets the number of leaderboards registered for this game.
- PrimaryCategory As String [read only]
Retrieves the primary category of the game - this may be empty.
- SecondaryCategory As String [read only]
Retrieves the secondary category of the game - this may be empty.
- ThemeColor As String [read only]
Retrieves the theme color for this game as an RGB hex triplet. The theme color is used to configure the appearance of Play Games UIs.
GPlayGameRequest
Fields:
- RECIPIENT_STATUS_ACCEPTED As Int
- RECIPIENT_STATUS_PENDING As Int
- STATUS_ACCEPTED As Int
- STATUS_PENDING As Int
- TYPE_ALL As Int
- TYPE_GIFT As Int
- TYPE_WISH As Int
Functions:
- GetRecipientStatus (PlayerId As String) As Int
Retrieves the status of the request for a given recipient.
- IsConsumed (PlayerId As String) As Boolean
Retrieves whether the request was consumed by a specific recipient.
PlayerId: The player ID for which the consumed state should be queried.
- IsInitialized As Boolean
Properties:
- CreationTimestamp As Long [read only]
Returns the server timestamp (in milliseconds since epoch) at which this request was created.
- Data As Byte() [read only]
Retrieves the data associated with the request.
- ExpirationTimestamp As Long [read only]
Returns the server timestamp (in milliseconds since epoch) at which this request will expire.
- Game As GPlayGame [read only]
Retrieves the game associated with this request.
- Recipients As List [read only]
Retrieves the information about all the players that the request was sent to.
- RequestId As String [read only]
Retrieves the ID of this request.
- Sender As GPlayPlayer [read only]
Retrieves the information about the player that sent the request.
- Status As Int [read only]
Retrieves the status of the request as an overall status depending on all recipients.
- Type As Int [read only]
Retrieves the type of this request.
GPlayInvitation
Fields:
- INVITATION_TYPE_REAL_TIME As Int
- INVITATION_TYPE_TURN_BASED As Int
- MATCH_VARIANT_DEFAULT As Int
- ROOM_VARIANT_DEFAULT As Int
Functions:
Properties:
- AvailableAutoMatchSlots As Int [read only]
Returns the maximum number of available automatch slots for this invitation. If automatch criteria were not specified during creation, or if all slots have been filled, this will return 0.
- CreationTimestamp As Long [read only]
Retrieves the server timestamp at which this invitation was created.
- Game As GPlayGame [read only]
Retrieves the Game object that this invitation is associated with.
- InvitationId As String [read only]
Retrieves the ID of this invitation.
- InvitationType As Int [read only]
Retrieves the type of this invitation. May be either INVITATION_TYPE_REAL_TIME or INVITATION_TYPE_TURN_BASED.
- Inviter As GPlayParticipant [read only]
Retrieves the participant who created this invitation.
- Participants As List [read only]
Returns the list of participants for this invitation.
- Variant As Int [read only]
Retrieves the variant specified for this invitation, if any. A variant is an optional developer-controlled parameter describing the type of game to play. If specified, this value will be a positive integer. If this invitation had no variant specified, returns ROOM_VARIANT_DEFAULT or MATCH_VARIANT_DEFAULT.
GPlayInvitations
Events:
- onInvitationReceived (Invitation As GPlayInvitation)
- onInvitationRemoved (InvitationID As String)
Fields:
- EXTRA_INVITATION As String
- RESULTMAP_INVITATIONS As String
- RESULTMAP_STATUS_CODE As String
- SORT_ORDER_MOST_RECENT_FIRST As Int
- SORT_ORDER_SOCIAL_AGGREGATION As Int
Functions:
- GetInvitationInboxIntent As android.content.Intent
Returns an intent that will let the user see and manage any outstanding invitations. This intent must be invoked with StartActivityForResult.
If the user canceled, the result code will be ACTIVITY_RESULT_CANCELED. If the user selected an invitation to accept, the result code will be ACTIVITY_RESULT_OK and the data intent will contain the selected invitation in the extras. Based on the type of the match (TBMP/RTMP), the result will include either EXTRA_TURN_BASED_MATCH or EXTRA_INVITATION.
- Initialize
- IsInitialized As Boolean
- LoadInvitations As GPlayPendingResult
Asynchronously loads the list of invitations for the current game. Invitations are returned sorted by most recent first.
- LoadInvitations2 (SortOrder As Int) As GPlayPendingResult
Asynchronously loads the list of invitations for the current game.
SortOrder: How to sort the returned invitations. Must be either SORT_ORDER_MOST_RECENT_FIRST or SORT_ORDER_SOCIAL_AGGREGATION.
- RegisterInvitationListener
Registers a listener to intercept incoming invitations for the currently signed-in user. If a listener is registered by this function, the incoming invitation will not generate a status bar notification as long as this client remains connected.
Note that only one invitation listener may be active at a time. Calling this function while another invitation listener was previously registered will replace the original listener with the new one.
The listener will raise the onInvitationReceived and onInvitationRemoved events.
- UnregisterInvitationListener
Unregisters this client's invitation listener, if any. Any new invitations will generate status bar notifications as normal.
GPlayLeaderboard
Events:
- onImageLoaded (URI As String, Drawable As BitmapDrawable)
Fields:
- SCORE_ORDER_LARGER_IS_BETTER As Int
- SCORE_ORDER_SMALLER_IS_BETTER As Int
Functions:
- GetIconImage (ImageView As ImageView) As String
Loads this leaderboard's icon and fills the given ImageView.
Returns the URI of the image, or an empty string if there was a problem retrieving the icon.
- GetIconImage2 As String
Loads this leaderboard's icon and raises an onImageLoaded event when the load is complete.
Returns the URI of the image, or an empty string if there was a problem retrieving the icon.
- IsInitialized As Boolean
Properties:
- DisplayName As String [read only]
Retrieves the display name of this leaderboard.
- LeaderboardId As String [read only]
Retrieves the ID of this leaderboard.
- ScoreOrder As Int [read only]
Retrieves the sort order of scores for this leaderboard. Possible values are SCORE_ORDER_LARGER_IS_BETTER or SCORE_ORDER_SMALLER_IS_BETTER.
- Variants As List [read only]
Retrieves the variants (GPlayLeaderboardVariant) for this leaderboard. These will be returned sorted by time span first, then by variant type.
GPlayLeaderboardScore
Events:
- onImageLoaded (URI As String, Drawable As BitmapDrawable)
Fields:
- LEADERBOARD_RANK_UNKNOWN As Int
Functions:
- GetScoreHolderHiResImage (ImageView As ImageView) As String
Loads the hi-res image to display for the player who scored this score and fills the given ImageView.
Returns the URI of the image. If the identity of the player is unknown, this will be an empty string. It may also be an empty string if the player simply has no image.
- GetScoreHolderHiResImage2 As String
Loads the hi-res image to display for the player who scored this score and raises an onImageLoaded event when the load is complete.
Returns the URI of the image. If the identity of the player is unknown, this will be an empty string. It may also be an empty string if the player simply has no image.
- GetScoreHolderIconImage (ImageView As ImageView) As String
Loads the icon image to display for the player who scored this score and fills the given ImageView. If the identity of the player is unknown, this will load an anonymous image for the player.
Returns the URI of the image or an empty string if the player simply has no image.
- GetScoreHolderIconImage2 As String
Loads the icon image to display for the player who scored this score and raises an onImageLoaded event when the load is complete. If the identity of the player is unknown, this will load an anonymous image for the player.
Returns the URI of the image or an empty string if the player simply has no image.
- IsInitialized As Boolean
Properties:
- DisplayRank As String [read only]
Retrieves a formatted string to display for this rank. This handles appropriate localization and formatting.
- DisplayScore As String [read only]
Retrieves a formatted string to display for this score. The details of the formatting are specified by the developer in their dev console.
- Rank As Long [read only]
Retrieves the rank returned from the server for this score. Note that this may not be exact and that multiple scores can have identical ranks. Lower ranks indicate a better score, with rank 1 being the best score on the board.
If the score holder's rank cannot be determined, this will return LEADERBOARD_RANK_UNKNOWN.
- RawScore As Long [read only]
Retrieves the raw score value.
- ScoreHolder As GPlayPlayer [read only]
Retrieves the player that scored this particular score. The return value here may be Null if the current player is not authorized to see information about the holder of this score.
- ScoreHolderDisplayName As String [read only]
Retrieves the name to display for the player who scored this score. If the identity of the player is unknown, this will return an anonymous name to display.
- ScoreTag As String [read only]
Retrieves the optional score tag associated with this score, if any.
- TimestampMillis As Long [read only]
Retrieves the timestamp (in milliseconds from epoch) at which this score was achieved.
GPlayLeaderboardVariant
Fields:
- COLLECTION_PUBLIC As Int
- COLLECTION_SOCIAL As Int
- NUM_SCORES_UNKNOWN As Int
- NUM_TIME_SPANS As Int
- PLAYER_RANK_UNKNOWN As Int
- PLAYER_SCORE_UNKNOWN As Int
- TIME_SPAN_ALL_TIME As Int
- TIME_SPAN_DAILY As Int
- TIME_SPAN_WEEKLY As Int
Functions:
- HasPlayerInfo As Boolean
Gets whether or not this variant contains score information for the viewing player. There are several possible reasons why this might be False. If the scores for this variant have never been loaded, we won't know if the player has a score or not. Similarly, if the player has not submitted a score for this variant, this will return False.
It is possible to have a score but no rank. For instance, on leaderboard variants of COLLECTION_PUBLIC, players who are not sharing their scores publicly will never have a rank.
- IsInitialized As Boolean
Properties:
- Collection As Int [read only]
Retrieves the collection of scores contained by this variant. Possible values are COLLECTION_PUBLIC or COLLECTION_SOCIAL.
- DisplayPlayerRank As String [read only]
Retrieves the viewing player's formatted rank for this variant, if any. Note that this value is only accurate if HasPlayerInfo returns True.
- DisplayPlayerScore As String [read only]
Retrieves the viewing player's score for this variant, if any. Note that this value is only accurate if HasPlayerInfo returns True.
- NumScores As Long [read only]
Retrieves the total number of scores for this variant. Not all of these scores will always be present on the local device. Note that if scores for this variant have not been loaded, this function will return NUM_SCORES_UNKNOWN.
- PlayerRank As Long [read only]
Retrieves the viewing player's rank for this variant, if any. Note that this value is only accurate if HasPlayerInfo returns True.
This function returns PLAYER_RANK_UNKNOWN if the player has no rank for this variant.
- PlayerScoreTag As String [read only]
Retrieves the viewing player's score tag for this variant, if any. Note that this value is only accurate if HasPlayerInfo returns True.
- RawPlayerScore As Long [read only]
Retrieves the viewing player's score for this variant, if any. Note that this value is only accurate if HasPlayerInfo returns True.
- TimeSpan As Int [read only]
Retrieves the time span that the scores for this variant are drawn from. Possible values are TIME_SPAN_ALL_TIME, TIME_SPAN_WEEKLY, or TIME_SPAN_DAILY.
GPlayLeaderboards
Fields:
- COLLECTION_PUBLIC As Int
- COLLECTION_SOCIAL As Int
- PAGE_DIRECTION_NEXT As Int
- PAGE_DIRECTION_PREV As Int
- RESULTMAP_LEADERBOARD As String
- RESULTMAP_LEADERBOARDS As String
- RESULTMAP_PLAYER_SCORE As String
- RESULTMAP_SCORE_BUFFER As String
- RESULTMAP_SCORE_DATA As String
- RESULTMAP_SCORES As String
- RESULTMAP_STATUS_CODE As String
- STATUS_OK As Int
- TIME_SPAN_ALL_TIME As Int
- TIME_SPAN_DAILY As Int
- TIME_SPAN_WEEKLY As Int
Functions:
- GetAllLeaderboardsIntent As android.content.Intent
Gets an intent to show the list of leaderboards for a game. This intent must be invoked with StartActivityForResult.
A RESULT_RECONNECT_REQUIRED may be returned as the result code in the onActivityResult event if the Google API client ends up in an inconsistent state.
- GetLeaderboardIntent (LeaderboardId As String) As android.content.Intent
Gets an intent to show a leaderboard for a game. This intent must be invoked with StartActivityForResult.
A RESULT_RECONNECT_REQUIRED may be returned as the result code in the onActivityResult event if the Google API client ends up in an inconsistent state.
LeaderboardId: The ID of the leaderboard to view.
- Initialize
- IsInitialized As Boolean
- LoadCurrentPlayerLeaderboardScore (LeaderboardId As String, Span As Int, LeaderboardCollection As Int) As GPlayPendingResult
Asynchronously loads the currently signed in player's score for a given leaderboard.
LeaderboardId: ID of the leaderboard to load the score from.
Span: Time span to retrieve data for. Valid values are TIME_SPAN_DAILY, TIME_SPAN_WEEKLY, or TIME_SPAN_ALL_TIME.
LeaderboardCollection: The leaderboard collection to retrieve scores for. Valid values are either COLLECTION_PUBLIC or COLLECTION_SOCIAL.
- LoadLeaderboardMetadata (ForceReload As Boolean) As GPlayPendingResult
Asynchronously loads the list of leaderboard metadata for this game.
ForceReload: If True, this call will clear any locally cached data and attempt to fetch the latest data from the server. This would commonly be used for something like a user-initiated refresh. Normally, this should be set to False to gain advantages of data caching.
- LoadLeaderboardMetadata2 (LeaderboardId As String, ForceReload As Boolean) As GPlayPendingResult
Asynchronously loads a specific leaderboard's metadata for this game.
LeaderboardId: ID of the leaderboard to load metadata for.
ForceReload: If True, this call will clear any locally cached data and attempt to fetch the latest data from the server. This would commonly be used for something like a user-initiated refresh. Normally, this should be set to False to gain advantages of data caching.
- LoadMoreScores (ScoreBuffer As Object, MaxResults As Int, PageDirection As Int) As GPlayPendingResult
Asynchronously loads an additional page of score data for the given score buffer.
ScoreBuffer: A score buffer delivered by a call to LoadPlayerCenteredScores or LoadTopScores in the result map.
MaxResults: The maximum number of scores to fetch per page. Must be between 1 and 25. Note that the number of scores returned here may be greater than this value, depending on how much data is cached on the device.
PageDirection: The direction to expand the list (one of the PAGE_DIRECTION constants).
- LoadPlayerCenteredScores (LeaderboardId As String, Span As Int, LeaderboardCollection As Int, MaxResults As Int) As GPlayPendingResult
Asynchronously loads the player-centered page of scores for a given leaderboard. If the player does not have a score on this leaderboard, this call will return the top page instead.
LeaderboardId: ID of the leaderboard.
Span: Time span to retrieve data for. Valid values are TIME_SPAN_DAILY, TIME_SPAN_WEEKLY, or TIME_SPAN_ALL_TIME.
LeaderboardCollection: The leaderboard collection to retrieve scores for. Valid values are either COLLECTION_PUBLIC or COLLECTION_SOCIAL.
MaxResults: The maximum number of scores to fetch per page. Must be between 1 and 25.
- LoadPlayerCenteredScores2 (LeaderboardId As String, Span As Int, LeaderboardCollection As Int, MaxResults As Int, ForceReload As Boolean) As GPlayPendingResult
Asynchronously loads the player-centered page of scores for a given leaderboard. If the player does not have a score on this leaderboard, this call will return the top page instead.
LeaderboardId: ID of the leaderboard.
Span: Time span to retrieve data for. Valid values are TIME_SPAN_DAILY, TIME_SPAN_WEEKLY, or TIME_SPAN_ALL_TIME.
LeaderboardCollection: The leaderboard collection to retrieve scores for. Valid values are either COLLECTION_PUBLIC or COLLECTION_SOCIAL.
MaxResults: The maximum number of scores to fetch per page. Must be between 1 and 25.
ForceReload: If True, this call will clear any locally cached data and attempt to fetch the latest data from the server. This would commonly be used for something like a user-initiated refresh. Normally, this should be set to False to gain advantages of data caching.
- LoadTopScores (LeaderboardId As String, Span As Int, LeaderboardCollection As Int, MaxResults As Int) As GPlayPendingResult
Asynchronously loads the top page of scores for a given leaderboard.
LeaderboardId: ID of the leaderboard.
Span: Time span to retrieve data for. Valid values are TIME_SPAN_DAILY, TIME_SPAN_WEEKLY, or TIME_SPAN_ALL_TIME.
LeaderboardCollection: The leaderboard collection to retrieve scores for. Valid values are either COLLECTION_PUBLIC or COLLECTION_SOCIAL.
MaxResults: The maximum number of scores to fetch per page. Must be between 1 and 25.
- LoadTopScores2 (LeaderboardId As String, Span As Int, LeaderboardCollection As Int, MaxResults As Int, ForceReload As Boolean) As GPlayPendingResult
Asynchronously loads the top page of scores for a given leaderboard.
LeaderboardId: ID of the leaderboard.
Span: Time span to retrieve data for. Valid values are TIME_SPAN_DAILY, TIME_SPAN_WEEKLY, or TIME_SPAN_ALL_TIME.
LeaderboardCollection: The leaderboard collection to retrieve scores for. Valid values are either COLLECTION_PUBLIC or COLLECTION_SOCIAL.
MaxResults: The maximum number of scores to fetch per page. Must be between 1 and 25.
ForceReload: If True, this call will clear any locally cached data and attempt to fetch the latest data from the server. This would commonly be used for something like a user-initiated refresh. Normally, this should be set to False to gain advantages of data caching.
- SubmitScore (LeaderboardId As String, Score As Long)
Submits a score to a leaderboard for the currently signed in player. The score is ignored if it is worse (as defined by the leaderboard configuration) than a previously submitted score for the same player.
Use this function if you do not need to be notified of the results of submitting the score, though note that the update may not be sent to the server until the next sync.
The meaning of the score value depends on the formatting of the leaderboard established in the developer console. Leaderboards support the following score formats:
- Fixed-point: Score represents a raw value, and will be formatted based on the number of decimal places configured. A score of 1000 would be formatted as 1000, 100.0, or 10.00 for 0, 1, or 2 decimal places.
- Time: Score represents an elapsed time in milliseconds. The value will be formatted as an appropriate time value.
- Currency: Score represents a value in micro units. For example, in USD, a score of 100 would display as $0.0001, while a score of 1000000 would display as $1.00
LeaderboardId: The leaderboard to submit the score to.
Score: The raw score value.
- SubmitScore2 (LeaderboardId As String, Score As Long, ScoreTag As String)
Submits a score to a leaderboard for the currently signed in player. The score is ignored if it is worse (as defined by the leaderboard configuration) than a previously submitted score for the same player.
Use this function if you do not need to be notified of the results of submitting the score, though note that the update may not be sent to the server until the next sync.
The meaning of the score value depends on the formatting of the leaderboard established in the developer console. Leaderboards support the following score formats:
- Fixed-point: Score represents a raw value, and will be formatted based on the number of decimal places configured. A score of 1000 would be formatted as 1000, 100.0, or 10.00 for 0, 1, or 2 decimal places.
- Time: Score represents an elapsed time in milliseconds. The value will be formatted as an appropriate time value.
- Currency: Score represents a value in micro units. For example, in USD, a score of 100 would display as $0.0001, while a score of 1000000 would display as $1.00
LeaderboardId: The leaderboard to submit the score to.
Score: The raw score value.
ScoreTag: Metadata about this score. The value may contain no more than 64 URI-safe characters as defined by section 2.3 of RFC 3986.
- SubmitScoreImmediate (LeaderboardId As String, Score As Long) As GPlayPendingResult
Submits a score to a leaderboard for the currently signed in player. The score is ignored if it is worse (as defined by the leaderboard configuration) than a previously submitted score for the same player.
This function will attempt to submit the score to the server immediately, and will return a PendingResult with information about the submission.
The meaning of the score value depends on the formatting of the leaderboard established in the developer console. Leaderboards support the following score formats:
- Fixed-point: Score represents a raw value, and will be formatted based on the number of decimal places configured. A score of 1000 would be formatted as 1000, 100.0, or 10.00 for 0, 1, or 2 decimal places.
- Time: Score represents an elapsed time in milliseconds. The value will be formatted as an appropriate time value.
- Currency: Score represents a value in micro units. For example, in USD, a score of 100 would display as $0.0001, while a score of 1000000 would display as $1.00
LeaderboardId: The leaderboard to submit the score to.
Score: The raw score value.
- SubmitScoreImmediate2 (LeaderboardId As String, Score As Long, ScoreTag As String) As GPlayPendingResult
Submits a score to a leaderboard for the currently signed in player. The score is ignored if it is worse (as defined by the leaderboard configuration) than a previously submitted score for the same player.
This function will attempt to submit the score to the server immediately, and will return a PendingResult with information about the submission.
The meaning of the score value depends on the formatting of the leaderboard established in the developer console. Leaderboards support the following score formats:
- Fixed-point: Score represents a raw value, and will be formatted based on the number of decimal places configured. A score of 1000 would be formatted as 1000, 100.0, or 10.00 for 0, 1, or 2 decimal places.
- Time: Score represents an elapsed time in milliseconds. The value will be formatted as an appropriate time value.
- Currency: Score represents a value in micro units. For example, in USD, a score of 100 would display as $0.0001, while a score of 1000000 would display as $1.00
LeaderboardId: The leaderboard to submit the score to.
Score: The raw score value.
ScoreTag: Metadata about this score. The value may contain no more than 64 URI-safe characters as defined by section 2.3 of RFC 3986.
GPlayLoadMatchesResponse
Functions:
- Close
Releases all the buffers stored in this response. Call this function only when you no longer need the data of this response.
- HasData As Boolean
Returns whether or not this response contains any non-empty buffers.
- IsInitialized As Boolean
Properties:
- CompletedMatches As GPlayTurnBasedMatch() [read only]
Gets the completed matches returned from this request. Note that if the original request did not include MATCH_TURN_STATUS_COMPLETE, this function will return Null.
- Invitations As GPlayInvitation() [read only]
Gets the invitations returned from this request. Note that if the original request did not include MATCH_TURN_STATUS_INVITED, this function will return Null.
- MyTurnMatches As GPlayTurnBasedMatch() [read only]
Gets the "my turn" matches returned from this request. Note that if the original request did not include MATCH_TURN_STATUS_MY_TURN, this function will return Null.
- TheirTurnMatches As GPlayTurnBasedMatch() [read only]
Gets the "their turn" matches returned from this request. Note that if the original request did not include MATCH_TURN_STATUS_THEIR_TURN, this function will return Null.
GPlayNearbyConnections
Events:
- onAcceptConnectionRequest (ErrorCode As Int)
- onConnectionRequest (EndpointId As String, DeviceId As String, EndpointName As String, Message() As Byte)
- onConnectionResponse (ErrorCode As Int, EndpointId As String, Message() As Byte)
- onDisconnected (EndpointId As String)
- onEndpointFound (EndpointId As String, DeviceId As String, AppId As String, EndpointName As String)
- onEndpointLost (EndpointId As String)
- onMessageReceived (EndpointId As String, Message() As Byte, IsReliable As Boolean)
- onRejectConnectionRequest (ErrorCode As Int)
- onSendConnectionRequest (ErrorCode As Int)
- onStartAdvertising (ErrorCode As Int, LocalEndpointName As String)
- onStartDiscovery (ErrorCode As Int)
Fields:
- DURATION_INDEFINITE As Long
- MAX_RELIABLE_MESSAGE_LEN As Int
- MAX_UNRELIABLE_MESSAGE_LEN As Int
- STATUS_ALREADY_ADVERTISING As Int
- STATUS_ALREADY_CONNECTED_TO_ENDPOINT As Int
- STATUS_ALREADY_DISCOVERING As Int
- STATUS_CONNECTION_REJECTED As Int
- STATUS_ERROR As Int
- STATUS_NETWORK_NOT_CONNECTED As Int
- STATUS_NOT_CONNECTED_TO_ENDPOINT As Int
- STATUS_OK As Int
Functions:
- AcceptConnectionRequest (RemoteEndpointId As String, Message As Byte())
Accepts a connection request from a remote endpoint. This method must be called before messages can be received from the remote endpoint.
RemoteEndpointId: The identifier for the remote endpoint that sent the connection request. Should match the value provided by the onConnectionRequest event.
Message: Bytes of a custom message to send with the connection response. This message must not exceed MAX_RELIABLE_MESSAGE_LEN bytes in length. May be Null.
- DisconnectFromEndpoint (RemoteEndpointId As String)
Disconnects from a remote endpoint. Messages can no longer be sent to or received from the endpoint after this method is called.
- GetStatusCodeString (StatusCode As Int) As String
Returns an untranslated debug (not user-friendly!) string based on the specified status code.
- Initialize (EventPrefix As String)
Initializes the GPlayNearbyConnections object.
EventPrefix: Prefix of events.
- IsInitialized As Boolean
- RejectConnectionRequest (RemoteEndpointId As String)
Rejects a connection request from a remote endpoint.
RemoteEndpointId: The identifier for the remote endpoint that sent the connection request. Should match the value provided by the onConnectionRequest event.
- SendConnectionRequest (RemoteEndpointId As String, Message As Byte())
Sends a request to connect to a remote endpoint.
RemoteEndpointId: The identifier for the remote endpoint to which a connection request will be sent. Should match the value provided by the onEndpointFound event.
Message: Bytes of a custom message to send with the connection request. This message must not exceed MAX_RELIABLE_MESSAGE_LEN bytes in length. May be Null.
- SendReliableMessage (RemoteEndpointId As String, Message As Byte())
Sends a message to a remote endpoint using a reliable protocol. Reliable messages will be retried until delivered, and are delivered in the order they were sent to a given endpoint. Messages can only be sent to remote endpoints once a connection request was first sent and accepted (in either direction).
RemoteEndpointId: The identifier for the remote endpoint to which the message should be sent.
Message: The bytes of the message to send to the remote endpoint. This message must not exceed MAX_RELIABLE_MESSAGE_LEN bytes in length.
- SendReliableMessage2 (RemoteEndpointIds As List, Message As Byte())
Sends a message to a list of remote endpoints using a reliable protocol. Reliable messages will be retried until delivered, and are delivered in the order they were sent to a given endpoint. Messages can only be sent to remote endpoints once a connection request was first sent and accepted (in either direction).
RemoteEndpointIds: The list of identifiers for the remote endpoints to which the message should be sent.
Message: The bytes of the message to send to the remote endpoints. This message must not exceed MAX_RELIABLE_MESSAGE_LEN bytes in length.
- SendUnreliableMessage (RemoteEndpointId As String, Message As Byte())
Sends a message to a remote endpoint using an unreliable protocol. Unreliable messages may be dropped or delivered out of order. Messages can only be sent to remote endpoints once a connection request was first sent and accepted (in either direction).
RemoteEndpointId: The identifier for the remote endpoint to which the message should be sent.
Message: The bytes of the message to send to the remote endpoint. This message must not exceed MAX_UNRELIABLE_MESSAGE_LEN bytes in length.
- SendUnreliableMessage2 (RemoteEndpointIds As List, Message As Byte())
Sends a message to a list of remote endpoints using an unreliable protocol. Unreliable messages may be dropped or delivered out of order. Messages can only be sent to remote endpoints once a connection request was first sent and accepted (in either direction).
RemoteEndpointIds: The list of identifiers for the remote endpoints to which the message should be sent.
Message: The bytes of the message to send to the remote endpoints. This message must not exceed MAX_UNRELIABLE_MESSAGE_LEN bytes in length.
- StartAdvertising (DurationMillis As Long)
Starts advertising a local endpoint for this app.
DurationMillis: The duration of the advertisement in milliseconds, unless StopAdvertising is called first. If DURATION_INDEFINITE is passed in, the advertisement will continue indefinitely until StopAdvertising is called.
- StartDiscovery (DurationMillis As Long)
Starts discovery for remote endpoints.
DurationMillis: The duration of discovery in milliseconds, unless StopDiscovery is called first. If DURATION_INDEFINITE is passed in, discovery will continue indefinitely until StopDiscovery is called.
- StopAdvertising
Stops advertising a local endpoint. Should be called after calling StartAdvertising as soon as the application no longer needs to advertise itself or goes inactive. Messages can still be sent to remote endpoints after advertising ends.
- StopAllEndPoints
Stops advertising and discovery and disconnects from all endpoints.
- StopDiscovery
Stops discovery for remote endpoints. Should be called after calling StartDiscovery as soon as the client no longer needs to discover endpoints or goes inactive. Messages can still be sent to remote endpoints after discovery ends.
Properties:
- LocalDeviceId As String [read only]
Returns the ID of the device, used when communicating with other devices. This identifier will be the same for all clients on this device, and will be stable across reboots of the device.
- LocalEndpointId As String [read only]
Returns the ID of the local endpoint, used when communicating with other devices. This identifier will be different for each Google API client.
GPlayNetworkInfo
Events:
- onConnectivityChange (NetworkType As Int, IsConnectedOrConnecting As Boolean)
Fields:
- NETWORK_BLUETOOTH As Int
- NETWORK_ETHERNET As Int
- NETWORK_MOBILE As Int
- NETWORK_NONE As Int
- NETWORK_VPN As Int
- NETWORK_WIFI As Int
- NETWORK_WIMAX As Int
Functions:
- Initialize
- IsConnected As Boolean
Returns whether the currently active default data network is connected.
- IsFailover As Boolean
Indicates whether the current attempt to connect to the network resulted from the connectivity manager trying to fail over to this network following a disconnect from another network.
- IsInitialized As Boolean
- IsRoaming (NetworkType As Int) As Boolean
Indicates whether the device is currently roaming on the given network.
- RegisterConnectivityChangeListener
Registers a listener to be notified of connectivy changes.
The onConnectivityChange events will return the type of network (one of the NETWORK constants) affected by the change and whether this network is connected or not.
- UnregisterConnectivityChangeListener
Stops the notification of connectivy changes.
Properties:
- ActiveNetwork As Int [read only]
Returns the type of the currently active default data network (one of the NETWORK constants).
- AllNetworkInfo As Map [read only]
Returns a map of all available networks. In the map, key = type of network (one of the NETWORK constants), value = whether it is connected.
- ConnectedNetwork As Int [read only]
Returns the type of the connected network (one of the NETWORK constants).
- ConnectingNetwork As Int [read only]
Returns the type of the network in the process of establishing a connection (one of the NETWORK constants).
GPlayNotifications
Fields:
- NOTIFICATION_TYPE_INVITATION As Int
- NOTIFICATION_TYPE_LEVEL_UP As Int
- NOTIFICATION_TYPE_MATCH_UPDATE As Int
- NOTIFICATION_TYPE_QUEST As Int
- NOTIFICATION_TYPE_REQUEST As Int
- NOTIFICATION_TYPES_ALL As Int
- NOTIFICATION_TYPES_MULTIPLAYER As Int
Functions:
- Clear (NotificationTypes As Int)
Clears the notifications of the specified type for the current game and signed-in player. This should be a mask comprised of values from the NOTIFICATION constants.
- ClearAll
Clears all notifications for the current game and signed-in player.
- Initialize
- IsInitialized As Boolean
GPlayParticipant
Events:
- onImageLoaded (URI As String, Drawable As BitmapDrawable)
Fields:
- STATUS_DECLINED As Int
- STATUS_FINISHED As Int
- STATUS_INVITED As Int
- STATUS_JOINED As Int
- STATUS_LEFT As Int
- STATUS_NOT_INVITED_YET As Int
- STATUS_UNRESPONSIVE As Int
Functions:
- GetHiResImage (ImageView As ImageView) As String
Loads the hi-res image to display for this participant and fills the given ImageView.
Returns the URI of the image. If the identity of the player is unknown, this will be an empty string. It may also be an empty string if the player simply has no image.
- GetHiResImage2 As String
Loads the hi-res image to display for this participant and raises an onImageLoaded event when the load is complete.
Returns the URI of the image. If the identity of the player is unknown, this will be an empty string. It may also be an empty string if the player simply has no image.
- GetIconImage (ImageView As ImageView) As String
Loads the icon-sized image to display for this participant and fills the given ImageView.
Returns the URI of the image. If the identity of the player is unknown, this will be the automatch avatar icon image for the player. It may also be an empty string if the player simply has no image.
- GetIconImage2 As String
Loads the icon-sized image to display for this participant and raises an onImageLoaded event when the load is complete.
Returns the URI of the image. If the identity of the player is unknown, this will be the automatch avatar icon image for the player. It may also be an empty string if the player simply has no image.
- IsConnectedToRoom As Boolean
Retrieves the connected status of the participant. If True indicates that participant is in the connected set of the room. Only applies to room participants.
- IsInitialized As Boolean
Properties:
- DisplayName As String [read only]
Returns the name to display for this participant. If the identity of the player is unknown, this will be a generic handle to describe the player.
- ParticipantId As String [read only]
Returns the ID of this participant. Note that this is only valid for use in the current multiplayer room or match: a participant will not have the same ID across multiple rooms or matches.
- Player As GPlayPlayer [read only]
Returns the Player object corresponding to this participant. Note that this may be Null if the identity of the player is unknown. This occurs in automatching scenarios where some players are not permitted to see the real identity of others.
- Result As GPlayParticipantResult [read only]
Returns the ParticipantResult associated with this participant, if any. Only applies to turn-based match participants.
- Status As Int [read only]
Retrieves the status of this participant.
Possible status values for room participants are STATUS_INVITED, STATUS_JOINED, STATUS_DECLINED, and STATUS_LEFT.
Possible status values for turn-based match participants are all of the above, STATUS_NOT_INVITED_YET, STATUS_FINISHED, and STATUS_UNRESPONSIVE.
GPlayParticipantResult
Fields:
- MATCH_RESULT_DISAGREED As Int
- MATCH_RESULT_DISCONNECT As Int
- MATCH_RESULT_LOSS As Int
- MATCH_RESULT_NONE As Int
- MATCH_RESULT_TIE As Int
- MATCH_RESULT_UNINITIALIZED As Int
- MATCH_RESULT_WIN As Int
- PLACING_UNINITIALIZED As Int
Functions:
- Initialize (ParticipantId As String, Result As Int, Placing As Int)
Creates a ParticipantResult object.
ParticipantId: The ID of the participant this result is for.
Result: The result type for this participant in the match (one of the MATCH_RESULT constants).
Placing: The placing of this participant in the match. Use PLACING_UNINITIALIZED to indicate that no placing should be reported.
- IsInitialized As Boolean
Properties:
- ParticipantId As String [read only]
Returns the ID of the participant this result is for.
- Placing As Int [read only]
Returns the placing of this participant in the match. PLACING_UNINITIALIZED means that this result has no placing value to report.
- Result As Int [read only]
Returns the result type for this participant in the match (one of the MATCH_RESULT constants).
GPlayPendingResult
Fields:
- RESULTMAP_ACHIEVEMENT_ID As String
- RESULTMAP_ACHIEVEMENTS As String
- RESULTMAP_INVITATIONS As String
- RESULTMAP_LEADERBOARD As String
- RESULTMAP_LEADERBOARDS As String
- RESULTMAP_MATCH As String
- RESULTMAP_MATCH_ID As String
- RESULTMAP_MATCHES As String
- RESULTMAP_PLAYER_SCORE As String
- RESULTMAP_PLAYER_STATS As String
- RESULTMAP_PLAYERS As String
- RESULTMAP_SCORE_BUFFER As String
- RESULTMAP_SCORE_DATA As String
- RESULTMAP_SCORES As String
- RESULTMAP_SNAPSHOT As String
- RESULTMAP_SNAPSHOT_CONFLICT_ID As String
- RESULTMAP_SNAPSHOT_CONFLICTING_WITH As String
- RESULTMAP_SNAPSHOT_ID As String
- RESULTMAP_SNAPSHOT_METADATA As String
- RESULTMAP_SNAPSHOTS As String
- RESULTMAP_STATUS_CODE As String
Functions:
- Await As Map
Blocks until the task is completed. This is not allowed on the UI thread.
- Await2 (TimeOut As Long) As Map
Blocks until the task is completed or has timed out waiting for the result. This is not allowed on the UI thread.
TimeOut: In milliseconds.
- Cancel
Requests that the pending result be canceled. If the result is available, but not consumed it will be released. If the result is set after cancellation was requested it is immediately released.
- IsCanceled As Boolean
Indicates whether the pending result has been canceled either due to calling Disconnect or calling Cancel directly on the pending result.
- SetResultEvent (EventName As String)
Sets the name of the event that will receive the result.
The event must be declared like this: Sub <EventName>(Result As Map)
- SetResultEvent2 (EventName As String, TimeOut As Long)
Sets the name of the event that will receive the result.
The event must be declared like this: Sub <EventName>(Result As Map)
TimeOut: In milliseconds.
GPlayPlayer
Events:
- onImageLoaded (URI As String, Drawable As BitmapDrawable)
Fields:
- CURRENT_XP_UNKNOWN As Long
- TIMESTAMP_UNKNOWN As Long
Functions:
- GetBannerImage (ImageView As ImageView, Landscape As Boolean) As String
Loads this player's banner image and fills the given ImageView.
Returns the URI of the image, or an empty string if the player has none.
Landscape: Whether the image is the landscape banner image (True) or the portrait banner image (False).
- GetBannerImage2 (Landscape As Boolean) As String
Loads this player's banner image and raises an onImageLoaded event when the load is complete.
Returns the URI of the image, or an empty string if the player has none.
Landscape: Whether the image is the landscape banner image (True) or the portrait banner image (False).
- GetHiResImage (ImageView As ImageView) As String
Loads this player's hi-res profile image and fills the given ImageView.
Returns the URI of the image, or an empty string if the player has none.
- GetHiResImage2 As String
Loads this player's hi-res profile image and raises an onImageLoaded event when the load is complete.
Returns the URI of the image, or an empty string if the player has none.
- GetIconImage (ImageView As ImageView) As String
Loads the player's icon-size profile image and fills the given ImageView.
Returns the URI of the image, or an empty string if the player has none.
- GetIconImage2 As String
Loads the player's icon-size profile image and raises an onImageLoaded event when the load is complete.
Returns the URI of the image, or an empty string if the player has none.
- HasHiResImage As Boolean
Indicates whether this player has a hi-res profile image to display.
- HasIconImage As Boolean
Indicates whether this player has an icon-size profile image to display.
- IsInitialized As Boolean
Properties:
- DisplayName As String [read only]
Retrieves the display name for this player.
- LastPlayedWithTimestamp As Long [read only]
Retrieves the timestamp (in ms since epoch) at which this player last played a multiplayer game with the currently signed in user. If the timestamp is not found, this function returns TIMESTAMP_UNKNOWN.
- LevelInfo As GPlayPlayerLevelInfo [read only]
Retrieves the player level associated information if any exists. If no level information exists for this player, this function will return null.
- PlayerId As String [read only]
Retrieves the ID of this player.
- RetrievedTimestamp As Long [read only]
Retrieves the timestamp (in ms since epoch) at which the player data was last updated locally.
- Title As String [read only]
Retrieves the title of the player. This is based on the player's gameplay activity in apps using Google Play Games services. Note that not all players have titles, and that a player's title may change over time.
GPlayPlayerLevel
Functions:
- Equals (obj As Object) As Boolean
- IsInitialized As Boolean
Properties:
- LevelNumber As Int [read only]
Returns the number for this level, e.g. "level 10".
For a player to be considered as being of this level, the value given by GPlayPlayerLevelInfo.CurrentXpTotal must fall in the range MinXP...MaxXP.
- MaxXP As Long [read only]
Returns the maximum XP value represented by this level, exclusive.
- MinXP As Long [read only]
Returns the minimum XP value needed to attain this level, inclusive.
GPlayPlayerLevelInfo
Functions:
- Equals (obj As Object) As Boolean
- IsInitialized As Boolean
- IsMaxLevel As Boolean
Returns True if the player reached the maximum level (CurrentLevel is the same as NextLevel).
Properties:
- CurrentLevel As GPlayPlayerLevel [read only]
Gets the player's current level object. This object will be the same as the one returned from NextLevel if the player reached the maximum level.
- CurrentXpTotal As Long [read only]
Returns the player's current XP value.
- LastLevelUpTimestamp As Long [read only]
Returns the timestamp of the player's last level-up.
- NextLevel As GPlayPlayerLevel [read only]
Gets the player's next level object. This object will be the same as the one returned from CurrentLevel if the player reached the maximum level.
GPlayPlayerStats
Fields:
- UNSET_VALUE As Float
The default value for each field when there isn't enough data to calculate.
Functions:
Properties:
- AverageSessionLength As Float [read only]
Returns the average session length of the player in minutes, or UNSET_VALUE. Session length is determined by the time that a player is signed in to Google Play Games services.
- ChurnProbability As Float [read only]
Returns the approximate probability of the player not returning to play the game (a decimal number between 0 and 1), or UNSET_VALUE. Higher values indicate that a player is less likely to return.
- DaysSinceLastPlayed As Int [read only]
Returns the approximate number of days since the player last played, or UNSET_VALUE.
- NumberOfPurchases As Int [read only]
Returns the approximate number of in-app purchases for the player, or UNSET_VALUE.
- NumberOfSessions As Int [read only]
Returns the approximate number of sessions of the player, or UNSET_VALUE. Sessions are determined by the number of times that a player signs in to Google Play Games services.
- SessionPercentile As Float [read only]
Returns the approximation of sessions percentile for the player (a decimal number between 0 and 1), or UNSET_VALUE. This value indicates how many sessions the current player has played in comparison to the rest of this game's player base. Higher numbers indicate that this player has played more sessions.
- SpendPercentile As Float [read only]
Returns the approximate spend percentile of the player (a decimal number between 0 and 1), or UNSET_VALUE. This value indicates how much the current player has spent in comparison to the rest of this game's player base. Higher numbers indicate that this player has spent more.
- SpendProbability As Float [read only]
Returns the approximate probability of the player choosing to spend in this game (a decimal number between 0 and 1), or UNSET_VALUE. Higher values indicate that a player is more likely to spend.
GPlayPlayers
Fields:
- EXTRA_PLAYER_SEARCH_RESULTS As String
- RESULTMAP_PLAYERS As String
- RESULTMAP_STATUS_CODE As String
Functions:
- GetCompareProfileIntent (Player As GPlayPlayer) As android.content.Intent
Returns an intent that will display a screen where the user can compare themself against another player's profile. This intent must be invoked with StartActivityForResult.
- GetPlayerFromIntentExtra (Intent As android.content.Intent) As GPlayPlayer
Retrieves a player from the extended data (EXTRA_PLAYER_SEARCH_RESULTS) of the given intent.
- GetPlayerSearchIntent As android.content.Intent
Returns an intent that will display a screen where the user can search for people on Google+. This intent must be invoked with StartActivityForResult.
If the user canceled, the result code will be ACTIVITY_RESULT_CANCELED. If the user selected any player from the search results list, the result code will be ACTIVITY_RESULT_OK, and the data intent will contain a Player object in EXTRA_PLAYER_SEARCH_RESULTS (that you can retrieve with GetPlayerFromIntentExtra).
- Initialize
- IsInitialized As Boolean
- LoadConnectedPlayers (ForceReload As Boolean) As GPlayPendingResult
Asynchronously loads a list of players that have connected to this game (and that the user has permission to know about).
ForceReload: If True, this call will clear any locally cached data and attempt to fetch the latest data from the server. This would commonly be used for something like a user-initiated refresh. Normally, this should be set to False to gain advantages of data caching.
- LoadInvitablePlayers (PageSize As Int, ForceReload As Boolean) As GPlayPendingResult
Loads the initial page of players the currently signed-in player can invite to a multiplayer game, sorted alphabetically by name.
PageSize: The number of entries to request for this initial page. Note that if cached data already exists, the returned buffer may contain more than this size, but it is guaranteed to contain at least this many if the collection contains enough records. This must be a value between 1 and 25.
ForceReload: If True, this call will clear any locally cached data and attempt to fetch the latest data from the server. This would commonly be used for something like a user-initiated refresh. Normally, this should be set to False to gain advantages of data caching.
- LoadMoreInvitablePlayers (PageSize As Int) As GPlayPendingResult
Asynchronously loads an additional page of invitable players.
PageSize: The number of additional entries to request. This must be a value between 1 and 25.
- LoadMoreRecentlyPlayedWithPlayers (PageSize As Int) As GPlayPendingResult
Asynchronously loads an additional page of players that the signed-in player has played multiplayer games with recently.
PageSize: The number of additional entries to request. This must be a value between 1 and 25.
- LoadPlayer (PlayerId As String) As GPlayPendingResult
Loads the profile for the requested player ID.
PlayerId: The player ID to get full profile data for.
- LoadRecentlyPlayedWithPlayers (PageSize As Int, ForceReload As Boolean) As GPlayPendingResult
Loads the initial page of players the currently signed-in player has played multiplayer games with recently, starting with the most recent.
PageSize: The number of entries to request for this initial page. Note that if cached data already exists, the returned buffer may contain more than this size, but it is guaranteed to contain at least this many if the collection contains enough records. This must be a value between 1 and 25.
ForceReload: If True, this call will clear any locally cached data and attempt to fetch the latest data from the server. This would commonly be used for something like a user-initiated refresh. Normally, this should be set to False to gain advantages of data caching.
Properties:
- CurrentPlayer As GPlayPlayer [read only]
Returns the Player object representing the currently signed in player. May be null if an error occurred while communicating with the games service.
- CurrentPlayerId As String [read only]
Returns the player ID for the currently signed in player. May be an empty string if an error occurred while communicating with the games service.
GPlayRealTimeMessage
Functions:
- IsInitialized As Boolean
- IsReliable As Boolean
Returns whether this message was sent over a reliable channel.
Properties:
- MessageData As Byte() [read only]
- SenderParticipantId As String [read only]
Returns the participant ID of the message sender.
GPlayRealTimeMultiplayer
Events:
- onConnectedToRoom (Room As GPlayRoom)
- onDisconnectedFromRoom (Room As GPlayRoom)
- onJoinedRoom (StatusCode As Int, Room As GPlayRoom)
- onLeftRoom (StatusCode As Int, RoomId As String)
- onP2PConnected (ParticipantId As String)
- onP2PDisconnected (ParticipantId As String)
- onPeerDeclined (Room As GPlayRoom, ParticipantIds As List)
- onPeerJoined (Room As GPlayRoom, ParticipantIds As List)
- onPeerLeft (Room As GPlayRoom, ParticipantIds As List)
- onPeersConnected (Room As GPlayRoom, ParticipantIds As List)
- onPeersDisconnected (Room As GPlayRoom, ParticipantIds As List)
- onRealTimeMessageReceived (Message As GPlayRealTimeMessage)
- onRealTimeMessageSent (StatusCode As Int, TokenId As Int, RecipientParticipantId As String)
- onRoomAutoMatching (Room As GPlayRoom)
- onRoomConnected (StatusCode As Int, Room As GPlayRoom)
- onRoomConnecting (Room As GPlayRoom)
- onRoomCreated (StatusCode As Int, Room As GPlayRoom)
Fields:
- EXTRA_INVITATION As String
- EXTRA_MAX_AUTOMATCH_PLAYERS As String
- EXTRA_MIN_AUTOMATCH_PLAYERS As String
- EXTRA_PLAYER_IDS As String
- EXTRA_ROOM As String
- MAX_RELIABLE_MESSAGE_LEN As Int
- MAX_UNRELIABLE_MESSAGE_LEN As Int
- SEND_STATUS_FAILED As Int
Return value indicating immediate failure.
- SEND_STATUS_OK As Int
- STATUS_CONNECTION_FAILED As Int
Failed to initialize the network connection for a real-time room.
- STATUS_INACTIVE_ROOM As Int
The room is not currently active.
- STATUS_INTERNAL_ERROR As Int
An unspecified error occurred; no more specific information is available.
- STATUS_INVALID_ROOM_ID As Int
Indicates that the real-time room ID provided to the operation was not valid, or does not correspond to the currently active real-time room.
- STATUS_MESSAGE_SEND_FAILED As Int
Failed to send message to the peer participant for a real-time room.
- STATUS_OK As Int
- STATUS_ROOM_NOT_JOINED As Int
Failed to send message to the peer participant for a real-time room, since the user has not joined the room.
Functions:
- Create (Config As GPlayRoomConfig)
Creates a real-time room for the current game. The lifetime of the current game's connection to the room is bound to the Google API client's lifecycle. When the client disconnects, the player will leave the room and any peer-to-peer connections for this player will be torn down.
Config: The configuration parameters for the room to create.
- DeclineInvitation (InvitationId As String)
Declines an invitation for a real-time room.
InvitationId: The ID of the invitation to decline.
- DismissInvitation (InvitationId As String)
Dismisses an invitation to a real-time room. Dismissing an invitation will not change the state of the room for the other participants.
InvitationId: The ID of the invitation to dismiss.
- GetInvitationFromIntentExtra (Intent As android.content.Intent) As GPlayInvitation
Retrieves an invitation from the extended data (EXTRA_INVITATION) of the given intent.
- GetInvitationInboxIntent As android.content.Intent
Returns an intent that will let the user see and manage any outstanding invitations. This intent must be invoked with StartActivityForResult.
If the user canceled, the result code will be ACTIVITY_RESULT_CANCELED. If the user selected an invitation to accept, the result code will be ACTIVITY_RESULT_OK and the data intent will contain the selected invitation in the extras (EXTRA_INVITATION).
- GetPlayerIDsFromIntentExtra (Intent As android.content.Intent) As Object
Retrieves a list of player IDs from the extended data (EXTRA_PLAYER_IDS) of the given intent. Returns Null if the list is empty.
- GetSelectOpponentsIntent (MinPlayers As Int, MaxPlayers As Int, AllowAutomatch As Boolean) As android.content.Intent
Returns an intent that will let the user select opponents to send an invitation for a real-time multiplayer match. This intent must be invoked with StartActivityForResult.
The number of players passed in should be the desired number of additional players to select, not including the current player. So, for a game that can handle between 2 and 4 players, MinPlayers would be 1 and MaxPlayers would be 3.
If the user canceled, the result will be ACTIVITY_RESULT_CANCELED. If the user selected players, the result code will be ACTIVITY_RESULT_OK, and the data intent will contain the selected player IDs in EXTRA_PLAYER_IDS and the minimum and maximum numbers of additional auto-match players in EXTRA_MIN_AUTOMATCH_PLAYERS and EXTRA_MAX_AUTOMATCH_PLAYERS respectively. The player IDs in EXTRA_PLAYER_IDS will include only the other players selected, not the current player.
If the AllowAutomatch parameter is set to False, the UI will not display an option for selecting automatch players. Set this to False if your game does not support automatching.
MinPlayers: The minimum number of players to select (not including the current player).
MaxPlayers: The maximum number of players to select (not including the current player).
AllowAutomatch: Whether or not to display an option for selecting automatch players.
- GetWaitingRoomIntent (Room As GPlayRoom, MinParticipantsToStart As Int) As android.content.Intent
Returns an intent that will display a "waiting room" screen that shows the progress of participants joining a real-time multiplayer room. This intent must be invoked with StartActivityForResult.
If the necessary number of peers have connected and it's now OK to start the game, or if the user explicitly asked to start the game now, the activity result code will be ACTIVITY_RESULT_OK. If the user bailed out of the waiting room screen without taking any action, the result will be ACTIVITY_RESULT_CANCELED. If the user explicitly chose to leave the room, the result will be ACTIVITY_RESULT_LEFT_ROOM. If the room no longer exists or is otherwise invalid, the result will be ACTIVITY_RESULT_INVALID_ROOM.
Regardless of what the result code was, the waiting room activity will return a data intent containing a Room object in EXTRA_ROOM that represents the current state of the room that you originally passed as a parameter here. Note that the returned room may be Null if the room no longer exists.
Room: The Room object to be displayed.
MinParticipantsToStart: The minimum number of participants that must be connected to the room (including the current player) for the "Start playing" menu item to become enabled.
- Initialize
- IsInitialized As Boolean
- Join (Config As GPlayRoomConfig)
Joins a real-time room by accepting an invitation. The lifetime of the current game's connection to the room is bound to the Google API client's lifecycle. When the client disconnects, the player will leave the room and any peer-to-peer connections for this player will be torn down.
Config: The configuration parameters for the room to join.
- Leave (RoomId As String)
Leaves the specified room. This will disconnect the player from the room, but allow other players to continue playing the game. After this function is called, you cannot perform any further actions on the room.
RoomId: ID of the room to leave.
- SendReliableMessage (RoomId As String, RecipientParticipantId As String, Message As Byte()) As Int
Sends a message to a participant in a real-time room reliably. Raises an onRealTimeMessageSent event to report the status of the send message operation. Returns the token ID for the message sent, or SEND_STATUS_FAILED if the message failed to send.
RoomId: ID of the room for which the message is being sent.
RecipientParticipantId: The participant ID to send the message to.
Message: The bytes of the message to be sent. This message must not exceed MAX_RELIABLE_MESSAGE_LEN bytes in length.
- SendUnreliableMessage (RoomId As String, RecipientParticipantId As String, Message As Byte()) As Int
Sends a message to a participant in a real-time room. The message delivery is not reliable and will not report status after completion. Returns SEND_STATUS_OK on a successful attempt, or SEND_STATUS_FAILED if the message failed to send.
RoomId: ID of the room for which the message is being sent.
RecipientParticipantId: The participant ID to send the message to.
Message: The bytes of the message to be sent. This message must not exceed MAX_UNRELIABLE_MESSAGE_LEN bytes in length.
- SendUnreliableMessage2 (RoomId As String, RecipientParticipantIds As List, Message As Byte()) As Int
Sends a message to one or more participants in a real-time room. The message delivery is not reliable and will not report status after completion. Returns SEND_STATUS_OK on a successful attempt, or SEND_STATUS_FAILED if the message failed to send.
RoomId: ID of the room for which the message is being sent.
RecipientParticipantIds: The list of participant IDs to send the message to.
Message: The bytes of the message to be sent. This message must not exceed MAX_UNRELIABLE_MESSAGE_LEN bytes in length.
- SendUnreliableMessageToOthers (RoomId As String, Message As Byte()) As Int
Sends a message to all participants in a real-time room, excluding the current player. The message delivery is not reliable and will not report status after completion. Returns SEND_STATUS_OK on a successful attempt, or SEND_STATUS_FAILED if the message failed to send.
RoomId: ID of the room for which the message is being sent.
Message: The bytes of the message to be sent. This message must not exceed MAX_UNRELIABLE_MESSAGE_LEN bytes in length.
GPlayRoom
Fields:
- PARTICIPANT_STATUS_DECLINED As Int
- PARTICIPANT_STATUS_INVITED As Int
- PARTICIPANT_STATUS_JOINED As Int
- PARTICIPANT_STATUS_LEFT As Int
- ROOM_STATUS_ACTIVE As Int
- ROOM_STATUS_AUTO_MATCHING As Int
- ROOM_STATUS_CONNECTING As Int
- ROOM_STATUS_INVITING As Int
- ROOM_VARIANT_DEFAULT As Int
Functions:
- GetParticipant (ParticipantId As String) As GPlayParticipant
Gets a participant in a room by its ID. Note that the participant ID must correspond to a participant in this match, or this method will throw an exception.
- GetParticipantId (PlayerId As String) As String
Gets the participant ID for a given player. This will only return a non-empty ID if the player is actually a participant in the room and that player's identity is visible to the current player. Note that this will never be empty for the current player.
- GetParticipantIds As List
Returns the IDs of the participants in this room. These are returned in the participant order of the room. Note that these are not stable across rooms.
- GetParticipants As List
Retrieves the Participants in this room.
- GetParticipantStatus (ParticipantId As String) As Int
Gets the status of a participant in a room (one of the PARTICIPANT_STATUS constants). Note that the participant ID must correspond to a participant in this room, or this method will throw an exception.
- IsInitialized As Boolean
- WrapIntentExtra (Intent As android.content.Intent)
Wraps the extended data (EXTRA_ROOM) retrieved from the given intent.
Properties:
- AutoMatchCriteria As Object [read only]
Retrieves the automatch criteria used to create or join this room, if any. May be null if the room has no automatch properties.
- AutoMatchWaitEstimateSeconds As Int [read only]
Retrieves the estimated wait time for automatching to finish for players who are not automatched immediately, as measured from the time that the room entered the automatching pool.
Returns -1 if the room is not automatching or no estimate could be provided.
- CreationTimestamp As Long [read only]
Returns the server timestamp at which the room was created.
- CreatorId As String [read only]
Returns the ID of the participant who created this Room. Note that not all participants will see the same value for the creator. In the case of an automatch, this value may differ for each participant.
- Description As String [read only]
Returns the description of this room.
- RoomId As String [read only]
Returns the ID of this Room.
- Status As Int [read only]
Returns the current status of the room (one of the ROOM_STATUS constants).
- Variant As Int [read only]
Retrieves the variant specified for this room, if any. A variant is an optional developer-controlled parameter describing the type of game to play. If specified, this value will be a positive integer. If this room had no variant specified, returns ROOM_VARIANT_DEFAULT.
GPlayRoomConfig
Fields:
- ROOM_VARIANT_DEFAULT As Int
Functions:
- CreateAutoMatchCriteria (MinAutoMatchPlayers As Int, MaxAutoMatchPlayers As Int, ExclusiveBitMask As Long) As Object
Creates an auto-match criteria object to pass to InitializeWithAutoMatch.
MinAutoMatchPlayers: Minimum number of auto-matched players.
MaxAutoMatchPlayers: Maximum number of auto-matched players.
ExclusiveBitMask: Exclusive bitmasks for the automatching request. The logical AND of each pairing of automatching requests must equal zero for auto-match. If there are no exclusivity requirements for the game, this value should just be set to 0.
- Initialize (Invitees As Object)
Creates a RoomConfig object.
Invitees: One or more player IDs to invite to the room.
- Initialize2 (Invitees As Object, Variant As Int)
Creates a RoomConfig object.
Invitees: One or more player IDs to invite to the room.
Variant: The developer-specified game variant.
- InitializeWithAutoMatch (AutoMatchCriteria As Object)
Creates a RoomConfig object.
AutoMatchCriteria: The criteria for auto-matching one or more players for the room.
- InitializeWithAutoMatch2 (Invitees As Object, AutoMatchCriteria As Object)
Creates a RoomConfig object.
Invitees: One or more player IDs to invite to the room.
AutoMatchCriteria: The criteria for auto-matching one or more players for the room.
- InitializeWithAutoMatch3 (Invitees As Object, AutoMatchCriteria As Object, Variant As Int)
Creates a RoomConfig object.
Invitees: One or more player IDs to invite to the room.
AutoMatchCriteria: The criteria for auto-matching one or more players for the room.
Variant: The developer-specified game variant.
- InitializeWithInvitation (InvitationId As String)
Creates a RoomConfig object.
InvitationId: The ID of the invitation to accept.
- IsInitialized As Boolean
Properties:
- InvitationId As String [read only]
Retrieves the ID of the invitation to accept, if any.
- InvitedPlayerIds As String() [read only]
Retrieves the player IDs to invite to the room.
- Variant As Int [read only]
Retrieves the developer-controlled parameter describing the type of game to play. Must be either a positive integer or ROOM_VARIANT_DEFAULT if not desired.
GPlayScoreSubmissionData
Fields:
- TIME_SPAN_ALL_TIME As Int
- TIME_SPAN_DAILY As Int
- TIME_SPAN_WEEKLY As Int
Functions:
- GetFormattedScore (TimeSpan As Int) As String
Retrieves the score data in a display-appropriate format.
TimeSpan: Time span to retrieve result for. Valid values are TIME_SPAN_DAILY, TIME_SPAN_WEEKLY, or TIME_SPAN_ALL_TIME.
- GetRawScore (TimeSpan As Int) As Long
Retrieves the raw score value.
TimeSpan: Time span to retrieve result for. Valid values are TIME_SPAN_DAILY, TIME_SPAN_WEEKLY, or TIME_SPAN_ALL_TIME.
- GetScoreTag (TimeSpan As Int) As String
Retrieves the score tag, if any.
TimeSpan: Time span to retrieve result for. Valid values are TIME_SPAN_DAILY, TIME_SPAN_WEEKLY, or TIME_SPAN_ALL_TIME.
- IsInitialized As Boolean
- IsNewBest (TimeSpan As Int) As Boolean
Indicates whether or not this score was the player's new best score for this time span.
TimeSpan: Time span to retrieve result for. Valid values are TIME_SPAN_DAILY, TIME_SPAN_WEEKLY, or TIME_SPAN_ALL_TIME.
Properties:
- LeaderboardId As String [read only]
Retrieves the ID of the leaderboard the score was submitted to.
- PlayerId As String [read only]
Retrieves the ID of the player the score was submitted for.
GPlaySnapshot
Functions:
Properties:
- Metadata As GPlaySnapshotMetadata [read only]
Retrieves the metadata for this snapshot.
- SnapshotContents As GPlaySnapshotContents [read only]
Retrieves the contents associated with this snapshot. The retrieved object, if not Null, can be used to update the data of a snapshot.
GPlaySnapshotContents
Functions:
- IsClosed As Boolean
Returns whether this snapshot contents has been closed.
- IsInitialized As Boolean
- ModifyBytes (DstOffset As Int, Content As Byte(), SrcOffset As Int, Count As Int) As Boolean
Writes the specified data into the snapshot. The contents of the snapshot will be replaced with the data provided in Content. The data will be persisted on disk, but is not uploaded to the server until the snapshot is committed via GPlaySnapshots.CommitAndClose.
Note that this function does not necessarily overwrite the entire contents of the file. If you are writing less data than was previously stored in the snapshot, the excess data will remain. Use WriteBytes to fully overwrite the file.
If the snapshot was not opened via GPlaySnapshots.Open, or if the contents have already been committed via GPlaySnapshots.CommitAndClose, this function will throw an exception.
DstOffset: Position in the snapshot file to start writing data to. 0 indicates the head of the file.
Content: The data to write.
SrcOffset: Position in content to start writing from.
Count: Number of bytes from content to write to this snapshot.
- ReadFully As Byte()
Reads the contents of a snapshot.
If this snapshot was not opened via GPlaySnapshots.Open, or if the contents have already been committed via GPlaySnapshots.CommitAndClose, this function will throw an exception.
- WriteBytes (Content As Byte()) As Boolean
Writes the specified data into the snapshot. The contents of the snapshot will be replaced with the data provided in Content. The data will be persisted on disk, but is not uploaded to the server until the snapshot is committed via GPlaySnapshots.CommitAndClose.
Note that this form of the API will fully overwrite the contents of the file. No previous data will be retained. Use ModifyBytes to overwrite parts of the file.
If the snapshot was not opened via GPlaySnapshots.Open, or if the contents have already been committed via GPlaySnapshots.CommitAndClose, this function will throw an exception.
Content: The data to write.
GPlaySnapshotMetadata
Events:
- onImageLoaded (URI As String, Drawable As BitmapDrawable)
Fields:
- PLAYED_TIME_UNKNOWN As Long
- PROGRESS_VALUE_UNKNOWN As Long
Functions:
- GetCoverImage (ImageView As ImageView) As String
Loads the snapshot's cover image and fills the given ImageView.
Returns the URI of the image, or an empty string if the snapshot has no cover image.
- GetCoverImage2 As String
Loads the snapshot's cover image and raises an onImageLoaded event when the load is complete.
Returns the URI of the image, or an empty string if the snapshot has no cover image.
- HasChangePending As Boolean
Indicates whether or not this snapshot has any changes pending that have not been uploaded to the server. Once all changes have been flushed to the server, this will return False.
- IsInitialized As Boolean
Properties:
- CoverImageAspectRatio As Float [read only]
Retrieves the aspect ratio of the cover image for this snapshot, if any. This is the ratio of width to height, so a value > 1 indicates a landscape image while a value < 1 indicates a portrait image. If the snapshot has no cover image, this will return 0.
- Description As String [read only]
Retrieves the description of this snapshot.
- DeviceName As String [read only]
Retrieves the name of the device that wrote this snapshot, if known.
- Game As GPlayGame [read only]
Retrieves the game associated with this snapshot.
- LastModifiedTimestamp As Long [read only]
Retrieves the last time this snapshot was modified, in milliseconds since epoch.
- Owner As GPlayPlayer [read only]
Retrieves the player that owns this snapshot.
- PlayedTime As Long [read only]
Retrieves the played time of this snapshot in milliseconds. This value is specified during the update operation. If not known, returns PLAYED_TIME_UNKNOWN.
- ProgressValue As Long [read only]
Retrieves the progress value for this snapshot. If not known, returns PROGRESS_VALUE_UNKNOWN.
- UniqueName As String [read only]
Retrieves the unique identifier of this snapshot. This value can be passed to GPlaySnapshots.Open to open the snapshot for modification.
This name should be unique within the scope of the application.
GPlaySnapshotMetadataChange
Fields:
- PLAYED_TIME_UNKNOWN As Long
- PROGRESS_VALUE_UNKNOWN As Long
Functions:
- Initialize (CoverImage As Bitmap, Description As String, PlayedTimeMillis As Long, ProgressValue As Long)
Creates the set of changes to apply to the metadata.
CoverImage: The bitmap to use for the snapshot's cover image. Can be Null.
Description: The description of the snapshot.
PlayedTimeMillis: The played time of the snapshot in milliseconds. Can be set to PLAYED_TIME_UNKNOWN if unknown.
ProgressValue: The progress value of the snapshot. Can be set to PROGRESS_VALUE_UNKNOWN if unknown.
- IsInitialized As Boolean
GPlaySnapshots
Fields:
- DISPLAY_LIMIT_NONE As Int
- EXTRA_SNAPSHOT_METADATA As String
- EXTRA_SNAPSHOT_NEW As String
- RESOLUTION_POLICY_HIGHEST_PROGRESS As Int
In the case of a conflict, the snapshot with the highest progress value will be used.
- RESOLUTION_POLICY_LAST_KNOWN_GOOD As Int
In the case of a conflict, the last known good version of this snapshot will be used.
- RESOLUTION_POLICY_LONGEST_PLAYTIME As Int
In the case of a conflict, the snapshot with the longest played time will be used.
- RESOLUTION_POLICY_MANUAL As Int
In the case of a conflict, the result will be returned to the app for resolution.
- RESOLUTION_POLICY_MOST_RECENTLY_MODIFIED As Int
In the case of a conflict, the most recently modified version of this snapshot will be used.
- RESULTMAP_SNAPSHOT As String
- RESULTMAP_SNAPSHOT_CONFLICT_ID As String
- RESULTMAP_SNAPSHOT_CONFLICTING_WITH As String
- RESULTMAP_SNAPSHOT_ID As String
- RESULTMAP_SNAPSHOT_METADATA As String
- RESULTMAP_SNAPSHOTS As String
- RESULTMAP_STATUS_CODE As String
- SMC_EMPTY_CHANGE As Object
- STATUS_OK As Int
- STATUS_SNAPSHOT_COMMIT_FAILED As Int
- STATUS_SNAPSHOT_CONFLICT As Int
- STATUS_SNAPSHOT_CONTENTS_UNAVAILABLE As Int
- STATUS_SNAPSHOT_CREATION_FAILED As Int
- STATUS_SNAPSHOT_FOLDER_UNAVAILABLE As Int
- STATUS_SNAPSHOT_NOT_FOUND As Int
Functions:
- CommitAndClose (Snapshot As GPlaySnapshot, MetadataChange As GPlaySnapshotMetadataChange) As GPlayPendingResult
Commits any modifications made to the snapshot. This will cause the changes to be synced to the server in the background.
Calling this function with a snapshot that has already been committed or that was not opened via Open will throw an exception.
Note that the total size of the contents of snapshot may not exceed the size provided by MaxDataSize.
Snapshot: The snapshot to commit the data for.
MetadataChange: The set of changes to apply to the metadata for the snapshot. Use SMC_EMPTY_CHANGE to preserve the existing metadata.
- Delete (Metadata As GPlaySnapshotMetadata) As GPlayPendingResult
Deletes the specified snapshot. This will delete the data of the snapshot locally and on the server.
Metadata: The metadata of the snapshot to delete.
- DiscardAndClose (Snapshot As GPlaySnapshot)
Discards the contents of the snapshot and close the contents. This will discard all changes made to the file, and close the snapshot to future changes until it is re-opened. The file will not be modified on the server.
Calling this function with a snapshot that has already been committed or that was not opened via Open will throw an exception.
Snapshot: The snapshot to discard the data for.
- GetSelectSnapshotIntent (Title As String, AllowAddButton As Boolean, AllowDelete As Boolean, MaxSnapshots As Int) As android.content.Intent
Returns an intent that will let the user select a snapshot. This intent must be invoked with StartActivityForResult.
If the user canceled without selecting a snapshot, the result code will be ACTIVITY_RESULT_CANCELED. If the user selected a snapshot from the list, the result code will be ACTIVITY_RESULT_OK and the data intent will contain the metadata of the selected snapshot in EXTRA_SNAPSHOT_METADATA. If the user pressed the Create button, the result code will be ACTIVITY_RESULT_OK and the data intent will contain a True boolean value in EXTRA_SNAPSHOT_NEW.
Note that if you have modified an open snapshot, the changes will not appear in this UI until you call CommitAndClose on the snapshot.
Title: The title to display in the action bar of the returned Activity.
AllowAddButton: Whether or not to display a "create new snapshot" option in the selection UI.
AllowDelete: Whether or not to provide a delete overflow menu option for each snapshot in the selection UI.
MaxSnapshots: The maximum number of snapshots to display in the UI. Use DISPLAY_LIMIT_NONE to display all snapshots.
- GetSnapshotMetadataFromIntentExtra (Intent As android.content.Intent) As GPlaySnapshotMetadata
Retrieves the metadata of a snapshot from the extended data (EXTRA_SNAPSHOT_METADATA) of the given intent.
- Initialize
- IsInitialized As Boolean
- Load (ForceReload As Boolean) As GPlayPendingResult
Asynchronously loads the list of snapshot metadata for the currently signed-in player.
ForceReload: If True, this call will clear any locally cached data and attempt to fetch the latest data from the server. This would commonly be used for something like a user-initiated refresh. Normally, this should be set to False to gain advantages of data caching.
- Open (Metadata As GPlaySnapshotMetadata) As GPlayPendingResult
Opens a snapshot with the given metadata (usually returned from Load or GetSnapshotMetadataFromIntentExtra). To succeed, the snapshot must exist; i.e. this call will fail if the snapshot was deleted between Load and Open.
Metadata: The metadata of the existing snapshot to load.
- Open2 (Metadata As GPlaySnapshotMetadata, ConflictPolicy As Int) As GPlayPendingResult
Opens a snapshot with the given metadata (usually returned from Load or GetSnapshotMetadataFromIntentExtra). To succeed, the snapshot must exist; i.e. this call will fail if the snapshot was deleted between Load and Open.
Metadata: The metadata of the existing snapshot to load.
ConflictPolicy: The conflict resolution policy to use for this snapshot (one of the RESOLUTION_POLICY constants).
- OpenWithName (FileName As String, CreateIfNotFound As Boolean) As GPlayPendingResult
Opens a snapshot with the given name.
FileName: The name of the snapshot file to open. Must be between 1 and 100 non-URL-reserved characters (a-z, A-Z, 0-9, or the symbols "-", ".", "_", or "~").
CreateIfNotFound: If True, the snapshot will be created if one cannot be found.
- OpenWithName2 (FileName As String, CreateIfNotFound As Boolean, ConflictPolicy As Int) As GPlayPendingResult
Opens a snapshot with the given name.
FileName: The name of the snapshot file to open. Must be between 1 and 100 non-URL-reserved characters (a-z, A-Z, 0-9, or the symbols "-", ".", "_", or "~").
CreateIfNotFound: If True, the snapshot will be created if one cannot be found.
ConflictPolicy: The conflict resolution policy to use for this snapshot (one of the RESOLUTION_POLICY constants).
- ResolveConflict (ConflictId As String, Snapshot As GPlaySnapshot) As GPlayPendingResult
Resolves a conflict using the data from the provided snapshot. This will replace the data on the server with the specified snapshot. Note that it is possible for this operation to result in a conflict itself, in which case resolution should be repeated.
Note that the total size of the contents of snapshot may not exceed the size provided by MaxDataSize.
Calling this function with a snapshot that has already been committed or that was not opened via Open will throw an exception.
ConflictId: The ID of the conflict to resolve.
Snapshot: The snapshot to use to resolve the conflict.
Properties:
- MaxCoverImageSize As Int [read only]
Gets the maximum data size per snapshot cover image in bytes. Guaranteed to be at least 800 KB. May increase in the future.
If the service cannot be reached for some reason, this will return -1.
- MaxDataSize As Int [read only]
Gets the maximum data size per snapshot in bytes. Guaranteed to be at least 3 MB. May increase in the future.
If the service cannot be reached for some reason, this will return -1.
GPlayStats
Fields:
- RESULTMAP_PLAYER_STATS As String
- STATUS_OK As Int
Functions:
- LoadCurrentPlayerStats (ForceReload As Boolean) As GPlayPendingResult
Asynchronously loads the player stats data for the currently signed-in player and game into a single result.
ForceReload: If True, this call will clear any locally cached data and attempt to fetch the latest data from the server. This would commonly be used for something like a user-initiated refresh. Normally, this should be set to False to gain advantages of data caching.
GPlayTurnBasedMatch
Fields:
- MATCH_STATUS_ACTIVE As Int
- MATCH_STATUS_AUTO_MATCHING As Int
- MATCH_STATUS_CANCELED As Int
- MATCH_STATUS_COMPLETE As Int
- MATCH_STATUS_EXPIRED As Int
- MATCH_TURN_STATUS_ALL As Int()
- MATCH_TURN_STATUS_COMPLETE As Int
- MATCH_TURN_STATUS_INVITED As Int
- MATCH_TURN_STATUS_MY_TURN As Int
- MATCH_TURN_STATUS_THEIR_TURN As Int
- MATCH_VARIANT_DEFAULT As Int
- PARTICIPANT_STATUS_DECLINED As Int
- PARTICIPANT_STATUS_FINISHED As Int
- PARTICIPANT_STATUS_INVITED As Int
- PARTICIPANT_STATUS_JOINED As Int
- PARTICIPANT_STATUS_LEFT As Int
- PARTICIPANT_STATUS_NOT_INVITED_YET As Int
- PARTICIPANT_STATUS_UNRESPONSIVE As Int
Functions:
- CanRematch As Boolean
Returns whether or not this match can be rematched. This will return True when the match has complete and has not already been rematched.
- GetParticipant (ParticipantId As String) As GPlayParticipant
Gets a participant in a match by its ID. Note that the participant ID must correspond to a participant in this match, or this method will throw an exception.
- GetParticipantId (PlayerId As String) As String
Gets the participant ID for a given player. This will only return a non-empty ID if the player is actually a participant in the match and that player's identity is visible to the current player. Note that this will never be empty for the current player.
- GetParticipantIds As List
Returns the IDs of the participants in this match. These are returned in the participant order of the match. Note that these are not stable across matches.
- GetParticipants As List
Retrieves the participants in this match.
- GetParticipantStatus (ParticipantId As String) As Int
Gets the status of a participant in a match (one of the PARTICIPANT_STATUS constants). Note that the participant ID must correspond to a participant in this match, or this method will throw an exception.
- IsInitialized As Boolean
- IsLocallyModified As Boolean
Returns whether or not this match has been locally modified. If this is True, the local device has match state which has not successfully synced to the server yet. In this state, further mutations to the match will fail with a status of STATUS_MATCH_ERROR_LOCALLY_MODIFIED.
Properties:
- AutoMatchCriteria As Object [read only]
Retrieves the automatch criteria used to create or join this match, if any. May be null if the match has no automatch properties.
- AvailableAutoMatchSlots As Int [read only]
Returns the maximum number of available automatch slots for this match. If automatch criteria were not specified during match creation, or if all slots have been filled, this will return 0.
- CreationTimestamp As Long [read only]
Returns the server timestamp at which the match was created.
- CreatorId As String [read only]
Returns the ID of the participant who created this match.
- Data As Byte() [read only]
Returns a byte array representing the current (game-specific) match state data.
- Description As String [read only]
Returns the description of this match.
- DescriptionParticipant As GPlayParticipant [read only]
Returns the participant representing the primary opponent in the match.
- DescriptionParticipantId As String [read only]
Gets the ID of another participant in the match that can be used when describing the participants the user is playing with. For example, in a four player match this might be used to state "Martha (and 2 others)".
- Game As GPlayGame [read only]
Returns the Game object that owns this match. Note that this should not be cached separately from the match itself, since the data underlying this object may change.
- LastUpdatedTimestamp As Long [read only]
Returns the timestamp at which the match was last modified.
- LastUpdaterId As String [read only]
Returns the ID of the participant who updated the match most recently.
- MatchId As String [read only]
Retrieves the ID of this match.
- MatchNumber As Int [read only]
Returns the match sequence number for this match. This number starts at 1, and increases every time a rematch is created.
- PendingParticipantId As String [read only]
Returns the ID of the participant that is considered pending. If no participant is considered pending (i.e., the match is over, etc), this function will return an empty string.
- PreviousMatchData As Byte() [read only]
Returns the match data from the previous match, if available. Note that this is only provided on the first turn of a rematched match.
- RematchId As String [read only]
Returns the match ID of the rematch that was created from this match, if any. This will only be non-empty if a rematch has been created.
- Status As Int [read only]
Returns the current status of the match (one of the MATCH_STATUS constants).
- TurnStatus As Int [read only]
Returns the turn status of the match for the current player (one of the MATCH_TURN_STATUS constants).
- Variant As Int [read only]
Retrieves the variant specified for this match, if any. A variant is an optional developer-controlled parameter describing the type of game to play, ranging from 1-1023 (inclusive). If this match had no variant specified, returns MATCH_VARIANT_DEFAULT.
- Version As Int [read only]
Returns the current version of the match.
GPlayTurnBasedMatchConfig
Fields:
- MATCH_VARIANT_DEFAULT As Int
Functions:
- CreateAutoMatchCriteria (MinAutoMatchPlayers As Int, MaxAutoMatchPlayers As Int, ExclusiveBitMask As Long) As Object
Creates an auto-match criteria object to pass to InitializeWithAutoMatch.
MinAutoMatchPlayers: Min number of auto-matched players.
MaxAutoMatchPlayers: Max number of auto-matched players.
ExclusiveBitMask: Exclusive bitmask for exclusive roles for the player. The exclusive bitmask of each pairing of players must equal zero for auto-match.
- Initialize (Invitees As Object)
Creates a TurnBasedMatchConfig object.
Invitees: One or more player IDs to invite to the match. Can be a string array, a List or the extended data (EXTRA_PLAYER_IDS) of an intent.
- InitializeWithAutoMatch (Invitees As Object, AutoMatchCriteria As Object)
Creates a TurnBasedMatchConfig object with a Variant parameter set to MATCH_VARIANT_DEFAULT.
Invitees: One or more player IDs to invite to the match. Can be a string array, a List or the extended data (EXTRA_PLAYER_IDS) of an intent.
AutoMatchCriteria: The criteria for auto-matching one or more players for the match.
- InitializeWithAutoMatch2 (Invitees As Object, AutoMatchCriteria As Object, Variant As Int)
Creates a TurnBasedMatchConfig object.
Invitees: One or more player IDs to invite to the match. Can be a string array, a List or an object returned by Intent.GetExtra(EXTRA_PLAYERS).
AutoMatchCriteria: The criteria for auto-matching one or more players for the match.
Variant: Developer-controlled parameter describing the type of game to play. Must be either a positive integer, or MATCH_VARIANT_DEFAULT if not desired. Note that variants must match exactly. Thus, if you do not specify a variant, only other matches created with MATCH_VARIANT_DEFAULT will be considered potential auto-matches.
- IsInitialized As Boolean
Properties:
- InvitedPlayerIds As String() [read only]
Gets the player IDs to invite to the match.
- Variant As Int [read only]
Retrieves the developer-specified match variant.
GPlayTurnBasedMultiplayer
Events:
- onTurnBasedMatchReceived (Match As GPlayTurnBasedMatch)
- onTurnBasedMatchRemoved (MatchID As String)
Fields:
- EXTRA_MAX_AUTOMATCH_PLAYERS As String
- EXTRA_MIN_AUTOMATCH_PLAYERS As String
- EXTRA_PLAYER_IDS As String
- EXTRA_TURN_BASED_MATCH As String
- MATCH_TURN_STATUS_COMPLETE As Int
- MATCH_TURN_STATUS_INVITED As Int
- MATCH_TURN_STATUS_MY_TURN As Int
- MATCH_TURN_STATUS_THEIR_TURN As Int
- RESULTMAP_MATCH As String
- RESULTMAP_MATCH_ID As String
- RESULTMAP_MATCHES As String
- RESULTMAP_STATUS_CODE As String
- STATUS_CLIENT_RECONNECT_REQUIRED As Int
- STATUS_INTERNAL_ERROR As Int
- STATUS_MATCH_ERROR_ALREADY_REMATCHED As Int
Indicates that the specified match has already had a rematch created.
- STATUS_MATCH_ERROR_INACTIVE_MATCH As Int
Indicates that the match is not currently active.
- STATUS_MATCH_ERROR_INVALID_MATCH_STATE As Int
Indicates that the match is not in the correct state to perform the specified action.
- STATUS_MATCH_ERROR_INVALID_PARTICIPANT_STATE As Int
Indicates that one or more participants in this match are not in valid states.
- STATUS_MATCH_ERROR_LOCALLY_MODIFIED As Int
Indicates that the specified match has already been modified locally.
- STATUS_MATCH_ERROR_OUT_OF_DATE_VERSION As Int
Indicates that the match data is out of date.
- STATUS_MATCH_NOT_FOUND As Int
Indicates that the specified match cannot be found.
- STATUS_MULTIPLAYER_DISABLED As Int
Indicates that this game does not support multiplayer.
- STATUS_MULTIPLAYER_ERROR_CREATION_NOT_ALLOWED As Int
Indicates that the user is not allowed to create a new multiplayer game at this time.
- STATUS_MULTIPLAYER_ERROR_INVALID_MULTIPLAYER_TYPE As Int
Indicates that the match is not the right type to perform this action on.
- STATUS_MULTIPLAYER_ERROR_INVALID_OPERATION As Int
Indicates that this multiplayer operation is not valid, and the server rejected it.
- STATUS_MULTIPLAYER_ERROR_NOT_TRUSTED_TESTER As Int
Indicates that the user attempted to invite another user who was not authorized to see the game.
- STATUS_NETWORK_ERROR_NO_DATA As Int
Indicates that a network error occurred while attempting to retrieve fresh data, and no data was available locally.
- STATUS_NETWORK_ERROR_OPERATION_DEFERRED As Int
Indicates that a network error occurred while attempting to modify data, but the data was successfully modified locally and will be updated on the network the next time the device is able to sync.
- STATUS_NETWORK_ERROR_OPERATION_FAILED As Int
Indicates that a network error occurred while attempting to perform an operation that requires network access.
- STATUS_NETWORK_ERROR_STALE_DATA As Int
Indicates that a network error occurred while attempting to retrieve fresh data, but some locally cached data was available.
- STATUS_OK As Int
Functions:
- AcceptInvitation (InvitationId As String) As GPlayPendingResult
Accepts an invitation for a turn-based match. This changes the current player's participant status to STATUS_JOINED.
InvitationId: The ID of the invitation to be accepted.
- CancelMatch (MatchId As String) As GPlayPendingResult
Cancels a turn-based match. Once this call succeeds, the match will be removed from local storage. Note that this will cancel the match completely, forcing it to end for all players involved. See LeaveMatch for a different alternative.
MatchId: ID of the match to cancel.
- CreateMatch (Config As GPlayTurnBasedMatchConfig) As GPlayPendingResult
Creates a new turn-based match for the current game. If the provided TurnBasedMatchConfig includes automatch parameters, the server will attempt to find any previously created matches that satisfy these parameters and join the current player into the previous match. If no suitable match can be found, a new match will be created.
Config: The configuration parameters for the match to create.
- DeclineInvitation (InvitationId As String)
Declines an invitation for a turn-based match. Note that this will cancel the match for the other participants and remove the match from the caller's local device.
InvitationId: The ID of the invitation to decline.
- DismissInvitation (InvitationId As String)
Dismisses an invitation to a turn-based match. Dismissing an invitation will not change the state of the match for the other participants.
InvitationId: The ID of the invitation to dismiss.
- DismissMatch (MatchId As String)
Deletes a match from the server and local storage. Dismissing a match will not change the state of the match for the other participants, but dismissed matches will never be shown to the dismissing player again.
MatchId: The ID of the match to dismiss.
- FinishMatch (MatchId As String) As GPlayPendingResult
Indicates that a participant is finished with a match. This will not change the data of the match, but it will transition the match into state MATCH_STATUS_COMPLETE if the match is not already in that state. This function is most commonly used to report that a participant has finished any post-processing steps the game might have and has seen their results in the match.
MatchId: ID of the match to finish.
- FinishMatch2 (MatchId As String, MatchData As Byte(), Results As List) As GPlayPendingResult
Marks a match as finished. This should be called when the match is over and all participants have results to be reported (if appropriate). Note that the last client to update a match is responsible for calling FinishMatch on that match.
On the last turn of the match, the client should call this function instead of TakeTurn.
MatchId: ID of the match to finish.
MatchData: Data representing the new state of the match after this update. Limited to a maximum of MaxMatchDataSize bytes.
Results: List of ParticipantResult objects for this match. The client which calls FinishMatch is responsible for reporting the results for all appropriate participants in the match. Not every participant is required to have a result, but providing results for participants who are not in the match is an error.
- GetInboxIntent As android.content.Intent
Returns an intent that will let the user see and manage any outstanding invitations and matches. This intent must be invoked with StartActivityForResult.
If the user canceled, the result code will be ACTIVITY_RESULT_CANCELED. If the user selected an invitation or a match to accept, the result code will be ACTIVITY_RESULT_OK and the data intent will contain the selected invitation/match in the extras (EXTRA_TURN_BASED_MATCH).
- GetMatchFromIntentExtra (Intent As android.content.Intent) As GPlayTurnBasedMatch
Retrieves a match from the extended data (EXTRA_TURN_BASED_MATCH) of the given intent.
- GetPlayerIDsFromIntentExtra (Intent As android.content.Intent) As Object
Retrieves a list of player IDs from the extended data (EXTRA_PLAYER_IDS) of the given intent. Returns Null if the list is empty.
- GetSelectOpponentsIntent (MinPlayers As Int, MaxPlayers As Int, AllowAutomatch As Boolean) As android.content.Intent
Returns an intent that will let the user select opponents to send an invitation to for a turn based multiplayer match. This intent must be invoked with StartActivityForResult.
The number of players passed in should be the desired number of additional players to select, not including the current player. So, for a game that can handle between 2 and 4 players, MinPlayers would be 1 and MaxPlayers would be 3.
If the user canceled, the result will be ACTIVITY_RESULT_CANCELED. If the user selected players, the result code will be ACTIVITY_RESULT_OK, and the data intent will contain the selected player IDs in EXTRA_PLAYER_IDS and the minimum and maximum numbers of additional auto-match players in EXTRA_MIN_AUTOMATCH_PLAYERS and EXTRA_MAX_AUTOMATCH_PLAYERS respectively. The player IDs in EXTRA_PLAYER_IDS will include only the other players selected, not the current player.
If the AllowAutomatch parameter is set to False, the UI will not display an option for selecting automatch players. Set this to False if your game does not support automatching.
MinPlayers: The minimum number of players to select (not including the current player).
MaxPlayers: The maximum number of players to select (not including the current player).
AllowAutomatch: Whether or not to display an option for selecting automatch players.
- Initialize
- IsInitialized As Boolean
- LeaveMatch (MatchId As String) As GPlayPendingResult
Leaves the specified match when it is not the current player's turn. If this takes the match to fewer than two participants, the match will be canceled. Call LeaveMatchDuringTurn instead to leave during the current player's turn.
MatchId: ID of the match to leave.
- LeaveMatchDuringTurn (MatchId As String, PendingParticipantId As String) As GPlayPendingResult
Leaves the specified match during the current player's turn. If this takes the match to fewer than two participants, the match will be canceled. The provided PendingParticipantId will be used to determine which participant should act next. If no pending participant is provided and the match has available auto-match slots, the match will wait for additional players to be found. If there are no auto-match slots available for this match, a pending participant ID is required. Call LeaveMatch instead to leave when it is not the current player's turn.
MatchId: ID of the match to leave.
PendingParticipantId: ID of the participant who will be set to pending after this update succeeds, or an empty string to wait for additional automatched players (if possible).
- LoadMatch (MatchId As String) As GPlayPendingResult
Loads a specified turn-based match.
MatchId: The ID of the match to retrieve.
- LoadMatchesByStatus (MatchTurnStatuses As Int()) As GPlayPendingResult
Asynchronously loads turn-based matches for the current game. Matches with any specified turn status codes will be returned.
Valid turn status values are MATCH_TURN_STATUS_INVITED, MATCH_TURN_STATUS_MY_TURN, MATCH_TURN_STATUS_THEIR_TURN, or MATCH_TURN_STATUS_COMPLETE. Note that if your game implements both turn-based and real-time multiplayer, requesting MATCH_TURN_STATUS_INVITED will return invitations for both turn-based matches and real-time matches.
MatchTurnStatuses: Array of turn statuses to request.
- RegisterMatchUpdateListener
Registers a listener to intercept incoming match updates for the currently signed-in user. If a listener is registered by this function, the incoming match update will not generate a status bar notification as long as this client remains connected.
Note that only one match update listener may be active at a time. Calling this function while another match update listener was previously registered will replace the original listener with the new one.
The listener will raise the onTurnBasedMatchReceived and onTurnBasedMatchRemoved events.
- Rematch (MatchId As String) As GPlayPendingResult
Creates a rematch of a previously completed turn-based match. The new match will have the same participants as the previous match. Note that only one rematch may be created from any single completed match, and only by a player that has already called FinishMatch on the match.
MatchId: The ID of the previous match to re-create.
- TakeTurn (MatchId As String, MatchData As Byte(), PendingParticipantId As String) As GPlayPendingResult
Updates a match with new turn data. The participant that is passed in as the pending participant will be notified that it is their turn to take action. If no pending participant is provided and the match has available auto-match slots, the match will wait for additional players to be found. If there are no auto-match slots available for this match, a pending participant ID is required.
For the final turn of the match, there is no need to call this function. Instead, call FinishMatch directly.
MatchId: ID of the match to update.
MatchData: Data representing the new state of the match after this update. Limited to a maximum of MaxMatchDataSize bytes.
PendingParticipantId: ID of the participant who will be set to pending after this update succeeds, or an empty string to wait for additional automatched players (if possible).
- TakeTurn2 (MatchId As String, MatchData As Byte(), PendingParticipantId As String, Results As List) As GPlayPendingResult
Updates a match with new turn data. The participant that is passed in as the pending participant will be notified that it is their turn to take action. If no pending participant is provided and the match has available auto-match slots, the match will wait for additional players to be found. If there are no auto-match slots available for this match, a pending participant ID is required.
Note that players will not receive invitations for matches until this function is called. An invitation will be sent to a player the first time they are set as the pending participant of a match.
For the final turn of the match, there is no need to call this function. Instead, call FinishMatch directly.
MatchId: ID of the match to update.
MatchData: Data representing the new state of the match after this update. Limited to a maximum of MaxMatchDataSize bytes.
PendingParticipantId: ID of the participant who will be set to pending after this update succeeds, or an empty string to wait for additional automatched players (if possible).
Results: List of ParticipantResult objects for this match. Note that the results reported here should be final - if results reported later conflict with these values, the returned value will indicate a conflicted result by returning MATCH_RESULT_DISAGREED. This is most useful for cases where a participant knows their results early. For example, a single elimination game where participants are eliminated as the game continues might wish to specify results for the eliminated participants here.
- UnregisterMatchUpdateListener
Unregisters this client's match update listener, if any. Any new match updates will generate status bar notifications as normal.
Properties:
- MaxMatchDataSize As Int [read only]
Gets the maximum data size per match in bytes. Guaranteed to be at least 128 KB. May increase in the future.
If the service cannot be reached for some reason, this will return -1.
GPlayUtils
Events:
- onActivityResult (ID As String, ResultCode As Int, ResultIntent As Intent)
Fields:
- ACTIVITY_RESULT_CANCELED As Int
- ACTIVITY_RESULT_INVALID_ROOM As Int
- ACTIVITY_RESULT_LEFT_ROOM As Int
- ACTIVITY_RESULT_OK As Int
- ACTIVITY_RESULT_RECONNECT_REQUIRED As Int
Functions:
- GetSettingsIntent As android.content.Intent
Gets an intent to show the Settings screen that allows the user to configure games-related features for the current game. This intent must be invoked with StartActivityForResult.
An ACTIVITY_RESULT_RECONNECT_REQUIRED may be returned as the result code of the onActivityResult event if the Google API client ends up in an inconsistent state.
Most applications will not need to call this directly, since the Settings UI is already reachable from most other Games UI screens (achievements, leaderboards, etc.) via a menu item.
- GetStatusCode (Result As Map) As Int
Retrieves the status code from the map returned by a GPlayPendingResult.
- StartActivityForResult (i As android.content.Intent, ID As String)
Launches an activity for which you would like a result when it finished. When this activity exits, an onActivityResult event is raised.
ID: An unique identifier helping you identify which activity exited.
Properties:
- AppId As String [read only]
Gets the application ID linked to this client instance.
- CurrentAccountName As String [read only]
Gets the name of the currently selected account. This is the account the user has chosen to use for Google Play Games.
Note that the Google API client must be connected to call this function, and your app must have AddPermission(android.permission.GET_ACCOUNTS) declared in your manifest in order to use this function.