Logo FSBarV1_Archived

BarClient Type

High-level client for orchestrating a BAR AI game session. Manages the full lifecycle: engine launch, proxy connection, handshake, frame stepping, and cleanup.

Constructors

Constructor Description

BarClient(config)

Full Usage: BarClient(config)

Parameters:
Returns: BarClient

Creates a new BarClient with the given engine configuration.

config : EngineConfig
Returns: BarClient

Instance members

Instance member Description

this.Config

Full Usage: this.Config

Returns: EngineConfig

Gets the engine configuration used to create this client.

Returns: EngineConfig

this.Frames

Full Usage: this.Frames

Returns: IObservable<GameFrame>

Game frames as a push-based observable. Subscribers receive frames as they arrive from the engine. The observable completes when the engine disconnects or sends a shutdown message.

Returns: IObservable<GameFrame>

this.GameState

Full Usage: this.GameState

Returns: GameState

Gets the current game state snapshot, updated each frame.

Returns: GameState

this.Handshake

Full Usage: this.Handshake

Returns: HandshakeInfo option

Gets the handshake information received from the proxy, or None if not yet connected.

Returns: HandshakeInfo option

this.Reset

Full Usage: this.Reset

Resets the in-game state by sending cheat commands.

this.SendCommands

Full Usage: this.SendCommands

Parameters:

Queue commands to send with the next frame response.

commands : AICommand list

this.Start

Full Usage: this.Start

Launches the BAR engine, connects to the proxy, and performs the handshake.

this.State

Full Usage: this.State

Returns: SessionState

Gets the current lifecycle state of this session.

Returns: SessionState

this.Stop

Full Usage: this.Stop

Stops the session and cleans up all resources. Safe to call from any state.

this.Stream

Full Usage: this.Stream

Returns: NetworkStream

Gets the active network stream to the HighBar V2 proxy.

Returns: NetworkStream

this.WaitFrames

Full Usage: this.WaitFrames

Parameters:

Blocks and collects up to N frames from the observable, calling the handler for each. Useful for synchronous REPL-style stepping.

count : int
handler : GameFrame -> unit

Type something to start searching.