public static RoomCreateResponse createRoom(
Client client,
String playerToken,
String roomName,
int maxPlayers,
String password,
boolean hostSwitch,
boolean canLeaveRoom,
boolean realtime,
Object playerData,
Object rules
) throws IOException
Creates a new game room for multiplayer sessions with typed rules support, host switching, and player data. Max players: 2-16.
public static <T> RoomListResponse<T> getRooms(
Client client,
String search,
Integer limit,
Class<T> rulesType
) throws IOException
Retrieves a list of all available game rooms with typed rules support. Supports search and limit parameters (limit: 1-50).
public static RoomJoinResponse joinRoom(
Client client,
String playerToken,
String roomId,
String password,
Object playerData
) throws IOException
Joins an existing game room with optional password and player data.
public static RoomLeaveResponse leaveRoom(
Client client,
String playerToken
) throws IOException
Leaves the current game room.
public static <T> RoomPlayersResponse<T> getRoomPlayers(
Client client,
String playerToken,
Class<T> dataType
) throws IOException
Retrieves a list of all players in the current room.
public static HeartbeatResponse sendRoomHeartbeat(
Client client,
String playerToken
) throws IOException
Sends heartbeat to maintain connection in game room.
public static <T> CurrentRoomResponse<T> getCurrentRoom(
Client client,
String playerToken,
Class<T> rulesType
) throws IOException
Gets comprehensive room state including player lists and pending actions with typed support.
public static SuccessResponse stopRoom(
Client client,
String playerToken
) throws IOException
Stops the current game room (Host Only). Completely removes the room and all associated data.
public static RoomKickResponse kickPlayer(
Client client,
String playerToken,
int playerId
) throws IOException
Kicks a player from the game room (Host Only). Cannot kick yourself.
public static SuccessResponse updateRoomPassword(
Client client,
String playerToken,
String password
) throws IOException
Updates the room password (Host Only). Use empty string to remove password.