Move room removal to penguin class

This commit is contained in:
Ben 2019-08-06 22:52:20 +01:00
parent 0b9b16d638
commit 0bc4bdd8fe
2 changed files with 3 additions and 3 deletions

View File

@ -293,6 +293,9 @@ class Penguin(Spheniscidae):
self.data.username)) self.data.username))
async def _client_connected(self): async def _client_connected(self):
if self.room is not None:
return await self.room.remove_penguin(self)
await super()._client_connected() await super()._client_connected()
def __repr__(self): def __repr__(self):

View File

@ -133,9 +133,6 @@ 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):
if self.room is not None:
return await self.room.remove_penguin(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)