Skip to content

Update network-event ABI and add ZR model-replacement opt-out - #478

Closed
PtxDK wants to merge 2 commits into
Source2ZE:mainfrom
PtxDK:codex/fix-network-event-abi
Closed

PtxDK wants to merge 2 commits into
Source2ZE:mainfrom
PtxDK:codex/fix-network-event-abi

Conversation

@PtxDK

@PtxDK PtxDK commented Nov 17, 2026 •

Copy link
Copy Markdown

Player joins can crash in Hook_PostEventAbstract because the engine passes a NetMessageInfo_t*, while the old hook treats it as an INetworkMessageInternal* and calls GetNetMessageInfo(). Update the SDK to published commit a508eb5ed5fb36f4067fa36a1c33f5fec7d73066, migrate the hook and outgoing message lookups/allocation to metadata pointers, and match the SDK's ClientPutInServerType_t hook argument.

Separately, ZR class application caused first-person weapon/model clipping on the tested server. Add zr_class_model_override (default 1); setting it to 0 skips class model and skin replacement while retaining tint, scale and gameplay attributes. This is an administrator-controlled workaround, not a repair to custom-model rendering.

Crash evidence

On Linux x86_64, the server loaded the map successfully but terminated with SIGSEGV when a player joined. The captured fault is in CS2Fixes v2.1's Hook_PostEventAbstract; this is a game-process segmentation fault, not a Linux kernel panic. The affected upstream source is 687f51a, using SDK 30c1a859fe846846081ce0e6125c23e497a9a186.

Relevant GDB excerpt, abridged for readability. Original memory addresses are preserved; source paths are shortened and template/argument lists abbreviated with ...:

Thread 1 "cs2" received signal SIGSEGV, Segmentation fault.
#0  0x0000778bc6f19cc9 in Hook_PostEventAbstract (...) at src/virtual_hooks.cpp:378
#1  0x0000778bc6f341c5 in KHook::Virtual<..., INetworkMessageInternal*, ...>::_KHook_Callback_Fixed (...) at khook.hpp:2008
#2  0x0000778bc6f33e27 in KHook::Virtual<..., INetworkMessageInternal*, ...>::_KHook_Callback_PRE (...) at khook.hpp:2044

The faulting source line at src/virtual_hooks.cpp:378 is:

NetMessageInfo_t* info = pEvent->GetNetMessageInfo();

The updated SDK declares the event parameter as NetMessageInfo_t*. Calling an INetworkMessageInternal virtual method on that metadata pointer is the ABI mismatch addressed here.

After deploying the final build, the player completed join, infection and reconnect tests. Ad hoc log checks and a separate debugger-detach step produced the following summary (these labels are validation output, not CS2 engine log messages):

segmentation_faults: 0
fatal_errors: 0
missing_human_class: 0
obsolete_scale_toggle: 0
native_crash_capture: False
Debugger-detached

The console counts cover entries after the latest active-map marker. The original server process remained running and its game port was still listening.

These log checks were subsequently packaged into cs2-log-validator, with documentation and automated tests. The results above came from the original ad hoc checks rather than the later packaged version. The standalone tool does not attach or detach GDB.

Validation

  • A fresh recursive clone of commit 2d48fa801aaad10b7ca14186db160970f1250fb2, including the published SDK pin, passed Linux Docker Compose compilation (--abort-on-container-exit --exit-code-from cs2fixes-build). The build checkout remained clean.
  • The exact resulting binary was deployed and player-tested with human classes restored, normal class scaling enabled, and zr_class_model_override 0.
  • The operator confirmed CT M4/USP models were correctly positioned before infection and the infected player's model/knife no longer clipped. Both remained correct after disconnecting and rejoining.
  • Post-test checks found the same server process still running, no segmentation faults or fatal errors after map activation, and no native crash captured by GDB. The debugger was detached after testing.
  • On the preceding diagnostic build, colored chat and solo infection were also confirmed working. These tests are short functional checks, not a long-duration stability test.
  • For repeat testing, the standalone validation script can check console and GDB logs after manual gameplay tests. It does not independently verify gameplay correctness or long-term stability.
  • Windows compilation/runtime testing and the CS2Fixes fork's CI matrix remain outstanding. The opt-out is enabled by setting the new cvar to 0; default 1 preserves existing model

@PtxDK

PtxDK commented Nov 17, 2026

Copy link
Copy Markdown
Author

I've simply fixed my own ZE server, and want to share the changes with all of you out there :)

I will do my best to help you incorporate the required changes into CS2Fixes, please let me know if you need me to do something.

@PtxDK
PtxDK marked this pull request as ready for review November 17, 2026 23:58
@Vauff Vauff closed this Nov 21, 2026
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.

2 participants