Only send entity updates to players able to see them#105
Merged
caelunshun merged 11 commits intodevelopfrom Sep 5, 2019
Merged
Only send entity updates to players able to see them#105caelunshun merged 11 commits intodevelopfrom
caelunshun merged 11 commits intodevelopfrom
Conversation
This function adds an easy way to broadcast a packet to all players who are able to see a given chunk. For example, movement packets for a player can be sent to all players able to see that player's chunk. The function hasn't yet been used, but player action broadcast systems will soon be modified to use `Util::broadcast()`. Also see #78.
This function efficiently finds all entities within the view distance of a player. It can be used to, for example, send initial entities to the player when they join. However, it should not be used for broadcasting packets; `Util::broadcast` is more efficient in this regard, since it does not have to iterate over `view_distance^2` chunks. See also #78.
Codecov Report
@@ Coverage Diff @@
## develop #105 +/- ##
==========================================
+ Coverage 57.16% 57.97% +0.8%
==========================================
Files 56 58 +2
Lines 7392 7726 +334
==========================================
+ Hits 4226 4479 +253
- Misses 3166 3247 +81
Continue to review full report at Codecov.
|
This better reflects what the function does. bla
b815e7d to
cfe9256
Compare
Codecov Report
@@ Coverage Diff @@
## develop #105 +/- ##
===========================================
+ Coverage 57.16% 57.96% +0.79%
===========================================
Files 56 58 +2
Lines 7392 7725 +333
===========================================
+ Hits 4226 4478 +252
- Misses 3166 3247 +81
Continue to review full report at Codecov.
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Resolves #78.