Skip to content

Conversation

@heymykola
Copy link
Contributor

Prevent crash on Source 2007 forks where GetPlayerNetInfo()->GetMsgHandler() is not compatible with IClient.

Only attempt the netchan/IClient path for known-safe game folders; otherwise leave m_pIClient null.

Prevent crash on Source 2007 forks where GetPlayerNetInfo()->GetMsgHandler() is not compatible with IClient.

Only attempt the netchan/IClient path for known-safe game folders; otherwise leave m_pIClient null.
@psychonic
Copy link
Member

This would need to be a blocklist rather than allowlist. Mods built on Source SDK 2007 can have any gamedir name but use the same engine binaries. The game(s) spawning this issue are not using that SDK and just get detected as it due to it being the closest match. That's fine enough, but this would need to be excluded on them.

@heymykola
Copy link
Contributor Author

I originally avoided a blocklist because I wasn’t sure if it would be too specific/unorthodox to add a workaround for one non-stock Source 2007 fork, as I assume there are likely other forks with the same issue. Based on your feedback, I switched to a blocklist and scoped it to the known Kuma Games server folders (KumaWar2MP / DinoHuntersMP / KillpointMP) so stock SDK2007 mods keep the existing behavior while these forks skip the netchan GetMsgHandler() cast that’s crashing on connect.

@asherkin
Copy link
Member

Is this late enough in the stack that gamedata could be used instead? It seems like it should be.

@heymykola
Copy link
Contributor Author

I did already go down the gamedata route first. I added custom folder + game overrides for Kuma in core.games, sdkhooks.games, and sdktools.games. That resolved my earlier SM errors (offset / signature resolution failures and extension load issues), and SM now starts without any errors.

This crash happens later, on a real player connect, inside SM core (CPlayer::Initialize → OnClientConnect) before any extension-specific gamedata is consulted. It’s specifically the INetChannel -> GetMsgHandler() → IClient* path that’s blowing up due to a layout/vtable mismatch on this non-stock 2007 fork.

Unless I’m missing something, I don’t see a way for gamedata to guard this particular path since it’s not an offset/signature lookup but a hard cast inside core logic. That’s why I went with a gamedir-based exclusion at the call site instead.

Kuma's Engine Version

Protocol version 14
Exe version 1.0.1.0 (valve)
Exe build: 22:11:58 Dec  4 2009 (4045)

My Custom GameData FIles: gamedata.zip

@asherkin
Copy link
Member

See https://github.com/search?q=repo%3Aalliedmodders%2Fsourcemod%20RadioMenuClosesOnInvalidSlot&type=code for an example of what I mean by using gamedata here.

@heymykola
Copy link
Contributor Author

heymykola commented Jan 27, 2026

Oh that is smart Ash. Do you want me to open another PR for common.games.txt to add under Keys:

"SkipNetchanIClient" "no" (which users can turn to "yes")?

[Edit] New(ish) to GetHub and PRs, common.games.txt updates below.

@heymykola heymykola changed the title Guard IClient Netchan Path by Gamedir Guard IClient Netchan Path by GamedData Jan 27, 2026
Copy link
Member

@Kenzzer Kenzzer left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Formatting nitpicks, but this looks okay otherwise.

Copy link
Contributor Author

@heymykola heymykola left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Feedback incorporated.

Copy link
Member

@Kenzzer Kenzzer left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Awesome ! ❤️

@heymykola
Copy link
Contributor Author

I appreciate everyone for their support and feedback. How often are updates released for download?

@Kenzzer
Copy link
Member

Kenzzer commented Jan 29, 2026

I appreciate everyone for their support and feedback. How often are updates released for download?

As soon as something lands on master or 1.12-dev branch a build will be triggered. When it comes to your changes its when this PR is merged. I'll let this one sit, because I've no idea if we've met asherkin's request.

@Kenzzer Kenzzer requested a review from asherkin January 29, 2026 08:43
@psychonic psychonic merged commit 0d29940 into alliedmodders:master Jan 31, 2026
4 checks passed
heymykola added a commit to heymykola/sourcemod that referenced this pull request Jan 31, 2026
heymykola added a commit to heymykola/sourcemod that referenced this pull request Jan 31, 2026
his is a follow-up to PR alliedmodders#2397 (Guard IClient Netchan Path by Gamedata). While that change prevents the netchan crash, testing on Source 2007–based forks showed the server can still crash during early client initialization when gamedata is accessed before it’s available. This adds a small guard around g_pGameConf key lookups so missing gamedata is treated as “unset,” preserving default behavior while preventing an access violation.
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.

4 participants