-
-
Notifications
You must be signed in to change notification settings - Fork 461
Guard IClient Netchan Path by GamedData #2397
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Guard IClient Netchan Path by GamedData #2397
Conversation
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.
|
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. |
|
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. |
|
Is this late enough in the stack that gamedata could be used instead? It seems like it should be. |
|
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 My Custom GameData FIles: gamedata.zip |
|
See https://github.com/search?q=repo%3Aalliedmodders%2Fsourcemod%20RadioMenuClosesOnInvalidSlot&type=code for an example of what I mean by using gamedata here. |
|
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. |
Kenzzer
left a comment
There was a problem hiding this 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.
heymykola
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Feedback incorporated.
Kenzzer
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Awesome ! ❤️
|
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. |
This reverts commit 0d29940.
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.
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.