Hey there,
I have got a problem: I want to code something like a status-checker for a minecraft server (After Minecraft 1.7)
I know, that I have to create a socket to the server:
This seems ok, the server is accepting the socket (Or at least, there is no error, while opening the socket)
Then I need to do the handshake! I found information that I need to send two different packets to the server, the 0x2-(Handshake)-Packet and the login packet. I found posts, where people were saying, that the minecraft server disconnectes the connection. But my server does not even react to my try:
Also I found different shapes for the packets. Often, they had unused bytes or some different information, like the login name. But what ever I tried, it didn't worked at all. SoI ask for anyone, who can send me a good tutorial how to do this handshake or anyone, who can explain, what I have to do!
BlackTechs
I have got a problem: I want to code something like a status-checker for a minecraft server (After Minecraft 1.7)
I know, that I have to create a socket to the server:
Code
Socket skt = new Socket(IP, port);This seems ok, the server is accepting the socket (Or at least, there is no error, while opening the socket)
Then I need to do the handshake! I found information that I need to send two different packets to the server, the 0x2-(Handshake)-Packet and the login packet. I found posts, where people were saying, that the minecraft server disconnectes the connection. But my server does not even react to my try:
Code
DataOutputStream writer = new DataOutputStream(
skt.getOutputStream());
writer.writeByte(0x2);
writer.writeByte(4);
writeString("127.0.0.1", writer);
writer.writeInt(25566);
writer.writeInt(2);
writer.flush();Also I found different shapes for the packets. Often, they had unused bytes or some different information, like the login name. But what ever I tried, it didn't worked at all. SoI ask for anyone, who can send me a good tutorial how to do this handshake or anyone, who can explain, what I have to do!
BlackTechs



