有没有办法从 Python 向 Minecraft 服务器发送登录数据包?
这是我现在所拥有的:
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()
我想发送带有非高级用户名的登录数据包(或者如果可能的话,一个不存在的用户名)