host

abstract suspend fun host(pattern: Pattern, memberName: String? = null, roomId: RoomId? = null): Room

Host a new room. The caller's peer becomes the SessionRole.Host.

memberName is this peer's own roster name — the label other members see for it. It defaults to null, in which case the peer's own id (Room.selfId) is used. It is deliberately not derived from Pattern.sessionName: the session name names the session, not this member (#1177).

roomId is this room's identity (Room.roomId). It defaults to null, in which case the factory mints a fresh one — a new room every time, which is what makes Room.roomId a per-session key rather than a per-device one (#1594).

Supply it when the identity is decided outside kuilt and the room must adopt it rather than invent its own: a lobby code or invite link the players already hold, a game id a matchmaking service assigned, or an id a durable record was keyed on before the room could be woven. Every member then reads that exact value off Room.roomId.

It does not make a host restart resumable — see Room.roomId; that is #1593's problem, and reusing an id does not solve it.