public Task<RoomCreateResponse> CreateRoomAsync<T>(string gamePlayerToken,
string roomName,
int maxPlayers = 4,
string? password = null,
bool hostSwitch = false,
bool canLeaveRoom = true,
T? rules = null,
T? playerData = null,
CancellationToken ct = default)
Creates a new game room for multiplayer sessions with typed rules support, host switching, and player data. Max players: 2-16.
public Task<RoomListResponse<T>> GetRoomsAsync<T>(string? search = null, int? limit = null, CancellationToken ct = default)
Retrieves a list of all available game rooms with typed rules support. Supports search and limit parameters (limit: 1-50).
public Task<RoomJoinResponse> JoinRoomAsync(
string gamePlayerToken,
string roomId,
string? password = null,
T? playerData = null,
CancellationToken ct = default)
Joins an existing game room with optional password and player data.
public Task<RoomLeaveResponse> LeaveRoomAsync(
string gamePlayerToken,
CancellationToken ct = default)
Leaves the current game room.
public Task<RoomPlayersResponse> GetRoomPlayersAsync(
string gamePlayerToken,
CancellationToken ct = default)
Retrieves a list of all players in the current room.
public Task<HeartbeatResponse> SendHeartbeatAsync(
string gamePlayerToken,
CancellationToken ct = default)
Sends heartbeat to maintain connection in game room.
public Task<CurrentRoomResponse<T>> GetCurrentRoomAsync<T>(
string playerToken,
CancellationToken ct = default)
Gets comprehensive room state including player lists and pending actions with typed support.
public Task<SuccessResponse> StopRoomAsync(
string playerToken,
CancellationToken ct = default)
Stops the current game room (Host Only). Completely removes the room and all associated data.
public Task<RoomKickResponse> KickPlayerAsync(
string playerToken,
int playerId,
CancellationToken ct = default)
Kicks a player from the game room (Host Only). Cannot kick yourself.
public Task<SuccessResponse> UpdateRoomPasswordAsync(
string playerToken,
string? password = null,
CancellationToken ct = default)
Updates the room password (Host Only). Use empty string to remove password.
A room is one live game session. Create makes the caller the host; list browses public rooms without needing a player token; join enters by id — with a password for protected rooms. Players lists the occupants of the caller's current room, and leave, heartbeat and current manage the membership lifecycle.
The host gets the controls: stop the room, kick a member, set or clear the password. Room custom data holds shared state — map, mode, phase — that members read to stay in sync, and matchmaking lobbies spawn a linked room when the host starts.