Query protocol fixes#146
Merged
kevinkjt2000 merged 3 commits intoDinnerbone:masterfrom Jun 21, 2021
Merged
Conversation
Collaborator
|
Thanks for the pull request! And nice catch! As stated the magic number seems to be missing at the start of the handshake packet. It seems the vanilla server has handled this without any issue for a long time, so I'll have to do some thorough testing/review to make sure the existing behavior continues to function. |
Contributor
Author
|
No, magic number was always there. |
kevinkjt2000
approved these changes
Jun 21, 2021
Collaborator
|
Released in v6.1.2 |
Contributor
Author
|
Thanks for a prompt review. |
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.
This library seems to not conform to minecraft query protocol.
This PR fixes inconsistencies and cleans up query packet handling. Tests are provided.
It now queries PocketMine-MP servers, as well as regular java edition servers.
Closes #145, properly.
Details on fixes (from https://wiki.vg/Query which seems to be the closest to the truth on minecraft protocol):
There was an extra zero int written to the handshake packet, now it conforms to this:

Cleaned up request packet generation as well, it all is now handled in one place, rather than doing most of the work in a single method and then adding a padding. It conforms to this:

Functionally not a lot changes.
Querier now generates proper session ids instead of always using 0, which helps readability and is more correct.

GameSpot) Query Protocol