Repository navigation
fix(soundcache): prevent Sven server join crashes and retry loops - #1
Merged
Merged
Conversation
Use the native SvEngine network ABI and refresh sound state once per HUD_VidInit join, before the first sound load or MapStarted callback. Cover full native status writes and early sound loading, and pin standalone builds to the SDK commit containing the required types. Co-Authored-By: Codex <codex@openai.com>
Let CMake fetch its declared SDK commit instead of overriding it with main, and validate installed gamedata with the same fetched SDK. Co-Authored-By: Codex <codex@openai.com>
hzqst
added a commit
to MetaHookSv/MetaHookSv
that referenced
this pull request
Nov 14, 2026
Enabling SvenSoundcacheControl could crash when joining a server because it passed a 72-byte HLSDK status buffer to SvEngine's 104-byte writer. Live testing also revealed repeated reconnects when MapStarted cleared a sound list already loaded by StartSound. Update both submodule pointers together: - MetaHookSv/MetaHook#18: add the native SvEngine network types and ABI checks (e7ca5ca). - MetaHookSv/SvenSoundcacheControl#1: use those types, refresh sound state only once per join, add regressions, and use the same pinned SDK in standalone builds and Windows CI (5009500). Validation: - MSVC x86 Release/Debug builds and both plugin tests passed with the local SDK and with a fresh standalone fetch of the published SDK commit. - Plugin formatting, the new SDK header's clang-format 23.1.3 check, git diff --check, and both gamedata snapshot validations passed. - halflife-mcp live tests on Sven build 10257 passed on 124.221.167.52:28347 and :28348, including same-map retry, the cvar enabled/disabled, server map changes, and local svencoop1 loopback. - The aggregate changes only the two tested gitlinks; no aggregate build configuration changed. Closes #975. Generated with [Claude Code](https://claude.com/claude-code)
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.
Joining a Sven server with SvenSoundcacheControl enabled overwrote the stack: the legacy HLSDK status buffer is 72 bytes, but SvEngine writes 104 bytes and places the remote address at a different offset. Use the SDK's Sven-specific status/address types and correctly typed network callbacks.
Live testing also exposed a retry loop when StartSound loaded the sound list before MapStarted. Track each join from HUD_VidInit and refresh once at the first loader or map-start callback, so a later callback preserves the sounds just loaded for that join.
Add regression coverage for full native status writes, boundary guards, remote address contents, and both callback orders. Standalone builds and Windows CI now use the same CMake SDK pin, c7c2af7d9dbfee94ae3fb4514e97efb856835ec7, and validate the required header, so they can build before the SDK PR is merged.
SDK change: MetaHookSv/MetaHook#18
Validation:
Refs MetaHookSv/MetaHookSv#975.