Logo FSBarV1_Archived

SessionManager Type

The hub-wide session owner. Disposable — `Dispose` tears down any active session and unregisters the pump.

Instance members

Instance member Description

this.AdminStatus

Full Usage: this.AdminStatus

Returns: AdminChannelStatus option

Current admin-channel status, or `None` when no session is active (data-model.md §8 invariant I3). Feature 039.

Returns: AdminChannelStatus option

this.AttachLog

Full Usage: this.AttachLog

Parameters:
    log : T

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.

log : T

this.End

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.

this.ForceEnd

Full Usage: this.ForceEnd

Returns: SubmitOutcome

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).

Returns: SubmitOutcome

this.Frames

Full Usage: this.Frames

Returns: IObservable<GameFrame>

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.

Returns: IObservable<GameFrame>

this.IsLobbyEditable

Full Usage: this.IsLobbyEditable

Returns: bool

True when `State = Idle` — the Setup tab and the gRPC `ConfigureLobby` handler both gate on this.

Returns: bool

this.IsPaused

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).

Returns: bool

this.Launch

Full Usage: this.Launch

Parameters:
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`.

config : LobbyConfig
startPaused : bool
Returns: Result<unit, string>

this.Pause

Full Usage: this.Pause

Returns: SubmitOutcome

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`.

Returns: SubmitOutcome

this.Resume

Full Usage: this.Resume

Returns: SubmitOutcome

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`.

Returns: SubmitOutcome

this.SendAdminMessage

Full Usage: this.SendAdminMessage

Parameters:
    text : string

Returns: SubmitOutcome

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.

text : string
Returns: SubmitOutcome

this.SetEngineSpeed

Full Usage: this.SetEngineSpeed

Parameters:
    speed : float32

Returns: SubmitOutcome

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`.

speed : float32
Returns: SubmitOutcome

this.SetSpeed

Full Usage: this.SetSpeed

Parameters:
    speed : 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.

speed : float32

this.State

Full Usage: this.State

Returns: SessionState

Current lifecycle state. Thread-safe snapshot.

Returns: SessionState

this.Stop

Full Usage: this.Stop

Returns: SubmitOutcome

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`.

Returns: SubmitOutcome

this.TogglePause

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.

Type something to start searching.