fix: remove player.active assignment to avoid unexpected tile section sending#92
fix: remove player.active assignment to avoid unexpected tile section sending#92ACaiCat wants to merge 1 commit into
Conversation
Reviewer's guide (collapsed on small PRs)Reviewer's GuideThis PR adjusts player activation timing by removing an early Sequence diagram for updated player activation and TileSection sendingsequenceDiagram
actor Client_PE
participant UnifiedServerCoordinator
participant Main_UpdateServer
Client_PE->>UnifiedServerCoordinator: UUIDPacket
UnifiedServerCoordinator->>UnifiedServerCoordinator: ProcessPacket
alt previous_behavior
UnifiedServerCoordinator->>UnifiedServerCoordinator: serverPlayer_active
Main_UpdateServer->>Client_PE: CheckSection
else current_behavior
Client_PE->>UnifiedServerCoordinator: PlayerActivePacket
UnifiedServerCoordinator->>UnifiedServerCoordinator: ProcessPacket
UnifiedServerCoordinator->>UnifiedServerCoordinator: serverPlayer_active
Main_UpdateServer->>Client_PE: CheckSection
end
File-Level Changes
Tips and commandsInteracting with Sourcery
Customizing Your ExperienceAccess your dashboard to:
Getting Help
|
There was a problem hiding this comment.
Hey - I've left some high level feedback:
- Consider adding a brief comment near the UUID handling / PlayerActive handling to document why
serverPlayer.activemust only be set in response to the PlayerActive packet, as this ordering constraint is non-obvious and ties directly to PE crash behavior. - It may be worth validating
CheckSection’s preconditions (e.g., world info / tile array initialization) rather than relying solely onplayer.active, so future changes don’t accidentally reintroduce similar issues by togglingactiveearlier in the flow.
Prompt for AI Agents
Please address the comments from this code review:
## Overall Comments
- Consider adding a brief comment near the UUID handling / PlayerActive handling to document why `serverPlayer.active` must only be set in response to the PlayerActive packet, as this ordering constraint is non-obvious and ties directly to PE crash behavior.
- It may be worth validating `CheckSection`’s preconditions (e.g., world info / tile array initialization) rather than relying solely on `player.active`, so future changes don’t accidentally reintroduce similar issues by toggling `active` earlier in the flow.Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.
There was a problem hiding this comment.
Pull request overview
This PR fixes a PE client crash during connection by preventing the server-side player from being marked active when handling the ClientUUID packet, so tile sections won’t be sent before the client has finished world initialization (waiting for the PlayerActive packet to activate the player).
Changes:
- Removed
serverPlayer.active = true;fromMessageID.ClientUUIDhandling inProcessPacket. - Keeps activation aligned with vanilla flow (activation happens on
PlayerActivepacket).
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
PE收到
TileSection神秘闪退ProcessPacket方法 处理UUID包的时候把Player.active设为了trueMain.UpdateServer里的CheckSection(用来根据玩家坐标发送区块)提前给玩家发送了区块WorldInfo所以没初始化Tile数组,收到CheckSection发送的区块直接崩了解决方法是把
UUID包处理的serverPlayer.active = true删了,走原版逻辑,玩家发PlayerActive包再把active设为trueSummary by Sourcery
Bug Fixes: