More forgiving PlayerList packet handling#608
Merged
Conversation
This should add some extra hints when diagnosing problems with packets. Limited the display to only the first 128 bytes so that big packets won't cause issues.
As soon as a connection's state becomes Playing, player list updates can be sent to it. However, sending a player list update before sending the player list itself is wrong, so make sure to send it before other packets. The timing required to trigger this seems improbable, but I did see issues that could be related to this.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
When looking through the desync files in #604 (desync-148.zip) I noticed that the client disconnected twice because of player list mismatches between the server and client when handling
PlayerListAction.Latenciespackets. I'm not certain what caused this. One theory, although unlikely, is described in the 4th commit. There are also more logs now produced, mainly when something unexpected occurs to help with debugging future issues. Most of the logs are related to PlayerList handling, but I also added a dump of the first bytes of a packet when an error occurs.