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