Skip to main content

HighLevelApiClient

A class in Alta.Api.Client, Alta.Api.Client.HighLevel.

The online client for Alta's web API, one sub-client per area. Made by HighLevelApiClientFactory and reached through ApiAccess.ApiClient. Both sides; most calls now time out because the services are gone.

Constructors​

1 private and internal constructor
MemberWhat it is
internal HighLevelApiClient(string endpointUri, string websocketUri, string userAgent = null, int timeout = 40)Creates a HighLevelApiClient from endpointUri, websocketUri, userAgent and timeout.

Fields​

2 private and internal fields
MemberWhat it is
private static readonly Logger LoggerLogger for this class.
private string websocketUriWebsocket address passed in by the factory. Stored but not read by this class.

Properties​

MemberWhat it is
IAccountClient Account { get; private set; }Account client. Made at login, null before.
IAchievementClient AchievementClient { get; private set; }Achievements client. Made at login, null before.
IAnalyticsClient Analytics { get; }Analytics client. Made in the constructor, so it exists before login.
IFutureUserActions FutureUserActions { get; private set; }Future user actions client. Made at login, null before.
IGroupsClient Groups { get; private set; }Groups client. Made at login, null before.
IInstancesClient Instances { get; private set; }Instances client. Made at login, null before.
bool IsLoggedIn { get; }True when UserClient.LoggedInUserInfo is set.
ILauncherApiClient LauncherClient { get; private set; }Launcher client. Made at login, null before.
LowLevelApiClient LowLevel { get; }The LowLevelApiClient that makes the HTTP requests and holds the tokens.
IMatchMakingClient MatchMaking { get; private set; }Matchmaking client. Made at login, null before.
IOculusClient Oculus { get; }Oculus client. Made in the constructor.
IPicoClient Pico { get; }Pico client. Made in the constructor.
IPlayerReportsClient PlayerReports { get; private set; }Player reports client. Made at login, null before.
IRecentPlayersClient RecentPlayers { get; private set; }Recent players client. Made at login, null before.
ISecurityApiClient SecurityClient { get; private set; }Security client (bans and similar). Made at login, null before.
IServerApiClient ServerClient { get; private set; }Server client (server lists, permissions, joining). Made at login, null before.
IServicesApiClient ServicesClient { get; }Services client (public IP lookup, token checks). Made in the constructor.
ISettingsClient SettingsClient { get; private set; }Settings client. Made at login, null before.
IShopApiClient ShopClient { get; private set; }Shop client. Made at login, null before.
ISocialClient SocialClient { get; private set; }Social client (friends). Made at login, null before.
IUserApiClient UserClient { get; }User client; its LoggedInUserInfo is the current login. Made in the constructor.
LoginCredentials UserCredentials { get; }The current login tokens, from LowLevel.Credentials.
IVoiceApiClient VoiceClient { get; private set; }Voice client. Made at login, null before.
1 private and internal property
MemberWhat it is
private LowLevelApiClient Alta.Api.Client.HighLevel.IHighLevelApiClientManager.ApiClient { get; }Gives the sub-clients the shared LowLevel client.

Events​

MemberWhat it is
event LoginCredentialsChangedHandler CredentialsChangedRaised by the low level client when the login tokens change, with the old and new credentials.

Methods​

MemberWhat it is
async Task<IUserApiClient> LoginAsync(string username, string passwordHash)Logs in with a username and password hash, sending the device id. Throws if already logged in.
async Task<IUserApiClient> LoginViaOauth(string clientId, string clientSecret, string scope)Logs in with an OAuth client id, secret and scope; AuthenticationUtility uses it. Throws if already logged in.
async Task<IUserApiClient> LoginWithEmailAsync(string email, string passwordHash)Logs in with an email and password hash. Throws if already logged in.
async Task<IUserApiClient> LoginWithOculus(string userNonce, ulong userIdentifier)Logs in with a linked Oculus account's nonce and user id. Throws if already logged in.
async Task<IUserApiClient> LoginWithPico(string userToken, ulong userIdentifier)Logs in with a linked Pico account's token and user id. Throws if already logged in.
async Task<IUserApiClient> LoginWithRefreshTokenAsync(string refreshToken)Logs in by exchanging a refresh token. Throws if already logged in.
IUserApiClient LoginWithTokens(string accessToken, string refreshToken, string identityToken)Logs in from access, refresh and identity tokens without a request, reading the user from their claims. How /access_token and TavernLib log in.
void Logout()Clears the low level login and the logged-in user. The logged-in sub-clients are left in place.
async Task<UserInfo> RegisterOculusUserAsync(string username, string passwordHash, string email, string referral, AccountLinkData accountLink = null)Registers a new account linked to an Oculus account.
async Task<UserInfo> RegisterPicoUserAsync(string username, string passwordHash, string email, string referral, AccountLinkData accountLink = null)Registers a new account linked to a Pico account.
async Task<UserInfo> RegisterUserAsync(string username, string passwordHash, string email, string referral)Registers a new account with a username, password hash, email and referral.
1 private and internal method
MemberWhat it is
private void CreateLoggedInApiClients(UserInfoWithPermissions loggedInUser)Stores the logged-in user and creates every sub-client that needs a login. Called by each login method.

Used in​

Members of other types that take, return or hold a HighLevelApiClient: