-
Notifications
You must be signed in to change notification settings - Fork 183
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
CS2 ConVar RE #154
base: cs2
Are you sure you want to change the base?
CS2 ConVar RE #154
Conversation
public/icvar.h
Outdated
template<> constexpr EConVarType TranslateConVarType<void*>( void ) { return EConVarType_Invalid; } | ||
|
||
template<typename T> | ||
class IConVar |
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.
I'd like to suggest this structure if it's possible to implement it this way:
IConVar (or something with I) pure abstract, not templated. The header file doesn't contain anything but this interface with forward declaration of all the used types.
CConVarBase inherited from IConVar, not templated, with all the general data and logic.
CConVar < T > inherited from CConVarBase with only the type-specific data and logic.
Put the C* to cconvar.h/cconvar.cpp if it is acceptable by the design.
In the current version it will be hard to use IConVar without the type information.
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.
To not give an impression that this was ignored, you can review the current structure if you have anything to add (Since some of your points were addressed). For the file naming, it's better to not rename something that's was like that since forever.
Getting closer to finishing the metamod PR. I had to however rebase this, if I wanted to continue my work over there |
This MR breaks MMS in a minor way:
Because this MR removes |
This is known and expected. MM:S will have to be adapted to the SDK. Work on that is still in-progress. |
This commit will be reverted eventually
ConVarRefAbstract
andConCommandRefAbstract
, replaced byConVar
andConCommand
respectively.It seems valve has offset'd the creation of the actual
ConVar
andConCommand
object totier0
through theICvar
interface.I've observed through some RE, that valve has trimmed down the
ConVar
andConCommand
classes to essentially just this :Everything else has been moved to a struct, which describes a command or convar. Those structs are then stored in a static vector, until ICvar interface is retrieved and
ConVar_Register
called.The creation struct essentially looks like this :
The ptr to the handles are then filled with whatever
ICvar
returned.