Closed Douile closed 1 year ago
Hmmm, I do recall when I implemented it that some popular/big servers use some 'anti-ddos' solutions and some queries return with made up data/straight up doesn't work.
If you mentioned that it works with the node
version, then yeah, this would probably would be a bug.
I believe they are using proxy software like https://papermc.io/software/velocity but i will have to test to confirm
Nevermind after looking into it I have found the issue. The difference between node and rust is that node sends the server address, while we use gamedig as the server address.
Big servers (hypixel) will ignore the query if it doesn't have the correct server address.
The problem with this is that the server address needs to be the hostname of the server, in hypixels case mc.hypixel.net
, but our query logic only passes IP address to the query function.
There are 2 solutions I can think of for this:
&str
or impl ToSocketAddrs
instead of IpAddr
for query giving the query function access to the pre-resolved host-name but also requiring us to do the lookup
ToSocketAddrs
is the only way to do DNS lookups in std at the moment, but it requires a port to be included (hacky fix is to append ":0" if we are passed a string but that won't work if we implement generically)Hey, coming back to this a bit late, I couldn't make a working version, I'll look into this a bit further.
Regarding the solutions, I do want to opt in for the 'additional arguments'.
While working on integration tests I noticed that Minecraft query doesn't work for popular servers such as
mc.hypixel.net
.Looking at the output of node-gamedig it succeeds with the "vanilla" protocol which is the equivalent of our java.
Using mc-java there is a packet underflow: