mirror of
https://github.com/evennia/evennia.git
synced 2026-03-24 00:36:30 +01:00
227 lines
No EOL
17 KiB
HTML
227 lines
No EOL
17 KiB
HTML
|
||
<!DOCTYPE html>
|
||
|
||
<html>
|
||
<head>
|
||
<meta charset="utf-8" />
|
||
<meta name="viewport" content="width=device-width, initial-scale=1.0" /><meta name="generator" content="Docutils 0.17.1: http://docutils.sourceforge.net/" />
|
||
|
||
<title>Character connection styles — Evennia 1.0-dev documentation</title>
|
||
<link rel="stylesheet" href="../_static/nature.css" type="text/css" />
|
||
<link rel="stylesheet" href="../_static/pygments.css" type="text/css" />
|
||
<script id="documentation_options" data-url_root="../" src="../_static/documentation_options.js"></script>
|
||
<script src="../_static/jquery.js"></script>
|
||
<script src="../_static/underscore.js"></script>
|
||
<script src="../_static/doctools.js"></script>
|
||
<script src="../_static/language_data.js"></script>
|
||
<link rel="shortcut icon" href="../_static/favicon.ico"/>
|
||
<link rel="index" title="Index" href="../genindex.html" />
|
||
<link rel="search" title="Search" href="../search.html" />
|
||
<link rel="next" title="Guest Logins" href="Guests.html" />
|
||
<link rel="prev" title="Text Encodings" href="Text-Encodings.html" />
|
||
</head><body>
|
||
<div class="related" role="navigation" aria-label="related navigation">
|
||
<h3>Navigation</h3>
|
||
<ul>
|
||
<li class="right" style="margin-right: 10px">
|
||
<a href="../genindex.html" title="General Index"
|
||
accesskey="I">index</a></li>
|
||
<li class="right" >
|
||
<a href="../py-modindex.html" title="Python Module Index"
|
||
>modules</a> |</li>
|
||
<li class="right" >
|
||
<a href="Guests.html" title="Guest Logins"
|
||
accesskey="N">next</a> |</li>
|
||
<li class="right" >
|
||
<a href="Text-Encodings.html" title="Text Encodings"
|
||
accesskey="P">previous</a> |</li>
|
||
<li class="nav-item nav-item-0"><a href="../index.html">Evennia 1.0-dev</a> »</li>
|
||
<li class="nav-item nav-item-1"><a href="Concepts-Overview.html" accesskey="U">Core Concepts</a> »</li>
|
||
<li class="nav-item nav-item-this"><a href="">Character connection styles</a></li>
|
||
</ul>
|
||
<div class="develop">develop branch</div>
|
||
</div>
|
||
|
||
<div class="document">
|
||
|
||
<div class="documentwrapper">
|
||
<div class="sphinxsidebar" role="navigation" aria-label="main navigation">
|
||
<div class="sphinxsidebarwrapper">
|
||
<p class="logo"><a href="../index.html">
|
||
<img class="logo" src="../_static/evennia_logo.png" alt="Logo"/>
|
||
</a></p>
|
||
<div id="searchbox" style="display: none" role="search">
|
||
<h3 id="searchlabel">Quick search</h3>
|
||
<div class="searchformwrapper">
|
||
<form class="search" action="../search.html" method="get">
|
||
<input type="text" name="q" aria-labelledby="searchlabel" />
|
||
<input type="submit" value="Go" />
|
||
</form>
|
||
</div>
|
||
</div>
|
||
<script>$('#searchbox').show(0);</script>
|
||
<h3><a href="../index.html">Table of Contents</a></h3>
|
||
<ul>
|
||
<li><a class="reference internal" href="#">Character connection styles</a><ul>
|
||
<li><a class="reference internal" href="#changing-the-login-screen">Changing the login screen</a></li>
|
||
<li><a class="reference internal" href="#customizing-the-login-command">Customizing the login command</a></li>
|
||
<li><a class="reference internal" href="#multisession-mode-and-multi-playing">Multisession mode and multi-playing</a></li>
|
||
<li><a class="reference internal" href="#character-creation-and-auto-puppeting">Character creation and auto-puppeting</a></li>
|
||
</ul>
|
||
</li>
|
||
</ul>
|
||
|
||
<h4>Previous topic</h4>
|
||
<p class="topless"><a href="Text-Encodings.html"
|
||
title="previous chapter">Text Encodings</a></p>
|
||
<h4>Next topic</h4>
|
||
<p class="topless"><a href="Guests.html"
|
||
title="next chapter">Guest Logins</a></p>
|
||
<div role="note" aria-label="source link">
|
||
<!--h3>This Page</h3-->
|
||
<ul class="this-page-menu">
|
||
<li><a href="../_sources/Concepts/Connection-Styles.md.txt"
|
||
rel="nofollow">Show Page Source</a></li>
|
||
</ul>
|
||
</div><h3>Links</h3>
|
||
<ul>
|
||
<li><a href="https://www.evennia.com">Home page</a> </li>
|
||
<li><a href="https://github.com/evennia/evennia">Evennia Github</a> </li>
|
||
<li><a href="http://games.evennia.com">Game Index</a> </li>
|
||
<li>
|
||
<a href="https://discord.gg/AJJpcRUhtF">Discord</a> -
|
||
<a href="https://github.com/evennia/evennia/discussions">Discussions</a> -
|
||
<a href="https://evennia.blogspot.com/">Blog</a>
|
||
</li>
|
||
</ul>
|
||
<h3>Versions</h3>
|
||
<ul>
|
||
<li><a href="Connection-Styles.html">1.0-dev (develop branch)</a></li>
|
||
<ul>
|
||
<li><a href="../0.9.5/index.html">0.9.5 (v0.9.5 branch)</a></li>
|
||
|
||
</ul>
|
||
|
||
</div>
|
||
</div>
|
||
<div class="bodywrapper">
|
||
<div class="body" role="main">
|
||
|
||
<section class="tex2jax_ignore mathjax_ignore" id="character-connection-styles">
|
||
<h1>Character connection styles<a class="headerlink" href="#character-connection-styles" title="Permalink to this headline">¶</a></h1>
|
||
<div class="highlight-shell notranslate"><div class="highlight"><pre><span></span>> login Foobar password123
|
||
</pre></div>
|
||
</div>
|
||
<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>
|
||
<section id="changing-the-login-screen">
|
||
<h2>Changing the login screen<a class="headerlink" href="#changing-the-login-screen" title="Permalink to this headline">¶</a></h2>
|
||
<p>This is done by modifying <code class="docutils literal notranslate"><span class="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>
|
||
<ul class="simple">
|
||
<li><p><a class="reference internal" href="../Contribs/Contrib-Email-Login.html"><span class="doc std std-doc">Email login</span></a> - require email during install, use email for login.</p></li>
|
||
<li><p><a class="reference internal" href="../Contribs/Contrib-Menu-Login.html"><span class="doc std std-doc">Menu login</span></a> - login using several prompts, asking to enter username and password in sequence.</p></li>
|
||
</ul>
|
||
</section>
|
||
<section id="customizing-the-login-command">
|
||
<h2>Customizing the login command<a class="headerlink" href="#customizing-the-login-command" title="Permalink to this headline">¶</a></h2>
|
||
<p>When a player connects to the game, it runs the <code class="docutils literal notranslate"><span class="pre">CMD_LOGINSTART</span></code> <a class="reference internal" href="../Components/Commands.html#system-commands"><span class="std std-doc">system command</span></a>. By default, this is the <a class="reference internal" href="../api/evennia.commands.default.unloggedin.html#evennia.commands.default.unloggedin.CmdUnconnectedLook" title="evennia.commands.default.unloggedin.CmdUnconnectedLook"><span class="xref myst py py-class">CmdUnconnectedLook</span></a>. This shows the welcome screen. The other commands in the <a class="reference internal" href="../api/evennia.commands.default.cmdset_unloggedin.html#evennia.commands.default.cmdset_unloggedin.UnloggedinCmdSet" title="evennia.commands.default.cmdset_unloggedin.UnloggedinCmdSet"><span class="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>
|
||
<aside class="sidebar">
|
||
<p>If you instead had your command inherit from <code class="docutils literal notranslate"><span class="pre">default_cmds.UnConnectedLook</span></code>, you didn’t even have to speciy the key (since your class would inherit it)!</p>
|
||
</aside>
|
||
<div class="highlight-python notranslate"><div class="highlight"><pre><span></span><span class="c1"># in mygame/commands/mylogin_commands.py</span>
|
||
|
||
<span class="kn">from</span> <span class="nn">evennia</span> <span class="kn">import</span> <span class="n">syscmdkeys</span><span class="p">,</span> <span class="n">default_cmds</span><span class="p">,</span> <span class="n">Command</span>
|
||
|
||
|
||
<span class="k">class</span> <span class="nc">MyUnloggedinLook</span><span class="p">(</span><span class="n">Command</span><span class="p">):</span>
|
||
|
||
<span class="c1"># this will now be the first command called when connecting</span>
|
||
<span class="n">key</span> <span class="o">=</span> <span class="n">syscmdkeys</span><span class="o">.</span><span class="n">CMD_LOGINSTART</span>
|
||
|
||
<span class="k">def</span> <span class="nf">func</span><span class="p">(</span><span class="bp">self</span><span class="p">):</span>
|
||
<span class="c1"># ... </span>
|
||
</pre></div>
|
||
</div>
|
||
<p>Next, add this to the right place in the <code class="docutils literal notranslate"><span class="pre">UnloggedinCmdSet</span></code>:</p>
|
||
<div class="highlight-python notranslate"><div class="highlight"><pre><span></span><span class="c1"># in mygame/commands/default_cmdsets.py</span>
|
||
|
||
<span class="kn">from</span> <span class="nn">commands.mylogin_commands</span> <span class="kn">import</span> <span class="n">MyUnloggedinLook</span>
|
||
<span class="c1"># ... </span>
|
||
|
||
<span class="k">class</span> <span class="nc">UnloggedinCmdSet</span><span class="p">(</span><span class="n">default_cmds</span><span class="o">.</span><span class="n">UnloggedinCmdSet</span><span class="p">):</span>
|
||
<span class="c1"># ... </span>
|
||
<span class="k">def</span> <span class="nf">at_cmdset_creation</span><span class="p">(</span><span class="bp">self</span><span class="p">):</span>
|
||
<span class="nb">super</span><span class="p">()</span><span class="o">.</span><span class="n">at_cmdset_creation</span>
|
||
<span class="bp">self</span><span class="o">.</span><span class="n">add</span><span class="p">(</span><span class="n">MyUnloggedinLook</span><span class="p">())</span>
|
||
</pre></div>
|
||
</div>
|
||
<p><code class="docutils literal notranslate"><span class="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>
|
||
<section id="multisession-mode-and-multi-playing">
|
||
<h2>Multisession mode and multi-playing<a class="headerlink" href="#multisession-mode-and-multi-playing" title="Permalink to this headline">¶</a></h2>
|
||
<p>The multisession modes are described in detail in the <a class="reference internal" href="../Components/Sessions.html#multisession-mode"><span class="std std-doc">Session documentation</span></a>. In brief, this is controlled by a <a class="reference internal" href="../Setup/Settings.html"><span class="doc std std-doc">setting</span></a>. Here’s the default:</p>
|
||
<div class="highlight-none notranslate"><div class="highlight"><pre><span></span>MULTISESSION_MODE = 0
|
||
</pre></div>
|
||
</div>
|
||
<ul class="simple">
|
||
<li><p><code class="docutils literal notranslate"><span class="pre">MULTISESSION_MODE=0</span></code>: One <a class="reference internal" href="../Components/Sessions.html"><span class="doc std std-doc">Session</span></a> per <a class="reference internal" href="../Components/Accounts.html"><span class="doc std std-doc">Account</span></a>, routed to one <a class="reference internal" href="../Components/Objects.html"><span class="doc std std-doc">puppet</span></a>. If connecting with a new session/client, it will kick the previous one.</p></li>
|
||
<li><p><code class="docutils literal notranslate"><span class="pre">MULTISESSION_MODE=1</span></code>: Multiple sessions per Account, all routed to one puppet. Allows you to control one puppet from multiple client windows.</p></li>
|
||
<li><p><code class="docutils literal notranslate"><span class="pre">MULTISESSION_MODE=2</span></code>: Multiple sessions per Account, each routed to a different puppet. This allows for multi-playing.</p></li>
|
||
<li><p><code class="docutils literal notranslate"><span class="pre">MULTISESSION_MODE=3</span></code>: Multiple sessions per account, And multiple sessions per puppet. This is full multi-playing, including being able to control each puppet from multiple clients.</p></li>
|
||
</ul>
|
||
<p>Mode <code class="docutils literal notranslate"><span class="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>
|
||
<div class="highlight-none notranslate"><div class="highlight"><pre><span></span>MAX_NR_SIMULTANEOUS_PUPPETS = 1
|
||
</pre></div>
|
||
</div>
|
||
<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 <code class="docutils literal notranslate"><span class="pre">MULTISESSION_MODE</span></code> is also set <code class="docutils literal notranslate"><span class="pre">>1</span></code>. Set to <code class="docutils literal notranslate"><span class="pre">None</span></code> for no limit.</p>
|
||
</section>
|
||
<section id="character-creation-and-auto-puppeting">
|
||
<h2>Character creation and auto-puppeting<a class="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 <code class="docutils literal notranslate"><span class="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>
|
||
<div class="highlight-none notranslate"><div class="highlight"><pre><span></span>AUTO_CREATE_CHARACTER_WITH_ACCOUNT = True
|
||
AUTO_PUPPET_ON_LOGIN = True
|
||
MAX_NR_CHARACTERS = 1
|
||
</pre></div>
|
||
</div>
|
||
<p>There is a default <code class="docutils literal notranslate"><span class="pre">charcreate</span></code> command. This heeds the <code class="docutils literal notranslate"><span class="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 <code class="docutils literal notranslate"><span class="pre">1</span></code>. Set to <code class="docutils literal notranslate"><span class="pre">None</span></code> for no limit. See the <a class="reference internal" href="../Howtos/Beginner-Tutorial/Beginner-Tutorial-Overview.html"><span class="doc std std-doc">Beginner Tutorial</span></a> for ideas on how to make a more advanced character generation system.</p>
|
||
<aside class="sidebar">
|
||
<p>Combining these settings with <code class="docutils literal notranslate"><span class="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 <code class="docutils literal notranslate"><span class="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 <a class="reference internal" href="../api/evennia.commands.default.account.html#evennia.commands.default.account.CmdOOCLook" title="evennia.commands.default.account.CmdOOCLook"><span class="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>
|
||
</section>
|
||
</section>
|
||
|
||
|
||
</div>
|
||
</div>
|
||
</div>
|
||
|
||
</div>
|
||
<div class="related" role="navigation" aria-label="related navigation">
|
||
<h3>Navigation</h3>
|
||
<ul>
|
||
<li class="right" style="margin-right: 10px">
|
||
<a href="../genindex.html" title="General Index"
|
||
>index</a></li>
|
||
<li class="right" >
|
||
<a href="../py-modindex.html" title="Python Module Index"
|
||
>modules</a> |</li>
|
||
<li class="right" >
|
||
<a href="Guests.html" title="Guest Logins"
|
||
>next</a> |</li>
|
||
<li class="right" >
|
||
<a href="Text-Encodings.html" title="Text Encodings"
|
||
>previous</a> |</li>
|
||
<li class="nav-item nav-item-0"><a href="../index.html">Evennia 1.0-dev</a> »</li>
|
||
<li class="nav-item nav-item-1"><a href="Concepts-Overview.html" >Core Concepts</a> »</li>
|
||
<li class="nav-item nav-item-this"><a href="">Character connection styles</a></li>
|
||
</ul>
|
||
<div class="develop">develop branch</div>
|
||
</div>
|
||
<div class="footer" role="contentinfo">
|
||
© Copyright 2022, The Evennia developer community.
|
||
Created using <a href="https://www.sphinx-doc.org/">Sphinx</a> 3.2.1.
|
||
</div>
|
||
</body>
|
||
</html> |