0

Is there a way to send a login packet to Minecraft server from Python?
Here is what I have right now:

import socket
client = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
addr = ("localhost", 25565)
client.connect(addr)
client.sendall(chr(0x02))
client.sendall(chr(0xFD))
client.sendall(chr(0xCD)) # After sending this line server still don't kick me
client.sendall(chr(0x06)+str(117)+str(70)+str(-46)) # And now server kicks me :-(
client.sendall(chr(0x03)+str("Hello World"))
print client.recv(4096)
client.close()

I'd like to send login packets with a non-premium username (or one that doesn't exist if it is possible)

JadedTuna
  • 1,783
  • 2
  • 18
  • 32
  • I don't think you can login with non-premium account because the server and the client have to authenticate with minecraft.net. The client has to authenticate twice even. – BlueSpud Sep 15 '13 at 13:06
  • How does cracked minecraft work then? You can connect to a cracked server. – JadedTuna Sep 15 '13 at 13:46
  • Cracked Minecraft doesn't authenticate, the servers have offline mode on which means that they don't authenticate with minecraft.net. It also means that you can't go on regular servers with a cracked account – BlueSpud Sep 15 '13 at 13:57
  • Is it possible to connect to cracked server with python and non-premium accout? – JadedTuna Sep 15 '13 at 14:13
  • Probably, though I've never tried it. – BlueSpud Sep 15 '13 at 14:46

1 Answers1

0

An alternative would be to use someone-else's python library that does it for you - like quarry or others mentioned here. Also see this related question.

Community
  • 1
  • 1
Pierz
  • 7,064
  • 52
  • 59