<p>Evennia supports multiple ways for players to connect to the game. This allows Evennia to mimic the behavior of various other servers, or open things up for a custom solution.</p>
<sectionid="changing-the-login-screen">
<h2>Changing the login screen<aclass="headerlink"href="#changing-the-login-screen"title="Permalink to this headline">¶</a></h2>
<p>This is done by modifying <codeclass="docutils literal notranslate"><spanclass="pre">mygame/server/conf/connection_screens.py</span></code> and reloading. If you don’t like the default login, there are two contribs to check out as inspiration.</p>
<ulclass="simple">
<li><p><aclass="reference internal"href="../Contribs/Contrib-Email-Login.html"><spanclass="doc std std-doc">Email login</span></a> - require email during install, use email for login.</p></li>
<li><p><aclass="reference internal"href="../Contribs/Contrib-Menu-Login.html"><spanclass="doc std std-doc">Menu login</span></a> - login using several prompts, asking to enter username and password in sequence.</p></li>
</ul>
</section>
<sectionid="customizing-the-login-command">
<h2>Customizing the login command<aclass="headerlink"href="#customizing-the-login-command"title="Permalink to this headline">¶</a></h2>
<p>When a player connects to the game, it runs the <codeclass="docutils literal notranslate"><spanclass="pre">CMD_LOGINSTART</span></code><aclass="reference internal"href="../Components/Commands.html#system-commands"><spanclass="std std-doc">system command</span></a>. By default, this is the <aclass="reference internal"href="../api/evennia.commands.default.unloggedin.html#evennia.commands.default.unloggedin.CmdUnconnectedLook"title="evennia.commands.default.unloggedin.CmdUnconnectedLook"><spanclass="xref myst py py-class">CmdUnconnectedLook</span></a>. This shows the welcome screen. The other commands in the <aclass="reference internal"href="../api/evennia.commands.default.cmdset_unloggedin.html#evennia.commands.default.cmdset_unloggedin.UnloggedinCmdSet"title="evennia.commands.default.cmdset_unloggedin.UnloggedinCmdSet"><spanclass="xref myst py py-class">UnloggedinCmdSet</span></a> are what defines the login experience. So if you want to customise it, you just need to replace/remove those commands.</p>
<asideclass="sidebar">
<p>If you instead had your command inherit from <codeclass="docutils literal notranslate"><spanclass="pre">default_cmds.UnConnectedLook</span></code>, you didn’t even have to speciy the key (since your class would inherit it)!</p>
</aside>
<divclass="highlight-python notranslate"><divclass="highlight"><pre><span></span><spanclass="c1"># in mygame/commands/mylogin_commands.py</span>
<p><codeclass="docutils literal notranslate"><spanclass="pre">reload</span></code> and your alternate command will be used. Examine the default commands and you’ll be able to change everything about the login.</p>
</section>
<sectionid="multisession-mode-and-multi-playing">
<h2>Multisession mode and multi-playing<aclass="headerlink"href="#multisession-mode-and-multi-playing"title="Permalink to this headline">¶</a></h2>
<p>The number of sessions possible to connect to a given account at the same time and how it works is given by the <codeclass="docutils literal notranslate"><spanclass="pre">MULTISESSION_MODE</span></code> setting:</p>
<ul>
<li><p><codeclass="docutils literal notranslate"><spanclass="pre">MULTISESSION_MODE=0</span></code>: One session per account. When connecting with a new session the old one is disconnected. This is the default mode and emulates many classic mud code bases.</p>
<li><p><codeclass="docutils literal notranslate"><spanclass="pre">MULTISESSION_MODE=1</span></code>: Many sessions per account, input/output from/to each session is treated the same. For the player this means they can connect to the game from multiple clients and see the same output in all of them. The result of a command given in one client (that is, through one Session) will be returned to <em>all</em> connected Sessions/clients with no distinction.</p>
<li><p><codeclass="docutils literal notranslate"><spanclass="pre">MULTISESSION_MODE=2</span></code>: Many sessions per account, one character per session. In this mode, puppeting an Object/Character will link the puppet back only to the particular Session doing the puppeting. That is, input from that Session will make use of the CmdSet of that Object/Character and outgoing messages (such as the result of a <codeclass="docutils literal notranslate"><spanclass="pre">look</span></code>) will be passed back only to that puppeting Session. If another Session tries to puppet the same Character, the old Session will automatically un-puppet it. From the player’s perspective, this will mean that they can open separate game clients and play a different Character in each using one game account.</p>
<li><p><codeclass="docutils literal notranslate"><spanclass="pre">MULTISESSION_MODE=3</span></code>: Many sessions per account <em>and</em> character. This is the full multi-puppeting mode, where multiple sessions may not only connect to the player account but multiple sessions may also puppet a single character at the same time. From the user’s perspective it means one can open multiple client windows, some for controlling different Characters and some that share a Character’s input/output like in mode 1. This mode otherwise works the same as mode 2.</p>
<p>Mode <codeclass="docutils literal notranslate"><spanclass="pre">0</span></code> is the default and mimics how many legacy codebases work, especially in the DIKU world. The equivalence of higher modes are often ‘hacked’ into existing servers to allow for players to have multiple characters.</p>
<p>This setting limits how many <em>different</em> puppets your <em>Account</em> can puppet <em>simultaneously</em>. This is used to limit true multiplaying. A value higher than one makes no sense unless <codeclass="docutils literal notranslate"><spanclass="pre">MULTISESSION_MODE</span></code> is also set <codeclass="docutils literal notranslate"><spanclass="pre">>1</span></code>. Set to <codeclass="docutils literal notranslate"><spanclass="pre">None</span></code> for no limit.</p>
<h2>Character creation and auto-puppeting<aclass="headerlink"href="#character-creation-and-auto-puppeting"title="Permalink to this headline">¶</a></h2>
<p>When a player first creates an account, Evennia will auto-create a <codeclass="docutils literal notranslate"><spanclass="pre">Character</span></code> puppet of the same name. When the player logs in, they will auto-puppet this Character. This default hides the Account-Character separation from the player and puts them immediately in the game. This default behavior is similar to how it works in many legacy MU servers.</p>
<p>To control this behavior, you need to tweak the settings. These are the defaults:</p>
<p>There is a default <codeclass="docutils literal notranslate"><spanclass="pre">charcreate</span></code> command. This heeds the <codeclass="docutils literal notranslate"><spanclass="pre">MAX_NR_CHARACTERS</span></code>; and if you make your own character-creation command, you should do the same. It needs to be at least <codeclass="docutils literal notranslate"><spanclass="pre">1</span></code>. Set to <codeclass="docutils literal notranslate"><spanclass="pre">None</span></code> for no limit. See the <aclass="reference internal"href="../Howtos/Beginner-Tutorial/Beginner-Tutorial-Overview.html"><spanclass="doc std std-doc">Beginner Tutorial</span></a> for ideas on how to make a more advanced character generation system.</p>
<asideclass="sidebar">
<p>Combining these settings with <codeclass="docutils literal notranslate"><spanclass="pre">MAX_NR_SIMULTANEOUS_PUPPETS</span></code> could allow for a game where (for example) a player can create a ‘stable’ of Characters, but only be able to play one at a time.</p>
</aside>
<p>If you choose to not auto-create a character, you will need to provide a character-generation, and there will be no (initial) Character to puppet. In both of these settings, you will initially end up in <codeclass="docutils literal notranslate"><spanclass="pre">ooc</span></code> mode after you login. This is a good place to put a character generation screen/menu (you can e.g. replace the <aclass="reference internal"href="../api/evennia.commands.default.account.html#evennia.commands.default.account.CmdOOCLook"title="evennia.commands.default.account.CmdOOCLook"><spanclass="xref myst py py-class">CmdOOCLook</span></a> to trigger something other than the normal ooc-look).</p>
<p>Once you created a Character, if your auto-puppet is set, you will automatically puppet your latest-puppeted Character whenever you login. If not set, you will always start OOC (and should be able to select which Character to puppet).</p>