Skip to content
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 methods for clearing netprop cache #1943

Open
wants to merge 5 commits into
base: master
Choose a base branch
from

Conversation

sirdigbot
Copy link
Contributor

As mentioned in PR #1908, changing the behaviour of the datamap cache would break certain extensions.
Kenzzer suggested adding functionality for extensions to clear the cache as a fix (though don't ask me how that works).

I never got a response in the discord if this was a good solution or not, but here's a PR to at least keep track of things.

@KyleSanderson
Copy link
Member

Bumping these ifaces are painful, so while this PR does nothing right now without hacking(?). It seems ok for something that could be exposed later if there's actual pain.

@Kenzzer
Copy link
Member

Kenzzer commented Mar 30, 2023

While the PR exposes a clear function, this needs to go further. It'd be really sweet if the gamehelpers interface was updated to expose these new functions to extensions. A proper netprop & datamap clear (which this PR's title doesn't mention, but adds anyways) would be welcomed addition.
There are extensions/plugins out there, mine included, that create custom sendprops and datamaps for entities. Unfortunately if said extensions/plugins are unloaded/reloaded well some custom datamaps might not exist anymore or wrongly cached as non existing, which is definitively going to create a bunch of crash/errors through sourcemod's natives SetEntPropX.

@sirdigbot
Copy link
Contributor Author

While the PR exposes a clear function, this needs to go further. It'd be really sweet if the gamehelpers interface was updated to expose these new functions to extensions.

Didn't know that was needed, or that g_HL2 wasn't exposed to extensions. Added.

A proper netprop & datamap clear (which this PR's title doesn't mention, but adds anyways) would be welcomed addition.

I thought netprop was the generic term for both, whereas sendprop and datamap/datatable were the specific terms?

@Kenzzer
Copy link
Member

Kenzzer commented Mar 31, 2023

Thank you for the changes !

I thought netprop was the generic term for both, whereas sendprop and datamap/datatable were the specific terms?

No sendprop and netprop are synonymous. And datamaps are datamaps (aka dataprops), and datatable is their container. Just like sendtable is the container of sendprops.

Copy link
Member

@peace-maker peace-maker left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm fine with either name datamap or datatable.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants