Provide data to plugins from chunk packets properly
This commit is contained in:
1 parent
d9199a3e2a
commit
83ad822bad
3 files changed
+36
-20
No files matched your search
@@ -16,6 +16,7 @@ from Crypto.Cipher import PKCS1_v1_5
|
||||
|
||||
EntityID = 0
|
||||
|
||||
|
||||
class ServerConnection(threading.Thread):
|
||||
def __init__(self, pluginLoader, username, sessionID, server, port, options=None):
|
||||
threading.Thread.__init__(self)
|
||||
@@ -116,7 +117,6 @@ class ServerConnection(threading.Thread):
|
||||
print "Connection to server failed"
|
||||
traceback.print_exc()
|
||||
sys.exit(1)
|
||||
return False
|
||||
|
||||
|
||||
class EncryptedFileObjectHandler():
|
||||
|
||||
@@ -440,13 +440,17 @@ def handle2B(FileObject):
|
||||
def handle33(FileObject):
|
||||
X = DataUtil.readInt(FileObject)
|
||||
Z = DataUtil.readInt(FileObject)
|
||||
GroundUpContinous = DataUtil.readBoolean(FileObject)
|
||||
GroundUpContinuous = DataUtil.readBoolean(FileObject)
|
||||
PrimaryBitMap = DataUtil.readShort(FileObject)
|
||||
AddBitMap = DataUtil.readShort(FileObject)
|
||||
CompressedSize = DataUtil.readInt(FileObject)
|
||||
FileObject.read(CompressedSize) #not going to be inflating and using this data until I know how to :3
|
||||
RawData = FileObject.read(CompressedSize)
|
||||
return {'x': X,
|
||||
'z': Z
|
||||
'z': Z,
|
||||
'GroundUpContinuous': GroundUpContinuous,
|
||||
'PrimaryBitMap': PrimaryBitMap,
|
||||
'AddBitMap': AddBitMap,
|
||||
'RawData': RawData
|
||||
}
|
||||
|
||||
|
||||
@@ -521,14 +525,25 @@ def handle38(FileObject):
|
||||
|
||||
#int - chunk data length
|
||||
ChunkDataLength = DataUtil.readInt(FileObject)
|
||||
DataUtil.readBoolean(FileObject)
|
||||
FileObject.read(ChunkDataLength) #just gonna ignore this for now
|
||||
SkyLightSent = DataUtil.readBoolean(FileObject)
|
||||
RawData = FileObject.read(ChunkDataLength)
|
||||
|
||||
#metadata - ignoring this
|
||||
metadata = []
|
||||
for i in range(ChunkCount):
|
||||
FileObject.read(12)
|
||||
ChunkX = DataUtil.readInt(FileObject)
|
||||
ChunkZ = DataUtil.readInt(FileObject)
|
||||
PrimaryBitMap = DataUtil.readUnsignedShort(FileObject)
|
||||
AddBitMap = DataUtil.readUnsignedShort(FileObject)
|
||||
metadata.append({'x': ChunkX,
|
||||
'z': ChunkZ,
|
||||
'PrimaryBitMap': PrimaryBitMap,
|
||||
'AddBitMap': AddBitMap
|
||||
})
|
||||
|
||||
return {'ChunkCount': ChunkCount
|
||||
return {'ChunkCount': ChunkCount,
|
||||
'SkyLightSent': SkyLightSent,
|
||||
'RawData': RawData,
|
||||
'ChunkMeta': metadata
|
||||
}
|
||||
|
||||
|
||||
|
||||
Reference in new issue
Block a user