Repository navigation
Fix SV_DropClient detour on non-ReHLDS servers - #1168
Merged
dvander merged 4 commits intoOct 11, 2026
Merged
Conversation
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.
This PR does two things
First, it fixes a bug it was introduced years ago back in #446. Basically whenever you used vanilla HLDS, SV_DropClient would never detour, as it would never enable, this resulted in AMXX just falling back to Metamod's pfnClientDisconnect. (It's the reason why would you get garbage, nulled data in the client_disconnected() AMXX forward). I suspect this was never reported due to more people moving to ReHLDS and not actually using the parameters of this forward. The fix is very straightforward and just involves removing a single line.
Second, it fixes two bugs introduced by this due to HL25 and Svengine engine changes. Again, the detour will call but the AMXX forward doesn't, due to how the struct is different in each engine version. To solve this issue I added new structs where AMXX will use the correct one based on the EngineType key value in the gamedata.
Three values are accepted, check gamedata file for formatting:
Missing or invalid value will fallback to Legacy, as it was done on the assumption that custom engines like Cry of Fear or Xash may be based on the Legacy branch of GoldSrc. (I mean, if people are crazy enough to run AMXX on Xash which is unsupported anyway)
Example plugin output.
HL25 (Before)
Client Player disconnected (Crashed? 0) (Reason size: 0) (Reason: K�H�Svengine (Before)
Client Player disconnected. (Crashed? 0) (Reason size: 0) (Reason: �����d���8PHHh���@�4�)** varies, sometimes prints previously print lines or just blank spaces
All Engine Branches (After)
Client Player disconnected. (Crashed? 1) (Reason size: 1023) (Reason: Client sent 'drop')As an additional note, offsets were proposed to tackle this issue, removing the need for struct usage but the idea was discarded mid-development. It still remains as an option that may be explored in the future. This PR doesn't affect ReHLDS, which uses ReAPI.