<spanid="evennia-accounts-accounts"></span><h1>evennia.accounts.accounts<aclass="headerlink"href="#module-evennia.accounts.accounts"title="Permalink to this headline">¶</a></h1>
<p>Typeclass for Account objects.</p>
<p>Note that this object is primarily intended to
store OOC information, not game info! This
object represents the actual user (not their
character) and has NO actual presence in the
game world (this is handled by the associated
character object, so you should customize that
instead for most things).</p>
<dlclass="py class">
<dtid="evennia.accounts.accounts.DefaultAccount">
<emclass="property">class </em><codeclass="sig-prename descclassname">evennia.accounts.accounts.</code><codeclass="sig-name descname">DefaultAccount</code><spanclass="sig-paren">(</span><emclass="sig-param"><spanclass="o">*</span><spanclass="n">args</span></em>, <emclass="sig-param"><spanclass="o">**</span><spanclass="n">kwargs</span></em><spanclass="sig-paren">)</span><aclass="reference internal"href="../_modules/evennia/accounts/accounts.html#DefaultAccount"><spanclass="viewcode-link">[source]</span></a><aclass="headerlink"href="#evennia.accounts.accounts.DefaultAccount"title="Permalink to this definition">¶</a></dt>
<codeclass="sig-name descname">objects</code><emclass="property"> = <evennia.accounts.manager.AccountManager object></em><aclass="headerlink"href="#evennia.accounts.accounts.DefaultAccount.objects"title="Permalink to this definition">¶</a></dt>
<codeclass="sig-name descname">default_character_typeclass</code><emclass="property"> = 'typeclasses.characters.Character'</em><aclass="headerlink"href="#evennia.accounts.accounts.DefaultAccount.default_character_typeclass"title="Permalink to this definition">¶</a></dt>
<codeclass="sig-name descname">cmdset</code><aclass="reference internal"href="../_modules/evennia/accounts/accounts.html#DefaultAccount.cmdset"><spanclass="viewcode-link">[source]</span></a><aclass="headerlink"href="#evennia.accounts.accounts.DefaultAccount.cmdset"title="Permalink to this definition">¶</a></dt>
<codeclass="sig-name descname">scripts</code><aclass="reference internal"href="../_modules/evennia/accounts/accounts.html#DefaultAccount.scripts"><spanclass="viewcode-link">[source]</span></a><aclass="headerlink"href="#evennia.accounts.accounts.DefaultAccount.scripts"title="Permalink to this definition">¶</a></dt>
<codeclass="sig-name descname">nicks</code><aclass="reference internal"href="../_modules/evennia/accounts/accounts.html#DefaultAccount.nicks"><spanclass="viewcode-link">[source]</span></a><aclass="headerlink"href="#evennia.accounts.accounts.DefaultAccount.nicks"title="Permalink to this definition">¶</a></dt>
<codeclass="sig-name descname">sessions</code><aclass="reference internal"href="../_modules/evennia/accounts/accounts.html#DefaultAccount.sessions"><spanclass="viewcode-link">[source]</span></a><aclass="headerlink"href="#evennia.accounts.accounts.DefaultAccount.sessions"title="Permalink to this definition">¶</a></dt>
<codeclass="sig-name descname">options</code><aclass="reference internal"href="../_modules/evennia/accounts/accounts.html#DefaultAccount.options"><spanclass="viewcode-link">[source]</span></a><aclass="headerlink"href="#evennia.accounts.accounts.DefaultAccount.options"title="Permalink to this definition">¶</a></dt>
<codeclass="sig-name descname">characters</code><aclass="reference internal"href="../_modules/evennia/accounts/accounts.html#DefaultAccount.characters"><spanclass="viewcode-link">[source]</span></a><aclass="headerlink"href="#evennia.accounts.accounts.DefaultAccount.characters"title="Permalink to this definition">¶</a></dt>
<codeclass="sig-name descname">at_post_add_character</code><spanclass="sig-paren">(</span><emclass="sig-param"><spanclass="n">character</span><spanclass="p">:</span><spanclass="n">DefaultCharacter</span></em><spanclass="sig-paren">)</span><aclass="reference internal"href="../_modules/evennia/accounts/accounts.html#DefaultAccount.at_post_add_character"><spanclass="viewcode-link">[source]</span></a><aclass="headerlink"href="#evennia.accounts.accounts.DefaultAccount.at_post_add_character"title="Permalink to this definition">¶</a></dt>
<dd><p>Called after a character is added to this account’s list of playable characters.</p>
<p>Use it to easily implement custom logic when a character is added to an account.</p>
<dlclass="field-list simple">
<dtclass="field-odd">Parameters</dt>
<ddclass="field-odd"><p><strong>character</strong> (<aclass="reference internal"href="evennia.objects.objects.html#evennia.objects.objects.DefaultCharacter"title="evennia.objects.objects.DefaultCharacter"><em>DefaultCharacter</em></a>) – The character that was added.</p>
<codeclass="sig-name descname">at_post_remove_character</code><spanclass="sig-paren">(</span><emclass="sig-param"><spanclass="n">character</span><spanclass="p">:</span><spanclass="n">DefaultCharacter</span></em><spanclass="sig-paren">)</span><aclass="reference internal"href="../_modules/evennia/accounts/accounts.html#DefaultAccount.at_post_remove_character"><spanclass="viewcode-link">[source]</span></a><aclass="headerlink"href="#evennia.accounts.accounts.DefaultAccount.at_post_remove_character"title="Permalink to this definition">¶</a></dt>
<dd><p>Called after a character is removed from this account’s list of playable characters.</p>
<p>Use it to easily implement custom logic when a character is removed from an account.</p>
<dlclass="field-list simple">
<dtclass="field-odd">Parameters</dt>
<ddclass="field-odd"><p><strong>character</strong> (<aclass="reference internal"href="evennia.objects.objects.html#evennia.objects.objects.DefaultCharacter"title="evennia.objects.objects.DefaultCharacter"><em>DefaultCharacter</em></a>) – The character that was removed.</p>
<codeclass="sig-name descname">uses_screenreader</code><spanclass="sig-paren">(</span><emclass="sig-param"><spanclass="n">session</span><spanclass="o">=</span><spanclass="default_value">None</span></em><spanclass="sig-paren">)</span><aclass="reference internal"href="../_modules/evennia/accounts/accounts.html#DefaultAccount.uses_screenreader"><spanclass="viewcode-link">[source]</span></a><aclass="headerlink"href="#evennia.accounts.accounts.DefaultAccount.uses_screenreader"title="Permalink to this definition">¶</a></dt>
<dd><p>Shortcut to determine if a session uses a screenreader. If no session given,
will return true if any of the sessions use a screenreader.</p>
<dlclass="field-list simple">
<dtclass="field-odd">Parameters</dt>
<ddclass="field-odd"><p><strong>session</strong> (<aclass="reference internal"href="evennia.server.session.html#evennia.server.session.Session"title="evennia.server.session.Session"><em>Session</em></a><em>, </em><em>optional</em>) – The session to check for screen reader.</p>
<codeclass="sig-name descname">get_display_name</code><spanclass="sig-paren">(</span><emclass="sig-param"><spanclass="n">looker</span></em>, <emclass="sig-param"><spanclass="o">**</span><spanclass="n">kwargs</span></em><spanclass="sig-paren">)</span><aclass="reference internal"href="../_modules/evennia/accounts/accounts.html#DefaultAccount.get_display_name"><spanclass="viewcode-link">[source]</span></a><aclass="headerlink"href="#evennia.accounts.accounts.DefaultAccount.get_display_name"title="Permalink to this definition">¶</a></dt>
<dd><p>This is used by channels and other OOC communications methods to give a
custom display of this account’s input.</p>
<dlclass="field-list simple">
<dtclass="field-odd">Parameters</dt>
<ddclass="field-odd"><ulclass="simple">
<li><p><strong>looker</strong> (<em>Account</em>) – The one that will see this name.</p></li>
<li><p><strong>**kwargs</strong>– Unused by default, can be used to pass game-specific data.</p></li>
</ul>
</dd>
<dtclass="field-even">Returns</dt>
<ddclass="field-even"><p><em>str</em>– The name, possibly modified.</p>
<codeclass="sig-name descname">disconnect_session_from_account</code><spanclass="sig-paren">(</span><emclass="sig-param"><spanclass="n">session</span></em>, <emclass="sig-param"><spanclass="n">reason</span><spanclass="o">=</span><spanclass="default_value">None</span></em><spanclass="sig-paren">)</span><aclass="reference internal"href="../_modules/evennia/accounts/accounts.html#DefaultAccount.disconnect_session_from_account"><spanclass="viewcode-link">[source]</span></a><aclass="headerlink"href="#evennia.accounts.accounts.DefaultAccount.disconnect_session_from_account"title="Permalink to this definition">¶</a></dt>
<dd><p>Access method for disconnecting a given session from the
account (connection happens automatically in the
sessionhandler)</p>
<dlclass="field-list simple">
<dtclass="field-odd">Parameters</dt>
<ddclass="field-odd"><ulclass="simple">
<li><p><strong>session</strong> (<aclass="reference internal"href="evennia.server.session.html#evennia.server.session.Session"title="evennia.server.session.Session"><em>Session</em></a>) – Session to disconnect.</p></li>
<li><p><strong>reason</strong> (<em>str</em><em>, </em><em>optional</em>) – Eventual reason for the disconnect.</p></li>
<codeclass="sig-name descname">puppet_object</code><spanclass="sig-paren">(</span><emclass="sig-param"><spanclass="n">session</span></em>, <emclass="sig-param"><spanclass="n">obj</span></em><spanclass="sig-paren">)</span><aclass="reference internal"href="../_modules/evennia/accounts/accounts.html#DefaultAccount.puppet_object"><spanclass="viewcode-link">[source]</span></a><aclass="headerlink"href="#evennia.accounts.accounts.DefaultAccount.puppet_object"title="Permalink to this definition">¶</a></dt>
<dd><p>Use the given session to control (puppet) the given object (usually
a Character type).</p>
<dlclass="field-list simple">
<dtclass="field-odd">Parameters</dt>
<ddclass="field-odd"><ulclass="simple">
<li><p><strong>session</strong> (<aclass="reference internal"href="evennia.server.session.html#evennia.server.session.Session"title="evennia.server.session.Session"><em>Session</em></a>) – session to use for puppeting</p></li>
<li><p><strong>obj</strong> (<em>Object</em>) – the object to start puppeting</p></li>
</ul>
</dd>
<dtclass="field-even">Raises</dt>
<ddclass="field-even"><p><strong>RuntimeError</strong>– If puppeting is not possible, the
<strong>exception.msg</strong> will contain the reason.</p>
<codeclass="sig-name descname">unpuppet_object</code><spanclass="sig-paren">(</span><emclass="sig-param"><spanclass="n">session</span></em><spanclass="sig-paren">)</span><aclass="reference internal"href="../_modules/evennia/accounts/accounts.html#DefaultAccount.unpuppet_object"><spanclass="viewcode-link">[source]</span></a><aclass="headerlink"href="#evennia.accounts.accounts.DefaultAccount.unpuppet_object"title="Permalink to this definition">¶</a></dt>
<dd><p>Disengage control over an object.</p>
<dlclass="field-list simple">
<dtclass="field-odd">Parameters</dt>
<ddclass="field-odd"><p><strong>session</strong> (<aclass="reference internal"href="evennia.server.session.html#evennia.server.session.Session"title="evennia.server.session.Session"><em>Session</em></a><em> or </em><em>list</em>) – The session or a list of
sessions to disengage from their puppets.</p>
</dd>
<dtclass="field-even">Raises</dt>
<ddclass="field-even"><p><strong>RuntimeError With message about error.</strong>–</p>
<codeclass="sig-name descname">unpuppet_all</code><spanclass="sig-paren">(</span><spanclass="sig-paren">)</span><aclass="reference internal"href="../_modules/evennia/accounts/accounts.html#DefaultAccount.unpuppet_all"><spanclass="viewcode-link">[source]</span></a><aclass="headerlink"href="#evennia.accounts.accounts.DefaultAccount.unpuppet_all"title="Permalink to this definition">¶</a></dt>
<dd><p>Disconnect all puppets. This is called by server before a
<codeclass="sig-name descname">get_puppet</code><spanclass="sig-paren">(</span><emclass="sig-param"><spanclass="n">session</span></em><spanclass="sig-paren">)</span><aclass="reference internal"href="../_modules/evennia/accounts/accounts.html#DefaultAccount.get_puppet"><spanclass="viewcode-link">[source]</span></a><aclass="headerlink"href="#evennia.accounts.accounts.DefaultAccount.get_puppet"title="Permalink to this definition">¶</a></dt>
<dd><p>Get an object puppeted by this session through this account. This is
the main method for retrieving the puppeted object from the
account’s end.</p>
<dlclass="field-list simple">
<dtclass="field-odd">Parameters</dt>
<ddclass="field-odd"><p><strong>session</strong> (<aclass="reference internal"href="evennia.server.session.html#evennia.server.session.Session"title="evennia.server.session.Session"><em>Session</em></a>) – Find puppeted object based on this session</p>
</dd>
<dtclass="field-even">Returns</dt>
<ddclass="field-even"><p><em>puppet (Object)</em>– The matching puppeted object, if any.</p>
<codeclass="sig-name descname">get_all_puppets</code><spanclass="sig-paren">(</span><spanclass="sig-paren">)</span><aclass="reference internal"href="../_modules/evennia/accounts/accounts.html#DefaultAccount.get_all_puppets"><spanclass="viewcode-link">[source]</span></a><aclass="headerlink"href="#evennia.accounts.accounts.DefaultAccount.get_all_puppets"title="Permalink to this definition">¶</a></dt>
<emclass="property">property </em><codeclass="sig-name descname">character</code><aclass="headerlink"href="#evennia.accounts.accounts.DefaultAccount.character"title="Permalink to this definition">¶</a></dt>
<dd><p>This is a legacy convenience link for use with <strong>MULTISESSION_MODE</strong>.</p>
<dlclass="field-list simple">
<dtclass="field-odd">Returns</dt>
<ddclass="field-odd"><p><p><em>puppets (Object or list)</em>–</p>
<dlclass="simple">
<dt>Users of <strong>MULTISESSION_MODE</strong> 0 or 1 will</dt><dd><p>always get the first puppet back. Users of higher <ahref="#id5"><spanclass="problematic"id="id6">**</span></a>MULTISESSION_MODE**s will
<emclass="property">property </em><codeclass="sig-name descname">puppet</code><aclass="headerlink"href="#evennia.accounts.accounts.DefaultAccount.puppet"title="Permalink to this definition">¶</a></dt>
<dd><p>This is a legacy convenience link for use with <strong>MULTISESSION_MODE</strong>.</p>
<dlclass="field-list simple">
<dtclass="field-odd">Returns</dt>
<ddclass="field-odd"><p><p><em>puppets (Object or list)</em>–</p>
<dlclass="simple">
<dt>Users of <strong>MULTISESSION_MODE</strong> 0 or 1 will</dt><dd><p>always get the first puppet back. Users of higher <ahref="#id7"><spanclass="problematic"id="id8">**</span></a>MULTISESSION_MODE**s will
<emclass="property">classmethod </em><codeclass="sig-name descname">is_banned</code><spanclass="sig-paren">(</span><emclass="sig-param"><spanclass="o">**</span><spanclass="n">kwargs</span></em><spanclass="sig-paren">)</span><aclass="reference internal"href="../_modules/evennia/accounts/accounts.html#DefaultAccount.is_banned"><spanclass="viewcode-link">[source]</span></a><aclass="headerlink"href="#evennia.accounts.accounts.DefaultAccount.is_banned"title="Permalink to this definition">¶</a></dt>
<dd><p>Checks if a given username or IP is banned.</p>
<dlclass="field-list simple">
<dtclass="field-odd">Keyword Arguments</dt>
<ddclass="field-odd"><ulclass="simple">
<li><p><strong>ip</strong> (<em>str</em><em>, </em><em>optional</em>) – IP address.</p></li>
<emclass="property">classmethod </em><codeclass="sig-name descname">authenticate</code><spanclass="sig-paren">(</span><emclass="sig-param"><spanclass="n">username</span></em>, <emclass="sig-param"><spanclass="n">password</span></em>, <emclass="sig-param"><spanclass="n">ip</span><spanclass="o">=</span><spanclass="default_value">''</span></em>, <emclass="sig-param"><spanclass="o">**</span><spanclass="n">kwargs</span></em><spanclass="sig-paren">)</span><aclass="reference internal"href="../_modules/evennia/accounts/accounts.html#DefaultAccount.authenticate"><spanclass="viewcode-link">[source]</span></a><aclass="headerlink"href="#evennia.accounts.accounts.DefaultAccount.authenticate"title="Permalink to this definition">¶</a></dt>
<dd><p>Checks the given username/password against the database to see if the
credentials are valid.</p>
<p>Note that this simply checks credentials and returns a valid reference
to the user– it does not log them in!</p>
<p>To finish the job:
After calling this from a Command, associate the account with a Session:
<emclass="property">classmethod </em><codeclass="sig-name descname">normalize_username</code><spanclass="sig-paren">(</span><emclass="sig-param"><spanclass="n">username</span></em><spanclass="sig-paren">)</span><aclass="reference internal"href="../_modules/evennia/accounts/accounts.html#DefaultAccount.normalize_username"><spanclass="viewcode-link">[source]</span></a><aclass="headerlink"href="#evennia.accounts.accounts.DefaultAccount.normalize_username"title="Permalink to this definition">¶</a></dt>
<dd><p>Django: Applies NFKC Unicode normalization to usernames so that visually
identical characters with different Unicode code points are considered
identical.</p>
<p>(This deals with the Turkish “i” problem and similar
annoyances. Only relevant if you go out of your way to allow Unicode
usernames though– Evennia accepts ASCII by default.)</p>
<p>In this case we’re simply piggybacking on this feature to apply
additional normalization per Evennia’s standards.</p>
<emclass="property">classmethod </em><codeclass="sig-name descname">validate_username</code><spanclass="sig-paren">(</span><emclass="sig-param"><spanclass="n">username</span></em><spanclass="sig-paren">)</span><aclass="reference internal"href="../_modules/evennia/accounts/accounts.html#DefaultAccount.validate_username"><spanclass="viewcode-link">[source]</span></a><aclass="headerlink"href="#evennia.accounts.accounts.DefaultAccount.validate_username"title="Permalink to this definition">¶</a></dt>
<dd><p>Checks the given username against the username validator associated with
Account objects, and also checks the database to make sure it is unique.</p>
<dlclass="field-list simple">
<dtclass="field-odd">Parameters</dt>
<ddclass="field-odd"><p><strong>username</strong> (<em>str</em>) – Username to validate</p>
</dd>
<dtclass="field-even">Returns</dt>
<ddclass="field-even"><p><em>valid (bool)</em>– Whether or not the password passed validation
<emclass="property">classmethod </em><codeclass="sig-name descname">validate_password</code><spanclass="sig-paren">(</span><emclass="sig-param"><spanclass="n">password</span></em>, <emclass="sig-param"><spanclass="n">account</span><spanclass="o">=</span><spanclass="default_value">None</span></em><spanclass="sig-paren">)</span><aclass="reference internal"href="../_modules/evennia/accounts/accounts.html#DefaultAccount.validate_password"><spanclass="viewcode-link">[source]</span></a><aclass="headerlink"href="#evennia.accounts.accounts.DefaultAccount.validate_password"title="Permalink to this definition">¶</a></dt>
<dd><p>Checks the given password against the list of Django validators enabled
in the server.conf file.</p>
<dlclass="field-list simple">
<dtclass="field-odd">Parameters</dt>
<ddclass="field-odd"><p><strong>password</strong> (<em>str</em>) – Password to validate</p>
</dd>
<dtclass="field-even">Keyword Arguments</dt>
<ddclass="field-even"><p><strong>account</strong> (<aclass="reference internal"href="#evennia.accounts.accounts.DefaultAccount"title="evennia.accounts.accounts.DefaultAccount"><em>DefaultAccount</em></a><em>, </em><em>optional</em>) – Account object to validate the
password for. Optional, but Django includes some validators to
do things like making sure users aren’t setting passwords to the
same value as their username. If left blank, these user-specific
checks are skipped.</p>
</dd>
<dtclass="field-odd">Returns</dt>
<ddclass="field-odd"><p><p><em>valid (bool)</em>– Whether or not the password passed validation
error (ValidationError, None): Any validation error(s) raised. Multiple</p>
<blockquote>
<div><p>errors can be nested within a single object.</p>
<codeclass="sig-name descname">set_password</code><spanclass="sig-paren">(</span><emclass="sig-param"><spanclass="n">password</span></em>, <emclass="sig-param"><spanclass="o">**</span><spanclass="n">kwargs</span></em><spanclass="sig-paren">)</span><aclass="reference internal"href="../_modules/evennia/accounts/accounts.html#DefaultAccount.set_password"><spanclass="viewcode-link">[source]</span></a><aclass="headerlink"href="#evennia.accounts.accounts.DefaultAccount.set_password"title="Permalink to this definition">¶</a></dt>
<dd><p>Applies the given password to the account. Logs and triggers the <strong>at_password_change</strong> hook.</p>
<dlclass="field-list simple">
<dtclass="field-odd">Parameters</dt>
<ddclass="field-odd"><p><strong>password</strong> (<em>str</em>) – Password to set.</p>
</dd>
</dl>
<pclass="rubric">Notes</p>
<p>This is called by Django also when logging in; it should not be mixed up with
validation, since that would mean old passwords in the database (pre validation checks)
<codeclass="sig-name descname">get_character_slots</code><spanclass="sig-paren">(</span><spanclass="sig-paren">)</span>→ Optional<spanclass="p">[</span>int<spanclass="p">, </span>None<spanclass="p">]</span><aclass="reference internal"href="../_modules/evennia/accounts/accounts.html#DefaultAccount.get_character_slots"><spanclass="viewcode-link">[source]</span></a><aclass="headerlink"href="#evennia.accounts.accounts.DefaultAccount.get_character_slots"title="Permalink to this definition">¶</a></dt>
<dd><p>Returns the number of character slots this account has, or
None if there are no limits.</p>
<p>By default, that’s settings.MAX_NR_CHARACTERS but this makes it easy to override.
Maybe for your game, players can be rewarded with more slots, somehow.</p>
<codeclass="sig-name descname">get_available_character_slots</code><spanclass="sig-paren">(</span><spanclass="sig-paren">)</span>→ Optional<spanclass="p">[</span>int<spanclass="p">, </span>None<spanclass="p">]</span><aclass="reference internal"href="../_modules/evennia/accounts/accounts.html#DefaultAccount.get_available_character_slots"><spanclass="viewcode-link">[source]</span></a><aclass="headerlink"href="#evennia.accounts.accounts.DefaultAccount.get_available_character_slots"title="Permalink to this definition">¶</a></dt>
<dd><p>Returns the number of character slots this account has available, or None if
<codeclass="sig-name descname">check_available_slots</code><spanclass="sig-paren">(</span><emclass="sig-param"><spanclass="o">**</span><spanclass="n">kwargs</span></em><spanclass="sig-paren">)</span>→ Optional<spanclass="p">[</span>str<spanclass="p">, </span>None<spanclass="p">]</span><aclass="reference internal"href="../_modules/evennia/accounts/accounts.html#DefaultAccount.check_available_slots"><spanclass="viewcode-link">[source]</span></a><aclass="headerlink"href="#evennia.accounts.accounts.DefaultAccount.check_available_slots"title="Permalink to this definition">¶</a></dt>
<dd><p>Helper method used to determine if an account can create additional characters using
<dt>An error message regarding the status of slots. If present, this</dt><dd><p>will halt character creation. If not, character creation can proceed.</p>
<codeclass="sig-name descname">create_character</code><spanclass="sig-paren">(</span><emclass="sig-param"><spanclass="o">*</span><spanclass="n">args</span></em>, <emclass="sig-param"><spanclass="o">**</span><spanclass="n">kwargs</span></em><spanclass="sig-paren">)</span><aclass="reference internal"href="../_modules/evennia/accounts/accounts.html#DefaultAccount.create_character"><spanclass="viewcode-link">[source]</span></a><aclass="headerlink"href="#evennia.accounts.accounts.DefaultAccount.create_character"title="Permalink to this definition">¶</a></dt>
<dd><p>Create a character linked to this account.</p>
<dlclass="field-list simple">
<dtclass="field-odd">Parameters</dt>
<ddclass="field-odd"><ulclass="simple">
<li><p><strong>key</strong> (<em>str</em><em>, </em><em>optional</em>) – If not given, use the same name as the account.</p></li>
<li><p><strong>typeclass</strong> (<em>str</em><em>, </em><em>optional</em>) – Typeclass to use for this character. If
<codeclass="sig-name descname">at_post_create_character</code><spanclass="sig-paren">(</span><emclass="sig-param"><spanclass="n">character</span></em>, <emclass="sig-param"><spanclass="o">**</span><spanclass="n">kwargs</span></em><spanclass="sig-paren">)</span><aclass="reference internal"href="../_modules/evennia/accounts/accounts.html#DefaultAccount.at_post_create_character"><spanclass="viewcode-link">[source]</span></a><aclass="headerlink"href="#evennia.accounts.accounts.DefaultAccount.at_post_create_character"title="Permalink to this definition">¶</a></dt>
<dd><p>An overloadable hook method that allows for further customization of newly created characters.</p>
<emclass="property">classmethod </em><codeclass="sig-name descname">create</code><spanclass="sig-paren">(</span><emclass="sig-param"><spanclass="o">*</span><spanclass="n">args</span></em>, <emclass="sig-param"><spanclass="o">**</span><spanclass="n">kwargs</span></em><spanclass="sig-paren">)</span><aclass="reference internal"href="../_modules/evennia/accounts/accounts.html#DefaultAccount.create"><spanclass="viewcode-link">[source]</span></a><aclass="headerlink"href="#evennia.accounts.accounts.DefaultAccount.create"title="Permalink to this definition">¶</a></dt>
<dd><p>Creates an Account (or Account/Character pair for MULTISESSION_MODE<2)
with default (or overridden) permissions and having joined them to the
appropriate default channels.</p>
<dlclass="field-list simple">
<dtclass="field-odd">Keyword Arguments</dt>
<ddclass="field-odd"><ulclass="simple">
<li><p><strong>username</strong> (<em>str</em>) – Username of Account owner</p></li>
<li><p><strong>password</strong> (<em>str</em>) – Password of Account owner</p></li>
<li><p><strong>email</strong> (<em>str</em><em>, </em><em>optional</em>) – Email address of Account owner</p></li>
<li><p><strong>ip</strong> (<em>str</em><em>, </em><em>optional</em>) – IP address of requesting connection</p></li>
<li><p><strong>guest</strong> (<em>bool</em><em>, </em><em>optional</em>) – Whether or not this is to be a Guest account</p></li>
<li><p><strong>permissions</strong> (<em>str</em><em>, </em><em>optional</em>) – Default permissions for the Account</p></li>
<li><p><strong>typeclass</strong> (<em>str</em><em>, </em><em>optional</em>) – Typeclass to use for new Account</p></li>
<li><p><strong>character_typeclass</strong> (<em>str</em><em>, </em><em>optional</em>) – Typeclass to use for new char
when applicable.</p></li>
</ul>
</dd>
<dtclass="field-even">Returns</dt>
<ddclass="field-even"><p><em>account (Account)</em>– Account if successfully created; None if not
errors (list): List of error messages in string form</p>
<codeclass="sig-name descname">delete</code><spanclass="sig-paren">(</span><emclass="sig-param"><spanclass="o">*</span><spanclass="n">args</span></em>, <emclass="sig-param"><spanclass="o">**</span><spanclass="n">kwargs</span></em><spanclass="sig-paren">)</span><aclass="reference internal"href="../_modules/evennia/accounts/accounts.html#DefaultAccount.delete"><spanclass="viewcode-link">[source]</span></a><aclass="headerlink"href="#evennia.accounts.accounts.DefaultAccount.delete"title="Permalink to this definition">¶</a></dt>
<dd><p>Deletes the account persistently.</p>
<pclass="rubric">Notes</p>
<dlclass="simple">
<dt><strong>*args</strong> and <strong>**kwargs</strong> are passed on to the base delete</dt><dd><p>mechanism (these are usually not used).</p>
</dd>
</dl>
<dlclass="field-list simple">
<dtclass="field-odd">Returns</dt>
<ddclass="field-odd"><p><p><em>bool</em>–</p>
<dlclass="simple">
<dt>If deletion was successful. Only time it fails would be</dt><dd><p>if the Account was already deleted. Note that even on a failure,
connected resources (nicks/aliases etc) will still have been
<codeclass="sig-name descname">msg</code><spanclass="sig-paren">(</span><emclass="sig-param"><spanclass="n">text</span><spanclass="o">=</span><spanclass="default_value">None</span></em>, <emclass="sig-param"><spanclass="n">from_obj</span><spanclass="o">=</span><spanclass="default_value">None</span></em>, <emclass="sig-param"><spanclass="n">session</span><spanclass="o">=</span><spanclass="default_value">None</span></em>, <emclass="sig-param"><spanclass="n">options</span><spanclass="o">=</span><spanclass="default_value">None</span></em>, <emclass="sig-param"><spanclass="o">**</span><spanclass="n">kwargs</span></em><spanclass="sig-paren">)</span><aclass="reference internal"href="../_modules/evennia/accounts/accounts.html#DefaultAccount.msg"><spanclass="viewcode-link">[source]</span></a><aclass="headerlink"href="#evennia.accounts.accounts.DefaultAccount.msg"title="Permalink to this definition">¶</a></dt>
<dd><p>Evennia -> User
This is the main route for sending data back to the user from the
server.</p>
<dlclass="field-list simple">
<dtclass="field-odd">Parameters</dt>
<ddclass="field-odd"><ulclass="simple">
<li><p><strong>text</strong> (<em>str</em><em> or </em><em>tuple</em><em>, </em><em>optional</em>) – The message to send. This
is treated internally like any send-command, so its
value can be a tuple if sending multiple arguments to
the <strong>text</strong> oob command.</p></li>
<li><p><strong>from_obj</strong> (<em>Object</em><em> or </em><em>Account</em><em> or </em><em>list</em><em>, </em><em>optional</em>) – Object sending. If given, its
at_msg_send() hook will be called. If iterable, call on all entities.</p></li>
<li><p><strong>session</strong> (<aclass="reference internal"href="evennia.server.session.html#evennia.server.session.Session"title="evennia.server.session.Session"><em>Session</em></a><em> or </em><em>list</em><em>, </em><em>optional</em>) – Session object or a list of
Sessions to receive this send. If given, overrules the
default send behavior for the current
MULTISESSION_MODE.</p></li>
<li><p><strong>options</strong> (<em>list</em>) – Protocol-specific options. Passed on to the protocol.</p></li>
</ul>
</dd>
<dtclass="field-even">Keyword Arguments</dt>
<ddclass="field-even"><p><strong>any</strong> (<em>dict</em>) – All other keywords are passed on to the protocol.</p>
<codeclass="sig-name descname">execute_cmd</code><spanclass="sig-paren">(</span><emclass="sig-param"><spanclass="n">raw_string</span></em>, <emclass="sig-param"><spanclass="n">session</span><spanclass="o">=</span><spanclass="default_value">None</span></em>, <emclass="sig-param"><spanclass="o">**</span><spanclass="n">kwargs</span></em><spanclass="sig-paren">)</span><aclass="reference internal"href="../_modules/evennia/accounts/accounts.html#DefaultAccount.execute_cmd"><spanclass="viewcode-link">[source]</span></a><aclass="headerlink"href="#evennia.accounts.accounts.DefaultAccount.execute_cmd"title="Permalink to this definition">¶</a></dt>
<dd><p>Do something as this account. This method is never called normally,
but only when the account object itself is supposed to execute the
command. It takes account nicks into account, but not nicks of
eventual puppets.</p>
<dlclass="field-list simple">
<dtclass="field-odd">Parameters</dt>
<ddclass="field-odd"><ulclass="simple">
<li><p><strong>raw_string</strong> (<em>str</em>) – Raw command input coming from the command line.</p></li>
<li><p><strong>session</strong> (<aclass="reference internal"href="evennia.server.session.html#evennia.server.session.Session"title="evennia.server.session.Session"><em>Session</em></a><em>, </em><em>optional</em>) – The session to be responsible
for the command-send</p></li>
</ul>
</dd>
<dtclass="field-even">Keyword Arguments</dt>
<ddclass="field-even"><p><strong>kwargs</strong> (<em>any</em>) – Other keyword arguments will be added to the
found command object instance as variables before it
executes. This is unused by default Evennia but may be
used to set flags and change operating parameters for
<codeclass="sig-name descname">at_pre_channel_msg</code><spanclass="sig-paren">(</span><emclass="sig-param"><spanclass="n">message</span></em>, <emclass="sig-param"><spanclass="n">channel</span></em>, <emclass="sig-param"><spanclass="n">senders</span><spanclass="o">=</span><spanclass="default_value">None</span></em>, <emclass="sig-param"><spanclass="o">**</span><spanclass="n">kwargs</span></em><spanclass="sig-paren">)</span><aclass="reference internal"href="../_modules/evennia/accounts/accounts.html#DefaultAccount.at_pre_channel_msg"><spanclass="viewcode-link">[source]</span></a><aclass="headerlink"href="#evennia.accounts.accounts.DefaultAccount.at_pre_channel_msg"title="Permalink to this definition">¶</a></dt>
<dd><p>Called by the Channel just before passing a message into <strong>channel_msg</strong>.
This allows for tweak messages per-user and also to abort the
receive on the receiver-level.</p>
<dlclass="field-list simple">
<dtclass="field-odd">Parameters</dt>
<ddclass="field-odd"><ulclass="simple">
<li><p><strong>message</strong> (<em>str</em>) – The message sent to the channel.</p></li>
<li><p><strong>channel</strong> (<em>Channel</em>) – The sending channel.</p></li>
<li><p><strong>senders</strong> (<em>list</em><em>, </em><em>optional</em>) – Accounts or Objects acting as senders.
For most normal messages, there is only a single sender. If
there are no senders, this may be a broadcasting message.</p></li>
<li><p><strong>**kwargs</strong>– These are additional keywords passed into <strong>channel_msg</strong>.
If <strong>no_prefix=True</strong> or <strong>emit=True</strong> are passed, the channel
prefix will not be added (<ahref="#id9"><spanclass="problematic"id="id10">**</span></a>[channelname]: ** by default)</p></li>
</ul>
</dd>
<dtclass="field-even">Returns</dt>
<ddclass="field-even"><p><p><em>str or None</em>–</p>
<dlclass="simple">
<dt>Allows for customizing the message for this recipient.</dt><dd><p>If returning <strong>None</strong> (or <strong>False</strong>) message-receiving is aborted.
The returning string will be passed into <strong>self.channel_msg</strong>.</p>
</dd>
</dl>
</p>
</dd>
</dl>
<pclass="rubric">Notes</p>
<p>This support posing/emotes by starting channel-send with : or ;.</p>
<codeclass="sig-name descname">channel_msg</code><spanclass="sig-paren">(</span><emclass="sig-param"><spanclass="n">message</span></em>, <emclass="sig-param"><spanclass="n">channel</span></em>, <emclass="sig-param"><spanclass="n">senders</span><spanclass="o">=</span><spanclass="default_value">None</span></em>, <emclass="sig-param"><spanclass="o">**</span><spanclass="n">kwargs</span></em><spanclass="sig-paren">)</span><aclass="reference internal"href="../_modules/evennia/accounts/accounts.html#DefaultAccount.channel_msg"><spanclass="viewcode-link">[source]</span></a><aclass="headerlink"href="#evennia.accounts.accounts.DefaultAccount.channel_msg"title="Permalink to this definition">¶</a></dt>
<dd><p>This performs the actions of receiving a message to an un-muted
channel.</p>
<dlclass="field-list simple">
<dtclass="field-odd">Parameters</dt>
<ddclass="field-odd"><ulclass="simple">
<li><p><strong>message</strong> (<em>str</em>) – The message sent to the channel.</p></li>
<li><p><strong>channel</strong> (<em>Channel</em>) – The sending channel.</p></li>
<li><p><strong>senders</strong> (<em>list</em><em>, </em><em>optional</em>) – Accounts or Objects acting as senders.
For most normal messages, there is only a single sender. If
there are no senders, this may be a broadcasting message or
similar.</p></li>
<li><p><strong>**kwargs</strong>– These are additional keywords originally passed into
<strong>Channel.msg</strong>.</p></li>
</ul>
</dd>
</dl>
<pclass="rubric">Notes</p>
<p>Before this, <strong>Channel.at_pre_channel_msg</strong> will fire, which offers a way
to customize the message for the receiver on the channel-level.</p>
<codeclass="sig-name descname">at_post_channel_msg</code><spanclass="sig-paren">(</span><emclass="sig-param"><spanclass="n">message</span></em>, <emclass="sig-param"><spanclass="n">channel</span></em>, <emclass="sig-param"><spanclass="n">senders</span><spanclass="o">=</span><spanclass="default_value">None</span></em>, <emclass="sig-param"><spanclass="o">**</span><spanclass="n">kwargs</span></em><spanclass="sig-paren">)</span><aclass="reference internal"href="../_modules/evennia/accounts/accounts.html#DefaultAccount.at_post_channel_msg"><spanclass="viewcode-link">[source]</span></a><aclass="headerlink"href="#evennia.accounts.accounts.DefaultAccount.at_post_channel_msg"title="Permalink to this definition">¶</a></dt>
<dd><p>Called by <strong>self.channel_msg</strong> after message was received.</p>
<dlclass="field-list simple">
<dtclass="field-odd">Parameters</dt>
<ddclass="field-odd"><ulclass="simple">
<li><p><strong>message</strong> (<em>str</em>) – The message sent to the channel.</p></li>
<li><p><strong>channel</strong> (<em>Channel</em>) – The sending channel.</p></li>
<li><p><strong>senders</strong> (<em>list</em><em>, </em><em>optional</em>) – Accounts or Objects acting as senders.
For most normal messages, there is only a single sender. If
there are no senders, this may be a broadcasting message.</p></li>
<li><p><strong>**kwargs</strong>– These are additional keywords passed into <strong>channel_msg</strong>.</p></li>
<codeclass="sig-name descname">access</code><spanclass="sig-paren">(</span><emclass="sig-param"><spanclass="n">accessing_obj</span></em>, <emclass="sig-param"><spanclass="n">access_type</span><spanclass="o">=</span><spanclass="default_value">'read'</span></em>, <emclass="sig-param"><spanclass="n">default</span><spanclass="o">=</span><spanclass="default_value">False</span></em>, <emclass="sig-param"><spanclass="n">no_superuser_bypass</span><spanclass="o">=</span><spanclass="default_value">False</span></em>, <emclass="sig-param"><spanclass="o">**</span><spanclass="n">kwargs</span></em><spanclass="sig-paren">)</span><aclass="reference internal"href="../_modules/evennia/accounts/accounts.html#DefaultAccount.access"><spanclass="viewcode-link">[source]</span></a><aclass="headerlink"href="#evennia.accounts.accounts.DefaultAccount.access"title="Permalink to this definition">¶</a></dt>
<dd><p>Determines if another object has permission to access this
object in whatever way.</p>
<dlclass="field-list simple">
<dtclass="field-odd">Parameters</dt>
<ddclass="field-odd"><ulclass="simple">
<li><p><strong>accessing_obj</strong> (<em>Object</em>) – Object trying to access this one.</p></li>
<li><p><strong>access_type</strong> (<em>str</em><em>, </em><em>optional</em>) – Type of access sought.</p></li>
<li><p><strong>default</strong> (<em>bool</em><em>, </em><em>optional</em>) – What to return if no lock of
access_type was found</p></li>
<li><p><strong>no_superuser_bypass</strong> (<em>bool</em><em>, </em><em>optional</em>) – Turn off superuser
lock bypassing. Be careful with this one.</p></li>
</ul>
</dd>
<dtclass="field-even">Keyword Arguments</dt>
<ddclass="field-even"><p><strong>kwargs</strong> (<em>any</em>) – Passed to the at_access hook along with the result.</p>
</dd>
<dtclass="field-odd">Returns</dt>
<ddclass="field-odd"><p><em>result (bool)</em>– Result of access check.</p>
<emclass="property">property </em><codeclass="sig-name descname">idle_time</code><aclass="headerlink"href="#evennia.accounts.accounts.DefaultAccount.idle_time"title="Permalink to this definition">¶</a></dt>
<dd><p>Returns the idle time of the least idle session in seconds. If
<emclass="property">property </em><codeclass="sig-name descname">connection_time</code><aclass="headerlink"href="#evennia.accounts.accounts.DefaultAccount.connection_time"title="Permalink to this definition">¶</a></dt>
<dd><p>Returns the maximum connection time of all connected sessions
in seconds. Returns nothing if there are no sessions.</p>
<codeclass="sig-name descname">basetype_setup</code><spanclass="sig-paren">(</span><spanclass="sig-paren">)</span><aclass="reference internal"href="../_modules/evennia/accounts/accounts.html#DefaultAccount.basetype_setup"><spanclass="viewcode-link">[source]</span></a><aclass="headerlink"href="#evennia.accounts.accounts.DefaultAccount.basetype_setup"title="Permalink to this definition">¶</a></dt>
<dd><p>This sets up the basic properties for an account. Overload this
with at_account_creation rather than changing this method.</p>
<codeclass="sig-name descname">at_account_creation</code><spanclass="sig-paren">(</span><spanclass="sig-paren">)</span><aclass="reference internal"href="../_modules/evennia/accounts/accounts.html#DefaultAccount.at_account_creation"><spanclass="viewcode-link">[source]</span></a><aclass="headerlink"href="#evennia.accounts.accounts.DefaultAccount.at_account_creation"title="Permalink to this definition">¶</a></dt>
<dd><p>This is called once, the very first time the account is created
(i.e. first time they register with the game). It’s a good
place to store attributes all accounts should have, like
<codeclass="sig-name descname">at_init</code><spanclass="sig-paren">(</span><spanclass="sig-paren">)</span><aclass="reference internal"href="../_modules/evennia/accounts/accounts.html#DefaultAccount.at_init"><spanclass="viewcode-link">[source]</span></a><aclass="headerlink"href="#evennia.accounts.accounts.DefaultAccount.at_init"title="Permalink to this definition">¶</a></dt>
<dd><p>This is always called whenever this object is initiated –
that is, whenever it its typeclass is cached from memory. This
happens on-demand first time the object is used or activated
in some way after being created but also after each server
restart or reload. In the case of account objects, this usually
happens the moment the account logs in or reconnects after a
<codeclass="sig-name descname">at_first_save</code><spanclass="sig-paren">(</span><spanclass="sig-paren">)</span><aclass="reference internal"href="../_modules/evennia/accounts/accounts.html#DefaultAccount.at_first_save"><spanclass="viewcode-link">[source]</span></a><aclass="headerlink"href="#evennia.accounts.accounts.DefaultAccount.at_first_save"title="Permalink to this definition">¶</a></dt>
<dd><p>This is a generic hook called by Evennia when this object is
saved to the database the very first time. You generally
don’t override this method but the hooks called by it.</p>
<codeclass="sig-name descname">at_access</code><spanclass="sig-paren">(</span><emclass="sig-param"><spanclass="n">result</span></em>, <emclass="sig-param"><spanclass="n">accessing_obj</span></em>, <emclass="sig-param"><spanclass="n">access_type</span></em>, <emclass="sig-param"><spanclass="o">**</span><spanclass="n">kwargs</span></em><spanclass="sig-paren">)</span><aclass="reference internal"href="../_modules/evennia/accounts/accounts.html#DefaultAccount.at_access"><spanclass="viewcode-link">[source]</span></a><aclass="headerlink"href="#evennia.accounts.accounts.DefaultAccount.at_access"title="Permalink to this definition">¶</a></dt>
<dd><dlclass="simple">
<dt>This is triggered after an access-call on this Account has</dt><dd><p>completed.</p>
</dd>
</dl>
<dlclass="field-list simple">
<dtclass="field-odd">Parameters</dt>
<ddclass="field-odd"><ulclass="simple">
<li><p><strong>result</strong> (<em>bool</em>) – The result of the access check.</p></li>
<li><p><strong>accessing_obj</strong> (<em>any</em>) – The object requesting the access
check.</p></li>
<li><p><strong>access_type</strong> (<em>str</em>) – The type of access checked.</p></li>
</ul>
</dd>
<dtclass="field-even">Keyword Arguments</dt>
<ddclass="field-even"><p><strong>kwargs</strong> (<em>any</em>) – These are passed on from the access check
and can be used to relay custom instructions from the
check mechanism.</p>
</dd>
</dl>
<pclass="rubric">Notes</p>
<p>This method cannot affect the result of the lock check and
its return value is not used in any way. It can be used
e.g. to customize error messages in a central location or
create other effects based on the access result.</p>
<codeclass="sig-name descname">at_cmdset_get</code><spanclass="sig-paren">(</span><emclass="sig-param"><spanclass="o">**</span><spanclass="n">kwargs</span></em><spanclass="sig-paren">)</span><aclass="reference internal"href="../_modules/evennia/accounts/accounts.html#DefaultAccount.at_cmdset_get"><spanclass="viewcode-link">[source]</span></a><aclass="headerlink"href="#evennia.accounts.accounts.DefaultAccount.at_cmdset_get"title="Permalink to this definition">¶</a></dt>
<dd><p>Called just <em>before</em> cmdsets on this account are requested by
the command handler. The cmdsets are available as
<strong>self.cmdset</strong>. If changes need to be done on the fly to the
cmdset before passing them on to the cmdhandler, this is the
place to do it. This is called also if the account currently
have no cmdsets. kwargs are usually not used unless the
<codeclass="sig-name descname">at_first_login</code><spanclass="sig-paren">(</span><emclass="sig-param"><spanclass="o">**</span><spanclass="n">kwargs</span></em><spanclass="sig-paren">)</span><aclass="reference internal"href="../_modules/evennia/accounts/accounts.html#DefaultAccount.at_first_login"><spanclass="viewcode-link">[source]</span></a><aclass="headerlink"href="#evennia.accounts.accounts.DefaultAccount.at_first_login"title="Permalink to this definition">¶</a></dt>
<dd><p>Called the very first time this account logs into the game.
Note that this is called <em>before</em> at_pre_login, so no session
is established and usually no character is yet assigned at
this point. This hook is intended for account-specific setup
like configurations.</p>
<dlclass="field-list simple">
<dtclass="field-odd">Parameters</dt>
<ddclass="field-odd"><p><strong>**kwargs</strong> (<em>dict</em>) – Arbitrary, optional arguments for users
<codeclass="sig-name descname">at_password_change</code><spanclass="sig-paren">(</span><emclass="sig-param"><spanclass="o">**</span><spanclass="n">kwargs</span></em><spanclass="sig-paren">)</span><aclass="reference internal"href="../_modules/evennia/accounts/accounts.html#DefaultAccount.at_password_change"><spanclass="viewcode-link">[source]</span></a><aclass="headerlink"href="#evennia.accounts.accounts.DefaultAccount.at_password_change"title="Permalink to this definition">¶</a></dt>
<dd><p>Called after a successful password set/modify.</p>
<dlclass="field-list simple">
<dtclass="field-odd">Parameters</dt>
<ddclass="field-odd"><p><strong>**kwargs</strong> (<em>dict</em>) – Arbitrary, optional arguments for users
<codeclass="sig-name descname">at_pre_login</code><spanclass="sig-paren">(</span><emclass="sig-param"><spanclass="o">**</span><spanclass="n">kwargs</span></em><spanclass="sig-paren">)</span><aclass="reference internal"href="../_modules/evennia/accounts/accounts.html#DefaultAccount.at_pre_login"><spanclass="viewcode-link">[source]</span></a><aclass="headerlink"href="#evennia.accounts.accounts.DefaultAccount.at_pre_login"title="Permalink to this definition">¶</a></dt>
<dd><p>Called every time the user logs in, just before the actual
login-state is set.</p>
<dlclass="field-list simple">
<dtclass="field-odd">Parameters</dt>
<ddclass="field-odd"><p><strong>**kwargs</strong> (<em>dict</em>) – Arbitrary, optional arguments for users
<codeclass="sig-name descname">at_post_login</code><spanclass="sig-paren">(</span><emclass="sig-param"><spanclass="n">session</span><spanclass="o">=</span><spanclass="default_value">None</span></em>, <emclass="sig-param"><spanclass="o">**</span><spanclass="n">kwargs</span></em><spanclass="sig-paren">)</span><aclass="reference internal"href="../_modules/evennia/accounts/accounts.html#DefaultAccount.at_post_login"><spanclass="viewcode-link">[source]</span></a><aclass="headerlink"href="#evennia.accounts.accounts.DefaultAccount.at_post_login"title="Permalink to this definition">¶</a></dt>
<dd><p>Called at the end of the login process, just before letting
the account loose.</p>
<dlclass="field-list simple">
<dtclass="field-odd">Parameters</dt>
<ddclass="field-odd"><ulclass="simple">
<li><p><strong>session</strong> (<aclass="reference internal"href="evennia.server.session.html#evennia.server.session.Session"title="evennia.server.session.Session"><em>Session</em></a><em>, </em><em>optional</em>) – Session logging in, if any.</p></li>
<li><p><strong>**kwargs</strong> (<em>dict</em>) – Arbitrary, optional arguments for users
overriding the call (unused by default).</p></li>
</ul>
</dd>
</dl>
<pclass="rubric">Notes</p>
<p>This is called <em>before</em> an eventual Character’s
<strong>at_post_login</strong> hook. By default it is used to set up
auto-puppeting based on <strong>MULTISESSION_MODE</strong></p>
<codeclass="sig-name descname">at_failed_login</code><spanclass="sig-paren">(</span><emclass="sig-param"><spanclass="n">session</span></em>, <emclass="sig-param"><spanclass="o">**</span><spanclass="n">kwargs</span></em><spanclass="sig-paren">)</span><aclass="reference internal"href="../_modules/evennia/accounts/accounts.html#DefaultAccount.at_failed_login"><spanclass="viewcode-link">[source]</span></a><aclass="headerlink"href="#evennia.accounts.accounts.DefaultAccount.at_failed_login"title="Permalink to this definition">¶</a></dt>
<dd><p>Called by the login process if a user account is targeted correctly
but provided with an invalid password. By default it does nothing,
<codeclass="sig-name descname">at_disconnect</code><spanclass="sig-paren">(</span><emclass="sig-param"><spanclass="n">reason</span><spanclass="o">=</span><spanclass="default_value">None</span></em>, <emclass="sig-param"><spanclass="o">**</span><spanclass="n">kwargs</span></em><spanclass="sig-paren">)</span><aclass="reference internal"href="../_modules/evennia/accounts/accounts.html#DefaultAccount.at_disconnect"><spanclass="viewcode-link">[source]</span></a><aclass="headerlink"href="#evennia.accounts.accounts.DefaultAccount.at_disconnect"title="Permalink to this definition">¶</a></dt>
<dd><p>Called just before user is disconnected.</p>
<dlclass="field-list simple">
<dtclass="field-odd">Parameters</dt>
<ddclass="field-odd"><ulclass="simple">
<li><p><strong>reason</strong> (<em>str</em><em>, </em><em>optional</em>) – The reason given for the disconnect,
(echoed to the connection channel by default).</p></li>
<li><p><strong>**kwargs</strong> (<em>dict</em>) – Arbitrary, optional arguments for users
<codeclass="sig-name descname">at_post_disconnect</code><spanclass="sig-paren">(</span><emclass="sig-param"><spanclass="o">**</span><spanclass="n">kwargs</span></em><spanclass="sig-paren">)</span><aclass="reference internal"href="../_modules/evennia/accounts/accounts.html#DefaultAccount.at_post_disconnect"><spanclass="viewcode-link">[source]</span></a><aclass="headerlink"href="#evennia.accounts.accounts.DefaultAccount.at_post_disconnect"title="Permalink to this definition">¶</a></dt>
<dd><p>This is called <em>after</em> disconnection is complete. No messages
can be relayed to the account from here. After this call, the
account should not be accessed any more, making this a good
spot for deleting it (in the case of a guest account account,
for example).</p>
<dlclass="field-list simple">
<dtclass="field-odd">Parameters</dt>
<ddclass="field-odd"><p><strong>**kwargs</strong> (<em>dict</em>) – Arbitrary, optional arguments for users
<codeclass="sig-name descname">at_msg_receive</code><spanclass="sig-paren">(</span><emclass="sig-param"><spanclass="n">text</span><spanclass="o">=</span><spanclass="default_value">None</span></em>, <emclass="sig-param"><spanclass="n">from_obj</span><spanclass="o">=</span><spanclass="default_value">None</span></em>, <emclass="sig-param"><spanclass="o">**</span><spanclass="n">kwargs</span></em><spanclass="sig-paren">)</span><aclass="reference internal"href="../_modules/evennia/accounts/accounts.html#DefaultAccount.at_msg_receive"><spanclass="viewcode-link">[source]</span></a><aclass="headerlink"href="#evennia.accounts.accounts.DefaultAccount.at_msg_receive"title="Permalink to this definition">¶</a></dt>
<dd><p>This hook is called whenever someone sends a message to this
object using the <strong>msg</strong> method.</p>
<p>Note that from_obj may be None if the sender did not include
itself as an argument to the obj.msg() call - so you have to
check for this. .</p>
<p>Consider this a pre-processing method before msg is passed on
to the user session. If this method returns False, the msg
will not be passed on.</p>
<dlclass="field-list simple">
<dtclass="field-odd">Parameters</dt>
<ddclass="field-odd"><ulclass="simple">
<li><p><strong>text</strong> (<em>str</em><em>, </em><em>optional</em>) – The message received.</p></li>
<li><p><strong>from_obj</strong> (<em>any</em><em>, </em><em>optional</em>) – The object sending the message.</p></li>
</ul>
</dd>
<dtclass="field-even">Keyword Arguments</dt>
<ddclass="field-even"><p><strong>includes any keywords sent to the msg method.</strong> (<em>This</em>) –</p>
</dd>
<dtclass="field-odd">Returns</dt>
<ddclass="field-odd"><p><em>receive (bool)</em>– If this message should be received.</p>
</dd>
</dl>
<pclass="rubric">Notes</p>
<p>If this method returns False, the <strong>msg</strong> operation
<codeclass="sig-name descname">at_msg_send</code><spanclass="sig-paren">(</span><emclass="sig-param"><spanclass="n">text</span><spanclass="o">=</span><spanclass="default_value">None</span></em>, <emclass="sig-param"><spanclass="n">to_obj</span><spanclass="o">=</span><spanclass="default_value">None</span></em>, <emclass="sig-param"><spanclass="o">**</span><spanclass="n">kwargs</span></em><spanclass="sig-paren">)</span><aclass="reference internal"href="../_modules/evennia/accounts/accounts.html#DefaultAccount.at_msg_send"><spanclass="viewcode-link">[source]</span></a><aclass="headerlink"href="#evennia.accounts.accounts.DefaultAccount.at_msg_send"title="Permalink to this definition">¶</a></dt>
<dd><p>This is a hook that is called when <em>this</em> object sends a
message to another object with <strong>obj.msg(text, to_obj=obj)</strong>.</p>
<dlclass="field-list simple">
<dtclass="field-odd">Parameters</dt>
<ddclass="field-odd"><ulclass="simple">
<li><p><strong>text</strong> (<em>str</em><em>, </em><em>optional</em>) – Text to send.</p></li>
<li><p><strong>to_obj</strong> (<em>any</em><em>, </em><em>optional</em>) – The object to send to.</p></li>
</ul>
</dd>
<dtclass="field-even">Keyword Arguments</dt>
<ddclass="field-even"><p><strong>passed from msg</strong><strong>(</strong><strong>)</strong> (<em>Keywords</em>) –</p>
</dd>
</dl>
<pclass="rubric">Notes</p>
<p>Since this method is executed by <strong>from_obj</strong>, if no <strong>from_obj</strong>
was passed to <strong>DefaultCharacter.msg</strong> this hook will never
<codeclass="sig-name descname">at_server_reload</code><spanclass="sig-paren">(</span><spanclass="sig-paren">)</span><aclass="reference internal"href="../_modules/evennia/accounts/accounts.html#DefaultAccount.at_server_reload"><spanclass="viewcode-link">[source]</span></a><aclass="headerlink"href="#evennia.accounts.accounts.DefaultAccount.at_server_reload"title="Permalink to this definition">¶</a></dt>
<dd><p>This hook is called whenever the server is shutting down for
restart/reboot. If you want to, for example, save
non-persistent properties across a restart, this is the place
<codeclass="sig-name descname">at_server_shutdown</code><spanclass="sig-paren">(</span><spanclass="sig-paren">)</span><aclass="reference internal"href="../_modules/evennia/accounts/accounts.html#DefaultAccount.at_server_shutdown"><spanclass="viewcode-link">[source]</span></a><aclass="headerlink"href="#evennia.accounts.accounts.DefaultAccount.at_server_shutdown"title="Permalink to this definition">¶</a></dt>
<dd><p>This hook is called whenever the server is shutting down fully
<codeclass="sig-name descname">ooc_appearance_template</code><emclass="property"> = '--------------------------------------------------------------------\n{header}\n\n{sessions}\n\n |whelp|n - more commands\n |wpublic <text>|n - talk on public channel\n |wcharcreate <name> [=description]|n - create new character\n |wchardelete <name>|n - delete a character\n |wic <name>|n - enter the game as character (|wooc|n to get back here)\n |wic|n - enter the game as latest character controlled.\n\n{characters}\n{footer}\n--------------------------------------------------------------------'</em><aclass="headerlink"href="#evennia.accounts.accounts.DefaultAccount.ooc_appearance_template"title="Permalink to this definition">¶</a></dt>
<codeclass="sig-name descname">at_look</code><spanclass="sig-paren">(</span><emclass="sig-param"><spanclass="n">target</span><spanclass="o">=</span><spanclass="default_value">None</span></em>, <emclass="sig-param"><spanclass="n">session</span><spanclass="o">=</span><spanclass="default_value">None</span></em>, <emclass="sig-param"><spanclass="o">**</span><spanclass="n">kwargs</span></em><spanclass="sig-paren">)</span><aclass="reference internal"href="../_modules/evennia/accounts/accounts.html#DefaultAccount.at_look"><spanclass="viewcode-link">[source]</span></a><aclass="headerlink"href="#evennia.accounts.accounts.DefaultAccount.at_look"title="Permalink to this definition">¶</a></dt>
<dd><p>Called when this object executes a look. It allows to customize
just what this means.</p>
<dlclass="field-list simple">
<dtclass="field-odd">Parameters</dt>
<ddclass="field-odd"><ulclass="simple">
<li><p><strong>target</strong> (<em>Object</em><em> or </em><em>list</em><em>, </em><em>optional</em>) – An object or a list
objects to inspect. This is normally a list of characters.</p></li>
<li><p><strong>session</strong> (<aclass="reference internal"href="evennia.server.session.html#evennia.server.session.Session"title="evennia.server.session.Session"><em>Session</em></a><em>, </em><em>optional</em>) – The session doing this look.</p></li>
<li><p><strong>**kwargs</strong> (<em>dict</em>) – Arbitrary, optional arguments for users
<emclass="property">exception </em><codeclass="sig-name descname">DoesNotExist</code><aclass="headerlink"href="#evennia.accounts.accounts.DefaultAccount.DoesNotExist"title="Permalink to this definition">¶</a></dt>
<emclass="property">exception </em><codeclass="sig-name descname">MultipleObjectsReturned</code><aclass="headerlink"href="#evennia.accounts.accounts.DefaultAccount.MultipleObjectsReturned"title="Permalink to this definition">¶</a></dt>
<codeclass="sig-name descname">path</code><emclass="property"> = 'evennia.accounts.accounts.DefaultAccount'</em><aclass="headerlink"href="#evennia.accounts.accounts.DefaultAccount.path"title="Permalink to this definition">¶</a></dt>
<codeclass="sig-name descname">typename</code><emclass="property"> = 'DefaultAccount'</em><aclass="headerlink"href="#evennia.accounts.accounts.DefaultAccount.typename"title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>
</dd></dl>
<dlclass="py class">
<dtid="evennia.accounts.accounts.DefaultGuest">
<emclass="property">class </em><codeclass="sig-prename descclassname">evennia.accounts.accounts.</code><codeclass="sig-name descname">DefaultGuest</code><spanclass="sig-paren">(</span><emclass="sig-param"><spanclass="o">*</span><spanclass="n">args</span></em>, <emclass="sig-param"><spanclass="o">**</span><spanclass="n">kwargs</span></em><spanclass="sig-paren">)</span><aclass="reference internal"href="../_modules/evennia/accounts/accounts.html#DefaultGuest"><spanclass="viewcode-link">[source]</span></a><aclass="headerlink"href="#evennia.accounts.accounts.DefaultGuest"title="Permalink to this definition">¶</a></dt>
<emclass="property">classmethod </em><codeclass="sig-name descname">create</code><spanclass="sig-paren">(</span><emclass="sig-param"><spanclass="o">**</span><spanclass="n">kwargs</span></em><spanclass="sig-paren">)</span><aclass="reference internal"href="../_modules/evennia/accounts/accounts.html#DefaultGuest.create"><spanclass="viewcode-link">[source]</span></a><aclass="headerlink"href="#evennia.accounts.accounts.DefaultGuest.create"title="Permalink to this definition">¶</a></dt>
<dd><p>Forwards request to cls.authenticate(); returns a DefaultGuest object
<emclass="property">classmethod </em><codeclass="sig-name descname">authenticate</code><spanclass="sig-paren">(</span><emclass="sig-param"><spanclass="o">**</span><spanclass="n">kwargs</span></em><spanclass="sig-paren">)</span><aclass="reference internal"href="../_modules/evennia/accounts/accounts.html#DefaultGuest.authenticate"><spanclass="viewcode-link">[source]</span></a><aclass="headerlink"href="#evennia.accounts.accounts.DefaultGuest.authenticate"title="Permalink to this definition">¶</a></dt>
<dd><p>Gets or creates a Guest account object.</p>
<dlclass="field-list simple">
<dtclass="field-odd">Keyword Arguments</dt>
<ddclass="field-odd"><p><strong>ip</strong> (<em>str</em><em>, </em><em>optional</em>) – IP address of requester; used for ban checking,
throttling and logging</p>
</dd>
<dtclass="field-even">Returns</dt>
<ddclass="field-even"><p><em>account (Object)</em>– Guest account object, if available
errors (list): List of error messages accrued during this request.</p>
<codeclass="sig-name descname">at_post_login</code><spanclass="sig-paren">(</span><emclass="sig-param"><spanclass="n">session</span><spanclass="o">=</span><spanclass="default_value">None</span></em>, <emclass="sig-param"><spanclass="o">**</span><spanclass="n">kwargs</span></em><spanclass="sig-paren">)</span><aclass="reference internal"href="../_modules/evennia/accounts/accounts.html#DefaultGuest.at_post_login"><spanclass="viewcode-link">[source]</span></a><aclass="headerlink"href="#evennia.accounts.accounts.DefaultGuest.at_post_login"title="Permalink to this definition">¶</a></dt>
<dd><p>By default, Guests only have one character regardless of which
MAX_NR_CHARACTERS we use. They also always auto-puppet a matching
<codeclass="sig-name descname">at_server_shutdown</code><spanclass="sig-paren">(</span><spanclass="sig-paren">)</span><aclass="reference internal"href="../_modules/evennia/accounts/accounts.html#DefaultGuest.at_server_shutdown"><spanclass="viewcode-link">[source]</span></a><aclass="headerlink"href="#evennia.accounts.accounts.DefaultGuest.at_server_shutdown"title="Permalink to this definition">¶</a></dt>
<dd><p>We repeat the functionality of <strong>at_disconnect()</strong> here just to
<codeclass="sig-name descname">at_post_disconnect</code><spanclass="sig-paren">(</span><emclass="sig-param"><spanclass="o">**</span><spanclass="n">kwargs</span></em><spanclass="sig-paren">)</span><aclass="reference internal"href="../_modules/evennia/accounts/accounts.html#DefaultGuest.at_post_disconnect"><spanclass="viewcode-link">[source]</span></a><aclass="headerlink"href="#evennia.accounts.accounts.DefaultGuest.at_post_disconnect"title="Permalink to this definition">¶</a></dt>
<dd><p>Once having disconnected, destroy the guest’s characters and</p>
<dlclass="field-list simple">
<dtclass="field-odd">Parameters</dt>
<ddclass="field-odd"><p><strong>**kwargs</strong> (<em>dict</em>) – Arbitrary, optional arguments for users
<emclass="property">exception </em><codeclass="sig-name descname">DoesNotExist</code><aclass="headerlink"href="#evennia.accounts.accounts.DefaultGuest.DoesNotExist"title="Permalink to this definition">¶</a></dt>
<emclass="property">exception </em><codeclass="sig-name descname">MultipleObjectsReturned</code><aclass="headerlink"href="#evennia.accounts.accounts.DefaultGuest.MultipleObjectsReturned"title="Permalink to this definition">¶</a></dt>
<codeclass="sig-name descname">path</code><emclass="property"> = 'evennia.accounts.accounts.DefaultGuest'</em><aclass="headerlink"href="#evennia.accounts.accounts.DefaultGuest.path"title="Permalink to this definition">¶</a></dt>
<codeclass="sig-name descname">typename</code><emclass="property"> = 'DefaultGuest'</em><aclass="headerlink"href="#evennia.accounts.accounts.DefaultGuest.typename"title="Permalink to this definition">¶</a></dt>