SessionManager Type
The hub-wide session owner. Disposable — `Dispose` tears down any active session and unregisters the pump.
Instance members
| Instance member |
Description
|
|
Current admin-channel status, or `None` when no session is active (data-model.md §8 invariant I3). Feature 039.
|
|
Feature 042: plug in a `HubLog` bus so state transitions, admin dispatches, and diagnostics emit onto the gRPC log stream. Safe to call at most once; later calls replace the previously-attached bus. Before attachment, emit sites are no-ops.
|
Full Usage:
this.End
|
Tear down the active session. Safe to call from any state. Does not exit the hub process or close gRPC clients. |
|
Force-end the active match (feature 039 US3). Sends `KILLSERVER` through the admin channel and arms a wall-clock watchdog that escalates to SIGTERM at 5 s and SIGKILL at 8 s if the engine hasn't exited (research.md §R8).
|
|
Observable of `GameFrame` values sourced from the underlying `BarClient`. Subscribers only receive frames while a session is `Running`; transitions to `Idle` / `Failed` complete per-subscription streams as the underlying `BarClient` `Frames` observable completes.
|
Full Usage:
this.IsLobbyEditable
Returns: bool
|
True when `State = Idle` — the Setup tab and the gRPC `ConfigureLobby` handler both gate on this.
|
Full Usage:
this.IsPaused
Returns: bool
|
True when the hub has most recently issued a pause to the engine. Not a live mirror of the engine state — BAR's native UI can flip the engine pause out-of-band without the hub noticing (research.md §R2 pick A / §R4).
|
Full Usage:
this.Launch
Parameters:
LobbyConfig
startPaused : bool
Returns: Result<unit, string>
|
Launch a new session. Returns `Ok ()` after the state has transitioned to `Starting`; the actual connection work happens on a background thread and publishes a later `StateChanged Running` or `StateChanged Failed`. Returns `Error msg` if the lobby does not validate against the current `BarInstall`, or if a session is already running (caller must `End` first). `startPaused` — feature 038 FR-003/004: when `true`, the hub issues a single `/pause` chat command via `BarClient.SendCommands` on the first `Running` transition, before the engine produces a non-zero-time frame. The caller sources this from `HubSettings.StartPausedDefault`.
|
|
Pause the active match via the admin channel (feature 039). Returns `Rejected` when no session is active or when the admin channel is not `Attached`.
|
|
Resume the active match via the admin channel (feature 039). Returns `Rejected` when no session is active or when the admin channel is not `Attached`.
|
|
Broadcast an admin message into the engine's in-game chat log (feature 039 US4). Empty / whitespace-only strings reject locally without touching the socket.
|
|
Set the engine speed multiplier via the admin channel (feature 039). Values that are non-positive, NaN, or infinite are rejected locally without touching the socket. Engine-range rejection arrives as a `HubEvent.DiagnosticsLine Warning`.
|
Full Usage:
this.SetSpeed
Parameters:
float32
|
Request an engine speed change. Phase-3 scope: emits `HubEvents.EngineSpeedChanged` and updates the hub-side target speed for display. Actual engine wire-up lands with the AI-command plumbing in Phase 9 / US7.
|
|
Current lifecycle state. Thread-safe snapshot.
|
|
Abort the currently-running or starting session via `End`. Returns `Sent` on success; `Rejected "no active session"` when the state is already `Idle`. Emits `StateChanged` on transition through the same path as `End`.
|
Full Usage:
this.TogglePause
|
Flip pause/unpause in a single call. Safe from any state; emits `SessionPaused` exactly once per toggle. Backing the Viewer-tab pause button (FR-004b). Dispatches to `Pause` or `Resume` based on the current `IsPaused` reading. |
FSBarV1_Archived