leave

fun leave()

Signals a voluntary departure from the game session.

Publishes a vacate marker on the presence channel so the host immediately evicts this voter via RaftNode.changeMembership without waiting the reconnect window. This frees the seat for a replacement peer to join promptly.

Distinct from close. leave is a graceful cluster departure: it signals the host and then returns; the caller is responsible for calling close afterward to tear down the local session. close is always a hard local teardown with no cluster signalling.

Spectators and roster-given sessions. Calling leave on a spectator or on a session created by gameNode (no presence channel) is a no-op — those sessions are not voter seats and cannot be "vacated" in the lobby-presence sense.

Reconnect-after-PeerLost (resuming the old seat) is out of scope — a peer that returns after eviction joins as a new voter via a fresh gameJoin into the freed seat.