Remove penguin from room upon disconnection

This commit is contained in:
rsakeys 2019-08-05 21:47:31 +03:00
parent 25cb12df08
commit 0b9b16d638

View File

@ -133,8 +133,10 @@ class Spheniscidae:
self.logger.info('Client %s connected', self.peer_name) self.logger.info('Client %s connected', self.peer_name)
async def _client_disconnected(self): async def _client_disconnected(self):
del self.server.peers_by_ip[self.peer_name] if self.room is not None:
return await self.room.remove_penguin(self)
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)
async def __data_received(self, data): async def __data_received(self, data):