pub struct Room {Show 27 fields
pub room_id: String,
pub room_name: String,
pub protocol_version: u32,
pub host_player_id: String,
pub host_username: String,
pub hosted: bool,
pub official: bool,
pub password: Option<String>,
pub max_players: u8,
pub format: GameFormat,
pub engine: EngineKind,
pub status: RoomStatus,
pub players: Vec<RoomSlot>,
pub observers: Vec<RoomObserver>,
pub draft_config: Option<DraftConfig>,
pub sealed_config: Option<SealedConfig>,
pub reconnect_timeout_s: u32,
pub table_style: Option<String>,
pub replay: Option<GameReplayCache>,
pub resume_token: String,
pub humanless_since: Option<Instant>,
pub limited_session_id: Option<String>,
pub draft_clock: Option<DraftClock>,
pub parent_limited_room: Option<String>,
pub limited_matches: Vec<String>,
pub transports: HashMap<String, TransportEndpoint>,
pub chat: ChatHistory,
}Fields§
§room_id: String§room_name: String§protocol_version: u32§host_player_id: String§host_username: String§hosted: bool§official: bool§password: Option<String>§max_players: u8§format: GameFormat§engine: EngineKind§status: RoomStatus§players: Vec<RoomSlot>§observers: Vec<RoomObserver>§draft_config: Option<DraftConfig>§sealed_config: Option<SealedConfig>§reconnect_timeout_s: u32§table_style: Option<String>§replay: Option<GameReplayCache>§resume_token: String§humanless_since: Option<Instant>§limited_session_id: Option<String>§draft_clock: Option<DraftClock>§parent_limited_room: Option<String>§limited_matches: Vec<String>§transports: HashMap<String, TransportEndpoint>Announced endpoints by player id. Only the relay binds one to a username.
chat: ChatHistoryImplementations§
Source§impl Room
impl Room
pub fn new( room_id: String, room_name: String, protocol_version: u32, host_player_id: String, host_username: String, max_players: u8, format: GameFormat, engine: EngineKind, host_plays: bool, draft_config: Option<DraftConfig>, sealed_config: Option<SealedConfig>, official: bool, password: Option<String>, reconnect_timeout_s: u32, table_style: Option<String>, ) -> Self
pub fn is_full(&self) -> bool
pub fn is_empty(&self) -> bool
pub fn is_limited_session(&self) -> bool
pub fn reset_lobby_settings(&mut self)
pub fn all_ready(&self) -> bool
pub fn add_player( &mut self, player_id: String, username: String, is_bot: bool, ) -> Result<(), String>
pub fn add_observer( &mut self, player_id: String, _username: String, ) -> Result<(), String>
pub fn remove_player(&mut self, player_id: &str) -> Option<RoomSlot>
pub fn remove_observer(&mut self, player_id: &str) -> Option<RoomObserver>
pub fn remove_participant(&mut self, player_id: &str) -> bool
pub fn set_connected(&mut self, player_id: &str, connected: bool)
Sourcepub fn all_disconnected(&self) -> bool
pub fn all_disconnected(&self) -> bool
Forward-ported for future use when room cleanup logic is implemented.
pub fn has_connected_human(&self) -> bool
pub fn set_ready(&mut self, player_id: &str, ready: bool) -> Result<(), String>
pub fn set_deck_selection( &mut self, player_id: &str, deck_name: String, deck: Deck, published_deck_id: Option<String>, commander_name: Option<String>, avatar_url: Option<String>, ) -> Result<(), String>
pub fn has_selected_deck(&self, player_id: &str) -> bool
pub fn player_decks(&self) -> Vec<PlayerDeckInfo>
pub fn is_host(&self, player_id: &str) -> bool
Sourcepub fn controller_id(&self) -> Option<&str>
pub fn controller_id(&self) -> Option<&str>
The room controller is the first human (non-bot) player to take a seat.
They drive the lobby (format, seats, bots, start) regardless of who holds
the engine (host). Computed dynamically from current seats, so if the
controlling human leaves, control passes to the next human — never to a
bot. Falls back to the first seat only if every player is a bot.
pub fn is_controller(&self, player_id: &str) -> bool
pub fn host_username(&self) -> String
pub fn host_is_player(&self) -> bool
pub fn host_connected(&self) -> bool
pub fn player_usernames(&self) -> Vec<String>
Sourcepub fn player_ids(&self) -> Vec<String>
pub fn player_ids(&self) -> Vec<String>
Forward-ported for future use when full player ID tracking is needed.
pub fn connected_player_ids(&self) -> Vec<String>
pub fn to_room_info(&self) -> RoomInfo
Source§impl Room
impl Room
Sourcepub fn participant_id_by_username(&self, username: &str) -> Option<String>
pub fn participant_id_by_username(&self, username: &str) -> Option<String>
Seats and the host only; observers are not signalling targets.
Sourcepub fn set_transport(
&mut self,
player_id: &str,
endpoint: Option<TransportEndpoint>,
) -> bool
pub fn set_transport( &mut self, player_id: &str, endpoint: Option<TransportEndpoint>, ) -> bool
Records a member’s endpoint, or withdraws it with None. False means refused.
Sourcepub fn transport_members(&self) -> Vec<TransportMember>
pub fn transport_members(&self) -> Vec<TransportMember>
The attested roster; every username is the relay’s own record.
pub fn transport_host(&self) -> Option<TransportMember>
Sourcepub fn transport_consented(&self) -> bool
pub fn transport_consented(&self) -> bool
Whether every human seat has announced. Bots never count.