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

Move player finders to a proper place & optimize them #2161

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

noaccessl
Copy link
Contributor

I thought it would be better to move these functions to a specialized place.
There was even a comment about it there.

-- These are totally in the wrong place.

Also, optimized them by using bidirectional mapping between IDs and players for easier fetching and cleanup.

@bloodycop7
Copy link
Contributor

bloodycop7 commented Nov 24, 2024

Are you sure this cannot have a client side side effect just like ents.Iterator, invalid entities that even IsValid check doesn't fix

@noaccessl
Copy link
Contributor Author

noaccessl commented Nov 24, 2024

Are you sure this cannot have a client side side effect just like ents.Iterator, invalid entities that even IsValid check doesn't fix

Most likely it should never happen as this just clears the certain player from stored data. ents.Iterator invalidates cache entirely, setting recaching up for the next call.

As far as I know, these two hooks shouldn't provide invalid players and only called once (regarding players).

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.

2 participants