feat: compress payloads if flag is set

works fine with libtw2 but TeeAI is stuck in a inf loop
This commit is contained in:
ChillerDragon 2023-06-24 10:48:34 +02:00
parent 941249f5a3
commit e27e5aef67
2 changed files with 3 additions and 1 deletions

View file

@ -287,7 +287,7 @@ max-attributes=7
max-bool-expr=5
# Maximum number of branch for function / method body.
max-branches=12
max-branches=14
# Maximum number of locals for function / method body.
max-locals=15

View file

@ -247,6 +247,8 @@ class TwPacket(PrettyPrint):
if is_connless:
if self.header.flags.connless is None:
self.header.flags.connless = True
if self.header.flags.compression:
payload = twnet_parser.huffman.compress(payload)
return self.header.pack() + payload
class PacketHeaderParser6():