-
-
Notifications
You must be signed in to change notification settings - Fork 29
fix: malformed packet crash #889
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
Conversation
Benchmark Results for general
Comparing to 4c402d0 |
Codecov ReportAttention: Patch coverage is
@@ Coverage Diff @@
## main #889 +/- ##
=======================================
Coverage 20.84% 20.84%
=======================================
Files 161 161
Lines 16870 16864 -6
Branches 469 464 -5
=======================================
- Hits 3517 3516 -1
+ Misses 13289 13284 -5
Partials 64 64
🚀 New features to boost your workflow:
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
generally looks good. However, requires a couple of changes.
Benchmark Results for general
Comparing to 4c402d0 |
Benchmark Results for general
Comparing to 4c402d0 |
This prevents possible bugs from forgetting to remove the player from the player reigstry when calling shutdown. It also removes the player from the positions map.
Using entity.destruct to disconnect players leads to an abort because, when the server receives PlayerDisconnect from the proxy, the server will try to set PendingRemove on the already-destructed entity, causing an abort. Sending DisconnectS2c was removed because it is not possible to send packets to disconnected players.
The channel is closed which makes the recv loop end. Therefore, sending a shutdown message is not needed.
970c342
to
46eed2e
Compare
Benchmark Results for general
Comparing to 347728c |
All requested changes have been made and Andrew currently seems to be inactive in the project
When a client sends a malformed packet, the server will crash because it used entity.destruct to disconnect players for malformed packets which leads to an abort because, when the server receives PlayerDisconnect from the proxy, the server will try to set PendingRemove on the already-destructed entity.
This PR fixes these errors on player disconnects.