Implement CVariant functions
~~Very work in progress - working on it in small bits at a time~~
This PR aims to implement functions to CVariant which accesses data from variant_t on the C++ side. Useful for functions that hook into the Entity IO system. ~~Unsure if a Set function is needed - but it can probably be done.~~
I've also added a function to get a string from a CUtlSymbolLarge class for plugin authors that wish to hook into AcceptInput without dealing with memory shenanigans on the C# side. Does not appear to have an easy way to modify it (from my little knowledge of hl2sdk) so it will remain as read-only.
you can just use fieldtype_t to replace VariantFieldTypes, fieldtype_t is generated from the schema
LGTM!
Does not appear to have an easy way to modify it (from my little knowledge of hl2sdk) so it will remain as read-only.
Maybe modify it through a native call?
Finally had the time to work on this again. Added a Set() function with corresponding native functions. Currently untested (and I can't test at the moment - so I would be grateful if someone could!)
@Yarukon - I've also used the generated field as you suggested. Thanks for the suggestion!
I've left probably my last reviews on this, good job!
@KillStr3aK Your cleanup suggestions have been made!
will this be added to the main branch?
will this be added to the main branch?
I hope so. I've been using a local version of CounterStrikeSharp with this feature for a while, and I've not encountered any massive issues. cc: @roflmuffin for review?
will this be added to the main branch?
I hope so. I've been using a local version of CounterStrikeSharp with this feature for a while, and I've not encountered any massive issues. cc: @roflmuffin for review?
I did actually run into a crash or two, so I might investigate this code a bit further.
Hey @zonical, the changes look good to me, do you anticipate that your latest commit adds more safety to prevent the crashes? Do you need some more time to test
Hey @zonical, the changes look good to me, do you anticipate that your latest commit adds more safety to prevent the crashes? Do you need some more time to test
I will need more time. Some of the crashes I've been having on my testing server seem to be resolved after my latest commit, but I want to ensure that everything is fully safe before merging.
Tried doing a massive rebase with latest code (this branch went extremely stale) and it fucked everything. New PR with a clean slate coming shortly!