mirror of
https://github.com/solero/houdini.git
synced 2024-11-14 14:48:21 +00:00
Catch CooldownError, AuthorityError and ChecklistError
This commit is contained in:
parent
a4052b66d5
commit
1429e9e9be
@ -5,6 +5,10 @@ from asyncio import IncompleteReadError, CancelledError
|
|||||||
import defusedxml.cElementTree as Et
|
import defusedxml.cElementTree as Et
|
||||||
from xml.etree.cElementTree import Element, SubElement, tostring
|
from xml.etree.cElementTree import Element, SubElement, tostring
|
||||||
|
|
||||||
|
from houdini.handlers import AuthorityError
|
||||||
|
from houdini.converters import ChecklistError
|
||||||
|
from houdini.cooldown import CooldownError
|
||||||
|
|
||||||
|
|
||||||
class Spheniscidae:
|
class Spheniscidae:
|
||||||
|
|
||||||
@ -135,10 +139,17 @@ class Spheniscidae:
|
|||||||
|
|
||||||
async def __data_received(self, data):
|
async def __data_received(self, data):
|
||||||
data = data.decode()[:-1]
|
data = data.decode()[:-1]
|
||||||
|
try:
|
||||||
if data.startswith('<'):
|
if data.startswith('<'):
|
||||||
await self.__handle_xml_data(data)
|
await self.__handle_xml_data(data)
|
||||||
else:
|
else:
|
||||||
await self.__handle_xt_data(data)
|
await self.__handle_xt_data(data)
|
||||||
|
except AuthorityError:
|
||||||
|
self.logger.debug('{} tried to send game packet before authentication'.format(self))
|
||||||
|
except CooldownError:
|
||||||
|
self.logger.debug('{} tried to send a packet during a cooldown'.format(self))
|
||||||
|
except ChecklistError:
|
||||||
|
self.logger.debug('{} sent a packet without meeting checklist requirements'.format(self))
|
||||||
|
|
||||||
async def run(self):
|
async def run(self):
|
||||||
await self._client_connected()
|
await self._client_connected()
|
||||||
|
Loading…
Reference in New Issue
Block a user