Closed MeRuslan closed 3 years ago
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.
No, magic number was always there. The issue was an extra 0 in a handshake packet.
Released in v6.1.2 Thanks for the contribution ❤️
Thanks for a prompt review.
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