Class HttpGameyeApiClient

Namespace
Unity.Multiplayer.Core

IGameyeApiClient over Gameye's REST API (https://api.gameye.com: image registration plus session start/stop). Verify the exact request and response shape against Gameye's current docs before depending on this for a public launch -- a third-party API's schema can drift after this was written, which is also why the real-provider smoke test is opt-in rather than part of every build.

public sealed class HttpGameyeApiClient : IGameyeApiClient, IDisposable
Inheritance
HttpGameyeApiClient
Implements
Inherited Members

Constructors

HttpGameyeApiClient(HttpClient, bool)

Uses client as already configured (base address and auth header); disposes it only when ownsClient is true.

public HttpGameyeApiClient(HttpClient client, bool ownsClient = false)

Parameters

client HttpClient
ownsClient bool

Exceptions

ArgumentNullException

client is null.

HttpGameyeApiClient(string)

Talks to Gameye at https://api.gameye.com/ with apiKey as a bearer token.

public HttpGameyeApiClient(string apiKey)

Parameters

apiKey string

Exceptions

ArgumentException

apiKey is empty.

Methods

Dispose()

Disposes the HttpClient if this object created it.

public void Dispose()

GetSessionAsync(string, CancellationToken)

The session's current status and port mapping.

public Task<GameyeSession> GetSessionAsync(string sessionId, CancellationToken cancellationToken = default)

Parameters

sessionId string
cancellationToken CancellationToken

Returns

Task<GameyeSession>

RegisterImageAsync(GameyeImageRegistration, CancellationToken)

Registers (or updates) the image Gameye pulls sessions from. Idempotent: call it again whenever mp-host pushes a new image under the same name.

public Task RegisterImageAsync(GameyeImageRegistration registration, CancellationToken cancellationToken = default)

Parameters

registration GameyeImageRegistration
cancellationToken CancellationToken

Returns

Task

StartSessionAsync(GameyeStartSessionRequest, CancellationToken)

Starts a session for one match.

public Task<GameyeSession> StartSessionAsync(GameyeStartSessionRequest request, CancellationToken cancellationToken = default)

Parameters

request GameyeStartSessionRequest
cancellationToken CancellationToken

Returns

Task<GameyeSession>

StopSessionAsync(string, CancellationToken)

Stops a session. Safe to call on one already gone.

public Task StopSessionAsync(string sessionId, CancellationToken cancellationToken = default)

Parameters

sessionId string
cancellationToken CancellationToken

Returns

Task