From 70e89fc4a934e6796dbbbeab9e1dbba55364bbb8 Mon Sep 17 00:00:00 2001 From: alemidev Date: Mon, 23 May 2022 01:09:01 +0200 Subject: [PATCH] add set_compression to dispatcher --- aiocraft/dispatcher.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/aiocraft/dispatcher.py b/aiocraft/dispatcher.py index bfd7e14..876c149 100644 --- a/aiocraft/dispatcher.py +++ b/aiocraft/dispatcher.py @@ -148,6 +148,10 @@ class Dispatcher: self._packet_id_whitelist = set((P(self._proto).id for P in self._packet_whitelist)) return self + def set_compression(self, threshold:Optional[int] = None) -> 'Dispatcher': + self._compression = threshold + return self + def set_state(self, state:Optional[ConnectionState]=ConnectionState.HANDSHAKING) -> 'Dispatcher': self.state = state or self.state return self