def verify_password(self, arg):
        """Verify that the password provided by the player and the password from
        their database profile are correct, or reset the password if it was forgotton.
        
        PREV STATE: self.verify_playername
        NEXT STATE: self.character_cleanup, if the correct password was provided
                    self.verify_playername, if an incorrect password was provided
                    self.reset_password, if they forgot their password
        """
        if arg == 'forgot':
            self.state = self.reset_password
            return
        password = hashlib.sha1(arg).hexdigest()
        if password == self.password:
            # Wicked cool, our player exists AND the right person is self.world.logging in
            self.player.playerize(self.world.db.select('* FROM player WHERE dbid=?', [self.dbid])[0])
            # Make sure that we clear the concealed text effect that we 
            # initiated when we moved to the password state
            self.player.update_output(CLEAR)
            self.state = self.character_cleanup
        else:
            self.next_state = self.verify_playername
            self.player.update_output([CLEAR + "Bad playername or password. ", \
                        "If you have forgotton your password, enter 'forgot' for your password, " + \
                         "and we will e-mail you a code to reset it.", "Enter playername: "])
dataset/ETHPy150Open shinymud/ShinyMUD/src/shinymud/modes/init_mode.py/InitMode.verify_password/original