.NET (C#) SDK — Matchmaking

Matchmaking

GetMatchmakingLobbiesAsync
public Task<MatchmakingListResponse<T>> GetMatchmakingLobbiesAsync<T>(string? search = null, int? limit = null, CancellationToken ct = default)

Lists all available matchmaking lobbies with typed rules support. Supports search and limit parameters (limit: 1-50).

CreateMatchmakingLobbyAsync
public Task<MatchmakingCreateResponse> CreateMatchmakingLobbyAsync<T>(string gamePlayerToken,
    string matchmakingName,
    int maxPlayers = 4,
    bool strictFull = false,
    bool joinByRequests = false,
    bool hostSwitch = false,
    bool canLeaveRoom = true,
    string? password = null,
    T? rules = null,
    T? playerData = null,
    CancellationToken ct = default)

Creates a new matchmaking lobby with name, optional password, typed rules support, host switching, and player data. Max players: 2-16.

RequestToJoinMatchmakingAsync
public Task<MatchmakingJoinRequestResponse> RequestToJoinMatchmakingAsync(
    string gamePlayerToken,
    string matchmakingId,
    CancellationToken ct = default)

Requests to join a matchmaking lobby that requires host approval.

RespondToJoinRequestAsync
public Task<MatchmakingPermissionResponse> RespondToJoinRequestAsync(
    string gamePlayerToken,
    string requestId,
    MatchmakingRequestAction action,
    CancellationToken ct = default)

Host responds to a join request (approve or reject).

CheckJoinRequestStatusAsync
public Task<MatchmakingRequestStatusResponse> CheckJoinRequestStatusAsync(
    string gamePlayerToken,
    string requestId,
    CancellationToken ct = default)

Checks the status of a join request.

GetCurrentMatchmakingStatusAsync
public Task<MatchmakingCurrentResponse<T>> GetCurrentMatchmakingStatusAsync<T>(string gamePlayerToken, CancellationToken ct = default)

Gets the current player's matchmaking status and lobby information with typed rules.

JoinMatchmakingDirectlyAsync
public Task<MatchmakingDirectJoinResponse> JoinMatchmakingDirectlyAsync(
    string gamePlayerToken,
    string matchmakingId,
    CancellationToken ct = default)

Joins a matchmaking lobby directly (only works if lobby doesn't require approval).

LeaveMatchmakingAsync
public Task<MatchmakingLeaveResponse> LeaveMatchmakingAsync(
    string gamePlayerToken,
    CancellationToken ct = default)

Leaves the current matchmaking lobby.

GetMatchmakingPlayersAsync
public Task<MatchmakingPlayersResponse> GetMatchmakingPlayersAsync(
    string gamePlayerToken,
    CancellationToken ct = default)

Gets all players in the current matchmaking lobby.

SendMatchmakingHeartbeatAsync
public Task<MatchmakingHeartbeatResponse> SendMatchmakingHeartbeatAsync(
    string gamePlayerToken,
    CancellationToken ct = default)

Sends heartbeat to maintain connection in matchmaking lobby.

RemoveMatchmakingLobbyAsync
public Task<MatchmakingRemoveResponse> RemoveMatchmakingLobbyAsync(
    string gamePlayerToken,
    CancellationToken ct = default)

Removes the matchmaking lobby (host only).

StartGameFromMatchmakingAsync
public Task<MatchmakingStartResponse> StartGameFromMatchmakingAsync(
    string gamePlayerToken,
    CancellationToken ct = default)

Starts a game from matchmaking lobby (host only).

StopMatchmakingAsync
public Task<SuccessResponse> StopMatchmakingAsync(
    string gamePlayerToken,
    CancellationToken ct = default)

Stops matchmaking lobby (Host Only). Cannot be called after game has started.

KickPlayerAsync
public Task<MatchmakingKickResponse> KickPlayerAsync(
    string playerToken,
    int playerId,
    CancellationToken ct = default)

Kicks a player from matchmaking lobby (Host Only). Cannot kick yourself or after matchmaking has started.

UpdateMatchmakingPasswordAsync
public Task<SuccessResponse> UpdateMatchmakingPasswordAsync(
    string playerToken,
    string? password = null,
    CancellationToken ct = default)

Updates the matchmaking password (Host Only). Cannot change password after matchmaking has started. Use empty string to remove password.

Lobbies, joins and host controls

Matchmaking is the discovery layer above rooms. List browses public lobbies — no player token needed, so players can window-shop before signing in. Create opens a lobby with your options mapped one-to-one onto wire fields; join attaches a player and creates the linked room; the host's start locks the lobby and spawns the live room everyone plays in.

Private lobbies use a join-request flow instead of open joins: guests request a seat and the host approves. Heartbeat keeps membership alive for the whole lobby lifetime, while leave and current cover exit and state reads. Host controls — stop, remove, kick, password — mirror the room-level controls.

  • Lobby entries are snapshots — refresh the list on a cadence rather than treating it as a live view.
  • Start locks the lobby and spawns the room: build your "all players ready" flow around that transition.
  • Matchmaking finds the game, the room runs it — gameplay traffic (updates, actions, realtime) uses the room APIs.
  • Methods are Task-based async — await them and pass a CancellationToken tied to your game's lifetime so in-flight requests cancel cleanly on shutdown.