mirror of
https://github.com/solero/houdini.git
synced 2024-11-24 22:47:22 +00:00
Implement AbortHandlerChain
exception for aborting future handlers
This commit is contained in:
parent
bc059bacb8
commit
f4d4044a04
@ -13,6 +13,10 @@ class AuthorityError(Exception):
|
||||
"""Raised when a packet is received but user has not yet authenticated"""
|
||||
|
||||
|
||||
class AbortHandlerChain(Exception):
|
||||
"""Exception raised when handler wants to abort the rest of the handler chain"""
|
||||
|
||||
|
||||
class _Packet:
|
||||
__slots__ = ['id']
|
||||
|
||||
|
@ -4,7 +4,7 @@ from xml.etree.cElementTree import Element, SubElement, tostring
|
||||
import defusedxml.cElementTree as Et
|
||||
|
||||
from houdini.constants import ClientType
|
||||
from houdini.handlers import AuthorityError, XMLPacket, XTPacket
|
||||
from houdini.handlers import AuthorityError, AbortHandlerChain, XMLPacket, XTPacket
|
||||
|
||||
|
||||
class Spheniscidae:
|
||||
@ -161,6 +161,8 @@ class Spheniscidae:
|
||||
await self.__handle_xt_data(data)
|
||||
except AuthorityError:
|
||||
self.logger.debug(f'{self} tried to send game packet before authentication')
|
||||
except AbortHandlerChain as e:
|
||||
self.logger.info(f'Handler chain aborted: {str(e)}')
|
||||
|
||||
async def run(self):
|
||||
await self._client_connected()
|
||||
|
Loading…
Reference in New Issue
Block a user