NetworkSession: add support for discarding repeated packets before th… #6715
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
…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.