diff --git a/game/gamesrc/objects/baseobjects.py b/game/gamesrc/objects/baseobjects.py index b29bc4303..9ff2ea840 100644 --- a/game/gamesrc/objects/baseobjects.py +++ b/game/gamesrc/objects/baseobjects.py @@ -94,6 +94,25 @@ class Character(BaseCharacter): # expand with whatever customizations you want below... # ... + + def at_disconnect(self): + """ + We stove away the character when logging off, otherwise they will remain where + they are, 'headless', so to say. + """ + self.location.msg_contents("%s has left the game." % self.name) + self.db.prelogout_location = self.location + self.location = None + + def at_post_login(self): + """ + This recovers the character again after having been "stoved away" at disconnect. + """ + if self.db.prelogout_location: + self.location = self.db.prelogout_location + else: + self.db.prelogout_location = self.location + self.location.msg_contents("%s has entered the game." % self.name) class Room(BaseRoom): """ diff --git a/src/players/player.py b/src/players/player.py index 0c5a9cf03..44c82f47c 100644 --- a/src/players/player.py +++ b/src/players/player.py @@ -24,7 +24,9 @@ class Player(TypeClass): register with the game). It's a good place to store attributes all players should have, like configuration values etc. - """ + """ + # the text encoding to use. + self.db.encoding = "utf-8" pass # Note that the hooks below also exist