Skip to main content

HighLevelApiClientFactory

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

Makes the API client the game uses (ApiAccess calls it) and holds the known API addresses. All of Alta's addresses here no longer answer.

Fields​

MemberWhat it is
const string DevelopmentEndpointAlta's development API address (/development_api).
const string DevelopmentWebsocketWebsocket address for the dev stage. Also the default websocket for CreateHighLevelClient.
const string LatestEndpointAPI address for the latest stage (/latest_api).
const string LatestWebsocketWebsocket address for the latest stage.
const string LocalEndpointLocal API address, http://localhost:13490/ (/local_api).
const string LocalWebsocketSet to Unsupported; there is no local websocket.
const string ProductionEndpointThe production API, https://webapi.townshiptale.com/.
const string ProductionWebsocketWebsocket address for the production stage.
const string PublicBaseEndpointBase Amazon API Gateway address the stage endpoints build on.
const string PublicBaseWebsocketBase Amazon websocket address the stage websockets build on.
const string TestEndpointAPI address for the test stage (/test_api).
const string TestWebsocketWebsocket address for the test stage.

Properties​

MemberWhat it is
static StatusAPI Status { get; }Shared StatusAPI client for the game's status messages.

Methods​

MemberWhat it is
static IHighLevelApiClient CreateHighLevelClient(string endpointUri = "https://webapi.townshiptale.com/", string websocketUri = "wss://5wx2mgoj95.execute-api.ap-southeast-2.amazonaws.com/dev/", string userAgent = null, int timeout = 40)Creates the online client for an endpoint and websocket address. Defaults to production with a 40 second timeout.
static IHighLevelApiClient CreateOfflineHighLevelClient(LoginCredentials credentials)Creates an OfflineHighLevelApiClient from stored login credentials.
static void SetLogging(LoggingConfiguration config)Replaces the NLog configuration for the whole process.