From 34021ad38809bdd1cf6905e574d8e93c4d191e3f Mon Sep 17 00:00:00 2001 From: Griatch Date: Sun, 6 Aug 2023 23:24:22 +0200 Subject: [PATCH] Remove dead code from unloggedin module --- evennia/commands/default/unloggedin.py | 70 -------------------------- 1 file changed, 70 deletions(-) diff --git a/evennia/commands/default/unloggedin.py b/evennia/commands/default/unloggedin.py index 574859ed2f..7bc58dc115 100644 --- a/evennia/commands/default/unloggedin.py +++ b/evennia/commands/default/unloggedin.py @@ -465,73 +465,3 @@ class CmdUnconnectedInfo(COMMAND_DEFAULT_CLASS): utils.get_evennia_version(), ) ) - - -def _create_account(session, accountname, password, permissions, typeclass=None, email=None): - """ - Helper function, creates an account of the specified typeclass. - """ - try: - new_account = create.create_account( - accountname, email, password, permissions=permissions, typeclass=typeclass - ) - - except Exception as e: - session.msg( - "There was an error creating the Account:\n%s\n If this problem persists, contact an" - " admin." % e - ) - logger.log_trace() - return False - - # This needs to be set so the engine knows this account is - # logging in for the first time. (so it knows to call the right - # hooks during login later) - new_account.db.FIRST_LOGIN = True - - # join the new account to the public channels - for chan_info in settings.DEFAULT_CHANNELS: - if chankey := chan_info.get("key"): - channel = ChannelDB.objects.get_channel(chankey) - if not channel or not ( - channel.access(new_account, "listen") and channel.connect(new_account) - ): - string = ( - f"New account '{new_account.key}' could not connect to default channel" - f" '{chankey}'!" - ) - logger.log_err(string) - else: - logger.log_err(f"Default channel '{chan_info}' is missing a 'key' field!") - - return new_account - - def _create_character(session, new_account, typeclass, home, permissions): - """ - Helper function, creates a character based on an account's name. - This is meant for Guest and AUTO_CREATRE_CHARACTER_WITH_ACCOUNT=True situations. - """ - try: - new_character = create.create_object( - typeclass, key=new_account.key, home=home, permissions=permissions - ) - # set playable character list - new_account.db._playable_characters.append(new_character) - - # allow only the character itself and the account to puppet this character (and Developers). - new_character.locks.add( - "puppet:id(%i) or pid(%i) or perm(Developer) or pperm(Developer)" - % (new_character.id, new_account.id) - ) - - # If no description is set, set a default description - if not new_character.db.desc: - new_character.db.desc = "This is a character." - # We need to set this to have ic auto-connect to this character - new_account.db._last_puppet = new_character - except Exception as e: - session.msg( - "There was an error creating the Character:\n%s\n If this problem persists, contact" - " an admin." % e - ) - logger.log_trace()