ax.util¶
Source: gamemode/framework/util/util_version.lua
Utility helpers used across the Parallax framework (printing, file handling, text utilities, etc.).
Section: version_utilities
Documented functions: 4
Functions¶
ax.util:GetBranch()¶
Returns the Git branch name this Parallax build was made from.
Performs the same two-tier lookup as GetVersion: live ax.version data first, then ReadVersionFile() as a fallback. Falls back to "unknown" when unavailable, so this function always returns a string. Useful for distinguishing between "main", "staging", or feature branches when diagnosing issues across different server deployments.
Realm: shared
Returns
string: The branch name (e.g."main","staging"), or"unknown"if version data is not available.
Usage
ax.util:GetCommitCount()¶
Returns the total commit count for this Parallax build.
Performs the same two-tier lookup as GetVersion: live ax.version data first, then ReadVersionFile() as a fallback. The value is coerced to a number via tonumber. Falls back to 0 when unavailable, so this function always returns a number. The commit count is useful for comparing build recency without parsing the version string.
Realm: shared
Returns
number: The commit count, or0as a safe fallback.
Usage
ax.util:GetCommitHash()¶
Returns the short Git commit hash for this Parallax build.
Performs the same two-tier lookup as GetVersion: live ax.version data first, then ReadVersionFile() as a fallback. Falls back to an empty string "" when unavailable, so this function always returns a string.
The hash is useful for identifying the exact source revision when reporting bugs or comparing server builds.
Realm: shared
Returns
string: The short commit hash (e.g."a3f2c1d"), or""if version data is not available.
Usage
ax.util:GetVersion()¶
Utility helpers used across the Parallax framework (printing, file handling, text utilities, etc.).
Versioning utilities.
Returns the Parallax framework version string (e.g. "0.3.42").
Performs a two-tier lookup:
- If
ax.versionis a table andax.version.data.versionis set (the live in-memory version populated at framework startup), that value is returned immediately. - Otherwise,
ax.version:ReadVersionFile()is called to readversion.jsonfrom disk and extract theversionfield.
Falls back to "0.0.0" when neither source yields a value, so this function always returns a string — never nil.
Realm: shared
Returns
string: The version string, or"0.0.0"as a safe fallback.
Usage