mirror of
https://github.com/solero/houdini.git
synced 2024-12-23 14:03:38 +00:00
General improvements to _client_disconnected
This isn't staying. Potential decorator for individual (and multiple) disconnect (and connect?) handlers to be used within the handler modules.
This commit is contained in:
parent
2e414e0f5a
commit
a6e1d05a52
@ -292,11 +292,17 @@ class Penguin(Spheniscidae):
|
||||
'{} removed their background item'.format(
|
||||
self.data.username))
|
||||
|
||||
async def _client_connected(self):
|
||||
if self.room is not None:
|
||||
return await self.room.remove_penguin(self)
|
||||
async def _client_disconnected(self):
|
||||
if self.joined_world:
|
||||
if self.room is not None:
|
||||
await self.room.remove_penguin(self)
|
||||
|
||||
await super()._client_connected()
|
||||
del self.server.penguins_by_id[self.data.id]
|
||||
del self.server.penguins_by_username[self.data.username]
|
||||
|
||||
await self.server.redis.hincrby('population', self.server.server_config['Id'], -1)
|
||||
|
||||
await super()._client_disconnected()
|
||||
|
||||
def __repr__(self):
|
||||
if self.data is not None:
|
||||
|
Loading…
Reference in New Issue
Block a user