C# Class GooglePlayGames.BasicApi.DummyClient

Inheritance: IPlayGamesClient
Afficher le fichier Open project: playgameservices/play-games-plugin-for-unity Class Usage Examples

Méthodes publiques

Méthode Description
Authenticate ( string>.Action callback, bool silent ) : void

Starts the authentication process.

If silent == true, no UIs will be shown (if UIs are needed, it will fail rather than show them). If silent == false, this may show UIs, consent dialogs, etc. At the end of the process, callback will be invoked to notify of the result. Once the callback returns true, the user is considered to be authenticated forever after.

GetAccessToken ( ) : string

Returns an access token.

GetAchievement ( string achId ) : GooglePlayGames.BasicApi.Achievement

Returns the achievement corresponding to the passed achievement identifier.

GetApiClient ( ) : IntPtr

Gets the Android API client. Returns null on non-Android players.

GetEventsClient ( ) : GooglePlayGames.BasicApi.Events.IEventsClient

Gets the events client.

GetFriends ( ) : IUserProfile[]

Gets the friends.

GetIdToken ( Action idTokenCallback ) : void

Retrieves an id token, which can be verified server side, if they are logged in.

GetInvitationFromNotification ( ) : Invitation

Gets the invitation from notification.

GetPlayerStats ( PlayerStats>.Action callback ) : void

Gets the player stats.

GetQuestsClient ( ) : GooglePlayGames.BasicApi.Quests.IQuestsClient

Gets the quests client.

GetRtmpClient ( ) : IRealTimeMultiplayerClient

Returns a real-time multiplayer client.

GetSavedGameClient ( ) : SavedGame.ISavedGameClient

Gets the saved game client.

GetServerAuthCode ( string serverClientId, string>.Action callback ) : void

Asynchronously retrieves the server auth code for this client.

Note: This function is only implemented for Android.

GetTbmpClient ( ) : ITurnBasedMultiplayerClient

Returns a turn-based multiplayer client.

GetToken ( ) : string

Retrieves an OAuth 2.0 bearer token for the client.

GetUserDisplayName ( ) : string

Returns a human readable name for the user, if they are logged in.

GetUserEmail ( ) : string

Gets the user's email.

The email address returned is selected by the user from the accounts present on the device. There is no guarantee this uniquely identifies the player. For unique identification use the id property of the local player. The user can also choose to not select any email address, meaning it is not available.

GetUserEmail ( string>.Action callback ) : void

Gets the user's email with a callback.

The email address returned is selected by the user from the accounts present on the device. There is no guarantee this uniquely identifies the player. For unique identification use the id property of the local player. The user can also choose to not select any email address, meaning it is not available.

GetUserId ( ) : string

Returns the authenticated user's ID. Note that this value may change if a user signs on and signs in with a different account.

GetUserImageUrl ( ) : string

Returns the user's avatar url, if they are logged in and have an avatar.

HasInvitationFromNotification ( ) : bool

Determines whether this instance has invitation from notification.

IncrementAchievement ( string achId, int steps, Action callback ) : void

Increments the achievement.

IsAuthenticated ( ) : bool

Returns whether or not user is authenticated.

LeaderboardMaxResults ( ) : int

Returns the max number of scores returned per call.

LoadAchievements ( Action callback ) : void

Loads the achievements for the current player.

LoadFriends ( Action callback ) : void

Load friends of the authenticated user

LoadMoreScores ( GooglePlayGames.BasicApi.ScorePageToken token, int rowCount, Action callback ) : void

Loads the more scores for the leaderboard.

The token is accessed by calling LoadScores() with a positive row count.

LoadScores ( string leaderboardId, LeaderboardStart start, int rowCount, LeaderboardCollection collection, LeaderboardTimeSpan timeSpan, Action callback ) : void

Loads the score data for the given leaderboard.

LoadUsers ( string userIds, Action callback ) : void

Loads the players specified.

This is mainly used by the leaderboard APIs to get the information of a high scorer.

RegisterInvitationDelegate ( InvitationReceivedDelegate invitationDelegate ) : void

Registers the invitation delegate.

RevealAchievement ( string achId, Action callback ) : void

Reveals the achievement.

SetStepsAtLeast ( string achId, int steps, Action callback ) : void

Set an achievement to have at least the given number of steps completed.

Calling this method 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 is automatically unlocked, and any further mutation operations are ignored.

ShowAchievementsUI ( Action callback ) : void

Shows the achievements UI

ShowLeaderboardUI ( string leaderboardId, LeaderboardTimeSpan span, Action callback ) : void

Shows the leaderboard UI

SignOut ( ) : void

Signs the user out.

SubmitScore ( string leaderboardId, long score, Action callback ) : void

Submits the score.

SubmitScore ( string leaderboardId, long score, string metadata, Action callback ) : void

Submits the score for the currently signed-in player to the leaderboard associated with a specific id and metadata (such as something the player did to earn the score).

UnlockAchievement ( string achId, Action callback ) : void

Unlocks the achievement.

Private Methods

Méthode Description
LogUsage ( ) : void

Logs the usage.

Method Details

Authenticate() public méthode

Starts the authentication process.
If silent == true, no UIs will be shown (if UIs are needed, it will fail rather than show them). If silent == false, this may show UIs, consent dialogs, etc. At the end of the process, callback will be invoked to notify of the result. Once the callback returns true, the user is considered to be authenticated forever after.
public Authenticate ( string>.Action callback, bool silent ) : void
callback string>.Action Callback when completed.
silent bool If set to true silent.
Résultat void

GetAccessToken() public méthode

Returns an access token.
public GetAccessToken ( ) : string
Résultat string

GetAchievement() public méthode

Returns the achievement corresponding to the passed achievement identifier.
public GetAchievement ( string achId ) : GooglePlayGames.BasicApi.Achievement
achId string Achievement identifier.
Résultat GooglePlayGames.BasicApi.Achievement

GetApiClient() public méthode

Gets the Android API client. Returns null on non-Android players.
public GetApiClient ( ) : IntPtr
Résultat System.IntPtr

GetEventsClient() public méthode

Gets the events client.
public GetEventsClient ( ) : GooglePlayGames.BasicApi.Events.IEventsClient
Résultat GooglePlayGames.BasicApi.Events.IEventsClient

GetFriends() public méthode

Gets the friends.
public GetFriends ( ) : IUserProfile[]
Résultat IUserProfile[]

GetIdToken() public méthode

Retrieves an id token, which can be verified server side, if they are logged in.
public GetIdToken ( Action idTokenCallback ) : void
idTokenCallback Action The callback invoked with the token
Résultat void

GetInvitationFromNotification() public méthode

Gets the invitation from notification.
public GetInvitationFromNotification ( ) : Invitation
Résultat GooglePlayGames.BasicApi.Multiplayer.Invitation

GetPlayerStats() public méthode

Gets the player stats.
public GetPlayerStats ( PlayerStats>.Action callback ) : void
callback PlayerStats>.Action Callback for response.
Résultat void

GetQuestsClient() public méthode

Gets the quests client.
public GetQuestsClient ( ) : GooglePlayGames.BasicApi.Quests.IQuestsClient
Résultat GooglePlayGames.BasicApi.Quests.IQuestsClient

GetRtmpClient() public méthode

Returns a real-time multiplayer client.
public GetRtmpClient ( ) : IRealTimeMultiplayerClient
Résultat IRealTimeMultiplayerClient

GetSavedGameClient() public méthode

Gets the saved game client.
public GetSavedGameClient ( ) : SavedGame.ISavedGameClient
Résultat SavedGame.ISavedGameClient

GetServerAuthCode() public méthode

Asynchronously retrieves the server auth code for this client.
Note: This function is only implemented for Android.
public GetServerAuthCode ( string serverClientId, string>.Action callback ) : void
serverClientId string The Client ID.
callback string>.Action Callback for response.
Résultat void

GetTbmpClient() public méthode

Returns a turn-based multiplayer client.
public GetTbmpClient ( ) : ITurnBasedMultiplayerClient
Résultat ITurnBasedMultiplayerClient

GetToken() public méthode

Retrieves an OAuth 2.0 bearer token for the client.
public GetToken ( ) : string
Résultat string

GetUserDisplayName() public méthode

Returns a human readable name for the user, if they are logged in.
public GetUserDisplayName ( ) : string
Résultat string

GetUserEmail() public méthode

Gets the user's email.
The email address returned is selected by the user from the accounts present on the device. There is no guarantee this uniquely identifies the player. For unique identification use the id property of the local player. The user can also choose to not select any email address, meaning it is not available.
public GetUserEmail ( ) : string
Résultat string

GetUserEmail() public méthode

Gets the user's email with a callback.
The email address returned is selected by the user from the accounts present on the device. There is no guarantee this uniquely identifies the player. For unique identification use the id property of the local player. The user can also choose to not select any email address, meaning it is not available.
public GetUserEmail ( string>.Action callback ) : void
callback string>.Action The callback with a status code of the request, /// and string which is the email. It can be null.
Résultat void

GetUserId() public méthode

Returns the authenticated user's ID. Note that this value may change if a user signs on and signs in with a different account.
public GetUserId ( ) : string
Résultat string

GetUserImageUrl() public méthode

Returns the user's avatar url, if they are logged in and have an avatar.
public GetUserImageUrl ( ) : string
Résultat string

HasInvitationFromNotification() public méthode

Determines whether this instance has invitation from notification.
public HasInvitationFromNotification ( ) : bool
Résultat bool

IncrementAchievement() public méthode

Increments the achievement.
public IncrementAchievement ( string achId, int steps, Action callback ) : void
achId string Achievement identifier.
steps int Steps to increment by..
callback Action Callback to invoke when complete.
Résultat void

IsAuthenticated() public méthode

Returns whether or not user is authenticated.
public IsAuthenticated ( ) : bool
Résultat bool

LeaderboardMaxResults() public méthode

Returns the max number of scores returned per call.
public LeaderboardMaxResults ( ) : int
Résultat int

LoadAchievements() public méthode

Loads the achievements for the current player.
public LoadAchievements ( Action callback ) : void
callback Action Callback to invoke when completed.
Résultat void

LoadFriends() public méthode

Load friends of the authenticated user
public LoadFriends ( Action callback ) : void
callback Action Callback invoked when complete. bool argument /// indicates success.
Résultat void

LoadMoreScores() public méthode

Loads the more scores for the leaderboard.
The token is accessed by calling LoadScores() with a positive row count.
public LoadMoreScores ( GooglePlayGames.BasicApi.ScorePageToken token, int rowCount, Action callback ) : void
token GooglePlayGames.BasicApi.ScorePageToken Token used to start loading scores.
rowCount int Max number of scores to return. /// This can be limited by the SDK.
callback Action Callback to invoke when complete.
Résultat void

LoadScores() public méthode

Loads the score data for the given leaderboard.
public LoadScores ( string leaderboardId, LeaderboardStart start, int rowCount, LeaderboardCollection collection, LeaderboardTimeSpan timeSpan, Action callback ) : void
leaderboardId string Leaderboard identifier.
start LeaderboardStart Start indicating the top scores or player centric
rowCount int Row count.
collection LeaderboardCollection Collection to display.
timeSpan LeaderboardTimeSpan Time span.
callback Action Callback to invoke when complete.
Résultat void

LoadUsers() public méthode

Loads the players specified.
This is mainly used by the leaderboard APIs to get the information of a high scorer.
public LoadUsers ( string userIds, Action callback ) : void
userIds string User identifiers.
callback Action Callback to invoke when completed.
Résultat void

RegisterInvitationDelegate() public méthode

Registers the invitation delegate.
public RegisterInvitationDelegate ( InvitationReceivedDelegate invitationDelegate ) : void
invitationDelegate InvitationReceivedDelegate Invitation delegate.
Résultat void

RevealAchievement() public méthode

Reveals the achievement.
public RevealAchievement ( string achId, Action callback ) : void
achId string Achievement identifier.
callback Action Callback to invoke when complete.
Résultat void

SetStepsAtLeast() public méthode

Set an achievement to have at least the given number of steps completed.
Calling this method 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 is automatically unlocked, and any further mutation operations are ignored.
public SetStepsAtLeast ( string achId, int steps, Action callback ) : void
achId string Achievement identifier.
steps int Steps to increment to at least.
callback Action Callback to invoke when complete.
Résultat void

ShowAchievementsUI() public méthode

Shows the achievements UI
public ShowAchievementsUI ( Action callback ) : void
callback Action Callback to invoke when complete.
Résultat void

ShowLeaderboardUI() public méthode

Shows the leaderboard UI
public ShowLeaderboardUI ( string leaderboardId, LeaderboardTimeSpan span, Action callback ) : void
leaderboardId string Leaderboard identifier.
span LeaderboardTimeSpan Timespan to display.
callback Action Callback to invoke when complete.
Résultat void

SignOut() public méthode

Signs the user out.
public SignOut ( ) : void
Résultat void

SubmitScore() public méthode

Submits the score.
public SubmitScore ( string leaderboardId, long score, Action callback ) : void
leaderboardId string Leaderboard identifier.
score long Score to submit.
callback Action Callback to invoke when complete.
Résultat void

SubmitScore() public méthode

Submits the score for the currently signed-in player to the leaderboard associated with a specific id and metadata (such as something the player did to earn the score).
public SubmitScore ( string leaderboardId, long score, string metadata, Action callback ) : void
leaderboardId string Leaderboard identifier.
score long Score value to submit.
metadata string Metadata about the score.
callback Action Callback upon completion.
Résultat void

UnlockAchievement() public méthode

Unlocks the achievement.
public UnlockAchievement ( string achId, Action callback ) : void
achId string Achievement identifier.
callback Action Callback to invoke when complete.
Résultat void