Skip to content

Conversation

TestingPlant
Copy link
Collaborator

Player positions are updated immediately when TeleportEvent is sent instead of later when the player confirms the teleportation. This allows the new position to be immediately replicated to other clients, which is also useful to allow the anticheat to continue working even if the client does not acknowledge the teleportation quickly.

This also fixes a bug where a player's teleport is not synced with other players because last_tick_position is set to the current position every tick, meaning that the server will continue sending position deltas relative to the previous location instead of the full position to the teleport location.

The hyperion-respawn plugin was also removed because it is not necessary since attack.rs already handles respawn

Player positions are updated immediately when TeleportEvent is sent
instead of later when the player confirms the teleportation. This allows
the new position to be immediately replicated to other clients, which is
also useful to allow the anticheat to continue working even if the client
does not acknowledge the teleportation quickly.

This also fixes a bug where a player's teleport is not synced
with other players because last_tick_position is set to the current
position every tick, meaning that the server will continue sending
position deltas relative to the previous location instead of the full
position to the teleport location.
The tag event already handles respawn. There is no need to have a second
respawn handler
@github-actions github-actions bot added the fix label Jul 8, 2025
Copy link

github-actions bot commented Jul 8, 2025

Benchmark Results for general

ray_intersection/aabb_size_0.1                     [  19.1 ns ...  19.1 ns ]      -0.07%
ray_intersection/aabb_size_1                       [  19.1 ns ...  19.1 ns ]      -0.14%
ray_intersection/aabb_size_10                      [  19.1 ns ...  19.1 ns ]      +0.02%
ray_intersection/ray_distance_1                    [   3.8 ns ...   3.8 ns ]      -0.25%
ray_intersection/ray_distance_5                    [   3.8 ns ...   3.8 ns ]      +0.28%
ray_intersection/ray_distance_20                   [   3.8 ns ...   3.8 ns ]      -0.35%
overlap/no_overlap                                 [  28.5 ns ...  28.5 ns ]      -0.10%
overlap/partial_overlap                            [  28.5 ns ...  28.5 ns ]      +0.01%
overlap/full_containment                           [  21.6 ns ...  21.6 ns ]      +0.13%
point_containment/inside                           [   4.9 ns ...   4.9 ns ]      +0.31%
point_containment/outside                          [   4.4 ns ...   4.4 ns ]      +0.22%
point_containment/boundary                         [   5.0 ns ...   5.0 ns ]      +0.12%

Comparing to bdac910

Copy link

codecov bot commented Jul 8, 2025

Codecov Report

Attention: Patch coverage is 1.30719% with 302 lines in your changes missing coverage. Please review.

Project coverage is 17.63%. Comparing base (bdac910) to head (807bf72).

Files with missing lines Patch % Lines
crates/hyperion/src/egress/sync_entity_state.rs 1.05% 94 Missing ⚠️
events/tag/src/plugin/attack.rs 0.00% 92 Missing ⚠️
crates/hyperion/src/simulation/mod.rs 3.17% 61 Missing ⚠️
crates/hyperion/src/simulation/handlers.rs 2.00% 49 Missing ⚠️
crates/hyperion/src/egress/player_join/mod.rs 0.00% 6 Missing ⚠️
@@            Coverage Diff             @@
##             main     #917      +/-   ##
==========================================
- Coverage   17.70%   17.63%   -0.07%     
==========================================
  Files         161      160       -1     
  Lines       15984    16039      +55     
  Branches      489      487       -2     
==========================================
- Hits         2830     2829       -1     
- Misses      13086    13143      +57     
+ Partials       68       67       -1     
Files with missing lines Coverage Δ
events/tag/src/lib.rs 0.00% <ø> (ø)
crates/hyperion/src/egress/player_join/mod.rs 1.36% <0.00%> (-0.02%) ⬇️
crates/hyperion/src/simulation/handlers.rs 3.47% <2.00%> (-0.07%) ⬇️
crates/hyperion/src/simulation/mod.rs 15.32% <3.17%> (-1.68%) ⬇️
events/tag/src/plugin/attack.rs 0.00% <0.00%> (ø)
crates/hyperion/src/egress/sync_entity_state.rs 5.31% <1.05%> (-0.12%) ⬇️

... and 1 file with indirect coverage changes

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@TestingPlant
Copy link
Collaborator Author

I need to refactor this so there is a point in time where a player's Position component can be trusted

@TestingPlant TestingPlant marked this pull request as draft July 29, 2025 18:13
@TestingPlant TestingPlant self-assigned this Jul 29, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant