Interface IGameClient
The Game Client offers apis to achieve player-scale outcomes. It relies on player authentication to authorize most api calls.
Namespace: Unity.Services.Apis
Assembly: Unity.Services.Apis.dll
Syntax
public interface IGameClient
Properties
AccessToken
The access token applied to apis.
Declaration
string AccessToken { get; }
Property Value
Type | Description |
---|---|
string |
Analytics
Analytics Api
Declaration
IAnalyticsApi Analytics { get; }
Property Value
Type | Description |
---|---|
IAnalytics |
CloudCode
CloudCode Api
Declaration
ICloudCodeApi CloudCode { get; }
Property Value
Type | Description |
---|---|
ICloud |
CloudSaveData
CloudSave Player Data Api
Declaration
ICloudSaveDataApi CloudSaveData { get; }
Property Value
Type | Description |
---|---|
ICloud |
CloudSaveFiles
CloudSave Files Api
Declaration
ICloudSaveFilesApi CloudSaveFiles { get; }
Property Value
Type | Description |
---|---|
ICloud |
EconomyConfiguration
Economy Configuration Api
Declaration
IEconomyConfigurationApi EconomyConfiguration { get; }
Property Value
Type | Description |
---|---|
IEconomy |
EconomyCurrencies
Economy Currencies Api
Declaration
IEconomyCurrenciesApi EconomyCurrencies { get; }
Property Value
Type | Description |
---|---|
IEconomy |
EconomyInventory
Economy Inventory Api
Declaration
IEconomyInventoryApi EconomyInventory { get; }
Property Value
Type | Description |
---|---|
IEconomy |
EconomyPurchases
Economy Purchases Api
Declaration
IEconomyPurchasesApi EconomyPurchases { get; }
Property Value
Type | Description |
---|---|
IEconomy |
FriendsMessaging
Friends Messaging Api
Declaration
IFriendsMessagingApi FriendsMessaging { get; }
Property Value
Type | Description |
---|---|
IFriends |
FriendsNotifications
Friends Notifications Api
Declaration
IFriendsNotificationsApi FriendsNotifications { get; }
Property Value
Type | Description |
---|---|
IFriends |
FriendsPresence
Friends Presence Api
Declaration
IFriendsPresenceApi FriendsPresence { get; }
Property Value
Type | Description |
---|---|
IFriends |
FriendsRelationships
Friends Relationships Api
Declaration
IFriendsRelationshipsApi FriendsRelationships { get; }
Property Value
Type | Description |
---|---|
IFriends |
Leaderboards
Leaderboards Api
Declaration
ILeaderboardsApi Leaderboards { get; }
Property Value
Type | Description |
---|---|
ILeaderboards |
Lobby
Lobby Api
Declaration
ILobbyApi Lobby { get; }
Property Value
Type | Description |
---|---|
ILobby |
PlayerAuthentication
Player Authentication Api
Declaration
IPlayerAuthenticationApi PlayerAuthentication { get; }
Property Value
Type | Description |
---|---|
IPlayer |
PlayerNames
Player Names Api
Declaration
IPlayerNamesApi PlayerNames { get; }
Property Value
Type | Description |
---|---|
IPlayer |
QosDiscovery
Qos Discovery Api
Declaration
IQosDiscoveryApi QosDiscovery { get; }
Property Value
Type | Description |
---|---|
IQos |
RelayAllocations
Relay Allocations Api
Declaration
IRelayAllocationsApi RelayAllocations { get; }
Property Value
Type | Description |
---|---|
IRelay |
RemoteConfig
Remote Config Api
Declaration
IRemoteConfigSettingsApi RemoteConfig { get; }
Property Value
Type | Description |
---|---|
IRemote |
Methods
ClearAnalyticsUserId()
Clears the analytics user id from the headers of the supported services
Declaration
void ClearAnalyticsUserId()
ClearCredentials()
Clears the credentials from the configuration of all apis
Declaration
void ClearCredentials()
ClearInstallationId()
Clears the installation id from the headers of the supported services
Declaration
void ClearInstallationId()
SetAccessToken(string)
Sets the player access token for all apis.
Declaration
void SetAccessToken(string accessToken)
Parameters
Type | Name | Description |
---|---|---|
string | accessToken | The access token |
SetAnalyticsUserId(string)
Sets the analytics user id into the headers of the supported services
Declaration
void SetAnalyticsUserId(string analyticsUserId)
Parameters
Type | Name | Description |
---|---|---|
string | analyticsUserId | The analytics user id |
SetInstallationId(string)
Sets the installation id into the headers of the supported services
Declaration
void SetInstallationId(string installationId)
Parameters
Type | Name | Description |
---|---|---|
string | installationId | The installation id |
SignInWithCode(string, SignInWithCodeRequest, string, string, CancellationToken)
Sign in using a code obtained from requesting a code.
Declaration
ApiOperation<AuthenticationResponse> SignInWithCode(string projectId, SignInWithCodeRequest request, string environment = null, string codeLinkSessionId = null, CancellationToken token = default)
Parameters
Type | Name | Description |
---|---|---|
string | projectId | The project id |
Sign |
request | The request options |
string | environment | The environment name |
string | codeLinkSessionId | The code link session id |
Cancellation |
token | The optional cancellation token |
Returns
Type | Description |
---|---|
Api |
The operation |
SignInWithExternalToken(string, string, SignInWithExternalTokenRequest, string, CancellationToken)
Sign in using a token obtained from a supported external identity provider.
Declaration
ApiOperation<AuthenticationResponse> SignInWithExternalToken(string projectId, string idProvider, SignInWithExternalTokenRequest request, string environment = null, CancellationToken token = default)
Parameters
Type | Name | Description |
---|---|---|
string | projectId | The project id |
string | idProvider | The key for the identity provider |
Sign |
request | The request options |
string | environment | The environment name |
Cancellation |
token | The optional cancellation token |
Returns
Type | Description |
---|---|
Api |
The operation |
SignInWithSessionToken(string, SignInWithSessionTokenRequest, string, CancellationToken)
Sign in using a session token
Declaration
ApiOperation<AuthenticationResponse> SignInWithSessionToken(string projectId, SignInWithSessionTokenRequest request, string environment = null, CancellationToken token = default)
Parameters
Type | Name | Description |
---|---|---|
string | projectId | The project id |
Sign |
request | The request options |
string | environment | The environment name |
Cancellation |
token | The optional cancellation token |
Returns
Type | Description |
---|---|
Api |
The operation |
SignInWithUsernamePassword(string, UsernamePasswordRequest, string, CancellationToken)
Sign in using a username and password
Declaration
ApiOperation<AuthenticationResponse> SignInWithUsernamePassword(string projectId, UsernamePasswordRequest request, string environment = null, CancellationToken token = default)
Parameters
Type | Name | Description |
---|---|---|
string | projectId | The project id |
Username |
request | The request options |
string | environment | The environment name |
Cancellation |
token | The optional cancellation token |
Returns
Type | Description |
---|---|
Api |
The operation |
SignUpAnonymously(string, string, SignUpAnonymouslyRequest, CancellationToken)
Create a new anonymous player account
Declaration
ApiOperation<AuthenticationResponse> SignUpAnonymously(string projectId, string environment = null, SignUpAnonymouslyRequest request = null, CancellationToken token = default)
Parameters
Type | Name | Description |
---|---|---|
string | projectId | The project id |
string | environment | The environment name |
Sign |
request | The request options |
Cancellation |
token | The optional cancellation token |
Returns
Type | Description |
---|---|
Api |
The operation |
SignUpWithUsernamePassword(string, UsernamePasswordRequest, string, CancellationToken)
Sign up using a username and password
Declaration
ApiOperation<AuthenticationResponse> SignUpWithUsernamePassword(string projectId, UsernamePasswordRequest request, string environment = null, CancellationToken token = default)
Parameters
Type | Name | Description |
---|---|---|
string | projectId | The project id |
Username |
request | The request options |
string | environment | The environment name |
Cancellation |
token | The optional cancellation token |
Returns
Type | Description |
---|---|
Api |
The operation |
Events
AccessTokenChanged
Event raised when the access token changed.
Declaration
event Action AccessTokenChanged
Event Type
Type | Description |
---|---|
Action |