mirror of
https://github.com/solero/houdini.git
synced 2024-11-08 20:28:20 +00:00
Temporary solution for "matching" packet data to handlers
This commit is contained in:
parent
fed5cf01ec
commit
dde08459e9
@ -66,12 +66,13 @@ class _Listener(_ArgumentDeserializer):
|
||||
|
||||
class _XTListener(_Listener):
|
||||
|
||||
__slots__ = ['pre_login']
|
||||
__slots__ = ['pre_login', 'match']
|
||||
|
||||
def __init__(self, *args, **kwargs):
|
||||
super().__init__(*args, **kwargs)
|
||||
|
||||
self.pre_login = kwargs.get('pre_login')
|
||||
self.match = kwargs.get('match')
|
||||
|
||||
async def __call__(self, p, packet_data):
|
||||
try:
|
||||
@ -79,6 +80,7 @@ class _XTListener(_Listener):
|
||||
await p.close()
|
||||
raise AuthorityError(f'{p} tried sending XT packet before authentication!')
|
||||
|
||||
if self.match is None or packet_data[:len(self.match)] == self.match:
|
||||
await super()._check_cooldown(p)
|
||||
super()._check_list(p)
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user