Update to 1.4.4 protocol changes and removed weird old gui artifact

This commit is contained in:
Ammar Askar 2012-11-19 23:56:51 +05:00
parent f2d19d5b83
commit 3d8211b031
5 changed files with 9 additions and 11 deletions

View File

@ -90,6 +90,9 @@ def readEntityMetadata(FileObject):
if (val["id"] != -1):
val["count"] = readByte(FileObject)
val["damage"] = readShort(FileObject)
nbtDataLength = readShort(FileObject)
if (nbtDataLength != -1):
val["NBT"] = NBTFile(BytesIO(readByteArray(FileObject, nbtDataLength)), compression=NBTFile.Compression.GZIP)
if ty == 6:
val = []
for i in range(3):

View File

@ -85,13 +85,8 @@ class ServerConnection(threading.Thread):
response = urllib2.urlopen(url).read()
if(response != "OK"):
#handle gui errors
if(self.NoGUI == False):
self.window.ConnectPanel.Status.SetFont(wx.Font(15, wx.MODERN, wx.NORMAL, wx.NORMAL, 0, "Minecraft"))
self.window.ConnectPanel.Status.SetLabel("Response from sessions.minecraft.net wasn't OK")
else:
print "Response from sessions.minecraft.net wasn't OK, it was " + response
return False
print "Response from sessions.minecraft.net wasn't OK, it was " + response
return False
#Success \o/ We can now begin sending our stuff to the server

View File

@ -635,7 +635,7 @@ def handle82(FileObject):
def handle83(FileObject):
ItemType = DataUtil.readShort(FileObject)
ItemID = DataUtil.readShort(FileObject)
TextLength = DataUtil.readByte(FileObject)
TextLength = DataUtil.readShort(FileObject)
Text = DataUtil.readByteArray(FileObject, TextLength)
return {'ItemType' : ItemType,
'ItemID' : ItemID,

View File

@ -12,7 +12,7 @@ def sendHandshake(socket, username, host, port):
socket.send("\x02")
#byte - protocol version
DataUtil.sendByte(socket, 47)
DataUtil.sendByte(socket, 49)
#string - username
DataUtil.sendString(socket, username)

View File

@ -25,7 +25,7 @@ if __name__ == "__main__":
help="file to dump packets to")
(options, args) = parser.parse_args()
if(options.username != ""):
user = options.username
else:
@ -40,7 +40,7 @@ if __name__ == "__main__":
derp = loginThread.getResponse()
if(derp['Response'] != "Good to go!"):
print derp['Response']
sys.exit()
sys.exit(1)
sessionid = derp['SessionID']
print "Logged in as " + derp['Username'] + "! Your session id is: " + sessionid
if(options.server != ""):