Vixen
02b45cc4
csharp
public sealed class GateClient

The four calls a game makes to a gate, and the token it carries between them.

Read the guide page for this →

Remarks

⚠ Nothing here throws for a refusal. A gate saying "that name is taken" or "fetch the update" is an ordinary answer, and turning it into an exception makes the client's happy path the only path anybody writes. Exceptions are for a request that did not happen, and even those are caught here and reported as Unreachable — because on a phone, "the network went away" is not exceptional either.

⚠ The token is held here and never written anywhere. Persisting it would make it a credential on disk with none of the protection a credential deserves, and the whole point of a twelve-hour session token is that signing in again is cheap.

Fields and properties (3)

  • public SignInResponse? Session

    The current session, once SignInAsync has succeeded.

  • public bool SignedIn

    Whether there is a session at all. Says nothing about whether it has expired.

  • public AuthenticationHeaderValue? Authorization

    The bearer header a service-plane socket needs.

Methods (8)

  • public GateClient(HttpClient http)

    The four calls a game makes to a gate, and the token it carries between them.

  • public Task<GateOutcome<CatalogResponse>> CatalogAsync(CancellationToken cancellation)

    What the fleet is running. The call to make before any other.

  • public Task<GateOutcome<SignInResponse>> SignInAsync(string scheme, string credential, CancellationToken cancellation)

    Turns a credential into a session, and remembers it.

  • public void SignOut()

    Forgets the session.

  • public Task<GateOutcome<CharacterList>> CharactersAsync(CancellationToken cancellation)

    The account's characters.

  • public Task<GateOutcome<CharacterSummary>> CreateCharacterAsync(CreateCharacterRequest request, CancellationToken cancellation)

    Makes a character.

  • public Task<GateOutcome<PlayResponse>> PlayAsync(PlayRequest request, CancellationToken cancellation)

    Asks to be put somewhere.

  • public Task<GateOutcome<PlayResponse>> EnterAsync(PlayRequest request, int attempts, CancellationToken cancellation)

    Asks to play, and waits out a shard that is coming up.

Used by (3)

  • GateClientTestsVixen.Live.Client.Tests
  • GateConnectionVixen.Live.Client
  • GateConnectionTestsVixen.Live.Client.Tests