Repository navigation
feat: add host mode and Windows x64/Linux support - #2
Merged
Merged
Conversation
Add a host mode for engines without their own Steam session: the bridge loads the steam_api runtime and owns SteamAPI/SteamGameServer initialization, callback pumping and shutdown. The C ABI covers game connection tickets, SteamID, persona name, app subscription, voice, game server logon, rules, heartbeats, ticket authentication and shared-socket packets, and translates client and game server callbacks into plain event structures. Shutdown requested from a callback is deferred until the dispatcher returns. Build for Windows x86/x64 and Linux x86/x64. Plugin mode finds the platform runtime name; the GoldSrc 8684 legacy fallback stays Windows x86 only. As a subproject the bridge keeps the parent's configurations, and the install directory and runtime staging are configurable. Pin SteamSDK to Steamworks SDK v1.65. Test executables share one directory so parallel builds no longer race copying the bridge. 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
Adds a host mode so a game engine without its own Steam session (HLND2T-DiligentGraphics, for GoldSrc-SDK-compatible Steam authentication) can use Steam through the bridge: engine → SteamAPIBridge → steam_api(64).dll / libsteam_api.so.
SteamBridge_HostInit(runtimePath, initializeClient)loads the runtime (default: platform runtime beside the bridge) and callsSteamAPI_InitFlat;HostShutdown,HostRunCallbacks,HostIsActive,HostIsClientActive. Dedicated servers passinitializeClient = 0.UserInitiateGameConnection/UserTerminateGameConnection(_DEPRECATEDticket API used by GoldSrc),UserAdvertiseGame,UserGetSteamID,UserGetPersonaName,UserIsSubscribedApp; voiceVoiceStart/StopRecording,VoiceGetAvailable,VoiceGet(optional PCM),VoiceDecompress,VoiceGetOptimalSampleRate.ServerInit(viaSteamInternal_GameServer_Init_V2with theSteamGameServer_InitExinterface list), logon, product/mod/description/rules/key values, advertise, player/bot counts,SendUserConnectAndAuthenticate, unauthenticated users, disconnect, user data, shared-socket packets.src/Platform.h). Plugin mode findssteam_api.dll/steam_api64.dll/libsteam_api.so; the GoldSrc 8684SteamClient012fallback stays Windows x86 only. Linux exports onlySteamBridge_*(version script).STEAMAPIBRIDGE_INSTALL_DIR(defaultsvencoop/metahook/dlls),STEAMAPIBRIDGE_INSTALL_RUNTIMEandSTEAMAPIBRIDGE_RUNTIME. New x64 and Linux build scripts.ba2bfcc). Merge SteamSDK#1 first; the pin points to its branch commit and should be moved to the merge commit if that differs.AGENTS.md/README.mdare updated: only host mode may initialize or shut down Steam, and only on the host's request; plugin mode is unchanged.Not included (separate work): rich presence, FakeIP / SteamNetworkingSockets, SteamInput, launch command line.
Verification
SteamBridge.Hostcovers unavailable runtime, client init failure, tickets, voice (incl. non-OK results), event translation and client/server dispatcher separation, deferred shutdown from callbacks, game server setters/authentication/packets and dedicated (server-only) sessions, against a fixture runtime exporting the real entry points.STEAMSDK_SOURCE_PATHfetches the pinned SteamSDK and passes CTest.format-check: 14 files, 0 differences.SteamBridgeHostSmokewith SDK v1.65steam_api64.dll(x64) andsteam_api.dll(x86), logged-in Steam client,steam_appid.txt= 70: client init, SteamID/persona, anonymous game server logon (LOGON_SUCCESS, POLICY), 218-byte ticket accepted bySendUserConnectAndAuthenticate, then GSClientApprove for the same SteamID. Linux was not tested against a real Steam client..defbased), MetaHookSv consumers on top of this change.🤖 Generated with Claude Code