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.