From 7a367acef3dea307e9cd7869cc65ad8b639238b0 Mon Sep 17 00:00:00 2001 From: ChillerDragon Date: Mon, 8 May 2023 09:51:03 +0200 Subject: [PATCH] Fix python caching flags of old packets --- twnet_parser/packet.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/twnet_parser/packet.py b/twnet_parser/packet.py index b1dcdfd..0fc6a02 100644 --- a/twnet_parser/packet.py +++ b/twnet_parser/packet.py @@ -43,7 +43,7 @@ class PacketFlags6(PrettyPrint): class PacketHeader(PrettyPrint): def __init__( self, - flags: PacketFlags7 = PacketFlags7(), + flags: Optional[PacketFlags7] = None, ack: int = 0, token: bytes = b'\xff\xff\xff\xff', num_chunks: Optional[int] = None @@ -53,6 +53,8 @@ class PacketHeader(PrettyPrint): the messages it was given when the pack() method is called """ + if not flags: + flags = PacketFlags7() self.flags: PacketFlags7 = flags self.ack: int = ack % NET_MAX_SEQUENCE self.token: bytes = token