Add Injection of CN_RemoteEntity #113
Conversation
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (1)
🚧 Files skipped from review as they are similar to previous changes (1)
WalkthroughThe PR extends ChangesRemote Entity Authority Tracking
Estimated code review effort🎯 2 (Simple) | ⏱️ ~10 minutes 🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 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.
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 `@addons/gecs/network/spawn_manager.gd`:
- Around line 257-259: The current logic marks server-owned entities as remote
and never clears stale remote markers; update the CN_RemoteEntity handling so
you only add CN_RemoteEntity when the net_id.peer_id truly differs from the
local multiplayer unique id (taking the server peer_id==0 case into account) and
always remove any existing CN_RemoteEntity during re-injection/respawn.
Concretely: in the block using net_id and
_ns.net_adapter.get_multiplayer().get_unique_id(), change the condition to skip
marking when peer_id==0 on the server (i.e. ensure the comparison treats
server-owned peers as local authority), and before possibly adding call
entity.remove_component(CN_RemoteEntity) or check
entity.has_component(CN_RemoteEntity) and remove it to avoid stale state;
reference the CN_RemoteEntity, net_id,
_ns.net_adapter.get_multiplayer().get_unique_id(), entity.add_component and
entity.remove_component symbols when applying the fix.
🪄 Autofix (Beta)
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: Organization UI
Review profile: CHILL
Plan: Pro
Run ID: 4f24aaa0-c496-4270-a08d-91f84acc4741
📒 Files selected for processing (1)
addons/gecs/network/spawn_manager.gd
Implement flagging entities with CN_RemoteEntity as described here: Authority Query Reference
It does not appear that the addon currently flags any entities with CN_RemoteEntity, only CN_LocalAuthority and CN_ServerAuthority.
Summary by CodeRabbit