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
Remove unnecessary loop sending octree packets to a known node. #1353
Conversation
Testing: Please mess with entities on a local domain to see if anything broke, if everything works as expected then the PR should be fine. :) |
Probably even better if two people are on the domain, one person messes with the entities and the other person should see the same messing. |
c415ba7
to
099bf16
Compare
The following links are available: build (macOS-10.15, full) build (ubuntu-18.04, full)
build (windows-latest, full) |
OctreeEditPacketSender can either send a packet (list) to a specific node or all nodes. In all cases it is currently looping through all known nodes and checking to see if they match the filter criteria before processing the request.
This patch splits the search into a for loop if doing all nodes and a direct-retrieve if the node is known.
This should be a very small optimization (saving for loop and functor call over every known node) but it might be significant if this function gets called a lot (once for every entity change? It's heavily optimized down the line already) and with a larger number of active users.
I have not done any testing outside of an interface smoketest (which doesn't even touch this line of code).
Testing focus: This patch changes the code responsible for changing entities in the domain, both storing messages before a user is fully connected and sending packets once they are. The actions affected by this change are: