fix: normalize Bedrock entity network offsets - #150
Conversation
|
Warning Review limit reached
Next review available in: 50 minutes You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository. How can I continue?After more reviews become available, a review can be triggered using the To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews. How do review limits work?CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability. For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window. Please refer docs for additional details. Review details⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (1)
📝 WalkthroughWalkthroughEntity tracking now supports unique IDs, metadata updates, network offsets, item actors, delta movement, and new acknowledgements. Packet registration and removal use centralized entity configuration. Combat misprediction searches exclude item entities. ChangesEntity tracking and movement
Combat target filtering
Estimated code review effort: 3 (Moderate) | ~25 minutes Sequence Diagram(s)sequenceDiagram
participant ServerDecode
participant trackEntity
participant EntityTrackerComponent
participant EntityDeltaPosition
ServerDecode->>trackEntity: register actor or item actor
trackEntity->>EntityTrackerComponent: add configured entity
ServerDecode->>EntityTrackerComponent: route MoveActorDelta
EntityTrackerComponent->>EntityDeltaPosition: enqueue delta acknowledgement
EntityDeltaPosition->>EntityTrackerComponent: apply optional axis deltas and teleport state
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✨ Finishing Touches 💡 1📝 Generate docstrings 💡
🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
🧹 Nitpick comments (1)
game/movement.go (1)
21-21: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick winDocument the precise
1.62001literal.The change from
1.62to1.62001is a protocol-precision fix, but nothing in the code says so. Without a comment, a future cleanup could "round" this back to1.62and silently reintroduce the Y-offset drift this PR fixes.♻️ Suggested comment
- DefaultPlayerHeightOffset = float32(1.62001) + // DefaultPlayerHeightOffset matches the exact Y offset BDS 1.26.30.03 applies + // to standing player positions on the wire; do not round to 1.62. + DefaultPlayerHeightOffset = float32(1.62001)🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@game/movement.go` at line 21, Add a concise comment directly above DefaultPlayerHeightOffset documenting that the precise 1.62001 literal is required for protocol precision and must not be rounded, preserving the current value.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Nitpick comments:
In `@game/movement.go`:
- Line 21: Add a concise comment directly above DefaultPlayerHeightOffset
documenting that the precise 1.62001 literal is required for protocol precision
and must not be rounded, preserving the current value.
ℹ️ Review info
⚙️ Run configuration
Configuration used: defaults
Review profile: CHILL
Plan: Pro Plus
Run ID: b31e6260-e1c5-4fea-b34f-0912842d3cc9
📒 Files selected for processing (11)
entity/entity.goentity/network_offset.goentity/network_offset_test.gogame/movement.goplayer/component/acknowledgement/entities.goplayer/component/combat.goplayer/component/entities.goplayer/component/entities_test.goplayer/entities.goplayer/packet.goplayer/packet_entity_offsets_test.go
8d34006 to
b45c731
Compare
b45c731 to
5c7ae7f
Compare
|
updated to sync with stable |
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@anticheat/player/component/entities.go`:
- Around line 34-40: Update AddEntity to remove any existing entity associated
with ent.UniqueId before inserting the new rid mapping, using
RemoveEntityByUniqueID or the established equivalent. Preserve cleanup of the
prior entity at rid so entities and runtimeIDs remain one-to-one.
🪄 Autofix
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: defaults
Review profile: CHILL
Plan: Pro Plus
Run ID: 1b9ab0e5-1bb1-4e48-81f9-cd9cd16e5e38
📒 Files selected for processing (11)
anticheat/entity/entity.goanticheat/entity/metadata.goanticheat/entity/network_offset.goanticheat/entity/type.goanticheat/game/movement.goanticheat/player/component/acknowledgement/entities.goanticheat/player/component/combat.goanticheat/player/component/entities.goanticheat/player/entities.goanticheat/player/packet.goanticheat/utils/bit.go
5c7ae7f to
b9dba26
Compare
|
|
Summary
Follow-up dependency
The currently pinned Dragonfly still emits its older approximations and raw spawn positions. Its offset implementation must be corrected and the pinned revision updated before this PR merges; otherwise the native Dragonfly integration will subtract mismatched values.
Verification
Summary by CodeRabbit
New Features
Bug Fixes