![]() |
|
[Java] How to do a Minecraft Handshake [1.7.2] - Printable Version +- Hack Forums (https://hackforums.net) +-- Forum: Tech (https://hackforums.net/forumdisplay.php?fid=444) +--- Forum: Coding (https://hackforums.net/forumdisplay.php?fid=151) +---- Forum: Software Development (https://hackforums.net/forumdisplay.php?fid=118) +---- Thread: [Java] How to do a Minecraft Handshake [1.7.2] (/showthread.php?tid=4346431) |
How to do a Minecraft Handshake [1.7.2] - BlackTechs - Jul 18, 2014 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: 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(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 * - Achilles Heel - Jul 18, 2014 Its been a while since I messed with minecraft packets. But if I remember, any string in a packet had an int before it that was the length of the string. * - ☕⚛Austin⚛☕ - Jul 18, 2014 Decompile Minecraft using MCP and there will be plenty of examples in there. They are doing rewrites of almost every class in the game to improve performance, so it will probably change once 1.8 comes out. /*Edit*/ This might be helpful too... Minecraft Protocol * - BlackTechs - Jul 20, 2014 Yeah well, decompiling does not help, because Minecraft uses about 112701234013 (just irony) different classes and stuff to do the client-server-protocoll. the protocol does not help anyway, it says what to do but not how to do! I worked with the protocol and a decompiled minecraft for hours before I posted my thread. It just said nothing to me... Edit: Ah yes, I AM sending the size of the string within the packet! I am using a methode writeString(String) that sends first the size of the String, and then the string |