barneygale / quarry

Python library that implements the Minecraft network protocol and data types
Other
527 stars 75 forks source link

zlib.error: Error -5 while decompressing data: incomplete or truncated stream #106

Open Widowan opened 3 years ago

Widowan commented 3 years ago

I just tried to use quarry to connect to non-vanilla server, but it failed with mentioned above error. After tinkering around with it, I managed to fix the issue by patching library and using zlib.decompressobj instead of zlib.decompress https://github.com/barneygale/quarry/blob/313f9fdfc624f2eddcb3826adb0d871819f47ce2/quarry/types/buffer/v1_7.py#L257

Don't know if it's worth mentioning, but uncompressed length was 30848 bytes.

barneygale commented 3 years ago

Thanks for the report. Pretty strange to be honest! Can you share more info on the server?

Widowan commented 3 years ago

Sure. The server was play.minesuperior.com

Widowan commented 3 years ago

I almost forgot, it's worth mentioning that server is using TCP Shield, so I had to manually set force protocol version to latest