Skip to content

feat(host): add server browsing, favorites, friends and VAC status to host mode - #6

Merged
hzqst merged 2 commits into
mainfrom
feat/host-matchmaking
Nov 22, 2026
Merged

hzqst merged 2 commits into
mainfrom
feat/host-matchmaking

Conversation

@hzqst

@hzqst hzqst commented Nov 22, 2026

Copy link
Copy Markdown
Contributor

Summary

Host-mode C functions for the GoldSrc server browser, so it can run on SteamAPIBridge instead of linking steam_api:

  • SteamBridge_Servers* (MatchMakingServers003): server lists (Internet, LAN, friends, favorites, history and spectator) with key/value filters, plus details, refresh, cancel, IsRefreshing, and ping and player queries.
    • List requests are opaque handles, validated by lookup. Queries are nonzero numbers.
    • Answers reach the callback that was passed to the request, copied out of gameserveritem_t into SteamBridgeServerItem.
    • A request released or a query cancelled from a callback stops answering at once. The native ReleaseRequest or CancelServerQuery runs after the dispatcher returns.
    • Client shutdown releases and cancels whatever is left.
  • SteamBridge_Matchmaking* (MatchMaking009): favorite count, add and remove.
  • SteamBridge_FriendsGetPersonaName and SteamBridge_FriendsGetGamePlayed (Friends018), and SteamBridge_AppsIsVACBanned (Apps009).
  • SteamBridge_HostSetMatchmakingCallback: FavoritesListChanged_t and PersonaStateChange_t events. This is a separate slot from the client callback, so a module other than the engine can own it. The existing SteamBridgeClientEvent layout is unchanged.

Steam's ppchFilters is a pointer to the address of the filter array, not an array of pointers. The bridge and the fixture both follow that.

Verification (simulated)

The fixture runtime (tests/MockHost.cpp) now has MatchMaking, MatchMakingServers and Friends implementations. Their stubs in tests/HostStubs.h are generated from the v1.65 headers. The fixture answers during SteamAPI_RunCallbacks, and it does not answer a request after it is released or a query after it is cancelled. SteamBridge.Host covers:

  • list kinds and filters, details, refresh and cancel calls;
  • list, ping and player answers;
  • release and cancel from inside callbacks, which must be deferred;
  • release and cancel at shutdown;
  • stale handles;
  • favorites, friends, VAC status and the matchmaking events.

CTest results:

  • Windows x64 and x86, Release and Debug: all pass.
  • Linux x64 and x86 Release (WSL Ubuntu 24.04): all pass.
  • format-check is clean (clang-format 23.1.3).

There is no real-Steam verification yet. A live server browser test comes with the GoldSrc-SDK serverbrowser port that consumes this API.

🤖 Generated with Claude Code

hzqst and others added 2 commits November 22, 2026 16:40
… host mode

Host mode wraps ISteamMatchmakingServers (server lists with filters, details,
refresh, ping and player queries), ISteamMatchmaking favorites and history,
ISteamFriends persona names and games, and ISteamApps VAC status behind C
functions. Steam's response interfaces stay inside the bridge: list requests
are handles, queries are numbers, and answers are copied out of
gameserveritem_t. Release and cancellation stop events at once and run the
native call after the dispatcher returns. FavoritesListChanged and
PersonaStateChange reach a matchmaking callback separate from the client
callback, so another module of the host can own it.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
The GoldSrc SDK removes /EHsc from CMAKE_CXX_FLAGS, so an embedded bridge
compiled without unwind semantics (C4530) and its catch blocks at the C
boundary could not run destructors.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
@hzqst

hzqst commented Nov 22, 2026

Copy link
Copy Markdown
Contributor Author

Added /EHsc to the bridge's own MSVC options. When the GoldSrc SDK embeds the bridge it strips /EHsc from CMAKE_CXX_FLAGS (C4530), which left the C-boundary catch blocks without unwind semantics. Windows x64/x86 Release CTest still passes.

Real-game check (x64, engine started with -steam, GoldSrc-SDK serverbrowser on this API): the Internet list loaded 800 servers and finished refreshing, the game info dialog showed ping details, VAC status and the player list, and adding then removing a favorite updated the Favorites page.

@hzqst
hzqst merged commit 30d8c67 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