Merge pull request #17 from EXio4/implement_74

Update to protocol 74
This commit is contained in:
Ammar Askar 2013-07-24 09:31:02 -07:00
commit 33f143d8be
3 changed files with 19 additions and 2 deletions

View File

@ -305,6 +305,8 @@ class PacketListener(threading.Thread):
packet = PacketListenerManager.handle6A(self.FileObject)
elif (response == "\x6B"):
packet = PacketListenerManager.handle6B(self.FileObject)
elif (response == "\x78"):
packet = PacketListenerManager.handle78(self.FileObject)
elif (response == "\x82"):
packet = PacketListenerManager.handle82(self.FileObject)
elif (response == "\x83"):

View File

@ -447,6 +447,12 @@ def handle2C(FileObject):
key = DataUtil.readString(FileObject)
value = DataUtil.readDouble(FileObject)
Properties[key] = value
len = DataUtil.readShort(FileObject)
for x in range(len):
uuid_msb = DataUtil.readLong(FileObject)
uuid_lsb = DataUtil.readLong(FileObject)
amount = DataUtil.readDouble(FileObject)
operation = DataUtil.readByte(FileObject)
return {'EntityID': EntityID,
'Properties': Properties
}
@ -731,6 +737,15 @@ def handle6B(FileObject):
'ClickedItem': ClickedItem
}
def handle78(FileObject):
EntityID = DataUtil.readByte(FileObject)
X = DataUtil.readInt(FileObject)
Y = DataUtil.readInt(FileObject)
Z = DataUtil.readInt(FileObject)
return {'EntityID': EntityID,
'x': X,
'y': Y,
'z': Z}
def handle82(FileObject):
X = DataUtil.readInt(FileObject)

View File

@ -13,7 +13,7 @@ def sendHandshake(socket, username, host, port):
socket.send("\x02")
#byte - protocol version
DataUtil.sendByte(socket, 73)
DataUtil.sendByte(socket, 74)
#string - username
DataUtil.sendString(socket, username)
@ -56,4 +56,4 @@ def sendFC(socket, secret, token):
def sendFF(socket, reason):
#string - disconnect reason
DataUtil.sendString(socket, reason)
DataUtil.sendString(socket, reason)