Skip to content

fix(sdk): add SvEngine network status ABI types - #18

Merged
hzqst merged 1 commit into
mainfrom
fix/svengine-network-status-975
Nov 14, 2026
Merged

hzqst merged 1 commit into
mainfrom
fix/svengine-network-status-975

Conversation

@hzqst

@hzqst hzqst commented Nov 14, 2026

Copy link
Copy Markdown
Contributor

Sven's net_api_t::Status writes 104 bytes, while the original HLSDK declares a 72-byte status object. Passing the legacy object from SvenSoundcacheControl overwrites the caller's stack when joining a server.

Add netadr_svengine_t, net_status_svengine_t, and typed Status/AdrToString callbacks in a dedicated SDK extension header. Keep the address payload opaque and check the native sizes and field offsets at compile time; existing HLSDK types remain compatible.

Validation:

  • Checked the native layouts in Sven engine builds 8948 and 10257.
  • MSVC x86 Release and Debug consumer builds and both consumer tests passed, including complete native status writes and boundary guards.
  • clang-format 23.1.3 passed for the new header.
  • With the consumer fix, halflife-mcp live testing on build 10257 covered both reported bar servers, same-map reconnects, the cvar enabled/disabled, and a local listen server.

Refs MetaHookSv/MetaHookSv#975.

Define the native 36-byte address and 104-byte status layouts, typed Status/AdrToString callbacks, and compile-time ABI checks without changing legacy HLSDK types.

Co-Authored-By: Codex <codex@openai.com>
@hzqst
hzqst merged commit e7ca5ca into main Nov 14, 2026
3 checks passed
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)
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