diff --git a/networking/DataUtil.py b/networking/DataUtil.py index 3b30a76..b075579 100644 --- a/networking/DataUtil.py +++ b/networking/DataUtil.py @@ -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): diff --git a/networking/NetworkManager.py b/networking/NetworkManager.py index 96f35f7..c5fb550 100644 --- a/networking/NetworkManager.py +++ b/networking/NetworkManager.py @@ -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 diff --git a/networking/PacketListenerManager.py b/networking/PacketListenerManager.py index 1f0a09d..e824eec 100644 --- a/networking/PacketListenerManager.py +++ b/networking/PacketListenerManager.py @@ -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, diff --git a/networking/PacketSenderManager.py b/networking/PacketSenderManager.py index 84f61f9..b3f0305 100644 --- a/networking/PacketSenderManager.py +++ b/networking/PacketSenderManager.py @@ -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) diff --git a/start.py b/start.py index 69cc00f..8e56bfe 100644 --- a/start.py +++ b/start.py @@ -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 != ""):