diff --git a/src/commands/default/unloggedin.py b/src/commands/default/unloggedin.py index 16181692a6..1d6662b6a8 100644 --- a/src/commands/default/unloggedin.py +++ b/src/commands/default/unloggedin.py @@ -90,18 +90,15 @@ class CmdUnconnectedConnect(MuxCommand): session.execute_cmd("quit") return - # actually do the login. This will call all hooks. + # actually do the login. This will call all other hooks: + # session.at_init() + # if character: + # at_first_login() # only once + # at_pre_login() + # player.at_post_login() - calls look if no character is set + # character.at_post_login() - this calls look command by default session.session_login(player) - # we are logged in. Look around. - character = player.character - if character: - character.execute_cmd("look") - else: - # we have no character yet; use player's look, if it exists - player.execute_cmd("look") - - class CmdUnconnectedCreate(MuxCommand): """ Create a new account. diff --git a/src/objects/objects.py b/src/objects/objects.py index fa8e0b631f..d17e9192a7 100644 --- a/src/objects/objects.py +++ b/src/objects/objects.py @@ -761,6 +761,8 @@ class Character(Object): self.location.msg_contents("%s has entered the game." % self.name, exclude=[self]) self.location.at_object_receive(self, self.location) + # call look + self.execute_cmd("look") diff --git a/src/players/player.py b/src/players/player.py index 9599d4d16e..f399b6714f 100644 --- a/src/players/player.py +++ b/src/players/player.py @@ -288,11 +288,14 @@ class Player(TypeClass): def at_post_login(self): """ - Called at the end of the login - process, just before letting - them loose. + Called at the end of the login process, just before letting + them loose. This is called before an eventual Character's + at_post_login hook. """ - pass + # Character.at_post_login also looks around. Only use + # this as a backup when logging in without a character + if not self.character: + self.execute_cmd("look") def at_disconnect(self, reason=None): """