Repository navigation
feat(host): expose the current game language and low violence through SteamApps - #5
Merged
Merged
Conversation
… 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>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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)copiesISteamApps::GetCurrentGameLanguage(), truncated and NUL-terminated.SB_INVALID_ARGUMENTfor a NULL buffer or zero capacity,SB_UNAVAILABLEwithout SteamApps,SB_FAILEDwhen Steam returns no language; the buffer is cleared on every failure.SteamBridge_UserIsLowViolence(uint32_t* lowViolence)returnsISteamApps::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 afterMockHostSetApps(available, language, lowViolence), so the existing "SteamApps unavailable" assertions keep their meaning.tests/Host.cpp:SB_UNAVAILABLEand cleared outputs.Appscase 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
scripts\build-SteamAPIBridge-x64-Release.bat): build, CTest 3/3 passed (Unavailable, Host, Modern).scripts\build-SteamAPIBridge-x86-Release.bat): build, CTest 4/4 passed (Unavailable, Host, Modern, Legacy).format-check: 14 files, 0 with differences.SteamBridgeHostSmokeagainst a real Steam client. The real-game check will be done with the HLND2T engine change.🤖 Generated with Claude Code