New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Synchronized building doesn't work correctly #2730
Comments
related to #1215 |
#3167) Introduction This PR is a second attempt at improving movement processing to fix #1215 , #2730 and more. This is significantly less complex than the previous attempt #2646 -- it gets rid of the movement buffering system entirely and instead relies on a simple rate limit counter to restrict on-the-fly movement processing. Movement is rate limited to a max average of 2 per tick. It allows up to 5 seconds' backlog to accommodate network lag. The rate limit counter is increased by 2 per tick and decreased once for every movement processed. This prevents movement processing being abused for denial of service attacks. Changes API changes This PR, while obviously highly beneficial for most current users, poses some BC-breaking issues because of changes to the internal Player API. Player->processMovement() (protected) has been removed. This is a BC concern for custom player classes which overrode it and called it as a parent. In addition, child implementations won't be called every tick any more, which could break some custom movement processing systems. Player->newPosition (protected) has been removed. This internal field may have been accessed by custom movement implementations. Player->isTeleporting (protected) has been removed. BC concern is same as previous point. Player->getNextPosition() (public) has been @deprecated. Added the following protected Player class members: int $moveRateLimit ?Vector3 $forceMoveSync handleMovement() processMostRecentMovements() revertMovement() Behavioural changes Player movement is now subject to less rubberbanding and has more reliable behaviour.
485f573 improves on this but doesn't completely fix it. It'll be necessary to handle position updates from the transaction packet itself to completely resolve this. |
For posterity: This was caused by a bug in the handling for InventoryTransactionPacket, in a hack designed to reduce the overhead caused by spammy right-clicks. It did not account for player movements (or aiming at the same position on a different block). The movement changes did not have any effect on the problem (placebo). |
clickPos is relative to the base block position, so if you keep aiming at the same spot on the block and jump, it thinks you're still spamming. closes pmmp#2730
Issue description
In recent versions of Bedrock the devs added a really nice (really!) feature which I refer to as "synchronized building". This makes block placement (and breaking in creative) speed synchronized with walking speed.
Sadly, this feature has some issues in PocketMine-MP due to how the movement processing system currently works. When the player is walking backwards placing blocks, sometimes the block will not be placed because the player's current position is inside the block. On the client side, they are not inside the block, and the bug is happening because the server only processes movements once per tick, but processes block place/break immediately.
Steps to reproduce the issue
OS and versions
The text was updated successfully, but these errors were encountered: