-
-
Notifications
You must be signed in to change notification settings - Fork 422
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
Add offset-reading capability for networked CUtlVector instances #1330
Add offset-reading capability for networked CUtlVector instances #1330
Conversation
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.
This looks great! It is a perfect first step towards supporting these props natively.
Not pull-ready yet; need recommendations on code style and how to deal with the
CSendPropExtra_UtlVector
gutted frompublic/dt_utlvector_send.cpp
.
I'd say the HACK_CSendPropExtra_UtlVector
struct here is a fine solution - this branch is highly unlikely to be hit in an engine that doesn't support CUtlVector props, and should only be reached for actual CUtlVectors, so won't have random fallout even if broken. It might be worth a quick check in CS:GO to make sure the struct matches there.
Co-authored-by: Asher Baker <asherkin@limetech.io>
A disassembly of
I'll go ahead and set this up for review since it appears to clear both games. |
Do we even need the whole struct? It looks like only one member is used. If there's any chance that this could different across engine variables, why not just put its offset in gamedata? |
I don't have an opinion for / against putting it in gamedata, but I'd imagine we could also use No problems switching it over to gamedata if that's the consensus. |
Using gamedata makes sense 👍 |
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.
This looks good, nice work man. When it's ready for review (after the offsets stuff comes in - which is a good suggestion) r? me again and I'll take another look for style and things like that.
Moved it over to offsets as requested. I'm not sure where in
Let me know if I should add it into common.games or all the engine ones. |
|
Done. |
Nice work on this one - didn't want to nit you on this one @nosoop so made a tiny commit and landed. Thanks for the contribution! |
This was initially discussed in the SourceMod Discord; PR provides a way to get the actual offset of networked class members of type
CUtlVector
such asCBaseFlex::m_AnimOverlay
andCTFPlayer::m_hMyWearables
.Tested working in TF2 with the following snippet:
Not pull-ready yet; need recommendations on code style and how to deal with the
CSendPropExtra_UtlVector
gutted frompublic/dt_utlvector_send.cpp
.Heuristic per following message (the
lengthproxy
also holds the extradata, so I opted to use the parent table instead):