Skip to content

feat(host): expose the current game language and low violence through SteamApps - #5

Merged
hzqst merged 1 commit into
mainfrom
feat/host-apps-language-low-violence
Nov 22, 2026
Merged

hzqst merged 1 commit into
mainfrom
feat/host-apps-language-low-violence

Conversation

@hzqst

@hzqst hzqst commented Nov 22, 2026

Copy link
Copy Markdown
Contributor

Summary

Host mode gains two client queries on the SteamApps009 interface the bridge already resolves for SteamBridge_UserIsSubscribedApp:

  • SteamBridge_UserGetCurrentGameLanguage(char* language, uint32_t capacity) copies ISteamApps::GetCurrentGameLanguage(), truncated and NUL-terminated. SB_INVALID_ARGUMENT for a NULL buffer or zero capacity, SB_UNAVAILABLE without SteamApps, SB_FAILED when Steam returns no language; the buffer is cleared on every failure.
  • SteamBridge_UserIsLowViolence(uint32_t* lowViolence) returns ISteamApps::BIsLowViolence(); the output is cleared when SteamApps is unavailable.

Both are C exports with the SteamBridge_ prefix, so the Linux version script exports them without changes. No Steam object crosses the ABI.

The consumer is the HLND2T engine. When started with -steam, its filesystem setup takes the language directory and the low-violence (_lv) paths from Steam, as GoldSrc does (SteamApps()->GetCurrentGameLanguage(), BIsLowViolence()), instead of reading the registry.

Tests

  • tests/HostStubs.h: StubApps, covering every SteamApps009 method of Steamworks SDK v1.65.
  • tests/MockHost.cpp: the fixture returns SteamApps only after MockHostSetApps(available, language, lowViolence), so the existing "SteamApps unavailable" assertions keep their meaning.
  • tests/Host.cpp:
    • The unavailable-runtime path and a client without SteamApps report SB_UNAVAILABLE and cleared outputs.
    • The new Apps case covers the subscribed and not-subscribed results, the language and its truncation, invalid arguments, low violence, and a SteamApps that returns no language (SB_FAILED).

Verification

  • Windows x64 Release (scripts\build-SteamAPIBridge-x64-Release.bat): build, CTest 3/3 passed (Unavailable, Host, Modern).
  • Windows x86 Release (scripts\build-SteamAPIBridge-x86-Release.bat): build, CTest 4/4 passed (Unavailable, Host, Modern, Legacy).
  • format-check: 14 files, 0 with differences.
  • Not run: the Linux build and CTest (no Linux environment here), and SteamBridgeHostSmoke against a real Steam client. The real-game check will be done with the HLND2T engine change.

🤖 Generated with Claude Code

… SteamApps

Add SteamBridge_UserGetCurrentGameLanguage and SteamBridge_UserIsLowViolence, read from the host client's SteamApps009 like SteamBridge_UserIsSubscribedApp. The host fixture now provides SteamApps on request (MockHostSetApps), so CTest covers subscription, language (truncation, missing language, invalid arguments) and low violence as well as their unavailability.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
@hzqst
hzqst merged commit e99fe65 into main Nov 22, 2026
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant