def login(session, *args, **kwargs): """ Peform a login. This only works if session is currently not logged in. This will also automatically throttle too quick attempts. Kwargs: name (str): Account name password (str): Plain-text password """ if not session.logged_in and "name" in kwargs and "password" in kwargs: from evennia.commands.default.unloggedin import create_normal_account account = create_normal_account(session, kwargs["name"], kwargs["password"]) if account: session.sessionhandler.login(session, account)