Java SDK — Matchmaking

Matchmaking

Matchmaking.getMatchmakingLobbies
public static <T> MatchmakingListResponse<T> getMatchmakingLobbies(
    Client client,
    String search,
    Integer limit,
    Class<T> rulesType
) throws IOException

Retrieves a list of all available matchmaking lobbies with typed rules support.

Requests.createMatchmakingLobby
public static MatchmakingCreateResponse createMatchmakingLobby(
    Client client,
    String playerToken,
    String matchmakingName,
    int maxPlayers,
    boolean strictFull,
    boolean joinByRequests,
    boolean hostSwitch,
    boolean canLeaveRoom,
    boolean realtimeRoom,
    String password,
    Object playerData,
    Object rules
) throws IOException

Creates a matchmaking lobby with typed player data and rules support. Supports approval-based or direct join modes.

Matchmaking.joinMatchmakingDirectly
public static MatchmakingDirectJoinResponse joinMatchmakingDirectly(
    Client client,
    String playerToken,
    String matchmakingId,
    Object playerData
) throws IOException

Joins a matchmaking lobby directly (requires lobby to be in direct join mode).

Requests.requestToJoinMatchmaking
public static MatchmakingJoinRequestResponse requestToJoinMatchmaking(
    Client client,
    String playerToken,
    String matchmakingId,
    Object playerData
) throws IOException

Requests to join a matchmaking lobby (requires lobby to be in approval mode).

Requests.respondToJoinRequest
public static MatchmakingPermissionResponse respondToJoinRequest(
    Client client,
    String playerToken,
    String requestId,
    EMatchmakingRequestAction action
) throws IOException

Responds to a join request (APPROVE or REJECT). Host only.

Matchmaking.getCurrentMatchmakingStatus
public static <T> MatchmakingCurrentResponse<T> getCurrentMatchmakingStatus(
    Client client,
    String playerToken,
    Class<T> rulesType
) throws IOException

Gets current matchmaking lobby status with typed rules support.

Matchmaking.getMatchmakingPlayers
public static <T> MatchmakingPlayersResponse<T> getMatchmakingPlayers(
    Client client,
    String playerToken,
    Class<T> dataType
) throws IOException

Gets list of players in the matchmaking lobby with typed player data.

Matchmaking.startGameFromMatchmaking
public static MatchmakingStartResponse startGameFromMatchmaking(
    Client client,
    String playerToken
) throws IOException

Starts the game from matchmaking lobby and creates a room. Host only.

Matchmaking.leaveMatchmaking
public static MatchmakingLeaveResponse leaveMatchmaking(
    Client client,
    String playerToken
) throws IOException

Leaves the current matchmaking lobby.

Matchmaking.sendMatchmakingHeartbeat
public static MatchmakingHeartbeatResponse sendMatchmakingHeartbeat(
    Client client,
    String playerToken
) throws IOException

Sends heartbeat to maintain connection in matchmaking lobby.

Matchmaking.removeMatchmakingLobby
public static MatchmakingRemoveResponse removeMatchmakingLobby(
    Client client,
    String playerToken
) throws IOException

Removes the matchmaking lobby (Host Only).

Matchmaking.stopMatchmaking
public static SuccessResponse stopMatchmaking(
    Client client,
    String playerToken
) throws IOException

Stops the matchmaking lobby before it has been started (Host Only).

Matchmaking.kickPlayer
public static MatchmakingKickResponse kickPlayer(
    Client client,
    String playerToken,
    int playerId
) throws IOException

Kicks a player from the matchmaking lobby (Host Only).

Matchmaking.updateMatchmakingPassword
public static SuccessResponse updateMatchmakingPassword(
    Client client,
    String playerToken,
    String password
) throws IOException

Updates the matchmaking lobby password (Host Only).

Requests.checkJoinRequestStatus
public static MatchmakingRequestStatusResponse checkJoinRequestStatus(
    Client client,
    String playerToken,
    String requestId
) throws IOException

Checks the status of a specific join request.

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.
  • Calls return CompletableFuture — compose with thenApply/thenAccept, or join() on a worker thread when blocking is acceptable; never join on a UI or render thread.