mirror of
https://github.com/ammaraskar/pyCraft.git
synced 2024-11-16 15:25:12 +01:00
commit
33f143d8be
@ -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"):
|
||||
|
@ -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)
|
||||
|
@ -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)
|
||||
|
Loading…
Reference in New Issue
Block a user