Skip to content

NetworkSession: add support for discarding repeated packets before th… #6715

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

Open
wants to merge 2 commits into
base: minor-next
Choose a base branch
from

Conversation

dktapps
Copy link
Member

@dktapps dktapps commented May 28, 2025

…ey're decoded

this dramatically reduces the server workload dealing with spammy packets like right-click interactions trigger. It also solves the problem of players getting kicked for right-clicking for too long.

Related issues & PRs

Fixes #5728 in local testing

Changes

API changes

No public API changes.

The network system has some new functions supporting this feature, but these are not part of the versioned API (as with all pocketmine\network\mcpe stuff).

Behavioural changes

The server will now discard InventoryTransactionPacket when repeated.
This may result in a performance improvement in some servers.

Follow-up

Maybe filter out more spammy c2s packets, like AnimatePacket?

Tests

Locally tested with the "Improved input response" toggle in the client set to ON.

Caveats

I'm not sure if doing this might have unintended side effects. So far as I know, there is no obvious reason to send the same transaction multiple times, but I may have overlooked something. Please test thoroughly and feedback.

…ey're decoded

this dramatically reduces the server workload dealing with spammy packets like right-click interactions trigger.
It also solves the problem of players getting kicked for right-clicking for too long.
@dktapps dktapps requested a review from a team as a code owner May 28, 2025 22:04
@dktapps dktapps added Type: Fix Bug fix, typo fix, or any other fix Category: Network Related to the internal network architecture Type: Enhancement Contributes features or other improvements to PocketMine-MP labels May 28, 2025
pmmp-admin-bot[bot]
pmmp-admin-bot bot previously approved these changes May 28, 2025
@kostamax27
Copy link
Contributor

bug.mp4

@dktapps
Copy link
Member Author

dktapps commented Jun 2, 2025

Not too sure how to resolve that issue. I could have it expire the filter after 1 tick, but it might still result in legit actions disappearing in certain conditions.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Category: Network Related to the internal network architecture Status: Insufficiently Tested Type: Enhancement Contributes features or other improvements to PocketMine-MP Type: Fix Bug fix, typo fix, or any other fix
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants