diff --git a/src/objects/objects.py b/src/objects/objects.py index 1df919d032..6a748cdbb3 100644 --- a/src/objects/objects.py +++ b/src/objects/objects.py @@ -465,12 +465,13 @@ class Object(TypeClass): """ pass - def at_pre_puppet(self, player): + def at_pre_puppet(self, player, sessid=None): """ Called just before a Player connects to this object to puppet it. player - connecting player object + sessid - session id controlling the connection """ pass @@ -488,13 +489,14 @@ class Object(TypeClass): """ pass - def at_post_unpuppet(self, player): + def at_post_unpuppet(self, player, sessid=None): """ Called just after the Player successfully disconnected from this object, severing all connections. player - the player object that just disconnected from this object. + sessid - session id controlling the connection """ pass @@ -793,7 +795,7 @@ class Character(Object): "Default is to look around after a move." self.execute_cmd('look') - def at_pre_puppet(self, player): + def at_pre_puppet(self, player, sessid=None): """ This recovers the character again after having been "stoved away" at the unpuppet """ @@ -809,7 +811,7 @@ class Character(Object): self.location.msg_contents("%s has entered the game." % self.name, exclude=[self]) self.location.at_object_receive(self, self.location) else: - player.msg("{r%s has no location and no home is set.{n" % self) + player.msg("{r%s has no location and no home is set.{n" % self, sessid=sessid) def at_post_puppet(self): """ @@ -820,7 +822,7 @@ class Character(Object): if self.location: self.location.msg_contents("%s has entered the game." % self.name, exclude=[self]) - def at_post_unpuppet(self, player): + def at_post_unpuppet(self, player, sessid=None): """ We stove away the character when the player goes ooc/logs off, otherwise the character object will remain in the room also after the player logged off ("headless", so to say). diff --git a/src/players/models.py b/src/players/models.py index 278ab00a14..aaab60f7e1 100644 --- a/src/players/models.py +++ b/src/players/models.py @@ -421,7 +421,7 @@ class PlayerDB(TypedObject): # with a lingering player/sessid reference from an unclean server kill or similar if normal_mode: - _GA(obj.typeclass, "at_pre_puppet")(self.typeclass) + _GA(obj.typeclass, "at_pre_puppet")(self.typeclass, sessid=sessid) # do the connection obj.sessid = sessid obj.player = self @@ -453,7 +453,7 @@ class PlayerDB(TypedObject): del obj.dbobj.player session.puppet = None session.puid = None - _GA(obj.typeclass, "at_post_unpuppet")(self) + _GA(obj.typeclass, "at_post_unpuppet")(self.typeclass, sessid=sessid) return True def unpuppet_all(self):