docs.unity3d.com
Search Results for

    Show / Hide Table of Contents

    Interface IServerClient

    The Server Client provides functionality for servers that want to use Unity Services. Authorization can be done through either Service Account authentication or running within a Hosted Game Server.

    Namespace: Unity.Services.Apis
    Assembly: Unity.Services.Apis.dll
    Syntax
    public interface IServerClient

    Properties

    AccessToken

    The access token applied to apis.

    Declaration
    string AccessToken { get; }
    Property Value
    Type Description
    string

    CloudCode

    CloudCode Api

    Declaration
    ICloudCodeApi CloudCode { get; }
    Property Value
    Type Description
    ICloudCodeApi

    CloudSaveData

    CloudSave Player Data Api

    Declaration
    ICloudSaveDataApi CloudSaveData { get; }
    Property Value
    Type Description
    ICloudSaveDataApi

    CloudSaveFiles

    CloudSave Files Api

    Declaration
    ICloudSaveFilesApi CloudSaveFiles { get; }
    Property Value
    Type Description
    ICloudSaveFilesApi

    EconomyConfiguration

    Economy Configuration Api

    Declaration
    IEconomyConfigurationApi EconomyConfiguration { get; }
    Property Value
    Type Description
    IEconomyConfigurationApi

    EconomyCurrencies

    Economy Currencies Api

    Declaration
    IEconomyCurrenciesApi EconomyCurrencies { get; }
    Property Value
    Type Description
    IEconomyCurrenciesApi

    EconomyInventory

    Economy Inventory Api

    Declaration
    IEconomyInventoryApi EconomyInventory { get; }
    Property Value
    Type Description
    IEconomyInventoryApi

    EconomyPurchases

    Economy Purchases Api

    Declaration
    IEconomyPurchasesApi EconomyPurchases { get; }
    Property Value
    Type Description
    IEconomyPurchasesApi

    Leaderboards

    Leaderboards Api

    Declaration
    ILeaderboardsApi Leaderboards { get; }
    Property Value
    Type Description
    ILeaderboardsApi

    Lobby

    Lobby Api

    Declaration
    ILobbyApi Lobby { get; }
    Property Value
    Type Description
    ILobbyApi

    PlayerNames

    Player Names Api

    Declaration
    IPlayerNamesApi PlayerNames { get; }
    Property Value
    Type Description
    IPlayerNamesApi

    Methods

    ClearCredentials()

    Clears the credentials from the configuration of all apis

    Declaration
    void ClearCredentials()

    SetAccessToken(string)

    Apply the access token to the apis

    Declaration
    void SetAccessToken(string accessToken)
    Parameters
    Type Name Description
    string accessToken

    The access token

    SetServiceAccount(string, string)

    Set the service account that the apis will use.

    Declaration
    void SetServiceAccount(string apiKey, string apiSecret)
    Parameters
    Type Name Description
    string apiKey

    The service account key

    string apiSecret

    The service account secret

    SignInWithServiceAccount(string, string, List<string>, CancellationToken)

    Exchange service account credentials for an access token to use with game apis.

    • IMPORTANT * Always protect your service account credentials. Make sure service account information is never used in a game client.
    Declaration
    ApiOperation<ExchangeResponse> SignInWithServiceAccount(string projectId, string environmentId, List<string> scopes = null, CancellationToken token = default)
    Parameters
    Type Name Description
    string projectId

    The cloud project id

    string environmentId

    The environment id

    List<string> scopes

    The permission scopes

    CancellationToken token

    The optional cancellation token

    Returns
    Type Description
    ApiOperation<ExchangeResponse>

    The operation

    In This Article
    Back to top
    Copyright © 2024 Unity Technologies — Trademarks and terms of use
    • Legal
    • Privacy Policy
    • Cookie Policy
    • Do Not Sell or Share My Personal Information
    • Your Privacy Choices (Cookie Settings)