mirror of
https://github.com/solero/houdini.git
synced 2024-11-25 15:07:24 +00:00
Catch checklist exception on DummyEvent listeners
This commit is contained in:
parent
aef99a11b6
commit
29706065ae
@ -136,21 +136,27 @@ class Spheniscidae:
|
|||||||
async def _client_connected(self):
|
async def _client_connected(self):
|
||||||
self.logger.info('Client %s connected', self.peer_name)
|
self.logger.info('Client %s connected', self.peer_name)
|
||||||
|
|
||||||
|
try:
|
||||||
dummy_event = DummyEventPacket('connected')
|
dummy_event = DummyEventPacket('connected')
|
||||||
if dummy_event in self.server.dummy_event_listeners:
|
if dummy_event in self.server.dummy_event_listeners:
|
||||||
dummy_event_listeners = self.server.dummy_event_listeners[dummy_event]
|
dummy_event_listeners = self.server.dummy_event_listeners[dummy_event]
|
||||||
for listener in dummy_event_listeners:
|
for listener in dummy_event_listeners:
|
||||||
await listener(self)
|
await listener(self)
|
||||||
|
except ChecklistError:
|
||||||
|
self.logger.debug('{} sent a packet without meeting checklist requirements'.format(self))
|
||||||
|
|
||||||
async def _client_disconnected(self):
|
async def _client_disconnected(self):
|
||||||
del self.server.peers_by_ip[self.peer_name]
|
del self.server.peers_by_ip[self.peer_name]
|
||||||
self.logger.info('Client %s disconnected', self.peer_name)
|
self.logger.info('Client %s disconnected', self.peer_name)
|
||||||
|
|
||||||
|
try:
|
||||||
dummy_event = DummyEventPacket('disconnected')
|
dummy_event = DummyEventPacket('disconnected')
|
||||||
if dummy_event in self.server.dummy_event_listeners:
|
if dummy_event in self.server.dummy_event_listeners:
|
||||||
dummy_event_listeners = self.server.dummy_event_listeners[dummy_event]
|
dummy_event_listeners = self.server.dummy_event_listeners[dummy_event]
|
||||||
for listener in dummy_event_listeners:
|
for listener in dummy_event_listeners:
|
||||||
await listener(self)
|
await listener(self)
|
||||||
|
except ChecklistError:
|
||||||
|
self.logger.debug('{} sent a packet without meeting checklist requirements'.format(self))
|
||||||
|
|
||||||
async def __data_received(self, data):
|
async def __data_received(self, data):
|
||||||
data = data.decode()[:-1]
|
data = data.decode()[:-1]
|
||||||
|
Loading…
Reference in New Issue
Block a user