Added at_post_disconnect() hook to Player, to allow for clean deletion of players at disconnect (for example for Guest-account implementation)

This commit is contained in:
Griatch 2014-07-06 16:20:50 +02:00
parent 88efc50054
commit 1874300ad1
2 changed files with 12 additions and 0 deletions

View file

@ -383,6 +383,16 @@ class Player(TypeClass):
reason = reason and "(%s)" % reason or ""
self._send_to_connect_channel("{R%s disconnected %s{n" % (self.key, reason))
def at_post_disconnect(self):
"""
This is called after disconnection is complete. No messages
can be relayed to the player from here. After this call, the
player should not be accessed any more, making this a good
spot for deleting it (in the case of a guest player account,
for example).
"""
pass
def at_message_receive(self, message, from_obj=None):
"""
Called when any text is emitted to this