Update to 1.4.4 protocol changes and removed weird old gui artifact

This commit is contained in:
Ammar Askar committed 2012-11-23 18:34:35 +05:00
1 parent f2d19d5b83
commit 3d8211b031
5 files changed
+9 -11

No files matched your search

+3
View File
@@ -90,6 +90,9 @@ def readEntityMetadata(FileObject):
if (val["id"] != -1): if (val["id"] != -1):
val["count"] = readByte(FileObject) val["count"] = readByte(FileObject)
val["damage"] = readShort(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: if ty == 6:
val = [] val = []
for i in range(3): for i in range(3):
+2 -7
View File
@@ -85,13 +85,8 @@ class ServerConnection(threading.Thread):
response = urllib2.urlopen(url).read() response = urllib2.urlopen(url).read()
if(response != "OK"): if(response != "OK"):
#handle gui errors print "Response from sessions.minecraft.net wasn't OK, it was " + response
if(self.NoGUI == False): return 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
#Success \o/ We can now begin sending our stuff to the server #Success \o/ We can now begin sending our stuff to the server
+1 -1
View File
@@ -635,7 +635,7 @@ def handle82(FileObject):
def handle83(FileObject): def handle83(FileObject):
ItemType = DataUtil.readShort(FileObject) ItemType = DataUtil.readShort(FileObject)
ItemID = DataUtil.readShort(FileObject) ItemID = DataUtil.readShort(FileObject)
TextLength = DataUtil.readByte(FileObject) TextLength = DataUtil.readShort(FileObject)
Text = DataUtil.readByteArray(FileObject, TextLength) Text = DataUtil.readByteArray(FileObject, TextLength)
return {'ItemType' : ItemType, return {'ItemType' : ItemType,
'ItemID' : ItemID, 'ItemID' : ItemID,
+1 -1
View File
@@ -12,7 +12,7 @@ def sendHandshake(socket, username, host, port):
socket.send("\x02") socket.send("\x02")
#byte - protocol version #byte - protocol version
DataUtil.sendByte(socket, 47) DataUtil.sendByte(socket, 49)
#string - username #string - username
DataUtil.sendString(socket, username) DataUtil.sendString(socket, username)
+2 -2
View File
@@ -25,7 +25,7 @@ if __name__ == "__main__":
help="file to dump packets to") help="file to dump packets to")
(options, args) = parser.parse_args() (options, args) = parser.parse_args()
if(options.username != ""): if(options.username != ""):
user = options.username user = options.username
else: else:
@@ -40,7 +40,7 @@ if __name__ == "__main__":
derp = loginThread.getResponse() derp = loginThread.getResponse()
if(derp['Response'] != "Good to go!"): if(derp['Response'] != "Good to go!"):
print derp['Response'] print derp['Response']
sys.exit() sys.exit(1)
sessionid = derp['SessionID'] sessionid = derp['SessionID']
print "Logged in as " + derp['Username'] + "! Your session id is: " + sessionid print "Logged in as " + derp['Username'] + "! Your session id is: " + sessionid
if(options.server != ""): if(options.server != ""):