Documentation
¶
Index ¶
Constants ¶
const BuiltForAPIVersion = "v0.531.4"
BuiltForAPIVersion is the server API version this client was built against. Update this constant when updating response structs and command signatures to match a new server API version.
Verification status (see docs/superpowers/specs/2026-07-08-api-drift-audit-findings.md): command coverage is verified and guarded against drift by pkg/game.TestServerCommandsCoveredByClient. Response-struct verification is partial — fields the client reads are verified for every response with a live sample in data/game-api/latest/, but structs lacking a live sample (openapi is an incomplete superset) remain unverified and are itemized in the findings doc.
The v0.473.0 -> v0.495.1 bump (2026-07-13) was driven by a full path- and field-level diff of the openapi snapshots rather than a struct re-audit: it added the espionage command, dropped the removed ShipClass price/ required_skills fields, and picked up the new additive fields. The pre-v0.473.0 drift called out in the findings doc remains unaudited.
The v0.495.1 -> v0.531.4 bump (2026-07-19) added the /shipping freight-carrier client (serverapi shipping structs + GameClient methods). The value tracks server_docs/openapi.20260719.json (x-gameserver-version v0.531.4), the openapi snapshot the shipping structs were built from; the server_docs/openapi.json symlink still points at the older v0.501.0 snapshot (a stale-symlink follow-up, not this constant).
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type SemVer ¶
SemVer represents a semantic version (Major.Minor.Patch)
func GetDocVersion ¶
GetDocVersion reads and parses the version from server_docs/api.md
func ParseSemVer ¶
ParseSemVer parses a semantic version string like "v0.43.6" or "0.43.6"
func (SemVer) Compare ¶
Compare compares two versions and returns the difference Positive values mean v is greater than other, negative means v is less than other
type VersionCheck ¶
type VersionCheck struct {
ServerVersion SemVer
ExpectedVersion SemVer
MajorMismatch bool
MinorDiff int // Difference in minor versions (0 if major differs)
WarningMessage string
ErrorMessage string
}
VersionCheck holds the result of a version compatibility check
func CheckVersion ¶
func CheckVersion(serverVersionStr string) (*VersionCheck, error)
CheckVersion compares the server version against the version this client was built for. Uses the BuiltForAPIVersion constant, not the server_docs files (which may be newer).
func (*VersionCheck) Banner ¶
func (vc *VersionCheck) Banner() string
Banner returns a multi-line banner for version warnings
func (*VersionCheck) Check ¶
func (vc *VersionCheck) Check() bool
Check returns true if versions are compatible (no major mismatch, minor diff <= 10)