EngineDiscovery Module
Functions for discovering and resolving BAR engine installations.
Functions and values
| Function or value |
Description
|
Full Usage:
defaultDataDir ()
Parameters:
unit
Returns: string option
The data directory path, or None if not found.
|
Returns the standard BAR data directory path if it exists and contains the expected maps/ and packages/ subdirectories.
|
Full Usage:
discoverEngines dataDir
Parameters:
string
-
The BAR data directory to scan.
Returns: DiscoveredEngine list
A list of discovered engine installations, newest first.
|
Scans the given data directory for installed engine versions. Returns a list of discovered engines sorted by version string descending (newest first).
|
Full Usage:
discoverGameVersion dataDir tag
Parameters:
string
-
The BAR data directory containing rapid/ subdirectory.
tag : string
-
The rapid tag to resolve (e.g., "byar:test").
Returns: DiscoveredGame option
The discovered game version, or None if the tag is not found.
|
Parses the rapid versions.gz file to resolve a game version tag to a concrete game name and hash.
|
Full Usage:
resolveEngine configPath
Parameters:
string option
-
Optional path to engine-version.json for version pinning.
Returns: EngineResolution
The resolved engine, game version, and resolution source.
|
Resolves the engine to use by checking, in order: (1) FSBAR_TEST_ENGINE / HIGHBAR_TEST_ENGINE environment variable, (2) engine-version.json config file (if configPath is provided), (3) automatic detection from the standard BAR data directory. Logs the resolved version and source. Raises an exception if no engine is found.
|
Full Usage:
resolveOverrideEnvVar ()
Parameters:
unit
Returns: (type)
|
Resolves which env-var override path to use (spec 045 FR-009).
Prefers
|
Full Usage:
validateEngine binaryPath versionString
Parameters:
string
-
The path to the engine binary to validate.
versionString : string
-
The version string for error reporting.
|
Validates that an engine binary exists and is executable. Raises an exception with an actionable error message if validation fails.
|
FSBarV1_Archived