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:
![image](https://user-images.githubusercontent.com/3734331/122765001-b81a4480-d2a8-11eb-8a9c-e519d8fab82f.png)
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:
![image](https://user-images.githubusercontent.com/3734331/122766277-0419b900-d2aa-11eb-87bc-06b227938c98.png)
Functionally not a lot changes.
Querier now generates proper session ids instead of always using 0, which helps readability and is more correct.
![image](https://user-images.githubusercontent.com/3734331/122765726-76d66480-d2a9-11eb-891d-611742c440d1.png)
GameSpot) Query Protocol