2013-08-19 39 views
0

有沒有辦法從python發送登錄數據包到Minecraft服務器?
這裏是我現在所擁有的:

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() 


希望有辦法做到這一點:-)。

編輯:

順便說一句,我想送與非付費用戶名(或不存在的)登錄的數據包,如果可能的話:-))

+0

我不認爲您可以使用非高級帳戶登錄,因爲服務器和客戶端必須使用minecraft.net進行身份驗證。客戶端甚至需要驗證兩次。 – BlueSpud

+0

然後,破解的Minecraft如何工作?您可以連接到破解的服務器。 – JadedTuna

+0

Cracked Minecraft無法進行身份驗證,服務器具有離線模式,這意味着他們不會使用minecraft.net進行身份驗證。這也意味着你不能使用破解賬戶登錄常規服務器 – BlueSpud

回答

0

的另一種方法是使用別人的python庫爲你做 - 例如quarry或其他提到的here。另請參閱此相關的question