Updated HTML docs

This commit is contained in:
Griatch 2020-10-19 22:46:24 +02:00
parent 8936980973
commit 2d53d75aea
355 changed files with 24586 additions and 5844 deletions

View file

@ -1,4 +1,4 @@
# Sphinx build info version 1
# This file hashes the configuration used when building these files. When it is not found, a full rebuild will be done.
config: 75efcd5cc8712eff6ba9e68cfd2962a8
config: b3d6691cbcfd884f2c512e34b39ac37e
tags: 645f666f9bcd5a90fca523b33c5a78b7

View file

@ -73,7 +73,7 @@
<span class="n">SIGNAL_OBJECT_POST_PUPPET</span><span class="p">,</span>
<span class="n">SIGNAL_OBJECT_POST_UNPUPPET</span><span class="p">,</span>
<span class="p">)</span>
<span class="kn">from</span> <span class="nn">evennia.typeclasses.attributes</span> <span class="k">import</span> <span class="n">NickHandler</span>
<span class="kn">from</span> <span class="nn">evennia.typeclasses.attributes</span> <span class="k">import</span> <span class="n">NickHandler</span><span class="p">,</span> <span class="n">ModelAttributeBackend</span>
<span class="kn">from</span> <span class="nn">evennia.scripts.scripthandler</span> <span class="k">import</span> <span class="n">ScriptHandler</span>
<span class="kn">from</span> <span class="nn">evennia.commands.cmdsethandler</span> <span class="k">import</span> <span class="n">CmdSetHandler</span>
<span class="kn">from</span> <span class="nn">evennia.utils.optionhandler</span> <span class="k">import</span> <span class="n">OptionHandler</span>
@ -81,7 +81,7 @@
<span class="kn">from</span> <span class="nn">django.utils.translation</span> <span class="k">import</span> <span class="n">gettext</span> <span class="k">as</span> <span class="n">_</span>
<span class="kn">from</span> <span class="nn">random</span> <span class="k">import</span> <span class="n">getrandbits</span>
<span class="n">__all__</span> <span class="o">=</span> <span class="p">(</span><span class="s2">&quot;DefaultAccount&quot;</span><span class="p">,)</span>
<span class="n">__all__</span> <span class="o">=</span> <span class="p">(</span><span class="s2">&quot;DefaultAccount&quot;</span><span class="p">,</span> <span class="s2">&quot;DefaultGuest&quot;</span><span class="p">)</span>
<span class="n">_SESSIONS</span> <span class="o">=</span> <span class="kc">None</span>
@ -240,7 +240,7 @@
<div class="viewcode-block" id="DefaultAccount.nicks"><a class="viewcode-back" href="../../../api/evennia.accounts.accounts.html#evennia.accounts.accounts.DefaultAccount.nicks">[docs]</a> <span class="nd">@lazy_property</span>
<span class="k">def</span> <span class="nf">nicks</span><span class="p">(</span><span class="bp">self</span><span class="p">):</span>
<span class="k">return</span> <span class="n">NickHandler</span><span class="p">(</span><span class="bp">self</span><span class="p">)</span></div>
<span class="k">return</span> <span class="n">NickHandler</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">ModelAttributeBackend</span><span class="p">)</span></div>
<div class="viewcode-block" id="DefaultAccount.sessions"><a class="viewcode-back" href="../../../api/evennia.accounts.accounts.html#evennia.accounts.accounts.DefaultAccount.sessions">[docs]</a> <span class="nd">@lazy_property</span>
<span class="k">def</span> <span class="nf">sessions</span><span class="p">(</span><span class="bp">self</span><span class="p">):</span>
@ -1588,21 +1588,21 @@
<span class="k">return</span> <span class="n">look_string</span></div></div>
<span class="k">class</span> <span class="nc">DefaultGuest</span><span class="p">(</span><span class="n">DefaultAccount</span><span class="p">):</span>
<div class="viewcode-block" id="DefaultGuest"><a class="viewcode-back" href="../../../api/evennia.accounts.accounts.html#evennia.accounts.accounts.DefaultGuest">[docs]</a><span class="k">class</span> <span class="nc">DefaultGuest</span><span class="p">(</span><span class="n">DefaultAccount</span><span class="p">):</span>
<span class="sd">&quot;&quot;&quot;</span>
<span class="sd"> This class is used for guest logins. Unlike Accounts, Guests and</span>
<span class="sd"> their characters are deleted after disconnection.</span>
<span class="sd"> &quot;&quot;&quot;</span>
<span class="nd">@classmethod</span>
<div class="viewcode-block" id="DefaultGuest.create"><a class="viewcode-back" href="../../../api/evennia.accounts.accounts.html#evennia.accounts.accounts.DefaultGuest.create">[docs]</a> <span class="nd">@classmethod</span>
<span class="k">def</span> <span class="nf">create</span><span class="p">(</span><span class="bp">cls</span><span class="p">,</span> <span class="o">**</span><span class="n">kwargs</span><span class="p">):</span>
<span class="sd">&quot;&quot;&quot;</span>
<span class="sd"> Forwards request to cls.authenticate(); returns a DefaultGuest object</span>
<span class="sd"> if one is available for use.</span>
<span class="sd"> &quot;&quot;&quot;</span>
<span class="k">return</span> <span class="bp">cls</span><span class="o">.</span><span class="n">authenticate</span><span class="p">(</span><span class="o">**</span><span class="n">kwargs</span><span class="p">)</span>
<span class="k">return</span> <span class="bp">cls</span><span class="o">.</span><span class="n">authenticate</span><span class="p">(</span><span class="o">**</span><span class="n">kwargs</span><span class="p">)</span></div>
<span class="nd">@classmethod</span>
<div class="viewcode-block" id="DefaultGuest.authenticate"><a class="viewcode-back" href="../../../api/evennia.accounts.accounts.html#evennia.accounts.accounts.DefaultGuest.authenticate">[docs]</a> <span class="nd">@classmethod</span>
<span class="k">def</span> <span class="nf">authenticate</span><span class="p">(</span><span class="bp">cls</span><span class="p">,</span> <span class="o">**</span><span class="n">kwargs</span><span class="p">):</span>
<span class="sd">&quot;&quot;&quot;</span>
<span class="sd"> Gets or creates a Guest account object.</span>
@ -1674,9 +1674,9 @@
<span class="n">logger</span><span class="o">.</span><span class="n">log_trace</span><span class="p">()</span>
<span class="k">return</span> <span class="kc">None</span><span class="p">,</span> <span class="n">errors</span>
<span class="k">return</span> <span class="n">account</span><span class="p">,</span> <span class="n">errors</span>
<span class="k">return</span> <span class="n">account</span><span class="p">,</span> <span class="n">errors</span></div>
<span class="k">def</span> <span class="nf">at_post_login</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">session</span><span class="o">=</span><span class="kc">None</span><span class="p">,</span> <span class="o">**</span><span class="n">kwargs</span><span class="p">):</span>
<div class="viewcode-block" id="DefaultGuest.at_post_login"><a class="viewcode-back" href="../../../api/evennia.accounts.accounts.html#evennia.accounts.accounts.DefaultGuest.at_post_login">[docs]</a> <span class="k">def</span> <span class="nf">at_post_login</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">session</span><span class="o">=</span><span class="kc">None</span><span class="p">,</span> <span class="o">**</span><span class="n">kwargs</span><span class="p">):</span>
<span class="sd">&quot;&quot;&quot;</span>
<span class="sd"> In theory, guests only have one character regardless of which</span>
<span class="sd"> MULTISESSION_MODE we&#39;re in. They don&#39;t get a choice.</span>
@ -1688,9 +1688,9 @@
<span class="sd"> &quot;&quot;&quot;</span>
<span class="bp">self</span><span class="o">.</span><span class="n">_send_to_connect_channel</span><span class="p">(</span><span class="n">_</span><span class="p">(</span><span class="s2">&quot;|G</span><span class="si">{key}</span><span class="s2"> connected|n&quot;</span><span class="p">)</span><span class="o">.</span><span class="n">format</span><span class="p">(</span><span class="n">key</span><span class="o">=</span><span class="bp">self</span><span class="o">.</span><span class="n">key</span><span class="p">))</span>
<span class="bp">self</span><span class="o">.</span><span class="n">puppet_object</span><span class="p">(</span><span class="n">session</span><span class="p">,</span> <span class="bp">self</span><span class="o">.</span><span class="n">db</span><span class="o">.</span><span class="n">_last_puppet</span><span class="p">)</span>
<span class="bp">self</span><span class="o">.</span><span class="n">puppet_object</span><span class="p">(</span><span class="n">session</span><span class="p">,</span> <span class="bp">self</span><span class="o">.</span><span class="n">db</span><span class="o">.</span><span class="n">_last_puppet</span><span class="p">)</span></div>
<span class="k">def</span> <span class="nf">at_server_shutdown</span><span class="p">(</span><span class="bp">self</span><span class="p">):</span>
<div class="viewcode-block" id="DefaultGuest.at_server_shutdown"><a class="viewcode-back" href="../../../api/evennia.accounts.accounts.html#evennia.accounts.accounts.DefaultGuest.at_server_shutdown">[docs]</a> <span class="k">def</span> <span class="nf">at_server_shutdown</span><span class="p">(</span><span class="bp">self</span><span class="p">):</span>
<span class="sd">&quot;&quot;&quot;</span>
<span class="sd"> We repeat the functionality of `at_disconnect()` here just to</span>
<span class="sd"> be on the safe side.</span>
@ -1699,9 +1699,9 @@
<span class="n">characters</span> <span class="o">=</span> <span class="bp">self</span><span class="o">.</span><span class="n">db</span><span class="o">.</span><span class="n">_playable_characters</span>
<span class="k">for</span> <span class="n">character</span> <span class="ow">in</span> <span class="n">characters</span><span class="p">:</span>
<span class="k">if</span> <span class="n">character</span><span class="p">:</span>
<span class="n">character</span><span class="o">.</span><span class="n">delete</span><span class="p">()</span>
<span class="n">character</span><span class="o">.</span><span class="n">delete</span><span class="p">()</span></div>
<span class="k">def</span> <span class="nf">at_post_disconnect</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="o">**</span><span class="n">kwargs</span><span class="p">):</span>
<div class="viewcode-block" id="DefaultGuest.at_post_disconnect"><a class="viewcode-back" href="../../../api/evennia.accounts.accounts.html#evennia.accounts.accounts.DefaultGuest.at_post_disconnect">[docs]</a> <span class="k">def</span> <span class="nf">at_post_disconnect</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="o">**</span><span class="n">kwargs</span><span class="p">):</span>
<span class="sd">&quot;&quot;&quot;</span>
<span class="sd"> Once having disconnected, destroy the guest&#39;s characters and</span>
@ -1715,7 +1715,7 @@
<span class="k">for</span> <span class="n">character</span> <span class="ow">in</span> <span class="n">characters</span><span class="p">:</span>
<span class="k">if</span> <span class="n">character</span><span class="p">:</span>
<span class="n">character</span><span class="o">.</span><span class="n">delete</span><span class="p">()</span>
<span class="bp">self</span><span class="o">.</span><span class="n">delete</span><span class="p">()</span>
<span class="bp">self</span><span class="o">.</span><span class="n">delete</span><span class="p">()</span></div></div>
</pre></div>
<div class="clearer"></div>

View file

@ -125,6 +125,15 @@
<span class="k">break</span>
<span class="bp">cls</span><span class="o">.</span><span class="n">help_category</span> <span class="o">=</span> <span class="bp">cls</span><span class="o">.</span><span class="n">help_category</span><span class="o">.</span><span class="n">lower</span><span class="p">()</span>
<span class="c1"># pre-prepare a help index entry for quicker lookup</span>
<span class="bp">cls</span><span class="o">.</span><span class="n">search_index_entry</span> <span class="o">=</span> <span class="p">{</span>
<span class="s2">&quot;key&quot;</span><span class="p">:</span> <span class="bp">cls</span><span class="o">.</span><span class="n">key</span><span class="p">,</span>
<span class="s2">&quot;aliases&quot;</span><span class="p">:</span> <span class="s2">&quot; &quot;</span><span class="o">.</span><span class="n">join</span><span class="p">(</span><span class="bp">cls</span><span class="o">.</span><span class="n">aliases</span><span class="p">),</span>
<span class="s2">&quot;category&quot;</span><span class="p">:</span> <span class="bp">cls</span><span class="o">.</span><span class="n">help_category</span><span class="p">,</span>
<span class="s2">&quot;text&quot;</span><span class="p">:</span> <span class="bp">cls</span><span class="o">.</span><span class="vm">__doc__</span><span class="p">,</span>
<span class="s2">&quot;tags&quot;</span><span class="p">:</span> <span class="s2">&quot;&quot;</span><span class="p">,</span>
<span class="p">}</span>
<div class="viewcode-block" id="CommandMeta"><a class="viewcode-back" href="../../../api/evennia.commands.command.html#evennia.commands.cmdhandler.CommandMeta">[docs]</a><span class="k">class</span> <span class="nc">CommandMeta</span><span class="p">(</span><span class="nb">type</span><span class="p">):</span>
<span class="sd">&quot;&quot;&quot;</span>
@ -550,20 +559,6 @@
<span class="s2">&quot;SCREENWIDTH&quot;</span><span class="p">,</span> <span class="p">{</span><span class="mi">0</span><span class="p">:</span> <span class="n">settings</span><span class="o">.</span><span class="n">CLIENT_DEFAULT_WIDTH</span><span class="p">}</span>
<span class="p">)[</span><span class="mi">0</span><span class="p">]</span>
<span class="k">return</span> <span class="n">settings</span><span class="o">.</span><span class="n">CLIENT_DEFAULT_WIDTH</span></div>
<div class="viewcode-block" id="Command.client_height"><a class="viewcode-back" href="../../../api/evennia.commands.command.html#evennia.commands.cmdhandler.Command.client_height">[docs]</a> <span class="k">def</span> <span class="nf">client_height</span><span class="p">(</span><span class="bp">self</span><span class="p">):</span>
<span class="sd">&quot;&quot;&quot;</span>
<span class="sd"> Get the client screenheight for the session using this command.</span>
<span class="sd"> Returns:</span>
<span class="sd"> client height (int): The height (in characters) of the client window.</span>
<span class="sd"> &quot;&quot;&quot;</span>
<span class="k">if</span> <span class="bp">self</span><span class="o">.</span><span class="n">session</span><span class="p">:</span>
<span class="k">return</span> <span class="bp">self</span><span class="o">.</span><span class="n">session</span><span class="o">.</span><span class="n">protocol_flags</span><span class="o">.</span><span class="n">get</span><span class="p">(</span>
<span class="s2">&quot;SCREENHEIGHT&quot;</span><span class="p">,</span> <span class="p">{</span><span class="mi">0</span><span class="p">:</span> <span class="n">settings</span><span class="o">.</span><span class="n">CLIENT_DEFAULT_HEIGHT</span><span class="p">}</span>
<span class="p">)[</span><span class="mi">0</span><span class="p">]</span>
<span class="k">return</span> <span class="n">settings</span><span class="o">.</span><span class="n">CLIENT_DEFAULT_HEIGHT</span></div>
<div class="viewcode-block" id="Command.styled_table"><a class="viewcode-back" href="../../../api/evennia.commands.command.html#evennia.commands.cmdhandler.Command.styled_table">[docs]</a> <span class="k">def</span> <span class="nf">styled_table</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="o">*</span><span class="n">args</span><span class="p">,</span> <span class="o">**</span><span class="n">kwargs</span><span class="p">):</span>
<span class="sd">&quot;&quot;&quot;</span>

View file

@ -53,8 +53,14 @@
<span class="kn">from</span> <span class="nn">evennia.commands.command</span> <span class="k">import</span> <span class="n">Command</span>
<span class="kn">from</span> <span class="nn">evennia.help.models</span> <span class="k">import</span> <span class="n">HelpEntry</span>
<span class="kn">from</span> <span class="nn">evennia.utils</span> <span class="k">import</span> <span class="n">create</span><span class="p">,</span> <span class="n">evmore</span>
<span class="kn">from</span> <span class="nn">evennia.utils.ansi</span> <span class="k">import</span> <span class="n">ANSIString</span>
<span class="kn">from</span> <span class="nn">evennia.utils.eveditor</span> <span class="k">import</span> <span class="n">EvEditor</span>
<span class="kn">from</span> <span class="nn">evennia.utils.utils</span> <span class="k">import</span> <span class="n">string_suggestions</span><span class="p">,</span> <span class="n">class_from_module</span>
<span class="kn">from</span> <span class="nn">evennia.utils.utils</span> <span class="k">import</span> <span class="p">(</span>
<span class="n">string_suggestions</span><span class="p">,</span>
<span class="n">class_from_module</span><span class="p">,</span>
<span class="n">inherits_from</span><span class="p">,</span>
<span class="n">format_grid</span><span class="p">,</span>
<span class="p">)</span>
<span class="n">COMMAND_DEFAULT_CLASS</span> <span class="o">=</span> <span class="n">class_from_module</span><span class="p">(</span><span class="n">settings</span><span class="o">.</span><span class="n">COMMAND_DEFAULT_CLASS</span><span class="p">)</span>
<span class="n">HELP_MORE</span> <span class="o">=</span> <span class="n">settings</span><span class="o">.</span><span class="n">HELP_MORE</span>
@ -65,6 +71,71 @@
<span class="n">_DEFAULT_WIDTH</span> <span class="o">=</span> <span class="n">settings</span><span class="o">.</span><span class="n">CLIENT_DEFAULT_WIDTH</span>
<span class="n">_SEP</span> <span class="o">=</span> <span class="s2">&quot;|C&quot;</span> <span class="o">+</span> <span class="s2">&quot;-&quot;</span> <span class="o">*</span> <span class="n">_DEFAULT_WIDTH</span> <span class="o">+</span> <span class="s2">&quot;|n&quot;</span>
<span class="n">_LUNR</span> <span class="o">=</span> <span class="kc">None</span>
<span class="n">_LUNR_EXCEPTION</span> <span class="o">=</span> <span class="kc">None</span>
<span class="k">class</span> <span class="nc">HelpCategory</span><span class="p">:</span>
<span class="k">def</span> <span class="nf">__init__</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">key</span><span class="p">):</span>
<span class="bp">self</span><span class="o">.</span><span class="n">key</span> <span class="o">=</span> <span class="n">key</span>
<span class="nd">@property</span>
<span class="k">def</span> <span class="nf">search_index_entry</span><span class="p">(</span><span class="bp">self</span><span class="p">):</span>
<span class="k">return</span> <span class="p">{</span>
<span class="s2">&quot;key&quot;</span><span class="p">:</span> <span class="nb">str</span><span class="p">(</span><span class="bp">self</span><span class="p">),</span>
<span class="s2">&quot;aliases&quot;</span><span class="p">:</span> <span class="s2">&quot;&quot;</span><span class="p">,</span>
<span class="s2">&quot;category&quot;</span><span class="p">:</span> <span class="bp">self</span><span class="o">.</span><span class="n">key</span><span class="p">,</span>
<span class="s2">&quot;tags&quot;</span><span class="p">:</span> <span class="s2">&quot;&quot;</span><span class="p">,</span>
<span class="s2">&quot;text&quot;</span><span class="p">:</span> <span class="s2">&quot;&quot;</span><span class="p">,</span>
<span class="p">}</span>
<span class="k">def</span> <span class="nf">__str__</span><span class="p">(</span><span class="bp">self</span><span class="p">):</span>
<span class="k">return</span> <span class="n">f</span><span class="s2">&quot;Category: </span><span class="si">{self.key}</span><span class="s2">&quot;</span>
<span class="k">def</span> <span class="nf">__eq__</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">other</span><span class="p">):</span>
<span class="k">return</span> <span class="nb">str</span><span class="p">(</span><span class="bp">self</span><span class="p">)</span><span class="o">.</span><span class="n">lower</span><span class="p">()</span> <span class="o">==</span> <span class="nb">str</span><span class="p">(</span><span class="n">other</span><span class="p">)</span><span class="o">.</span><span class="n">lower</span><span class="p">()</span>
<span class="k">def</span> <span class="nf">__hash__</span><span class="p">(</span><span class="bp">self</span><span class="p">):</span>
<span class="k">return</span> <span class="nb">id</span><span class="p">(</span><span class="bp">self</span><span class="p">)</span>
<span class="k">def</span> <span class="nf">help_search_with_index</span><span class="p">(</span><span class="n">query</span><span class="p">,</span> <span class="n">candidate_entries</span><span class="p">,</span> <span class="n">suggestion_maxnum</span><span class="o">=</span><span class="mi">5</span><span class="p">):</span>
<span class="sd">&quot;&quot;&quot;</span>
<span class="sd"> Lunr-powered fast index search and suggestion wrapper</span>
<span class="sd"> &quot;&quot;&quot;</span>
<span class="k">global</span> <span class="n">_LUNR</span><span class="p">,</span> <span class="n">_LUNR_EXCEPTION</span>
<span class="k">if</span> <span class="ow">not</span> <span class="n">_LUNR</span><span class="p">:</span>
<span class="c1"># we have to delay-load lunr because it messes with logging if it&#39;s imported</span>
<span class="c1"># before twisted&#39;s logging has been set up</span>
<span class="kn">from</span> <span class="nn">lunr</span> <span class="k">import</span> <span class="n">lunr</span> <span class="k">as</span> <span class="n">_LUNR</span>
<span class="kn">from</span> <span class="nn">lunr.exceptions</span> <span class="k">import</span> <span class="n">QueryParseError</span> <span class="k">as</span> <span class="n">_LUNR_EXCEPTION</span>
<span class="n">indx</span> <span class="o">=</span> <span class="p">[</span><span class="n">cnd</span><span class="o">.</span><span class="n">search_index_entry</span> <span class="k">for</span> <span class="n">cnd</span> <span class="ow">in</span> <span class="n">candidate_entries</span><span class="p">]</span>
<span class="n">mapping</span> <span class="o">=</span> <span class="p">{</span><span class="n">indx</span><span class="p">[</span><span class="n">ix</span><span class="p">][</span><span class="s2">&quot;key&quot;</span><span class="p">]:</span> <span class="n">cand</span> <span class="k">for</span> <span class="n">ix</span><span class="p">,</span> <span class="n">cand</span> <span class="ow">in</span> <span class="nb">enumerate</span><span class="p">(</span><span class="n">candidate_entries</span><span class="p">)}</span>
<span class="n">search_index</span> <span class="o">=</span> <span class="n">_LUNR</span><span class="p">(</span>
<span class="n">ref</span><span class="o">=</span><span class="s2">&quot;key&quot;</span><span class="p">,</span>
<span class="n">fields</span><span class="o">=</span><span class="p">[</span>
<span class="p">{</span><span class="s2">&quot;field_name&quot;</span><span class="p">:</span> <span class="s2">&quot;key&quot;</span><span class="p">,</span> <span class="s2">&quot;boost&quot;</span><span class="p">:</span> <span class="mi">10</span><span class="p">},</span>
<span class="p">{</span><span class="s2">&quot;field_name&quot;</span><span class="p">:</span> <span class="s2">&quot;aliases&quot;</span><span class="p">,</span> <span class="s2">&quot;boost&quot;</span><span class="p">:</span> <span class="mi">9</span><span class="p">},</span>
<span class="p">{</span><span class="s2">&quot;field_name&quot;</span><span class="p">:</span> <span class="s2">&quot;category&quot;</span><span class="p">,</span> <span class="s2">&quot;boost&quot;</span><span class="p">:</span> <span class="mi">8</span><span class="p">},</span>
<span class="p">{</span><span class="s2">&quot;field_name&quot;</span><span class="p">:</span> <span class="s2">&quot;tags&quot;</span><span class="p">,</span> <span class="s2">&quot;boost&quot;</span><span class="p">:</span> <span class="mi">5</span><span class="p">},</span>
<span class="p">{</span><span class="s2">&quot;field_name&quot;</span><span class="p">:</span> <span class="s2">&quot;text&quot;</span><span class="p">,</span> <span class="s2">&quot;boost&quot;</span><span class="p">:</span> <span class="mi">1</span><span class="p">},</span>
<span class="p">],</span>
<span class="n">documents</span><span class="o">=</span><span class="n">indx</span><span class="p">,</span>
<span class="p">)</span>
<span class="k">try</span><span class="p">:</span>
<span class="n">matches</span> <span class="o">=</span> <span class="n">search_index</span><span class="o">.</span><span class="n">search</span><span class="p">(</span><span class="n">query</span><span class="p">)[:</span><span class="n">suggestion_maxnum</span><span class="p">]</span>
<span class="k">except</span> <span class="n">_LUNR_EXCEPTION</span><span class="p">:</span>
<span class="c1"># this is a user-input problem</span>
<span class="n">matches</span> <span class="o">=</span> <span class="p">[]</span>
<span class="c1"># matches (objs), suggestions (strs)</span>
<span class="k">return</span> <span class="p">(</span>
<span class="p">[</span><span class="n">mapping</span><span class="p">[</span><span class="n">match</span><span class="p">[</span><span class="s2">&quot;ref&quot;</span><span class="p">]]</span> <span class="k">for</span> <span class="n">match</span> <span class="ow">in</span> <span class="n">matches</span><span class="p">],</span>
<span class="p">[</span><span class="nb">str</span><span class="p">(</span><span class="n">match</span><span class="p">[</span><span class="s2">&quot;ref&quot;</span><span class="p">])</span> <span class="k">for</span> <span class="n">match</span> <span class="ow">in</span> <span class="n">matches</span><span class="p">],</span> <span class="c1"># + f&quot; (score {match[&#39;score&#39;]})&quot;) # good debug</span>
<span class="p">)</span>
<div class="viewcode-block" id="CmdHelp"><a class="viewcode-back" href="../../../../api/evennia.commands.default.help.html#evennia.commands.default.help.CmdHelp">[docs]</a><span class="k">class</span> <span class="nc">CmdHelp</span><span class="p">(</span><span class="n">Command</span><span class="p">):</span>
<span class="sd">&quot;&quot;&quot;</span>
@ -108,7 +179,7 @@
<span class="k">if</span> <span class="nb">type</span><span class="p">(</span><span class="bp">self</span><span class="p">)</span><span class="o">.</span><span class="n">help_more</span><span class="p">:</span>
<span class="n">usemore</span> <span class="o">=</span> <span class="kc">True</span>
<span class="k">if</span> <span class="bp">self</span><span class="o">.</span><span class="n">session</span> <span class="ow">and</span> <span class="bp">self</span><span class="o">.</span><span class="n">session</span><span class="o">.</span><span class="n">protocol_key</span> <span class="ow">in</span> <span class="p">(</span><span class="s2">&quot;websocket&quot;</span><span class="p">,</span> <span class="s2">&quot;ajax/comet&quot;</span><span class="p">):</span>
<span class="k">if</span> <span class="bp">self</span><span class="o">.</span><span class="n">session</span> <span class="ow">and</span> <span class="bp">self</span><span class="o">.</span><span class="n">session</span><span class="o">.</span><span class="n">protocol_key</span> <span class="ow">in</span> <span class="p">(</span><span class="s2">&quot;websocket&quot;</span><span class="p">,</span> <span class="s2">&quot;ajax/comet&quot;</span><span class="p">,):</span>
<span class="k">try</span><span class="p">:</span>
<span class="n">options</span> <span class="o">=</span> <span class="bp">self</span><span class="o">.</span><span class="n">account</span><span class="o">.</span><span class="n">db</span><span class="o">.</span><span class="n">_saved_webclient_options</span>
<span class="k">if</span> <span class="n">options</span> <span class="ow">and</span> <span class="n">options</span><span class="p">[</span><span class="s2">&quot;helppopup&quot;</span><span class="p">]:</span>
@ -152,30 +223,34 @@
<span class="n">string</span> <span class="o">+=</span> <span class="s2">&quot;</span><span class="se">\n</span><span class="s2">&quot;</span> <span class="o">+</span> <span class="n">_SEP</span>
<span class="k">return</span> <span class="n">string</span></div>
<div class="viewcode-block" id="CmdHelp.format_help_list"><a class="viewcode-back" href="../../../../api/evennia.commands.default.help.html#evennia.commands.default.help.CmdHelp.format_help_list">[docs]</a> <span class="nd">@staticmethod</span>
<span class="k">def</span> <span class="nf">format_help_list</span><span class="p">(</span><span class="n">hdict_cmds</span><span class="p">,</span> <span class="n">hdict_db</span><span class="p">):</span>
<div class="viewcode-block" id="CmdHelp.format_help_list"><a class="viewcode-back" href="../../../../api/evennia.commands.default.help.html#evennia.commands.default.help.CmdHelp.format_help_list">[docs]</a> <span class="k">def</span> <span class="nf">format_help_list</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">hdict_cmds</span><span class="p">,</span> <span class="n">hdict_db</span><span class="p">):</span>
<span class="sd">&quot;&quot;&quot;</span>
<span class="sd"> Output a category-ordered list. The input are the</span>
<span class="sd"> pre-loaded help files for commands and database-helpfiles</span>
<span class="sd"> respectively. You can override this method to return a</span>
<span class="sd"> custom display of the list of commands and topics.</span>
<span class="sd"> &quot;&quot;&quot;</span>
<span class="n">string</span> <span class="o">=</span> <span class="s2">&quot;&quot;</span>
<span class="k">if</span> <span class="n">hdict_cmds</span> <span class="ow">and</span> <span class="nb">any</span><span class="p">(</span><span class="n">hdict_cmds</span><span class="o">.</span><span class="n">values</span><span class="p">()):</span>
<span class="n">string</span> <span class="o">+=</span> <span class="s2">&quot;</span><span class="se">\n</span><span class="s2">&quot;</span> <span class="o">+</span> <span class="n">_SEP</span> <span class="o">+</span> <span class="s2">&quot;</span><span class="se">\n</span><span class="s2"> |CCommand help entries|n</span><span class="se">\n</span><span class="s2">&quot;</span> <span class="o">+</span> <span class="n">_SEP</span>
<span class="k">for</span> <span class="n">category</span> <span class="ow">in</span> <span class="nb">sorted</span><span class="p">(</span><span class="n">hdict_cmds</span><span class="o">.</span><span class="n">keys</span><span class="p">()):</span>
<span class="n">string</span> <span class="o">+=</span> <span class="s2">&quot;</span><span class="se">\n</span><span class="s2"> |w</span><span class="si">%s</span><span class="s2">|n:</span><span class="se">\n</span><span class="s2">&quot;</span> <span class="o">%</span> <span class="p">(</span><span class="nb">str</span><span class="p">(</span><span class="n">category</span><span class="p">)</span><span class="o">.</span><span class="n">title</span><span class="p">())</span>
<span class="n">string</span> <span class="o">+=</span> <span class="s2">&quot;|G&quot;</span> <span class="o">+</span> <span class="n">fill</span><span class="p">(</span><span class="s2">&quot;|C, |G&quot;</span><span class="o">.</span><span class="n">join</span><span class="p">(</span><span class="nb">sorted</span><span class="p">(</span><span class="n">hdict_cmds</span><span class="p">[</span><span class="n">category</span><span class="p">])))</span> <span class="o">+</span> <span class="s2">&quot;|n&quot;</span>
<span class="k">if</span> <span class="n">hdict_db</span> <span class="ow">and</span> <span class="nb">any</span><span class="p">(</span><span class="n">hdict_db</span><span class="o">.</span><span class="n">values</span><span class="p">()):</span>
<span class="n">string</span> <span class="o">+=</span> <span class="s2">&quot;</span><span class="se">\n\n</span><span class="s2">&quot;</span> <span class="o">+</span> <span class="n">_SEP</span> <span class="o">+</span> <span class="s2">&quot;</span><span class="se">\n\r</span><span class="s2"> |COther help entries|n</span><span class="se">\n</span><span class="s2">&quot;</span> <span class="o">+</span> <span class="n">_SEP</span>
<span class="k">for</span> <span class="n">category</span> <span class="ow">in</span> <span class="nb">sorted</span><span class="p">(</span><span class="n">hdict_db</span><span class="o">.</span><span class="n">keys</span><span class="p">()):</span>
<span class="n">string</span> <span class="o">+=</span> <span class="s2">&quot;</span><span class="se">\n\r</span><span class="s2"> |w</span><span class="si">%s</span><span class="s2">|n:</span><span class="se">\n</span><span class="s2">&quot;</span> <span class="o">%</span> <span class="p">(</span><span class="nb">str</span><span class="p">(</span><span class="n">category</span><span class="p">)</span><span class="o">.</span><span class="n">title</span><span class="p">())</span>
<span class="n">string</span> <span class="o">+=</span> <span class="p">(</span>
<span class="s2">&quot;|G&quot;</span>
<span class="o">+</span> <span class="n">fill</span><span class="p">(</span><span class="s2">&quot;, &quot;</span><span class="o">.</span><span class="n">join</span><span class="p">(</span><span class="nb">sorted</span><span class="p">([</span><span class="nb">str</span><span class="p">(</span><span class="n">topic</span><span class="p">)</span> <span class="k">for</span> <span class="n">topic</span> <span class="ow">in</span> <span class="n">hdict_db</span><span class="p">[</span><span class="n">category</span><span class="p">]])))</span>
<span class="o">+</span> <span class="s2">&quot;|n&quot;</span>
<span class="n">category_clr</span> <span class="o">=</span> <span class="s2">&quot;|w&quot;</span>
<span class="n">topic_clr</span> <span class="o">=</span> <span class="s2">&quot;|G&quot;</span>
<span class="n">width</span> <span class="o">=</span> <span class="bp">self</span><span class="o">.</span><span class="n">client_width</span><span class="p">()</span>
<span class="n">grid</span> <span class="o">=</span> <span class="p">[]</span>
<span class="n">verbatim_elements</span> <span class="o">=</span> <span class="p">[]</span>
<span class="k">for</span> <span class="n">category</span> <span class="ow">in</span> <span class="nb">sorted</span><span class="p">(</span><span class="nb">set</span><span class="p">(</span><span class="nb">list</span><span class="p">(</span><span class="n">hdict_cmds</span><span class="o">.</span><span class="n">keys</span><span class="p">())</span> <span class="o">+</span> <span class="nb">list</span><span class="p">(</span><span class="n">hdict_db</span><span class="o">.</span><span class="n">keys</span><span class="p">()))):</span>
<span class="n">category_str</span> <span class="o">=</span> <span class="n">f</span><span class="s2">&quot;-- {category.title()} &quot;</span>
<span class="n">grid</span><span class="o">.</span><span class="n">append</span><span class="p">(</span>
<span class="n">ANSIString</span><span class="p">(</span>
<span class="n">category_clr</span> <span class="o">+</span> <span class="n">category_str</span> <span class="o">+</span> <span class="s2">&quot;-&quot;</span> <span class="o">*</span> <span class="p">(</span><span class="n">width</span> <span class="o">-</span> <span class="nb">len</span><span class="p">(</span><span class="n">category_str</span><span class="p">))</span> <span class="o">+</span> <span class="n">topic_clr</span>
<span class="p">)</span>
<span class="k">return</span> <span class="n">string</span></div>
<span class="p">)</span>
<span class="n">verbatim_elements</span><span class="o">.</span><span class="n">append</span><span class="p">(</span><span class="nb">len</span><span class="p">(</span><span class="n">grid</span><span class="p">)</span> <span class="o">-</span> <span class="mi">1</span><span class="p">)</span>
<span class="n">entries</span> <span class="o">=</span> <span class="nb">sorted</span><span class="p">(</span><span class="nb">set</span><span class="p">(</span><span class="n">hdict_cmds</span><span class="o">.</span><span class="n">get</span><span class="p">(</span><span class="n">category</span><span class="p">,</span> <span class="p">[])</span> <span class="o">+</span> <span class="n">hdict_db</span><span class="o">.</span><span class="n">get</span><span class="p">(</span><span class="n">category</span><span class="p">,</span> <span class="p">[])))</span>
<span class="n">grid</span><span class="o">.</span><span class="n">extend</span><span class="p">(</span><span class="n">entries</span><span class="p">)</span>
<span class="n">gridrows</span> <span class="o">=</span> <span class="n">format_grid</span><span class="p">(</span><span class="n">grid</span><span class="p">,</span> <span class="n">width</span><span class="p">,</span> <span class="n">sep</span><span class="o">=</span><span class="s2">&quot; &quot;</span><span class="p">,</span> <span class="n">verbatim_elements</span><span class="o">=</span><span class="n">verbatim_elements</span><span class="p">)</span>
<span class="n">gridrows</span> <span class="o">=</span> <span class="n">ANSIString</span><span class="p">(</span><span class="s2">&quot;</span><span class="se">\n</span><span class="s2">&quot;</span><span class="p">)</span><span class="o">.</span><span class="n">join</span><span class="p">(</span><span class="n">gridrows</span><span class="p">)</span>
<span class="k">return</span> <span class="n">gridrows</span></div>
<div class="viewcode-block" id="CmdHelp.check_show_help"><a class="viewcode-back" href="../../../../api/evennia.commands.default.help.html#evennia.commands.default.help.CmdHelp.check_show_help">[docs]</a> <span class="k">def</span> <span class="nf">check_show_help</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">cmd</span><span class="p">,</span> <span class="n">caller</span><span class="p">):</span>
<span class="sd">&quot;&quot;&quot;</span>
@ -216,7 +291,7 @@
<span class="sd"> False: the command shouldn&#39;t appear in the table.</span>
<span class="sd"> &quot;&quot;&quot;</span>
<span class="k">return</span> <span class="n">cmd</span><span class="o">.</span><span class="n">access</span><span class="p">(</span><span class="n">caller</span><span class="p">,</span> <span class="s2">&quot;view&quot;</span><span class="p">,</span> <span class="n">default</span><span class="o">=</span><span class="kc">True</span><span class="p">)</span></div>
<span class="k">return</span> <span class="kc">True</span></div>
<div class="viewcode-block" id="CmdHelp.parse"><a class="viewcode-back" href="../../../../api/evennia.commands.default.help.html#evennia.commands.default.help.CmdHelp.parse">[docs]</a> <span class="k">def</span> <span class="nf">parse</span><span class="p">(</span><span class="bp">self</span><span class="p">):</span>
<span class="sd">&quot;&quot;&quot;</span>
@ -249,8 +324,8 @@
<span class="p">]</span>
<span class="n">all_categories</span> <span class="o">=</span> <span class="nb">list</span><span class="p">(</span>
<span class="nb">set</span><span class="p">(</span>
<span class="p">[</span><span class="n">cmd</span><span class="o">.</span><span class="n">help_category</span><span class="o">.</span><span class="n">lower</span><span class="p">()</span> <span class="k">for</span> <span class="n">cmd</span> <span class="ow">in</span> <span class="n">all_cmds</span><span class="p">]</span>
<span class="o">+</span> <span class="p">[</span><span class="n">topic</span><span class="o">.</span><span class="n">help_category</span><span class="o">.</span><span class="n">lower</span><span class="p">()</span> <span class="k">for</span> <span class="n">topic</span> <span class="ow">in</span> <span class="n">all_topics</span><span class="p">]</span>
<span class="p">[</span><span class="n">HelpCategory</span><span class="p">(</span><span class="n">cmd</span><span class="o">.</span><span class="n">help_category</span><span class="p">)</span> <span class="k">for</span> <span class="n">cmd</span> <span class="ow">in</span> <span class="n">all_cmds</span><span class="p">]</span>
<span class="o">+</span> <span class="p">[</span><span class="n">HelpCategory</span><span class="p">(</span><span class="n">topic</span><span class="o">.</span><span class="n">help_category</span><span class="p">)</span> <span class="k">for</span> <span class="n">topic</span> <span class="ow">in</span> <span class="n">all_topics</span><span class="p">]</span>
<span class="p">)</span>
<span class="p">)</span>
@ -271,78 +346,51 @@
<span class="bp">self</span><span class="o">.</span><span class="n">msg_help</span><span class="p">(</span><span class="bp">self</span><span class="o">.</span><span class="n">format_help_list</span><span class="p">(</span><span class="n">hdict_cmd</span><span class="p">,</span> <span class="n">hdict_topic</span><span class="p">))</span>
<span class="k">return</span>
<span class="c1"># Try to access a particular command</span>
<span class="c1"># Try to access a particular help entry or category</span>
<span class="n">entries</span> <span class="o">=</span> <span class="p">[</span><span class="n">cmd</span> <span class="k">for</span> <span class="n">cmd</span> <span class="ow">in</span> <span class="n">all_cmds</span> <span class="k">if</span> <span class="n">cmd</span><span class="p">]</span> <span class="o">+</span> <span class="nb">list</span><span class="p">(</span><span class="n">HelpEntry</span><span class="o">.</span><span class="n">objects</span><span class="o">.</span><span class="n">all</span><span class="p">())</span> <span class="o">+</span> <span class="n">all_categories</span>
<span class="c1"># build vocabulary of suggestions and rate them by string similarity.</span>
<span class="n">suggestions</span> <span class="o">=</span> <span class="kc">None</span>
<span class="k">if</span> <span class="n">suggestion_maxnum</span> <span class="o">&gt;</span> <span class="mi">0</span><span class="p">:</span>
<span class="n">vocabulary</span> <span class="o">=</span> <span class="p">(</span>
<span class="p">[</span><span class="n">cmd</span><span class="o">.</span><span class="n">key</span> <span class="k">for</span> <span class="n">cmd</span> <span class="ow">in</span> <span class="n">all_cmds</span> <span class="k">if</span> <span class="n">cmd</span><span class="p">]</span>
<span class="o">+</span> <span class="p">[</span><span class="n">topic</span><span class="o">.</span><span class="n">key</span> <span class="k">for</span> <span class="n">topic</span> <span class="ow">in</span> <span class="n">all_topics</span><span class="p">]</span>
<span class="o">+</span> <span class="n">all_categories</span>
<span class="k">for</span> <span class="n">match_query</span> <span class="ow">in</span> <span class="p">[</span><span class="n">f</span><span class="s2">&quot;</span><span class="si">{query}</span><span class="s2">~1&quot;</span><span class="p">,</span> <span class="n">f</span><span class="s2">&quot;</span><span class="si">{query}</span><span class="s2">*&quot;</span><span class="p">]:</span>
<span class="c1"># We first do an exact word-match followed by a start-by query</span>
<span class="n">matches</span><span class="p">,</span> <span class="n">suggestions</span> <span class="o">=</span> <span class="n">help_search_with_index</span><span class="p">(</span>
<span class="n">match_query</span><span class="p">,</span> <span class="n">entries</span><span class="p">,</span> <span class="n">suggestion_maxnum</span><span class="o">=</span><span class="bp">self</span><span class="o">.</span><span class="n">suggestion_maxnum</span>
<span class="p">)</span>
<span class="p">[</span><span class="n">vocabulary</span><span class="o">.</span><span class="n">extend</span><span class="p">(</span><span class="n">cmd</span><span class="o">.</span><span class="n">aliases</span><span class="p">)</span> <span class="k">for</span> <span class="n">cmd</span> <span class="ow">in</span> <span class="n">all_cmds</span><span class="p">]</span>
<span class="n">suggestions</span> <span class="o">=</span> <span class="p">[</span>
<span class="n">sugg</span>
<span class="k">for</span> <span class="n">sugg</span> <span class="ow">in</span> <span class="n">string_suggestions</span><span class="p">(</span>
<span class="n">query</span><span class="p">,</span> <span class="nb">set</span><span class="p">(</span><span class="n">vocabulary</span><span class="p">),</span> <span class="n">cutoff</span><span class="o">=</span><span class="n">suggestion_cutoff</span><span class="p">,</span> <span class="n">maxnum</span><span class="o">=</span><span class="n">suggestion_maxnum</span>
<span class="p">)</span>
<span class="k">if</span> <span class="n">sugg</span> <span class="o">!=</span> <span class="n">query</span>
<span class="p">]</span>
<span class="k">if</span> <span class="ow">not</span> <span class="n">suggestions</span><span class="p">:</span>
<span class="n">suggestions</span> <span class="o">=</span> <span class="p">[</span>
<span class="n">sugg</span> <span class="k">for</span> <span class="n">sugg</span> <span class="ow">in</span> <span class="n">vocabulary</span> <span class="k">if</span> <span class="n">sugg</span> <span class="o">!=</span> <span class="n">query</span> <span class="ow">and</span> <span class="n">sugg</span><span class="o">.</span><span class="n">startswith</span><span class="p">(</span><span class="n">query</span><span class="p">)</span>
<span class="p">]</span>
<span class="c1"># try an exact command auto-help match</span>
<span class="n">match</span> <span class="o">=</span> <span class="p">[</span><span class="n">cmd</span> <span class="k">for</span> <span class="n">cmd</span> <span class="ow">in</span> <span class="n">all_cmds</span> <span class="k">if</span> <span class="n">cmd</span> <span class="o">==</span> <span class="n">query</span><span class="p">]</span>
<span class="k">if</span> <span class="n">matches</span><span class="p">:</span>
<span class="n">match</span> <span class="o">=</span> <span class="n">matches</span><span class="p">[</span><span class="mi">0</span><span class="p">]</span>
<span class="k">if</span> <span class="nb">isinstance</span><span class="p">(</span><span class="n">match</span><span class="p">,</span> <span class="n">HelpCategory</span><span class="p">):</span>
<span class="n">formatted</span> <span class="o">=</span> <span class="bp">self</span><span class="o">.</span><span class="n">format_help_list</span><span class="p">(</span>
<span class="p">{</span>
<span class="n">match</span><span class="o">.</span><span class="n">key</span><span class="p">:</span> <span class="p">[</span>
<span class="n">cmd</span><span class="o">.</span><span class="n">key</span>
<span class="k">for</span> <span class="n">cmd</span> <span class="ow">in</span> <span class="n">all_cmds</span>
<span class="k">if</span> <span class="n">match</span><span class="o">.</span><span class="n">key</span><span class="o">.</span><span class="n">lower</span><span class="p">()</span> <span class="o">==</span> <span class="n">cmd</span><span class="o">.</span><span class="n">help_category</span>
<span class="p">]</span>
<span class="p">},</span>
<span class="p">{</span>
<span class="n">match</span><span class="o">.</span><span class="n">key</span><span class="p">:</span> <span class="p">[</span>
<span class="n">topic</span><span class="o">.</span><span class="n">key</span>
<span class="k">for</span> <span class="n">topic</span> <span class="ow">in</span> <span class="n">all_topics</span>
<span class="k">if</span> <span class="n">match</span><span class="o">.</span><span class="n">key</span><span class="o">.</span><span class="n">lower</span><span class="p">()</span> <span class="o">==</span> <span class="n">topic</span><span class="o">.</span><span class="n">help_category</span>
<span class="p">]</span>
<span class="p">},</span>
<span class="p">)</span>
<span class="k">elif</span> <span class="n">inherits_from</span><span class="p">(</span><span class="n">match</span><span class="p">,</span> <span class="s2">&quot;evennia.commands.command.Command&quot;</span><span class="p">):</span>
<span class="n">formatted</span> <span class="o">=</span> <span class="bp">self</span><span class="o">.</span><span class="n">format_help_entry</span><span class="p">(</span>
<span class="n">match</span><span class="o">.</span><span class="n">key</span><span class="p">,</span>
<span class="n">match</span><span class="o">.</span><span class="n">get_help</span><span class="p">(</span><span class="n">caller</span><span class="p">,</span> <span class="n">cmdset</span><span class="p">),</span>
<span class="n">aliases</span><span class="o">=</span><span class="n">match</span><span class="o">.</span><span class="n">aliases</span><span class="p">,</span>
<span class="n">suggested</span><span class="o">=</span><span class="n">suggestions</span><span class="p">[</span><span class="mi">1</span><span class="p">:],</span>
<span class="p">)</span>
<span class="k">else</span><span class="p">:</span>
<span class="n">formatted</span> <span class="o">=</span> <span class="bp">self</span><span class="o">.</span><span class="n">format_help_entry</span><span class="p">(</span>
<span class="n">match</span><span class="o">.</span><span class="n">key</span><span class="p">,</span>
<span class="n">match</span><span class="o">.</span><span class="n">entrytext</span><span class="p">,</span>
<span class="n">aliases</span><span class="o">=</span><span class="n">match</span><span class="o">.</span><span class="n">aliases</span><span class="o">.</span><span class="n">all</span><span class="p">(),</span>
<span class="n">suggested</span><span class="o">=</span><span class="n">suggestions</span><span class="p">[</span><span class="mi">1</span><span class="p">:],</span>
<span class="p">)</span>
<span class="k">if</span> <span class="ow">not</span> <span class="n">match</span><span class="p">:</span>
<span class="c1"># try an inexact match with prefixes stripped from query and cmds</span>
<span class="n">_query</span> <span class="o">=</span> <span class="n">query</span><span class="p">[</span><span class="mi">1</span><span class="p">:]</span> <span class="k">if</span> <span class="n">query</span><span class="p">[</span><span class="mi">0</span><span class="p">]</span> <span class="ow">in</span> <span class="n">CMD_IGNORE_PREFIXES</span> <span class="k">else</span> <span class="n">query</span>
<span class="n">match</span> <span class="o">=</span> <span class="p">[</span>
<span class="n">cmd</span>
<span class="k">for</span> <span class="n">cmd</span> <span class="ow">in</span> <span class="n">all_cmds</span>
<span class="k">for</span> <span class="n">m</span> <span class="ow">in</span> <span class="n">cmd</span><span class="o">.</span><span class="n">_matchset</span>
<span class="k">if</span> <span class="n">m</span> <span class="o">==</span> <span class="n">_query</span> <span class="ow">or</span> <span class="n">m</span><span class="p">[</span><span class="mi">0</span><span class="p">]</span> <span class="ow">in</span> <span class="n">CMD_IGNORE_PREFIXES</span> <span class="ow">and</span> <span class="n">m</span><span class="p">[</span><span class="mi">1</span><span class="p">:]</span> <span class="o">==</span> <span class="n">_query</span>
<span class="p">]</span>
<span class="k">if</span> <span class="nb">len</span><span class="p">(</span><span class="n">match</span><span class="p">)</span> <span class="o">==</span> <span class="mi">1</span><span class="p">:</span>
<span class="n">cmd</span> <span class="o">=</span> <span class="n">match</span><span class="p">[</span><span class="mi">0</span><span class="p">]</span>
<span class="n">key</span> <span class="o">=</span> <span class="n">cmd</span><span class="o">.</span><span class="n">auto_help_display_key</span> <span class="k">if</span> <span class="nb">hasattr</span><span class="p">(</span><span class="n">cmd</span><span class="p">,</span> <span class="s2">&quot;auto_help_display_key&quot;</span><span class="p">)</span> <span class="k">else</span> <span class="n">cmd</span><span class="o">.</span><span class="n">key</span>
<span class="n">formatted</span> <span class="o">=</span> <span class="bp">self</span><span class="o">.</span><span class="n">format_help_entry</span><span class="p">(</span>
<span class="n">key</span><span class="p">,</span>
<span class="n">cmd</span><span class="o">.</span><span class="n">get_help</span><span class="p">(</span><span class="n">caller</span><span class="p">,</span> <span class="n">cmdset</span><span class="p">),</span>
<span class="n">aliases</span><span class="o">=</span><span class="n">cmd</span><span class="o">.</span><span class="n">aliases</span><span class="p">,</span>
<span class="n">suggested</span><span class="o">=</span><span class="n">suggestions</span><span class="p">,</span>
<span class="p">)</span>
<span class="bp">self</span><span class="o">.</span><span class="n">msg_help</span><span class="p">(</span><span class="n">formatted</span><span class="p">)</span>
<span class="k">return</span>
<span class="c1"># try an exact database help entry match</span>
<span class="n">match</span> <span class="o">=</span> <span class="nb">list</span><span class="p">(</span><span class="n">HelpEntry</span><span class="o">.</span><span class="n">objects</span><span class="o">.</span><span class="n">find_topicmatch</span><span class="p">(</span><span class="n">query</span><span class="p">,</span> <span class="n">exact</span><span class="o">=</span><span class="kc">True</span><span class="p">))</span>
<span class="k">if</span> <span class="nb">len</span><span class="p">(</span><span class="n">match</span><span class="p">)</span> <span class="o">==</span> <span class="mi">1</span><span class="p">:</span>
<span class="n">formatted</span> <span class="o">=</span> <span class="bp">self</span><span class="o">.</span><span class="n">format_help_entry</span><span class="p">(</span>
<span class="n">match</span><span class="p">[</span><span class="mi">0</span><span class="p">]</span><span class="o">.</span><span class="n">key</span><span class="p">,</span>
<span class="n">match</span><span class="p">[</span><span class="mi">0</span><span class="p">]</span><span class="o">.</span><span class="n">entrytext</span><span class="p">,</span>
<span class="n">aliases</span><span class="o">=</span><span class="n">match</span><span class="p">[</span><span class="mi">0</span><span class="p">]</span><span class="o">.</span><span class="n">aliases</span><span class="o">.</span><span class="n">all</span><span class="p">(),</span>
<span class="n">suggested</span><span class="o">=</span><span class="n">suggestions</span><span class="p">,</span>
<span class="p">)</span>
<span class="bp">self</span><span class="o">.</span><span class="n">msg_help</span><span class="p">(</span><span class="n">formatted</span><span class="p">)</span>
<span class="k">return</span>
<span class="c1"># try to see if a category name was entered</span>
<span class="k">if</span> <span class="n">query</span> <span class="ow">in</span> <span class="n">all_categories</span><span class="p">:</span>
<span class="bp">self</span><span class="o">.</span><span class="n">msg_help</span><span class="p">(</span>
<span class="bp">self</span><span class="o">.</span><span class="n">format_help_list</span><span class="p">({</span>
<span class="n">query</span><span class="p">:</span> <span class="p">[</span>
<span class="n">cmd</span><span class="o">.</span><span class="n">auto_help_display_key</span> <span class="k">if</span> <span class="nb">hasattr</span><span class="p">(</span><span class="n">cmd</span><span class="p">,</span> <span class="s2">&quot;auto_help_display_key&quot;</span><span class="p">)</span> <span class="k">else</span> <span class="n">cmd</span><span class="o">.</span><span class="n">key</span>
<span class="k">for</span> <span class="n">cmd</span> <span class="ow">in</span> <span class="n">all_cmds</span> <span class="k">if</span> <span class="n">cmd</span><span class="o">.</span><span class="n">help_category</span> <span class="o">==</span> <span class="n">query</span><span class="p">]},</span>
<span class="p">{</span><span class="n">query</span><span class="p">:</span> <span class="p">[</span><span class="n">topic</span><span class="o">.</span><span class="n">key</span> <span class="k">for</span> <span class="n">topic</span> <span class="ow">in</span> <span class="n">all_topics</span> <span class="k">if</span> <span class="n">topic</span><span class="o">.</span><span class="n">help_category</span> <span class="o">==</span> <span class="n">query</span><span class="p">]},</span>
<span class="p">)</span>
<span class="p">)</span>
<span class="k">return</span>
<span class="bp">self</span><span class="o">.</span><span class="n">msg_help</span><span class="p">(</span><span class="n">formatted</span><span class="p">)</span>
<span class="k">return</span>
<span class="c1"># no exact matches found. Just give suggestions.</span>
<span class="bp">self</span><span class="o">.</span><span class="n">msg</span><span class="p">(</span>
@ -423,7 +471,10 @@
<span class="bp">self</span><span class="o">.</span><span class="n">msg</span><span class="p">(</span><span class="s2">&quot;You have to define a topic!&quot;</span><span class="p">)</span>
<span class="k">return</span>
<span class="n">topicstrlist</span> <span class="o">=</span> <span class="n">topicstr</span><span class="o">.</span><span class="n">split</span><span class="p">(</span><span class="s2">&quot;;&quot;</span><span class="p">)</span>
<span class="n">topicstr</span><span class="p">,</span> <span class="n">aliases</span> <span class="o">=</span> <span class="p">(</span><span class="n">topicstrlist</span><span class="p">[</span><span class="mi">0</span><span class="p">],</span> <span class="n">topicstrlist</span><span class="p">[</span><span class="mi">1</span><span class="p">:]</span> <span class="k">if</span> <span class="nb">len</span><span class="p">(</span><span class="n">topicstr</span><span class="p">)</span> <span class="o">&gt;</span> <span class="mi">1</span> <span class="k">else</span> <span class="p">[])</span>
<span class="n">topicstr</span><span class="p">,</span> <span class="n">aliases</span> <span class="o">=</span> <span class="p">(</span>
<span class="n">topicstrlist</span><span class="p">[</span><span class="mi">0</span><span class="p">],</span>
<span class="n">topicstrlist</span><span class="p">[</span><span class="mi">1</span><span class="p">:]</span> <span class="k">if</span> <span class="nb">len</span><span class="p">(</span><span class="n">topicstr</span><span class="p">)</span> <span class="o">&gt;</span> <span class="mi">1</span> <span class="k">else</span> <span class="p">[],</span>
<span class="p">)</span>
<span class="n">aliastxt</span> <span class="o">=</span> <span class="p">(</span><span class="s2">&quot;(aliases: </span><span class="si">%s</span><span class="s2">)&quot;</span> <span class="o">%</span> <span class="s2">&quot;, &quot;</span><span class="o">.</span><span class="n">join</span><span class="p">(</span><span class="n">aliases</span><span class="p">))</span> <span class="k">if</span> <span class="n">aliases</span> <span class="k">else</span> <span class="s2">&quot;&quot;</span>
<span class="n">old_entry</span> <span class="o">=</span> <span class="kc">None</span>
@ -452,7 +503,7 @@
<span class="n">helpentry</span> <span class="o">=</span> <span class="n">old_entry</span>
<span class="k">else</span><span class="p">:</span>
<span class="n">helpentry</span> <span class="o">=</span> <span class="n">create</span><span class="o">.</span><span class="n">create_help_entry</span><span class="p">(</span>
<span class="n">topicstr</span><span class="p">,</span> <span class="bp">self</span><span class="o">.</span><span class="n">rhs</span><span class="p">,</span> <span class="n">category</span><span class="o">=</span><span class="n">category</span><span class="p">,</span> <span class="n">locks</span><span class="o">=</span><span class="n">lockstring</span><span class="p">,</span> <span class="n">aliases</span><span class="o">=</span><span class="n">aliases</span>
<span class="n">topicstr</span><span class="p">,</span> <span class="bp">self</span><span class="o">.</span><span class="n">rhs</span><span class="p">,</span> <span class="n">category</span><span class="o">=</span><span class="n">category</span><span class="p">,</span> <span class="n">locks</span><span class="o">=</span><span class="n">lockstring</span><span class="p">,</span> <span class="n">aliases</span><span class="o">=</span><span class="n">aliases</span><span class="p">,</span>
<span class="p">)</span>
<span class="bp">self</span><span class="o">.</span><span class="n">caller</span><span class="o">.</span><span class="n">db</span><span class="o">.</span><span class="n">_editing_help</span> <span class="o">=</span> <span class="n">helpentry</span>

View file

@ -434,7 +434,9 @@
<span class="k">if</span> <span class="n">noecho</span><span class="p">:</span>
<span class="n">prompt</span> <span class="o">=</span> <span class="s2">&quot;...&quot;</span> <span class="k">if</span> <span class="n">console</span><span class="o">.</span><span class="n">push</span><span class="p">(</span><span class="n">line</span><span class="p">)</span> <span class="k">else</span> <span class="n">main_prompt</span>
<span class="k">else</span><span class="p">:</span>
<span class="n">prompt</span> <span class="o">=</span> <span class="n">line</span> <span class="k">if</span> <span class="n">console</span><span class="o">.</span><span class="n">push</span><span class="p">(</span><span class="n">line</span><span class="p">)</span> <span class="k">else</span> <span class="n">f</span><span class="s2">&quot;</span><span class="si">{line}</span><span class="se">\n</span><span class="si">{main_prompt}</span><span class="s2">&quot;</span>
<span class="k">if</span> <span class="n">line</span><span class="p">:</span>
<span class="bp">self</span><span class="o">.</span><span class="n">caller</span><span class="o">.</span><span class="n">msg</span><span class="p">(</span><span class="n">f</span><span class="s2">&quot;&gt;&gt;&gt; </span><span class="si">{line}</span><span class="s2">&quot;</span><span class="p">)</span>
<span class="n">prompt</span> <span class="o">=</span> <span class="n">line</span> <span class="k">if</span> <span class="n">console</span><span class="o">.</span><span class="n">push</span><span class="p">(</span><span class="n">line</span><span class="p">)</span> <span class="k">else</span> <span class="n">main_prompt</span>
<span class="k">except</span> <span class="ne">SystemExit</span><span class="p">:</span>
<span class="k">break</span>
<span class="bp">self</span><span class="o">.</span><span class="n">msg</span><span class="p">(</span><span class="s2">&quot;|gClosing the Python console.|n&quot;</span><span class="p">)</span>

View file

@ -314,8 +314,21 @@
<div class="viewcode-block" id="TestHelp"><a class="viewcode-back" href="../../../../api/evennia.commands.default.tests.html#evennia.commands.default.tests.TestHelp">[docs]</a><span class="k">class</span> <span class="nc">TestHelp</span><span class="p">(</span><span class="n">CommandTest</span><span class="p">):</span>
<div class="viewcode-block" id="TestHelp.setUp"><a class="viewcode-back" href="../../../../api/evennia.commands.default.tests.html#evennia.commands.default.tests.TestHelp.setUp">[docs]</a> <span class="k">def</span> <span class="nf">setUp</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">setUp</span><span class="p">()</span>
<span class="c1"># we need to set up a logger here since lunr takes over the logger otherwise</span>
<span class="kn">import</span> <span class="nn">logging</span>
<span class="n">logging</span><span class="o">.</span><span class="n">basicConfig</span><span class="p">(</span><span class="n">level</span><span class="o">=</span><span class="n">logging</span><span class="o">.</span><span class="n">ERROR</span><span class="p">)</span></div>
<div class="viewcode-block" id="TestHelp.tearDown"><a class="viewcode-back" href="../../../../api/evennia.commands.default.tests.html#evennia.commands.default.tests.TestHelp.tearDown">[docs]</a> <span class="k">def</span> <span class="nf">tearDown</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">tearDown</span><span class="p">()</span>
<span class="kn">import</span> <span class="nn">logging</span>
<span class="n">logging</span><span class="o">.</span><span class="n">disable</span><span class="p">(</span><span class="n">level</span><span class="o">=</span><span class="n">logging</span><span class="o">.</span><span class="n">ERROR</span><span class="p">)</span></div>
<div class="viewcode-block" id="TestHelp.test_help"><a class="viewcode-back" href="../../../../api/evennia.commands.default.tests.html#evennia.commands.default.tests.TestHelp.test_help">[docs]</a> <span class="k">def</span> <span class="nf">test_help</span><span class="p">(</span><span class="bp">self</span><span class="p">):</span>
<span class="bp">self</span><span class="o">.</span><span class="n">call</span><span class="p">(</span><span class="n">help</span><span class="o">.</span><span class="n">CmdHelp</span><span class="p">(),</span> <span class="s2">&quot;&quot;</span><span class="p">,</span> <span class="s2">&quot;Command help entries&quot;</span><span class="p">,</span> <span class="n">cmdset</span><span class="o">=</span><span class="n">CharacterCmdSet</span><span class="p">())</span></div>
<span class="bp">self</span><span class="o">.</span><span class="n">call</span><span class="p">(</span><span class="n">help</span><span class="o">.</span><span class="n">CmdHelp</span><span class="p">(),</span> <span class="s2">&quot;&quot;</span><span class="p">,</span> <span class="s2">&quot;Admin&quot;</span><span class="p">,</span> <span class="n">cmdset</span><span class="o">=</span><span class="n">CharacterCmdSet</span><span class="p">())</span></div>
<div class="viewcode-block" id="TestHelp.test_set_help"><a class="viewcode-back" href="../../../../api/evennia.commands.default.tests.html#evennia.commands.default.tests.TestHelp.test_set_help">[docs]</a> <span class="k">def</span> <span class="nf">test_set_help</span><span class="p">(</span><span class="bp">self</span><span class="p">):</span>
<span class="bp">self</span><span class="o">.</span><span class="n">call</span><span class="p">(</span>

View file

@ -335,6 +335,7 @@
<span class="s2"> |wquit|n - abort the connection</span>
<span class="s2">First create an account e.g. with |wcreate Anna c67jHL8p|n</span>
<span class="s2">(If you have spaces in your name, use double quotes: |wcreate &quot;Anna the Barbarian&quot; c67jHL8p|n</span>
<span class="s2">Next you can connect to the game: |wconnect Anna c67jHL8p|n</span>
<span class="s2">You can use the |wlook|n command if you want to see the connect screen again.</span>

View file

@ -324,7 +324,8 @@
<span class="sd"> the markers and a tuple (langname, saytext), where</span>
<span class="sd"> langname can be None.</span>
<span class="sd"> Raises:</span>
<span class="sd"> rplanguage.LanguageError: If an invalid language was specified.</span>
<span class="sd"> evennia.contrib.rpsystem.LanguageError: If an invalid language was</span>
<span class="sd"> specified.</span>
<span class="sd"> Notes:</span>
<span class="sd"> Note that no errors are raised if the wrong language identifier</span>

View file

@ -683,7 +683,6 @@
<span class="sd"> Args:</span>
<span class="sd"> to_init (object): Object to initialize range field for.</span>
<span class="sd"> Keyword Args:</span>
<span class="sd"> anchor_obj (object): Object to copy range values from, or None for a random object.</span>
<span class="sd"> add_distance (int): Distance to put between to_init object and anchor object.</span>

View file

@ -473,8 +473,9 @@
<span class="s2">and the main window.</span>
<span class="s2">- Use |y&lt;Return&gt;|n (or click the arrow on the right) to send your input.</span>
<span class="s2">- Use |yShift + &lt;up/down-arrow&gt;|n to step back and forth in your command-history.</span>
<span class="s2">- Use |yShift + &lt;Return&gt;|n to add a new line to your input without sending.</span>
<span class="s2">- Use |yCtrl + &lt;up/down-arrow&gt;|n to step back and forth in your command-history.</span>
<span class="s2">- Use |yCtrl + &lt;Return&gt;|n to add a new line to your input without sending.</span>
<span class="s2">(Cmd instead of Ctrl-key on Macs)</span>
<span class="s2">There is also some |wextra|n info to learn about customizing the webclient.</span>

View file

@ -110,7 +110,7 @@
<span class="sd"> stationary (idling) until attacked.</span>
<span class="sd"> aggressive: if set, will attack Characters in</span>
<span class="sd"> the same room using whatever Weapon it</span>
<span class="sd"> carries (see tutorial_world.objects.Weapon).</span>
<span class="sd"> carries (see tutorial_world.objects.TutorialWeapon).</span>
<span class="sd"> if unset, the mob will never engage in combat</span>
<span class="sd"> no matter what.</span>
<span class="sd"> hunting: if set, the mob will pursue enemies trying</span>
@ -209,9 +209,9 @@
<span class="sd"> be &quot;ticked&quot;.</span>
<span class="sd"> Args:</span>
<span class="sd"> interval (int): The number of seconds</span>
<span class="sd"> interval (int or None): The number of seconds</span>
<span class="sd"> between ticks</span>
<span class="sd"> hook_key (str): The name of the method</span>
<span class="sd"> hook_key (str or None): The name of the method</span>
<span class="sd"> (on this mob) to call every interval</span>
<span class="sd"> seconds.</span>
<span class="sd"> stop (bool, optional): Just stop the</span>
@ -413,16 +413,11 @@
<span class="k">return</span>
<span class="c1"># we use the same attack commands as defined in</span>
<span class="c1"># tutorial_world.objects.Weapon, assuming that</span>
<span class="c1"># tutorial_world.objects.TutorialWeapon, assuming that</span>
<span class="c1"># the mob is given a Weapon to attack with.</span>
<span class="n">attack_cmd</span> <span class="o">=</span> <span class="n">random</span><span class="o">.</span><span class="n">choice</span><span class="p">((</span><span class="s2">&quot;thrust&quot;</span><span class="p">,</span> <span class="s2">&quot;pierce&quot;</span><span class="p">,</span> <span class="s2">&quot;stab&quot;</span><span class="p">,</span> <span class="s2">&quot;slash&quot;</span><span class="p">,</span> <span class="s2">&quot;chop&quot;</span><span class="p">))</span>
<span class="bp">self</span><span class="o">.</span><span class="n">execute_cmd</span><span class="p">(</span><span class="s2">&quot;</span><span class="si">%s</span><span class="s2"> </span><span class="si">%s</span><span class="s2">&quot;</span> <span class="o">%</span> <span class="p">(</span><span class="n">attack_cmd</span><span class="p">,</span> <span class="n">target</span><span class="p">))</span>
<span class="k">if</span> <span class="n">target</span><span class="o">.</span><span class="n">db</span><span class="o">.</span><span class="n">health</span> <span class="ow">is</span> <span class="kc">None</span><span class="p">:</span>
<span class="c1"># This is not an attackable target</span>
<span class="n">logger</span><span class="o">.</span><span class="n">log_err</span><span class="p">(</span><span class="n">f</span><span class="s2">&quot;</span><span class="si">{self.key}</span><span class="s2"> found </span><span class="si">{target}</span><span class="s2"> had an `health` attribute of `None`.&quot;</span><span class="p">)</span>
<span class="k">return</span>
<span class="c1"># analyze the current state</span>
<span class="k">if</span> <span class="n">target</span><span class="o">.</span><span class="n">db</span><span class="o">.</span><span class="n">health</span> <span class="o">&lt;=</span> <span class="mi">0</span><span class="p">:</span>
<span class="c1"># we reduced the target to &lt;= 0 health. Move them to the</span>

View file

@ -55,8 +55,8 @@
<span class="sd">Obelisk</span>
<span class="sd">LightSource</span>
<span class="sd">CrumblingWall</span>
<span class="sd">Weapon</span>
<span class="sd">WeaponRack</span>
<span class="sd">TutorialWeapon</span>
<span class="sd">TutorialWeaponRack</span>
<span class="sd">&quot;&quot;&quot;</span>
@ -832,7 +832,7 @@
<span class="c1"># -------------------------------------------------------------</span>
<span class="c1">#</span>
<span class="c1"># Weapon - object type</span>
<span class="c1"># TutorialWeapon - object type</span>
<span class="c1">#</span>
<span class="c1"># A weapon is necessary in order to fight in the tutorial</span>
<span class="c1"># world. A weapon (which here is assumed to be a bladed</span>
@ -972,7 +972,7 @@
<span class="bp">self</span><span class="o">.</span><span class="n">add</span><span class="p">(</span><span class="n">CmdAttack</span><span class="p">())</span></div></div>
<div class="viewcode-block" id="Weapon"><a class="viewcode-back" href="../../../../api/evennia.contrib.tutorial_world.objects.html#evennia.contrib.tutorial_world.objects.Weapon">[docs]</a><span class="k">class</span> <span class="nc">Weapon</span><span class="p">(</span><span class="n">TutorialObject</span><span class="p">):</span>
<div class="viewcode-block" id="TutorialWeapon"><a class="viewcode-back" href="../../../../api/evennia.contrib.tutorial_world.objects.html#evennia.contrib.tutorial_world.objects.TutorialWeapon">[docs]</a><span class="k">class</span> <span class="nc">TutorialWeapon</span><span class="p">(</span><span class="n">TutorialObject</span><span class="p">):</span>
<span class="sd">&quot;&quot;&quot;</span>
<span class="sd"> This defines a bladed weapon.</span>
@ -984,7 +984,7 @@
<span class="sd"> &quot;&quot;&quot;</span>
<div class="viewcode-block" id="Weapon.at_object_creation"><a class="viewcode-back" href="../../../../api/evennia.contrib.tutorial_world.objects.html#evennia.contrib.tutorial_world.objects.Weapon.at_object_creation">[docs]</a> <span class="k">def</span> <span class="nf">at_object_creation</span><span class="p">(</span><span class="bp">self</span><span class="p">):</span>
<div class="viewcode-block" id="TutorialWeapon.at_object_creation"><a class="viewcode-back" href="../../../../api/evennia.contrib.tutorial_world.objects.html#evennia.contrib.tutorial_world.objects.TutorialWeapon.at_object_creation">[docs]</a> <span class="k">def</span> <span class="nf">at_object_creation</span><span class="p">(</span><span class="bp">self</span><span class="p">):</span>
<span class="sd">&quot;&quot;&quot;Called at first creation of the object&quot;&quot;&quot;</span>
<span class="nb">super</span><span class="p">()</span><span class="o">.</span><span class="n">at_object_creation</span><span class="p">()</span>
<span class="bp">self</span><span class="o">.</span><span class="n">db</span><span class="o">.</span><span class="n">hit</span> <span class="o">=</span> <span class="mf">0.4</span> <span class="c1"># hit chance</span>
@ -993,7 +993,7 @@
<span class="bp">self</span><span class="o">.</span><span class="n">db</span><span class="o">.</span><span class="n">magic</span> <span class="o">=</span> <span class="kc">False</span>
<span class="bp">self</span><span class="o">.</span><span class="n">cmdset</span><span class="o">.</span><span class="n">add_default</span><span class="p">(</span><span class="n">CmdSetWeapon</span><span class="p">,</span> <span class="n">permanent</span><span class="o">=</span><span class="kc">True</span><span class="p">)</span></div>
<div class="viewcode-block" id="Weapon.reset"><a class="viewcode-back" href="../../../../api/evennia.contrib.tutorial_world.objects.html#evennia.contrib.tutorial_world.objects.Weapon.reset">[docs]</a> <span class="k">def</span> <span class="nf">reset</span><span class="p">(</span><span class="bp">self</span><span class="p">):</span>
<div class="viewcode-block" id="TutorialWeapon.reset"><a class="viewcode-back" href="../../../../api/evennia.contrib.tutorial_world.objects.html#evennia.contrib.tutorial_world.objects.TutorialWeapon.reset">[docs]</a> <span class="k">def</span> <span class="nf">reset</span><span class="p">(</span><span class="bp">self</span><span class="p">):</span>
<span class="sd">&quot;&quot;&quot;</span>
<span class="sd"> When reset, the weapon is simply deleted, unless it has a place</span>
<span class="sd"> to return to.</span>
@ -1023,7 +1023,7 @@
<span class="n">WEAPON_PROTOTYPES</span> <span class="o">=</span> <span class="p">{</span>
<span class="s2">&quot;weapon&quot;</span><span class="p">:</span> <span class="p">{</span>
<span class="s2">&quot;typeclass&quot;</span><span class="p">:</span> <span class="s2">&quot;evennia.contrib.tutorial_world.objects.Weapon&quot;</span><span class="p">,</span>
<span class="s2">&quot;typeclass&quot;</span><span class="p">:</span> <span class="s2">&quot;evennia.contrib.tutorial_world.objects.TutorialWeapon&quot;</span><span class="p">,</span>
<span class="s2">&quot;key&quot;</span><span class="p">:</span> <span class="s2">&quot;Weapon&quot;</span><span class="p">,</span>
<span class="s2">&quot;hit&quot;</span><span class="p">:</span> <span class="mf">0.2</span><span class="p">,</span>
<span class="s2">&quot;parry&quot;</span><span class="p">:</span> <span class="mf">0.2</span><span class="p">,</span>
@ -1168,7 +1168,7 @@
<span class="bp">self</span><span class="o">.</span><span class="n">add</span><span class="p">(</span><span class="n">CmdGetWeapon</span><span class="p">())</span></div></div>
<div class="viewcode-block" id="WeaponRack"><a class="viewcode-back" href="../../../../api/evennia.contrib.tutorial_world.objects.html#evennia.contrib.tutorial_world.objects.WeaponRack">[docs]</a><span class="k">class</span> <span class="nc">WeaponRack</span><span class="p">(</span><span class="n">TutorialObject</span><span class="p">):</span>
<div class="viewcode-block" id="TutorialWeaponRack"><a class="viewcode-back" href="../../../../api/evennia.contrib.tutorial_world.objects.html#evennia.contrib.tutorial_world.objects.TutorialWeaponRack">[docs]</a><span class="k">class</span> <span class="nc">TutorialWeaponRack</span><span class="p">(</span><span class="n">TutorialObject</span><span class="p">):</span>
<span class="sd">&quot;&quot;&quot;</span>
<span class="sd"> This object represents a weapon store. When people use the</span>
<span class="sd"> &quot;get weapon&quot; command on this rack, it will produce one</span>
@ -1185,7 +1185,7 @@
<span class="sd"> &quot;&quot;&quot;</span>
<div class="viewcode-block" id="WeaponRack.at_object_creation"><a class="viewcode-back" href="../../../../api/evennia.contrib.tutorial_world.objects.html#evennia.contrib.tutorial_world.objects.WeaponRack.at_object_creation">[docs]</a> <span class="k">def</span> <span class="nf">at_object_creation</span><span class="p">(</span><span class="bp">self</span><span class="p">):</span>
<div class="viewcode-block" id="TutorialWeaponRack.at_object_creation"><a class="viewcode-back" href="../../../../api/evennia.contrib.tutorial_world.objects.html#evennia.contrib.tutorial_world.objects.TutorialWeaponRack.at_object_creation">[docs]</a> <span class="k">def</span> <span class="nf">at_object_creation</span><span class="p">(</span><span class="bp">self</span><span class="p">):</span>
<span class="sd">&quot;&quot;&quot;</span>
<span class="sd"> called at creation</span>
<span class="sd"> &quot;&quot;&quot;</span>
@ -1204,7 +1204,7 @@
<span class="bp">self</span><span class="o">.</span><span class="n">db</span><span class="o">.</span><span class="n">no_more_weapons_msg</span> <span class="o">=</span> <span class="s2">&quot;you find nothing else of use.&quot;</span>
<span class="bp">self</span><span class="o">.</span><span class="n">db</span><span class="o">.</span><span class="n">available_weapons</span> <span class="o">=</span> <span class="p">[</span><span class="s2">&quot;knife&quot;</span><span class="p">,</span> <span class="s2">&quot;dagger&quot;</span><span class="p">,</span> <span class="s2">&quot;sword&quot;</span><span class="p">,</span> <span class="s2">&quot;club&quot;</span><span class="p">]</span></div>
<div class="viewcode-block" id="WeaponRack.produce_weapon"><a class="viewcode-back" href="../../../../api/evennia.contrib.tutorial_world.objects.html#evennia.contrib.tutorial_world.objects.WeaponRack.produce_weapon">[docs]</a> <span class="k">def</span> <span class="nf">produce_weapon</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">caller</span><span class="p">):</span>
<div class="viewcode-block" id="TutorialWeaponRack.produce_weapon"><a class="viewcode-back" href="../../../../api/evennia.contrib.tutorial_world.objects.html#evennia.contrib.tutorial_world.objects.TutorialWeaponRack.produce_weapon">[docs]</a> <span class="k">def</span> <span class="nf">produce_weapon</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">caller</span><span class="p">):</span>
<span class="sd">&quot;&quot;&quot;</span>
<span class="sd"> This will produce a new weapon from the rack,</span>
<span class="sd"> assuming the caller hasn&#39;t already gotten one. When</span>

View file

@ -114,7 +114,8 @@
<span class="n">db_tags</span> <span class="o">=</span> <span class="n">models</span><span class="o">.</span><span class="n">ManyToManyField</span><span class="p">(</span>
<span class="n">Tag</span><span class="p">,</span>
<span class="n">blank</span><span class="o">=</span><span class="kc">True</span><span class="p">,</span>
<span class="n">help_text</span><span class="o">=</span><span class="s2">&quot;tags on this object. Tags are simple string markers to identify, group and alias objects.&quot;</span><span class="p">,</span>
<span class="n">help_text</span><span class="o">=</span><span class="s2">&quot;tags on this object. Tags are simple string markers to &quot;</span>
<span class="s2">&quot;identify, group and alias objects.&quot;</span><span class="p">,</span>
<span class="p">)</span>
<span class="c1"># (deprecated, only here to allow MUX helpfile load (don&#39;t use otherwise)).</span>
<span class="c1"># TODO: remove this when not needed anymore.</span>
@ -164,6 +165,19 @@
<span class="sd"> &quot;&quot;&quot;</span>
<span class="k">return</span> <span class="bp">self</span><span class="o">.</span><span class="n">locks</span><span class="o">.</span><span class="n">check</span><span class="p">(</span><span class="n">accessing_obj</span><span class="p">,</span> <span class="n">access_type</span><span class="o">=</span><span class="n">access_type</span><span class="p">,</span> <span class="n">default</span><span class="o">=</span><span class="n">default</span><span class="p">)</span></div>
<span class="nd">@property</span>
<span class="k">def</span> <span class="nf">search_index_entry</span><span class="p">(</span><span class="bp">self</span><span class="p">):</span>
<span class="sd">&quot;&quot;&quot;</span>
<span class="sd"> Property for easily retaining a search index entry for this object.</span>
<span class="sd"> &quot;&quot;&quot;</span>
<span class="k">return</span> <span class="p">{</span>
<span class="s2">&quot;key&quot;</span><span class="p">:</span> <span class="bp">self</span><span class="o">.</span><span class="n">db_key</span><span class="p">,</span>
<span class="s2">&quot;aliases&quot;</span><span class="p">:</span> <span class="s2">&quot; &quot;</span><span class="o">.</span><span class="n">join</span><span class="p">(</span><span class="bp">self</span><span class="o">.</span><span class="n">aliases</span><span class="o">.</span><span class="n">all</span><span class="p">()),</span>
<span class="s2">&quot;category&quot;</span><span class="p">:</span> <span class="bp">self</span><span class="o">.</span><span class="n">db_help_category</span><span class="p">,</span>
<span class="s2">&quot;text&quot;</span><span class="p">:</span> <span class="bp">self</span><span class="o">.</span><span class="n">db_entrytext</span><span class="p">,</span>
<span class="s2">&quot;tags&quot;</span><span class="p">:</span> <span class="s2">&quot; &quot;</span><span class="o">.</span><span class="n">join</span><span class="p">(</span><span class="nb">str</span><span class="p">(</span><span class="n">tag</span><span class="p">)</span> <span class="k">for</span> <span class="n">tag</span> <span class="ow">in</span> <span class="bp">self</span><span class="o">.</span><span class="n">tags</span><span class="o">.</span><span class="n">all</span><span class="p">()),</span>
<span class="p">}</span>
<span class="c1">#</span>
<span class="c1"># Web/Django methods</span>
<span class="c1">#</span>

View file

@ -580,8 +580,6 @@
<span class="sd"> Only true if accessed_obj has the specified tag and optional</span>
<span class="sd"> category.</span>
<span class="sd"> &quot;&quot;&quot;</span>
<span class="k">if</span> <span class="nb">hasattr</span><span class="p">(</span><span class="n">accessed_obj</span><span class="p">,</span> <span class="s2">&quot;obj&quot;</span><span class="p">):</span>
<span class="n">accessed_obj</span> <span class="o">=</span> <span class="n">accessed_obj</span><span class="o">.</span><span class="n">obj</span>
<span class="n">tagkey</span> <span class="o">=</span> <span class="n">args</span><span class="p">[</span><span class="mi">0</span><span class="p">]</span> <span class="k">if</span> <span class="n">args</span> <span class="k">else</span> <span class="kc">None</span>
<span class="n">category</span> <span class="o">=</span> <span class="n">args</span><span class="p">[</span><span class="mi">1</span><span class="p">]</span> <span class="k">if</span> <span class="nb">len</span><span class="p">(</span><span class="n">args</span><span class="p">)</span> <span class="o">&gt;</span> <span class="mi">1</span> <span class="k">else</span> <span class="kc">None</span>
<span class="k">return</span> <span class="nb">bool</span><span class="p">(</span><span class="n">accessed_obj</span><span class="o">.</span><span class="n">tags</span><span class="o">.</span><span class="n">get</span><span class="p">(</span><span class="n">tagkey</span><span class="p">,</span> <span class="n">category</span><span class="o">=</span><span class="n">category</span><span class="p">))</span></div>
@ -613,9 +611,6 @@
<span class="sd"> in your inventory will also pass the lock).</span>
<span class="sd"> &quot;&quot;&quot;</span>
<span class="k">if</span> <span class="nb">hasattr</span><span class="p">(</span><span class="n">accessed_obj</span><span class="p">,</span> <span class="s2">&quot;obj&quot;</span><span class="p">):</span>
<span class="n">accessed_obj</span> <span class="o">=</span> <span class="n">accessed_obj</span><span class="o">.</span><span class="n">obj</span>
<span class="k">def</span> <span class="nf">_recursive_inside</span><span class="p">(</span><span class="n">obj</span><span class="p">,</span> <span class="n">accessed_obj</span><span class="p">,</span> <span class="n">lvl</span><span class="o">=</span><span class="mi">1</span><span class="p">):</span>
<span class="k">if</span> <span class="n">obj</span><span class="o">.</span><span class="n">location</span><span class="p">:</span>
<span class="k">if</span> <span class="n">obj</span><span class="o">.</span><span class="n">location</span> <span class="o">==</span> <span class="n">accessed_obj</span><span class="p">:</span>

View file

@ -54,6 +54,7 @@
<span class="sd">the database object. Like everything else, they can be accessed</span>
<span class="sd">transparently through the decorating TypeClass.</span>
<span class="sd">&quot;&quot;&quot;</span>
<span class="kn">from</span> <span class="nn">collections</span> <span class="k">import</span> <span class="n">defaultdict</span>
<span class="kn">from</span> <span class="nn">django.conf</span> <span class="k">import</span> <span class="n">settings</span>
<span class="kn">from</span> <span class="nn">django.db</span> <span class="k">import</span> <span class="n">models</span>
<span class="kn">from</span> <span class="nn">django.core.exceptions</span> <span class="k">import</span> <span class="n">ObjectDoesNotExist</span>
@ -83,34 +84,49 @@
<span class="sd"> &quot;&quot;&quot;</span>
<span class="bp">self</span><span class="o">.</span><span class="n">obj</span> <span class="o">=</span> <span class="n">obj</span>
<span class="bp">self</span><span class="o">.</span><span class="n">_pkcache</span> <span class="o">=</span> <span class="p">{}</span>
<span class="bp">self</span><span class="o">.</span><span class="n">_pkcache</span> <span class="o">=</span> <span class="nb">set</span><span class="p">()</span>
<span class="bp">self</span><span class="o">.</span><span class="n">_idcache</span> <span class="o">=</span> <span class="n">obj</span><span class="o">.</span><span class="vm">__class__</span><span class="o">.</span><span class="n">__instance_cache__</span>
<span class="bp">self</span><span class="o">.</span><span class="n">_typecache</span> <span class="o">=</span> <span class="n">defaultdict</span><span class="p">(</span><span class="nb">set</span><span class="p">)</span>
<span class="bp">self</span><span class="o">.</span><span class="n">init</span><span class="p">()</span></div>
<div class="viewcode-block" id="ContentsHandler.load"><a class="viewcode-back" href="../../../api/evennia.objects.models.html#evennia.objects.admin.ContentsHandler.load">[docs]</a> <span class="k">def</span> <span class="nf">load</span><span class="p">(</span><span class="bp">self</span><span class="p">):</span>
<span class="sd">&quot;&quot;&quot;</span>
<span class="sd"> Retrieves all objects from database. Used for initializing.</span>
<span class="sd"> Returns:</span>
<span class="sd"> Objects (list of ObjectDB)</span>
<span class="sd"> &quot;&quot;&quot;</span>
<span class="k">return</span> <span class="nb">list</span><span class="p">(</span><span class="bp">self</span><span class="o">.</span><span class="n">obj</span><span class="o">.</span><span class="n">locations_set</span><span class="o">.</span><span class="n">all</span><span class="p">())</span></div>
<div class="viewcode-block" id="ContentsHandler.init"><a class="viewcode-back" href="../../../api/evennia.objects.models.html#evennia.objects.admin.ContentsHandler.init">[docs]</a> <span class="k">def</span> <span class="nf">init</span><span class="p">(</span><span class="bp">self</span><span class="p">):</span>
<span class="sd">&quot;&quot;&quot;</span>
<span class="sd"> Re-initialize the content cache</span>
<span class="sd"> &quot;&quot;&quot;</span>
<span class="bp">self</span><span class="o">.</span><span class="n">_pkcache</span><span class="o">.</span><span class="n">update</span><span class="p">(</span>
<span class="nb">dict</span><span class="p">((</span><span class="n">obj</span><span class="o">.</span><span class="n">pk</span><span class="p">,</span> <span class="kc">None</span><span class="p">)</span> <span class="k">for</span> <span class="n">obj</span> <span class="ow">in</span> <span class="n">ObjectDB</span><span class="o">.</span><span class="n">objects</span><span class="o">.</span><span class="n">filter</span><span class="p">(</span><span class="n">db_location</span><span class="o">=</span><span class="bp">self</span><span class="o">.</span><span class="n">obj</span><span class="p">)</span> <span class="k">if</span> <span class="n">obj</span><span class="o">.</span><span class="n">pk</span><span class="p">)</span>
<span class="p">)</span></div>
<span class="n">objects</span> <span class="o">=</span> <span class="bp">self</span><span class="o">.</span><span class="n">load</span><span class="p">()</span>
<span class="bp">self</span><span class="o">.</span><span class="n">_pkcache</span> <span class="o">=</span> <span class="p">{</span><span class="n">obj</span><span class="o">.</span><span class="n">pk</span> <span class="k">for</span> <span class="n">obj</span> <span class="ow">in</span> <span class="n">objects</span><span class="p">}</span>
<span class="k">for</span> <span class="n">obj</span> <span class="ow">in</span> <span class="n">objects</span><span class="p">:</span>
<span class="k">for</span> <span class="n">ctype</span> <span class="ow">in</span> <span class="n">obj</span><span class="o">.</span><span class="n">_content_types</span><span class="p">:</span>
<span class="bp">self</span><span class="o">.</span><span class="n">_typecache</span><span class="p">[</span><span class="n">ctype</span><span class="p">]</span><span class="o">.</span><span class="n">add</span><span class="p">(</span><span class="n">obj</span><span class="o">.</span><span class="n">pk</span><span class="p">)</span></div>
<div class="viewcode-block" id="ContentsHandler.get"><a class="viewcode-back" href="../../../api/evennia.objects.models.html#evennia.objects.admin.ContentsHandler.get">[docs]</a> <span class="k">def</span> <span class="nf">get</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">exclude</span><span class="o">=</span><span class="kc">None</span><span class="p">):</span>
<div class="viewcode-block" id="ContentsHandler.get"><a class="viewcode-back" href="../../../api/evennia.objects.models.html#evennia.objects.admin.ContentsHandler.get">[docs]</a> <span class="k">def</span> <span class="nf">get</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">exclude</span><span class="o">=</span><span class="kc">None</span><span class="p">,</span> <span class="n">content_type</span><span class="o">=</span><span class="kc">None</span><span class="p">):</span>
<span class="sd">&quot;&quot;&quot;</span>
<span class="sd"> Return the contents of the cache.</span>
<span class="sd"> Args:</span>
<span class="sd"> exclude (Object or list of Object): object(s) to ignore</span>
<span class="sd"> content_type (str or None): Filter list by a content-type. If None, don&#39;t filter.</span>
<span class="sd"> Returns:</span>
<span class="sd"> objects (list): the Objects inside this location</span>
<span class="sd"> &quot;&quot;&quot;</span>
<span class="k">if</span> <span class="n">exclude</span><span class="p">:</span>
<span class="n">pks</span> <span class="o">=</span> <span class="p">[</span><span class="n">pk</span> <span class="k">for</span> <span class="n">pk</span> <span class="ow">in</span> <span class="bp">self</span><span class="o">.</span><span class="n">_pkcache</span> <span class="k">if</span> <span class="n">pk</span> <span class="ow">not</span> <span class="ow">in</span> <span class="p">[</span><span class="n">excl</span><span class="o">.</span><span class="n">pk</span> <span class="k">for</span> <span class="n">excl</span> <span class="ow">in</span> <span class="n">make_iter</span><span class="p">(</span><span class="n">exclude</span><span class="p">)]]</span>
<span class="k">if</span> <span class="n">content_type</span> <span class="ow">is</span> <span class="ow">not</span> <span class="kc">None</span><span class="p">:</span>
<span class="n">pks</span> <span class="o">=</span> <span class="bp">self</span><span class="o">.</span><span class="n">_typecache</span><span class="p">[</span><span class="n">content_type</span><span class="p">]</span>
<span class="k">else</span><span class="p">:</span>
<span class="n">pks</span> <span class="o">=</span> <span class="bp">self</span><span class="o">.</span><span class="n">_pkcache</span>
<span class="k">if</span> <span class="n">exclude</span><span class="p">:</span>
<span class="n">pks</span> <span class="o">=</span> <span class="n">pks</span> <span class="o">-</span> <span class="p">{</span><span class="n">excl</span><span class="o">.</span><span class="n">pk</span> <span class="k">for</span> <span class="n">excl</span> <span class="ow">in</span> <span class="n">make_iter</span><span class="p">(</span><span class="n">exclude</span><span class="p">)}</span>
<span class="k">try</span><span class="p">:</span>
<span class="k">return</span> <span class="p">[</span><span class="bp">self</span><span class="o">.</span><span class="n">_idcache</span><span class="p">[</span><span class="n">pk</span><span class="p">]</span> <span class="k">for</span> <span class="n">pk</span> <span class="ow">in</span> <span class="n">pks</span><span class="p">]</span>
<span class="k">except</span> <span class="ne">KeyError</span><span class="p">:</span>
@ -120,10 +136,9 @@
<span class="k">try</span><span class="p">:</span>
<span class="k">return</span> <span class="p">[</span><span class="bp">self</span><span class="o">.</span><span class="n">_idcache</span><span class="p">[</span><span class="n">pk</span><span class="p">]</span> <span class="k">for</span> <span class="n">pk</span> <span class="ow">in</span> <span class="n">pks</span><span class="p">]</span>
<span class="k">except</span> <span class="ne">KeyError</span><span class="p">:</span>
<span class="c1"># this means the central instance_cache was totally flushed.</span>
<span class="c1"># Re-fetching from database will rebuild the necessary parts of the cache</span>
<span class="c1"># for next fetch.</span>
<span class="k">return</span> <span class="nb">list</span><span class="p">(</span><span class="n">ObjectDB</span><span class="o">.</span><span class="n">objects</span><span class="o">.</span><span class="n">filter</span><span class="p">(</span><span class="n">db_location</span><span class="o">=</span><span class="bp">self</span><span class="o">.</span><span class="n">obj</span><span class="p">))</span></div>
<span class="c1"># this means an actual failure of caching. Return real database match.</span>
<span class="n">logger</span><span class="o">.</span><span class="n">log_err</span><span class="p">(</span><span class="s2">&quot;contents cache failed for </span><span class="si">%s</span><span class="s2">.&quot;</span> <span class="o">%</span> <span class="bp">self</span><span class="o">.</span><span class="n">obj</span><span class="o">.</span><span class="n">key</span><span class="p">)</span>
<span class="k">return</span> <span class="bp">self</span><span class="o">.</span><span class="n">load</span><span class="p">()</span></div>
<div class="viewcode-block" id="ContentsHandler.add"><a class="viewcode-back" href="../../../api/evennia.objects.models.html#evennia.objects.admin.ContentsHandler.add">[docs]</a> <span class="k">def</span> <span class="nf">add</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">obj</span><span class="p">):</span>
<span class="sd">&quot;&quot;&quot;</span>
@ -133,7 +148,9 @@
<span class="sd"> obj (Object): object to add</span>
<span class="sd"> &quot;&quot;&quot;</span>
<span class="bp">self</span><span class="o">.</span><span class="n">_pkcache</span><span class="p">[</span><span class="n">obj</span><span class="o">.</span><span class="n">pk</span><span class="p">]</span> <span class="o">=</span> <span class="kc">None</span></div>
<span class="bp">self</span><span class="o">.</span><span class="n">_pkcache</span><span class="o">.</span><span class="n">add</span><span class="p">(</span><span class="n">obj</span><span class="o">.</span><span class="n">pk</span><span class="p">)</span>
<span class="k">for</span> <span class="n">ctype</span> <span class="ow">in</span> <span class="n">obj</span><span class="o">.</span><span class="n">_content_types</span><span class="p">:</span>
<span class="bp">self</span><span class="o">.</span><span class="n">_typecache</span><span class="p">[</span><span class="n">ctype</span><span class="p">]</span><span class="o">.</span><span class="n">add</span><span class="p">(</span><span class="n">obj</span><span class="o">.</span><span class="n">pk</span><span class="p">)</span></div>
<div class="viewcode-block" id="ContentsHandler.remove"><a class="viewcode-back" href="../../../api/evennia.objects.models.html#evennia.objects.admin.ContentsHandler.remove">[docs]</a> <span class="k">def</span> <span class="nf">remove</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">obj</span><span class="p">):</span>
<span class="sd">&quot;&quot;&quot;</span>
@ -143,7 +160,10 @@
<span class="sd"> obj (Object): object to remove</span>
<span class="sd"> &quot;&quot;&quot;</span>
<span class="bp">self</span><span class="o">.</span><span class="n">_pkcache</span><span class="o">.</span><span class="n">pop</span><span class="p">(</span><span class="n">obj</span><span class="o">.</span><span class="n">pk</span><span class="p">,</span> <span class="kc">None</span><span class="p">)</span></div>
<span class="bp">self</span><span class="o">.</span><span class="n">_pkcache</span><span class="o">.</span><span class="n">remove</span><span class="p">(</span><span class="n">obj</span><span class="o">.</span><span class="n">pk</span><span class="p">)</span>
<span class="k">for</span> <span class="n">ctype</span> <span class="ow">in</span> <span class="n">obj</span><span class="o">.</span><span class="n">_content_types</span><span class="p">:</span>
<span class="k">if</span> <span class="n">obj</span><span class="o">.</span><span class="n">pk</span> <span class="ow">in</span> <span class="bp">self</span><span class="o">.</span><span class="n">_typecache</span><span class="p">[</span><span class="n">ctype</span><span class="p">]:</span>
<span class="bp">self</span><span class="o">.</span><span class="n">_typecache</span><span class="p">[</span><span class="n">ctype</span><span class="p">]</span><span class="o">.</span><span class="n">remove</span><span class="p">(</span><span class="n">obj</span><span class="o">.</span><span class="n">pk</span><span class="p">)</span></div>
<div class="viewcode-block" id="ContentsHandler.clear"><a class="viewcode-back" href="../../../api/evennia.objects.models.html#evennia.objects.admin.ContentsHandler.clear">[docs]</a> <span class="k">def</span> <span class="nf">clear</span><span class="p">(</span><span class="bp">self</span><span class="p">):</span>
<span class="sd">&quot;&quot;&quot;</span>
@ -151,6 +171,7 @@
<span class="sd"> &quot;&quot;&quot;</span>
<span class="bp">self</span><span class="o">.</span><span class="n">_pkcache</span> <span class="o">=</span> <span class="p">{}</span>
<span class="bp">self</span><span class="o">.</span><span class="n">_typecache</span> <span class="o">=</span> <span class="n">defaultdict</span><span class="p">(</span><span class="nb">set</span><span class="p">)</span>
<span class="bp">self</span><span class="o">.</span><span class="n">init</span><span class="p">()</span></div></div>

View file

@ -53,7 +53,7 @@
<span class="kn">from</span> <span class="nn">django.conf</span> <span class="k">import</span> <span class="n">settings</span>
<span class="kn">from</span> <span class="nn">evennia.typeclasses.models</span> <span class="k">import</span> <span class="n">TypeclassBase</span>
<span class="kn">from</span> <span class="nn">evennia.typeclasses.attributes</span> <span class="k">import</span> <span class="n">NickHandler</span>
<span class="kn">from</span> <span class="nn">evennia.typeclasses.attributes</span> <span class="k">import</span> <span class="n">NickHandler</span><span class="p">,</span> <span class="n">ModelAttributeBackend</span>
<span class="kn">from</span> <span class="nn">evennia.objects.manager</span> <span class="k">import</span> <span class="n">ObjectManager</span>
<span class="kn">from</span> <span class="nn">evennia.objects.models</span> <span class="k">import</span> <span class="n">ObjectDB</span>
<span class="kn">from</span> <span class="nn">evennia.scripts.scripthandler</span> <span class="k">import</span> <span class="n">ScriptHandler</span>
@ -245,6 +245,9 @@
<span class="sd"> &quot;&quot;&quot;</span>
<span class="c1"># Used for sorting / filtering in inventories / room contents.</span>
<span class="n">_content_types</span> <span class="o">=</span> <span class="p">(</span><span class="s2">&quot;object&quot;</span><span class="p">,)</span>
<span class="c1"># lockstring of newly created objects, for easy overloading.</span>
<span class="c1"># Will be formatted with the appropriate attributes.</span>
<span class="n">lockstring</span> <span class="o">=</span> <span class="s2">&quot;control:id(</span><span class="si">{account_id}</span><span class="s2">) or perm(Admin);delete:id(</span><span class="si">{account_id}</span><span class="s2">) or perm(Admin)&quot;</span>
@ -263,7 +266,7 @@
<div class="viewcode-block" id="DefaultObject.nicks"><a class="viewcode-back" href="../../../api/evennia.objects.objects.html#evennia.objects.objects.DefaultObject.nicks">[docs]</a> <span class="nd">@lazy_property</span>
<span class="k">def</span> <span class="nf">nicks</span><span class="p">(</span><span class="bp">self</span><span class="p">):</span>
<span class="k">return</span> <span class="n">NickHandler</span><span class="p">(</span><span class="bp">self</span><span class="p">)</span></div>
<span class="k">return</span> <span class="n">NickHandler</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">ModelAttributeBackend</span><span class="p">)</span></div>
<div class="viewcode-block" id="DefaultObject.sessions"><a class="viewcode-back" href="../../../api/evennia.objects.objects.html#evennia.objects.objects.DefaultObject.sessions">[docs]</a> <span class="nd">@lazy_property</span>
<span class="k">def</span> <span class="nf">sessions</span><span class="p">(</span><span class="bp">self</span><span class="p">):</span>
@ -298,7 +301,7 @@
<span class="ow">and</span> <span class="ow">not</span> <span class="bp">self</span><span class="o">.</span><span class="n">db_account</span><span class="o">.</span><span class="n">attributes</span><span class="o">.</span><span class="n">get</span><span class="p">(</span><span class="s2">&quot;_quell&quot;</span><span class="p">)</span>
<span class="p">)</span>
<div class="viewcode-block" id="DefaultObject.contents_get"><a class="viewcode-back" href="../../../api/evennia.objects.objects.html#evennia.objects.objects.DefaultObject.contents_get">[docs]</a> <span class="k">def</span> <span class="nf">contents_get</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">exclude</span><span class="o">=</span><span class="kc">None</span><span class="p">):</span>
<div class="viewcode-block" id="DefaultObject.contents_get"><a class="viewcode-back" href="../../../api/evennia.objects.objects.html#evennia.objects.objects.DefaultObject.contents_get">[docs]</a> <span class="k">def</span> <span class="nf">contents_get</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">exclude</span><span class="o">=</span><span class="kc">None</span><span class="p">,</span> <span class="n">content_type</span><span class="o">=</span><span class="kc">None</span><span class="p">):</span>
<span class="sd">&quot;&quot;&quot;</span>
<span class="sd"> Returns the contents of this object, i.e. all</span>
<span class="sd"> objects that has this object set as its location.</span>
@ -307,17 +310,18 @@
<span class="sd"> Args:</span>
<span class="sd"> exclude (Object): Object to exclude from returned</span>
<span class="sd"> contents list</span>
<span class="sd"> content_type (str): A content_type to filter by. None for no</span>
<span class="sd"> filtering.</span>
<span class="sd"> Returns:</span>
<span class="sd"> contents (list): List of contents of this Object.</span>
<span class="sd"> Notes:</span>
<span class="sd"> Also available as the `contents` property.</span>
<span class="sd"> Also available as the `contents` property, minus exclusion</span>
<span class="sd"> and filtering.</span>
<span class="sd"> &quot;&quot;&quot;</span>
<span class="n">con</span> <span class="o">=</span> <span class="bp">self</span><span class="o">.</span><span class="n">contents_cache</span><span class="o">.</span><span class="n">get</span><span class="p">(</span><span class="n">exclude</span><span class="o">=</span><span class="n">exclude</span><span class="p">)</span>
<span class="c1"># print &quot;contents_get:&quot;, self, con, id(self), calledby() # DEBUG</span>
<span class="k">return</span> <span class="n">con</span></div>
<span class="k">return</span> <span class="bp">self</span><span class="o">.</span><span class="n">contents_cache</span><span class="o">.</span><span class="n">get</span><span class="p">(</span><span class="n">exclude</span><span class="o">=</span><span class="n">exclude</span><span class="p">,</span> <span class="n">content_type</span><span class="o">=</span><span class="n">content_type</span><span class="p">)</span></div>
<div class="viewcode-block" id="DefaultObject.contents_set"><a class="viewcode-back" href="../../../api/evennia.objects.objects.html#evennia.objects.objects.DefaultObject.contents_set">[docs]</a> <span class="k">def</span> <span class="nf">contents_set</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="o">*</span><span class="n">args</span><span class="p">):</span>
<span class="s2">&quot;You cannot replace this property&quot;</span>
@ -413,6 +417,7 @@
<span class="n">nofound_string</span><span class="o">=</span><span class="kc">None</span><span class="p">,</span>
<span class="n">multimatch_string</span><span class="o">=</span><span class="kc">None</span><span class="p">,</span>
<span class="n">use_dbref</span><span class="o">=</span><span class="kc">None</span><span class="p">,</span>
<span class="n">stacked</span><span class="o">=</span><span class="mi">0</span><span class="p">,</span>
<span class="p">):</span>
<span class="sd">&quot;&quot;&quot;</span>
<span class="sd"> Returns an Object matching a search string/condition</span>
@ -468,10 +473,19 @@
<span class="sd"> will be treated like a normal string. If `None` (default), the ability to query by</span>
<span class="sd"> #dbref is turned on if `self` has the permission &#39;Builder&#39; and is turned off</span>
<span class="sd"> otherwise.</span>
<span class="sd"> stacked (int, optional): If &gt; 0, multimatches will be analyzed to determine if they</span>
<span class="sd"> only contains identical objects; these are then assumed &#39;stacked&#39; and no multi-match</span>
<span class="sd"> error will be generated, instead `stacked` number of matches will be returned. If</span>
<span class="sd"> `stacked` is larger than number of matches, returns that number of matches. If</span>
<span class="sd"> the found stack is a mix of objects, return None and handle the multi-match</span>
<span class="sd"> error depending on the value of `quiet`.</span>
<span class="sd"> Returns:</span>
<span class="sd"> match (Object, None or list): will return an Object/None if `quiet=False`,</span>
<span class="sd"> otherwise it will return a list of 0, 1 or more matches.</span>
<span class="sd"> Object: If finding a match an `quiet=False`</span>
<span class="sd"> None: If not finding a unique match and `quiet=False`.</span>
<span class="sd"> list: With 0, 1 or more matching objects if `quiet=True`</span>
<span class="sd"> list: With 2 or more matching objects if `stacked` is a positive integer and</span>
<span class="sd"> the matched stack has only object-copies.</span>
<span class="sd"> Notes:</span>
<span class="sd"> To find Accounts, use eg. `evennia.account_search`. If</span>
@ -539,8 +553,29 @@
<span class="n">use_dbref</span><span class="o">=</span><span class="n">use_dbref</span><span class="p">,</span>
<span class="p">)</span>
<span class="n">nresults</span> <span class="o">=</span> <span class="nb">len</span><span class="p">(</span><span class="n">results</span><span class="p">)</span>
<span class="k">if</span> <span class="n">stacked</span> <span class="o">&gt;</span> <span class="mi">0</span> <span class="ow">and</span> <span class="n">nresults</span> <span class="o">&gt;</span> <span class="mi">1</span><span class="p">:</span>
<span class="c1"># handle stacks, disable multimatch errors</span>
<span class="n">nstack</span> <span class="o">=</span> <span class="n">nresults</span>
<span class="k">if</span> <span class="ow">not</span> <span class="n">exact</span><span class="p">:</span>
<span class="c1"># we re-run exact match agains one of the matches to</span>
<span class="c1"># make sure we were not catching partial matches not belonging</span>
<span class="c1"># to the stack</span>
<span class="n">nstack</span> <span class="o">=</span> <span class="nb">len</span><span class="p">(</span><span class="n">ObjectDB</span><span class="o">.</span><span class="n">objects</span><span class="o">.</span><span class="n">get_objs_with_key_or_alias</span><span class="p">(</span>
<span class="n">results</span><span class="p">[</span><span class="mi">0</span><span class="p">]</span><span class="o">.</span><span class="n">key</span><span class="p">,</span>
<span class="n">exact</span><span class="o">=</span><span class="kc">True</span><span class="p">,</span>
<span class="n">candidates</span><span class="o">=</span><span class="nb">list</span><span class="p">(</span><span class="n">results</span><span class="p">),</span>
<span class="n">typeclasses</span><span class="o">=</span><span class="p">[</span><span class="n">typeclass</span><span class="p">]</span> <span class="k">if</span> <span class="n">typeclass</span> <span class="k">else</span> <span class="kc">None</span>
<span class="p">))</span>
<span class="k">if</span> <span class="n">nstack</span> <span class="o">==</span> <span class="n">nresults</span><span class="p">:</span>
<span class="c1"># a valid stack, return multiple results</span>
<span class="k">return</span> <span class="nb">list</span><span class="p">(</span><span class="n">results</span><span class="p">)[:</span><span class="n">stacked</span><span class="p">]</span>
<span class="k">if</span> <span class="n">quiet</span><span class="p">:</span>
<span class="c1"># don&#39;t auto-handle error messaging</span>
<span class="k">return</span> <span class="nb">list</span><span class="p">(</span><span class="n">results</span><span class="p">)</span>
<span class="c1"># handle error messages</span>
<span class="k">return</span> <span class="n">_AT_SEARCH_RESULT</span><span class="p">(</span>
<span class="n">results</span><span class="p">,</span>
<span class="bp">self</span><span class="p">,</span>
@ -1697,20 +1732,26 @@
<span class="sd"> **kwargs (dict): Arbitrary, optional arguments for users</span>
<span class="sd"> overriding the call (unused by default).</span>
<span class="sd"> &quot;&quot;&quot;</span>
<span class="k">def</span> <span class="nf">filter_visible</span><span class="p">(</span><span class="n">obj_list</span><span class="p">):</span>
<span class="c1"># Helper method to determine if objects are visible to the looker.</span>
<span class="k">return</span> <span class="p">[</span><span class="n">obj</span> <span class="k">for</span> <span class="n">obj</span> <span class="ow">in</span> <span class="n">obj_list</span> <span class="k">if</span> <span class="n">obj</span> <span class="o">!=</span> <span class="n">looker</span> <span class="ow">and</span> <span class="n">obj</span><span class="o">.</span><span class="n">access</span><span class="p">(</span><span class="n">looker</span><span class="p">,</span> <span class="s2">&quot;view&quot;</span><span class="p">)]</span>
<span class="k">if</span> <span class="ow">not</span> <span class="n">looker</span><span class="p">:</span>
<span class="k">return</span> <span class="s2">&quot;&quot;</span>
<span class="c1"># get and identify all objects</span>
<span class="n">visible</span> <span class="o">=</span> <span class="p">(</span><span class="n">con</span> <span class="k">for</span> <span class="n">con</span> <span class="ow">in</span> <span class="bp">self</span><span class="o">.</span><span class="n">contents</span> <span class="k">if</span> <span class="n">con</span> <span class="o">!=</span> <span class="n">looker</span> <span class="ow">and</span> <span class="n">con</span><span class="o">.</span><span class="n">access</span><span class="p">(</span><span class="n">looker</span><span class="p">,</span> <span class="s2">&quot;view&quot;</span><span class="p">))</span>
<span class="n">exits</span><span class="p">,</span> <span class="n">users</span><span class="p">,</span> <span class="n">things</span> <span class="o">=</span> <span class="p">[],</span> <span class="p">[],</span> <span class="n">defaultdict</span><span class="p">(</span><span class="nb">list</span><span class="p">)</span>
<span class="k">for</span> <span class="n">con</span> <span class="ow">in</span> <span class="n">visible</span><span class="p">:</span>
<span class="n">key</span> <span class="o">=</span> <span class="n">con</span><span class="o">.</span><span class="n">get_display_name</span><span class="p">(</span><span class="n">looker</span><span class="p">)</span>
<span class="k">if</span> <span class="n">con</span><span class="o">.</span><span class="n">destination</span><span class="p">:</span>
<span class="n">exits</span><span class="o">.</span><span class="n">append</span><span class="p">(</span><span class="n">key</span><span class="p">)</span>
<span class="k">elif</span> <span class="n">con</span><span class="o">.</span><span class="n">has_account</span><span class="p">:</span>
<span class="n">users</span><span class="o">.</span><span class="n">append</span><span class="p">(</span><span class="s2">&quot;|c</span><span class="si">%s</span><span class="s2">|n&quot;</span> <span class="o">%</span> <span class="n">key</span><span class="p">)</span>
<span class="k">else</span><span class="p">:</span>
<span class="c1"># things can be pluralized</span>
<span class="n">things</span><span class="p">[</span><span class="n">key</span><span class="p">]</span><span class="o">.</span><span class="n">append</span><span class="p">(</span><span class="n">con</span><span class="p">)</span>
<span class="n">exits_list</span> <span class="o">=</span> <span class="n">filter_visible</span><span class="p">(</span><span class="bp">self</span><span class="o">.</span><span class="n">contents_get</span><span class="p">(</span><span class="n">content_type</span><span class="o">=</span><span class="s2">&quot;exit&quot;</span><span class="p">))</span>
<span class="n">users_list</span> <span class="o">=</span> <span class="n">filter_visible</span><span class="p">(</span><span class="bp">self</span><span class="o">.</span><span class="n">contents_get</span><span class="p">(</span><span class="n">content_type</span><span class="o">=</span><span class="s2">&quot;character&quot;</span><span class="p">))</span>
<span class="n">things_list</span> <span class="o">=</span> <span class="n">filter_visible</span><span class="p">(</span><span class="bp">self</span><span class="o">.</span><span class="n">contents_get</span><span class="p">(</span><span class="n">content_type</span><span class="o">=</span><span class="s2">&quot;object&quot;</span><span class="p">))</span>
<span class="n">things</span> <span class="o">=</span> <span class="n">defaultdict</span><span class="p">(</span><span class="nb">list</span><span class="p">)</span>
<span class="k">for</span> <span class="n">thing</span> <span class="ow">in</span> <span class="n">things_list</span><span class="p">:</span>
<span class="n">things</span><span class="p">[</span><span class="n">thing</span><span class="o">.</span><span class="n">key</span><span class="p">]</span><span class="o">.</span><span class="n">append</span><span class="p">(</span><span class="n">thing</span><span class="p">)</span>
<span class="n">users</span> <span class="o">=</span> <span class="p">[</span><span class="n">f</span><span class="s2">&quot;|c</span><span class="si">{user.key}</span><span class="s2">|n&quot;</span> <span class="k">for</span> <span class="n">user</span> <span class="ow">in</span> <span class="n">users_list</span><span class="p">]</span>
<span class="n">exits</span> <span class="o">=</span> <span class="p">[</span><span class="n">ex</span><span class="o">.</span><span class="n">key</span> <span class="k">for</span> <span class="n">ex</span> <span class="ow">in</span> <span class="n">exits_list</span><span class="p">]</span>
<span class="c1"># get description, build string</span>
<span class="n">string</span> <span class="o">=</span> <span class="s2">&quot;|c</span><span class="si">%s</span><span class="s2">|n</span><span class="se">\n</span><span class="s2">&quot;</span> <span class="o">%</span> <span class="bp">self</span><span class="o">.</span><span class="n">get_display_name</span><span class="p">(</span><span class="n">looker</span><span class="p">)</span>
<span class="n">desc</span> <span class="o">=</span> <span class="bp">self</span><span class="o">.</span><span class="n">db</span><span class="o">.</span><span class="n">desc</span>
@ -2068,6 +2109,9 @@
<span class="sd"> &quot;&quot;&quot;</span>
<span class="c1"># Tuple of types used for indexing inventory contents. Characters generally wouldn&#39;t be in</span>
<span class="c1"># anyone&#39;s inventory, but this also governs displays in room contents.</span>
<span class="n">_content_types</span> <span class="o">=</span> <span class="p">(</span><span class="s2">&quot;character&quot;</span><span class="p">,)</span>
<span class="c1"># lockstring of newly created rooms, for easy overloading.</span>
<span class="c1"># Will be formatted with the appropriate attributes.</span>
<span class="n">lockstring</span> <span class="o">=</span> <span class="p">(</span>
@ -2107,6 +2151,13 @@
<span class="c1"># If no typeclass supplied, use this class</span>
<span class="n">kwargs</span><span class="p">[</span><span class="s2">&quot;typeclass&quot;</span><span class="p">]</span> <span class="o">=</span> <span class="n">kwargs</span><span class="o">.</span><span class="n">pop</span><span class="p">(</span><span class="s2">&quot;typeclass&quot;</span><span class="p">,</span> <span class="bp">cls</span><span class="p">)</span>
<span class="c1"># Normalize to latin characters and validate, if necessary, the supplied key</span>
<span class="n">key</span> <span class="o">=</span> <span class="bp">cls</span><span class="o">.</span><span class="n">normalize_name</span><span class="p">(</span><span class="n">key</span><span class="p">)</span>
<span class="k">if</span> <span class="ow">not</span> <span class="bp">cls</span><span class="o">.</span><span class="n">validate_name</span><span class="p">(</span><span class="n">key</span><span class="p">):</span>
<span class="n">errors</span><span class="o">.</span><span class="n">append</span><span class="p">(</span><span class="s2">&quot;Invalid character name.&quot;</span><span class="p">)</span>
<span class="k">return</span> <span class="n">obj</span><span class="p">,</span> <span class="n">errors</span>
<span class="c1"># Set the supplied key as the name of the intended object</span>
<span class="n">kwargs</span><span class="p">[</span><span class="s2">&quot;key&quot;</span><span class="p">]</span> <span class="o">=</span> <span class="n">key</span>
@ -2156,6 +2207,38 @@
<span class="k">return</span> <span class="n">obj</span><span class="p">,</span> <span class="n">errors</span></div>
<div class="viewcode-block" id="DefaultCharacter.normalize_name"><a class="viewcode-back" href="../../../api/evennia.objects.objects.html#evennia.objects.objects.DefaultCharacter.normalize_name">[docs]</a> <span class="nd">@classmethod</span>
<span class="k">def</span> <span class="nf">normalize_name</span><span class="p">(</span><span class="bp">cls</span><span class="p">,</span> <span class="n">name</span><span class="p">):</span>
<span class="sd">&quot;&quot;&quot;</span>
<span class="sd"> Normalize the character name prior to creating. Note that this should be refactored</span>
<span class="sd"> to support i18n for non-latin scripts, but as we (currently) have no bug reports requesting better</span>
<span class="sd"> support of non-latin character sets, requiring character names to be latinified is an acceptable option.</span>
<span class="sd"> Args:</span>
<span class="sd"> name (str) : The name of the character</span>
<span class="sd"> Returns:</span>
<span class="sd"> latin_name (str) : A valid name.</span>
<span class="sd"> &quot;&quot;&quot;</span>
<span class="kn">from</span> <span class="nn">evennia.utils.utils</span> <span class="k">import</span> <span class="n">latinify</span>
<span class="n">latin_name</span> <span class="o">=</span> <span class="n">latinify</span><span class="p">(</span><span class="n">name</span><span class="p">,</span> <span class="n">default</span><span class="o">=</span><span class="s2">&quot;X&quot;</span><span class="p">)</span>
<span class="k">return</span> <span class="n">latin_name</span></div>
<div class="viewcode-block" id="DefaultCharacter.validate_name"><a class="viewcode-back" href="../../../api/evennia.objects.objects.html#evennia.objects.objects.DefaultCharacter.validate_name">[docs]</a> <span class="nd">@classmethod</span>
<span class="k">def</span> <span class="nf">validate_name</span><span class="p">(</span><span class="bp">cls</span><span class="p">,</span> <span class="n">name</span><span class="p">):</span>
<span class="sd">&quot;&quot;&quot; Validate the character name prior to creating. Overload this function to add custom validators</span>
<span class="sd"> Args:</span>
<span class="sd"> name (str) : The name of the character</span>
<span class="sd"> Returns:</span>
<span class="sd"> valid (bool) : True if character creation should continue; False if it should fail</span>
<span class="sd"> &quot;&quot;&quot;</span>
<span class="k">return</span> <span class="kc">True</span> <span class="c1"># Default validator does not perform any operations</span></div>
<div class="viewcode-block" id="DefaultCharacter.basetype_setup"><a class="viewcode-back" href="../../../api/evennia.objects.objects.html#evennia.objects.objects.DefaultCharacter.basetype_setup">[docs]</a> <span class="k">def</span> <span class="nf">basetype_setup</span><span class="p">(</span><span class="bp">self</span><span class="p">):</span>
<span class="sd">&quot;&quot;&quot;</span>
<span class="sd"> Setup character-specific security.</span>
@ -2284,6 +2367,10 @@
<span class="sd"> location is always `None`.</span>
<span class="sd"> &quot;&quot;&quot;</span>
<span class="c1"># A tuple of strings used for indexing this object inside an inventory.</span>
<span class="c1"># Generally, a room isn&#39;t expected to HAVE a location, but maybe in some games?</span>
<span class="n">_content_types</span> <span class="o">=</span> <span class="p">(</span><span class="s2">&quot;room&quot;</span><span class="p">,)</span>
<span class="c1"># lockstring of newly created rooms, for easy overloading.</span>
<span class="c1"># Will be formatted with the {id} of the creating object.</span>
<span class="n">lockstring</span> <span class="o">=</span> <span class="p">(</span>
@ -2443,6 +2530,7 @@
<span class="sd"> &quot;&quot;&quot;</span>
<span class="n">_content_types</span> <span class="o">=</span> <span class="p">(</span><span class="s2">&quot;exit&quot;</span><span class="p">,)</span>
<span class="n">exit_command</span> <span class="o">=</span> <span class="n">ExitCommand</span>
<span class="n">priority</span> <span class="o">=</span> <span class="mi">101</span>

View file

@ -46,9 +46,11 @@
<span class="sd">&quot;&quot;&quot;</span>
<span class="kn">import</span> <span class="nn">os</span>
<span class="kn">from</span> <span class="nn">django.conf</span> <span class="k">import</span> <span class="n">settings</span>
<span class="kn">from</span> <span class="nn">evennia.server.portal</span> <span class="k">import</span> <span class="n">amp</span>
<span class="kn">from</span> <span class="nn">twisted.internet</span> <span class="k">import</span> <span class="n">protocol</span>
<span class="kn">from</span> <span class="nn">evennia.utils</span> <span class="k">import</span> <span class="n">logger</span>
<span class="kn">from</span> <span class="nn">evennia.utils.utils</span> <span class="k">import</span> <span class="n">class_from_module</span>
<div class="viewcode-block" id="AMPClientFactory"><a class="viewcode-back" href="../../../api/evennia.server.amp_client.html#evennia.server.amp_client.AMPClientFactory">[docs]</a><span class="k">class</span> <span class="nc">AMPClientFactory</span><span class="p">(</span><span class="n">protocol</span><span class="o">.</span><span class="n">ReconnectingClientFactory</span><span class="p">):</span>
@ -74,7 +76,7 @@
<span class="sd"> &quot;&quot;&quot;</span>
<span class="bp">self</span><span class="o">.</span><span class="n">server</span> <span class="o">=</span> <span class="n">server</span>
<span class="bp">self</span><span class="o">.</span><span class="n">protocol</span> <span class="o">=</span> <span class="n">AMPServerClientProtocol</span>
<span class="bp">self</span><span class="o">.</span><span class="n">protocol</span> <span class="o">=</span> <span class="n">class_from_module</span><span class="p">(</span><span class="n">settings</span><span class="o">.</span><span class="n">AMP_CLIENT_PROTOCOL_CLASS</span><span class="p">)</span>
<span class="bp">self</span><span class="o">.</span><span class="n">maxDelay</span> <span class="o">=</span> <span class="mi">10</span>
<span class="c1"># not really used unless connecting to multiple servers, but</span>
<span class="c1"># avoids having to check for its existence on the protocol</span>

View file

@ -528,7 +528,6 @@
<span class="sd"> Keyword Args:</span>
<span class="sd"> &lt;option name&gt;: an option to save</span>
<span class="sd"> &quot;&quot;&quot;</span>
<span class="n">account</span> <span class="o">=</span> <span class="n">session</span><span class="o">.</span><span class="n">account</span>

View file

@ -56,7 +56,7 @@
<span class="kn">import</span> <span class="nn">pickle</span>
<span class="kn">from</span> <span class="nn">twisted.internet.defer</span> <span class="k">import</span> <span class="n">DeferredList</span><span class="p">,</span> <span class="n">Deferred</span>
<span class="kn">from</span> <span class="nn">evennia.utils.utils</span> <span class="k">import</span> <span class="n">to_str</span><span class="p">,</span> <span class="n">variable_from_module</span>
<span class="kn">from</span> <span class="nn">evennia.utils.utils</span> <span class="k">import</span> <span class="n">variable_from_module</span>
<span class="c1"># delayed import</span>
<span class="n">_LOGGER</span> <span class="o">=</span> <span class="kc">None</span>

View file

@ -52,6 +52,7 @@
<span class="kn">from</span> <span class="nn">django.conf</span> <span class="k">import</span> <span class="n">settings</span>
<span class="kn">from</span> <span class="nn">subprocess</span> <span class="k">import</span> <span class="n">Popen</span><span class="p">,</span> <span class="n">STDOUT</span>
<span class="kn">from</span> <span class="nn">evennia.utils</span> <span class="k">import</span> <span class="n">logger</span>
<span class="kn">from</span> <span class="nn">evennia.utils.utils</span> <span class="k">import</span> <span class="n">class_from_module</span>
<span class="k">def</span> <span class="nf">_is_windows</span><span class="p">():</span>
@ -97,7 +98,7 @@
<span class="sd"> &quot;&quot;&quot;</span>
<span class="bp">self</span><span class="o">.</span><span class="n">portal</span> <span class="o">=</span> <span class="n">portal</span>
<span class="bp">self</span><span class="o">.</span><span class="n">protocol</span> <span class="o">=</span> <span class="n">AMPServerProtocol</span>
<span class="bp">self</span><span class="o">.</span><span class="n">protocol</span> <span class="o">=</span> <span class="n">class_from_module</span><span class="p">(</span><span class="n">settings</span><span class="o">.</span><span class="n">AMP_SERVER_PROTOCOL_CLASS</span><span class="p">)</span>
<span class="bp">self</span><span class="o">.</span><span class="n">broadcasts</span> <span class="o">=</span> <span class="p">[]</span>
<span class="bp">self</span><span class="o">.</span><span class="n">server_connection</span> <span class="o">=</span> <span class="kc">None</span>
<span class="bp">self</span><span class="o">.</span><span class="n">launcher_connection</span> <span class="o">=</span> <span class="kc">None</span>
@ -115,7 +116,7 @@
<span class="sd"> protocol (Protocol): The created protocol.</span>
<span class="sd"> &quot;&quot;&quot;</span>
<span class="bp">self</span><span class="o">.</span><span class="n">portal</span><span class="o">.</span><span class="n">amp_protocol</span> <span class="o">=</span> <span class="n">AMPServerProtocol</span><span class="p">()</span>
<span class="bp">self</span><span class="o">.</span><span class="n">portal</span><span class="o">.</span><span class="n">amp_protocol</span> <span class="o">=</span> <span class="bp">self</span><span class="o">.</span><span class="n">protocol</span><span class="p">()</span>
<span class="bp">self</span><span class="o">.</span><span class="n">portal</span><span class="o">.</span><span class="n">amp_protocol</span><span class="o">.</span><span class="n">factory</span> <span class="o">=</span> <span class="bp">self</span>
<span class="k">return</span> <span class="bp">self</span><span class="o">.</span><span class="n">portal</span><span class="o">.</span><span class="n">amp_protocol</span></div></div>

View file

@ -68,7 +68,7 @@
<span class="n">evennia</span><span class="o">.</span><span class="n">_init</span><span class="p">()</span>
<span class="kn">from</span> <span class="nn">evennia.utils.utils</span> <span class="k">import</span> <span class="n">get_evennia_version</span><span class="p">,</span> <span class="n">mod_import</span><span class="p">,</span> <span class="n">make_iter</span>
<span class="kn">from</span> <span class="nn">evennia.utils.utils</span> <span class="k">import</span> <span class="n">get_evennia_version</span><span class="p">,</span> <span class="n">mod_import</span><span class="p">,</span> <span class="n">make_iter</span><span class="p">,</span> <span class="n">class_from_module</span>
<span class="kn">from</span> <span class="nn">evennia.server.portal.portalsessionhandler</span> <span class="k">import</span> <span class="n">PORTAL_SESSIONS</span>
<span class="kn">from</span> <span class="nn">evennia.utils</span> <span class="k">import</span> <span class="n">logger</span>
<span class="kn">from</span> <span class="nn">evennia.server.webserver</span> <span class="k">import</span> <span class="n">EvenniaReverseProxyResource</span>
@ -327,6 +327,8 @@
<span class="kn">from</span> <span class="nn">evennia.server.portal</span> <span class="k">import</span> <span class="n">telnet</span>
<span class="n">_telnet_protocol</span> <span class="o">=</span> <span class="n">class_from_module</span><span class="p">(</span><span class="n">settings</span><span class="o">.</span><span class="n">TELNET_PROTOCOL_CLASS</span><span class="p">)</span>
<span class="k">for</span> <span class="n">interface</span> <span class="ow">in</span> <span class="n">TELNET_INTERFACES</span><span class="p">:</span>
<span class="n">ifacestr</span> <span class="o">=</span> <span class="s2">&quot;&quot;</span>
<span class="k">if</span> <span class="n">interface</span> <span class="ow">not</span> <span class="ow">in</span> <span class="p">(</span><span class="s2">&quot;0.0.0.0&quot;</span><span class="p">,</span> <span class="s2">&quot;::&quot;</span><span class="p">)</span> <span class="ow">or</span> <span class="nb">len</span><span class="p">(</span><span class="n">TELNET_INTERFACES</span><span class="p">)</span> <span class="o">&gt;</span> <span class="mi">1</span><span class="p">:</span>
@ -335,7 +337,7 @@
<span class="n">pstring</span> <span class="o">=</span> <span class="s2">&quot;</span><span class="si">%s</span><span class="s2">:</span><span class="si">%s</span><span class="s2">&quot;</span> <span class="o">%</span> <span class="p">(</span><span class="n">ifacestr</span><span class="p">,</span> <span class="n">port</span><span class="p">)</span>
<span class="n">factory</span> <span class="o">=</span> <span class="n">telnet</span><span class="o">.</span><span class="n">TelnetServerFactory</span><span class="p">()</span>
<span class="n">factory</span><span class="o">.</span><span class="n">noisy</span> <span class="o">=</span> <span class="kc">False</span>
<span class="n">factory</span><span class="o">.</span><span class="n">protocol</span> <span class="o">=</span> <span class="n">telnet</span><span class="o">.</span><span class="n">TelnetProtocol</span>
<span class="n">factory</span><span class="o">.</span><span class="n">protocol</span> <span class="o">=</span> <span class="n">_telnet_protocol</span>
<span class="n">factory</span><span class="o">.</span><span class="n">sessionhandler</span> <span class="o">=</span> <span class="n">PORTAL_SESSIONS</span>
<span class="n">telnet_service</span> <span class="o">=</span> <span class="n">internet</span><span class="o">.</span><span class="n">TCPServer</span><span class="p">(</span><span class="n">port</span><span class="p">,</span> <span class="n">factory</span><span class="p">,</span> <span class="n">interface</span><span class="o">=</span><span class="n">interface</span><span class="p">)</span>
<span class="n">telnet_service</span><span class="o">.</span><span class="n">setName</span><span class="p">(</span><span class="s2">&quot;EvenniaTelnet</span><span class="si">%s</span><span class="s2">&quot;</span> <span class="o">%</span> <span class="n">pstring</span><span class="p">)</span>
@ -350,6 +352,8 @@
<span class="kn">from</span> <span class="nn">evennia.server.portal</span> <span class="k">import</span> <span class="n">telnet_ssl</span>
<span class="n">_ssl_protocol</span> <span class="o">=</span> <span class="n">class_from_module</span><span class="p">(</span><span class="n">settings</span><span class="o">.</span><span class="n">SSL_PROTOCOL_CLASS</span><span class="p">)</span>
<span class="k">for</span> <span class="n">interface</span> <span class="ow">in</span> <span class="n">SSL_INTERFACES</span><span class="p">:</span>
<span class="n">ifacestr</span> <span class="o">=</span> <span class="s2">&quot;&quot;</span>
<span class="k">if</span> <span class="n">interface</span> <span class="ow">not</span> <span class="ow">in</span> <span class="p">(</span><span class="s2">&quot;0.0.0.0&quot;</span><span class="p">,</span> <span class="s2">&quot;::&quot;</span><span class="p">)</span> <span class="ow">or</span> <span class="nb">len</span><span class="p">(</span><span class="n">SSL_INTERFACES</span><span class="p">)</span> <span class="o">&gt;</span> <span class="mi">1</span><span class="p">:</span>
@ -359,7 +363,7 @@
<span class="n">factory</span> <span class="o">=</span> <span class="n">protocol</span><span class="o">.</span><span class="n">ServerFactory</span><span class="p">()</span>
<span class="n">factory</span><span class="o">.</span><span class="n">noisy</span> <span class="o">=</span> <span class="kc">False</span>
<span class="n">factory</span><span class="o">.</span><span class="n">sessionhandler</span> <span class="o">=</span> <span class="n">PORTAL_SESSIONS</span>
<span class="n">factory</span><span class="o">.</span><span class="n">protocol</span> <span class="o">=</span> <span class="n">telnet_ssl</span><span class="o">.</span><span class="n">SSLProtocol</span>
<span class="n">factory</span><span class="o">.</span><span class="n">protocol</span> <span class="o">=</span> <span class="n">_ssl_protocol</span>
<span class="n">ssl_context</span> <span class="o">=</span> <span class="n">telnet_ssl</span><span class="o">.</span><span class="n">getSSLContext</span><span class="p">()</span>
<span class="k">if</span> <span class="n">ssl_context</span><span class="p">:</span>
@ -383,6 +387,8 @@
<span class="kn">from</span> <span class="nn">evennia.server.portal</span> <span class="k">import</span> <span class="n">ssh</span>
<span class="n">_ssh_protocol</span> <span class="o">=</span> <span class="n">class_from_module</span><span class="p">(</span><span class="n">settings</span><span class="o">.</span><span class="n">SSH_PROTOCOL_CLASS</span><span class="p">)</span>
<span class="k">for</span> <span class="n">interface</span> <span class="ow">in</span> <span class="n">SSH_INTERFACES</span><span class="p">:</span>
<span class="n">ifacestr</span> <span class="o">=</span> <span class="s2">&quot;&quot;</span>
<span class="k">if</span> <span class="n">interface</span> <span class="ow">not</span> <span class="ow">in</span> <span class="p">(</span><span class="s2">&quot;0.0.0.0&quot;</span><span class="p">,</span> <span class="s2">&quot;::&quot;</span><span class="p">)</span> <span class="ow">or</span> <span class="nb">len</span><span class="p">(</span><span class="n">SSH_INTERFACES</span><span class="p">)</span> <span class="o">&gt;</span> <span class="mi">1</span><span class="p">:</span>
@ -390,11 +396,7 @@
<span class="k">for</span> <span class="n">port</span> <span class="ow">in</span> <span class="n">SSH_PORTS</span><span class="p">:</span>
<span class="n">pstring</span> <span class="o">=</span> <span class="s2">&quot;</span><span class="si">%s</span><span class="s2">:</span><span class="si">%s</span><span class="s2">&quot;</span> <span class="o">%</span> <span class="p">(</span><span class="n">ifacestr</span><span class="p">,</span> <span class="n">port</span><span class="p">)</span>
<span class="n">factory</span> <span class="o">=</span> <span class="n">ssh</span><span class="o">.</span><span class="n">makeFactory</span><span class="p">(</span>
<span class="p">{</span>
<span class="s2">&quot;protocolFactory&quot;</span><span class="p">:</span> <span class="n">ssh</span><span class="o">.</span><span class="n">SshProtocol</span><span class="p">,</span>
<span class="s2">&quot;protocolArgs&quot;</span><span class="p">:</span> <span class="p">(),</span>
<span class="s2">&quot;sessions&quot;</span><span class="p">:</span> <span class="n">PORTAL_SESSIONS</span><span class="p">,</span>
<span class="p">}</span>
<span class="p">{</span><span class="s2">&quot;protocolFactory&quot;</span><span class="p">:</span> <span class="n">_ssh_protocol</span><span class="p">,</span> <span class="s2">&quot;protocolArgs&quot;</span><span class="p">:</span> <span class="p">(),</span> <span class="s2">&quot;sessions&quot;</span><span class="p">:</span> <span class="n">PORTAL_SESSIONS</span><span class="p">,}</span>
<span class="p">)</span>
<span class="n">factory</span><span class="o">.</span><span class="n">noisy</span> <span class="o">=</span> <span class="kc">False</span>
<span class="n">ssh_service</span> <span class="o">=</span> <span class="n">internet</span><span class="o">.</span><span class="n">TCPServer</span><span class="p">(</span><span class="n">port</span><span class="p">,</span> <span class="n">factory</span><span class="p">,</span> <span class="n">interface</span><span class="o">=</span><span class="n">interface</span><span class="p">)</span>
@ -410,6 +412,7 @@
<span class="c1"># Start a reverse proxy to relay data to the Server-side webserver</span>
<span class="n">websocket_started</span> <span class="o">=</span> <span class="kc">False</span>
<span class="n">_websocket_protocol</span> <span class="o">=</span> <span class="n">class_from_module</span><span class="p">(</span><span class="n">settings</span><span class="o">.</span><span class="n">WEBSOCKET_PROTOCOL_CLASS</span><span class="p">)</span>
<span class="k">for</span> <span class="n">interface</span> <span class="ow">in</span> <span class="n">WEBSERVER_INTERFACES</span><span class="p">:</span>
<span class="n">ifacestr</span> <span class="o">=</span> <span class="s2">&quot;&quot;</span>
<span class="k">if</span> <span class="n">interface</span> <span class="ow">not</span> <span class="ow">in</span> <span class="p">(</span><span class="s2">&quot;0.0.0.0&quot;</span><span class="p">,</span> <span class="s2">&quot;::&quot;</span><span class="p">)</span> <span class="ow">or</span> <span class="nb">len</span><span class="p">(</span><span class="n">WEBSERVER_INTERFACES</span><span class="p">)</span> <span class="o">&gt;</span> <span class="mi">1</span><span class="p">:</span>
@ -444,7 +447,7 @@
<span class="n">factory</span> <span class="o">=</span> <span class="n">Websocket</span><span class="p">()</span>
<span class="n">factory</span><span class="o">.</span><span class="n">noisy</span> <span class="o">=</span> <span class="kc">False</span>
<span class="n">factory</span><span class="o">.</span><span class="n">protocol</span> <span class="o">=</span> <span class="n">webclient</span><span class="o">.</span><span class="n">WebSocketClient</span>
<span class="n">factory</span><span class="o">.</span><span class="n">protocol</span> <span class="o">=</span> <span class="n">_websocket_protocol</span>
<span class="n">factory</span><span class="o">.</span><span class="n">sessionhandler</span> <span class="o">=</span> <span class="n">PORTAL_SESSIONS</span>
<span class="n">websocket_service</span> <span class="o">=</span> <span class="n">internet</span><span class="o">.</span><span class="n">TCPServer</span><span class="p">(</span><span class="n">port</span><span class="p">,</span> <span class="n">factory</span><span class="p">,</span> <span class="n">interface</span><span class="o">=</span><span class="n">w_interface</span><span class="p">)</span>
<span class="n">websocket_service</span><span class="o">.</span><span class="n">setName</span><span class="p">(</span><span class="s2">&quot;EvenniaWebSocket</span><span class="si">%s</span><span class="s2">:</span><span class="si">%s</span><span class="s2">&quot;</span> <span class="o">%</span> <span class="p">(</span><span class="n">w_ifacestr</span><span class="p">,</span> <span class="n">port</span><span class="p">))</span>

View file

@ -48,8 +48,10 @@
<span class="kn">from</span> <span class="nn">collections</span> <span class="k">import</span> <span class="n">deque</span><span class="p">,</span> <span class="n">namedtuple</span>
<span class="kn">from</span> <span class="nn">twisted.internet</span> <span class="k">import</span> <span class="n">reactor</span>
<span class="kn">from</span> <span class="nn">django.conf</span> <span class="k">import</span> <span class="n">settings</span>
<span class="kn">from</span> <span class="nn">evennia.server.sessionhandler</span> <span class="k">import</span> <span class="n">SessionHandler</span><span class="p">,</span> <span class="n">PCONN</span><span class="p">,</span> <span class="n">PDISCONN</span><span class="p">,</span> <span class="n">PCONNSYNC</span><span class="p">,</span> <span class="n">PDISCONNALL</span>
<span class="kn">from</span> <span class="nn">evennia.server.sessionhandler</span> <span class="k">import</span> <span class="n">SessionHandler</span>
<span class="kn">from</span> <span class="nn">evennia.server.portal.amp</span> <span class="k">import</span> <span class="n">PCONN</span><span class="p">,</span> <span class="n">PDISCONN</span><span class="p">,</span> <span class="n">PCONNSYNC</span><span class="p">,</span> <span class="n">PDISCONNALL</span>
<span class="kn">from</span> <span class="nn">evennia.utils.logger</span> <span class="k">import</span> <span class="n">log_trace</span>
<span class="kn">from</span> <span class="nn">evennia.utils.utils</span> <span class="k">import</span> <span class="n">class_from_module</span>
<span class="c1"># module import</span>
<span class="n">_MOD_IMPORT</span> <span class="o">=</span> <span class="kc">None</span>
@ -109,6 +111,19 @@
<span class="sd"> &quot;&quot;&quot;</span>
<span class="bp">self</span><span class="o">.</span><span class="n">connection_time</span> <span class="o">=</span> <span class="n">time</span><span class="o">.</span><span class="n">time</span><span class="p">()</span></div>
<div class="viewcode-block" id="PortalSessionHandler.generate_sessid"><a class="viewcode-back" href="../../../../api/evennia.server.portal.portalsessionhandler.html#evennia.server.portal.portalsessionhandler.PortalSessionHandler.generate_sessid">[docs]</a> <span class="k">def</span> <span class="nf">generate_sessid</span><span class="p">(</span><span class="bp">self</span><span class="p">):</span>
<span class="sd">&quot;&quot;&quot;</span>
<span class="sd"> Simply generates a sessid that&#39;s guaranteed to be unique for this Portal run.</span>
<span class="sd"> Returns:</span>
<span class="sd"> sessid</span>
<span class="sd"> &quot;&quot;&quot;</span>
<span class="bp">self</span><span class="o">.</span><span class="n">latest_sessid</span> <span class="o">+=</span> <span class="mi">1</span>
<span class="k">if</span> <span class="bp">self</span><span class="o">.</span><span class="n">latest_sessid</span> <span class="ow">in</span> <span class="bp">self</span><span class="p">:</span>
<span class="k">return</span> <span class="bp">self</span><span class="o">.</span><span class="n">generate_sessid</span><span class="p">()</span>
<span class="k">return</span> <span class="bp">self</span><span class="o">.</span><span class="n">latest_sessid</span></div>
<div class="viewcode-block" id="PortalSessionHandler.connect"><a class="viewcode-back" href="../../../../api/evennia.server.portal.portalsessionhandler.html#evennia.server.portal.portalsessionhandler.PortalSessionHandler.connect">[docs]</a> <span class="k">def</span> <span class="nf">connect</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">session</span><span class="p">):</span>
<span class="sd">&quot;&quot;&quot;</span>
<span class="sd"> Called by protocol at first connect. This adds a not-yet</span>
@ -132,8 +147,7 @@
<span class="k">if</span> <span class="ow">not</span> <span class="n">session</span><span class="o">.</span><span class="n">sessid</span><span class="p">:</span>
<span class="c1"># if the session already has a sessid (e.g. being inherited in the</span>
<span class="c1"># case of a webclient auto-reconnect), keep it</span>
<span class="bp">self</span><span class="o">.</span><span class="n">latest_sessid</span> <span class="o">+=</span> <span class="mi">1</span>
<span class="n">session</span><span class="o">.</span><span class="n">sessid</span> <span class="o">=</span> <span class="bp">self</span><span class="o">.</span><span class="n">latest_sessid</span>
<span class="n">session</span><span class="o">.</span><span class="n">sessid</span> <span class="o">=</span> <span class="bp">self</span><span class="o">.</span><span class="n">generate_sessid</span><span class="p">()</span>
<span class="n">session</span><span class="o">.</span><span class="n">server_connected</span> <span class="o">=</span> <span class="kc">False</span>
<span class="n">_CONNECTION_QUEUE</span><span class="o">.</span><span class="n">appendleft</span><span class="p">(</span><span class="n">session</span><span class="p">)</span>
<span class="k">if</span> <span class="nb">len</span><span class="p">(</span><span class="n">_CONNECTION_QUEUE</span><span class="p">)</span> <span class="o">&gt;</span> <span class="mi">1</span><span class="p">:</span>
@ -504,7 +518,9 @@
<span class="n">log_trace</span><span class="p">()</span></div></div>
<span class="n">PORTAL_SESSIONS</span> <span class="o">=</span> <span class="n">PortalSessionHandler</span><span class="p">()</span>
<span class="n">_PORTAL_SESSION_HANDLER_CLASS</span> <span class="o">=</span> <span class="n">class_from_module</span><span class="p">(</span><span class="n">settings</span><span class="o">.</span><span class="n">PORTAL_SESSION_HANDLER_CLASS</span><span class="p">)</span>
<span class="n">PORTAL_SESSIONS</span> <span class="o">=</span> <span class="n">_PORTAL_SESSION_HANDLER_CLASS</span><span class="p">()</span>
</pre></div>
<div class="clearer"></div>

View file

@ -84,10 +84,9 @@
<span class="kn">from</span> <span class="nn">twisted.python</span> <span class="k">import</span> <span class="n">components</span>
<span class="kn">from</span> <span class="nn">django.conf</span> <span class="k">import</span> <span class="n">settings</span>
<span class="kn">from</span> <span class="nn">evennia.server</span> <span class="k">import</span> <span class="n">session</span>
<span class="kn">from</span> <span class="nn">evennia.accounts.models</span> <span class="k">import</span> <span class="n">AccountDB</span>
<span class="kn">from</span> <span class="nn">evennia.utils</span> <span class="k">import</span> <span class="n">ansi</span>
<span class="kn">from</span> <span class="nn">evennia.utils.utils</span> <span class="k">import</span> <span class="n">to_str</span>
<span class="kn">from</span> <span class="nn">evennia.utils.utils</span> <span class="k">import</span> <span class="n">to_str</span><span class="p">,</span> <span class="n">class_from_module</span>
<span class="n">_RE_N</span> <span class="o">=</span> <span class="n">re</span><span class="o">.</span><span class="n">compile</span><span class="p">(</span><span class="sa">r</span><span class="s2">&quot;\|n$&quot;</span><span class="p">)</span>
<span class="n">_RE_SCREENREADER_REGEX</span> <span class="o">=</span> <span class="n">re</span><span class="o">.</span><span class="n">compile</span><span class="p">(</span>
@ -115,6 +114,8 @@
<span class="n">_PRIVATE_KEY_FILE</span><span class="p">,</span> <span class="n">_PUBLIC_KEY_FILE</span>
<span class="p">)</span>
<span class="n">_BASE_SESSION_CLASS</span> <span class="o">=</span> <span class="n">class_from_module</span><span class="p">(</span><span class="n">settings</span><span class="o">.</span><span class="n">BASE_SESSION_CLASS</span><span class="p">)</span>
<span class="c1"># not used atm</span>
<div class="viewcode-block" id="SSHServerFactory"><a class="viewcode-back" href="../../../../api/evennia.server.portal.ssh.html#evennia.server.portal.ssh.SSHServerFactory">[docs]</a><span class="k">class</span> <span class="nc">SSHServerFactory</span><span class="p">(</span><span class="n">protocol</span><span class="o">.</span><span class="n">ServerFactory</span><span class="p">):</span>
@ -125,7 +126,7 @@
<span class="k">return</span> <span class="s2">&quot;SSH&quot;</span></div></div>
<div class="viewcode-block" id="SshProtocol"><a class="viewcode-back" href="../../../../api/evennia.server.portal.ssh.html#evennia.server.portal.ssh.SshProtocol">[docs]</a><span class="k">class</span> <span class="nc">SshProtocol</span><span class="p">(</span><span class="n">Manhole</span><span class="p">,</span> <span class="n">session</span><span class="o">.</span><span class="n">Session</span><span class="p">):</span>
<div class="viewcode-block" id="SshProtocol"><a class="viewcode-back" href="../../../../api/evennia.server.portal.ssh.html#evennia.server.portal.ssh.SshProtocol">[docs]</a><span class="k">class</span> <span class="nc">SshProtocol</span><span class="p">(</span><span class="n">Manhole</span><span class="p">,</span> <span class="n">_BASE_SESSION_CLASS</span><span class="p">):</span>
<span class="sd">&quot;&quot;&quot;</span>
<span class="sd"> Each account connecting over ssh gets this protocol assigned to</span>
<span class="sd"> them. All communication between game and account goes through</span>
@ -318,18 +319,18 @@
<span class="sd"> text (str): The first argument is always the text string to send. No other arguments</span>
<span class="sd"> are considered.</span>
<span class="sd"> Keyword Args:</span>
<span class="sd"> options (dict): Send-option flags:</span>
<span class="sd"> options (dict): Send-option flags (booleans)</span>
<span class="sd"> - mxp: Enforce MXP link support.</span>
<span class="sd"> - ansi: Enforce no ANSI colors.</span>
<span class="sd"> - xterm256: Enforce xterm256 colors, regardless of TTYPE setting.</span>
<span class="sd"> - nocolor: Strip all colors.</span>
<span class="sd"> - raw: Pass string through without any ansi processing</span>
<span class="sd"> (i.e. include Evennia ansi markers but do not</span>
<span class="sd"> - mxp: enforce mxp link support.</span>
<span class="sd"> - ansi: enforce no ansi colors.</span>
<span class="sd"> - xterm256: enforce xterm256 colors, regardless of ttype setting.</span>
<span class="sd"> - nocolor: strip all colors.</span>
<span class="sd"> - raw: pass string through without any ansi processing</span>
<span class="sd"> (i.e. include evennia ansi markers but do not</span>
<span class="sd"> convert them into ansi tokens)</span>
<span class="sd"> - echo: Turn on/off line echo on the client. Turn</span>
<span class="sd"> - echo: turn on/off line echo on the client. turn</span>
<span class="sd"> off line echo for client, for example for password.</span>
<span class="sd"> Note that it must be actively turned back on again!</span>
<span class="sd"> note that it must be actively turned back on again!</span>
<span class="sd"> &quot;&quot;&quot;</span>
<span class="c1"># print &quot;telnet.send_text&quot;, args,kwargs # DEBUG</span>

View file

@ -59,7 +59,7 @@
<span class="k">raise</span> <span class="ne">ImportError</span><span class="p">(</span><span class="n">errstr</span><span class="o">.</span><span class="n">format</span><span class="p">(</span><span class="n">err</span><span class="o">=</span><span class="n">error</span><span class="p">))</span>
<span class="kn">from</span> <span class="nn">django.conf</span> <span class="k">import</span> <span class="n">settings</span>
<span class="kn">from</span> <span class="nn">evennia.server.portal.telnet</span> <span class="k">import</span> <span class="n">TelnetProtocol</span>
<span class="kn">from</span> <span class="nn">evennia.utils.utils</span> <span class="k">import</span> <span class="n">class_from_module</span>
<span class="n">_GAME_DIR</span> <span class="o">=</span> <span class="n">settings</span><span class="o">.</span><span class="n">GAME_DIR</span>
@ -84,8 +84,10 @@
<span class="s2"> </span><span class="si">{exestring}</span><span class="s2"></span>
<span class="s2">&quot;&quot;&quot;</span>
<span class="n">_TELNET_PROTOCOL_CLASS</span> <span class="o">=</span> <span class="n">class_from_module</span><span class="p">(</span><span class="n">settings</span><span class="o">.</span><span class="n">TELNET_PROTOCOL_CLASS</span><span class="p">)</span>
<div class="viewcode-block" id="SSLProtocol"><a class="viewcode-back" href="../../../../api/evennia.server.portal.ssl.html#evennia.server.portal.ssl.SSLProtocol">[docs]</a><span class="k">class</span> <span class="nc">SSLProtocol</span><span class="p">(</span><span class="n">TelnetProtocol</span><span class="p">):</span>
<div class="viewcode-block" id="SSLProtocol"><a class="viewcode-back" href="../../../../api/evennia.server.portal.ssl.html#evennia.server.portal.ssl.SSLProtocol">[docs]</a><span class="k">class</span> <span class="nc">SSLProtocol</span><span class="p">(</span><span class="n">_TELNET_PROTOCOL_CLASS</span><span class="p">):</span>
<span class="sd">&quot;&quot;&quot;</span>
<span class="sd"> Communication is the same as telnet, except data transfer</span>
<span class="sd"> is done with encryption.</span>

View file

@ -66,12 +66,11 @@
<span class="n">LINEMODE_TRAPSIG</span><span class="p">,</span>
<span class="p">)</span>
<span class="kn">from</span> <span class="nn">django.conf</span> <span class="k">import</span> <span class="n">settings</span>
<span class="kn">from</span> <span class="nn">evennia.server.session</span> <span class="k">import</span> <span class="n">Session</span>
<span class="kn">from</span> <span class="nn">evennia.server.portal</span> <span class="k">import</span> <span class="n">ttype</span><span class="p">,</span> <span class="n">mssp</span><span class="p">,</span> <span class="n">telnet_oob</span><span class="p">,</span> <span class="n">naws</span><span class="p">,</span> <span class="n">suppress_ga</span>
<span class="kn">from</span> <span class="nn">evennia.server.portal.mccp</span> <span class="k">import</span> <span class="n">Mccp</span><span class="p">,</span> <span class="n">mccp_compress</span><span class="p">,</span> <span class="n">MCCP</span>
<span class="kn">from</span> <span class="nn">evennia.server.portal.mxp</span> <span class="k">import</span> <span class="n">Mxp</span><span class="p">,</span> <span class="n">mxp_parse</span>
<span class="kn">from</span> <span class="nn">evennia.utils</span> <span class="k">import</span> <span class="n">ansi</span>
<span class="kn">from</span> <span class="nn">evennia.utils.utils</span> <span class="k">import</span> <span class="n">to_bytes</span>
<span class="kn">from</span> <span class="nn">evennia.utils.utils</span> <span class="k">import</span> <span class="n">to_bytes</span><span class="p">,</span> <span class="n">class_from_module</span>
<span class="n">_RE_N</span> <span class="o">=</span> <span class="n">re</span><span class="o">.</span><span class="n">compile</span><span class="p">(</span><span class="sa">r</span><span class="s2">&quot;\|n$&quot;</span><span class="p">)</span>
<span class="n">_RE_LEND</span> <span class="o">=</span> <span class="n">re</span><span class="o">.</span><span class="n">compile</span><span class="p">(</span><span class="sa">br</span><span class="s2">&quot;\n$|\r$|\r\n$|\r\x00$|&quot;</span><span class="p">,</span> <span class="n">re</span><span class="o">.</span><span class="n">MULTILINE</span><span class="p">)</span>
@ -97,6 +96,9 @@
<span class="p">)</span>
<span class="n">_BASE_SESSION_CLASS</span> <span class="o">=</span> <span class="n">class_from_module</span><span class="p">(</span><span class="n">settings</span><span class="o">.</span><span class="n">BASE_SESSION_CLASS</span><span class="p">)</span>
<div class="viewcode-block" id="TelnetServerFactory"><a class="viewcode-back" href="../../../../api/evennia.server.portal.telnet.html#evennia.server.portal.telnet.TelnetServerFactory">[docs]</a><span class="k">class</span> <span class="nc">TelnetServerFactory</span><span class="p">(</span><span class="n">protocol</span><span class="o">.</span><span class="n">ServerFactory</span><span class="p">):</span>
<span class="s2">&quot;This is only to name this better in logs&quot;</span>
<span class="n">noisy</span> <span class="o">=</span> <span class="kc">False</span>
@ -105,7 +107,7 @@
<span class="k">return</span> <span class="s2">&quot;Telnet&quot;</span></div></div>
<div class="viewcode-block" id="TelnetProtocol"><a class="viewcode-back" href="../../../../api/evennia.server.portal.telnet.html#evennia.server.portal.telnet.TelnetProtocol">[docs]</a><span class="k">class</span> <span class="nc">TelnetProtocol</span><span class="p">(</span><span class="n">Telnet</span><span class="p">,</span> <span class="n">StatefulTelnetProtocol</span><span class="p">,</span> <span class="n">Session</span><span class="p">):</span>
<div class="viewcode-block" id="TelnetProtocol"><a class="viewcode-back" href="../../../../api/evennia.server.portal.telnet.html#evennia.server.portal.telnet.TelnetProtocol">[docs]</a><span class="k">class</span> <span class="nc">TelnetProtocol</span><span class="p">(</span><span class="n">Telnet</span><span class="p">,</span> <span class="n">StatefulTelnetProtocol</span><span class="p">,</span> <span class="n">_BASE_SESSION_CLASS</span><span class="p">):</span>
<span class="sd">&quot;&quot;&quot;</span>
<span class="sd"> Each player connecting over telnet (ie using most traditional mud</span>
<span class="sd"> clients) gets a telnet protocol instance assigned to them. All</span>
@ -429,19 +431,19 @@
<span class="sd"> text (str): The first argument is always the text string to send. No other arguments</span>
<span class="sd"> are considered.</span>
<span class="sd"> Keyword Args:</span>
<span class="sd"> options (dict): Send-option flags:</span>
<span class="sd"> options (dict): Send-option flags</span>
<span class="sd"> - mxp: Enforce MXP link support.</span>
<span class="sd"> - ansi: Enforce no ANSI colors.</span>
<span class="sd"> - xterm256: Enforce xterm256 colors, regardless of TTYPE.</span>
<span class="sd"> - noxterm256: Enforce no xterm256 color support, regardless of TTYPE.</span>
<span class="sd"> - nocolor: Strip all Color, regardless of ansi/xterm256 setting.</span>
<span class="sd"> - raw: Pass string through without any ansi processing</span>
<span class="sd"> (i.e. include Evennia ansi markers but do not</span>
<span class="sd"> convert them into ansi tokens)</span>
<span class="sd"> - echo: Turn on/off line echo on the client. Turn</span>
<span class="sd"> off line echo for client, for example for password.</span>
<span class="sd"> Note that it must be actively turned back on again!</span>
<span class="sd"> - mxp: Enforce MXP link support.</span>
<span class="sd"> - ansi: Enforce no ANSI colors.</span>
<span class="sd"> - xterm256: Enforce xterm256 colors, regardless of TTYPE.</span>
<span class="sd"> - noxterm256: Enforce no xterm256 color support, regardless of TTYPE.</span>
<span class="sd"> - nocolor: Strip all Color, regardless of ansi/xterm256 setting.</span>
<span class="sd"> - raw: Pass string through without any ansi processing</span>
<span class="sd"> (i.e. include Evennia ansi markers but do not</span>
<span class="sd"> convert them into ansi tokens)</span>
<span class="sd"> - echo: Turn on/off line echo on the client. Turn</span>
<span class="sd"> off line echo for client, for example for password.</span>
<span class="sd"> Note that it must be actively turned back on again!</span>
<span class="sd"> &quot;&quot;&quot;</span>
<span class="n">text</span> <span class="o">=</span> <span class="n">args</span><span class="p">[</span><span class="mi">0</span><span class="p">]</span> <span class="k">if</span> <span class="n">args</span> <span class="k">else</span> <span class="s2">&quot;&quot;</span>

View file

@ -51,21 +51,16 @@
<span class="sd">instruct the client to play sounds or to update a graphical health</span>
<span class="sd">bar.</span>
<span class="sd">&gt; Note that in Evennia&#39;s Web client, all send commands are &quot;OOB commands&quot;,</span>
<span class="sd">(including the &quot;text&quot; one), there is no equivalence to MSDP/GMCP for the</span>
<span class="sd">webclient since it doesn&#39;t need it.</span>
<span class="sd">Note that in Evennia&#39;s Web client, all send commands are &quot;OOB</span>
<span class="sd">commands&quot;, (including the &quot;text&quot; one), there is no equivalence to</span>
<span class="sd">MSDP/GMCP for the webclient since it doesn&#39;t need it.</span>
<span class="sd">This implements the following telnet OOB communication protocols:</span>
<span class="sd">- MSDP (Mud Server Data Protocol), as per</span>
<span class="sd"> http://tintin.sourceforge.net/msdp/</span>
<span class="sd">- MSDP (Mud Server Data Protocol), as per http://tintin.sourceforge.net/msdp/</span>
<span class="sd">- GMCP (Generic Mud Communication Protocol) as per</span>
<span class="sd"> http://www.ironrealms.com/rapture/manual/files/FeatGMCP-txt.html#Generic_MUD_Communication_Protocol%28GMCP%29</span>
<span class="sd">Following the lead of KaVir&#39;s protocol snippet, we first check if client</span>
<span class="sd">supports MSDP and if not, we fallback to GMCP with a MSDP header where</span>
<span class="sd">applicable.</span>
<span class="sd">----</span>
<span class="sd">&quot;&quot;&quot;</span>
@ -202,16 +197,16 @@
<span class="sd"> MSDP structures on these forms:</span>
<span class="sd"> ::</span>
<span class="sd"> [cmdname, [], {}] -&gt; VAR cmdname VAL &quot;&quot;</span>
<span class="sd"> [cmdname, [arg], {}] -&gt; VAR cmdname VAL arg</span>
<span class="sd"> [cmdname, [args],{}] -&gt; VAR cmdname VAL ARRAYOPEN VAL arg VAL arg ... ARRAYCLOSE</span>
<span class="sd"> [cmdname, [], {kwargs}] -&gt; VAR cmdname VAL TABLEOPEN VAR key VAL val ... TABLECLOSE</span>
<span class="sd"> [cmdname, [], {}] -&gt; VAR cmdname VAL &quot;&quot;</span>
<span class="sd"> [cmdname, [arg], {}] -&gt; VAR cmdname VAL arg</span>
<span class="sd"> [cmdname, [args],{}] -&gt; VAR cmdname VAL ARRAYOPEN VAL arg VAL arg ... ARRAYCLOSE</span>
<span class="sd"> [cmdname, [], {kwargs}] -&gt; VAR cmdname VAL TABLEOPEN VAR key VAL val ... TABLECLOSE</span>
<span class="sd"> [cmdname, [args], {kwargs}] -&gt; VAR cmdname VAL ARRAYOPEN VAL arg VAL arg ... ARRAYCLOSE</span>
<span class="sd"> VAR cmdname VAL TABLEOPEN VAR key VAL val ... TABLECLOSE</span>
<span class="sd"> Further nesting is not supported, so if an array argument consists</span>
<span class="sd"> of an array (for example), that array will be json-converted to a</span>
<span class="sd"> string.</span>
<span class="sd"> Further nesting is not supported, so if an array argument</span>
<span class="sd"> consists of an array (for example), that array will be</span>
<span class="sd"> json-converted to a string.</span>
<span class="sd"> &quot;&quot;&quot;</span>
<span class="n">msdp_cmdname</span> <span class="o">=</span> <span class="s2">&quot;</span><span class="si">{msdp_var}{msdp_cmdname}{msdp_val}</span><span class="s2">&quot;</span><span class="o">.</span><span class="n">format</span><span class="p">(</span>
@ -281,11 +276,10 @@
<span class="sd"> [cmd.name, [arg], {}] -&gt; Cmd.Name arg</span>
<span class="sd"> [cmd.name, [args],{}] -&gt; Cmd.Name [args]</span>
<span class="sd"> [cmd.name, [], {kwargs}] -&gt; Cmd.Name {kwargs}</span>
<span class="sd"> [cmdname, [args, {kwargs}] -&gt; Core.Cmdname [[args],{kwargs}]</span>
<span class="sd"> [cmdname, [args, {kwargs}] -&gt; Core.Cmdname [[args],{kwargs}]</span>
<span class="sd"> Notes:</span>
<span class="sd"> There are also a few default mappings between evennia outputcmds and</span>
<span class="sd"> GMCP:</span>
<span class="sd"> There are also a few default mappings between evennia outputcmds and GMCP:</span>
<span class="sd"> ::</span>
<span class="sd"> client_options -&gt; Core.Supports.Get</span>

View file

@ -58,10 +58,8 @@
<span class="kn">import</span> <span class="nn">re</span>
<span class="kn">import</span> <span class="nn">json</span>
<span class="kn">import</span> <span class="nn">html</span>
<span class="kn">from</span> <span class="nn">twisted.internet.protocol</span> <span class="k">import</span> <span class="n">Protocol</span>
<span class="kn">from</span> <span class="nn">django.conf</span> <span class="k">import</span> <span class="n">settings</span>
<span class="kn">from</span> <span class="nn">evennia.server.session</span> <span class="k">import</span> <span class="n">Session</span>
<span class="kn">from</span> <span class="nn">evennia.utils.utils</span> <span class="k">import</span> <span class="n">to_str</span><span class="p">,</span> <span class="n">mod_import</span>
<span class="kn">from</span> <span class="nn">evennia.utils.utils</span> <span class="k">import</span> <span class="n">mod_import</span><span class="p">,</span> <span class="n">class_from_module</span>
<span class="kn">from</span> <span class="nn">evennia.utils.ansi</span> <span class="k">import</span> <span class="n">parse_ansi</span>
<span class="kn">from</span> <span class="nn">evennia.utils.text2html</span> <span class="k">import</span> <span class="n">parse_html</span>
<span class="kn">from</span> <span class="nn">autobahn.twisted.websocket</span> <span class="k">import</span> <span class="n">WebSocketServerProtocol</span>
@ -81,10 +79,10 @@
<span class="c1"># called when the browser is navigating away from the page</span>
<span class="n">GOING_AWAY</span> <span class="o">=</span> <span class="n">WebSocketServerProtocol</span><span class="o">.</span><span class="n">CLOSE_STATUS_CODE_GOING_AWAY</span>
<span class="n">STATE_CLOSING</span> <span class="o">=</span> <span class="n">WebSocketServerProtocol</span><span class="o">.</span><span class="n">STATE_CLOSING</span>
<span class="n">_BASE_SESSION_CLASS</span> <span class="o">=</span> <span class="n">class_from_module</span><span class="p">(</span><span class="n">settings</span><span class="o">.</span><span class="n">BASE_SESSION_CLASS</span><span class="p">)</span>
<div class="viewcode-block" id="WebSocketClient"><a class="viewcode-back" href="../../../../api/evennia.server.portal.webclient.html#evennia.server.portal.webclient.WebSocketClient">[docs]</a><span class="k">class</span> <span class="nc">WebSocketClient</span><span class="p">(</span><span class="n">WebSocketServerProtocol</span><span class="p">,</span> <span class="n">Session</span><span class="p">):</span>
<div class="viewcode-block" id="WebSocketClient"><a class="viewcode-back" href="../../../../api/evennia.server.portal.webclient.html#evennia.server.portal.webclient.WebSocketClient">[docs]</a><span class="k">class</span> <span class="nc">WebSocketClient</span><span class="p">(</span><span class="n">WebSocketServerProtocol</span><span class="p">,</span> <span class="n">_BASE_SESSION_CLASS</span><span class="p">):</span>
<span class="sd">&quot;&quot;&quot;</span>
<span class="sd"> Implements the server-side of the Websocket connection.</span>
<span class="sd"> &quot;&quot;&quot;</span>
@ -298,8 +296,6 @@
<span class="k">return</span>
<span class="k">else</span><span class="p">:</span>
<span class="k">return</span>
<span class="c1"># just to be sure</span>
<span class="n">text</span> <span class="o">=</span> <span class="n">to_str</span><span class="p">(</span><span class="n">text</span><span class="p">)</span>
<span class="n">flags</span> <span class="o">=</span> <span class="bp">self</span><span class="o">.</span><span class="n">protocol_flags</span>

View file

@ -47,15 +47,15 @@
<span class="sd">The settings are global variables:</span>
<span class="sd">TIMESTEP - time in seconds between each &#39;tick&#39;</span>
<span class="sd">CHANCE_OF_ACTION - chance 0-1 of action happening</span>
<span class="sd">CHANCE_OF_LOGIN - chance 0-1 of login happening</span>
<span class="sd">TELNET_PORT - port to use, defaults to settings.TELNET_PORT</span>
<span class="sd">ACTIONS - see below</span>
<span class="sd">- TIMESTEP - time in seconds between each &#39;tick&#39;</span>
<span class="sd">- CHANCE_OF_ACTION - chance 0-1 of action happening</span>
<span class="sd">- CHANCE_OF_LOGIN - chance 0-1 of login happening</span>
<span class="sd">- TELNET_PORT - port to use, defaults to settings.TELNET_PORT</span>
<span class="sd">- ACTIONS - see below</span>
<span class="sd">ACTIONS is a tuple</span>
<span class="sd">```</span>
<span class="sd">```python</span>
<span class="sd">(login_func, logout_func, (0.3, func1), (0.1, func2) ... )</span>
<span class="sd">```</span>
@ -78,14 +78,14 @@
<span class="sd">The client object has the following relevant properties and methods:</span>
<span class="sd">- key - an optional client key. This is only used for dummyrunner output.</span>
<span class="sd"> Default is &quot;Dummy-&lt;cid&gt;&quot;</span>
<span class="sd"> Default is &quot;Dummy-&lt;cid&gt;&quot;</span>
<span class="sd">- cid - client id</span>
<span class="sd">- gid - globally unique id, hashed with time stamp</span>
<span class="sd">- istep - the current step</span>
<span class="sd">- exits - an empty list. Can be used to store exit names</span>
<span class="sd">- objs - an empty list. Can be used to store object names</span>
<span class="sd">- counter() - returns a unique increasing id, hashed with time stamp</span>
<span class="sd"> to make it unique also between dummyrunner instances.</span>
<span class="sd"> to make it unique also between dummyrunner instances.</span>
<span class="sd">The return should either be a single command string or a tuple of</span>
<span class="sd">command strings. This list of commands will always be executed every</span>
@ -93,7 +93,7 @@
<span class="sd">(no randomness) and allows for setting up a more complex chain of</span>
<span class="sd">commands (such as creating an account and logging in).</span>
<span class="sd">---</span>
<span class="sd">----</span>
<span class="sd">&quot;&quot;&quot;</span>
<span class="c1"># Dummy runner settings</span>

View file

@ -40,12 +40,12 @@
<h1>Source code for evennia.server.server</h1><div class="highlight"><pre>
<span></span><span class="sd">&quot;&quot;&quot;</span>
<span class="sd">This module implements the main Evennia server process, the core of</span>
<span class="sd">the game engine.</span>
<span class="sd">This module implements the main Evennia server process, the core of the game</span>
<span class="sd">engine.</span>
<span class="sd">This module should be started with the &#39;twistd&#39; executable since it</span>
<span class="sd">sets up all the networking features. (this is done automatically</span>
<span class="sd">by evennia/server/server_runner.py).</span>
<span class="sd">This module should be started with the &#39;twistd&#39; executable since it sets up all</span>
<span class="sd">the networking features. (this is done automatically by</span>
<span class="sd">evennia/server/server_runner.py).</span>
<span class="sd">&quot;&quot;&quot;</span>
<span class="kn">import</span> <span class="nn">time</span>
@ -63,6 +63,7 @@
<span class="n">django</span><span class="o">.</span><span class="n">setup</span><span class="p">()</span>
<span class="kn">import</span> <span class="nn">evennia</span>
<span class="kn">import</span> <span class="nn">importlib</span>
<span class="n">evennia</span><span class="o">.</span><span class="n">_init</span><span class="p">()</span>
@ -72,7 +73,6 @@
<span class="kn">from</span> <span class="nn">evennia.accounts.models</span> <span class="k">import</span> <span class="n">AccountDB</span>
<span class="kn">from</span> <span class="nn">evennia.scripts.models</span> <span class="k">import</span> <span class="n">ScriptDB</span>
<span class="kn">from</span> <span class="nn">evennia.server.models</span> <span class="k">import</span> <span class="n">ServerConfig</span>
<span class="kn">from</span> <span class="nn">evennia.server</span> <span class="k">import</span> <span class="n">initial_setup</span>
<span class="kn">from</span> <span class="nn">evennia.utils.utils</span> <span class="k">import</span> <span class="n">get_evennia_version</span><span class="p">,</span> <span class="n">mod_import</span><span class="p">,</span> <span class="n">make_iter</span>
<span class="kn">from</span> <span class="nn">evennia.utils</span> <span class="k">import</span> <span class="n">logger</span>
@ -382,6 +382,7 @@
<span class="sd"> Once finished the last_initial_setup_step is set to -1.</span>
<span class="sd"> &quot;&quot;&quot;</span>
<span class="k">global</span> <span class="n">INFO_DICT</span>
<span class="n">initial_setup</span> <span class="o">=</span> <span class="n">importlib</span><span class="o">.</span><span class="n">import_module</span><span class="p">(</span><span class="n">settings</span><span class="o">.</span><span class="n">INITIAL_SETUP_MODULE</span><span class="p">)</span>
<span class="n">last_initial_setup_step</span> <span class="o">=</span> <span class="n">ServerConfig</span><span class="o">.</span><span class="n">objects</span><span class="o">.</span><span class="n">conf</span><span class="p">(</span><span class="s2">&quot;last_initial_setup_step&quot;</span><span class="p">)</span>
<span class="k">if</span> <span class="ow">not</span> <span class="n">last_initial_setup_step</span><span class="p">:</span>
<span class="c1"># None is only returned if the config does not exist,</span>
@ -440,18 +441,17 @@
<span class="sd">&quot;&quot;&quot;</span>
<span class="sd"> Shuts down the server from inside it.</span>
<span class="sd"> Keyword Args:</span>
<span class="sd"> mode (str): Sets the server restart mode:</span>
<span class="sd"> - &#39;reload&#39;: server restarts, no &quot;persistent&quot; scripts</span>
<span class="sd"> are stopped, at_reload hooks called.</span>
<span class="sd"> - &#39;reset&#39; - server restarts, non-persistent scripts stopped,</span>
<span class="sd"> at_shutdown hooks called but sessions will not</span>
<span class="sd"> be disconnected.</span>
<span class="sd"> -&#39;shutdown&#39; - like reset, but server will not auto-restart.</span>
<span class="sd"> _reactor_stopping: This is set if server is stopped by a kill</span>
<span class="sd"> command OR this method was already called</span>
<span class="sd"> once - in both cases the reactor is dead/stopping already.</span>
<span class="sd"> mode - sets the server restart mode.</span>
<span class="sd"> - &#39;reload&#39; - server restarts, no &quot;persistent&quot; scripts</span>
<span class="sd"> are stopped, at_reload hooks called.</span>
<span class="sd"> - &#39;reset&#39; - server restarts, non-persistent scripts stopped,</span>
<span class="sd"> at_shutdown hooks called but sessions will not</span>
<span class="sd"> be disconnected.</span>
<span class="sd"> - &#39;shutdown&#39; - like reset, but server will not auto-restart.</span>
<span class="sd"> _reactor_stopping - this is set if server is stopped by a kill</span>
<span class="sd"> command OR this method was already called</span>
<span class="sd"> once - in both cases the reactor is</span>
<span class="sd"> dead/stopping already.</span>
<span class="sd"> &quot;&quot;&quot;</span>
<span class="k">if</span> <span class="n">_reactor_stopping</span> <span class="ow">and</span> <span class="nb">hasattr</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="s2">&quot;shutdown_complete&quot;</span><span class="p">):</span>
<span class="c1"># this means we have already passed through this method</span>

View file

@ -47,7 +47,6 @@
<span class="sd">It is stored on the Server side (as opposed to protocol-specific sessions which</span>
<span class="sd">are stored on the Portal side)</span>
<span class="sd">&quot;&quot;&quot;</span>
<span class="kn">import</span> <span class="nn">weakref</span>
<span class="kn">import</span> <span class="nn">time</span>
<span class="kn">from</span> <span class="nn">django.utils</span> <span class="k">import</span> <span class="n">timezone</span>
<span class="kn">from</span> <span class="nn">django.conf</span> <span class="k">import</span> <span class="n">settings</span>
@ -57,6 +56,7 @@
<span class="kn">from</span> <span class="nn">evennia.commands.cmdsethandler</span> <span class="k">import</span> <span class="n">CmdSetHandler</span>
<span class="kn">from</span> <span class="nn">evennia.server.session</span> <span class="k">import</span> <span class="n">Session</span>
<span class="kn">from</span> <span class="nn">evennia.scripts.monitorhandler</span> <span class="k">import</span> <span class="n">MONITOR_HANDLER</span>
<span class="kn">from</span> <span class="nn">evennia.typeclasses.attributes</span> <span class="k">import</span> <span class="n">AttributeHandler</span><span class="p">,</span> <span class="n">InMemoryAttributeBackend</span><span class="p">,</span> <span class="n">DbHolder</span>
<span class="n">_GA</span> <span class="o">=</span> <span class="nb">object</span><span class="o">.</span><span class="fm">__getattribute__</span>
<span class="n">_SA</span> <span class="o">=</span> <span class="nb">object</span><span class="o">.</span><span class="fm">__setattr__</span>
@ -66,124 +66,6 @@
<span class="c1"># i18n</span>
<span class="kn">from</span> <span class="nn">django.utils.translation</span> <span class="k">import</span> <span class="n">gettext</span> <span class="k">as</span> <span class="n">_</span>
<span class="c1"># Handlers for Session.db/ndb operation</span>
<div class="viewcode-block" id="NDbHolder"><a class="viewcode-back" href="../../../api/evennia.server.serversession.html#evennia.server.serversession.NDbHolder">[docs]</a><span class="k">class</span> <span class="nc">NDbHolder</span><span class="p">(</span><span class="nb">object</span><span class="p">):</span>
<span class="sd">&quot;&quot;&quot;Holder for allowing property access of attributes&quot;&quot;&quot;</span>
<div class="viewcode-block" id="NDbHolder.__init__"><a class="viewcode-back" href="../../../api/evennia.server.serversession.html#evennia.server.serversession.NDbHolder.__init__">[docs]</a> <span class="k">def</span> <span class="nf">__init__</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">obj</span><span class="p">,</span> <span class="n">name</span><span class="p">,</span> <span class="n">manager_name</span><span class="o">=</span><span class="s2">&quot;attributes&quot;</span><span class="p">):</span>
<span class="n">_SA</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">name</span><span class="p">,</span> <span class="n">_GA</span><span class="p">(</span><span class="n">obj</span><span class="p">,</span> <span class="n">manager_name</span><span class="p">))</span>
<span class="n">_SA</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="s2">&quot;name&quot;</span><span class="p">,</span> <span class="n">name</span><span class="p">)</span></div>
<span class="k">def</span> <span class="nf">__getattribute__</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">attrname</span><span class="p">):</span>
<span class="k">if</span> <span class="n">attrname</span> <span class="o">==</span> <span class="s2">&quot;all&quot;</span><span class="p">:</span>
<span class="c1"># we allow to overload our default .all</span>
<span class="n">attr</span> <span class="o">=</span> <span class="n">_GA</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">_GA</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="s2">&quot;name&quot;</span><span class="p">))</span><span class="o">.</span><span class="n">get</span><span class="p">(</span><span class="s2">&quot;all&quot;</span><span class="p">)</span>
<span class="k">return</span> <span class="n">attr</span> <span class="k">if</span> <span class="n">attr</span> <span class="k">else</span> <span class="n">_GA</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="s2">&quot;all&quot;</span><span class="p">)</span>
<span class="k">return</span> <span class="n">_GA</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">_GA</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="s2">&quot;name&quot;</span><span class="p">))</span><span class="o">.</span><span class="n">get</span><span class="p">(</span><span class="n">attrname</span><span class="p">)</span>
<span class="k">def</span> <span class="nf">__setattr__</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">attrname</span><span class="p">,</span> <span class="n">value</span><span class="p">):</span>
<span class="n">_GA</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">_GA</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="s2">&quot;name&quot;</span><span class="p">))</span><span class="o">.</span><span class="n">add</span><span class="p">(</span><span class="n">attrname</span><span class="p">,</span> <span class="n">value</span><span class="p">)</span>
<span class="k">def</span> <span class="nf">__delattr__</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">attrname</span><span class="p">):</span>
<span class="n">_GA</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">_GA</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="s2">&quot;name&quot;</span><span class="p">))</span><span class="o">.</span><span class="n">remove</span><span class="p">(</span><span class="n">attrname</span><span class="p">)</span>
<div class="viewcode-block" id="NDbHolder.get_all"><a class="viewcode-back" href="../../../api/evennia.server.serversession.html#evennia.server.serversession.NDbHolder.get_all">[docs]</a> <span class="k">def</span> <span class="nf">get_all</span><span class="p">(</span><span class="bp">self</span><span class="p">):</span>
<span class="k">return</span> <span class="n">_GA</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">_GA</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="s2">&quot;name&quot;</span><span class="p">))</span><span class="o">.</span><span class="n">all</span><span class="p">()</span></div>
<span class="nb">all</span> <span class="o">=</span> <span class="nb">property</span><span class="p">(</span><span class="n">get_all</span><span class="p">)</span></div>
<div class="viewcode-block" id="NAttributeHandler"><a class="viewcode-back" href="../../../api/evennia.server.serversession.html#evennia.server.serversession.NAttributeHandler">[docs]</a><span class="k">class</span> <span class="nc">NAttributeHandler</span><span class="p">(</span><span class="nb">object</span><span class="p">):</span>
<span class="sd">&quot;&quot;&quot;</span>
<span class="sd"> NAttributeHandler version without recache protection.</span>
<span class="sd"> This stand-alone handler manages non-database saving.</span>
<span class="sd"> It is similar to `AttributeHandler` and is used</span>
<span class="sd"> by the `.ndb` handler in the same way as `.db` does</span>
<span class="sd"> for the `AttributeHandler`.</span>
<span class="sd"> &quot;&quot;&quot;</span>
<div class="viewcode-block" id="NAttributeHandler.__init__"><a class="viewcode-back" href="../../../api/evennia.server.serversession.html#evennia.server.serversession.NAttributeHandler.__init__">[docs]</a> <span class="k">def</span> <span class="nf">__init__</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">obj</span><span class="p">):</span>
<span class="sd">&quot;&quot;&quot;</span>
<span class="sd"> Initialized on the object</span>
<span class="sd"> &quot;&quot;&quot;</span>
<span class="bp">self</span><span class="o">.</span><span class="n">_store</span> <span class="o">=</span> <span class="p">{}</span>
<span class="bp">self</span><span class="o">.</span><span class="n">obj</span> <span class="o">=</span> <span class="n">weakref</span><span class="o">.</span><span class="n">proxy</span><span class="p">(</span><span class="n">obj</span><span class="p">)</span></div>
<div class="viewcode-block" id="NAttributeHandler.has"><a class="viewcode-back" href="../../../api/evennia.server.serversession.html#evennia.server.serversession.NAttributeHandler.has">[docs]</a> <span class="k">def</span> <span class="nf">has</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">key</span><span class="p">):</span>
<span class="sd">&quot;&quot;&quot;</span>
<span class="sd"> Check if object has this attribute or not.</span>
<span class="sd"> Args:</span>
<span class="sd"> key (str): The Nattribute key to check.</span>
<span class="sd"> Returns:</span>
<span class="sd"> has_nattribute (bool): If Nattribute is set or not.</span>
<span class="sd"> &quot;&quot;&quot;</span>
<span class="k">return</span> <span class="n">key</span> <span class="ow">in</span> <span class="bp">self</span><span class="o">.</span><span class="n">_store</span></div>
<div class="viewcode-block" id="NAttributeHandler.get"><a class="viewcode-back" href="../../../api/evennia.server.serversession.html#evennia.server.serversession.NAttributeHandler.get">[docs]</a> <span class="k">def</span> <span class="nf">get</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">key</span><span class="p">,</span> <span class="n">default</span><span class="o">=</span><span class="kc">None</span><span class="p">):</span>
<span class="sd">&quot;&quot;&quot;</span>
<span class="sd"> Get the named key value.</span>
<span class="sd"> Args:</span>
<span class="sd"> key (str): The Nattribute key to get.</span>
<span class="sd"> Returns:</span>
<span class="sd"> the value of the Nattribute.</span>
<span class="sd"> &quot;&quot;&quot;</span>
<span class="k">return</span> <span class="bp">self</span><span class="o">.</span><span class="n">_store</span><span class="o">.</span><span class="n">get</span><span class="p">(</span><span class="n">key</span><span class="p">,</span> <span class="n">default</span><span class="p">)</span></div>
<div class="viewcode-block" id="NAttributeHandler.add"><a class="viewcode-back" href="../../../api/evennia.server.serversession.html#evennia.server.serversession.NAttributeHandler.add">[docs]</a> <span class="k">def</span> <span class="nf">add</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">key</span><span class="p">,</span> <span class="n">value</span><span class="p">):</span>
<span class="sd">&quot;&quot;&quot;</span>
<span class="sd"> Add new key and value.</span>
<span class="sd"> Args:</span>
<span class="sd"> key (str): The name of Nattribute to add.</span>
<span class="sd"> value (any): The value to store.</span>
<span class="sd"> &quot;&quot;&quot;</span>
<span class="bp">self</span><span class="o">.</span><span class="n">_store</span><span class="p">[</span><span class="n">key</span><span class="p">]</span> <span class="o">=</span> <span class="n">value</span></div>
<div class="viewcode-block" id="NAttributeHandler.remove"><a class="viewcode-back" href="../../../api/evennia.server.serversession.html#evennia.server.serversession.NAttributeHandler.remove">[docs]</a> <span class="k">def</span> <span class="nf">remove</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">key</span><span class="p">):</span>
<span class="sd">&quot;&quot;&quot;</span>
<span class="sd"> Remove Nattribute from storage.</span>
<span class="sd"> Args:</span>
<span class="sd"> key (str): The name of the Nattribute to remove.</span>
<span class="sd"> &quot;&quot;&quot;</span>
<span class="k">if</span> <span class="n">key</span> <span class="ow">in</span> <span class="bp">self</span><span class="o">.</span><span class="n">_store</span><span class="p">:</span>
<span class="k">del</span> <span class="bp">self</span><span class="o">.</span><span class="n">_store</span><span class="p">[</span><span class="n">key</span><span class="p">]</span></div>
<div class="viewcode-block" id="NAttributeHandler.clear"><a class="viewcode-back" href="../../../api/evennia.server.serversession.html#evennia.server.serversession.NAttributeHandler.clear">[docs]</a> <span class="k">def</span> <span class="nf">clear</span><span class="p">(</span><span class="bp">self</span><span class="p">):</span>
<span class="sd">&quot;&quot;&quot;</span>
<span class="sd"> Remove all NAttributes from handler.</span>
<span class="sd"> &quot;&quot;&quot;</span>
<span class="bp">self</span><span class="o">.</span><span class="n">_store</span> <span class="o">=</span> <span class="p">{}</span></div>
<div class="viewcode-block" id="NAttributeHandler.all"><a class="viewcode-back" href="../../../api/evennia.server.serversession.html#evennia.server.serversession.NAttributeHandler.all">[docs]</a> <span class="k">def</span> <span class="nf">all</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">return_tuples</span><span class="o">=</span><span class="kc">False</span><span class="p">):</span>
<span class="sd">&quot;&quot;&quot;</span>
<span class="sd"> List the contents of the handler.</span>
<span class="sd"> Args:</span>
<span class="sd"> return_tuples (bool, optional): Defines if the Nattributes</span>
<span class="sd"> are returns as a list of keys or as a list of `(key, value)`.</span>
<span class="sd"> Returns:</span>
<span class="sd"> nattributes (list): A list of keys `[key, key, ...]` or a</span>
<span class="sd"> list of tuples `[(key, value), ...]` depending on the</span>
<span class="sd"> setting of `return_tuples`.</span>
<span class="sd"> &quot;&quot;&quot;</span>
<span class="k">if</span> <span class="n">return_tuples</span><span class="p">:</span>
<span class="k">return</span> <span class="p">[(</span><span class="n">key</span><span class="p">,</span> <span class="n">value</span><span class="p">)</span> <span class="k">for</span> <span class="p">(</span><span class="n">key</span><span class="p">,</span> <span class="n">value</span><span class="p">)</span> <span class="ow">in</span> <span class="bp">self</span><span class="o">.</span><span class="n">_store</span><span class="o">.</span><span class="n">items</span><span class="p">()</span> <span class="k">if</span> <span class="ow">not</span> <span class="n">key</span><span class="o">.</span><span class="n">startswith</span><span class="p">(</span><span class="s2">&quot;_&quot;</span><span class="p">)]</span>
<span class="k">return</span> <span class="p">[</span><span class="n">key</span> <span class="k">for</span> <span class="n">key</span> <span class="ow">in</span> <span class="bp">self</span><span class="o">.</span><span class="n">_store</span> <span class="k">if</span> <span class="ow">not</span> <span class="n">key</span><span class="o">.</span><span class="n">startswith</span><span class="p">(</span><span class="s2">&quot;_&quot;</span><span class="p">)]</span></div></div>
<span class="c1"># -------------------------------------------------------------</span>
<span class="c1"># Server Session</span>
@ -216,6 +98,10 @@
<span class="n">cmdset_storage</span> <span class="o">=</span> <span class="nb">property</span><span class="p">(</span><span class="n">__cmdset_storage_get</span><span class="p">,</span> <span class="n">__cmdset_storage_set</span><span class="p">)</span>
<span class="nd">@property</span>
<span class="k">def</span> <span class="nf">id</span><span class="p">(</span><span class="bp">self</span><span class="p">):</span>
<span class="k">return</span> <span class="bp">self</span><span class="o">.</span><span class="n">sessid</span>
<div class="viewcode-block" id="ServerSession.at_sync"><a class="viewcode-back" href="../../../api/evennia.server.serversession.html#evennia.server.serversession.ServerSession.at_sync">[docs]</a> <span class="k">def</span> <span class="nf">at_sync</span><span class="p">(</span><span class="bp">self</span><span class="p">):</span>
<span class="sd">&quot;&quot;&quot;</span>
<span class="sd"> This is called whenever a session has been resynced with the</span>
@ -385,7 +271,7 @@
<span class="sd"> Update the protocol_flags and sync them with Portal.</span>
<span class="sd"> Keyword Args:</span>
<span class="sd"> any: A key:value pair to set in the</span>
<span class="sd"> protocol_flag (any): A key and value to set in the</span>
<span class="sd"> protocol_flags dictionary.</span>
<span class="sd"> Notes:</span>
@ -417,14 +303,13 @@
<span class="sd"> the respective inputfuncs.</span>
<span class="sd"> Keyword Args:</span>
<span class="sd"> any: Incoming data from protocol on</span>
<span class="sd"> kwargs (any): Incoming data from protocol on</span>
<span class="sd"> the form `{&quot;commandname&quot;: ((args), {kwargs}),...}`</span>
<span class="sd"> Notes:</span>
<span class="sd"> This method is here in order to give the user</span>
<span class="sd"> a single place to catch and possibly process all incoming data from</span>
<span class="sd"> the client. It should usually always end by sending</span>
<span class="sd"> this data off to `self.sessionhandler.call_inputfuncs(self, **kwargs)`.</span>
<span class="sd"> &quot;&quot;&quot;</span>
<span class="bp">self</span><span class="o">.</span><span class="n">sessionhandler</span><span class="o">.</span><span class="n">call_inputfuncs</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="o">**</span><span class="n">kwargs</span><span class="p">)</span></div>
@ -434,7 +319,9 @@
<span class="sd"> Args:</span>
<span class="sd"> text (str): String input.</span>
<span class="sd"> kwargs (str or tuple): Send-commands identified</span>
<span class="sd"> Keyword Args:</span>
<span class="sd"> any (str or tuple): Send-commands identified</span>
<span class="sd"> by their keys. Or &quot;options&quot;, carrying options</span>
<span class="sd"> for the protocol(s).</span>
@ -530,7 +417,7 @@
<div class="viewcode-block" id="ServerSession.nattributes"><a class="viewcode-back" href="../../../api/evennia.server.serversession.html#evennia.server.serversession.ServerSession.nattributes">[docs]</a> <span class="nd">@lazy_property</span>
<span class="k">def</span> <span class="nf">nattributes</span><span class="p">(</span><span class="bp">self</span><span class="p">):</span>
<span class="k">return</span> <span class="n">NAttributeHandler</span><span class="p">(</span><span class="bp">self</span><span class="p">)</span></div>
<span class="k">return</span> <span class="n">AttributeHandler</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">InMemoryAttributeBackend</span><span class="p">)</span></div>
<div class="viewcode-block" id="ServerSession.attributes"><a class="viewcode-back" href="../../../api/evennia.server.serversession.html#evennia.server.serversession.ServerSession.attributes">[docs]</a> <span class="nd">@lazy_property</span>
<span class="k">def</span> <span class="nf">attributes</span><span class="p">(</span><span class="bp">self</span><span class="p">):</span>
@ -548,7 +435,7 @@
<span class="k">try</span><span class="p">:</span>
<span class="k">return</span> <span class="bp">self</span><span class="o">.</span><span class="n">_ndb_holder</span>
<span class="k">except</span> <span class="ne">AttributeError</span><span class="p">:</span>
<span class="bp">self</span><span class="o">.</span><span class="n">_ndb_holder</span> <span class="o">=</span> <span class="n">NDbHolder</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="s2">&quot;nattrhandler&quot;</span><span class="p">,</span> <span class="n">manager_name</span><span class="o">=</span><span class="s2">&quot;nattributes&quot;</span><span class="p">)</span>
<span class="bp">self</span><span class="o">.</span><span class="n">_ndb_holder</span> <span class="o">=</span> <span class="n">DbHolder</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="s2">&quot;nattrhandler&quot;</span><span class="p">,</span> <span class="n">manager_name</span><span class="o">=</span><span class="s2">&quot;nattributes&quot;</span><span class="p">)</span>
<span class="k">return</span> <span class="bp">self</span><span class="o">.</span><span class="n">_ndb_holder</span></div>
<span class="c1"># @ndb.setter</span>

View file

@ -76,26 +76,6 @@
<span class="sd"> &quot;&quot;&quot;</span>
<span class="c1"># names of attributes that should be affected by syncing.</span>
<span class="n">_attrs_to_sync</span> <span class="o">=</span> <span class="p">(</span>
<span class="s2">&quot;protocol_key&quot;</span><span class="p">,</span>
<span class="s2">&quot;address&quot;</span><span class="p">,</span>
<span class="s2">&quot;suid&quot;</span><span class="p">,</span>
<span class="s2">&quot;sessid&quot;</span><span class="p">,</span>
<span class="s2">&quot;uid&quot;</span><span class="p">,</span>
<span class="s2">&quot;csessid&quot;</span><span class="p">,</span>
<span class="s2">&quot;uname&quot;</span><span class="p">,</span>
<span class="s2">&quot;logged_in&quot;</span><span class="p">,</span>
<span class="s2">&quot;puid&quot;</span><span class="p">,</span>
<span class="s2">&quot;conn_time&quot;</span><span class="p">,</span>
<span class="s2">&quot;cmd_last&quot;</span><span class="p">,</span>
<span class="s2">&quot;cmd_last_visible&quot;</span><span class="p">,</span>
<span class="s2">&quot;cmd_total&quot;</span><span class="p">,</span>
<span class="s2">&quot;protocol_flags&quot;</span><span class="p">,</span>
<span class="s2">&quot;server_data&quot;</span><span class="p">,</span>
<span class="s2">&quot;cmdset_storage_string&quot;</span><span class="p">,</span>
<span class="p">)</span>
<div class="viewcode-block" id="Session.init_session"><a class="viewcode-back" href="../../../api/evennia.server.session.html#evennia.server.session.Session.init_session">[docs]</a> <span class="k">def</span> <span class="nf">init_session</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">protocol_key</span><span class="p">,</span> <span class="n">address</span><span class="p">,</span> <span class="n">sessionhandler</span><span class="p">):</span>
<span class="sd">&quot;&quot;&quot;</span>
<span class="sd"> Initialize the Session. This should be called by the protocol when</span>
@ -162,9 +142,9 @@
<span class="sd"> the keys given by self._attrs_to_sync.</span>
<span class="sd"> &quot;&quot;&quot;</span>
<span class="k">return</span> <span class="nb">dict</span><span class="p">(</span>
<span class="p">(</span><span class="n">key</span><span class="p">,</span> <span class="n">value</span><span class="p">)</span> <span class="k">for</span> <span class="n">key</span><span class="p">,</span> <span class="n">value</span> <span class="ow">in</span> <span class="bp">self</span><span class="o">.</span><span class="vm">__dict__</span><span class="o">.</span><span class="n">items</span><span class="p">()</span> <span class="k">if</span> <span class="n">key</span> <span class="ow">in</span> <span class="bp">self</span><span class="o">.</span><span class="n">_attrs_to_sync</span>
<span class="p">)</span></div>
<span class="k">return</span> <span class="p">{</span>
<span class="n">attr</span><span class="p">:</span> <span class="nb">getattr</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">attr</span><span class="p">)</span> <span class="k">for</span> <span class="n">attr</span> <span class="ow">in</span> <span class="n">settings</span><span class="o">.</span><span class="n">SESSION_SYNC_ATTRS</span> <span class="k">if</span> <span class="nb">hasattr</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">attr</span><span class="p">)</span>
<span class="p">}</span></div>
<div class="viewcode-block" id="Session.load_sync_data"><a class="viewcode-back" href="../../../api/evennia.server.session.html#evennia.server.session.Session.load_sync_data">[docs]</a> <span class="k">def</span> <span class="nf">load_sync_data</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">sessdata</span><span class="p">):</span>
<span class="sd">&quot;&quot;&quot;</span>

View file

@ -45,12 +45,12 @@
<span class="sd">There are two similar but separate stores of sessions:</span>
<span class="sd"> - ServerSessionHandler - this stores generic game sessions</span>
<span class="sd"> for the game. These sessions has no knowledge about</span>
<span class="sd"> how they are connected to the world.</span>
<span class="sd"> - PortalSessionHandler - this stores sessions created by</span>
<span class="sd"> twisted protocols. These are dumb connectors that</span>
<span class="sd"> handle network communication but holds no game info.</span>
<span class="sd">- ServerSessionHandler - this stores generic game sessions</span>
<span class="sd"> for the game. These sessions has no knowledge about</span>
<span class="sd"> how they are connected to the world.</span>
<span class="sd">- PortalSessionHandler - this stores sessions created by</span>
<span class="sd"> twisted protocols. These are dumb connectors that</span>
<span class="sd"> handle network communication but holds no game info.</span>
<span class="sd">&quot;&quot;&quot;</span>
<span class="kn">import</span> <span class="nn">time</span>
@ -64,7 +64,9 @@
<span class="n">make_iter</span><span class="p">,</span>
<span class="n">delay</span><span class="p">,</span>
<span class="n">callables_from_module</span><span class="p">,</span>
<span class="n">class_from_module</span><span class="p">,</span>
<span class="p">)</span>
<span class="kn">from</span> <span class="nn">evennia.server.portal</span> <span class="k">import</span> <span class="n">amp</span>
<span class="kn">from</span> <span class="nn">evennia.server.signals</span> <span class="k">import</span> <span class="n">SIGNAL_ACCOUNT_POST_LOGIN</span><span class="p">,</span> <span class="n">SIGNAL_ACCOUNT_POST_LOGOUT</span>
<span class="kn">from</span> <span class="nn">evennia.server.signals</span> <span class="k">import</span> <span class="n">SIGNAL_ACCOUNT_POST_FIRST_LOGIN</span><span class="p">,</span> <span class="n">SIGNAL_ACCOUNT_POST_LAST_LOGOUT</span>
<span class="kn">from</span> <span class="nn">evennia.utils.inlinefuncs</span> <span class="k">import</span> <span class="n">parse_inlinefunc</span>
@ -88,25 +90,6 @@
<span class="n">DUMMYSESSION</span> <span class="o">=</span> <span class="n">DummySession</span><span class="p">()</span>
<span class="c1"># AMP signals</span>
<span class="n">PCONN</span> <span class="o">=</span> <span class="nb">chr</span><span class="p">(</span><span class="mi">1</span><span class="p">)</span> <span class="c1"># portal session connect</span>
<span class="n">PDISCONN</span> <span class="o">=</span> <span class="nb">chr</span><span class="p">(</span><span class="mi">2</span><span class="p">)</span> <span class="c1"># portal session disconnect</span>
<span class="n">PSYNC</span> <span class="o">=</span> <span class="nb">chr</span><span class="p">(</span><span class="mi">3</span><span class="p">)</span> <span class="c1"># portal session sync</span>
<span class="n">SLOGIN</span> <span class="o">=</span> <span class="nb">chr</span><span class="p">(</span><span class="mi">4</span><span class="p">)</span> <span class="c1"># server session login</span>
<span class="n">SDISCONN</span> <span class="o">=</span> <span class="nb">chr</span><span class="p">(</span><span class="mi">5</span><span class="p">)</span> <span class="c1"># server session disconnect</span>
<span class="n">SDISCONNALL</span> <span class="o">=</span> <span class="nb">chr</span><span class="p">(</span><span class="mi">6</span><span class="p">)</span> <span class="c1"># server session disconnect all</span>
<span class="n">SSHUTD</span> <span class="o">=</span> <span class="nb">chr</span><span class="p">(</span><span class="mi">7</span><span class="p">)</span> <span class="c1"># server shutdown</span>
<span class="n">SSYNC</span> <span class="o">=</span> <span class="nb">chr</span><span class="p">(</span><span class="mi">8</span><span class="p">)</span> <span class="c1"># server session sync</span>
<span class="n">SCONN</span> <span class="o">=</span> <span class="nb">chr</span><span class="p">(</span><span class="mi">11</span><span class="p">)</span> <span class="c1"># server portal connection (for bots)</span>
<span class="n">PCONNSYNC</span> <span class="o">=</span> <span class="nb">chr</span><span class="p">(</span><span class="mi">12</span><span class="p">)</span> <span class="c1"># portal post-syncing session</span>
<span class="n">PDISCONNALL</span> <span class="o">=</span> <span class="nb">chr</span><span class="p">(</span><span class="mi">13</span><span class="p">)</span> <span class="c1"># portal session discnnect all</span>
<span class="n">SRELOAD</span> <span class="o">=</span> <span class="nb">chr</span><span class="p">(</span><span class="mi">14</span><span class="p">)</span> <span class="c1"># server reloading (have portal start a new server)</span>
<span class="n">SSTART</span> <span class="o">=</span> <span class="nb">chr</span><span class="p">(</span><span class="mi">15</span><span class="p">)</span> <span class="c1"># server start (portal must already be running anyway)</span>
<span class="n">PSHUTD</span> <span class="o">=</span> <span class="nb">chr</span><span class="p">(</span><span class="mi">16</span><span class="p">)</span> <span class="c1"># portal (+server) shutdown</span>
<span class="n">SSHUTD</span> <span class="o">=</span> <span class="nb">chr</span><span class="p">(</span><span class="mi">17</span><span class="p">)</span> <span class="c1"># server shutdown</span>
<span class="n">PSTATUS</span> <span class="o">=</span> <span class="nb">chr</span><span class="p">(</span><span class="mi">18</span><span class="p">)</span> <span class="c1"># ping server or portal status</span>
<span class="n">SRESET</span> <span class="o">=</span> <span class="nb">chr</span><span class="p">(</span><span class="mi">19</span><span class="p">)</span> <span class="c1"># server shutdown in reset mode</span>
<span class="c1"># i18n</span>
<span class="kn">from</span> <span class="nn">django.utils.translation</span> <span class="k">import</span> <span class="n">gettext</span> <span class="k">as</span> <span class="n">_</span>
@ -214,23 +197,20 @@
<span class="sd"> Args:</span>
<span class="sd"> session (Session): The relevant session instance.</span>
<span class="sd"> kwargs (dict) Each keyword represents a</span>
<span class="sd"> send-instruction, with the keyword itself being the name</span>
<span class="sd"> kwargs (dict) Each keyword represents a send-instruction, with the keyword itself being the name</span>
<span class="sd"> of the instruction (like &quot;text&quot;). Suitable values for each</span>
<span class="sd"> keyword are:</span>
<span class="sd"> ::</span>
<span class="sd"> arg -&gt; [[arg], {}]</span>
<span class="sd"> [args] -&gt; [[args], {}]</span>
<span class="sd"> {kwargs} -&gt; [[], {kwargs}]</span>
<span class="sd"> [args, {kwargs}] -&gt; [[arg], {kwargs}]</span>
<span class="sd"> [[args], {kwargs}] -&gt; [[args], {kwargs}]</span>
<span class="sd"> - arg -&gt; [[arg], {}]</span>
<span class="sd"> - [args] -&gt; [[args], {}]</span>
<span class="sd"> - {kwargs} -&gt; [[], {kwargs}]</span>
<span class="sd"> - [args, {kwargs}] -&gt; [[arg], {kwargs}]</span>
<span class="sd"> - [[args], {kwargs}] -&gt; [[args], {kwargs}]</span>
<span class="sd"> Returns:</span>
<span class="sd"> kwargs (dict): A cleaned dictionary of cmdname:[[args],{kwargs}] pairs,</span>
<span class="sd"> where the keys, args and kwargs have all been converted to</span>
<span class="sd"> send-safe entities (strings or numbers), and inlinefuncs have been</span>
<span class="sd"> applied.</span>
<span class="sd"> where the keys, args and kwargs have all been converted to</span>
<span class="sd"> send-safe entities (strings or numbers), and inlinefuncs have been</span>
<span class="sd"> applied.</span>
<span class="sd"> &quot;&quot;&quot;</span>
<span class="n">options</span> <span class="o">=</span> <span class="n">kwargs</span><span class="o">.</span><span class="n">pop</span><span class="p">(</span><span class="s2">&quot;options&quot;</span><span class="p">,</span> <span class="kc">None</span><span class="p">)</span> <span class="ow">or</span> <span class="p">{}</span>
@ -494,7 +474,7 @@
<span class="sd"> &quot;&quot;&quot;</span>
<span class="bp">self</span><span class="o">.</span><span class="n">server</span><span class="o">.</span><span class="n">amp_protocol</span><span class="o">.</span><span class="n">send_AdminServer2Portal</span><span class="p">(</span>
<span class="n">DUMMYSESSION</span><span class="p">,</span> <span class="n">operation</span><span class="o">=</span><span class="n">SCONN</span><span class="p">,</span> <span class="n">protocol_path</span><span class="o">=</span><span class="n">protocol_path</span><span class="p">,</span> <span class="n">config</span><span class="o">=</span><span class="n">configdict</span>
<span class="n">DUMMYSESSION</span><span class="p">,</span> <span class="n">operation</span><span class="o">=</span><span class="n">amp</span><span class="o">.</span><span class="n">SCONN</span><span class="p">,</span> <span class="n">protocol_path</span><span class="o">=</span><span class="n">protocol_path</span><span class="p">,</span> <span class="n">config</span><span class="o">=</span><span class="n">configdict</span>
<span class="p">)</span></div>
<div class="viewcode-block" id="ServerSessionHandler.portal_restart_server"><a class="viewcode-back" href="../../../api/evennia.server.sessionhandler.html#evennia.server.sessionhandler.ServerSessionHandler.portal_restart_server">[docs]</a> <span class="k">def</span> <span class="nf">portal_restart_server</span><span class="p">(</span><span class="bp">self</span><span class="p">):</span>
@ -502,14 +482,14 @@
<span class="sd"> Called by server when reloading. We tell the portal to start a new server instance.</span>
<span class="sd"> &quot;&quot;&quot;</span>
<span class="bp">self</span><span class="o">.</span><span class="n">server</span><span class="o">.</span><span class="n">amp_protocol</span><span class="o">.</span><span class="n">send_AdminServer2Portal</span><span class="p">(</span><span class="n">DUMMYSESSION</span><span class="p">,</span> <span class="n">operation</span><span class="o">=</span><span class="n">SRELOAD</span><span class="p">)</span></div>
<span class="bp">self</span><span class="o">.</span><span class="n">server</span><span class="o">.</span><span class="n">amp_protocol</span><span class="o">.</span><span class="n">send_AdminServer2Portal</span><span class="p">(</span><span class="n">DUMMYSESSION</span><span class="p">,</span> <span class="n">operation</span><span class="o">=</span><span class="n">amp</span><span class="o">.</span><span class="n">SRELOAD</span><span class="p">)</span></div>
<div class="viewcode-block" id="ServerSessionHandler.portal_reset_server"><a class="viewcode-back" href="../../../api/evennia.server.sessionhandler.html#evennia.server.sessionhandler.ServerSessionHandler.portal_reset_server">[docs]</a> <span class="k">def</span> <span class="nf">portal_reset_server</span><span class="p">(</span><span class="bp">self</span><span class="p">):</span>
<span class="sd">&quot;&quot;&quot;</span>
<span class="sd"> Called by server when reloading. We tell the portal to start a new server instance.</span>
<span class="sd"> &quot;&quot;&quot;</span>
<span class="bp">self</span><span class="o">.</span><span class="n">server</span><span class="o">.</span><span class="n">amp_protocol</span><span class="o">.</span><span class="n">send_AdminServer2Portal</span><span class="p">(</span><span class="n">DUMMYSESSION</span><span class="p">,</span> <span class="n">operation</span><span class="o">=</span><span class="n">SRESET</span><span class="p">)</span></div>
<span class="bp">self</span><span class="o">.</span><span class="n">server</span><span class="o">.</span><span class="n">amp_protocol</span><span class="o">.</span><span class="n">send_AdminServer2Portal</span><span class="p">(</span><span class="n">DUMMYSESSION</span><span class="p">,</span> <span class="n">operation</span><span class="o">=</span><span class="n">amp</span><span class="o">.</span><span class="n">SRESET</span><span class="p">)</span></div>
<div class="viewcode-block" id="ServerSessionHandler.portal_shutdown"><a class="viewcode-back" href="../../../api/evennia.server.sessionhandler.html#evennia.server.sessionhandler.ServerSessionHandler.portal_shutdown">[docs]</a> <span class="k">def</span> <span class="nf">portal_shutdown</span><span class="p">(</span><span class="bp">self</span><span class="p">):</span>
<span class="sd">&quot;&quot;&quot;</span>
@ -517,7 +497,7 @@
<span class="sd"> itself down)</span>
<span class="sd"> &quot;&quot;&quot;</span>
<span class="bp">self</span><span class="o">.</span><span class="n">server</span><span class="o">.</span><span class="n">amp_protocol</span><span class="o">.</span><span class="n">send_AdminServer2Portal</span><span class="p">(</span><span class="n">DUMMYSESSION</span><span class="p">,</span> <span class="n">operation</span><span class="o">=</span><span class="n">PSHUTD</span><span class="p">)</span></div>
<span class="bp">self</span><span class="o">.</span><span class="n">server</span><span class="o">.</span><span class="n">amp_protocol</span><span class="o">.</span><span class="n">send_AdminServer2Portal</span><span class="p">(</span><span class="n">DUMMYSESSION</span><span class="p">,</span> <span class="n">operation</span><span class="o">=</span><span class="n">amp</span><span class="o">.</span><span class="n">PSHUTD</span><span class="p">)</span></div>
<div class="viewcode-block" id="ServerSessionHandler.login"><a class="viewcode-back" href="../../../api/evennia.server.sessionhandler.html#evennia.server.sessionhandler.ServerSessionHandler.login">[docs]</a> <span class="k">def</span> <span class="nf">login</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">session</span><span class="p">,</span> <span class="n">account</span><span class="p">,</span> <span class="n">force</span><span class="o">=</span><span class="kc">False</span><span class="p">,</span> <span class="n">testmode</span><span class="o">=</span><span class="kc">False</span><span class="p">):</span>
<span class="sd">&quot;&quot;&quot;</span>
@ -565,7 +545,7 @@
<span class="c1"># sync the portal to the session</span>
<span class="k">if</span> <span class="ow">not</span> <span class="n">testmode</span><span class="p">:</span>
<span class="bp">self</span><span class="o">.</span><span class="n">server</span><span class="o">.</span><span class="n">amp_protocol</span><span class="o">.</span><span class="n">send_AdminServer2Portal</span><span class="p">(</span>
<span class="n">session</span><span class="p">,</span> <span class="n">operation</span><span class="o">=</span><span class="n">SLOGIN</span><span class="p">,</span> <span class="n">sessiondata</span><span class="o">=</span><span class="p">{</span><span class="s2">&quot;logged_in&quot;</span><span class="p">:</span> <span class="kc">True</span><span class="p">,</span> <span class="s2">&quot;uid&quot;</span><span class="p">:</span> <span class="n">session</span><span class="o">.</span><span class="n">uid</span><span class="p">}</span>
<span class="n">session</span><span class="p">,</span> <span class="n">operation</span><span class="o">=</span><span class="n">amp</span><span class="o">.</span><span class="n">SLOGIN</span><span class="p">,</span> <span class="n">sessiondata</span><span class="o">=</span><span class="p">{</span><span class="s2">&quot;logged_in&quot;</span><span class="p">:</span> <span class="kc">True</span><span class="p">,</span> <span class="s2">&quot;uid&quot;</span><span class="p">:</span> <span class="n">session</span><span class="o">.</span><span class="n">uid</span><span class="p">}</span>
<span class="p">)</span>
<span class="n">account</span><span class="o">.</span><span class="n">at_post_login</span><span class="p">(</span><span class="n">session</span><span class="o">=</span><span class="n">session</span><span class="p">)</span>
<span class="k">if</span> <span class="n">nsess</span> <span class="o">&lt;</span> <span class="mi">2</span><span class="p">:</span>
@ -610,7 +590,7 @@
<span class="k">if</span> <span class="n">sync_portal</span><span class="p">:</span>
<span class="c1"># inform portal that session should be closed.</span>
<span class="bp">self</span><span class="o">.</span><span class="n">server</span><span class="o">.</span><span class="n">amp_protocol</span><span class="o">.</span><span class="n">send_AdminServer2Portal</span><span class="p">(</span>
<span class="n">session</span><span class="p">,</span> <span class="n">operation</span><span class="o">=</span><span class="n">SDISCONN</span><span class="p">,</span> <span class="n">reason</span><span class="o">=</span><span class="n">reason</span>
<span class="n">session</span><span class="p">,</span> <span class="n">operation</span><span class="o">=</span><span class="n">amp</span><span class="o">.</span><span class="n">SDISCONN</span><span class="p">,</span> <span class="n">reason</span><span class="o">=</span><span class="n">reason</span>
<span class="p">)</span></div>
<div class="viewcode-block" id="ServerSessionHandler.all_sessions_portal_sync"><a class="viewcode-back" href="../../../api/evennia.server.sessionhandler.html#evennia.server.sessionhandler.ServerSessionHandler.all_sessions_portal_sync">[docs]</a> <span class="k">def</span> <span class="nf">all_sessions_portal_sync</span><span class="p">(</span><span class="bp">self</span><span class="p">):</span>
@ -621,7 +601,7 @@
<span class="sd"> &quot;&quot;&quot;</span>
<span class="n">sessdata</span> <span class="o">=</span> <span class="bp">self</span><span class="o">.</span><span class="n">get_all_sync_data</span><span class="p">()</span>
<span class="k">return</span> <span class="bp">self</span><span class="o">.</span><span class="n">server</span><span class="o">.</span><span class="n">amp_protocol</span><span class="o">.</span><span class="n">send_AdminServer2Portal</span><span class="p">(</span>
<span class="n">DUMMYSESSION</span><span class="p">,</span> <span class="n">operation</span><span class="o">=</span><span class="n">SSYNC</span><span class="p">,</span> <span class="n">sessiondata</span><span class="o">=</span><span class="n">sessdata</span>
<span class="n">DUMMYSESSION</span><span class="p">,</span> <span class="n">operation</span><span class="o">=</span><span class="n">amp</span><span class="o">.</span><span class="n">SSYNC</span><span class="p">,</span> <span class="n">sessiondata</span><span class="o">=</span><span class="n">sessdata</span>
<span class="p">)</span></div>
<div class="viewcode-block" id="ServerSessionHandler.session_portal_sync"><a class="viewcode-back" href="../../../api/evennia.server.sessionhandler.html#evennia.server.sessionhandler.ServerSessionHandler.session_portal_sync">[docs]</a> <span class="k">def</span> <span class="nf">session_portal_sync</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">session</span><span class="p">):</span>
@ -632,7 +612,7 @@
<span class="sd"> &quot;&quot;&quot;</span>
<span class="n">sessdata</span> <span class="o">=</span> <span class="p">{</span><span class="n">session</span><span class="o">.</span><span class="n">sessid</span><span class="p">:</span> <span class="n">session</span><span class="o">.</span><span class="n">get_sync_data</span><span class="p">()}</span>
<span class="k">return</span> <span class="bp">self</span><span class="o">.</span><span class="n">server</span><span class="o">.</span><span class="n">amp_protocol</span><span class="o">.</span><span class="n">send_AdminServer2Portal</span><span class="p">(</span>
<span class="n">DUMMYSESSION</span><span class="p">,</span> <span class="n">operation</span><span class="o">=</span><span class="n">SSYNC</span><span class="p">,</span> <span class="n">sessiondata</span><span class="o">=</span><span class="n">sessdata</span><span class="p">,</span> <span class="n">clean</span><span class="o">=</span><span class="kc">False</span>
<span class="n">DUMMYSESSION</span><span class="p">,</span> <span class="n">operation</span><span class="o">=</span><span class="n">amp</span><span class="o">.</span><span class="n">SSYNC</span><span class="p">,</span> <span class="n">sessiondata</span><span class="o">=</span><span class="n">sessdata</span><span class="p">,</span> <span class="n">clean</span><span class="o">=</span><span class="kc">False</span>
<span class="p">)</span></div>
<div class="viewcode-block" id="ServerSessionHandler.session_portal_partial_sync"><a class="viewcode-back" href="../../../api/evennia.server.sessionhandler.html#evennia.server.sessionhandler.ServerSessionHandler.session_portal_partial_sync">[docs]</a> <span class="k">def</span> <span class="nf">session_portal_partial_sync</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">session_data</span><span class="p">):</span>
@ -645,7 +625,7 @@
<span class="sd"> &quot;&quot;&quot;</span>
<span class="k">return</span> <span class="bp">self</span><span class="o">.</span><span class="n">server</span><span class="o">.</span><span class="n">amp_protocol</span><span class="o">.</span><span class="n">send_AdminServer2Portal</span><span class="p">(</span>
<span class="n">DUMMYSESSION</span><span class="p">,</span> <span class="n">operation</span><span class="o">=</span><span class="n">SSYNC</span><span class="p">,</span> <span class="n">sessiondata</span><span class="o">=</span><span class="n">session_data</span><span class="p">,</span> <span class="n">clean</span><span class="o">=</span><span class="kc">False</span>
<span class="n">DUMMYSESSION</span><span class="p">,</span> <span class="n">operation</span><span class="o">=</span><span class="n">amp</span><span class="o">.</span><span class="n">SSYNC</span><span class="p">,</span> <span class="n">sessiondata</span><span class="o">=</span><span class="n">session_data</span><span class="p">,</span> <span class="n">clean</span><span class="o">=</span><span class="kc">False</span>
<span class="p">)</span></div>
<div class="viewcode-block" id="ServerSessionHandler.disconnect_all_sessions"><a class="viewcode-back" href="../../../api/evennia.server.sessionhandler.html#evennia.server.sessionhandler.ServerSessionHandler.disconnect_all_sessions">[docs]</a> <span class="k">def</span> <span class="nf">disconnect_all_sessions</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">reason</span><span class="o">=</span><span class="s2">&quot;You have been disconnected.&quot;</span><span class="p">):</span>
@ -661,7 +641,7 @@
<span class="k">del</span> <span class="n">session</span>
<span class="c1"># tell portal to disconnect all sessions</span>
<span class="bp">self</span><span class="o">.</span><span class="n">server</span><span class="o">.</span><span class="n">amp_protocol</span><span class="o">.</span><span class="n">send_AdminServer2Portal</span><span class="p">(</span>
<span class="n">DUMMYSESSION</span><span class="p">,</span> <span class="n">operation</span><span class="o">=</span><span class="n">SDISCONNALL</span><span class="p">,</span> <span class="n">reason</span><span class="o">=</span><span class="n">reason</span>
<span class="n">DUMMYSESSION</span><span class="p">,</span> <span class="n">operation</span><span class="o">=</span><span class="n">amp</span><span class="o">.</span><span class="n">SDISCONNALL</span><span class="p">,</span> <span class="n">reason</span><span class="o">=</span><span class="n">reason</span>
<span class="p">)</span></div>
<div class="viewcode-block" id="ServerSessionHandler.disconnect_duplicate_sessions"><a class="viewcode-back" href="../../../api/evennia.server.sessionhandler.html#evennia.server.sessionhandler.ServerSessionHandler.disconnect_duplicate_sessions">[docs]</a> <span class="k">def</span> <span class="nf">disconnect_duplicate_sessions</span><span class="p">(</span>
@ -804,8 +784,9 @@
<span class="sd"> Given a client identification hash (for session types that offer them)</span>
<span class="sd"> return all sessions with a matching hash.</span>
<span class="sd"> Args:</span>
<span class="sd"> Args</span>
<span class="sd"> csessid (str): The session hash.</span>
<span class="sd"> Returns:</span>
<span class="sd"> sessions (list): The sessions with matching .csessid, if any.</span>
@ -868,9 +849,9 @@
<div class="viewcode-block" id="ServerSessionHandler.call_inputfuncs"><a class="viewcode-back" href="../../../api/evennia.server.sessionhandler.html#evennia.server.sessionhandler.ServerSessionHandler.call_inputfuncs">[docs]</a> <span class="k">def</span> <span class="nf">call_inputfuncs</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">session</span><span class="p">,</span> <span class="o">**</span><span class="n">kwargs</span><span class="p">):</span>
<span class="sd">&quot;&quot;&quot;</span>
<span class="sd"> Split incoming data into its inputfunc counterparts.</span>
<span class="sd"> This should be called by the serversession.data_in</span>
<span class="sd"> as `sessionhandler.call_inputfunc(self, **kwargs)`.</span>
<span class="sd"> Split incoming data into its inputfunc counterparts. This should be</span>
<span class="sd"> called by the `serversession.data_in` as</span>
<span class="sd"> `sessionhandler.call_inputfunc(self, **kwargs)`.</span>
<span class="sd"> We also intercept OOB communication here.</span>
@ -878,8 +859,8 @@
<span class="sd"> sessions (Session): Session.</span>
<span class="sd"> Keyword Args:</span>
<span class="sd"> kwargs (any): Incoming data from protocol on</span>
<span class="sd"> the form `{&quot;commandname&quot;: ((args), {kwargs}),...}`</span>
<span class="sd"> any (tuple): Incoming data from protocol, each</span>
<span class="sd"> on the form `commandname=((args), {kwargs})`.</span>
<span class="sd"> &quot;&quot;&quot;</span>
@ -900,7 +881,11 @@
<span class="n">log_trace</span><span class="p">()</span></div></div>
<span class="n">SESSION_HANDLER</span> <span class="o">=</span> <span class="n">ServerSessionHandler</span><span class="p">()</span>
<span class="c1"># import class from settings</span>
<span class="n">_SESSION_HANDLER_CLASS</span> <span class="o">=</span> <span class="n">class_from_module</span><span class="p">(</span><span class="n">settings</span><span class="o">.</span><span class="n">SERVER_SESSION_HANDLER_CLASS</span><span class="p">)</span>
<span class="c1"># Instantiate class. These globals are used to provide singleton-like behavior.</span>
<span class="n">SESSION_HANDLER</span> <span class="o">=</span> <span class="n">_SESSION_HANDLER_CLASS</span><span class="p">()</span>
<span class="n">SESSIONS</span> <span class="o">=</span> <span class="n">SESSION_HANDLER</span> <span class="c1"># legacy</span>
</pre></div>

File diff suppressed because it is too large Load diff

View file

@ -72,17 +72,15 @@
<span class="c1"># Attribute manager methods</span>
<div class="viewcode-block" id="TypedObjectManager.get_attribute"><a class="viewcode-back" href="../../../api/evennia.typeclasses.managers.html#evennia.typeclasses.managers.TypedObjectManager.get_attribute">[docs]</a> <span class="k">def</span> <span class="nf">get_attribute</span><span class="p">(</span>
<span class="bp">self</span><span class="p">,</span> <span class="n">key</span><span class="o">=</span><span class="kc">None</span><span class="p">,</span> <span class="n">category</span><span class="o">=</span><span class="kc">None</span><span class="p">,</span> <span class="n">value</span><span class="o">=</span><span class="kc">None</span><span class="p">,</span> <span class="n">strvalue</span><span class="o">=</span><span class="kc">None</span><span class="p">,</span>
<span class="n">obj</span><span class="o">=</span><span class="kc">None</span><span class="p">,</span> <span class="n">attrtype</span><span class="o">=</span><span class="kc">None</span><span class="p">,</span> <span class="o">**</span><span class="n">kwargs</span><span class="p">):</span>
<span class="bp">self</span><span class="p">,</span> <span class="n">key</span><span class="o">=</span><span class="kc">None</span><span class="p">,</span> <span class="n">category</span><span class="o">=</span><span class="kc">None</span><span class="p">,</span> <span class="n">value</span><span class="o">=</span><span class="kc">None</span><span class="p">,</span> <span class="n">strvalue</span><span class="o">=</span><span class="kc">None</span><span class="p">,</span> <span class="n">obj</span><span class="o">=</span><span class="kc">None</span><span class="p">,</span> <span class="n">attrtype</span><span class="o">=</span><span class="kc">None</span><span class="p">,</span> <span class="o">**</span><span class="n">kwargs</span>
<span class="p">):</span>
<span class="sd">&quot;&quot;&quot;</span>
<span class="sd"> Return Attribute objects by key, by category, by value, by</span>
<span class="sd"> `strvalue`, by object (it is stored on) or with a combination of</span>
<span class="sd"> those criteria.</span>
<span class="sd"> Return Attribute objects by key, by category, by value, by strvalue, by</span>
<span class="sd"> object (it is stored on) or with a combination of those criteria.</span>
<span class="sd"> Args:</span>
<span class="sd"> key (str, optional): The attribute&#39;s key to search for.</span>
<span class="sd"> category (str, optional): The category of the attribute(s)</span>
<span class="sd"> to search for.</span>
<span class="sd"> key (str, optional): The attribute&#39;s key to search for</span>
<span class="sd"> category (str, optional): The category of the attribute(s) to search for.</span>
<span class="sd"> value (str, optional): The attribute value to search for.</span>
<span class="sd"> Note that this is not a very efficient operation since it</span>
<span class="sd"> will query for a pickled entity. Mutually exclusive to</span>
@ -93,13 +91,13 @@
<span class="sd"> precedence if given.</span>
<span class="sd"> obj (Object, optional): On which object the Attribute to</span>
<span class="sd"> search for is.</span>
<span class="sd"> attrtype (str, optional): An attribute-type to search for.</span>
<span class="sd"> attrype (str, optional): An attribute-type to search for.</span>
<span class="sd"> By default this is either `None` (normal Attributes) or</span>
<span class="sd"> `&quot;nick&quot;`.</span>
<span class="sd"> kwargs (any): Currently unused. Reserved for future use.</span>
<span class="sd"> **kwargs (any): Currently unused. Reserved for future use.</span>
<span class="sd"> Returns:</span>
<span class="sd"> attributes (list): The matching Attributes.</span>
<span class="sd"> list: The matching Attributes.</span>
<span class="sd"> &quot;&quot;&quot;</span>
<span class="n">dbmodel</span> <span class="o">=</span> <span class="bp">self</span><span class="o">.</span><span class="n">model</span><span class="o">.</span><span class="n">__dbclass__</span><span class="o">.</span><span class="vm">__name__</span><span class="o">.</span><span class="n">lower</span><span class="p">()</span>
@ -217,7 +215,7 @@
<span class="sd"> to search for.</span>
<span class="sd"> obj (Object, optional): On which object the Tag to</span>
<span class="sd"> search for is.</span>
<span class="sd"> tagtype (str, optional): One of None (normal tags),</span>
<span class="sd"> tagtype (str, optional): One of `None` (normal tags),</span>
<span class="sd"> &quot;alias&quot; or &quot;permission&quot;</span>
<span class="sd"> global_search (bool, optional): Include all possible tags,</span>
<span class="sd"> not just tags on this object</span>
@ -620,7 +618,7 @@
<span class="k">for</span> <span class="n">parent</span> <span class="ow">in</span> <span class="p">(</span><span class="n">parent</span> <span class="k">for</span> <span class="n">parent</span> <span class="ow">in</span> <span class="n">parents</span> <span class="k">if</span> <span class="nb">hasattr</span><span class="p">(</span><span class="n">parent</span><span class="p">,</span> <span class="s2">&quot;path&quot;</span><span class="p">)):</span>
<span class="n">query</span> <span class="o">=</span> <span class="n">query</span> <span class="o">|</span> <span class="n">Q</span><span class="p">(</span><span class="n">db_typeclass_path__exact</span><span class="o">=</span><span class="n">parent</span><span class="o">.</span><span class="n">path</span><span class="p">)</span>
<span class="c1"># actually query the database</span>
<span class="k">return</span> <span class="bp">self</span><span class="o">.</span><span class="n">filter</span><span class="p">(</span><span class="n">query</span><span class="p">)</span></div></div>
<span class="k">return</span> <span class="nb">super</span><span class="p">()</span><span class="o">.</span><span class="n">filter</span><span class="p">(</span><span class="n">query</span><span class="p">)</span></div></div>
<span class="k">class</span> <span class="nc">TypeclassManager</span><span class="p">(</span><span class="n">TypedObjectManager</span><span class="p">):</span>

View file

@ -65,8 +65,6 @@
<span class="sd">This module also contains the Managers for the respective models; inherit from</span>
<span class="sd">these to create custom managers.</span>
<span class="sd">----</span>
<span class="sd">&quot;&quot;&quot;</span>
<span class="kn">from</span> <span class="nn">django.db.models</span> <span class="k">import</span> <span class="n">signals</span>
@ -79,7 +77,13 @@
<span class="kn">from</span> <span class="nn">django.utils.encoding</span> <span class="k">import</span> <span class="n">smart_str</span>
<span class="kn">from</span> <span class="nn">django.utils.text</span> <span class="k">import</span> <span class="n">slugify</span>
<span class="kn">from</span> <span class="nn">evennia.typeclasses.attributes</span> <span class="k">import</span> <span class="n">Attribute</span><span class="p">,</span> <span class="n">AttributeHandler</span><span class="p">,</span> <span class="n">NAttributeHandler</span>
<span class="kn">from</span> <span class="nn">evennia.typeclasses.attributes</span> <span class="k">import</span> <span class="p">(</span>
<span class="n">Attribute</span><span class="p">,</span>
<span class="n">AttributeHandler</span><span class="p">,</span>
<span class="n">ModelAttributeBackend</span><span class="p">,</span>
<span class="n">InMemoryAttributeBackend</span><span class="p">,</span>
<span class="p">)</span>
<span class="kn">from</span> <span class="nn">evennia.typeclasses.attributes</span> <span class="k">import</span> <span class="n">DbHolder</span>
<span class="kn">from</span> <span class="nn">evennia.typeclasses.tags</span> <span class="k">import</span> <span class="n">Tag</span><span class="p">,</span> <span class="n">TagHandler</span><span class="p">,</span> <span class="n">AliasHandler</span><span class="p">,</span> <span class="n">PermissionHandler</span>
<span class="kn">from</span> <span class="nn">evennia.utils.idmapper.models</span> <span class="k">import</span> <span class="n">SharedMemoryModel</span><span class="p">,</span> <span class="n">SharedMemoryModelBase</span>
@ -203,35 +207,6 @@
<span class="k">return</span> <span class="n">new_class</span>
<span class="k">class</span> <span class="nc">DbHolder</span><span class="p">(</span><span class="nb">object</span><span class="p">):</span>
<span class="sd">&quot;&quot;&quot;</span>
<span class="sd"> Holder for allowing property access of attributes.</span>
<span class="sd"> &quot;&quot;&quot;</span>
<span class="k">def</span> <span class="nf">__init__</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">obj</span><span class="p">,</span> <span class="n">name</span><span class="p">,</span> <span class="n">manager_name</span><span class="o">=</span><span class="s2">&quot;attributes&quot;</span><span class="p">):</span>
<span class="n">_SA</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">name</span><span class="p">,</span> <span class="n">_GA</span><span class="p">(</span><span class="n">obj</span><span class="p">,</span> <span class="n">manager_name</span><span class="p">))</span>
<span class="n">_SA</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="s2">&quot;name&quot;</span><span class="p">,</span> <span class="n">name</span><span class="p">)</span>
<span class="k">def</span> <span class="nf">__getattribute__</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">attrname</span><span class="p">):</span>
<span class="k">if</span> <span class="n">attrname</span> <span class="o">==</span> <span class="s2">&quot;all&quot;</span><span class="p">:</span>
<span class="c1"># we allow to overload our default .all</span>
<span class="n">attr</span> <span class="o">=</span> <span class="n">_GA</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">_GA</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="s2">&quot;name&quot;</span><span class="p">))</span><span class="o">.</span><span class="n">get</span><span class="p">(</span><span class="s2">&quot;all&quot;</span><span class="p">)</span>
<span class="k">return</span> <span class="n">attr</span> <span class="k">if</span> <span class="n">attr</span> <span class="k">else</span> <span class="n">_GA</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="s2">&quot;all&quot;</span><span class="p">)</span>
<span class="k">return</span> <span class="n">_GA</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">_GA</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="s2">&quot;name&quot;</span><span class="p">))</span><span class="o">.</span><span class="n">get</span><span class="p">(</span><span class="n">attrname</span><span class="p">)</span>
<span class="k">def</span> <span class="nf">__setattr__</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">attrname</span><span class="p">,</span> <span class="n">value</span><span class="p">):</span>
<span class="n">_GA</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">_GA</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="s2">&quot;name&quot;</span><span class="p">))</span><span class="o">.</span><span class="n">add</span><span class="p">(</span><span class="n">attrname</span><span class="p">,</span> <span class="n">value</span><span class="p">)</span>
<span class="k">def</span> <span class="nf">__delattr__</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">attrname</span><span class="p">):</span>
<span class="n">_GA</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">_GA</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="s2">&quot;name&quot;</span><span class="p">))</span><span class="o">.</span><span class="n">remove</span><span class="p">(</span><span class="n">attrname</span><span class="p">)</span>
<span class="k">def</span> <span class="nf">get_all</span><span class="p">(</span><span class="bp">self</span><span class="p">):</span>
<span class="k">return</span> <span class="n">_GA</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">_GA</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="s2">&quot;name&quot;</span><span class="p">))</span><span class="o">.</span><span class="n">all</span><span class="p">()</span>
<span class="nb">all</span> <span class="o">=</span> <span class="nb">property</span><span class="p">(</span><span class="n">get_all</span><span class="p">)</span>
<span class="c1">#</span>
<span class="c1"># Main TypedObject abstraction</span>
<span class="c1">#</span>
@ -355,8 +330,10 @@
<span class="sd"> than use the one in the model.</span>
<span class="sd"> Args:</span>
<span class="sd"> *args: Passed through to parent.</span>
<span class="sd"> **kwargs: Passed through to parent.</span>
<span class="sd"> Passed through to parent.</span>
<span class="sd"> Keyword Args:</span>
<span class="sd"> Passed through to parent.</span>
<span class="sd"> Notes:</span>
<span class="sd"> The loading mechanism will attempt the following steps:</span>
@ -383,7 +360,7 @@
<span class="c1"># initialize all handlers in a lazy fashion</span>
<div class="viewcode-block" id="TypedObject.attributes"><a class="viewcode-back" href="../../../api/evennia.typeclasses.models.html#evennia.typeclasses.models.TypedObject.attributes">[docs]</a> <span class="nd">@lazy_property</span>
<span class="k">def</span> <span class="nf">attributes</span><span class="p">(</span><span class="bp">self</span><span class="p">):</span>
<span class="k">return</span> <span class="n">AttributeHandler</span><span class="p">(</span><span class="bp">self</span><span class="p">)</span></div>
<span class="k">return</span> <span class="n">AttributeHandler</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">ModelAttributeBackend</span><span class="p">)</span></div>
<div class="viewcode-block" id="TypedObject.locks"><a class="viewcode-back" href="../../../api/evennia.typeclasses.models.html#evennia.typeclasses.models.TypedObject.locks">[docs]</a> <span class="nd">@lazy_property</span>
<span class="k">def</span> <span class="nf">locks</span><span class="p">(</span><span class="bp">self</span><span class="p">):</span>
@ -403,7 +380,7 @@
<div class="viewcode-block" id="TypedObject.nattributes"><a class="viewcode-back" href="../../../api/evennia.typeclasses.models.html#evennia.typeclasses.models.TypedObject.nattributes">[docs]</a> <span class="nd">@lazy_property</span>
<span class="k">def</span> <span class="nf">nattributes</span><span class="p">(</span><span class="bp">self</span><span class="p">):</span>
<span class="k">return</span> <span class="n">NAttributeHandler</span><span class="p">(</span><span class="bp">self</span><span class="p">)</span></div>
<span class="k">return</span> <span class="n">AttributeHandler</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">InMemoryAttributeBackend</span><span class="p">)</span></div>
<div class="viewcode-block" id="TypedObject.Meta"><a class="viewcode-back" href="../../../api/evennia.typeclasses.models.html#evennia.typeclasses.models.TypedObject.Meta">[docs]</a> <span class="k">class</span> <span class="nc">Meta</span><span class="p">(</span><span class="nb">object</span><span class="p">):</span>
<span class="sd">&quot;&quot;&quot;</span>
@ -680,7 +657,7 @@
<span class="sd"> superuser lock bypass (be careful with this one).</span>
<span class="sd"> Keyword Args:</span>
<span class="sd"> kwargs (any): Ignored, but is there to make the api</span>
<span class="sd"> kwar (any): Ignored, but is there to make the api</span>
<span class="sd"> consistent with the object-typeclass method access, which</span>
<span class="sd"> use it to feed to its hook methods.</span>
@ -769,18 +746,18 @@
<span class="k">def</span> <span class="nf">__db_get</span><span class="p">(</span><span class="bp">self</span><span class="p">):</span>
<span class="sd">&quot;&quot;&quot;</span>
<span class="sd"> Attribute handler wrapper. Allows for the syntax</span>
<span class="sd"> ::</span>
<span class="sd"> ```python</span>
<span class="sd"> obj.db.attrname = value</span>
<span class="sd"> and</span>
<span class="sd"> # and</span>
<span class="sd"> value = obj.db.attrname</span>
<span class="sd"> and</span>
<span class="sd"> # and</span>
<span class="sd"> del obj.db.attrname</span>
<span class="sd"> and</span>
<span class="sd"> # and</span>
<span class="sd"> all_attr = obj.db.all()</span>
<span class="sd"> (unless there is an attribute named &#39;all&#39;, in which case that will be</span>
<span class="sd"> returned instead).</span>
<span class="sd"> # (unless there is an attribute</span>
<span class="sd"> # named &#39;all&#39;, in which case that will be returned instead).</span>
<span class="sd"> ```</span>
<span class="sd"> &quot;&quot;&quot;</span>
<span class="k">try</span><span class="p">:</span>
@ -791,14 +768,14 @@
<span class="c1"># @db.setter</span>
<span class="k">def</span> <span class="nf">__db_set</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">value</span><span class="p">):</span>
<span class="sd">&quot;&quot;&quot;Stop accidentally replacing the db object&quot;&quot;&quot;</span>
<span class="s2">&quot;Stop accidentally replacing the db object&quot;</span>
<span class="n">string</span> <span class="o">=</span> <span class="s2">&quot;Cannot assign directly to db object! &quot;</span>
<span class="n">string</span> <span class="o">+=</span> <span class="s2">&quot;Use db.attr=value instead.&quot;</span>
<span class="k">raise</span> <span class="ne">Exception</span><span class="p">(</span><span class="n">string</span><span class="p">)</span>
<span class="c1"># @db.deleter</span>
<span class="k">def</span> <span class="nf">__db_del</span><span class="p">(</span><span class="bp">self</span><span class="p">):</span>
<span class="sd">&quot;&quot;&quot;Stop accidental deletion.&quot;&quot;&quot;</span>
<span class="s2">&quot;Stop accidental deletion.&quot;</span>
<span class="k">raise</span> <span class="ne">Exception</span><span class="p">(</span><span class="s2">&quot;Cannot delete the db object!&quot;</span><span class="p">)</span>
<span class="n">db</span> <span class="o">=</span> <span class="nb">property</span><span class="p">(</span><span class="n">__db_get</span><span class="p">,</span> <span class="n">__db_set</span><span class="p">,</span> <span class="n">__db_del</span><span class="p">)</span>
@ -810,23 +787,10 @@
<span class="c1"># @property ndb</span>
<span class="k">def</span> <span class="nf">__ndb_get</span><span class="p">(</span><span class="bp">self</span><span class="p">):</span>
<span class="sd">&quot;&quot;&quot;</span>
<span class="sd"> A non-attr_obj store (NonDataBase). Everything stored to this is</span>
<span class="sd"> guaranteed to be cleared when a server is shutdown. Syntax is same as</span>
<span class="sd"> for the `.db` property, e.g.</span>
<span class="sd"> ::</span>
<span class="sd"> obj.ndb.attrname = value</span>
<span class="sd"> and</span>
<span class="sd"> value = obj.ndb.attrname</span>
<span class="sd"> and</span>
<span class="sd"> del obj.ndb.attrname</span>
<span class="sd"> and</span>
<span class="sd"> all_attr = obj.ndb.all()</span>
<span class="sd"> What makes this preferable over just assigning properties directly on</span>
<span class="sd"> the object is that Evennia can track caching for these properties and</span>
<span class="sd"> for example avoid wiping objects with set `.ndb` data on cache flushes.</span>
<span class="sd"> A non-attr_obj store (ndb: NonDataBase). Everything stored</span>
<span class="sd"> to this is guaranteed to be cleared when a server is shutdown.</span>
<span class="sd"> Syntax is same as for the _get_db_holder() method and</span>
<span class="sd"> property, e.g. obj.ndb.attr = value etc.</span>
<span class="sd"> &quot;&quot;&quot;</span>
<span class="k">try</span><span class="p">:</span>
<span class="k">return</span> <span class="bp">self</span><span class="o">.</span><span class="n">_ndb_holder</span>
@ -931,33 +895,28 @@
<div class="viewcode-block" id="TypedObject.web_get_create_url"><a class="viewcode-back" href="../../../api/evennia.typeclasses.models.html#evennia.typeclasses.models.TypedObject.web_get_create_url">[docs]</a> <span class="nd">@classmethod</span>
<span class="k">def</span> <span class="nf">web_get_create_url</span><span class="p">(</span><span class="bp">cls</span><span class="p">):</span>
<span class="sd">&quot;&quot;&quot;</span>
<span class="sd"> Returns the URI path for a View that allows users to create new</span>
<span class="sd"> instances of this object.</span>
<span class="sd"> ex. Chargen = &#39;/characters/create/&#39;</span>
<span class="sd"> For this to work, the developer must have defined a named view somewhere</span>
<span class="sd"> in urls.py that follows the format &#39;modelname-action&#39;, so in this case</span>
<span class="sd"> a named view of &#39;character-create&#39; would be referenced by this method.</span>
<span class="sd"> ex.</span>
<span class="sd"> url(r&#39;characters/create/&#39;, ChargenView.as_view(), name=&#39;character-create&#39;)</span>
<span class="sd"> If no View has been created and defined in urls.py, returns an</span>
<span class="sd"> HTML anchor.</span>
<span class="sd"> This method is naive and simply returns a path. Securing access to</span>
<span class="sd"> the actual view and limiting who can create new objects is the</span>
<span class="sd"> developer&#39;s responsibility.</span>
<span class="sd"> Returns:</span>
<span class="sd"> path (str): URI path to object creation page, if defined.</span>
<span class="sd"> Examples:</span>
<span class="sd"> ::</span>
<span class="sd"> Chargen = &#39;/characters/create/&#39;</span>
<span class="sd"> For this to work, the developer must have defined a named view somewhere</span>
<span class="sd"> in urls.py that follows the format &#39;modelname-action&#39;, so in this case</span>
<span class="sd"> a named view of &#39;character-create&#39; would be referenced by this method.</span>
<span class="sd"> ::</span>
<span class="sd"> url(r&#39;characters/create/&#39;, ChargenView.as_view(), name=&#39;character-create&#39;)</span>
<span class="sd"> If no View has been created and defined in urls.py, returns an</span>
<span class="sd"> HTML anchor.</span>
<span class="sd"> Notes:</span>
<span class="sd"> This method is naive and simply returns a path. Securing access to</span>
<span class="sd"> the actual view and limiting who can create new objects is the</span>
<span class="sd"> developer&#39;s responsibility.</span>
<span class="sd"> &quot;&quot;&quot;</span>
<span class="k">try</span><span class="p">:</span>
<span class="k">return</span> <span class="n">reverse</span><span class="p">(</span><span class="s2">&quot;</span><span class="si">%s</span><span class="s2">-create&quot;</span> <span class="o">%</span> <span class="n">slugify</span><span class="p">(</span><span class="bp">cls</span><span class="o">.</span><span class="n">_meta</span><span class="o">.</span><span class="n">verbose_name</span><span class="p">))</span>
@ -973,21 +932,24 @@
<span class="sd"> path (str): URI path to object detail page, if defined.</span>
<span class="sd"> Examples:</span>
<span class="sd"> ::</span>
<span class="sd"> Oscar (Character) = &#39;/characters/oscar/1/&#39;</span>
<span class="sd"> ```python</span>
<span class="sd"> Oscar (Character) = &#39;/characters/oscar/1/&#39;</span>
<span class="sd"> ```</span>
<span class="sd"> For this to work, the developer must have defined a named view somewhere</span>
<span class="sd"> in urls.py that follows the format &#39;modelname-action&#39;, so in this case</span>
<span class="sd"> a named view of &#39;character-detail&#39; would be referenced by this method.</span>
<span class="sd"> ::</span>
<span class="sd"> ```python</span>
<span class="sd"> url(r&#39;characters/(?P&lt;slug&gt;[\w\d\-]+)/(?P&lt;pk&gt;[0-9]+)/$&#39;,</span>
<span class="sd"> CharDetailView.as_view(), name=&#39;character-detail&#39;)</span>
<span class="sd"> ```</span>
<span class="sd"> If no View has been created and defined in urls.py, returns an</span>
<span class="sd"> HTML anchor.</span>
<span class="sd"> Notes:</span>
<span class="sd"> This method is naive and simply returns a path. Securing access to</span>
<span class="sd"> the actual view and limiting who can view this object is the</span>
<span class="sd"> developer&#39;s responsibility.</span>
@ -1007,25 +969,26 @@
<span class="sd"> object.</span>
<span class="sd"> Returns:</span>
<span class="sd"> path (str): URI path to object puppet page, if defined.</span>
<span class="sd"> str: URI path to object puppet page, if defined.</span>
<span class="sd"> Examples:</span>
<span class="sd"> ::</span>
<span class="sd"> Oscar (Character) = &#39;/characters/oscar/1/puppet/&#39;</span>
<span class="sd"> ```python</span>
<span class="sd"> Oscar (Character) = &#39;/characters/oscar/1/puppet/&#39;</span>
<span class="sd"> ```</span>
<span class="sd"> For this to work, the developer must have defined a named view somewhere</span>
<span class="sd"> in urls.py that follows the format &#39;modelname-action&#39;, so in this case</span>
<span class="sd"> a named view of &#39;character-puppet&#39; would be referenced by this method.</span>
<span class="sd"> ::</span>
<span class="sd"> url(r&#39;characters/(?P&lt;slug&gt;[\w\d\-]+)/(?P&lt;pk&gt;[0-9]+)/puppet/$&#39;,</span>
<span class="sd"> CharPuppetView.as_view(), name=&#39;character-puppet&#39;)</span>
<span class="sd"> ```python</span>
<span class="sd"> url(r&#39;characters/(?P&lt;slug&gt;[\w\d\-]+)/(?P&lt;pk&gt;[0-9]+)/puppet/$&#39;,</span>
<span class="sd"> CharPuppetView.as_view(), name=&#39;character-puppet&#39;)</span>
<span class="sd"> ```</span>
<span class="sd"> If no View has been created and defined in urls.py, returns an</span>
<span class="sd"> HTML anchor.</span>
<span class="sd"> Notes:</span>
<span class="sd"> This method is naive and simply returns a path. Securing access to</span>
<span class="sd"> the actual view and limiting who can view this object is the developer&#39;s</span>
<span class="sd"> responsibility.</span>
@ -1046,29 +1009,31 @@
<span class="sd"> object.</span>
<span class="sd"> Returns:</span>
<span class="sd"> path (str): URI path to object update page, if defined.</span>
<span class="sd"> str: URI path to object update page, if defined.</span>
<span class="sd"> Examples:</span>
<span class="sd"> ::</span>
<span class="sd"> Oscar (Character) = &#39;/characters/oscar/1/change/&#39;</span>
<span class="sd"> ```python</span>
<span class="sd"> Oscar (Character) = &#39;/characters/oscar/1/change/&#39;</span>
<span class="sd"> ```</span>
<span class="sd"> For this to work, the developer must have defined a named view somewhere</span>
<span class="sd"> in urls.py that follows the format &#39;modelname-action&#39;, so in this case</span>
<span class="sd"> a named view of &#39;character-update&#39; would be referenced by this method.</span>
<span class="sd"> ::</span>
<span class="sd"> url(r&#39;characters/(?P&lt;slug&gt;[\w\d\-]+)/(?P&lt;pk&gt;[0-9]+)/change/$&#39;,</span>
<span class="sd"> CharUpdateView.as_view(), name=&#39;character-update&#39;)</span>
<span class="sd"> ```python</span>
<span class="sd"> url(r&#39;characters/(?P&lt;slug&gt;[\w\d\-]+)/(?P&lt;pk&gt;[0-9]+)/change/$&#39;,</span>
<span class="sd"> CharUpdateView.as_view(), name=&#39;character-update&#39;)</span>
<span class="sd"> ```</span>
<span class="sd"> If no View has been created and defined in urls.py, returns an</span>
<span class="sd"> HTML anchor.</span>
<span class="sd"> Notes:</span>
<span class="sd"> This method is naive and simply returns a path. Securing access to</span>
<span class="sd"> the actual view and limiting who can modify objects is the developer&#39;s</span>
<span class="sd"> responsibility.</span>
<span class="sd"> &quot;&quot;&quot;</span>
<span class="k">try</span><span class="p">:</span>
<span class="k">return</span> <span class="n">reverse</span><span class="p">(</span>
@ -1086,25 +1051,27 @@
<span class="sd"> path (str): URI path to object deletion page, if defined.</span>
<span class="sd"> Examples:</span>
<span class="sd"> ::</span>
<span class="sd"> Oscar (Character) = &#39;/characters/oscar/1/delete/&#39;</span>
<span class="sd"> ```python</span>
<span class="sd"> Oscar (Character) = &#39;/characters/oscar/1/delete/&#39;</span>
<span class="sd"> ```</span>
<span class="sd"> For this to work, the developer must have defined a named view somewhere</span>
<span class="sd"> in urls.py that follows the format &#39;modelname-action&#39;, so in this case</span>
<span class="sd"> a named view of &#39;character-detail&#39; would be referenced by this method.</span>
<span class="sd"> ::</span>
<span class="sd"> For this to work, the developer must have defined a named view</span>
<span class="sd"> somewhere in urls.py that follows the format &#39;modelname-action&#39;, so</span>
<span class="sd"> in this case a named view of &#39;character-detail&#39; would be referenced</span>
<span class="sd"> by this method.</span>
<span class="sd"> url(r&#39;characters/(?P&lt;slug&gt;[\w\d\-]+)/(?P&lt;pk&gt;[0-9]+)/delete/$&#39;,</span>
<span class="sd"> CharDeleteView.as_view(), name=&#39;character-delete&#39;)</span>
<span class="sd"> ```python</span>
<span class="sd"> url(r&#39;characters/(?P&lt;slug&gt;[\w\d\-]+)/(?P&lt;pk&gt;[0-9]+)/delete/$&#39;,</span>
<span class="sd"> CharDeleteView.as_view(), name=&#39;character-delete&#39;)</span>
<span class="sd"> ```</span>
<span class="sd"> If no View has been created and defined in urls.py, returns an</span>
<span class="sd"> HTML anchor.</span>
<span class="sd"> If no View has been created and defined in urls.py, returns an HTML</span>
<span class="sd"> anchor.</span>
<span class="sd"> Notes:</span>
<span class="sd"> This method is naive and simply returns a path. Securing access to</span>
<span class="sd"> the actual view and limiting who can delete this object is the developer&#39;s</span>
<span class="sd"> responsibility.</span>
<span class="sd"> the actual view and limiting who can delete this object is the</span>
<span class="sd"> developer&#39;s responsibility.</span>
<span class="sd"> &quot;&quot;&quot;</span>

View file

@ -360,6 +360,40 @@
<span class="nb">getattr</span><span class="p">(</span><span class="bp">self</span><span class="o">.</span><span class="n">obj</span><span class="p">,</span> <span class="bp">self</span><span class="o">.</span><span class="n">_m2m_fieldname</span><span class="p">)</span><span class="o">.</span><span class="n">add</span><span class="p">(</span><span class="n">tagobj</span><span class="p">)</span>
<span class="bp">self</span><span class="o">.</span><span class="n">_setcache</span><span class="p">(</span><span class="n">tagstr</span><span class="p">,</span> <span class="n">category</span><span class="p">,</span> <span class="n">tagobj</span><span class="p">)</span></div>
<div class="viewcode-block" id="TagHandler.has"><a class="viewcode-back" href="../../../api/evennia.typeclasses.tags.html#evennia.typeclasses.tags.TagHandler.has">[docs]</a> <span class="k">def</span> <span class="nf">has</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">tag</span><span class="o">=</span><span class="kc">None</span><span class="p">,</span> <span class="n">category</span><span class="o">=</span><span class="kc">None</span><span class="p">,</span> <span class="n">return_list</span><span class="o">=</span><span class="kc">False</span><span class="p">):</span>
<span class="sd">&quot;&quot;&quot;</span>
<span class="sd"> Checks if the given Tag (or list of Tags) exists on the object.</span>
<span class="sd"> Args:</span>
<span class="sd"> tag (str or iterable): The Tag key or tags to check for.</span>
<span class="sd"> If `None`, search by category.</span>
<span class="sd"> category (str, optional): Limit the check to Tags with this</span>
<span class="sd"> category (note, that `None` is the default category).</span>
<span class="sd"> Returns:</span>
<span class="sd"> has_tag (bool or list): If the Tag exists on this object or not.</span>
<span class="sd"> If `tag` was given as an iterable then the return is a list of booleans.</span>
<span class="sd"> Raises:</span>
<span class="sd"> ValueError: If neither `tag` nor `category` is given.</span>
<span class="sd"> &quot;&quot;&quot;</span>
<span class="n">ret</span> <span class="o">=</span> <span class="p">[]</span>
<span class="n">category</span> <span class="o">=</span> <span class="n">category</span><span class="o">.</span><span class="n">strip</span><span class="p">()</span><span class="o">.</span><span class="n">lower</span><span class="p">()</span> <span class="k">if</span> <span class="n">category</span> <span class="ow">is</span> <span class="ow">not</span> <span class="kc">None</span> <span class="k">else</span> <span class="kc">None</span>
<span class="k">if</span> <span class="n">tag</span><span class="p">:</span>
<span class="k">for</span> <span class="n">tag_str</span> <span class="ow">in</span> <span class="n">make_iter</span><span class="p">(</span><span class="n">tag</span><span class="p">):</span>
<span class="n">tag_str</span> <span class="o">=</span> <span class="n">tag_str</span><span class="o">.</span><span class="n">strip</span><span class="p">()</span><span class="o">.</span><span class="n">lower</span><span class="p">()</span>
<span class="n">ret</span><span class="o">.</span><span class="n">extend</span><span class="p">(</span><span class="nb">bool</span><span class="p">(</span><span class="n">tag</span><span class="p">)</span> <span class="k">for</span> <span class="n">tag</span> <span class="ow">in</span> <span class="bp">self</span><span class="o">.</span><span class="n">_getcache</span><span class="p">(</span><span class="n">tag_str</span><span class="p">,</span> <span class="n">category</span><span class="p">))</span>
<span class="k">elif</span> <span class="n">category</span><span class="p">:</span>
<span class="n">ret</span><span class="o">.</span><span class="n">extend</span><span class="p">(</span><span class="nb">bool</span><span class="p">(</span><span class="n">tag</span><span class="p">)</span> <span class="k">for</span> <span class="n">tag</span> <span class="ow">in</span> <span class="bp">self</span><span class="o">.</span><span class="n">_getcache</span><span class="p">(</span><span class="n">category</span><span class="o">=</span><span class="n">category</span><span class="p">))</span>
<span class="k">else</span><span class="p">:</span>
<span class="k">raise</span> <span class="ne">ValueError</span><span class="p">(</span><span class="s2">&quot;Either tag or category must be provided.&quot;</span><span class="p">)</span>
<span class="k">if</span> <span class="n">return_list</span><span class="p">:</span>
<span class="k">return</span> <span class="n">ret</span>
<span class="k">return</span> <span class="n">ret</span><span class="p">[</span><span class="mi">0</span><span class="p">]</span> <span class="k">if</span> <span class="nb">len</span><span class="p">(</span><span class="n">ret</span><span class="p">)</span> <span class="o">==</span> <span class="mi">1</span> <span class="k">else</span> <span class="n">ret</span></div>
<div class="viewcode-block" id="TagHandler.get"><a class="viewcode-back" href="../../../api/evennia.typeclasses.tags.html#evennia.typeclasses.tags.TagHandler.get">[docs]</a> <span class="k">def</span> <span class="nf">get</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">key</span><span class="o">=</span><span class="kc">None</span><span class="p">,</span> <span class="n">default</span><span class="o">=</span><span class="kc">None</span><span class="p">,</span> <span class="n">category</span><span class="o">=</span><span class="kc">None</span><span class="p">,</span> <span class="n">return_tagobj</span><span class="o">=</span><span class="kc">False</span><span class="p">,</span> <span class="n">return_list</span><span class="o">=</span><span class="kc">False</span><span class="p">):</span>
<span class="sd">&quot;&quot;&quot;</span>
<span class="sd"> Get the tag for the given key, category or combination of the two.</span>

View file

@ -42,20 +42,19 @@
<span></span><span class="sd">&quot;&quot;&quot;</span>
<span class="sd">ANSI - Gives colour to text.</span>
<span class="sd">Use the codes defined in ANSIPARSER in your text to apply colour to text</span>
<span class="sd">according to the ANSI standard.</span>
<span class="sd">::</span>
<span class="sd">Use the codes defined in ANSIPARSER in your text</span>
<span class="sd">to apply colour to text according to the ANSI standard.</span>
<span class="sd"> This is |rRed text|n and this is normal again.</span>
<span class="sd">Examples:</span>
<span class="sd">Mostly you should not need to call `parse_ansi()` explicitly; it is run by</span>
<span class="sd">Evennia just before returning data to/from the user. Depreciated/decativated</span>
<span class="sd">example forms are available in contribs by extending the ansi mapping</span>
<span class="sd">```python</span>
<span class="sd">&quot;This is |rRed text|n and this is normal again.&quot;</span>
<span class="sd">```</span>
<span class="sd">This module also contains the `ANSIString` custom string-type, which correctly</span>
<span class="sd">wraps/manipulates and tracks lengths of strings containing ANSI-markup.</span>
<span class="sd">----</span>
<span class="sd">Mostly you should not need to call `parse_ansi()` explicitly;</span>
<span class="sd">it is run by Evennia just before returning data to/from the</span>
<span class="sd">user. Depreciated example forms are available by extending</span>
<span class="sd">the ansi mapping.</span>
<span class="sd">&quot;&quot;&quot;</span>
<span class="kn">import</span> <span class="nn">functools</span>
@ -123,14 +122,16 @@
<div class="viewcode-block" id="ANSIParser"><a class="viewcode-back" href="../../../api/evennia.utils.ansi.html#evennia.utils.ansi.ANSIParser">[docs]</a><span class="k">class</span> <span class="nc">ANSIParser</span><span class="p">(</span><span class="nb">object</span><span class="p">):</span>
<span class="sd">&quot;&quot;&quot;</span>
<span class="sd"> A class that parses ANSI markup to ANSI command sequences</span>
<span class="sd"> A class that parses ANSI markup</span>
<span class="sd"> to ANSI command sequences</span>
<span class="sd"> We also allow to escape colour codes by prepending with</span>
<span class="sd"> an extra `|`, so `||r` will literally print `|r`.</span>
<span class="sd"> We also allow to escape colour codes</span>
<span class="sd"> by prepending with a \ for xterm256,</span>
<span class="sd"> an extra | for Merc-style codes</span>
<span class="sd"> &quot;&quot;&quot;</span>
<span class="c1"># Mapping using |r, |n etc</span>
<span class="c1"># Mapping using {r {n etc</span>
<span class="n">ansi_map</span> <span class="o">=</span> <span class="p">[</span>
<span class="c1"># alternative |-format</span>
@ -629,9 +630,10 @@
<span class="k">def</span> <span class="nf">_transform</span><span class="p">(</span><span class="n">func_name</span><span class="p">):</span>
<span class="sd">&quot;&quot;&quot;</span>
<span class="sd"> Some string functions, like those manipulating capital letters, return a</span>
<span class="sd"> string the same length as the original. This function allows us to do the</span>
<span class="sd"> same, replacing all the non-coded characters with the resulting string.</span>
<span class="sd"> Some string functions, like those manipulating capital letters,</span>
<span class="sd"> return a string the same length as the original. This function</span>
<span class="sd"> allows us to do the same, replacing all the non-coded characters</span>
<span class="sd"> with the resulting string.</span>
<span class="sd"> &quot;&quot;&quot;</span>
@ -864,7 +866,7 @@
<span class="sd"> &quot;&quot;&quot;</span>
<span class="k">if</span> <span class="ow">not</span> <span class="n">offset</span><span class="p">:</span>
<span class="k">return</span> <span class="p">[]</span>
<span class="k">return</span> <span class="n">iterable</span>
<span class="k">return</span> <span class="p">[</span><span class="n">i</span> <span class="o">+</span> <span class="n">offset</span> <span class="k">for</span> <span class="n">i</span> <span class="ow">in</span> <span class="n">iterable</span><span class="p">]</span>
<span class="nd">@classmethod</span>
@ -1026,12 +1028,9 @@
<span class="sd"> occurrence of the separator rather than the first.</span>
<span class="sd"> Returns:</span>
<span class="sd"> result (tuple):</span>
<span class="sd"> - prefix (ANSIString): The part of the string before the</span>
<span class="sd"> separator</span>
<span class="sd"> - sep (ANSIString): The separator itself</span>
<span class="sd"> - postfix (ANSIString): The part of the string after the</span>
<span class="sd"> separator.</span>
<span class="sd"> ANSIString: The part of the string before the separator</span>
<span class="sd"> ANSIString: The separator itself</span>
<span class="sd"> ANSIString: The part of the string after the separator.</span>
<span class="sd"> &quot;&quot;&quot;</span>
<span class="k">if</span> <span class="nb">hasattr</span><span class="p">(</span><span class="n">sep</span><span class="p">,</span> <span class="s2">&quot;_clean_string&quot;</span><span class="p">):</span>
@ -1330,27 +1329,23 @@
<span class="sd"> Joins together strings in an iterable, using this string between each</span>
<span class="sd"> one.</span>
<span class="sd"> NOTE: This should always be used for joining strings when ANSIStrings</span>
<span class="sd"> are involved. Otherwise color information will be discarded by python,</span>
<span class="sd"> due to details in the C implementation of strings.</span>
<span class="sd"> Args:</span>
<span class="sd"> iterable (list of strings): A list of strings to join together</span>
<span class="sd"> Returns:</span>
<span class="sd"> result (ANSIString): A single string with all of the iterable&#39;s</span>
<span class="sd"> ANSIString: A single string with all of the iterable&#39;s</span>
<span class="sd"> contents concatenated, with this string between each.</span>
<span class="sd"> Examples:</span>
<span class="sd"> ::</span>
<span class="sd"> ANSIString(&#39;, &#39;).join([&#39;up&#39;, &#39;right&#39;, &#39;left&#39;, &#39;down&#39;])</span>
<span class="sd"> Would return</span>
<span class="sd"> ::</span>
<span class="sd"> &gt;&gt;&gt; ANSIString(&#39;, &#39;).join([&#39;up&#39;, &#39;right&#39;, &#39;left&#39;, &#39;down&#39;])</span>
<span class="sd"> ANSIString(&#39;up, right, left, down&#39;)</span>
<span class="sd"> Notes:</span>
<span class="sd"> This should always be used for joining strings when ANSIStrings are</span>
<span class="sd"> involved. Otherwise color information will be discarded by python,</span>
<span class="sd"> due to details in the C implementation of strings.</span>
<span class="sd"> &quot;&quot;&quot;</span>
<span class="n">result</span> <span class="o">=</span> <span class="n">ANSIString</span><span class="p">(</span><span class="s2">&quot;&quot;</span><span class="p">)</span>
<span class="n">last_item</span> <span class="o">=</span> <span class="kc">None</span>

View file

@ -41,24 +41,22 @@
<h1>Source code for evennia.utils.batchprocessors</h1><div class="highlight"><pre>
<span></span><span class="sd">&quot;&quot;&quot;</span>
<span class="sd">This module contains the core methods for the Batch-command- and</span>
<span class="sd">Batch-code-processors respectively. In short, these are two different</span>
<span class="sd">ways to build a game world using a normal text-editor without having</span>
<span class="sd">to do so &#39;on the fly&#39; in-game. They also serve as an automatic backup</span>
<span class="sd">so you can quickly recreate a world also after a server reset. The</span>
<span class="sd">functions in this module is meant to form the backbone of a system</span>
<span class="sd">called and accessed through game commands.</span>
<span class="sd">Batch-code-processors respectively. In short, these are two different ways to</span>
<span class="sd">build a game world using a normal text-editor without having to do so &#39;on the</span>
<span class="sd">fly&#39; in-game. They also serve as an automatic backup so you can quickly</span>
<span class="sd">recreate a world also after a server reset. The functions in this module is</span>
<span class="sd">meant to form the backbone of a system called and accessed through game</span>
<span class="sd">commands.</span>
<span class="sd">The Batch-command processor is the simplest. It simply runs a list of</span>
<span class="sd">in-game commands in sequence by reading them from a text file. The</span>
<span class="sd">advantage of this is that the builder only need to remember the normal</span>
<span class="sd">in-game commands. They are also executing with full permission checks</span>
<span class="sd">etc, making it relatively safe for builders to use. The drawback is</span>
<span class="sd">that in-game there is really a builder-character walking around</span>
<span class="sd">building things, and it can be important to create rooms and objects</span>
<span class="sd">in the right order, so the character can move between them. Also</span>
<span class="sd">objects that affects players (such as mobs, dark rooms etc) will</span>
<span class="sd">affect the building character too, requiring extra care to turn</span>
<span class="sd">off/on.</span>
<span class="sd">The Batch-command processor is the simplest. It simply runs a list of in-game</span>
<span class="sd">commands in sequence by reading them from a text file. The advantage of this is</span>
<span class="sd">that the builder only need to remember the normal in-game commands. They are</span>
<span class="sd">also executing with full permission checks etc, making it relatively safe for</span>
<span class="sd">builders to use. The drawback is that in-game there is really a</span>
<span class="sd">builder-character walking around building things, and it can be important to</span>
<span class="sd">create rooms and objects in the right order, so the character can move between</span>
<span class="sd">them. Also objects that affects players (such as mobs, dark rooms etc) will</span>
<span class="sd">affect the building character too, requiring extra care to turn off/on.</span>
<span class="sd">The Batch-code processor is a more advanced system that accepts full</span>
<span class="sd">Python code, executing in chunks. The advantage of this is much more</span>
@ -72,8 +70,7 @@
<span class="sd">recommended that the batch-code processor is limited only to</span>
<span class="sd">superusers or highly trusted staff.</span>
<span class="sd">Batch-Command processor file syntax</span>
<span class="sd">-----------------------------------</span>
<span class="sd"># Batch-command processor file syntax</span>
<span class="sd">The batch-command processor accepts &#39;batchcommand files&#39; e.g</span>
<span class="sd">`batch.ev`, containing a sequence of valid Evennia commands in a</span>
@ -81,31 +78,39 @@
<span class="sd">had been run at the game prompt.</span>
<span class="sd">Each Evennia command must be delimited by a line comment to mark its</span>
<span class="sd">end. This way entire game worlds can be created and planned offline; it is</span>
<span class="sd">end.</span>
<span class="sd">::</span>
<span class="sd"> look</span>
<span class="sd"> # delimiting comment</span>
<span class="sd"> create/drop box</span>
<span class="sd"> # another required comment</span>
<span class="sd">One can also inject another batchcmdfile:</span>
<span class="sd">::</span>
<span class="sd"> #INSERT path.batchcmdfile</span>
<span class="sd">This way entire game worlds can be created and planned offline; it is</span>
<span class="sd">especially useful in order to create long room descriptions where a</span>
<span class="sd">real offline text editor is often much better than any online text</span>
<span class="sd">editor or prompt.</span>
<span class="sd">There is only one batchcommand-specific entry to use in a batch-command</span>
<span class="sd">files (all others are just like in-game commands):</span>
<span class="sd">## Example of batch.ev file:</span>
<span class="sd">- `#INSERT path.batchcmdfile` - this as the first entry on a line will</span>
<span class="sd"> import and run a batch.ev file in this position, as if it was</span>
<span class="sd"> written in this file.</span>
<span class="sd">Example of batch.ev file:</span>
<span class="sd">::</span>
<span class="sd"> # batch file</span>
<span class="sd"> # all lines starting with # are comments; they also indicate</span>
<span class="sd"> # that a command definition is over.</span>
<span class="sd"> @create box</span>
<span class="sd"> create box</span>
<span class="sd"> # this comment ends the @create command.</span>
<span class="sd"> @set box/desc = A large box.</span>
<span class="sd"> set box/desc = A large box.</span>
<span class="sd"> Inside are some scattered piles of clothing.</span>
@ -117,25 +122,22 @@
<span class="sd"> # is ignored. An empty line in the command definition is parsed as a \n</span>
<span class="sd"> # (so two empty lines becomes a new paragraph).</span>
<span class="sd"> @teleport #221</span>
<span class="sd"> teleport #221</span>
<span class="sd"> # (Assuming #221 is a warehouse or something.)</span>
<span class="sd"> # (remember, this comment ends the @teleport command! Don&#39;f forget it)</span>
<span class="sd"> # Example of importing another file at this point.</span>
<span class="sd"> #INSERT examples.batch</span>
<span class="sd"> #IMPORT examples.batch</span>
<span class="sd"> @drop box</span>
<span class="sd"> drop box</span>
<span class="sd"> # Done, the box is in the warehouse! (this last comment is not necessary to</span>
<span class="sd"> # close the @drop command since it&#39;s the end of the file)</span>
<span class="sd"> # close the drop command since it&#39;s the end of the file)</span>
<span class="sd">An example batch file is `contrib/examples/batch_example.ev`.</span>
<span class="sd">Batch-Code processor file syntax</span>
<span class="sd">--------------------------------</span>
<span class="sd"># Batch-code processor file syntax</span>
<span class="sd">The Batch-code processor accepts full python modules (e.g. `batch.py`)</span>
<span class="sd">that looks identical to normal Python files. The difference from</span>
@ -169,13 +171,14 @@
<span class="sd">Importing works as normal. The following variables are automatically</span>
<span class="sd">made available in the script namespace.</span>
<span class="sd">- `caller` - The object executing the batchscript</span>
<span class="sd">- `caller` - The object executing the batchscript</span>
<span class="sd">- `DEBUG` - This is a boolean marking if the batchprocessor is running</span>
<span class="sd"> in debug mode. It can be checked to e.g. delete created objects</span>
<span class="sd"> when running a CODE block multiple times during testing.</span>
<span class="sd"> (avoids creating a slew of same-named db objects)</span>
<span class="sd"> in debug mode. It can be checked to e.g. delete created objects</span>
<span class="sd"> when running a CODE block multiple times during testing.</span>
<span class="sd"> (avoids creating a slew of same-named db objects)</span>
<span class="sd">## Example batch.py file</span>
<span class="sd">Example batch.py file:</span>
<span class="sd">::</span>
<span class="sd"> #HEADER</span>
@ -204,8 +207,6 @@
<span class="sd"> script = create.create_script()</span>
<span class="sd">----</span>
<span class="sd">&quot;&quot;&quot;</span>
<span class="kn">import</span> <span class="nn">re</span>
<span class="kn">import</span> <span class="nn">codecs</span>
@ -243,7 +244,7 @@
<span class="sd"> file_ending (str): The file ending of this file (.ev or .py)</span>
<span class="sd"> Returns:</span>
<span class="sd"> str: The text content of the batch file.</span>
<span class="sd"> text (str): The text content of the batch file.</span>
<span class="sd"> Raises:</span>
<span class="sd"> IOError: If problems reading file.</span>
@ -290,22 +291,30 @@
<div class="viewcode-block" id="BatchCommandProcessor.parse_file"><a class="viewcode-back" href="../../../api/evennia.utils.batchprocessors.html#evennia.utils.batchprocessors.BatchCommandProcessor.parse_file">[docs]</a> <span class="k">def</span> <span class="nf">parse_file</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">pythonpath</span><span class="p">):</span>
<span class="sd">&quot;&quot;&quot;</span>
<span class="sd"> This parses the lines of a batchfile according to the following</span>
<span class="sd"> rules:</span>
<span class="sd"> This parses the lines of a batch-command-file.</span>
<span class="sd"> 1. `#` at the beginning of a line marks the end of the command before</span>
<span class="sd"> it. It is also a comment and any number of # can exist on</span>
<span class="sd"> subsequent lines (but not inside comments).</span>
<span class="sd"> 2. `#INSERT` at the beginning of a line imports another</span>
<span class="sd"> batch-cmd file file and pastes it into the batch file as if</span>
<span class="sd"> it was written there.</span>
<span class="sd"> 3. Commands are placed alone at the beginning of a line and their</span>
<span class="sd"> arguments are considered to be everything following (on any</span>
<span class="sd"> number of lines) until the next comment line beginning with #.</span>
<span class="sd"> 4. Newlines are ignored in command definitions</span>
<span class="sd"> 5. A completely empty line in a command line definition is condered</span>
<span class="sd"> a newline (so two empty lines is a paragraph).</span>
<span class="sd"> 6. Excess spaces and indents inside arguments are stripped.</span>
<span class="sd"> Args:</span>
<span class="sd"> pythonpath (str): The dot-python path to the file.</span>
<span class="sd"> Returns:</span>
<span class="sd"> list: A list of all parsed commands with arguments, as strings.</span>
<span class="sd"> Notes:</span>
<span class="sd"> Parsing follows the following rules:</span>
<span class="sd"> 1. A `#` at the beginning of a line marks the end of the command before</span>
<span class="sd"> it. It is also a comment and any number of # can exist on</span>
<span class="sd"> subsequent lines (but not inside comments).</span>
<span class="sd"> 2. #INSERT at the beginning of a line imports another</span>
<span class="sd"> batch-cmd file file and pastes it into the batch file as if</span>
<span class="sd"> it was written there.</span>
<span class="sd"> 3. Commands are placed alone at the beginning of a line and their</span>
<span class="sd"> arguments are considered to be everything following (on any</span>
<span class="sd"> number of lines) until the next comment line beginning with #.</span>
<span class="sd"> 4. Newlines are ignored in command definitions</span>
<span class="sd"> 5. A completely empty line in a command line definition is condered</span>
<span class="sd"> a newline (so two empty lines is a paragraph).</span>
<span class="sd"> 6. Excess spaces and indents inside arguments are stripped.</span>
<span class="sd"> &quot;&quot;&quot;</span>
@ -354,21 +363,23 @@
<div class="viewcode-block" id="BatchCodeProcessor.parse_file"><a class="viewcode-back" href="../../../api/evennia.utils.batchprocessors.html#evennia.utils.batchprocessors.BatchCodeProcessor.parse_file">[docs]</a> <span class="k">def</span> <span class="nf">parse_file</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">pythonpath</span><span class="p">):</span>
<span class="sd">&quot;&quot;&quot;</span>
<span class="sd"> This parses the lines of a batchfile according to the following</span>
<span class="sd"> rules:</span>
<span class="sd"> This parses the lines of a batch-code file</span>
<span class="sd"> Args:</span>
<span class="sd"> pythonpath (str): The dot-python path to the file.</span>
<span class="sd"> Returns:</span>
<span class="sd"> codeblocks (list): A list of all #CODE blocks, each with</span>
<span class="sd"> prepended #HEADER data. If no #CODE blocks were found,</span>
<span class="sd"> this will be a list of one element.</span>
<span class="sd"> list: A list of all `#CODE` blocks, each with</span>
<span class="sd"> prepended `#HEADER` block data. If no `#CODE`</span>
<span class="sd"> blocks were found, this will be a list of one element</span>
<span class="sd"> containing all code in the file (so a normal Python file).</span>
<span class="sd"> Notes:</span>
<span class="sd"> Parsing is done according to the following rules:</span>
<span class="sd"> 1. Code before a #CODE/HEADER block are considered part of</span>
<span class="sd"> the first code/header block or is the ONLY block if no</span>
<span class="sd"> #CODE/HEADER blocks are defined.</span>
<span class="sd"> the first code/header block or is the ONLY block if no</span>
<span class="sd"> `#CODE/HEADER` blocks are defined.</span>
<span class="sd"> 2. Lines starting with #HEADER starts a header block (ends other blocks)</span>
<span class="sd"> 3. Lines starting with #CODE begins a code block (ends other blocks)</span>
<span class="sd"> 4. Lines starting with #INSERT are on form #INSERT filename. Code from</span>
@ -377,6 +388,7 @@
<span class="sd"> 5. Code after the last block is considered part of the last header/code</span>
<span class="sd"> block</span>
<span class="sd"> &quot;&quot;&quot;</span>
<span class="n">text</span> <span class="o">=</span> <span class="s2">&quot;&quot;</span><span class="o">.</span><span class="n">join</span><span class="p">(</span><span class="n">read_batchfile</span><span class="p">(</span><span class="n">pythonpath</span><span class="p">,</span> <span class="n">file_ending</span><span class="o">=</span><span class="s2">&quot;.py&quot;</span><span class="p">))</span>

View file

@ -40,27 +40,19 @@
<h1>Source code for evennia.utils.create</h1><div class="highlight"><pre>
<span></span><span class="sd">&quot;&quot;&quot;</span>
<span class="sd">This module gathers all the essential database-creation</span>
<span class="sd">functions for the game engine&#39;s various object types.</span>
<span class="sd">This module gathers all the essential database-creation functions for the game</span>
<span class="sd">engine&#39;s various object types.</span>
<span class="sd">Only objects created &#39;stand-alone&#39; are in here, e.g. object Attributes</span>
<span class="sd">are always created directly through their respective objects.</span>
<span class="sd">Only objects created &#39;stand-alone&#39; are in here. E.g. object Attributes are</span>
<span class="sd">always created through their respective objects handlers.</span>
<span class="sd">Each creation_* function also has an alias named for the entity being</span>
<span class="sd">created, such as create_object() and object(). This is for</span>
<span class="sd">consistency with the utils.search module and allows you to do the</span>
<span class="sd">shorter &quot;create.object()&quot;.</span>
<span class="sd">Each `creation_*` function also has an alias named for the entity being created,</span>
<span class="sd">such as create_object() and object(). This is for consistency with the</span>
<span class="sd">utils.search module and allows you to do the shorter `create.object()`.</span>
<span class="sd">The respective object managers hold more methods for manipulating and</span>
<span class="sd">searching objects already existing in the database.</span>
<span class="sd">The respective object managers hold more methods for manipulating and searching</span>
<span class="sd">objects already existing in the database.</span>
<span class="sd">Models covered:</span>
<span class="sd"> Objects</span>
<span class="sd"> Scripts</span>
<span class="sd"> Help</span>
<span class="sd"> Message</span>
<span class="sd"> Channel</span>
<span class="sd"> Accounts</span>
<span class="sd">&quot;&quot;&quot;</span>
<span class="kn">from</span> <span class="nn">django.conf</span> <span class="k">import</span> <span class="n">settings</span>
<span class="kn">from</span> <span class="nn">django.db</span> <span class="k">import</span> <span class="n">IntegrityError</span>
@ -122,22 +114,21 @@
<span class="sd"> Keyword Args:</span>
<span class="sd"> typeclass (class or str): Class or python path to a typeclass.</span>
<span class="sd"> key (str): Name of the new object. If not set, a name of</span>
<span class="sd"> #dbref will be set.</span>
<span class="sd"> `#dbref` will be set.</span>
<span class="sd"> home (Object or str): Obj or #dbref to use as the object&#39;s</span>
<span class="sd"> home location.</span>
<span class="sd"> permissions (list): A list of permission strings or tuples (permstring, category).</span>
<span class="sd"> locks (str): one or more lockstrings, separated by semicolons.</span>
<span class="sd"> aliases (list): A list of alternative keys or tuples (aliasstring, category).</span>
<span class="sd"> tags (list): List of tag keys or tuples (tagkey, category) or (tagkey, category, data).</span>
<span class="sd"> destination (Object or str): Obj or #dbref to use as an Exit&#39;s</span>
<span class="sd"> target.</span>
<span class="sd"> destination (Object or str): Obj or #dbref to use as an Exit&#39;s target.</span>
<span class="sd"> report_to (Object): The object to return error messages to.</span>
<span class="sd"> nohome (bool): This allows the creation of objects without a</span>
<span class="sd"> default home location; only used when creating the default</span>
<span class="sd"> location itself or during unittests.</span>
<span class="sd"> attributes (list): Tuples on the form (key, value) or (key, value, category),</span>
<span class="sd"> (key, value, lockstring) or (key, value, lockstring, default_access).</span>
<span class="sd"> to set as Attributes on the new object.</span>
<span class="sd"> (key, value, lockstring) or (key, value, lockstring, default_access).</span>
<span class="sd"> to set as Attributes on the new object.</span>
<span class="sd"> nattributes (list): Non-persistent tuples on the form (key, value). Note that</span>
<span class="sd"> adding this rarely makes sense since this data will not survive a reload.</span>

View file

@ -653,7 +653,7 @@
<span class="sd"> that saves assigned data to the database. Skip if not</span>
<span class="sd"> serializing onto a given object. If db_obj is given, this</span>
<span class="sd"> function will convert lists, dicts and sets to their</span>
<span class="sd"> `_SaverList`, `_SaverDict` and `_SaverSet` counterparts.</span>
<span class="sd"> _SaverList, _SaverDict and _SaverSet counterparts.</span>
<span class="sd"> Returns:</span>
<span class="sd"> data (any): Unpickled data.</span>

View file

@ -42,47 +42,42 @@
<span></span><span class="sd">&quot;&quot;&quot;</span>
<span class="sd">EvEditor (Evennia Line Editor)</span>
<span class="sd">This implements an advanced line editor for editing longer texts</span>
<span class="sd">in-game. The editor mimics the command mechanisms of the &quot;VI&quot; editor</span>
<span class="sd">(a famous line-by-line editor) as far as reasonable.</span>
<span class="sd">This implements an advanced line editor for editing longer texts in-game. The</span>
<span class="sd">editor mimics the command mechanisms of the &quot;VI&quot; editor (a famous line-by-line</span>
<span class="sd">editor) as far as reasonable.</span>
<span class="sd">Features of the editor:</span>
<span class="sd"> - undo/redo.</span>
<span class="sd"> - edit/replace on any line of the buffer.</span>
<span class="sd"> - search&amp;replace text anywhere in buffer.</span>
<span class="sd"> - formatting of buffer, or selection, to certain width + indentations.</span>
<span class="sd"> - allow to echo the input or not, depending on your client.</span>
<span class="sd">- undo/redo.</span>
<span class="sd">- edit/replace on any line of the buffer.</span>
<span class="sd">- search&amp;replace text anywhere in buffer.</span>
<span class="sd">- formatting of buffer, or selection, to certain width + indentations.</span>
<span class="sd">- allow to echo the input or not, depending on your client.</span>
<span class="sd">- in-built help</span>
<span class="sd">To use the editor, just import EvEditor from this module</span>
<span class="sd">and initialize it:</span>
<span class="sd">::</span>
<span class="sd">To use the editor, just import EvEditor from this module and initialize it:</span>
<span class="sd"> from evennia.utils.eveditor import EvEditor</span>
<span class="sd"> EvEditor(caller, loadfunc=None, savefunc=None, quitfunc=None, key=&quot;&quot;, persistent=True)</span>
<span class="sd">```python</span>
<span class="sd">from evennia.utils.eveditor import EvEditor</span>
<span class="sd">- `caller` is the user of the editor, the one to see all feedback.</span>
<span class="sd">- `loadfunc(caller)` is called when the editor is first launched; the</span>
<span class="sd"> return from this function is loaded as the starting buffer in the</span>
<span class="sd"> editor.</span>
<span class="sd">- `safefunc(caller, buffer)` is called with the current buffer when</span>
<span class="sd"> saving in the editor. The function should return True/False depending</span>
<span class="sd"> on if the saving was successful or not.</span>
<span class="sd">- `quitfunc(caller)` is called when the editor exits. If this is given,</span>
<span class="sd"> no automatic quit messages will be given.</span>
<span class="sd">- `key` is an optional identifier for the editing session, to be</span>
<span class="sd"> displayed in the editor.</span>
<span class="sd">- `persistent` means the editor state will be saved to the database making it</span>
<span class="sd"> survive a server reload. Note that using this mode, the load- save-</span>
<span class="sd"> and quit-funcs must all be possible to pickle - notable unusable</span>
<span class="sd"> callables are class methods and functions defined inside other</span>
<span class="sd"> functions. With persistent=False, no such restriction exists.</span>
<span class="sd">- `code` set to True activates features on the EvEditor to enter Python code.</span>
<span class="sd"># set up an editor to edit the caller&#39;s &#39;desc&#39; Attribute</span>
<span class="sd">def _loadfunc(caller):</span>
<span class="sd"> return caller.db.desc</span>
<span class="sd">In addition, the EvEditor can be used to enter Python source code,</span>
<span class="sd">and offers basic handling of indentation.</span>
<span class="sd">def _savefunc(caller, buffer):</span>
<span class="sd"> caller.db.desc = buffer.strip()</span>
<span class="sd"> return True</span>
<span class="sd">----</span>
<span class="sd">def _quitfunc(caller):</span>
<span class="sd"> caller.msg(&quot;Custom quit message&quot;)</span>
<span class="sd"># start the editor</span>
<span class="sd">EvEditor(caller, loadfunc=None, savefunc=None, quitfunc=None, key=&quot;&quot;,</span>
<span class="sd"> persistent=True, code=False)</span>
<span class="sd">```</span>
<span class="sd">The editor can also be used to format Python code and be made to</span>
<span class="sd">survive a reload. See the `EvEditor` class for more details.</span>
<span class="sd">&quot;&quot;&quot;</span>
<span class="kn">import</span> <span class="nn">re</span>
@ -270,17 +265,18 @@
<div class="viewcode-block" id="CmdEditorBase.parse"><a class="viewcode-back" href="../../../api/evennia.utils.eveditor.html#evennia.utils.eveditor.CmdEditorBase.parse">[docs]</a> <span class="k">def</span> <span class="nf">parse</span><span class="p">(</span><span class="bp">self</span><span class="p">):</span>
<span class="sd">&quot;&quot;&quot;</span>
<span class="sd"> Handles pre-parsing</span>
<span class="sd"> Handles pre-parsing. Editor commands are on the form</span>
<span class="sd"> ::</span>
<span class="sd"> Usage:</span>
<span class="sd"> :cmd [li] [w] [txt]</span>
<span class="sd"> Where all arguments are optional.</span>
<span class="sd"> - li - line number (int), starting from 1. This could also</span>
<span class="sd"> be a range given as &lt;l&gt;:&lt;l&gt;.</span>
<span class="sd"> - w - word(s) (string), could be encased in quotes.</span>
<span class="sd"> - txt - extra text (string), could be encased in quotes.</span>
<span class="sd"> - `li` - line number (int), starting from 1. This could also</span>
<span class="sd"> be a range given as &lt;l&gt;:&lt;l&gt;.</span>
<span class="sd"> - `w` - word(s) (string), could be encased in quotes.</span>
<span class="sd"> - `txt` - extra text (string), could be encased in quotes.</span>
<span class="sd"> &quot;&quot;&quot;</span>

View file

@ -54,32 +54,34 @@
<span class="sd">object when displaying the form.</span>
<span class="sd">Example of input file `testform.py`:</span>
<span class="sd">::</span>
<span class="sd"> FORMCHAR = &quot;x&quot;</span>
<span class="sd"> TABLECHAR = &quot;c&quot;</span>
<span class="sd">```python</span>
<span class="sd">FORMCHAR = &quot;x&quot;</span>
<span class="sd">TABLECHAR = &quot;c&quot;</span>
<span class="sd"> FORM = &#39;&#39;&#39;</span>
<span class="sd"> .------------------------------------------------.</span>
<span class="sd"> | |</span>
<span class="sd"> | Name: xxxxx1xxxxx Player: xxxxxxx2xxxxxxx |</span>
<span class="sd"> | xxxxxxxxxxx |</span>
<span class="sd"> | |</span>
<span class="sd"> &gt;----------------------------------------------&lt;</span>
<span class="sd"> | |</span>
<span class="sd"> | Desc: xxxxxxxxxxx STR: x4x DEX: x5x |</span>
<span class="sd"> | xxxxx3xxxxx INT: x6x STA: x7x |</span>
<span class="sd"> | xxxxxxxxxxx LUC: x8x MAG: x9x |</span>
<span class="sd"> | |</span>
<span class="sd"> &gt;----------------------------------------------&lt;</span>
<span class="sd"> | | |</span>
<span class="sd"> | cccccccc | ccccccccccccccccccccccccccccccccccc |</span>
<span class="sd"> | cccccccc | ccccccccccccccccccccccccccccccccccc |</span>
<span class="sd"> | cccAcccc | ccccccccccccccccccccccccccccccccccc |</span>
<span class="sd"> | cccccccc | ccccccccccccccccccccccccccccccccccc |</span>
<span class="sd"> | cccccccc | cccccccccccccccccBccccccccccccccccc |</span>
<span class="sd"> | | |</span>
<span class="sd"> -------------------------------------------------</span>
<span class="sd">FORM = &#39;&#39;&#39;</span>
<span class="sd">.------------------------------------------------.</span>
<span class="sd">| |</span>
<span class="sd">| Name: xxxxx1xxxxx Player: xxxxxxx2xxxxxxx |</span>
<span class="sd">| xxxxxxxxxxx |</span>
<span class="sd">| |</span>
<span class="sd"> &gt;----------------------------------------------&lt;</span>
<span class="sd">| |</span>
<span class="sd">| Desc: xxxxxxxxxxx STR: x4x DEX: x5x |</span>
<span class="sd">| xxxxx3xxxxx INT: x6x STA: x7x |</span>
<span class="sd">| xxxxxxxxxxx LUC: x8x MAG: x9x |</span>
<span class="sd">| |</span>
<span class="sd"> &gt;----------------------------------------------&lt;</span>
<span class="sd">| | |</span>
<span class="sd">| cccccccc | ccccccccccccccccccccccccccccccccccc |</span>
<span class="sd">| cccccccc | ccccccccccccccccccccccccccccccccccc |</span>
<span class="sd">| cccAcccc | ccccccccccccccccccccccccccccccccccc |</span>
<span class="sd">| cccccccc | ccccccccccccccccccccccccccccccccccc |</span>
<span class="sd">| cccccccc | cccccccccccccccccBccccccccccccccccc |</span>
<span class="sd">| | |</span>
<span class="sd">-------------------------------------------------</span>
<span class="sd">&#39;&#39;&#39;</span>
<span class="sd">```</span>
<span class="sd">The first line of the `FORM` string is ignored. The forms and table</span>
<span class="sd">markers must mark out complete, unbroken rectangles, each containing</span>
@ -93,8 +95,8 @@
<span class="sd">Use as follows:</span>
<span class="sd">::</span>
<span class="sd">```python</span>
<span class="sd"> from evennia import EvForm, EvTable</span>
<span class="sd"> # create a new form from the template</span>
@ -126,9 +128,10 @@
<span class="sd"> &quot;B&quot;: tableB})</span>
<span class="sd"> print(form)</span>
<span class="sd">```</span>
<span class="sd">This produces the following result:</span>
<span class="sd">::</span>
<span class="sd"> .------------------------------------------------.</span>
@ -152,7 +155,6 @@
<span class="sd"> | | |</span>
<span class="sd"> ------------------------------------------------</span>
<span class="sd">The marked forms have been replaced with EvCells of text and with</span>
<span class="sd">EvTables. The form can be updated by simply re-applying `form.map()`</span>
<span class="sd">with the updated data.</span>
@ -227,15 +229,16 @@
<div class="viewcode-block" id="EvForm.__init__"><a class="viewcode-back" href="../../../api/evennia.utils.evform.html#evennia.utils.evform.EvForm.__init__">[docs]</a> <span class="k">def</span> <span class="nf">__init__</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">filename</span><span class="o">=</span><span class="kc">None</span><span class="p">,</span> <span class="n">cells</span><span class="o">=</span><span class="kc">None</span><span class="p">,</span> <span class="n">tables</span><span class="o">=</span><span class="kc">None</span><span class="p">,</span> <span class="n">form</span><span class="o">=</span><span class="kc">None</span><span class="p">,</span> <span class="o">**</span><span class="n">kwargs</span><span class="p">):</span>
<span class="sd">&quot;&quot;&quot;</span>
<span class="sd"> Initiate the form.</span>
<span class="sd"> Initiate the form</span>
<span class="sd"> Keyword Args:</span>
<span class="sd"> filename (str): Path to template file.</span>
<span class="sd"> cells (dict): A dictionary mapping of `{id:text}`.</span>
<span class="sd"> tables (dict): A dictionary mapping of `{id:EvTable}`.</span>
<span class="sd"> form (dict): A dictionary of</span>
<span class="sd"> `{&quot;FORMCHAR&quot;:char, &quot;TABLECHAR&quot;:char, &quot;FORM&quot;:templatestring}`.</span>
<span class="sd"> if this is given, filename is not read.</span>
<span class="sd"> cells (dict): A dictionary mapping `{id: text}`</span>
<span class="sd"> tables (dict): A dictionary mapping `{id: EvTable}`.</span>
<span class="sd"> form (dict): A dictionary</span>
<span class="sd"> `{&quot;FORMCHAR&quot;:char, &quot;TABLECHAR&quot;:char, &quot;FORM&quot;:templatestring}`.</span>
<span class="sd"> If this is given, filename is not read.</span>
<span class="sd"> Notes:</span>
<span class="sd"> Other kwargs are fed as options to the EvCells and EvTables</span>
<span class="sd"> (see `evtable.EvCell` and `evtable.EvTable` for more info).</span>

View file

@ -40,12 +40,14 @@
<h1>Source code for evennia.utils.evmenu</h1><div class="highlight"><pre>
<span></span><span class="sd">&quot;&quot;&quot;</span>
<span class="sd">The EvMenu is a full in-game menu system for Evennia.</span>
<span class="sd">EvMenu</span>
<span class="sd">This implements a full menu system for Evennia.</span>
<span class="sd">To start the menu, just import the EvMenu class from this module.</span>
<span class="sd">Example usage:</span>
<span class="sd">::</span>
<span class="sd">```python</span>
<span class="sd"> from evennia.utils.evmenu import EvMenu</span>
@ -53,10 +55,11 @@
<span class="sd"> startnode=&quot;node1&quot;,</span>
<span class="sd"> cmdset_mergetype=&quot;Replace&quot;, cmdset_priority=1,</span>
<span class="sd"> auto_quit=True, cmd_on_exit=&quot;look&quot;, persistent=True)</span>
<span class="sd">```</span>
<span class="sd">Where `caller` is the Object to use the menu on - it will get a new</span>
<span class="sd">cmdset while using the Menu. The `menu_module_path` is the python path</span>
<span class="sd">to a python module containing function definitions. By adjusting the</span>
<span class="sd">cmdset while using the Menu. The menu_module_path is the python path</span>
<span class="sd">to a python module containing function definitions. By adjusting the</span>
<span class="sd">keyword options of the Menu() initialization call you can start the</span>
<span class="sd">menu at different places in the menu definition file, adjust if the</span>
<span class="sd">menu command should overload the normal commands or not, etc.</span>
@ -70,7 +73,8 @@
<span class="sd">The menu is defined in a module (this can be the same module as the</span>
<span class="sd">command definition too) with function definitions:</span>
<span class="sd">::</span>
<span class="sd">```python</span>
<span class="sd"> def node1(caller):</span>
<span class="sd"> # (this is the start node if called like above)</span>
@ -84,8 +88,9 @@
<span class="sd"> def another_node(caller, input_string, **kwargs):</span>
<span class="sd"> # code</span>
<span class="sd"> return text, options</span>
<span class="sd">```</span>
<span class="sd">Where `caller` is the object using the menu and input_string is the</span>
<span class="sd">Where caller is the object using the menu and input_string is the</span>
<span class="sd">command entered by the user on the *previous* node (the command</span>
<span class="sd">entered to get to this node). The node function code will only be</span>
<span class="sd">executed once per node-visit and the system will accept nodes with</span>
@ -102,42 +107,42 @@
<span class="sd">menu is immediately exited and the default &quot;look&quot; command is called.</span>
<span class="sd">- `text` (str, tuple or None): Text shown at this node. If a tuple, the</span>
<span class="sd"> second element in the tuple is a help text to display at this</span>
<span class="sd"> node when the user enters the menu help command there.</span>
<span class="sd"> second element in the tuple is a help text to display at this</span>
<span class="sd"> node when the user enters the menu help command there.</span>
<span class="sd">- `options` (tuple, dict or None): If `None`, this exits the menu.</span>
<span class="sd"> If a single dict, this is a single-option node. If a tuple,</span>
<span class="sd"> it should be a tuple of option dictionaries. Option dicts have</span>
<span class="sd"> the following keys:</span>
<span class="sd"> it should be a tuple of option dictionaries. Option dicts have the following keys:</span>
<span class="sd"> - `key` (str or tuple, optional): What to enter to choose this option.</span>
<span class="sd"> If a tuple, it must be a tuple of strings, where the first string is the</span>
<span class="sd"> key which will be shown to the user and the others are aliases.</span>
<span class="sd"> If unset, the options&#39; number will be used. The special key `_default`</span>
<span class="sd"> marks this option as the default fallback when no other option matches</span>
<span class="sd"> the user input. There can only be one `_default` option per node. It</span>
<span class="sd"> will not be displayed in the list.</span>
<span class="sd"> If a tuple, it must be a tuple of strings, where the first string is the</span>
<span class="sd"> key which will be shown to the user and the others are aliases.</span>
<span class="sd"> If unset, the options&#39; number will be used. The special key `_default`</span>
<span class="sd"> marks this option as the default fallback when no other option matches</span>
<span class="sd"> the user input. There can only be one `_default` option per node. It</span>
<span class="sd"> will not be displayed in the list.</span>
<span class="sd"> - `desc` (str, optional): This describes what choosing the option will do.</span>
<span class="sd"> - `goto` (str, tuple or callable): If string, should be the name of node to go to</span>
<span class="sd"> when this option is selected. If a callable, it has the signature</span>
<span class="sd"> `callable(caller[,raw_input][,**kwargs])`. If a tuple, the first element</span>
<span class="sd"> is the callable and the second is a dict with the kwargs to pass to</span>
<span class="sd"> the callable. Those kwargs will also be passed into the next node if possible.</span>
<span class="sd"> Such a callable should return either a str or a (str, dict), where the</span>
<span class="sd"> string is the name of the next node to go to and the dict is the new,</span>
<span class="sd"> (possibly modified) kwarg to pass into the next node. If the callable returns</span>
<span class="sd"> None or the empty string, the current node will be revisited.</span>
<span class="sd"> when this option is selected. If a callable, it has the signature</span>
<span class="sd"> `callable(caller[,raw_input][,**kwargs])`. If a tuple, the first element</span>
<span class="sd"> is the callable and the second is a dict with the `**kwargs` to pass to</span>
<span class="sd"> the callable. Those kwargs will also be passed into the next node if possible.</span>
<span class="sd"> Such a callable should return either a str or a (str, dict), where the</span>
<span class="sd"> string is the name of the next node to go to and the dict is the new,</span>
<span class="sd"> (possibly modified) kwarg to pass into the next node. If the callable returns</span>
<span class="sd"> None or the empty string, the current node will be revisited.</span>
<span class="sd"> - `exec` (str, callable or tuple, optional): This takes the same input as `goto` above</span>
<span class="sd"> and runs before it. If given a node name, the node will be executed but will not</span>
<span class="sd"> be considered the next node. If node/callback returns str or (str, dict), these will</span>
<span class="sd"> replace the `goto` step (`goto` callbacks will not fire), with the string being the</span>
<span class="sd"> next node name and the optional dict acting as the kwargs-input for the next node.</span>
<span class="sd"> If an exec callable returns `None`, the current node is re-run.</span>
<span class="sd"> and runs before it. If given a node name, the node will be executed but will not</span>
<span class="sd"> be considered the next node. If node/callback returns str or (str, dict), these will</span>
<span class="sd"> replace the `goto` step (`goto` callbacks will not fire), with the string being the</span>
<span class="sd"> next node name and the optional dict acting as the kwargs-input for the next node.</span>
<span class="sd"> If an exec callable returns the empty string (only), the current node is re-run.</span>
<span class="sd">If key is not given, the option will automatically be identified by</span>
<span class="sd">If `key` is not given, the option will automatically be identified by</span>
<span class="sd">its number 1..N.</span>
<span class="sd">Example:</span>
<span class="sd">::</span>
<span class="sd">```python</span>
<span class="sd"> # in menu_module.py</span>
@ -173,8 +178,11 @@
<span class="sd"> text = &quot;This ends the menu since there are no options.&quot;</span>
<span class="sd"> return text, None</span>
<span class="sd">```</span>
<span class="sd">When starting this menu with `Menu(caller, &quot;path.to.menu_module&quot;)`,</span>
<span class="sd">the first node will look something like this:</span>
<span class="sd">::</span>
<span class="sd"> This is a node text</span>
@ -193,9 +201,8 @@
<span class="sd">reaching a node without any options.</span>
<span class="sd">For a menu demo, import CmdTestMenu from this module and add it to</span>
<span class="sd">your default cmdset. Run it with this module, like `testmenu</span>
<span class="sd">evennia.utils.evmenu`.</span>
<span class="sd">For a menu demo, import `CmdTestMenu` from this module and add it to</span>
<span class="sd">your default cmdset. Run it with this module, like `testmenu evennia.utils.evmenu`.</span>
<span class="sd">## Menu generation from template string</span>
@ -211,10 +218,13 @@
<span class="sd">For maximum flexibility you can inject normally-created nodes in the menu tree</span>
<span class="sd">before passing it to EvMenu. If that&#39;s not needed, you can also create a menu</span>
<span class="sd">in one step with:</span>
<span class="sd">::</span>
<span class="sd">```python</span>
<span class="sd"> evmenu.template2menu(caller, menu_template, goto_callables)</span>
<span class="sd">```</span>
<span class="sd">The `goto_callables` is a mapping `{&quot;funcname&quot;: callable, ...}`, where each</span>
<span class="sd">callable must be a module-global function on the form</span>
<span class="sd">`funcname(caller, raw_string, **kwargs)` (like any goto-callable). The</span>
@ -292,9 +302,9 @@
<span class="sd">key:values will be converted to strings/numbers with literal_eval before passed</span>
<span class="sd">into the callable.</span>
<span class="sd">The &quot;&gt; &quot; option takes a glob or regex to perform different actions depending on user</span>
<span class="sd">input. Make sure to sort these in increasing order of generality since they</span>
<span class="sd">will be tested in sequence.</span>
<span class="sd">The \\&gt; option takes a glob or regex to perform different actions depending</span>
<span class="sd">on user input. Make sure to sort these in increasing order of generality since</span>
<span class="sd">they will be tested in sequence.</span>
<span class="sd">----</span>
@ -573,9 +583,7 @@
<span class="sd"> by default in all nodes of the menu. This will print out the current state of</span>
<span class="sd"> the menu. Deactivate for production use! When the debug flag is active, the</span>
<span class="sd"> `persistent` flag is deactivated.</span>
<span class="sd"> Keyword Args:</span>
<span class="sd"> any (any): All kwargs will become initialization variables on `caller.ndb._evmenu`,</span>
<span class="sd"> **kwargs: All kwargs will become initialization variables on `caller.ndb._menutree`,</span>
<span class="sd"> to be available at run.</span>
<span class="sd"> Raises:</span>
@ -775,30 +783,6 @@
<span class="sd"> Call a node-like callable, with a variable number of raw_string, *args, **kwargs, all of</span>
<span class="sd"> which should work also if not present (only `caller` is always required). Return its result.</span>
<span class="sd"> Viable node-like callable forms:</span>
<span class="sd"> ::</span>
<span class="sd"> _callname(caller)</span>
<span class="sd"> _callname(caller, raw_string)</span>
<span class="sd"> _callname(caller, **kwargs)</span>
<span class="sd"> _callname(caller, raw_string, **kwargs)</span>
<span class="sd"> If this is a node:</span>
<span class="sd"> - `caller` is the one using the menu.</span>
<span class="sd"> - `raw_string` is the users exact input on the *previous* node.</span>
<span class="sd"> - `**kwargs` is either passed through the previous node or returned</span>
<span class="sd"> along with the node name from the goto-callable leading to this node.</span>
<span class="sd"> If this is a goto-callable:</span>
<span class="sd"> - `caller` is the one using the menu.</span>
<span class="sd"> - `raw_string` is the user&#39;s exact input when chosing the option that triggered</span>
<span class="sd"> this goto-callable.</span>
<span class="sd"> - `**kwargs` is any extra dict passed to the callable in the option</span>
<span class="sd"> definition, or (if no explit kwarg was given to the callable) the</span>
<span class="sd"> previous node&#39;s kwarg, if any.</span>
<span class="sd"> &quot;&quot;&quot;</span>
<span class="k">try</span><span class="p">:</span>
<span class="k">try</span><span class="p">:</span>
@ -1003,8 +987,7 @@
<span class="sd"> raw_string (str): The raw default string entered on the</span>
<span class="sd"> previous node (only used if the node accepts it as an</span>
<span class="sd"> argument)</span>
<span class="sd"> Keyword Args:</span>
<span class="sd"> any: Extra arguments to goto callables.</span>
<span class="sd"> **kwargs: Extra arguments to goto callables.</span>
<span class="sd"> &quot;&quot;&quot;</span>
@ -1377,33 +1360,29 @@
<span class="sd"> option_generator (callable or list): A list of strings indicating the options, or a callable</span>
<span class="sd"> that is called as option_generator(caller) to produce such a list.</span>
<span class="sd"> select (callable or str, optional): Node to redirect a selection to. Its `**kwargs` will</span>
<span class="sd"> contain the `available_choices` list and `selection` will hold one</span>
<span class="sd"> of the elements in that list. If a callable, it will be called as</span>
<span class="sd"> `select(caller, menuchoice, **kwargs)` where menuchoice is the</span>
<span class="sd"> chosen option as a string and `available_choices` is the list of available</span>
<span class="sd"> options offered by the option_generator. The callable whould return</span>
<span class="sd"> the name of the target node to goto after this selection (or None to repeat the</span>
<span class="sd"> list-node). Note that if this is not given, the decorated node</span>
<span class="sd"> must itself provide a way to continue from the node!</span>
<span class="sd"> contain the `available_choices` list and `selection` will hold one of the elements in</span>
<span class="sd"> that list. If a callable, it will be called as</span>
<span class="sd"> `select(caller, menuchoice, **kwargs)` where menuchoice is the chosen option as a</span>
<span class="sd"> string and `available_choices` is a kwarg mapping the option keys to the choices</span>
<span class="sd"> offered by the option_generator. The callable whould return the name of the target node</span>
<span class="sd"> to goto after this selection (or None to repeat the list-node). Note that if this is not</span>
<span class="sd"> given, the decorated node must itself provide a way to continue from the node!</span>
<span class="sd"> pagesize (int): How many options to show per page.</span>
<span class="sd"> Example:</span>
<span class="sd"> ::</span>
<span class="sd"> def _selectfunc(caller, menuchoice, **kwargs):</span>
<span class="sd"> # menuchoice would be either &#39;foo&#39; or &#39;bar&#39; here</span>
<span class="sd"> # kwargs[&#39;available_choices&#39;] would be the list [&#39;foo&#39;, &#39;bar&#39;]</span>
<span class="sd"> return &quot;the_next_node_to_go_to&quot;</span>
<span class="sd"> @list_node([&#39;foo&#39;, &#39;bar&#39;], _selectfunc)</span>
<span class="sd"> def node_index(caller):</span>
<span class="sd"> text = &quot;describing the list&quot;</span>
<span class="sd"> return text, []</span>
<span class="sd"> ```python</span>
<span class="sd"> list_node([&#39;foo&#39;, &#39;bar&#39;], select)</span>
<span class="sd"> def node_index(caller):</span>
<span class="sd"> text = &quot;describing the list&quot;</span>
<span class="sd"> return text, []</span>
<span class="sd"> ```</span>
<span class="sd"> Notes:</span>
<span class="sd"> All normal `goto` or `exec` callables returned from the decorated nodes will, if they accept</span>
<span class="sd"> `**kwargs`, get a new kwarg `available_choices` injected. This is the ordered list of named</span>
<span class="sd"> options (descs) visible on the current node page.</span>
<span class="sd"> All normal `goto` or `exec` callables returned from the decorated nodes</span>
<span class="sd"> will, if they accept `**kwargs`, get a new kwarg &#39;available_choices&#39;</span>
<span class="sd"> injected. These are the ordered list of named options (descs) visible</span>
<span class="sd"> on the current node page.</span>
<span class="sd"> &quot;&quot;&quot;</span>
@ -1624,60 +1603,51 @@
<div class="viewcode-block" id="get_input"><a class="viewcode-back" href="../../../api/evennia.utils.evmenu.html#evennia.utils.evmenu.get_input">[docs]</a><span class="k">def</span> <span class="nf">get_input</span><span class="p">(</span><span class="n">caller</span><span class="p">,</span> <span class="n">prompt</span><span class="p">,</span> <span class="n">callback</span><span class="p">,</span> <span class="n">session</span><span class="o">=</span><span class="kc">None</span><span class="p">,</span> <span class="o">*</span><span class="n">args</span><span class="p">,</span> <span class="o">**</span><span class="n">kwargs</span><span class="p">):</span>
<span class="sd">&quot;&quot;&quot;</span>
<span class="sd"> This is a helper function for easily request input from</span>
<span class="sd"> the caller.</span>
<span class="sd"> This is a helper function for easily request input from the caller.</span>
<span class="sd"> Args:</span>
<span class="sd"> caller (Account or Object): The entity being asked</span>
<span class="sd"> the question. This should usually be an object</span>
<span class="sd"> controlled by a user.</span>
<span class="sd"> prompt (str): This text will be shown to the user,</span>
<span class="sd"> in order to let them know their input is needed.</span>
<span class="sd"> caller (Account or Object): The entity being asked the question. This</span>
<span class="sd"> should usually be an object controlled by a user.</span>
<span class="sd"> prompt (str): This text will be shown to the user, in order to let them</span>
<span class="sd"> know their input is needed.</span>
<span class="sd"> callback (callable): A function that will be called</span>
<span class="sd"> when the user enters a reply. It must take three</span>
<span class="sd"> arguments: the `caller`, the `prompt` text and the</span>
<span class="sd"> `result` of the input given by the user. If the</span>
<span class="sd"> callback doesn&#39;t return anything or return False,</span>
<span class="sd"> the input prompt will be cleaned up and exited. If</span>
<span class="sd"> returning True, the prompt will remain and continue to</span>
<span class="sd"> accept input.</span>
<span class="sd"> when the user enters a reply. It must take three arguments: the</span>
<span class="sd"> `caller`, the `prompt` text and the `result` of the input given by</span>
<span class="sd"> the user. If the callback doesn&#39;t return anything or return False,</span>
<span class="sd"> the input prompt will be cleaned up and exited. If returning True,</span>
<span class="sd"> the prompt will remain and continue to accept input.</span>
<span class="sd"> session (Session, optional): This allows to specify the</span>
<span class="sd"> session to send the prompt to. It&#39;s usually only</span>
<span class="sd"> needed if `caller` is an Account in multisession modes</span>
<span class="sd"> greater than 2. The session is then updated by the</span>
<span class="sd"> command and is available (for example in callbacks)</span>
<span class="sd"> through `caller.ndb.getinput._session`.</span>
<span class="sd"> args, kwargs (optional): Extra arguments will be</span>
<span class="sd"> passed to the fall back function as a list &#39;args&#39;</span>
<span class="sd"> and all keyword arguments as a dictionary &#39;kwargs&#39;.</span>
<span class="sd"> To utilise `*args` and `**kwargs`, a value for the</span>
<span class="sd"> session argument must be provided (None by default)</span>
<span class="sd"> and the callback function must take `*args` and</span>
<span class="sd"> `**kwargs` as arguments.</span>
<span class="sd"> session to send the prompt to. It&#39;s usually only needed if `caller`</span>
<span class="sd"> is an Account in multisession modes greater than 2. The session is</span>
<span class="sd"> then updated by the command and is available (for example in</span>
<span class="sd"> callbacks) through `caller.ndb.getinput._session`.</span>
<span class="sd"> *args (any): Extra arguments to pass to `callback`. To utilise `*args`</span>
<span class="sd"> (and `**kwargs`), a value for the `session` argument must also be</span>
<span class="sd"> provided.</span>
<span class="sd"> **kwargs (any): Extra kwargs to pass to `callback`.</span>
<span class="sd"> Raises:</span>
<span class="sd"> RuntimeError: If the given callback is not callable.</span>
<span class="sd"> Notes:</span>
<span class="sd"> The result value sent to the callback is raw and not</span>
<span class="sd"> processed in any way. This means that you will get</span>
<span class="sd"> the ending line return character from most types of</span>
<span class="sd"> client inputs. So make sure to strip that before</span>
<span class="sd"> doing a comparison.</span>
<span class="sd"> The result value sent to the callback is raw and not processed in any</span>
<span class="sd"> way. This means that you will get the ending line return character from</span>
<span class="sd"> most types of client inputs. So make sure to strip that before doing a</span>
<span class="sd"> comparison.</span>
<span class="sd"> When the prompt is running, a temporary object</span>
<span class="sd"> `caller.ndb._getinput` is stored; this will be removed</span>
<span class="sd"> when the prompt finishes.</span>
<span class="sd"> If you need the specific Session of the caller (which</span>
<span class="sd"> may not be easy to get if caller is an account in higher</span>
<span class="sd"> multisession modes), then it is available in the</span>
<span class="sd"> callback through `caller.ndb._getinput._session`.</span>
<span class="sd"> When the prompt is running, a temporary object `caller.ndb._getinput`</span>
<span class="sd"> is stored; this will be removed when the prompt finishes.</span>
<span class="sd"> Chaining get_input functions will result in the caller</span>
<span class="sd"> stacking ever more instances of InputCmdSets. Whilst</span>
<span class="sd"> they will all be cleared on concluding the get_input</span>
<span class="sd"> chain, EvMenu should be considered for anything beyond</span>
<span class="sd"> a single question.</span>
<span class="sd"> If you need the specific Session of the caller (which may not be easy</span>
<span class="sd"> to get if caller is an account in higher multisession modes), then it</span>
<span class="sd"> is available in the callback through `caller.ndb._getinput._session`.</span>
<span class="sd"> This is why the `session` is required as input.</span>
<span class="sd"> It&#39;s not recommended to &#39;chain&#39; `get_input` into a sequence of</span>
<span class="sd"> questions. This will result in the caller stacking ever more instances</span>
<span class="sd"> of InputCmdSets. While they will all be cleared on concluding the</span>
<span class="sd"> get_input chain, EvMenu should be considered for anything beyond a</span>
<span class="sd"> single question.</span>
<span class="sd"> &quot;&quot;&quot;</span>
<span class="k">if</span> <span class="ow">not</span> <span class="n">callable</span><span class="p">(</span><span class="n">callback</span><span class="p">):</span>

View file

@ -43,29 +43,34 @@
<span class="sd">&quot;&quot;&quot;</span>
<span class="sd">EvMore - pager mechanism</span>
<span class="sd">This is a pager for displaying long texts and allows stepping up and</span>
<span class="sd">down in the text (the name comes from the traditional &#39;more&#39; unix</span>
<span class="sd">command).</span>
<span class="sd">This is a pager for displaying long texts and allows stepping up and down in</span>
<span class="sd">the text (the name comes from the traditional &#39;more&#39; unix command).</span>
<span class="sd">To use, simply pass the text through the EvMore object:</span>
<span class="sd">::</span>
<span class="sd">```python</span>
<span class="sd"> from evennia.utils.evmore import EvMore</span>
<span class="sd"> text = some_long_text_output()</span>
<span class="sd"> EvMore(caller, text, always_page=False, session=None, justify_kwargs=None, **kwargs)</span>
<span class="sd">```</span>
<span class="sd">One can also use the convenience function msg from this module:</span>
<span class="sd">::</span>
<span class="sd">One can also use the convenience function `msg` from this module to avoid</span>
<span class="sd">having to set up the `EvMenu` object manually:</span>
<span class="sd">```python</span>
<span class="sd"> from evennia.utils import evmore</span>
<span class="sd"> text = some_long_text_output()</span>
<span class="sd"> evmore.msg(caller, text, always_page=False, session=None, justify_kwargs=None, **kwargs)</span>
<span class="sd">```</span>
<span class="sd">Where always_page decides if the pager is used also if the text is not long</span>
<span class="sd">enough to need to scroll, session is used to determine which session to relay</span>
<span class="sd">to and `justify_kwargs` are kwargs to pass to `utils.utils.justify` in order to</span>
<span class="sd">The `always_page` argument decides if the pager is used also if the text is not long</span>
<span class="sd">enough to need to scroll, `session` is used to determine which session to relay</span>
<span class="sd">to and `justify_kwargs` are kwargs to pass to utils.utils.justify in order to</span>
<span class="sd">change the formatting of the text. The remaining `**kwargs` will be passed on to</span>
<span class="sd">the `caller.msg()` construct every time the page is updated.</span>
@ -77,7 +82,8 @@
<span class="kn">from</span> <span class="nn">django.core.paginator</span> <span class="k">import</span> <span class="n">Paginator</span>
<span class="kn">from</span> <span class="nn">evennia</span> <span class="k">import</span> <span class="n">Command</span><span class="p">,</span> <span class="n">CmdSet</span>
<span class="kn">from</span> <span class="nn">evennia.commands</span> <span class="k">import</span> <span class="n">cmdhandler</span>
<span class="kn">from</span> <span class="nn">evennia.utils.utils</span> <span class="k">import</span> <span class="n">make_iter</span><span class="p">,</span> <span class="n">inherits_from</span><span class="p">,</span> <span class="n">justify</span>
<span class="kn">from</span> <span class="nn">evennia.utils.ansi</span> <span class="k">import</span> <span class="n">ANSIString</span>
<span class="kn">from</span> <span class="nn">evennia.utils.utils</span> <span class="k">import</span> <span class="n">make_iter</span><span class="p">,</span> <span class="n">inherits_from</span><span class="p">,</span> <span class="n">justify</span><span class="p">,</span> <span class="n">dedent</span>
<span class="n">_CMD_NOMATCH</span> <span class="o">=</span> <span class="n">cmdhandler</span><span class="o">.</span><span class="n">CMD_NOMATCH</span>
<span class="n">_CMD_NOINPUT</span> <span class="o">=</span> <span class="n">cmdhandler</span><span class="o">.</span><span class="n">CMD_NOINPUT</span>
@ -88,6 +94,8 @@
<span class="n">_EVTABLE</span> <span class="o">=</span> <span class="kc">None</span>
<span class="n">_LBR</span> <span class="o">=</span> <span class="n">ANSIString</span><span class="p">(</span><span class="s2">&quot;</span><span class="se">\n</span><span class="s2">&quot;</span><span class="p">)</span>
<span class="c1"># text</span>
<span class="n">_DISPLAY</span> <span class="o">=</span> <span class="s2">&quot;&quot;&quot;</span><span class="si">{text}</span><span class="s2"></span>
@ -169,10 +177,9 @@
<span class="k">return</span> <span class="n">qs</span><span class="o">.</span><span class="n">count</span><span class="p">()</span></div>
<div class="viewcode-block" id="EvMore"><a class="viewcode-back" href="../../../api/evennia.utils.evmore.html#evennia.utils.evmore.EvMore">[docs]</a><span class="k">class</span> <span class="nc">EvMore</span><span class="p">:</span>
<div class="viewcode-block" id="EvMore"><a class="viewcode-back" href="../../../api/evennia.utils.evmore.html#evennia.utils.evmore.EvMore">[docs]</a><span class="k">class</span> <span class="nc">EvMore</span><span class="p">(</span><span class="nb">object</span><span class="p">):</span>
<span class="sd">&quot;&quot;&quot;</span>
<span class="sd"> The main pager object.</span>
<span class="sd"> The main pager object</span>
<span class="sd"> &quot;&quot;&quot;</span>
<div class="viewcode-block" id="EvMore.__init__"><a class="viewcode-back" href="../../../api/evennia.utils.evmore.html#evennia.utils.evmore.EvMore.__init__">[docs]</a> <span class="k">def</span> <span class="nf">__init__</span><span class="p">(</span>
@ -190,16 +197,15 @@
<span class="p">):</span>
<span class="sd">&quot;&quot;&quot;</span>
<span class="sd"> Initialization of the Evmore input handler.</span>
<span class="sd"> Initialization of the EvMore pager.</span>
<span class="sd"> Args:</span>
<span class="sd"> caller (Object or Account): Entity reading the text.</span>
<span class="sd"> inp (str, EvTable, Paginator or iterator): The text or data to put under paging.</span>
<span class="sd"> - If a string, paginage normally. If this text contains</span>
<span class="sd"> one or more \\\\f (backslash + f) format symbols, automatic</span>
<span class="sd"> pagination and justification are force-disabled and</span>
<span class="sd"> page-breaks will only happen after each \\\\f.</span>
<span class="sd"> one or more `\\\\f` format symbol, automatic pagination and justification</span>
<span class="sd"> are force-disabled and page-breaks will only happen after each `\\\\f`.</span>
<span class="sd"> - If `EvTable`, the EvTable will be paginated with the same</span>
<span class="sd"> setting on each page if it is too long. The table</span>
<span class="sd"> decorations will be considered in the size of the page.</span>
@ -207,8 +213,9 @@
<span class="sd"> expected to be a line in the final display. Each line</span>
<span class="sd"> will be run through `iter_callable`.</span>
<span class="sd"> always_page (bool, optional): If `False`, the pager will only kick</span>
<span class="sd"> in if `inp` is too big to fit the screen.</span>
<span class="sd"> always_page (bool, optional): If `False`, the</span>
<span class="sd"> pager will only kick in if `inp` is too big</span>
<span class="sd"> to fit the screen.</span>
<span class="sd"> session (Session, optional): If given, this session will be used</span>
<span class="sd"> to determine the screen width and will receive all output.</span>
<span class="sd"> justify (bool, optional): If set, auto-justify long lines. This must be turned</span>
@ -224,51 +231,29 @@
<span class="sd"> the caller when the more page exits. Note that this will be using whatever</span>
<span class="sd"> cmdset the user had *before* the evmore pager was activated (so none of</span>
<span class="sd"> the evmore commands will be available when this is run).</span>
<span class="sd"> kwargs (any, any): These will be passed on to the `caller.msg` method.</span>
<span class="sd"> kwargs (any, optional): These will be passed on to the `caller.msg` method.</span>
<span class="sd"> Examples:</span>
<span class="sd"> Basic use:</span>
<span class="sd"> ::</span>
<span class="sd"> super_long_text = &quot; ... &quot;</span>
<span class="sd"> EvMore(caller, super_long_text)</span>
<span class="sd"> Paginated query data - this is an optimization to avoid fetching</span>
<span class="sd"> database data until it&#39;s actually paged to.</span>
<span class="sd"> ::</span>
<span class="sd"> from django.core.paginator import Paginator</span>
<span class="sd"> query = ObjectDB.objects.all()</span>
<span class="sd"> pages = Paginator(query, 10) # 10 objs per page</span>
<span class="sd"> EvMore(caller, pages)</span>
<span class="sd"> Automatic split EvTable over multiple EvMore pages</span>
<span class="sd"> ::</span>
<span class="sd"> table = EvMore(*header, table=tabledata)</span>
<span class="sd"> EvMore(caller, table)</span>
<span class="sd"> Every page a separate EvTable (optimization for very large data sets)</span>
<span class="sd"> ::</span>
<span class="sd"> from evennia import EvTable, EvMore</span>
<span class="sd"> class TableEvMore(EvMore):</span>
<span class="sd"> def init_pages(self, data):</span>
<span class="sd"> pages = # depends on data type</span>
<span class="sd"> super().init_pages(pages)</span>
<span class="sd"> def page_formatter(self, page):</span>
<span class="sd"> table = EvTable()</span>
<span class="sd"> for line in page:</span>
<span class="sd"> cols = # split raw line into columns</span>
<span class="sd"> table.add_row(*cols)</span>
<span class="sd"> return str(table)</span>
<span class="sd"> TableEvMore(caller, pages)</span>
<span class="sd"> ```python</span>
<span class="sd"> super_long_text = &quot; ... &quot;</span>
<span class="sd"> EvMore(caller, super_long_text)</span>
<span class="sd"> ```</span>
<span class="sd"> Paginator</span>
<span class="sd"> ```python</span>
<span class="sd"> from django.core.paginator import Paginator</span>
<span class="sd"> query = ObjectDB.objects.all()</span>
<span class="sd"> pages = Paginator(query, 10) # 10 objs per page</span>
<span class="sd"> EvMore(caller, pages)</span>
<span class="sd"> ```</span>
<span class="sd"> Every page an EvTable</span>
<span class="sd"> ```python</span>
<span class="sd"> from evennia import EvTable</span>
<span class="sd"> def _to_evtable(page):</span>
<span class="sd"> table = ... # convert page to a table</span>
<span class="sd"> return EvTable(*headers, table=table, ...)</span>
<span class="sd"> EvMore(caller, pages, page_formatter=_to_evtable)</span>
<span class="sd"> ```</span>
<span class="sd"> &quot;&quot;&quot;</span>
<span class="bp">self</span><span class="o">.</span><span class="n">_caller</span> <span class="o">=</span> <span class="n">caller</span>
@ -455,9 +440,12 @@
<div class="viewcode-block" id="EvMore.init_f_str"><a class="viewcode-back" href="../../../api/evennia.utils.evmore.html#evennia.utils.evmore.EvMore.init_f_str">[docs]</a> <span class="k">def</span> <span class="nf">init_f_str</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">text</span><span class="p">):</span>
<span class="sd">&quot;&quot;&quot;</span>
<span class="sd"> The input contains \\\\f (backslash + f) markers. We use \\\\f to indicate</span>
<span class="sd"> the user wants to enforce their line breaks on their own. If so, we do</span>
<span class="sd"> no automatic line-breaking/justification at all.</span>
<span class="sd"> The input contains `\\f` markers. We use `\\f` to indicate the user wants to</span>
<span class="sd"> enforce their line breaks on their own. If so, we do no automatic</span>
<span class="sd"> line-breaking/justification at all.</span>
<span class="sd"> Args:</span>
<span class="sd"> text (str): The string to format with f-markers.</span>
<span class="sd"> &quot;&quot;&quot;</span>
<span class="bp">self</span><span class="o">.</span><span class="n">_data</span> <span class="o">=</span> <span class="n">text</span><span class="o">.</span><span class="n">split</span><span class="p">(</span><span class="s2">&quot;</span><span class="se">\f</span><span class="s2">&quot;</span><span class="p">)</span>
@ -486,7 +474,7 @@
<span class="n">lines</span> <span class="o">=</span> <span class="n">text</span><span class="o">.</span><span class="n">split</span><span class="p">(</span><span class="s2">&quot;</span><span class="se">\n</span><span class="s2">&quot;</span><span class="p">)</span>
<span class="bp">self</span><span class="o">.</span><span class="n">_data</span> <span class="o">=</span> <span class="p">[</span>
<span class="s2">&quot;</span><span class="se">\n</span><span class="s2">&quot;</span><span class="o">.</span><span class="n">join</span><span class="p">(</span><span class="n">lines</span><span class="p">[</span><span class="n">i</span> <span class="p">:</span> <span class="n">i</span> <span class="o">+</span> <span class="bp">self</span><span class="o">.</span><span class="n">height</span><span class="p">])</span> <span class="k">for</span> <span class="n">i</span> <span class="ow">in</span> <span class="nb">range</span><span class="p">(</span><span class="mi">0</span><span class="p">,</span> <span class="nb">len</span><span class="p">(</span><span class="n">lines</span><span class="p">),</span> <span class="bp">self</span><span class="o">.</span><span class="n">height</span><span class="p">)</span>
<span class="n">_LBR</span><span class="o">.</span><span class="n">join</span><span class="p">(</span><span class="n">lines</span><span class="p">[</span><span class="n">i</span> <span class="p">:</span> <span class="n">i</span> <span class="o">+</span> <span class="bp">self</span><span class="o">.</span><span class="n">height</span><span class="p">])</span> <span class="k">for</span> <span class="n">i</span> <span class="ow">in</span> <span class="nb">range</span><span class="p">(</span><span class="mi">0</span><span class="p">,</span> <span class="nb">len</span><span class="p">(</span><span class="n">lines</span><span class="p">),</span> <span class="bp">self</span><span class="o">.</span><span class="n">height</span><span class="p">)</span>
<span class="p">]</span>
<span class="bp">self</span><span class="o">.</span><span class="n">_npages</span> <span class="o">=</span> <span class="nb">len</span><span class="p">(</span><span class="bp">self</span><span class="o">.</span><span class="n">_data</span><span class="p">)</span></div>
@ -504,15 +492,13 @@
<span class="sd"> Notes:</span>
<span class="sd"> If overridden, this method must perform the following actions:</span>
<span class="sd"> - read and re-store `self._data` (the incoming data set) if needed</span>
<span class="sd"> for pagination to work.</span>
<span class="sd"> - read and re-store `self._data` (the incoming data set) if needed for pagination to work.</span>
<span class="sd"> - set `self._npages` to the total number of pages. Default is 1.</span>
<span class="sd"> - set `self._paginator` to a callable that will take a page number 1...N and return</span>
<span class="sd"> the data to display on that page (not any decorations or next/prev buttons). If only</span>
<span class="sd"> wanting to change the paginator, override `self.paginator` instead.</span>
<span class="sd"> - set `self._page_formatter` to a callable that will receive the</span>
<span class="sd"> page from `self._paginator` and format it with one element per</span>
<span class="sd"> line. Default is `str`. Or override `self.page_formatter`</span>
<span class="sd"> - set `self._page_formatter` to a callable that will receive the page from `self._paginator`</span>
<span class="sd"> and format it with one element per line. Default is `str`. Or override `self.page_formatter`</span>
<span class="sd"> directly instead.</span>
<span class="sd"> By default, helper methods are called that perform these actions</span>
@ -590,40 +576,6 @@
<span class="sd">&quot;&quot;&quot;</span>
<span class="sd"> EvMore-supported version of msg, mimicking the normal msg method.</span>
<span class="sd"> Args:</span>
<span class="sd"> caller (Object or Account): Entity reading the text.</span>
<span class="sd"> text (str, EvTable or iterator): The text or data to put under paging.</span>
<span class="sd"> - If a string, paginage normally. If this text contains</span>
<span class="sd"> one or more \\\\f (backslash + f) format symbol, automatic pagination is disabled</span>
<span class="sd"> and page-breaks will only happen after each \\\\f.</span>
<span class="sd"> - If `EvTable`, the EvTable will be paginated with the same</span>
<span class="sd"> setting on each page if it is too long. The table</span>
<span class="sd"> decorations will be considered in the size of the page.</span>
<span class="sd"> - Otherwise `text` is converted to an iterator, where each step is</span>
<span class="sd"> is expected to be a line in the final display, and each line</span>
<span class="sd"> will be run through repr().</span>
<span class="sd"> always_page (bool, optional): If `False`, the</span>
<span class="sd"> pager will only kick in if `text` is too big</span>
<span class="sd"> to fit the screen.</span>
<span class="sd"> session (Session, optional): If given, this session will be used</span>
<span class="sd"> to determine the screen width and will receive all output.</span>
<span class="sd"> justify (bool, optional): If set, justify long lines in output. Disable for</span>
<span class="sd"> fixed-format output, like tables.</span>
<span class="sd"> justify_kwargs (dict, bool or None, optional): If given, this should</span>
<span class="sd"> be valid keyword arguments to the utils.justify() function. If False,</span>
<span class="sd"> no justification will be done.</span>
<span class="sd"> exit_on_lastpage (bool, optional): Immediately exit pager when reaching the last page.</span>
<span class="sd"> use_evtable (bool, optional): If True, each page will be rendered as an</span>
<span class="sd"> EvTable. For this to work, `text` must be an iterable, where each element</span>
<span class="sd"> is the table (list of list) to render on that page.</span>
<span class="sd"> evtable_args (tuple, optional): The args to use for EvTable on each page.</span>
<span class="sd"> evtable_kwargs (dict, optional): The kwargs to use for EvTable on each</span>
<span class="sd"> page (except `table`, which is supplied by EvMore per-page).</span>
<span class="sd"> kwargs (any, optional): These will be passed on</span>
<span class="sd"> to the `caller.msg` method.</span>
<span class="sd"> &quot;&quot;&quot;</span>
<span class="n">EvMore</span><span class="p">(</span>
<span class="n">caller</span><span class="p">,</span>
@ -635,6 +587,9 @@
<span class="n">exit_on_lastpage</span><span class="o">=</span><span class="n">exit_on_lastpage</span><span class="p">,</span>
<span class="o">**</span><span class="n">kwargs</span><span class="p">,</span>
<span class="p">)</span></div>
<span class="n">msg</span><span class="o">.</span><span class="vm">__doc__</span> <span class="o">+=</span> <span class="n">dedent</span><span class="p">(</span><span class="n">EvMore</span><span class="o">.</span><span class="fm">__init__</span><span class="o">.</span><span class="vm">__doc__</span><span class="p">)</span>
</pre></div>
<div class="clearer"></div>

View file

@ -40,21 +40,25 @@
<h1>Source code for evennia.utils.evtable</h1><div class="highlight"><pre>
<span></span><span class="sd">&quot;&quot;&quot;</span>
<span class="sd">This is an advanced ASCII table creator. It was inspired by</span>
<span class="sd">[prettytable](https://code.google.com/p/prettytable/) but shares no code.</span>
<span class="sd">This is an advanced ASCII table creator. It was inspired by Prettytable</span>
<span class="sd">(https://code.google.com/p/prettytable/) but shares no code and is considerably</span>
<span class="sd">more advanced, supporting auto-balancing of incomplete tables and ANSI colors among</span>
<span class="sd">other things.</span>
<span class="sd">Example usage:</span>
<span class="sd">::</span>
<span class="sd"> from evennia.utils import evtable</span>
<span class="sd">```python</span>
<span class="sd"> from evennia.utils import evtable</span>
<span class="sd"> table = evtable.EvTable(&quot;Heading1&quot;, &quot;Heading2&quot;,</span>
<span class="sd"> table = evtable.EvTable(&quot;Heading1&quot;, &quot;Heading2&quot;,</span>
<span class="sd"> table=[[1,2,3],[4,5,6],[7,8,9]], border=&quot;cells&quot;)</span>
<span class="sd"> table.add_column(&quot;This is long data&quot;, &quot;This is even longer data&quot;)</span>
<span class="sd"> table.add_row(&quot;This is a single row&quot;)</span>
<span class="sd"> print table</span>
<span class="sd"> table.add_column(&quot;This is long data&quot;, &quot;This is even longer data&quot;)</span>
<span class="sd"> table.add_row(&quot;This is a single row&quot;)</span>
<span class="sd"> print table</span>
<span class="sd">```</span>
<span class="sd">Result:</span>
<span class="sd">::</span>
<span class="sd"> +----------------------+----------+---+--------------------------+</span>
@ -71,13 +75,15 @@
<span class="sd">As seen, the table will automatically expand with empty cells to make</span>
<span class="sd">the table symmetric. Tables can be restricted to a given width:</span>
<span class="sd">::</span>
<span class="sd"> table.reformat(width=50, align=&quot;l&quot;)</span>
<span class="sd">```python</span>
<span class="sd"> table.reformat(width=50, align=&quot;l&quot;)</span>
<span class="sd">```</span>
<span class="sd">(We could just have added these keywords to the table creation call)</span>
<span class="sd">This yields the following result:</span>
<span class="sd">::</span>
<span class="sd"> +-----------+------------+-----------+-----------+</span>
@ -98,16 +104,21 @@
<span class="sd"> | row | | | |</span>
<span class="sd"> +-----------+------------+-----------+-----------+</span>
<span class="sd">Table-columns can be individually formatted. Note that if an</span>
<span class="sd">individual column is set with a specific width, table auto-balancing</span>
<span class="sd">will not affect this column (this may lead to the full table being too</span>
<span class="sd">wide, so be careful mixing fixed-width columns with auto- balancing).</span>
<span class="sd">Here we change the width and alignment of the column at index 3</span>
<span class="sd">(Python starts from 0):</span>
<span class="sd">::</span>
<span class="sd"> table.reformat_column(3, width=30, align=&quot;r&quot;)</span>
<span class="sd"> print table</span>
<span class="sd">```python</span>
<span class="sd">table.reformat_column(3, width=30, align=&quot;r&quot;)</span>
<span class="sd">print table</span>
<span class="sd">```</span>
<span class="sd">::</span>
<span class="sd"> +-----------+-------+-----+-----------------------------+---------+</span>
<span class="sd"> | Heading1 | Headi | | | |</span>
@ -131,15 +142,14 @@
<span class="sd">vertically. This will lead to text contents being cropped. Each cell</span>
<span class="sd">can only shrink to a minimum width and height of 1.</span>
<span class="sd">`EvTable` is intended to be used with [ANSIString](evennia.utils.ansi#ansistring)</span>
<span class="sd">for supporting ANSI-coloured string types.</span>
<span class="sd">`EvTable` is intended to be used with `ANSIString` for supporting ANSI-coloured</span>
<span class="sd">string types.</span>
<span class="sd">When a cell is auto-wrapped across multiple lines, ANSI-reset</span>
<span class="sd">sequences will be put at the end of each wrapped line. This means that</span>
<span class="sd">the colour of a wrapped cell will not &quot;bleed&quot;, but it also means that</span>
<span class="sd">eventual colour outside the table will not transfer &quot;across&quot; a table,</span>
<span class="sd">you need to re-set the color to have it appear on both sides of the</span>
<span class="sd">table string.</span>
<span class="sd">When a cell is auto-wrapped across multiple lines, ANSI-reset sequences will be</span>
<span class="sd">put at the end of each wrapped line. This means that the colour of a wrapped</span>
<span class="sd">cell will not &quot;bleed&quot;, but it also means that eventual colour outside the table</span>
<span class="sd">will not transfer &quot;across&quot; a table, you need to re-set the color to have it</span>
<span class="sd">appear on both sides of the table string.</span>
<span class="sd">----</span>

View file

@ -43,20 +43,22 @@
<span class="sd">Inline functions (nested form).</span>
<span class="sd">This parser accepts nested inlinefunctions on the form</span>
<span class="sd">::</span>
<span class="sd"> $funcname(arg, arg, ...)</span>
<span class="sd">```python</span>
<span class="sd">$funcname(arg, arg, ...)</span>
<span class="sd">```</span>
<span class="sd">embedded in any text where any arg can be another `$funcname{}` call.</span>
<span class="sd">embedded in any text where any arg can be another ``$funcname()`` call.</span>
<span class="sd">This functionality is turned off by default - to activate,</span>
<span class="sd">`settings.INLINEFUNC_ENABLED` must be set to `True`.</span>
<span class="sd">Each token starts with `$funcname(` where there must be no space between the</span>
<span class="sd">$funcname and &quot;(&quot;. It ends with a matched ending parentesis &quot;)&quot;.</span>
<span class="sd">Each token starts with `$funcname(` where there must be no space</span>
<span class="sd">between the `$funcname` and `&quot;(&quot;`. The inlinefunc ends with a matched ending parentesis.</span>
<span class="sd">`&quot;)&quot;`.</span>
<span class="sd">Inside the inlinefunc definition, one can use \\\\ to escape. This is</span>
<span class="sd">Inside the inlinefunc definition, one can use `\` to escape. This is</span>
<span class="sd">mainly needed for escaping commas in flowing text (which would</span>
<span class="sd">otherwise be interpreted as an argument separator), or to escape `}`</span>
<span class="sd">otherwise be interpreted as an argument separator), or to escape `)`</span>
<span class="sd">when not intended to close the function block. Enclosing text in</span>
<span class="sd">matched `\&quot;\&quot;\&quot;` (triple quotes) or `&#39;&#39;&#39;` (triple single-quotes) will</span>
<span class="sd">also escape *everything* within without needing to escape individual</span>
@ -66,10 +68,11 @@
<span class="sd">modules defined by `settings.INLINEFUNC_MODULES`. They are identified</span>
<span class="sd">by their function name (and ignored if this name starts with `_`). They</span>
<span class="sd">should be on the following form:</span>
<span class="sd">::</span>
<span class="sd"> def funcname (*args, **kwargs):</span>
<span class="sd">```python</span>
<span class="sd">def funcname (*args, **kwargs):</span>
<span class="sd"> # ...</span>
<span class="sd">```</span>
<span class="sd">Here, the arguments given to `$funcname(arg1,arg2)` will appear as the</span>
<span class="sd">`*args` tuple. This will be populated by the arguments given to the</span>
@ -93,8 +96,9 @@
<span class="sd"> the `stackfull` inlinefunc is appended to the end. By default this is an</span>
<span class="sd"> error message.</span>
<span class="sd">Syntax errors, notably not completely closing all inlinefunc blocks, will lead</span>
<span class="sd">to the entire string remaining unparsed.</span>
<span class="sd">Syntax errors, notably failing to completely closing all inlinefunc</span>
<span class="sd">blocks, will lead to the entire string remaining unparsed. Inlineparsing should</span>
<span class="sd">never traceback.</span>
<span class="sd">----</span>
@ -132,10 +136,9 @@
<span class="sd"> given range.</span>
<span class="sd"> Example:</span>
<span class="sd"> - `$random()`</span>
<span class="sd"> - `$random(5)`</span>
<span class="sd"> - `$random(5, 10)`</span>
<span class="sd"> `$random()`</span>
<span class="sd"> `$random(5)`</span>
<span class="sd"> `$random(5, 10)`</span>
<span class="sd"> &quot;&quot;&quot;</span>
<span class="n">nargs</span> <span class="o">=</span> <span class="nb">len</span><span class="p">(</span><span class="n">args</span><span class="p">)</span>
@ -615,16 +618,16 @@
<span class="sd"> Args:</span>
<span class="sd"> in_template (str): The template to be used for nick recognition.</span>
<span class="sd"> out_template (str): The template to be used to replace the string</span>
<span class="sd"> matched by the `in_template`.</span>
<span class="sd"> matched by the in_template.</span>
<span class="sd"> Returns:</span>
<span class="sd"> regex, template (regex, str): Regex to match against strings and a</span>
<span class="sd"> template with markers `{arg1}`, `{arg2}`, etc for replacement using the</span>
<span class="sd"> standard `.format` method.</span>
<span class="sd"> regex (regex): Regex to match against strings</span>
<span class="sd"> template (str): Template with markers {arg1}, {arg2}, etc for</span>
<span class="sd"> replacement using the standard .format method.</span>
<span class="sd"> Raises:</span>
<span class="sd"> inlinefuncs.NickTemplateInvalid: If the in/out template does not have a matching</span>
<span class="sd"> number of $args.</span>
<span class="sd"> evennia.utils.inlinefuncs.NickTemplateInvalid: If the in/out template</span>
<span class="sd"> does not have a matching number of $args.</span>
<span class="sd"> &quot;&quot;&quot;</span>
<span class="c1"># create the regex for in_template</span>

View file

@ -39,13 +39,7 @@
<div class="body" role="main">
<h1>Source code for evennia.utils.optionclasses</h1><div class="highlight"><pre>
<span></span><span class="sd">&quot;&quot;&quot;</span>
<span class="sd">Option classes store user- or server Options in a generic way</span>
<span class="sd">while also providing validation.</span>
<span class="sd">&quot;&quot;&quot;</span>
<span class="kn">import</span> <span class="nn">datetime</span>
<span></span><span class="kn">import</span> <span class="nn">datetime</span>
<span class="kn">from</span> <span class="nn">evennia</span> <span class="k">import</span> <span class="n">logger</span>
<span class="kn">from</span> <span class="nn">evennia.utils.ansi</span> <span class="k">import</span> <span class="n">strip_ansi</span>
<span class="kn">from</span> <span class="nn">evennia.utils.validatorfuncs</span> <span class="k">import</span> <span class="n">_TZ_DICT</span>
@ -53,7 +47,7 @@
<span class="kn">from</span> <span class="nn">evennia.utils</span> <span class="k">import</span> <span class="n">validatorfuncs</span>
<div class="viewcode-block" id="BaseOption"><a class="viewcode-back" href="../../../api/evennia.utils.optionclasses.html#evennia.utils.optionclasses.BaseOption">[docs]</a><span class="k">class</span> <span class="nc">BaseOption</span><span class="p">:</span>
<div class="viewcode-block" id="BaseOption"><a class="viewcode-back" href="../../../api/evennia.utils.optionclasses.html#evennia.utils.optionclasses.BaseOption">[docs]</a><span class="k">class</span> <span class="nc">BaseOption</span><span class="p">(</span><span class="nb">object</span><span class="p">):</span>
<span class="sd">&quot;&quot;&quot;</span>
<span class="sd"> Abstract Class to deal with encapsulating individual Options. An Option has</span>
<span class="sd"> a name/key, a description to display in relevant commands and menus, and a</span>
@ -157,8 +151,8 @@
<div class="viewcode-block" id="BaseOption.save"><a class="viewcode-back" href="../../../api/evennia.utils.optionclasses.html#evennia.utils.optionclasses.BaseOption.save">[docs]</a> <span class="k">def</span> <span class="nf">save</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="o">**</span><span class="n">kwargs</span><span class="p">):</span>
<span class="sd">&quot;&quot;&quot;</span>
<span class="sd"> Stores the current value using `.handler.save_handler(self.key, value, **kwargs)`</span>
<span class="sd"> where kwargs are a combination of those passed into this function and the</span>
<span class="sd"> ones specified by the OptionHandler.</span>
<span class="sd"> where `kwargs` are a combination of those passed into this function and</span>
<span class="sd"> the ones specified by the `OptionHandler`.</span>
<span class="sd"> Keyword Args:</span>
<span class="sd"> any (any): Not used by default. These are passed in from self.set</span>

View file

@ -327,7 +327,7 @@
<span class="k">return</span> <span class="n">value</span></div>
<div class="viewcode-block" id="PickledObjectField.value_to_string"><a class="viewcode-back" href="../../../api/evennia.utils.picklefield.html#evennia.utils.picklefield.PickledObjectField.value_to_string">[docs]</a> <span class="k">def</span> <span class="nf">value_to_string</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">obj</span><span class="p">):</span>
<span class="n">value</span> <span class="o">=</span> <span class="bp">self</span><span class="o">.</span><span class="n">_get_val_from_obj</span><span class="p">(</span><span class="n">obj</span><span class="p">)</span>
<span class="n">value</span> <span class="o">=</span> <span class="bp">self</span><span class="o">.</span><span class="n">value_from_object</span><span class="p">(</span><span class="n">obj</span><span class="p">)</span>
<span class="k">return</span> <span class="bp">self</span><span class="o">.</span><span class="n">get_db_prep_value</span><span class="p">(</span><span class="n">value</span><span class="p">)</span></div>
<div class="viewcode-block" id="PickledObjectField.get_internal_type"><a class="viewcode-back" href="../../../api/evennia.utils.picklefield.html#evennia.utils.picklefield.PickledObjectField.get_internal_type">[docs]</a> <span class="k">def</span> <span class="nf">get_internal_type</span><span class="p">(</span><span class="bp">self</span><span class="p">):</span>

View file

@ -77,6 +77,7 @@
<span class="s2">&quot;search_message&quot;</span><span class="p">,</span>
<span class="s2">&quot;search_channel&quot;</span><span class="p">,</span>
<span class="s2">&quot;search_help_entry&quot;</span><span class="p">,</span>
<span class="s2">&quot;search_tag&quot;</span><span class="p">,</span>
<span class="s2">&quot;search_script_tag&quot;</span><span class="p">,</span>
<span class="s2">&quot;search_account_tag&quot;</span><span class="p">,</span>
<span class="s2">&quot;search_channel_tag&quot;</span><span class="p">,</span>

View file

@ -80,18 +80,18 @@
<span class="sd"> should directly give the module pathname to unload.</span>
<span class="sd"> Example:</span>
<span class="sd"> ::</span>
<span class="sd"> # (in a test method)</span>
<span class="sd"> unload_module(foo)</span>
<span class="sd"> with mock.patch(&quot;foo.GLOBALTHING&quot;, &quot;mockval&quot;):</span>
<span class="sd"> import foo</span>
<span class="sd"> ... # test code using foo.GLOBALTHING, now set to &#39;mockval&#39;</span>
<span class="sd"> ```python</span>
<span class="sd"> # (in a test method)</span>
<span class="sd"> unload_module(foo)</span>
<span class="sd"> with mock.patch(&quot;foo.GLOBALTHING&quot;, &quot;mockval&quot;):</span>
<span class="sd"> import foo</span>
<span class="sd"> ... # test code using foo.GLOBALTHING, now set to &#39;mockval&#39;</span>
<span class="sd"> ```</span>
<span class="sd"> Notes:</span>
<span class="sd"> This allows for mocking constants global to the module, since</span>
<span class="sd"> otherwise those would not be mocked (since a module is only</span>
<span class="sd"> loaded once).</span>
<span class="sd"> This allows for mocking constants global to the module, since</span>
<span class="sd"> otherwise those would not be mocked (since a module is only</span>
<span class="sd"> loaded once).</span>
<span class="sd"> &quot;&quot;&quot;</span>
<span class="k">if</span> <span class="nb">isinstance</span><span class="p">(</span><span class="n">module</span><span class="p">,</span> <span class="nb">str</span><span class="p">):</span>

View file

@ -401,17 +401,17 @@
<span class="sd"> values with double quotes.</span>
<span class="sd"> Returns:</span>
<span class="sd"> liststr (str): The list represented as a string.</span>
<span class="sd"> str: The list represented as a string.</span>
<span class="sd"> Examples:</span>
<span class="sd"> ```python</span>
<span class="sd"> # no endsep:</span>
<span class="sd"> [1,2,3] -&gt; &#39;1, 2, 3&#39;</span>
<span class="sd"> # with endsep==&#39;and&#39;:</span>
<span class="sd"> [1,2,3] -&gt; &#39;1, 2 and 3&#39;</span>
<span class="sd"> # with addquote and endsep</span>
<span class="sd"> [1,2,3] -&gt; &#39;&quot;1&quot;, &quot;2&quot; and &quot;3&quot;&#39;</span>
<span class="sd"> &gt;&gt;&gt; list_to_string([1,2,3], endsep=&#39;&#39;)</span>
<span class="sd"> &#39;1, 2, 3&#39;</span>
<span class="sd"> &gt;&gt;&gt; list_to_string([1,2,3], ensdep=&#39;and&#39;)</span>
<span class="sd"> &#39;1, 2 and 3&#39;</span>
<span class="sd"> &gt;&gt;&gt; list_to_string([1,2,3], endsep=&#39;and&#39;, addquote=True)</span>
<span class="sd"> &#39;&quot;1&quot;, &quot;2&quot; and &quot;3&quot;&#39;</span>
<span class="sd"> ```</span>
<span class="sd"> &quot;&quot;&quot;</span>
@ -891,7 +891,7 @@
<span class="sd"> the text with &quot;?&quot; in place of problematic characters. If the specified encoding cannot</span>
<span class="sd"> be found, the protocol flag is reset to utf-8. In any case, returns bytes.</span>
<span class="sd"> Note:</span>
<span class="sd"> Notes:</span>
<span class="sd"> If `text` is already bytes, return it as is.</span>
<span class="sd"> &quot;&quot;&quot;</span>
@ -931,7 +931,7 @@
<span class="sd"> Returns:</span>
<span class="sd"> decoded_text (str): The decoded text.</span>
<span class="sd"> Note:</span>
<span class="sd"> Notes:</span>
<span class="sd"> If `text` is already str, return it as is.</span>
<span class="sd"> &quot;&quot;&quot;</span>
<span class="k">if</span> <span class="nb">isinstance</span><span class="p">(</span><span class="n">text</span><span class="p">,</span> <span class="nb">str</span><span class="p">):</span>
@ -985,18 +985,17 @@
<span class="sd"> distance from parent.</span>
<span class="sd"> Args:</span>
<span class="sd"> obj (any): Object to analyze. This may be either an instance</span>
<span class="sd"> or a class.</span>
<span class="sd"> parent (any): Can be either instance, class or python path to class.</span>
<span class="sd"> obj (any): Object to analyze. This may be either an instance or</span>
<span class="sd"> a class.</span>
<span class="sd"> parent (any): Can be either an instance, a class or the python</span>
<span class="sd"> path to the class.</span>
<span class="sd"> Returns:</span>
<span class="sd"> inherits_from (bool): If `parent` is a parent to `obj` or not.</span>
<span class="sd"> Notes:</span>
<span class="sd"> What differs this function from e.g. `isinstance()` is that `obj`</span>
<span class="sd"> may be both an instance and a class, and parent may be an</span>
<span class="sd"> instance, a class, or the python path to a class (counting from</span>
<span class="sd"> the evennia root directory).</span>
<span class="sd"> What differentiates this function from Python&#39;s `isinstance()` is the</span>
<span class="sd"> flexibility in the types allowed for the object and parent being compared.</span>
<span class="sd"> &quot;&quot;&quot;</span>
@ -1044,8 +1043,7 @@
<span class="sd"> shortcut to having to use the full backend name.</span>
<span class="sd"> Args:</span>
<span class="sd"> name (str): One of &#39;sqlite3&#39;, &#39;mysql&#39;, &#39;postgresql&#39;</span>
<span class="sd"> or &#39;oracle&#39;.</span>
<span class="sd"> name (str): One of &#39;sqlite3&#39;, &#39;mysql&#39;, &#39;postgresql&#39; or &#39;oracle&#39;.</span>
<span class="sd"> Returns:</span>
<span class="sd"> uses (bool): If the given database is used or not.</span>
@ -1069,20 +1067,19 @@
<span class="sd"> timedelay (int or float): The delay in seconds</span>
<span class="sd"> callback (callable): Will be called as `callback(*args, **kwargs)`</span>
<span class="sd"> after `timedelay` seconds.</span>
<span class="sd"> args (any, optional): Will be used as arguments to callback</span>
<span class="sd"> *args: Will be used as arguments to callback</span>
<span class="sd"> Keyword Args:</span>
<span class="sd"> persistent (bool, optional): should make the delay persistent</span>
<span class="sd"> over a reboot or reload</span>
<span class="sd"> any (any): Will be used as keyword arguments to callback.</span>
<span class="sd"> persistent (bool): Make the delay persistent over a reboot or reload.</span>
<span class="sd"> any: Any other keywords will be use as keyword arguments to callback.</span>
<span class="sd"> Returns:</span>
<span class="sd"> deferred (deferred): Will fire with callback after</span>
<span class="sd"> `timedelay` seconds. Note that if `timedelay()` is used in the</span>
<span class="sd"> commandhandler callback chain, the callback chain can be</span>
<span class="sd"> defined directly in the command body and don&#39;t need to be</span>
<span class="sd"> specified here.</span>
<span class="sd"> deferred: Will fire with callback after `timedelay` seconds. Note that</span>
<span class="sd"> if `timedelay()` is used in the</span>
<span class="sd"> commandhandler callback chain, the callback chain can be</span>
<span class="sd"> defined directly in the command body and don&#39;t need to be</span>
<span class="sd"> specified here.</span>
<span class="sd"> Note:</span>
<span class="sd"> Notes:</span>
<span class="sd"> The task handler (`evennia.scripts.taskhandler.TASK_HANDLER`) will</span>
<span class="sd"> be called for persistent or non-persistent tasks.</span>
<span class="sd"> If persistent is set to True, the callback, its arguments</span>
@ -1113,17 +1110,16 @@
<span class="sd"> executed with `*args` and non-reserved `**kwargs` as arguments.</span>
<span class="sd"> The callable will be executed using ProcPool, or in a thread</span>
<span class="sd"> if ProcPool is not available.</span>
<span class="sd"> Keyword Args:</span>
<span class="sd"> at_return (callable): Should point to a callable with one</span>
<span class="sd"> argument. It will be called with the return value from</span>
<span class="sd"> to_execute.</span>
<span class="sd"> argument. It will be called with the return value from</span>
<span class="sd"> to_execute.</span>
<span class="sd"> at_return_kwargs (dict): This dictionary will be used as</span>
<span class="sd"> keyword arguments to the at_return callback.</span>
<span class="sd"> keyword arguments to the at_return callback.</span>
<span class="sd"> at_err (callable): This will be called with a Failure instance</span>
<span class="sd"> if there is an error in to_execute.</span>
<span class="sd"> if there is an error in to_execute.</span>
<span class="sd"> at_err_kwargs (dict): This dictionary will be used as keyword</span>
<span class="sd"> arguments to the at_err errback.</span>
<span class="sd"> arguments to the at_err errback.</span>
<span class="sd"> Notes:</span>
<span class="sd"> All other `*args` and `**kwargs` will be passed on to</span>
@ -1209,7 +1205,7 @@
<div class="viewcode-block" id="has_parent"><a class="viewcode-back" href="../../../api/evennia.utils.utils.html#evennia.utils.utils.has_parent">[docs]</a><span class="k">def</span> <span class="nf">has_parent</span><span class="p">(</span><span class="n">basepath</span><span class="p">,</span> <span class="n">obj</span><span class="p">):</span>
<span class="sd">&quot;&quot;&quot;</span>
<span class="sd"> Checks if `basepath` is somewhere in `obj`&#39;s parent tree.</span>
<span class="sd"> Checks if `basepath` is somewhere in obj&#39;s parent tree.</span>
<span class="sd"> Args:</span>
<span class="sd"> basepath (str): Python dotpath to compare against obj path.</span>
@ -1577,8 +1573,8 @@
<span class="sd"> Returns:</span>
<span class="sd"> suggestions (list): Suggestions from `vocabulary` with a</span>
<span class="sd"> similarity-rating that higher than or equal to `cutoff`.</span>
<span class="sd"> Could be empty if there are no matches.</span>
<span class="sd"> similarity-rating that higher than or equal to `cutoff`.</span>
<span class="sd"> Could be empty if there are no matches.</span>
<span class="sd"> &quot;&quot;&quot;</span>
<span class="k">return</span> <span class="p">[</span>
@ -1646,11 +1642,9 @@
<div class="viewcode-block" id="format_table"><a class="viewcode-back" href="../../../api/evennia.utils.utils.html#evennia.utils.utils.format_table">[docs]</a><span class="k">def</span> <span class="nf">format_table</span><span class="p">(</span><span class="n">table</span><span class="p">,</span> <span class="n">extra_space</span><span class="o">=</span><span class="mi">1</span><span class="p">):</span>
<span class="sd">&quot;&quot;&quot;</span>
<span class="sd"> Note: `evennia.utils.evtable` is more powerful than this, but this function</span>
<span class="sd"> can be useful when the number of columns and rows are unknown and must be</span>
<span class="sd"> calculated on the fly.</span>
<span class="sd"> Format a 2D array of strings into a multi-column table.</span>
<span class="sd"> Args.</span>
<span class="sd"> Args:</span>
<span class="sd"> table (list): A list of lists to represent columns in the</span>
<span class="sd"> table: `[[val,val,val,...], [val,val,val,...], ...]`, where</span>
<span class="sd"> each val will be placed on a separate row in the</span>
@ -1660,26 +1654,30 @@
<span class="sd"> padding (in characters) should be left between columns.</span>
<span class="sd"> Returns:</span>
<span class="sd"> table (list): A list of lists representing the rows to print</span>
<span class="sd"> out one by one.</span>
<span class="sd"> list: A list of lists representing the rows to print out one by one.</span>
<span class="sd"> Notes:</span>
<span class="sd"> The function formats the columns to be as wide as the widest member</span>
<span class="sd"> of each column.</span>
<span class="sd"> Example:</span>
<span class="sd"> ::</span>
<span class="sd"> `evennia.utils.evtable` is more powerful than this, but this</span>
<span class="sd"> function can be useful when the number of columns and rows are</span>
<span class="sd"> unknown and must be calculated on the fly.</span>
<span class="sd"> ftable = format_table([[...], [...], ...])</span>
<span class="sd"> for ir, row in enumarate(ftable):</span>
<span class="sd"> if ir == 0:</span>
<span class="sd"> # make first row white</span>
<span class="sd"> string += &quot;\\\\n|w&quot; + &quot;&quot;join(row) + &quot;|n&quot;</span>
<span class="sd"> else:</span>
<span class="sd"> string += &quot;\\\\n&quot; + &quot;&quot;.join(row)</span>
<span class="sd"> print(string)</span>
<span class="sd"> Examples: ::</span>
<span class="sd"> ftable = format_table([[1,2,3], [4,5,6]])</span>
<span class="sd"> string = &quot;&quot;</span>
<span class="sd"> for ir, row in enumarate(ftable):</span>
<span class="sd"> if ir == 0:</span>
<span class="sd"> # make first row white</span>
<span class="sd"> string += &quot;\\n|w&quot; + &quot;&quot;.join(row) + &quot;|n&quot;</span>
<span class="sd"> else:</span>
<span class="sd"> string += &quot;\\n&quot; + &quot;&quot;.join(row)</span>
<span class="sd"> print(string)</span>
<span class="sd"> &quot;&quot;&quot;</span>
<span class="k">if</span> <span class="ow">not</span> <span class="n">table</span><span class="p">:</span>
<span class="k">return</span> <span class="p">[[]]</span>
@ -1695,6 +1693,191 @@
<span class="k">return</span> <span class="n">ftable</span></div>
<div class="viewcode-block" id="percent"><a class="viewcode-back" href="../../../api/evennia.utils.utils.html#evennia.utils.utils.percent">[docs]</a><span class="k">def</span> <span class="nf">percent</span><span class="p">(</span><span class="n">value</span><span class="p">,</span> <span class="n">minval</span><span class="p">,</span> <span class="n">maxval</span><span class="p">,</span> <span class="n">formatting</span><span class="o">=</span><span class="s2">&quot;</span><span class="si">{:3.1f}</span><span class="s2">%&quot;</span><span class="p">):</span>
<span class="sd">&quot;&quot;&quot;</span>
<span class="sd"> Get a value in an interval as a percentage of its position</span>
<span class="sd"> in that interval. This also understands negative numbers.</span>
<span class="sd"> Args:</span>
<span class="sd"> value (number): This should be a value minval&lt;=value&lt;=maxval.</span>
<span class="sd"> minval (number or None): Smallest value in interval. This could be None</span>
<span class="sd"> for an open interval (then return will always be 100%)</span>
<span class="sd"> maxval (number or None): Biggest value in interval. This could be None</span>
<span class="sd"> for an open interval (then return will always be 100%)</span>
<span class="sd"> formatted (str, optional): This is a string that should</span>
<span class="sd"> accept one formatting tag. This will receive the</span>
<span class="sd"> current value as a percentage. If None, the</span>
<span class="sd"> raw float will be returned instead.</span>
<span class="sd"> Returns:</span>
<span class="sd"> str or float: The formatted value or the raw percentage as a float.</span>
<span class="sd"> Notes:</span>
<span class="sd"> We try to handle a weird interval gracefully.</span>
<span class="sd"> - If either maxval or minval is None (open interval), we (aribtrarily) assume 100%.</span>
<span class="sd"> - If minval &gt; maxval, we return 0%.</span>
<span class="sd"> - If minval == maxval == value we are looking at a single value match and return 100%.</span>
<span class="sd"> - If minval == maxval != value we return 0%.</span>
<span class="sd"> - If value not in [minval..maxval], we set value to the closest</span>
<span class="sd"> boundary, so the result will be 0% or 100%, respectively.</span>
<span class="sd"> &quot;&quot;&quot;</span>
<span class="n">result</span> <span class="o">=</span> <span class="kc">None</span>
<span class="k">if</span> <span class="kc">None</span> <span class="ow">in</span> <span class="p">(</span><span class="n">minval</span><span class="p">,</span> <span class="n">maxval</span><span class="p">):</span>
<span class="c1"># we have no boundaries, percent calculation makes no sense,</span>
<span class="c1"># we set this to 100% since it</span>
<span class="n">result</span> <span class="o">=</span> <span class="mf">100.0</span>
<span class="k">elif</span> <span class="n">minval</span> <span class="o">&gt;</span> <span class="n">maxval</span><span class="p">:</span>
<span class="c1"># interval has no width so we cannot</span>
<span class="c1"># occupy any position within it.</span>
<span class="n">result</span> <span class="o">=</span> <span class="mf">0.0</span>
<span class="k">elif</span> <span class="n">minval</span> <span class="o">==</span> <span class="n">maxval</span> <span class="o">==</span> <span class="n">value</span><span class="p">:</span>
<span class="c1"># this is a single value that we match</span>
<span class="n">result</span> <span class="o">=</span> <span class="mf">100.0</span>
<span class="k">elif</span> <span class="n">minval</span> <span class="o">==</span> <span class="n">maxval</span> <span class="o">!=</span> <span class="n">value</span><span class="p">:</span>
<span class="c1"># interval has no width so we cannot be in it.</span>
<span class="n">result</span> <span class="o">=</span> <span class="mf">0.0</span>
<span class="k">if</span> <span class="n">result</span> <span class="ow">is</span> <span class="kc">None</span><span class="p">:</span>
<span class="c1"># constrain value to interval</span>
<span class="n">value</span> <span class="o">=</span> <span class="nb">min</span><span class="p">(</span><span class="nb">max</span><span class="p">(</span><span class="n">minval</span><span class="p">,</span> <span class="n">value</span><span class="p">),</span> <span class="n">maxval</span><span class="p">)</span>
<span class="c1"># these should both be &gt;0</span>
<span class="n">dpart</span> <span class="o">=</span> <span class="n">value</span> <span class="o">-</span> <span class="n">minval</span>
<span class="n">dfull</span> <span class="o">=</span> <span class="n">maxval</span> <span class="o">-</span> <span class="n">minval</span>
<span class="n">result</span> <span class="o">=</span> <span class="p">(</span><span class="n">dpart</span> <span class="o">/</span> <span class="n">dfull</span><span class="p">)</span> <span class="o">*</span> <span class="mf">100.0</span>
<span class="k">if</span> <span class="nb">isinstance</span><span class="p">(</span><span class="n">formatting</span><span class="p">,</span> <span class="nb">str</span><span class="p">):</span>
<span class="k">return</span> <span class="n">formatting</span><span class="o">.</span><span class="n">format</span><span class="p">(</span><span class="n">result</span><span class="p">)</span>
<span class="k">return</span> <span class="n">result</span></div>
<span class="kn">import</span> <span class="nn">functools</span> <span class="c1"># noqa</span>
<div class="viewcode-block" id="percentile"><a class="viewcode-back" href="../../../api/evennia.utils.utils.html#evennia.utils.utils.percentile">[docs]</a><span class="k">def</span> <span class="nf">percentile</span><span class="p">(</span><span class="n">iterable</span><span class="p">,</span> <span class="n">percent</span><span class="p">,</span> <span class="n">key</span><span class="o">=</span><span class="k">lambda</span> <span class="n">x</span><span class="p">:</span> <span class="n">x</span><span class="p">):</span>
<span class="sd">&quot;&quot;&quot;</span>
<span class="sd"> Find the percentile of a list of values.</span>
<span class="sd"> Args:</span>
<span class="sd"> iterable (iterable): A list of values. Note N MUST BE already sorted.</span>
<span class="sd"> percent (float): A value from 0.0 to 1.0.</span>
<span class="sd"> key (callable, optional). Function to compute value from each element of N.</span>
<span class="sd"> Returns:</span>
<span class="sd"> float: The percentile of the values</span>
<span class="sd"> &quot;&quot;&quot;</span>
<span class="k">if</span> <span class="ow">not</span> <span class="n">iterable</span><span class="p">:</span>
<span class="k">return</span> <span class="kc">None</span>
<span class="n">k</span> <span class="o">=</span> <span class="p">(</span><span class="nb">len</span><span class="p">(</span><span class="n">iterable</span><span class="p">)</span> <span class="o">-</span> <span class="mi">1</span><span class="p">)</span> <span class="o">*</span> <span class="n">percent</span>
<span class="n">f</span> <span class="o">=</span> <span class="n">math</span><span class="o">.</span><span class="n">floor</span><span class="p">(</span><span class="n">k</span><span class="p">)</span>
<span class="n">c</span> <span class="o">=</span> <span class="n">math</span><span class="o">.</span><span class="n">ceil</span><span class="p">(</span><span class="n">k</span><span class="p">)</span>
<span class="k">if</span> <span class="n">f</span> <span class="o">==</span> <span class="n">c</span><span class="p">:</span>
<span class="k">return</span> <span class="n">key</span><span class="p">(</span><span class="n">iterable</span><span class="p">[</span><span class="nb">int</span><span class="p">(</span><span class="n">k</span><span class="p">)])</span>
<span class="n">d0</span> <span class="o">=</span> <span class="n">key</span><span class="p">(</span><span class="n">iterable</span><span class="p">[</span><span class="nb">int</span><span class="p">(</span><span class="n">f</span><span class="p">)])</span> <span class="o">*</span> <span class="p">(</span><span class="n">c</span> <span class="o">-</span> <span class="n">k</span><span class="p">)</span>
<span class="n">d1</span> <span class="o">=</span> <span class="n">key</span><span class="p">(</span><span class="n">iterable</span><span class="p">[</span><span class="nb">int</span><span class="p">(</span><span class="n">c</span><span class="p">)])</span> <span class="o">*</span> <span class="p">(</span><span class="n">k</span> <span class="o">-</span> <span class="n">f</span><span class="p">)</span>
<span class="k">return</span> <span class="n">d0</span> <span class="o">+</span> <span class="n">d1</span></div>
<div class="viewcode-block" id="format_grid"><a class="viewcode-back" href="../../../api/evennia.utils.utils.html#evennia.utils.utils.format_grid">[docs]</a><span class="k">def</span> <span class="nf">format_grid</span><span class="p">(</span><span class="n">elements</span><span class="p">,</span> <span class="n">width</span><span class="o">=</span><span class="mi">78</span><span class="p">,</span> <span class="n">sep</span><span class="o">=</span><span class="s2">&quot; &quot;</span><span class="p">,</span> <span class="n">verbatim_elements</span><span class="o">=</span><span class="kc">None</span><span class="p">):</span>
<span class="sd">&quot;&quot;&quot;</span>
<span class="sd"> This helper function makes a &#39;grid&#39; output, where it distributes the given</span>
<span class="sd"> string-elements as evenly as possible to fill out the given width.</span>
<span class="sd"> will not work well if the variation of length is very big!</span>
<span class="sd"> Args:</span>
<span class="sd"> elements (iterable): A 1D list of string elements to put in the grid.</span>
<span class="sd"> width (int, optional): The width of the grid area to fill.</span>
<span class="sd"> sep (str, optional): The extra separator to put between words. If</span>
<span class="sd"> set to the empty string, words may run into each other.</span>
<span class="sd"> verbatim_elements (list, optional): This is a list of indices pointing to</span>
<span class="sd"> specific items in the `elements` list. An element at this index will</span>
<span class="sd"> not be included in the calculation of the slot sizes. It will still</span>
<span class="sd"> be inserted into the grid at the correct position and may be surrounded</span>
<span class="sd"> by padding unless filling the entire line. This is useful for embedding</span>
<span class="sd"> decorations in the grid, such as horizontal bars.</span>
<span class="sd"> Returns:</span>
<span class="sd"> gridstr: The grid as a list of ready-formatted rows. We return it</span>
<span class="sd"> like this to make it easier to insert decorations between rows, such</span>
<span class="sd"> as horizontal bars.</span>
<span class="sd"> &quot;&quot;&quot;</span>
<span class="k">if</span> <span class="ow">not</span> <span class="n">verbatim_elements</span><span class="p">:</span>
<span class="n">verbatim_elements</span> <span class="o">=</span> <span class="p">[]</span>
<span class="n">nelements</span> <span class="o">=</span> <span class="nb">len</span><span class="p">(</span><span class="n">elements</span><span class="p">)</span>
<span class="c1"># add sep to all but the very last element</span>
<span class="n">elements</span> <span class="o">=</span> <span class="p">[</span><span class="n">elements</span><span class="p">[</span><span class="n">ie</span><span class="p">]</span> <span class="o">+</span> <span class="n">sep</span> <span class="k">for</span> <span class="n">ie</span> <span class="ow">in</span> <span class="nb">range</span><span class="p">(</span><span class="n">nelements</span> <span class="o">-</span> <span class="mi">1</span><span class="p">)]</span> <span class="o">+</span> <span class="p">[</span><span class="n">elements</span><span class="p">[</span><span class="o">-</span><span class="mi">1</span><span class="p">]]</span>
<span class="n">wls</span> <span class="o">=</span> <span class="p">[</span><span class="nb">len</span><span class="p">(</span><span class="n">elem</span><span class="p">)</span> <span class="k">for</span> <span class="n">elem</span> <span class="ow">in</span> <span class="n">elements</span><span class="p">]</span>
<span class="n">wls_percentile</span> <span class="o">=</span> <span class="p">[</span><span class="n">wl</span> <span class="k">for</span> <span class="n">iw</span><span class="p">,</span> <span class="n">wl</span> <span class="ow">in</span> <span class="nb">enumerate</span><span class="p">(</span><span class="n">wls</span><span class="p">)</span> <span class="k">if</span> <span class="n">iw</span> <span class="ow">not</span> <span class="ow">in</span> <span class="n">verbatim_elements</span><span class="p">]</span>
<span class="c1"># from pudb import debugger</span>
<span class="c1"># debugger.Debugger().set_trace()</span>
<span class="c1"># get the nth percentile as a good representation of average width</span>
<span class="n">averlen</span> <span class="o">=</span> <span class="nb">int</span><span class="p">(</span><span class="n">percentile</span><span class="p">(</span><span class="nb">sorted</span><span class="p">(</span><span class="n">wls_percentile</span><span class="p">),</span> <span class="mf">0.9</span><span class="p">))</span> <span class="o">+</span> <span class="mi">2</span> <span class="c1"># include extra space</span>
<span class="n">aver_per_row</span> <span class="o">=</span> <span class="n">width</span> <span class="o">//</span> <span class="n">averlen</span> <span class="o">+</span> <span class="mi">1</span>
<span class="k">if</span> <span class="n">aver_per_row</span> <span class="o">==</span> <span class="mi">1</span><span class="p">:</span>
<span class="c1"># one line per row, output directly since this is trivial</span>
<span class="c1"># we use rstrip here to remove extra spaces added by sep</span>
<span class="k">return</span> <span class="p">[</span>
<span class="n">crop</span><span class="p">(</span><span class="n">element</span><span class="o">.</span><span class="n">rstrip</span><span class="p">(),</span> <span class="n">width</span><span class="p">)</span> <span class="o">+</span> <span class="s2">&quot; &quot;</span> <span class="o">*</span> <span class="nb">max</span><span class="p">(</span><span class="mi">0</span><span class="p">,</span> <span class="n">width</span> <span class="o">-</span> <span class="nb">len</span><span class="p">(</span><span class="n">element</span><span class="o">.</span><span class="n">rstrip</span><span class="p">()))</span>
<span class="k">for</span> <span class="n">iel</span><span class="p">,</span> <span class="n">element</span> <span class="ow">in</span> <span class="nb">enumerate</span><span class="p">(</span><span class="n">elements</span><span class="p">)</span>
<span class="p">]</span>
<span class="n">indices</span> <span class="o">=</span> <span class="p">[</span><span class="n">averlen</span> <span class="o">*</span> <span class="n">ind</span> <span class="k">for</span> <span class="n">ind</span> <span class="ow">in</span> <span class="nb">range</span><span class="p">(</span><span class="n">aver_per_row</span> <span class="o">-</span> <span class="mi">1</span><span class="p">)]</span>
<span class="n">rows</span> <span class="o">=</span> <span class="p">[]</span>
<span class="n">ic</span> <span class="o">=</span> <span class="mi">0</span>
<span class="n">row</span> <span class="o">=</span> <span class="s2">&quot;&quot;</span>
<span class="k">for</span> <span class="n">ie</span><span class="p">,</span> <span class="n">element</span> <span class="ow">in</span> <span class="nb">enumerate</span><span class="p">(</span><span class="n">elements</span><span class="p">):</span>
<span class="n">wl</span> <span class="o">=</span> <span class="n">wls</span><span class="p">[</span><span class="n">ie</span><span class="p">]</span>
<span class="n">lrow</span> <span class="o">=</span> <span class="nb">len</span><span class="p">(</span><span class="n">row</span><span class="p">)</span>
<span class="n">debug</span> <span class="o">=</span> <span class="n">row</span><span class="o">.</span><span class="n">replace</span><span class="p">(</span><span class="s2">&quot; &quot;</span><span class="p">,</span> <span class="s2">&quot;.&quot;</span><span class="p">)</span>
<span class="k">if</span> <span class="n">lrow</span> <span class="o">+</span> <span class="n">wl</span> <span class="o">&gt;</span> <span class="n">width</span><span class="p">:</span>
<span class="c1"># this slot extends outside grid, move to next line</span>
<span class="n">row</span> <span class="o">+=</span> <span class="s2">&quot; &quot;</span> <span class="o">*</span> <span class="p">(</span><span class="n">width</span> <span class="o">-</span> <span class="n">lrow</span><span class="p">)</span>
<span class="n">rows</span><span class="o">.</span><span class="n">append</span><span class="p">(</span><span class="n">row</span><span class="p">)</span>
<span class="k">if</span> <span class="n">wl</span> <span class="o">&gt;=</span> <span class="n">width</span><span class="p">:</span>
<span class="c1"># remove sep if this fills the entire line</span>
<span class="n">element</span> <span class="o">=</span> <span class="n">element</span><span class="o">.</span><span class="n">rstrip</span><span class="p">()</span>
<span class="n">row</span> <span class="o">=</span> <span class="n">crop</span><span class="p">(</span><span class="n">element</span><span class="p">,</span> <span class="n">width</span><span class="p">)</span>
<span class="n">ic</span> <span class="o">=</span> <span class="mi">0</span>
<span class="k">elif</span> <span class="n">ic</span> <span class="o">&gt;=</span> <span class="n">aver_per_row</span> <span class="o">-</span> <span class="mi">1</span><span class="p">:</span>
<span class="c1"># no more slots available on this line</span>
<span class="n">row</span> <span class="o">+=</span> <span class="s2">&quot; &quot;</span> <span class="o">*</span> <span class="nb">max</span><span class="p">(</span><span class="mi">0</span><span class="p">,</span> <span class="p">(</span><span class="n">width</span> <span class="o">-</span> <span class="n">lrow</span><span class="p">))</span>
<span class="n">rows</span><span class="o">.</span><span class="n">append</span><span class="p">(</span><span class="n">row</span><span class="p">)</span>
<span class="n">row</span> <span class="o">=</span> <span class="n">crop</span><span class="p">(</span><span class="n">element</span><span class="p">,</span> <span class="n">width</span><span class="p">)</span>
<span class="n">ic</span> <span class="o">=</span> <span class="mi">0</span>
<span class="k">else</span><span class="p">:</span>
<span class="k">try</span><span class="p">:</span>
<span class="k">while</span> <span class="n">lrow</span> <span class="o">&gt;</span> <span class="nb">max</span><span class="p">(</span><span class="mi">0</span><span class="p">,</span> <span class="n">indices</span><span class="p">[</span><span class="n">ic</span><span class="p">]):</span>
<span class="c1"># slot too wide, extend into adjacent slot</span>
<span class="n">ic</span> <span class="o">+=</span> <span class="mi">1</span>
<span class="n">row</span> <span class="o">+=</span> <span class="s2">&quot; &quot;</span> <span class="o">*</span> <span class="nb">max</span><span class="p">(</span><span class="mi">0</span><span class="p">,</span> <span class="n">indices</span><span class="p">[</span><span class="n">ic</span><span class="p">]</span> <span class="o">-</span> <span class="n">lrow</span><span class="p">)</span>
<span class="k">except</span> <span class="ne">IndexError</span><span class="p">:</span>
<span class="c1"># we extended past edge of grid, crop or move to next line</span>
<span class="k">if</span> <span class="n">ic</span> <span class="o">==</span> <span class="mi">0</span><span class="p">:</span>
<span class="n">row</span> <span class="o">=</span> <span class="n">crop</span><span class="p">(</span><span class="n">element</span><span class="p">,</span> <span class="n">width</span><span class="p">)</span>
<span class="k">else</span><span class="p">:</span>
<span class="n">row</span> <span class="o">+=</span> <span class="s2">&quot; &quot;</span> <span class="o">*</span> <span class="nb">max</span><span class="p">(</span><span class="mi">0</span><span class="p">,</span> <span class="n">width</span> <span class="o">-</span> <span class="n">lrow</span><span class="p">)</span>
<span class="n">rows</span><span class="o">.</span><span class="n">append</span><span class="p">(</span><span class="n">row</span><span class="p">)</span>
<span class="n">ic</span> <span class="o">=</span> <span class="mi">0</span>
<span class="k">else</span><span class="p">:</span>
<span class="c1"># add a new slot</span>
<span class="n">row</span> <span class="o">+=</span> <span class="n">element</span> <span class="o">+</span> <span class="s2">&quot; &quot;</span> <span class="o">*</span> <span class="nb">max</span><span class="p">(</span><span class="mi">0</span><span class="p">,</span> <span class="n">averlen</span> <span class="o">-</span> <span class="n">wl</span><span class="p">)</span>
<span class="n">ic</span> <span class="o">+=</span> <span class="mi">1</span>
<span class="k">if</span> <span class="n">ie</span> <span class="o">&gt;=</span> <span class="n">nelements</span> <span class="o">-</span> <span class="mi">1</span><span class="p">:</span>
<span class="c1"># last element, make sure to store</span>
<span class="n">row</span> <span class="o">+=</span> <span class="s2">&quot; &quot;</span> <span class="o">*</span> <span class="nb">max</span><span class="p">(</span><span class="mi">0</span><span class="p">,</span> <span class="n">width</span> <span class="o">-</span> <span class="nb">len</span><span class="p">(</span><span class="n">row</span><span class="p">))</span>
<span class="n">rows</span><span class="o">.</span><span class="n">append</span><span class="p">(</span><span class="n">row</span><span class="p">)</span>
<span class="k">return</span> <span class="n">rows</span></div>
<div class="viewcode-block" id="get_evennia_pids"><a class="viewcode-back" href="../../../api/evennia.utils.utils.html#evennia.utils.utils.get_evennia_pids">[docs]</a><span class="k">def</span> <span class="nf">get_evennia_pids</span><span class="p">():</span>
<span class="sd">&quot;&quot;&quot;</span>
<span class="sd"> Get the currently valid PIDs (Process IDs) of the Portal and</span>
@ -1706,13 +1889,13 @@
<span class="sd"> Examples:</span>
<span class="sd"> This can be used to determine if we are in a subprocess by</span>
<span class="sd"> something like:</span>
<span class="sd"> ```python</span>
<span class="sd"> self_pid = os.getpid()</span>
<span class="sd"> server_pid, portal_pid = get_evennia_pids()</span>
<span class="sd"> is_subprocess = self_pid not in (server_pid, portal_pid)</span>
<span class="sd"> ```</span>
<span class="sd"> &quot;&quot;&quot;</span>
<span class="n">server_pidfile</span> <span class="o">=</span> <span class="n">os</span><span class="o">.</span><span class="n">path</span><span class="o">.</span><span class="n">join</span><span class="p">(</span><span class="n">settings</span><span class="o">.</span><span class="n">GAME_DIR</span><span class="p">,</span> <span class="s2">&quot;server.pid&quot;</span><span class="p">)</span>
<span class="n">portal_pidfile</span> <span class="o">=</span> <span class="n">os</span><span class="o">.</span><span class="n">path</span><span class="o">.</span><span class="n">join</span><span class="p">(</span><span class="n">settings</span><span class="o">.</span><span class="n">GAME_DIR</span><span class="p">,</span> <span class="s2">&quot;portal.pid&quot;</span><span class="p">)</span>
@ -1928,16 +2111,15 @@
<span class="sd"> query (str, optional): The search query used to produce `matches`.</span>
<span class="sd"> quiet (bool, optional): If `True`, no messages will be echoed to caller</span>
<span class="sd"> on errors.</span>
<span class="sd"> Keyword Args:</span>
<span class="sd"> nofound_string (str): Replacement string to echo on a notfound error.</span>
<span class="sd"> multimatch_string (str): Replacement string to echo on a multimatch error.</span>
<span class="sd"> Returns:</span>
<span class="sd"> processed_result (Object or None): This is always a single result</span>
<span class="sd"> or `None`. If `None`, any error reporting/handling should</span>
<span class="sd"> already have happened. The returned object is of the type we are</span>
<span class="sd"> checking multimatches for (e.g. Objects or Commands)</span>
<span class="sd"> or `None`. If `None`, any error reporting/handling should</span>
<span class="sd"> already have happened. The returned object is of the type we are</span>
<span class="sd"> checking multimatches for (e.g. Objects or Commands)</span>
<span class="sd"> &quot;&quot;&quot;</span>
@ -1996,10 +2178,10 @@
<span class="sd"> Keyword Args:</span>
<span class="sd"> size_limit (int): Use this to limit the number of elements</span>
<span class="sd"> alloweds to be in this list. By default the overshooting elements</span>
<span class="sd"> will be removed in FIFO order.</span>
<span class="sd"> alloweds to be in this list. By default the overshooting elements</span>
<span class="sd"> will be removed in FIFO order.</span>
<span class="sd"> fifo (bool, optional): Defaults to `True`. Remove overshooting elements</span>
<span class="sd"> in FIFO order. If `False`, remove in FILO order.</span>
<span class="sd"> in FIFO order. If `False`, remove in FILO order.</span>
<span class="sd"> &quot;&quot;&quot;</span>
<span class="nb">super</span><span class="p">()</span><span class="o">.</span><span class="fm">__init__</span><span class="p">()</span>
@ -2066,10 +2248,10 @@
<span class="sd"> from this parent.</span>
<span class="sd"> Returns:</span>
<span class="sd"> typeclasses (dict): On the form {&quot;typeclass.path&quot;: typeclass, ...}</span>
<span class="sd"> dict: On the form `{&quot;typeclass.path&quot;: typeclass, ...}`</span>
<span class="sd"> Notes:</span>
<span class="sd"> This will dynamicall retrieve all abstract django models inheriting at any distance</span>
<span class="sd"> This will dynamically retrieve all abstract django models inheriting at any distance</span>
<span class="sd"> from the TypedObject base (aka a Typeclass) so it will work fine with any custom</span>
<span class="sd"> classes being added.</span>
@ -2092,14 +2274,19 @@
<div class="viewcode-block" id="interactive"><a class="viewcode-back" href="../../../api/evennia.utils.utils.html#evennia.utils.utils.interactive">[docs]</a><span class="k">def</span> <span class="nf">interactive</span><span class="p">(</span><span class="n">func</span><span class="p">):</span>
<span class="sd">&quot;&quot;&quot;</span>
<span class="sd"> Decorator to make a method pausable with yield(seconds) and able to ask for</span>
<span class="sd"> user-input with `response=yield(question)`. For the question-asking to</span>
<span class="sd"> work, &#39;caller&#39; must the name of an argument or kwarg to the decorated</span>
<span class="sd"> function.</span>
<span class="sd"> Decorator to make a method pausable with `yield(seconds)`</span>
<span class="sd"> and able to ask for user-input with `response=yield(question)`.</span>
<span class="sd"> For the question-asking to work, one of the args or kwargs to the</span>
<span class="sd"> decorated function must be named &#39;caller&#39;.</span>
<span class="sd"> Example:</span>
<span class="sd"> ::</span>
<span class="sd"> Raises:</span>
<span class="sd"> ValueError: If asking an interactive question but the decorated</span>
<span class="sd"> function has no arg or kwarg named &#39;caller&#39;.</span>
<span class="sd"> ValueError: If passing non int/float to yield using for pausing.</span>
<span class="sd"> Examples:</span>
<span class="sd"> ```python</span>
<span class="sd"> @interactive</span>
<span class="sd"> def myfunc(caller):</span>
<span class="sd"> caller.msg(&quot;This is a test&quot;)</span>
@ -2111,9 +2298,10 @@
<span class="sd"> yield(5)</span>
<span class="sd"> else:</span>
<span class="sd"> # ...</span>
<span class="sd"> ```</span>
<span class="sd"> Notes:</span>
<span class="sd"> This turns the method into a generator!</span>
<span class="sd"> This turns the decorated function or method into a generator.</span>
<span class="sd"> &quot;&quot;&quot;</span>
<span class="kn">from</span> <span class="nn">evennia.utils.evmenu</span> <span class="k">import</span> <span class="n">get_input</span>

View file

@ -89,12 +89,10 @@
<span class="sd"> account (AccountDB): The Account performing this lookup. Unless `from_tz` is provided,</span>
<span class="sd"> the account&#39;s timezone option will be used.</span>
<span class="sd"> from_tz (pytz.timezone): An instance of a pytz timezone object from the</span>
<span class="sd"> user. If not provided, tries to use the timezone option of the `account`.</span>
<span class="sd"> user. If not provided, tries to use the timezone option of `account`.</span>
<span class="sd"> If neither one is provided, defaults to UTC.</span>
<span class="sd"> Returns:</span>
<span class="sd"> datetime in UTC.</span>
<span class="sd"> Raises:</span>
<span class="sd"> ValueError: If encountering a malformed timezone, date string or other format error.</span>

View file

@ -266,8 +266,14 @@
<li class="toctree-l2"><a class="reference internal" href="evennia.utils.html">evennia.utils</a><ul>
<li class="toctree-l3"><a class="reference internal" href="evennia.utils.ansi.html">evennia.utils.ansi</a></li>
<li class="toctree-l3"><a class="reference internal" href="evennia.utils.batchprocessors.html">evennia.utils.batchprocessors</a><ul>
<li class="toctree-l4"><a class="reference internal" href="evennia.utils.batchprocessors.html#batch-command-processor-file-syntax">Batch-Command processor file syntax</a></li>
<li class="toctree-l4"><a class="reference internal" href="evennia.utils.batchprocessors.html#batch-code-processor-file-syntax">Batch-Code processor file syntax</a></li>
<li class="toctree-l4"><a class="reference internal" href="evennia.utils.batchprocessors.html#batch-command-processor-file-syntax">Batch-command processor file syntax</a><ul>
<li class="toctree-l5"><a class="reference internal" href="evennia.utils.batchprocessors.html#example-of-batch-ev-file">Example of batch.ev file:</a></li>
</ul>
</li>
<li class="toctree-l4"><a class="reference internal" href="evennia.utils.batchprocessors.html#batch-code-processor-file-syntax">Batch-code processor file syntax</a><ul>
<li class="toctree-l5"><a class="reference internal" href="evennia.utils.batchprocessors.html#example-batch-py-file">Example batch.py file</a></li>
</ul>
</li>
</ul>
</li>
<li class="toctree-l3"><a class="reference internal" href="evennia.utils.containers.html">evennia.utils.containers</a></li>

View file

@ -939,6 +939,94 @@ overriding the call (unused by default).</p></li>
</dd></dl>
<dl class="py class">
<dt id="evennia.accounts.accounts.DefaultGuest">
<em class="property">class </em><code class="sig-prename descclassname">evennia.accounts.accounts.</code><code class="sig-name descname">DefaultGuest</code><span class="sig-paren">(</span><em class="sig-param"><span class="o">*</span><span class="n">args</span></em>, <em class="sig-param"><span class="o">**</span><span class="n">kwargs</span></em><span class="sig-paren">)</span><a class="reference internal" href="../_modules/evennia/accounts/accounts.html#DefaultGuest"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#evennia.accounts.accounts.DefaultGuest" title="Permalink to this definition"></a></dt>
<dd><p>Bases: <a class="reference internal" href="#evennia.accounts.accounts.DefaultAccount" title="evennia.accounts.accounts.DefaultAccount"><code class="xref py py-class docutils literal notranslate"><span class="pre">evennia.accounts.accounts.DefaultAccount</span></code></a></p>
<p>This class is used for guest logins. Unlike Accounts, Guests and
their characters are deleted after disconnection.</p>
<dl class="py method">
<dt id="evennia.accounts.accounts.DefaultGuest.create">
<em class="property">classmethod </em><code class="sig-name descname">create</code><span class="sig-paren">(</span><em class="sig-param"><span class="o">**</span><span class="n">kwargs</span></em><span class="sig-paren">)</span><a class="reference internal" href="../_modules/evennia/accounts/accounts.html#DefaultGuest.create"><span class="viewcode-link">[source]</span></a><a class="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
if one is available for use.</p>
</dd></dl>
<dl class="py method">
<dt id="evennia.accounts.accounts.DefaultGuest.authenticate">
<em class="property">classmethod </em><code class="sig-name descname">authenticate</code><span class="sig-paren">(</span><em class="sig-param"><span class="o">**</span><span class="n">kwargs</span></em><span class="sig-paren">)</span><a class="reference internal" href="../_modules/evennia/accounts/accounts.html#DefaultGuest.authenticate"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#evennia.accounts.accounts.DefaultGuest.authenticate" title="Permalink to this definition"></a></dt>
<dd><p>Gets or creates a Guest account object.</p>
<dl class="field-list simple">
<dt class="field-odd">Keyword Arguments</dt>
<dd class="field-odd"><p><strong>ip</strong> (<em>str</em><em>, </em><em>optional</em>) IP address of requestor; used for ban checking,
throttling and logging</p>
</dd>
<dt class="field-even">Returns</dt>
<dd class="field-even"><p><em>account (Object)</em> Guest account object, if available
errors (list): List of error messages accrued during this request.</p>
</dd>
</dl>
</dd></dl>
<dl class="py method">
<dt id="evennia.accounts.accounts.DefaultGuest.at_post_login">
<code class="sig-name descname">at_post_login</code><span class="sig-paren">(</span><em class="sig-param"><span class="n">session</span><span class="o">=</span><span class="default_value">None</span></em>, <em class="sig-param"><span class="o">**</span><span class="n">kwargs</span></em><span class="sig-paren">)</span><a class="reference internal" href="../_modules/evennia/accounts/accounts.html#DefaultGuest.at_post_login"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#evennia.accounts.accounts.DefaultGuest.at_post_login" title="Permalink to this definition"></a></dt>
<dd><p>In theory, guests only have one character regardless of which
MULTISESSION_MODE were in. They dont get a choice.</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters</dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>session</strong> (<a class="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 connecting.</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>
</dd></dl>
<dl class="py method">
<dt id="evennia.accounts.accounts.DefaultGuest.at_server_shutdown">
<code class="sig-name descname">at_server_shutdown</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="reference internal" href="../_modules/evennia/accounts/accounts.html#DefaultGuest.at_server_shutdown"><span class="viewcode-link">[source]</span></a><a class="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
be on the safe side.</p>
</dd></dl>
<dl class="py method">
<dt id="evennia.accounts.accounts.DefaultGuest.at_post_disconnect">
<code class="sig-name descname">at_post_disconnect</code><span class="sig-paren">(</span><em class="sig-param"><span class="o">**</span><span class="n">kwargs</span></em><span class="sig-paren">)</span><a class="reference internal" href="../_modules/evennia/accounts/accounts.html#DefaultGuest.at_post_disconnect"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#evennia.accounts.accounts.DefaultGuest.at_post_disconnect" title="Permalink to this definition"></a></dt>
<dd><p>Once having disconnected, destroy the guests characters and</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters</dt>
<dd class="field-odd"><p><strong>**kwargs</strong> (<em>dict</em>) Arbitrary, optional arguments for users
overriding the call (unused by default).</p>
</dd>
</dl>
</dd></dl>
<dl class="py exception">
<dt id="evennia.accounts.accounts.DefaultGuest.DoesNotExist">
<em class="property">exception </em><code class="sig-name descname">DoesNotExist</code><a class="headerlink" href="#evennia.accounts.accounts.DefaultGuest.DoesNotExist" title="Permalink to this definition"></a></dt>
<dd><p>Bases: <a class="reference internal" href="#evennia.accounts.accounts.DefaultAccount.DoesNotExist" title="evennia.accounts.accounts.DefaultAccount.DoesNotExist"><code class="xref py py-class docutils literal notranslate"><span class="pre">evennia.accounts.accounts.DefaultAccount.DoesNotExist</span></code></a></p>
</dd></dl>
<dl class="py exception">
<dt id="evennia.accounts.accounts.DefaultGuest.MultipleObjectsReturned">
<em class="property">exception </em><code class="sig-name descname">MultipleObjectsReturned</code><a class="headerlink" href="#evennia.accounts.accounts.DefaultGuest.MultipleObjectsReturned" title="Permalink to this definition"></a></dt>
<dd><p>Bases: <a class="reference internal" href="#evennia.accounts.accounts.DefaultAccount.MultipleObjectsReturned" title="evennia.accounts.accounts.DefaultAccount.MultipleObjectsReturned"><code class="xref py py-class docutils literal notranslate"><span class="pre">evennia.accounts.accounts.DefaultAccount.MultipleObjectsReturned</span></code></a></p>
</dd></dl>
<dl class="py attribute">
<dt id="evennia.accounts.accounts.DefaultGuest.path">
<code class="sig-name descname">path</code><em class="property"> = 'evennia.accounts.accounts.DefaultGuest'</em><a class="headerlink" href="#evennia.accounts.accounts.DefaultGuest.path" title="Permalink to this definition"></a></dt>
<dd></dd></dl>
<dl class="py attribute">
<dt id="evennia.accounts.accounts.DefaultGuest.typename">
<code class="sig-name descname">typename</code><em class="property"> = 'DefaultGuest'</em><a class="headerlink" href="#evennia.accounts.accounts.DefaultGuest.typename" title="Permalink to this definition"></a></dt>
<dd></dd></dl>
</dd></dl>
</div>

View file

@ -374,17 +374,6 @@ commands the caller can use.</p>
</dl>
</dd></dl>
<dl class="py method">
<dt id="evennia.commands.command.Command.client_height">
<code class="sig-name descname">client_height</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="reference internal" href="../_modules/evennia/commands/command.html#Command.client_height"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#evennia.commands.command.Command.client_height" title="Permalink to this definition"></a></dt>
<dd><p>Get the client screenheight for the session using this command.</p>
<dl class="field-list simple">
<dt class="field-odd">Returns</dt>
<dd class="field-odd"><p><em>client height (int)</em> The height (in characters) of the client window.</p>
</dd>
</dl>
</dd></dl>
<dl class="py method">
<dt id="evennia.commands.command.Command.styled_table">
<code class="sig-name descname">styled_table</code><span class="sig-paren">(</span><em class="sig-param"><span class="o">*</span><span class="n">args</span></em>, <em class="sig-param"><span class="o">**</span><span class="n">kwargs</span></em><span class="sig-paren">)</span><a class="reference internal" href="../_modules/evennia/commands/command.html#Command.styled_table"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#evennia.commands.command.Command.styled_table" title="Permalink to this definition"></a></dt>
@ -437,6 +426,11 @@ detailing the contents of the table.</p>
<code class="sig-name descname">save_for_next</code><em class="property"> = False</em><a class="headerlink" href="#evennia.commands.command.Command.save_for_next" title="Permalink to this definition"></a></dt>
<dd></dd></dl>
<dl class="py attribute">
<dt id="evennia.commands.command.Command.search_index_entry">
<code class="sig-name descname">search_index_entry</code><em class="property"> = {'aliases': '', 'category': 'general', 'key': 'command', 'tags': '', 'text': '\n Base command\n\n Usage:\n command [args]\n\n This is the base command class. Inherit from this\n to create new commands.\n\n The cmdhandler makes the following variables available to the\n command methods (so you can always assume them to be there):\n self.caller - the game object calling the command\n self.cmdstring - the command name used to trigger this command (allows\n you to know which alias was used, for example)\n cmd.args - everything supplied to the command following the cmdstring\n (this is usually what is parsed in self.parse())\n cmd.cmdset - the cmdset from which this command was matched (useful only\n seldomly, notably for help-type commands, to create dynamic\n help entries and lists)\n cmd.obj - the object on which this command is defined. If a default command,\n this is usually the same as caller.\n cmd.rawstring - the full raw string input, including any args and no parsing.\n\n The following class properties can/should be defined on your child class:\n\n key - identifier for command (e.g. &quot;look&quot;)\n aliases - (optional) list of aliases (e.g. [&quot;l&quot;, &quot;loo&quot;])\n locks - lock string (default is &quot;cmd:all()&quot;)\n help_category - how to organize this help entry in help system\n (default is &quot;General&quot;)\n auto_help - defaults to True. Allows for turning off auto-help generation\n arg_regex - (optional) raw string regex defining how the argument part of\n the command should look in order to match for this command\n (e.g. must it be a space between cmdname and arg?)\n auto_help_display_key - (optional) if given, this replaces the string shown\n in the auto-help listing. This is particularly useful for system-commands\n whose actual key is not really meaningful.\n\n (Note that if auto_help is on, this initial string is also used by the\n system to create the help entry for the command, so it\'s a good idea to\n format it similar to this one). This behavior can be changed by\n overriding the method \'get_help\' of a command: by default, this\n method returns cmd.__doc__ (that is, this very docstring, or\n the docstring of your command). You can, however, extend or\n replace this without disabling auto_help.\n '}</em><a class="headerlink" href="#evennia.commands.command.Command.search_index_entry" title="Permalink to this definition"></a></dt>
<dd></dd></dl>
</dd></dl>
<dl class="py exception">

View file

@ -98,6 +98,11 @@ method. Otherwise all text will be returned to all connected sessions.</p>
<code class="sig-name descname">lock_storage</code><em class="property"> = 'cmd:all()'</em><a class="headerlink" href="#evennia.commands.default.account.CmdOOCLook.lock_storage" title="Permalink to this definition"></a></dt>
<dd></dd></dl>
<dl class="py attribute">
<dt id="evennia.commands.default.account.CmdOOCLook.search_index_entry">
<code class="sig-name descname">search_index_entry</code><em class="property"> = {'aliases': 'l ls', 'category': 'general', 'key': 'look', 'tags': '', 'text': '\n look while out-of-character\n\n Usage:\n look\n\n Look in the ooc state.\n '}</em><a class="headerlink" href="#evennia.commands.default.account.CmdOOCLook.search_index_entry" title="Permalink to this definition"></a></dt>
<dd></dd></dl>
</dd></dl>
<dl class="py class">
@ -152,6 +157,11 @@ as you the account have access right to puppet it.</p>
<code class="sig-name descname">lock_storage</code><em class="property"> = 'cmd:all()'</em><a class="headerlink" href="#evennia.commands.default.account.CmdIC.lock_storage" title="Permalink to this definition"></a></dt>
<dd></dd></dl>
<dl class="py attribute">
<dt id="evennia.commands.default.account.CmdIC.search_index_entry">
<code class="sig-name descname">search_index_entry</code><em class="property"> = {'aliases': 'puppet', 'category': 'general', 'key': 'ic', 'tags': '', 'text': '\n control an object you have permission to puppet\n\n Usage:\n ic &lt;character&gt;\n\n Go in-character (IC) as a given Character.\n\n This will attempt to &quot;become&quot; a different object assuming you have\n the right to do so. Note that it\'s the ACCOUNT character that puppets\n characters/objects and which needs to have the correct permission!\n\n You cannot become an object that is already controlled by another\n account. In principle &lt;character&gt; can be any in-game object as long\n as you the account have access right to puppet it.\n '}</em><a class="headerlink" href="#evennia.commands.default.account.CmdIC.search_index_entry" title="Permalink to this definition"></a></dt>
<dd></dd></dl>
</dd></dl>
<dl class="py class">
@ -201,6 +211,11 @@ as you the account have access right to puppet it.</p>
<code class="sig-name descname">lock_storage</code><em class="property"> = 'cmd:pperm(Player)'</em><a class="headerlink" href="#evennia.commands.default.account.CmdOOC.lock_storage" title="Permalink to this definition"></a></dt>
<dd></dd></dl>
<dl class="py attribute">
<dt id="evennia.commands.default.account.CmdOOC.search_index_entry">
<code class="sig-name descname">search_index_entry</code><em class="property"> = {'aliases': 'unpuppet', 'category': 'general', 'key': 'ooc', 'tags': '', 'text': '\n stop puppeting and go ooc\n\n Usage:\n ooc\n\n Go out-of-character (OOC).\n\n This will leave your current character and put you in a incorporeal OOC state.\n '}</em><a class="headerlink" href="#evennia.commands.default.account.CmdOOC.search_index_entry" title="Permalink to this definition"></a></dt>
<dd></dd></dl>
</dd></dl>
<dl class="py class">
@ -249,6 +264,11 @@ as you the account have access right to puppet it.</p>
<code class="sig-name descname">lock_storage</code><em class="property"> = 'cmd:pperm(Player)'</em><a class="headerlink" href="#evennia.commands.default.account.CmdPassword.lock_storage" title="Permalink to this definition"></a></dt>
<dd></dd></dl>
<dl class="py attribute">
<dt id="evennia.commands.default.account.CmdPassword.search_index_entry">
<code class="sig-name descname">search_index_entry</code><em class="property"> = {'aliases': '', 'category': 'general', 'key': 'password', 'tags': '', 'text': '\n change your password\n\n Usage:\n password &lt;old password&gt; = &lt;new password&gt;\n\n Changes your password. Make sure to pick a safe one.\n '}</em><a class="headerlink" href="#evennia.commands.default.account.CmdPassword.search_index_entry" title="Permalink to this definition"></a></dt>
<dd></dd></dl>
</dd></dl>
<dl class="py class">
@ -305,6 +325,11 @@ game. Use the /all switch to disconnect from all sessions.</p>
<code class="sig-name descname">lock_storage</code><em class="property"> = 'cmd:all()'</em><a class="headerlink" href="#evennia.commands.default.account.CmdQuit.lock_storage" title="Permalink to this definition"></a></dt>
<dd></dd></dl>
<dl class="py attribute">
<dt id="evennia.commands.default.account.CmdQuit.search_index_entry">
<code class="sig-name descname">search_index_entry</code><em class="property"> = {'aliases': '', 'category': 'general', 'key': 'quit', 'tags': '', 'text': '\n quit the game\n\n Usage:\n quit\n\n Switch:\n all - disconnect all connected sessions\n\n Gracefully disconnect your current session from the\n game. Use the /all switch to disconnect from all sessions.\n '}</em><a class="headerlink" href="#evennia.commands.default.account.CmdQuit.search_index_entry" title="Permalink to this definition"></a></dt>
<dd></dd></dl>
</dd></dl>
<dl class="py class">
@ -356,6 +381,11 @@ if you want.</p>
<code class="sig-name descname">lock_storage</code><em class="property"> = 'cmd:pperm(Player)'</em><a class="headerlink" href="#evennia.commands.default.account.CmdCharCreate.lock_storage" title="Permalink to this definition"></a></dt>
<dd></dd></dl>
<dl class="py attribute">
<dt id="evennia.commands.default.account.CmdCharCreate.search_index_entry">
<code class="sig-name descname">search_index_entry</code><em class="property"> = {'aliases': '', 'category': 'general', 'key': 'charcreate', 'tags': '', 'text': '\n create a new character\n\n Usage:\n charcreate &lt;charname&gt; [= desc]\n\n Create a new character, optionally giving it a description. You\n may use upper-case letters in the name - you will nevertheless\n always be able to access your character using lower-case letters\n if you want.\n '}</em><a class="headerlink" href="#evennia.commands.default.account.CmdCharCreate.search_index_entry" title="Permalink to this definition"></a></dt>
<dd></dd></dl>
</dd></dl>
<dl class="py class">
@ -414,6 +444,11 @@ later connecting with a client with different capabilities.</p>
<code class="sig-name descname">lock_storage</code><em class="property"> = 'cmd:all()'</em><a class="headerlink" href="#evennia.commands.default.account.CmdOption.lock_storage" title="Permalink to this definition"></a></dt>
<dd></dd></dl>
<dl class="py attribute">
<dt id="evennia.commands.default.account.CmdOption.search_index_entry">
<code class="sig-name descname">search_index_entry</code><em class="property"> = {'aliases': 'options', 'category': 'general', 'key': 'option', 'tags': '', 'text': '\n Set an account option\n\n Usage:\n option[/save] [name = value]\n\n Switches:\n save - Save the current option settings for future logins.\n clear - Clear the saved options.\n\n This command allows for viewing and setting client interface\n settings. Note that saved options may not be able to be used if\n later connecting with a client with different capabilities.\n\n\n '}</em><a class="headerlink" href="#evennia.commands.default.account.CmdOption.search_index_entry" title="Permalink to this definition"></a></dt>
<dd></dd></dl>
</dd></dl>
<dl class="py class">
@ -462,6 +497,11 @@ later connecting with a client with different capabilities.</p>
<code class="sig-name descname">lock_storage</code><em class="property"> = 'cmd:all()'</em><a class="headerlink" href="#evennia.commands.default.account.CmdSessions.lock_storage" title="Permalink to this definition"></a></dt>
<dd></dd></dl>
<dl class="py attribute">
<dt id="evennia.commands.default.account.CmdSessions.search_index_entry">
<code class="sig-name descname">search_index_entry</code><em class="property"> = {'aliases': '', 'category': 'general', 'key': 'sessions', 'tags': '', 'text': '\n check your connected session(s)\n\n Usage:\n sessions\n\n Lists the sessions currently connected to your account.\n\n '}</em><a class="headerlink" href="#evennia.commands.default.account.CmdSessions.search_index_entry" title="Permalink to this definition"></a></dt>
<dd></dd></dl>
</dd></dl>
<dl class="py class">
@ -512,6 +552,11 @@ also for those with all permissions.</p>
<code class="sig-name descname">lock_storage</code><em class="property"> = 'cmd:all()'</em><a class="headerlink" href="#evennia.commands.default.account.CmdWho.lock_storage" title="Permalink to this definition"></a></dt>
<dd></dd></dl>
<dl class="py attribute">
<dt id="evennia.commands.default.account.CmdWho.search_index_entry">
<code class="sig-name descname">search_index_entry</code><em class="property"> = {'aliases': 'doing', 'category': 'general', 'key': 'who', 'tags': '', 'text': '\n list who is currently online\n\n Usage:\n who\n doing\n\n Shows who is currently online. Doing is an alias that limits info\n also for those with all permissions.\n '}</em><a class="headerlink" href="#evennia.commands.default.account.CmdWho.search_index_entry" title="Permalink to this definition"></a></dt>
<dd></dd></dl>
</dd></dl>
<dl class="py class">
@ -591,6 +636,11 @@ Takes a table of columns [[val,val,…],[val,val,…],…]</p>
<code class="sig-name descname">lock_storage</code><em class="property"> = 'cmd:all()'</em><a class="headerlink" href="#evennia.commands.default.account.CmdColorTest.lock_storage" title="Permalink to this definition"></a></dt>
<dd></dd></dl>
<dl class="py attribute">
<dt id="evennia.commands.default.account.CmdColorTest.search_index_entry">
<code class="sig-name descname">search_index_entry</code><em class="property"> = {'aliases': '', 'category': 'general', 'key': 'color', 'tags': '', 'text': '\n testing which colors your client support\n\n Usage:\n color ansi||xterm256\n\n Prints a color map along with in-mud color codes to use to produce\n them. It also tests what is supported in your client. Choices are\n 16-color ansi (supported in most muds) or the 256-color xterm256\n standard. No checking is done to determine your client supports\n color - if not you will see rubbish appear.\n '}</em><a class="headerlink" href="#evennia.commands.default.account.CmdColorTest.search_index_entry" title="Permalink to this definition"></a></dt>
<dd></dd></dl>
</dd></dl>
<dl class="py class">
@ -646,6 +696,11 @@ Use the unquell command to revert back to normal operation.</p>
<code class="sig-name descname">lock_storage</code><em class="property"> = 'cmd:pperm(Player)'</em><a class="headerlink" href="#evennia.commands.default.account.CmdQuell.lock_storage" title="Permalink to this definition"></a></dt>
<dd></dd></dl>
<dl class="py attribute">
<dt id="evennia.commands.default.account.CmdQuell.search_index_entry">
<code class="sig-name descname">search_index_entry</code><em class="property"> = {'aliases': 'unquell', 'category': 'general', 'key': 'quell', 'tags': '', 'text': &quot;\n use character's permissions instead of account's\n\n Usage:\n quell\n unquell\n\n Normally the permission level of the Account is used when puppeting a\n Character/Object to determine access. This command will switch the lock\n system to make use of the puppeted Object's permissions instead. This is\n useful mainly for testing.\n Hierarchical permission quelling only work downwards, thus an Account cannot\n use a higher-permission Character to escalate their permission level.\n Use the unquell command to revert back to normal operation.\n &quot;}</em><a class="headerlink" href="#evennia.commands.default.account.CmdQuell.search_index_entry" title="Permalink to this definition"></a></dt>
<dd></dd></dl>
</dd></dl>
<dl class="py class">
@ -689,6 +744,11 @@ Use the unquell command to revert back to normal operation.</p>
<code class="sig-name descname">lock_storage</code><em class="property"> = 'cmd:pperm(Player)'</em><a class="headerlink" href="#evennia.commands.default.account.CmdCharDelete.lock_storage" title="Permalink to this definition"></a></dt>
<dd></dd></dl>
<dl class="py attribute">
<dt id="evennia.commands.default.account.CmdCharDelete.search_index_entry">
<code class="sig-name descname">search_index_entry</code><em class="property"> = {'aliases': '', 'category': 'general', 'key': 'chardelete', 'tags': '', 'text': '\n delete a character - this cannot be undone!\n\n Usage:\n chardelete &lt;charname&gt;\n\n Permanently deletes one of your characters.\n '}</em><a class="headerlink" href="#evennia.commands.default.account.CmdCharDelete.search_index_entry" title="Permalink to this definition"></a></dt>
<dd></dd></dl>
</dd></dl>
<dl class="py class">
@ -746,6 +806,11 @@ to all the variables defined therein.</p>
<code class="sig-name descname">lock_storage</code><em class="property"> = 'cmd:all();'</em><a class="headerlink" href="#evennia.commands.default.account.CmdStyle.lock_storage" title="Permalink to this definition"></a></dt>
<dd></dd></dl>
<dl class="py attribute">
<dt id="evennia.commands.default.account.CmdStyle.search_index_entry">
<code class="sig-name descname">search_index_entry</code><em class="property"> = {'aliases': '', 'category': 'general', 'key': 'style', 'tags': '', 'text': '\n In-game style options\n\n Usage:\n style\n style &lt;option&gt; = &lt;value&gt;\n\n Configure stylings for in-game display elements like table borders, help\n entriest etc. Use without arguments to see all available options.\n\n '}</em><a class="headerlink" href="#evennia.commands.default.account.CmdStyle.search_index_entry" title="Permalink to this definition"></a></dt>
<dd></dd></dl>
</dd></dl>
</div>

View file

@ -89,6 +89,11 @@ supplied it will be echoed to the user unless /quiet is set.</p>
<code class="sig-name descname">lock_storage</code><em class="property"> = 'cmd:perm(boot) or perm(Admin)'</em><a class="headerlink" href="#evennia.commands.default.admin.CmdBoot.lock_storage" title="Permalink to this definition"></a></dt>
<dd></dd></dl>
<dl class="py attribute">
<dt id="evennia.commands.default.admin.CmdBoot.search_index_entry">
<code class="sig-name descname">search_index_entry</code><em class="property"> = {'aliases': '', 'category': 'admin', 'key': 'boot', 'tags': '', 'text': '\n kick an account from the server.\n\n Usage\n boot[/switches] &lt;account obj&gt; [: reason]\n\n Switches:\n quiet - Silently boot without informing account\n sid - boot by session id instead of name or dbref\n\n Boot an account object from the server. If a reason is\n supplied it will be echoed to the user unless /quiet is set.\n '}</em><a class="headerlink" href="#evennia.commands.default.admin.CmdBoot.search_index_entry" title="Permalink to this definition"></a></dt>
<dd></dd></dl>
</dd></dl>
<dl class="py class">
@ -163,6 +168,11 @@ values in each tuple is set to the empty string.</p>
<code class="sig-name descname">lock_storage</code><em class="property"> = 'cmd:perm(ban) or perm(Developer)'</em><a class="headerlink" href="#evennia.commands.default.admin.CmdBan.lock_storage" title="Permalink to this definition"></a></dt>
<dd></dd></dl>
<dl class="py attribute">
<dt id="evennia.commands.default.admin.CmdBan.search_index_entry">
<code class="sig-name descname">search_index_entry</code><em class="property"> = {'aliases': 'bans', 'category': 'admin', 'key': 'ban', 'tags': '', 'text': &quot;\n ban an account from the server\n\n Usage:\n ban [&lt;name or ip&gt; [: reason]]\n\n Without any arguments, shows numbered list of active bans.\n\n This command bans a user from accessing the game. Supply an optional\n reason to be able to later remember why the ban was put in place.\n\n It is often preferable to ban an account from the server than to\n delete an account with accounts/delete. If banned by name, that account\n account can no longer be logged into.\n\n IP (Internet Protocol) address banning allows blocking all access\n from a specific address or subnet. Use an asterisk (*) as a\n wildcard.\n\n Examples:\n ban thomas - ban account 'thomas'\n ban/ip 134.233.2.111 - ban specific ip address\n ban/ip 134.233.2.* - ban all in a subnet\n ban/ip 134.233.*.* - even wider ban\n\n A single IP filter can be easy to circumvent by changing computers\n or requesting a new IP address. Setting a wide IP block filter with\n wildcards might be tempting, but remember that it may also\n accidentally block innocent users connecting from the same country\n or region.\n\n &quot;}</em><a class="headerlink" href="#evennia.commands.default.admin.CmdBan.search_index_entry" title="Permalink to this definition"></a></dt>
<dd></dd></dl>
</dd></dl>
<dl class="py class">
@ -209,6 +219,11 @@ unban.</p>
<code class="sig-name descname">lock_storage</code><em class="property"> = 'cmd:perm(unban) or perm(Developer)'</em><a class="headerlink" href="#evennia.commands.default.admin.CmdUnban.lock_storage" title="Permalink to this definition"></a></dt>
<dd></dd></dl>
<dl class="py attribute">
<dt id="evennia.commands.default.admin.CmdUnban.search_index_entry">
<code class="sig-name descname">search_index_entry</code><em class="property"> = {'aliases': '', 'category': 'admin', 'key': 'unban', 'tags': '', 'text': '\n remove a ban from an account\n\n Usage:\n unban &lt;banid&gt;\n\n This will clear an account name/ip ban previously set with the ban\n command. Use this command without an argument to view a numbered\n list of bans. Use the numbers in this list to select which one to\n unban.\n\n '}</em><a class="headerlink" href="#evennia.commands.default.admin.CmdUnban.search_index_entry" title="Permalink to this definition"></a></dt>
<dd></dd></dl>
</dd></dl>
<dl class="py class">
@ -238,7 +253,7 @@ to accounts respectively.</p>
<dl class="py attribute">
<dt id="evennia.commands.default.admin.CmdEmit.aliases">
<code class="sig-name descname">aliases</code><em class="property"> = ['remit', 'pemit']</em><a class="headerlink" href="#evennia.commands.default.admin.CmdEmit.aliases" title="Permalink to this definition"></a></dt>
<code class="sig-name descname">aliases</code><em class="property"> = ['pemit', 'remit']</em><a class="headerlink" href="#evennia.commands.default.admin.CmdEmit.aliases" title="Permalink to this definition"></a></dt>
<dd></dd></dl>
<dl class="py attribute">
@ -267,6 +282,11 @@ to accounts respectively.</p>
<code class="sig-name descname">lock_storage</code><em class="property"> = 'cmd:perm(emit) or perm(Builder)'</em><a class="headerlink" href="#evennia.commands.default.admin.CmdEmit.lock_storage" title="Permalink to this definition"></a></dt>
<dd></dd></dl>
<dl class="py attribute">
<dt id="evennia.commands.default.admin.CmdEmit.search_index_entry">
<code class="sig-name descname">search_index_entry</code><em class="property"> = {'aliases': 'pemit remit', 'category': 'admin', 'key': 'emit', 'tags': '', 'text': '\n admin command for emitting message to multiple objects\n\n Usage:\n emit[/switches] [&lt;obj&gt;, &lt;obj&gt;, ... =] &lt;message&gt;\n remit [&lt;obj&gt;, &lt;obj&gt;, ... =] &lt;message&gt;\n pemit [&lt;obj&gt;, &lt;obj&gt;, ... =] &lt;message&gt;\n\n Switches:\n room - limit emits to rooms only (default)\n accounts - limit emits to accounts only\n contents - send to the contents of matched objects too\n\n Emits a message to the selected objects or to\n your immediate surroundings. If the object is a room,\n send to its contents. remit and pemit are just\n limited forms of emit, for sending to rooms and\n to accounts respectively.\n '}</em><a class="headerlink" href="#evennia.commands.default.admin.CmdEmit.search_index_entry" title="Permalink to this definition"></a></dt>
<dd></dd></dl>
</dd></dl>
<dl class="py class">
@ -310,6 +330,11 @@ to accounts respectively.</p>
<code class="sig-name descname">lock_storage</code><em class="property"> = 'cmd:perm(newpassword) or perm(Admin)'</em><a class="headerlink" href="#evennia.commands.default.admin.CmdNewPassword.lock_storage" title="Permalink to this definition"></a></dt>
<dd></dd></dl>
<dl class="py attribute">
<dt id="evennia.commands.default.admin.CmdNewPassword.search_index_entry">
<code class="sig-name descname">search_index_entry</code><em class="property"> = {'aliases': '', 'category': 'admin', 'key': 'userpassword', 'tags': '', 'text': &quot;\n change the password of an account\n\n Usage:\n userpassword &lt;user obj&gt; = &lt;new password&gt;\n\n Set an account's password.\n &quot;}</em><a class="headerlink" href="#evennia.commands.default.admin.CmdNewPassword.search_index_entry" title="Permalink to this definition"></a></dt>
<dd></dd></dl>
</dd></dl>
<dl class="py class">
@ -363,6 +388,11 @@ or account. If no permission is given, list all permissions on &lt;object&gt;.</
<code class="sig-name descname">lock_storage</code><em class="property"> = 'cmd:perm(perm) or perm(Developer)'</em><a class="headerlink" href="#evennia.commands.default.admin.CmdPerm.lock_storage" title="Permalink to this definition"></a></dt>
<dd></dd></dl>
<dl class="py attribute">
<dt id="evennia.commands.default.admin.CmdPerm.search_index_entry">
<code class="sig-name descname">search_index_entry</code><em class="property"> = {'aliases': 'setperm', 'category': 'admin', 'key': 'perm', 'tags': '', 'text': '\n set the permissions of an account/object\n\n Usage:\n perm[/switch] &lt;object&gt; [= &lt;permission&gt;[,&lt;permission&gt;,...]]\n perm[/switch] *&lt;account&gt; [= &lt;permission&gt;[,&lt;permission&gt;,...]]\n\n Switches:\n del - delete the given permission from &lt;object&gt; or &lt;account&gt;.\n account - set permission on an account (same as adding * to name)\n\n This command sets/clears individual permission strings on an object\n or account. If no permission is given, list all permissions on &lt;object&gt;.\n '}</em><a class="headerlink" href="#evennia.commands.default.admin.CmdPerm.search_index_entry" title="Permalink to this definition"></a></dt>
<dd></dd></dl>
</dd></dl>
<dl class="py class">
@ -407,6 +437,11 @@ including all currently unlogged in.</p>
<code class="sig-name descname">lock_storage</code><em class="property"> = 'cmd:perm(wall) or perm(Admin)'</em><a class="headerlink" href="#evennia.commands.default.admin.CmdWall.lock_storage" title="Permalink to this definition"></a></dt>
<dd></dd></dl>
<dl class="py attribute">
<dt id="evennia.commands.default.admin.CmdWall.search_index_entry">
<code class="sig-name descname">search_index_entry</code><em class="property"> = {'aliases': '', 'category': 'admin', 'key': 'wall', 'tags': '', 'text': '\n make an announcement to all\n\n Usage:\n wall &lt;message&gt;\n\n Announces a message to all connected sessions\n including all currently unlogged in.\n '}</em><a class="headerlink" href="#evennia.commands.default.admin.CmdWall.search_index_entry" title="Permalink to this definition"></a></dt>
<dd></dd></dl>
</dd></dl>
<dl class="py class">
@ -456,6 +491,11 @@ including all currently unlogged in.</p>
<code class="sig-name descname">lock_storage</code><em class="property"> = 'cmd:perm(spawn) or perm(Builder)'</em><a class="headerlink" href="#evennia.commands.default.admin.CmdForce.lock_storage" title="Permalink to this definition"></a></dt>
<dd></dd></dl>
<dl class="py attribute">
<dt id="evennia.commands.default.admin.CmdForce.search_index_entry">
<code class="sig-name descname">search_index_entry</code><em class="property"> = {'aliases': '', 'category': 'building', 'key': 'force', 'tags': '', 'text': '\n forces an object to execute a command\n\n Usage:\n force &lt;object&gt;=&lt;command string&gt;\n\n Example:\n force bob=get stick\n '}</em><a class="headerlink" href="#evennia.commands.default.admin.CmdForce.search_index_entry" title="Permalink to this definition"></a></dt>
<dd></dd></dl>
</dd></dl>
</div>

View file

@ -103,6 +103,11 @@ skipping, reloading etc.</p>
<code class="sig-name descname">lock_storage</code><em class="property"> = 'cmd:perm(batchcommands) or perm(Developer)'</em><a class="headerlink" href="#evennia.commands.default.batchprocess.CmdBatchCommands.lock_storage" title="Permalink to this definition"></a></dt>
<dd></dd></dl>
<dl class="py attribute">
<dt id="evennia.commands.default.batchprocess.CmdBatchCommands.search_index_entry">
<code class="sig-name descname">search_index_entry</code><em class="property"> = {'aliases': 'batchcommand batchcmd', 'category': 'building', 'key': 'batchcommands', 'tags': '', 'text': '\n build from batch-command file\n\n Usage:\n batchcommands[/interactive] &lt;python.path.to.file&gt;\n\n Switch:\n interactive - this mode will offer more control when\n executing the batch file, like stepping,\n skipping, reloading etc.\n\n Runs batches of commands from a batch-cmd text file (*.ev).\n\n '}</em><a class="headerlink" href="#evennia.commands.default.batchprocess.CmdBatchCommands.search_index_entry" title="Permalink to this definition"></a></dt>
<dd></dd></dl>
</dd></dl>
<dl class="py class">
@ -161,6 +166,11 @@ object copies behind when testing out the script.</p>
<code class="sig-name descname">lock_storage</code><em class="property"> = 'cmd:superuser()'</em><a class="headerlink" href="#evennia.commands.default.batchprocess.CmdBatchCode.lock_storage" title="Permalink to this definition"></a></dt>
<dd></dd></dl>
<dl class="py attribute">
<dt id="evennia.commands.default.batchprocess.CmdBatchCode.search_index_entry">
<code class="sig-name descname">search_index_entry</code><em class="property"> = {'aliases': 'batchcodes', 'category': 'building', 'key': 'batchcode', 'tags': '', 'text': '\n build from batch-code file\n\n Usage:\n batchcode[/interactive] &lt;python path to file&gt;\n\n Switch:\n interactive - this mode will offer more control when\n executing the batch file, like stepping,\n skipping, reloading etc.\n debug - auto-delete all objects that has been marked as\n deletable in the script file (see example files for\n syntax). This is useful so as to to not leave multiple\n object copies behind when testing out the script.\n\n Runs batches of commands from a batch-code text file (*.py).\n\n '}</em><a class="headerlink" href="#evennia.commands.default.batchprocess.CmdBatchCode.search_index_entry" title="Permalink to this definition"></a></dt>
<dd></dd></dl>
</dd></dl>
</div>

View file

@ -85,6 +85,11 @@ the cases, see the module doc.</p>
<code class="sig-name descname">lock_storage</code><em class="property"> = 'cmd:all();'</em><a class="headerlink" href="#evennia.commands.default.building.ObjManipCommand.lock_storage" title="Permalink to this definition"></a></dt>
<dd></dd></dl>
<dl class="py attribute">
<dt id="evennia.commands.default.building.ObjManipCommand.search_index_entry">
<code class="sig-name descname">search_index_entry</code><em class="property"> = {'aliases': '', 'category': 'general', 'key': 'command', 'tags': '', 'text': &quot;\n This is a parent class for some of the defining objmanip commands\n since they tend to have some more variables to define new objects.\n\n Each object definition can have several components. First is\n always a name, followed by an optional alias list and finally an\n some optional data, such as a typeclass or a location. A comma ','\n separates different objects. Like this:\n\n name1;alias;alias;alias:option, name2;alias;alias ...\n\n Spaces between all components are stripped.\n\n A second situation is attribute manipulation. Such commands\n are simpler and offer combinations\n\n objname/attr/attr/attr, objname/attr, ...\n\n &quot;}</em><a class="headerlink" href="#evennia.commands.default.building.ObjManipCommand.search_index_entry" title="Permalink to this definition"></a></dt>
<dd></dd></dl>
</dd></dl>
<dl class="py class">
@ -146,6 +151,11 @@ by everyone.</p>
<code class="sig-name descname">lock_storage</code><em class="property"> = 'cmd:perm(setobjalias) or perm(Builder)'</em><a class="headerlink" href="#evennia.commands.default.building.CmdSetObjAlias.lock_storage" title="Permalink to this definition"></a></dt>
<dd></dd></dl>
<dl class="py attribute">
<dt id="evennia.commands.default.building.CmdSetObjAlias.search_index_entry">
<code class="sig-name descname">search_index_entry</code><em class="property"> = {'aliases': 'setobjalias', 'category': 'building', 'key': 'alias', 'tags': '', 'text': &quot;\n adding permanent aliases for object\n\n Usage:\n alias &lt;obj&gt; [= [alias[,alias,alias,...]]]\n alias &lt;obj&gt; =\n alias/category &lt;obj&gt; = [alias[,alias,...]:&lt;category&gt;\n\n Switches:\n category - requires ending input with :category, to store the\n given aliases with the given category.\n\n Assigns aliases to an object so it can be referenced by more\n than one name. Assign empty to remove all aliases from object. If\n assigning a category, all aliases given will be using this category.\n\n Observe that this is not the same thing as personal aliases\n created with the 'nick' command! Aliases set with alias are\n changing the object in question, making those aliases usable\n by everyone.\n &quot;}</em><a class="headerlink" href="#evennia.commands.default.building.CmdSetObjAlias.search_index_entry" title="Permalink to this definition"></a></dt>
<dd></dd></dl>
</dd></dl>
<dl class="py class">
@ -191,6 +201,11 @@ one exact copy of the original object will be created with the name <a href="#id
<code class="sig-name descname">lock_storage</code><em class="property"> = 'cmd:perm(copy) or perm(Builder)'</em><a class="headerlink" href="#evennia.commands.default.building.CmdCopy.lock_storage" title="Permalink to this definition"></a></dt>
<dd></dd></dl>
<dl class="py attribute">
<dt id="evennia.commands.default.building.CmdCopy.search_index_entry">
<code class="sig-name descname">search_index_entry</code><em class="property"> = {'aliases': '', 'category': 'building', 'key': 'copy', 'tags': '', 'text': &quot;\n copy an object and its properties\n\n Usage:\n copy &lt;original obj&gt; [= &lt;new_name&gt;][;alias;alias..]\n [:&lt;new_location&gt;] [,&lt;new_name2&gt; ...]\n\n Create one or more copies of an object. If you don't supply any targets,\n one exact copy of the original object will be created with the name *_copy.\n &quot;}</em><a class="headerlink" href="#evennia.commands.default.building.CmdCopy.search_index_entry" title="Permalink to this definition"></a></dt>
<dd></dd></dl>
</dd></dl>
<dl class="py class">
@ -283,6 +298,11 @@ required and get the attribute from the object.</p>
<code class="sig-name descname">lock_storage</code><em class="property"> = 'cmd:perm(cpattr) or perm(Builder)'</em><a class="headerlink" href="#evennia.commands.default.building.CmdCpAttr.lock_storage" title="Permalink to this definition"></a></dt>
<dd></dd></dl>
<dl class="py attribute">
<dt id="evennia.commands.default.building.CmdCpAttr.search_index_entry">
<code class="sig-name descname">search_index_entry</code><em class="property"> = {'aliases': '', 'category': 'building', 'key': 'cpattr', 'tags': '', 'text': &quot;\n copy attributes between objects\n\n Usage:\n cpattr[/switch] &lt;obj&gt;/&lt;attr&gt; = &lt;obj1&gt;/&lt;attr1&gt; [,&lt;obj2&gt;/&lt;attr2&gt;,&lt;obj3&gt;/&lt;attr3&gt;,...]\n cpattr[/switch] &lt;obj&gt;/&lt;attr&gt; = &lt;obj1&gt; [,&lt;obj2&gt;,&lt;obj3&gt;,...]\n cpattr[/switch] &lt;attr&gt; = &lt;obj1&gt;/&lt;attr1&gt; [,&lt;obj2&gt;/&lt;attr2&gt;,&lt;obj3&gt;/&lt;attr3&gt;,...]\n cpattr[/switch] &lt;attr&gt; = &lt;obj1&gt;[,&lt;obj2&gt;,&lt;obj3&gt;,...]\n\n Switches:\n move - delete the attribute from the source object after copying.\n\n Example:\n cpattr coolness = Anna/chillout, Anna/nicety, Tom/nicety\n -&gt;\n copies the coolness attribute (defined on yourself), to attributes\n on Anna and Tom.\n\n Copy the attribute one object to one or more attributes on another object.\n If you don't supply a source object, yourself is used.\n &quot;}</em><a class="headerlink" href="#evennia.commands.default.building.CmdCpAttr.search_index_entry" title="Permalink to this definition"></a></dt>
<dd></dd></dl>
</dd></dl>
<dl class="py class">
@ -337,6 +357,11 @@ object. If you dont supply a source object, yourself is used.</p>
<code class="sig-name descname">lock_storage</code><em class="property"> = 'cmd:perm(mvattr) or perm(Builder)'</em><a class="headerlink" href="#evennia.commands.default.building.CmdMvAttr.lock_storage" title="Permalink to this definition"></a></dt>
<dd></dd></dl>
<dl class="py attribute">
<dt id="evennia.commands.default.building.CmdMvAttr.search_index_entry">
<code class="sig-name descname">search_index_entry</code><em class="property"> = {'aliases': '', 'category': 'building', 'key': 'mvattr', 'tags': '', 'text': &quot;\n move attributes between objects\n\n Usage:\n mvattr[/switch] &lt;obj&gt;/&lt;attr&gt; = &lt;obj1&gt;/&lt;attr1&gt; [,&lt;obj2&gt;/&lt;attr2&gt;,&lt;obj3&gt;/&lt;attr3&gt;,...]\n mvattr[/switch] &lt;obj&gt;/&lt;attr&gt; = &lt;obj1&gt; [,&lt;obj2&gt;,&lt;obj3&gt;,...]\n mvattr[/switch] &lt;attr&gt; = &lt;obj1&gt;/&lt;attr1&gt; [,&lt;obj2&gt;/&lt;attr2&gt;,&lt;obj3&gt;/&lt;attr3&gt;,...]\n mvattr[/switch] &lt;attr&gt; = &lt;obj1&gt;[,&lt;obj2&gt;,&lt;obj3&gt;,...]\n\n Switches:\n copy - Don't delete the original after moving.\n\n Move an attribute from one object to one or more attributes on another\n object. If you don't supply a source object, yourself is used.\n &quot;}</em><a class="headerlink" href="#evennia.commands.default.building.CmdMvAttr.search_index_entry" title="Permalink to this definition"></a></dt>
<dd></dd></dl>
</dd></dl>
<dl class="py class">
@ -405,6 +430,11 @@ object of this type like this:</p>
<code class="sig-name descname">lock_storage</code><em class="property"> = 'cmd:perm(create) or perm(Builder)'</em><a class="headerlink" href="#evennia.commands.default.building.CmdCreate.lock_storage" title="Permalink to this definition"></a></dt>
<dd></dd></dl>
<dl class="py attribute">
<dt id="evennia.commands.default.building.CmdCreate.search_index_entry">
<code class="sig-name descname">search_index_entry</code><em class="property"> = {'aliases': '', 'category': 'building', 'key': 'create', 'tags': '', 'text': &quot;\n create new objects\n\n Usage:\n create[/drop] &lt;objname&gt;[;alias;alias...][:typeclass], &lt;objname&gt;...\n\n switch:\n drop - automatically drop the new object into your current\n location (this is not echoed). This also sets the new\n object's home to the current location rather than to you.\n\n Creates one or more new objects. If typeclass is given, the object\n is created as a child of this typeclass. The typeclass script is\n assumed to be located under types/ and any further\n directory structure is given in Python notation. So if you have a\n correct typeclass 'RedButton' defined in\n types/examples/red_button.py, you could create a new\n object of this type like this:\n\n create/drop button;red : examples.red_button.RedButton\n\n &quot;}</em><a class="headerlink" href="#evennia.commands.default.building.CmdCreate.search_index_entry" title="Permalink to this definition"></a></dt>
<dd></dd></dl>
</dd></dl>
<dl class="py class">
@ -461,6 +491,11 @@ describe the current room.</p>
<code class="sig-name descname">lock_storage</code><em class="property"> = 'cmd:perm(desc) or perm(Builder)'</em><a class="headerlink" href="#evennia.commands.default.building.CmdDesc.lock_storage" title="Permalink to this definition"></a></dt>
<dd></dd></dl>
<dl class="py attribute">
<dt id="evennia.commands.default.building.CmdDesc.search_index_entry">
<code class="sig-name descname">search_index_entry</code><em class="property"> = {'aliases': 'describe', 'category': 'building', 'key': 'desc', 'tags': '', 'text': '\n describe an object or the current room.\n\n Usage:\n desc [&lt;obj&gt; =] &lt;description&gt;\n\n Switches:\n edit - Open up a line editor for more advanced editing.\n\n Sets the &quot;desc&quot; attribute on an object. If an object is not given,\n describe the current room.\n '}</em><a class="headerlink" href="#evennia.commands.default.building.CmdDesc.search_index_entry" title="Permalink to this definition"></a></dt>
<dd></dd></dl>
</dd></dl>
<dl class="py class">
@ -493,7 +528,7 @@ You can specify the /force switch to bypass this confirmation.</p>
<dl class="py attribute">
<dt id="evennia.commands.default.building.CmdDestroy.aliases">
<code class="sig-name descname">aliases</code><em class="property"> = ['delete', 'del']</em><a class="headerlink" href="#evennia.commands.default.building.CmdDestroy.aliases" title="Permalink to this definition"></a></dt>
<code class="sig-name descname">aliases</code><em class="property"> = ['del', 'delete']</em><a class="headerlink" href="#evennia.commands.default.building.CmdDestroy.aliases" title="Permalink to this definition"></a></dt>
<dd></dd></dl>
<dl class="py attribute">
@ -532,6 +567,11 @@ You can specify the /force switch to bypass this confirmation.</p>
<code class="sig-name descname">lock_storage</code><em class="property"> = 'cmd:perm(destroy) or perm(Builder)'</em><a class="headerlink" href="#evennia.commands.default.building.CmdDestroy.lock_storage" title="Permalink to this definition"></a></dt>
<dd></dd></dl>
<dl class="py attribute">
<dt id="evennia.commands.default.building.CmdDestroy.search_index_entry">
<code class="sig-name descname">search_index_entry</code><em class="property"> = {'aliases': 'del delete', 'category': 'building', 'key': 'destroy', 'tags': '', 'text': '\n permanently delete objects\n\n Usage:\n destroy[/switches] [obj, obj2, obj3, [dbref-dbref], ...]\n\n Switches:\n override - The destroy command will usually avoid accidentally\n destroying account objects. This switch overrides this safety.\n force - destroy without confirmation.\n Examples:\n destroy house, roof, door, 44-78\n destroy 5-10, flower, 45\n destroy/force north\n\n Destroys one or many objects. If dbrefs are used, a range to delete can be\n given, e.g. 4-10. Also the end points will be deleted. This command\n displays a confirmation before destroying, to make sure of your choice.\n You can specify the /force switch to bypass this confirmation.\n '}</em><a class="headerlink" href="#evennia.commands.default.building.CmdDestroy.search_index_entry" title="Permalink to this definition"></a></dt>
<dd></dd></dl>
</dd></dl>
<dl class="py class">
@ -601,6 +641,11 @@ would be north;no;n.</p>
<code class="sig-name descname">lock_storage</code><em class="property"> = 'cmd:perm(dig) or perm(Builder)'</em><a class="headerlink" href="#evennia.commands.default.building.CmdDig.lock_storage" title="Permalink to this definition"></a></dt>
<dd></dd></dl>
<dl class="py attribute">
<dt id="evennia.commands.default.building.CmdDig.search_index_entry">
<code class="sig-name descname">search_index_entry</code><em class="property"> = {'aliases': '', 'category': 'building', 'key': 'dig', 'tags': '', 'text': &quot;\n build new rooms and connect them to the current location\n\n Usage:\n dig[/switches] &lt;roomname&gt;[;alias;alias...][:typeclass]\n [= &lt;exit_to_there&gt;[;alias][:typeclass]]\n [, &lt;exit_to_here&gt;[;alias][:typeclass]]\n\n Switches:\n tel or teleport - move yourself to the new room\n\n Examples:\n dig kitchen = north;n, south;s\n dig house:myrooms.MyHouseTypeclass\n dig sheer cliff;cliff;sheer = climb up, climb down\n\n This command is a convenient way to build rooms quickly; it creates the\n new room and you can optionally set up exits back and forth between your\n current room and the new one. You can add as many aliases as you\n like to the name of the room and the exits in question; an example\n would be 'north;no;n'.\n &quot;}</em><a class="headerlink" href="#evennia.commands.default.building.CmdDig.search_index_entry" title="Permalink to this definition"></a></dt>
<dd></dd></dl>
</dd></dl>
<dl class="py class">
@ -671,6 +716,11 @@ For more flexibility and power in creating rooms, use dig.</p>
<code class="sig-name descname">lock_storage</code><em class="property"> = 'cmd: perm(tunnel) or perm(Builder)'</em><a class="headerlink" href="#evennia.commands.default.building.CmdTunnel.lock_storage" title="Permalink to this definition"></a></dt>
<dd></dd></dl>
<dl class="py attribute">
<dt id="evennia.commands.default.building.CmdTunnel.search_index_entry">
<code class="sig-name descname">search_index_entry</code><em class="property"> = {'aliases': 'tun', 'category': 'building', 'key': 'tunnel', 'tags': '', 'text': '\n create new rooms in cardinal directions only\n\n Usage:\n tunnel[/switch] &lt;direction&gt;[:typeclass] [= &lt;roomname&gt;[;alias;alias;...][:typeclass]]\n\n Switches:\n oneway - do not create an exit back to the current location\n tel - teleport to the newly created room\n\n Example:\n tunnel n\n tunnel n = house;mike\'s place;green building\n\n This is a simple way to build using pre-defined directions:\n |wn,ne,e,se,s,sw,w,nw|n (north, northeast etc)\n |wu,d|n (up and down)\n |wi,o|n (in and out)\n The full names (north, in, southwest, etc) will always be put as\n main name for the exit, using the abbreviation as an alias (so an\n exit will always be able to be used with both &quot;north&quot; as well as\n &quot;n&quot; for example). Opposite directions will automatically be\n created back from the new room unless the /oneway switch is given.\n For more flexibility and power in creating rooms, use dig.\n '}</em><a class="headerlink" href="#evennia.commands.default.building.CmdTunnel.search_index_entry" title="Permalink to this definition"></a></dt>
<dd></dd></dl>
</dd></dl>
<dl class="py class">
@ -726,6 +776,11 @@ currently set destination.</p>
<code class="sig-name descname">lock_storage</code><em class="property"> = 'cmd:perm(link) or perm(Builder)'</em><a class="headerlink" href="#evennia.commands.default.building.CmdLink.lock_storage" title="Permalink to this definition"></a></dt>
<dd></dd></dl>
<dl class="py attribute">
<dt id="evennia.commands.default.building.CmdLink.search_index_entry">
<code class="sig-name descname">search_index_entry</code><em class="property"> = {'aliases': '', 'category': 'building', 'key': 'link', 'tags': '', 'text': '\n link existing rooms together with exits\n\n Usage:\n link[/switches] &lt;object&gt; = &lt;target&gt;\n link[/switches] &lt;object&gt; =\n link[/switches] &lt;object&gt;\n\n Switch:\n twoway - connect two exits. For this to work, BOTH &lt;object&gt;\n and &lt;target&gt; must be exit objects.\n\n If &lt;object&gt; is an exit, set its destination to &lt;target&gt;. Two-way operation\n instead sets the destination to the *locations* of the respective given\n arguments.\n The second form (a lone =) sets the destination to None (same as\n the unlink command) and the third form (without =) just shows the\n currently set destination.\n '}</em><a class="headerlink" href="#evennia.commands.default.building.CmdLink.search_index_entry" title="Permalink to this definition"></a></dt>
<dd></dd></dl>
</dd></dl>
<dl class="py class">
@ -776,6 +831,11 @@ and call func in CmdLink</p>
<code class="sig-name descname">lock_storage</code><em class="property"> = 'cmd:perm(unlink) or perm(Builder)'</em><a class="headerlink" href="#evennia.commands.default.building.CmdUnLink.lock_storage" title="Permalink to this definition"></a></dt>
<dd></dd></dl>
<dl class="py attribute">
<dt id="evennia.commands.default.building.CmdUnLink.search_index_entry">
<code class="sig-name descname">search_index_entry</code><em class="property"> = {'aliases': '', 'category': 'building', 'key': 'unlink', 'tags': '', 'text': '\n remove exit-connections between rooms\n\n Usage:\n unlink &lt;Object&gt;\n\n Unlinks an object, for example an exit, disconnecting\n it from whatever it was connected to.\n '}</em><a class="headerlink" href="#evennia.commands.default.building.CmdUnLink.search_index_entry" title="Permalink to this definition"></a></dt>
<dd></dd></dl>
</dd></dl>
<dl class="py class">
@ -824,6 +884,11 @@ It is also a convenient target of the “home” command.</p>
<code class="sig-name descname">lock_storage</code><em class="property"> = 'cmd:perm(sethome) or perm(Builder)'</em><a class="headerlink" href="#evennia.commands.default.building.CmdSetHome.lock_storage" title="Permalink to this definition"></a></dt>
<dd></dd></dl>
<dl class="py attribute">
<dt id="evennia.commands.default.building.CmdSetHome.search_index_entry">
<code class="sig-name descname">search_index_entry</code><em class="property"> = {'aliases': '', 'category': 'building', 'key': 'sethome', 'tags': '', 'text': '\n set an object\'s home location\n\n Usage:\n sethome &lt;obj&gt; [= &lt;home_location&gt;]\n sethom &lt;obj&gt;\n\n The &quot;home&quot; location is a &quot;safety&quot; location for objects; they\n will be moved there if their current location ceases to exist. All\n objects should always have a home location for this reason.\n It is also a convenient target of the &quot;home&quot; command.\n\n If no location is given, just view the object\'s home location.\n '}</em><a class="headerlink" href="#evennia.commands.default.building.CmdSetHome.search_index_entry" title="Permalink to this definition"></a></dt>
<dd></dd></dl>
</dd></dl>
<dl class="py class">
@ -868,6 +933,11 @@ to a user. Defaults to yourself.</p>
<code class="sig-name descname">lock_storage</code><em class="property"> = 'cmd:perm(listcmdsets) or perm(Builder)'</em><a class="headerlink" href="#evennia.commands.default.building.CmdListCmdSets.lock_storage" title="Permalink to this definition"></a></dt>
<dd></dd></dl>
<dl class="py attribute">
<dt id="evennia.commands.default.building.CmdListCmdSets.search_index_entry">
<code class="sig-name descname">search_index_entry</code><em class="property"> = {'aliases': 'listcmsets', 'category': 'building', 'key': 'cmdsets', 'tags': '', 'text': '\n list command sets defined on an object\n\n Usage:\n cmdsets &lt;obj&gt;\n\n This displays all cmdsets assigned\n to a user. Defaults to yourself.\n '}</em><a class="headerlink" href="#evennia.commands.default.building.CmdListCmdSets.search_index_entry" title="Permalink to this definition"></a></dt>
<dd></dd></dl>
</dd></dl>
<dl class="py class">
@ -912,6 +982,11 @@ rename an account.</p>
<code class="sig-name descname">lock_storage</code><em class="property"> = 'cmd:perm(rename) or perm(Builder)'</em><a class="headerlink" href="#evennia.commands.default.building.CmdName.lock_storage" title="Permalink to this definition"></a></dt>
<dd></dd></dl>
<dl class="py attribute">
<dt id="evennia.commands.default.building.CmdName.search_index_entry">
<code class="sig-name descname">search_index_entry</code><em class="property"> = {'aliases': 'rename', 'category': 'building', 'key': 'name', 'tags': '', 'text': '\n change the name and/or aliases of an object\n\n Usage:\n name &lt;obj&gt; = &lt;newname&gt;;alias1;alias2\n\n Rename an object to something new. Use *obj to\n rename an account.\n\n '}</em><a class="headerlink" href="#evennia.commands.default.building.CmdName.search_index_entry" title="Permalink to this definition"></a></dt>
<dd></dd></dl>
</dd></dl>
<dl class="py class">
@ -973,6 +1048,11 @@ as well as the self.create_exit() method.</p>
<code class="sig-name descname">lock_storage</code><em class="property"> = 'cmd:perm(open) or perm(Builder)'</em><a class="headerlink" href="#evennia.commands.default.building.CmdOpen.lock_storage" title="Permalink to this definition"></a></dt>
<dd></dd></dl>
<dl class="py attribute">
<dt id="evennia.commands.default.building.CmdOpen.search_index_entry">
<code class="sig-name descname">search_index_entry</code><em class="property"> = {'aliases': '', 'category': 'building', 'key': 'open', 'tags': '', 'text': '\n open a new exit from the current room\n\n Usage:\n open &lt;new exit&gt;[;alias;alias..][:typeclass] [,&lt;return exit&gt;[;alias;..][:typeclass]]] = &lt;destination&gt;\n\n Handles the creation of exits. If a destination is given, the exit\n will point there. The &lt;return exit&gt; argument sets up an exit at the\n destination leading back to the current room. Destination name\n can be given both as a #dbref and a name, if that name is globally\n unique.\n\n '}</em><a class="headerlink" href="#evennia.commands.default.building.CmdOpen.search_index_entry" title="Permalink to this definition"></a></dt>
<dd></dd></dl>
</dd></dl>
<dl class="py class">
@ -1128,6 +1208,11 @@ with older attrs that might have been named with <strong>[]</strong>s.</p>
<code class="sig-name descname">lock_storage</code><em class="property"> = 'cmd:perm(set) or perm(Builder)'</em><a class="headerlink" href="#evennia.commands.default.building.CmdSetAttribute.lock_storage" title="Permalink to this definition"></a></dt>
<dd></dd></dl>
<dl class="py attribute">
<dt id="evennia.commands.default.building.CmdSetAttribute.search_index_entry">
<code class="sig-name descname">search_index_entry</code><em class="property"> = {'aliases': '', 'category': 'building', 'key': 'set', 'tags': '', 'text': '\n set attribute on an object or account\n\n Usage:\n set &lt;obj&gt;/&lt;attr&gt; = &lt;value&gt;\n set &lt;obj&gt;/&lt;attr&gt; =\n set &lt;obj&gt;/&lt;attr&gt;\n set *&lt;account&gt;/&lt;attr&gt; = &lt;value&gt;\n\n Switch:\n edit: Open the line editor (string values only)\n script: If we\'re trying to set an attribute on a script\n channel: If we\'re trying to set an attribute on a channel\n account: If we\'re trying to set an attribute on an account\n room: Setting an attribute on a room (global search)\n exit: Setting an attribute on an exit (global search)\n char: Setting an attribute on a character (global search)\n character: Alias for char, as above.\n\n Sets attributes on objects. The second example form above clears a\n previously set attribute while the third form inspects the current value of\n the attribute (if any). The last one (with the star) is a shortcut for\n operating on a player Account rather than an Object.\n\n The most common data to save with this command are strings and\n numbers. You can however also set Python primitives such as lists,\n dictionaries and tuples on objects (this might be important for\n the functionality of certain custom objects). This is indicated\n by you starting your value with one of |c\'|n, |c&quot;|n, |c(|n, |c[|n\n or |c{ |n.\n\n Once you have stored a Python primitive as noted above, you can include\n |c[&lt;key&gt;]|n in &lt;attr&gt; to reference nested values in e.g. a list or dict.\n\n Remember that if you use Python primitives like this, you must\n write proper Python syntax too - notably you must include quotes\n around your strings or you will get an error.\n\n '}</em><a class="headerlink" href="#evennia.commands.default.building.CmdSetAttribute.search_index_entry" title="Permalink to this definition"></a></dt>
<dd></dd></dl>
</dd></dl>
<dl class="py class">
@ -1182,7 +1267,7 @@ server settings.</p>
<dl class="py attribute">
<dt id="evennia.commands.default.building.CmdTypeclass.aliases">
<code class="sig-name descname">aliases</code><em class="property"> = ['parent', 'swap', 'type', 'update']</em><a class="headerlink" href="#evennia.commands.default.building.CmdTypeclass.aliases" title="Permalink to this definition"></a></dt>
<code class="sig-name descname">aliases</code><em class="property"> = ['swap', 'parent', 'update', 'type']</em><a class="headerlink" href="#evennia.commands.default.building.CmdTypeclass.aliases" title="Permalink to this definition"></a></dt>
<dd></dd></dl>
<dl class="py attribute">
@ -1211,6 +1296,11 @@ server settings.</p>
<code class="sig-name descname">lock_storage</code><em class="property"> = 'cmd:perm(typeclass) or perm(Builder)'</em><a class="headerlink" href="#evennia.commands.default.building.CmdTypeclass.lock_storage" title="Permalink to this definition"></a></dt>
<dd></dd></dl>
<dl class="py attribute">
<dt id="evennia.commands.default.building.CmdTypeclass.search_index_entry">
<code class="sig-name descname">search_index_entry</code><em class="property"> = {'aliases': 'swap parent update type', 'category': 'building', 'key': 'typeclass', 'tags': '', 'text': &quot;\n set or change an object's typeclass\n\n Usage:\n typeclass[/switch] &lt;object&gt; [= typeclass.path]\n typeclass/prototype &lt;object&gt; = prototype_key\n\n typeclass/list/show [typeclass.path]\n swap - this is a shorthand for using /force/reset flags.\n update - this is a shorthand for using the /force/reload flag.\n\n Switch:\n show, examine - display the current typeclass of object (default) or, if\n given a typeclass path, show the docstring of that typeclass.\n update - *only* re-run at_object_creation on this object\n meaning locks or other properties set later may remain.\n reset - clean out *all* the attributes and properties on the\n object - basically making this a new clean object.\n force - change to the typeclass also if the object\n already has a typeclass of the same name.\n list - show available typeclasses. Only typeclasses in modules actually\n imported or used from somewhere in the code will show up here\n (those typeclasses are still available if you know the path)\n prototype - clean and overwrite the object with the specified\n prototype key - effectively making a whole new object.\n\n Example:\n type button = examples.red_button.RedButton\n type/prototype button=a red button\n\n If the typeclass_path is not given, the current object's typeclass is\n assumed.\n\n View or set an object's typeclass. If setting, the creation hooks of the\n new typeclass will be run on the object. If you have clashing properties on\n the old class, use /reset. By default you are protected from changing to a\n typeclass of the same name as the one you already have - use /force to\n override this protection.\n\n The given typeclass must be identified by its location using python\n dot-notation pointing to the correct module and class. If no typeclass is\n given (or a wrong typeclass is given). Errors in the path or new typeclass\n will lead to the old typeclass being kept. The location of the typeclass\n module is searched from the default typeclass directory, as defined in the\n server settings.\n\n &quot;}</em><a class="headerlink" href="#evennia.commands.default.building.CmdTypeclass.search_index_entry" title="Permalink to this definition"></a></dt>
<dd></dd></dl>
</dd></dl>
<dl class="py class">
@ -1258,6 +1348,11 @@ matching the given attribute-wildcard search string.</p>
<code class="sig-name descname">lock_storage</code><em class="property"> = 'cmd:perm(wipe) or perm(Builder)'</em><a class="headerlink" href="#evennia.commands.default.building.CmdWipe.lock_storage" title="Permalink to this definition"></a></dt>
<dd></dd></dl>
<dl class="py attribute">
<dt id="evennia.commands.default.building.CmdWipe.search_index_entry">
<code class="sig-name descname">search_index_entry</code><em class="property"> = {'aliases': '', 'category': 'building', 'key': 'wipe', 'tags': '', 'text': &quot;\n clear all attributes from an object\n\n Usage:\n wipe &lt;object&gt;[/&lt;attr&gt;[/&lt;attr&gt;...]]\n\n Example:\n wipe box\n wipe box/colour\n\n Wipes all of an object's attributes, or optionally only those\n matching the given attribute-wildcard search string.\n &quot;}</em><a class="headerlink" href="#evennia.commands.default.building.CmdWipe.search_index_entry" title="Permalink to this definition"></a></dt>
<dd></dd></dl>
</dd></dl>
<dl class="py class">
@ -1325,6 +1420,11 @@ them by ;, i.e:</p>
<code class="sig-name descname">lock_storage</code><em class="property"> = 'cmd: perm(locks) or perm(Builder)'</em><a class="headerlink" href="#evennia.commands.default.building.CmdLock.lock_storage" title="Permalink to this definition"></a></dt>
<dd></dd></dl>
<dl class="py attribute">
<dt id="evennia.commands.default.building.CmdLock.search_index_entry">
<code class="sig-name descname">search_index_entry</code><em class="property"> = {'aliases': 'locks', 'category': 'building', 'key': 'lock', 'tags': '', 'text': &quot;\n assign a lock definition to an object\n\n Usage:\n lock &lt;object or *account&gt;[ = &lt;lockstring&gt;]\n or\n lock[/switch] &lt;object or *account&gt;/&lt;access_type&gt;\n\n Switch:\n del - delete given access type\n view - view lock associated with given access type (default)\n\n If no lockstring is given, shows all locks on\n object.\n\n Lockstring is of the form\n access_type:[NOT] func1(args)[ AND|OR][ NOT] func2(args) ...]\n Where func1, func2 ... valid lockfuncs with or without arguments.\n Separator expressions need not be capitalized.\n\n For example:\n 'get: id(25) or perm(Admin)'\n The 'get' lock access_type is checked e.g. by the 'get' command.\n An object locked with this example lock will only be possible to pick up\n by Admins or by an object with id=25.\n\n You can add several access_types after one another by separating\n them by ';', i.e:\n 'get:id(25); delete:perm(Builder)'\n &quot;}</em><a class="headerlink" href="#evennia.commands.default.building.CmdLock.search_index_entry" title="Permalink to this definition"></a></dt>
<dd></dd></dl>
</dd></dl>
<dl class="py class">
@ -1351,7 +1451,7 @@ If object is not specified, the current location is examined.</p>
<dl class="py attribute">
<dt id="evennia.commands.default.building.CmdExamine.aliases">
<code class="sig-name descname">aliases</code><em class="property"> = ['ex', 'exam']</em><a class="headerlink" href="#evennia.commands.default.building.CmdExamine.aliases" title="Permalink to this definition"></a></dt>
<code class="sig-name descname">aliases</code><em class="property"> = ['exam', 'ex']</em><a class="headerlink" href="#evennia.commands.default.building.CmdExamine.aliases" title="Permalink to this definition"></a></dt>
<dd></dd></dl>
<dl class="py attribute">
@ -1446,6 +1546,11 @@ non-persistent data stored on object</p>
<code class="sig-name descname">lock_storage</code><em class="property"> = 'cmd:perm(examine) or perm(Builder)'</em><a class="headerlink" href="#evennia.commands.default.building.CmdExamine.lock_storage" title="Permalink to this definition"></a></dt>
<dd></dd></dl>
<dl class="py attribute">
<dt id="evennia.commands.default.building.CmdExamine.search_index_entry">
<code class="sig-name descname">search_index_entry</code><em class="property"> = {'aliases': 'exam ex', 'category': 'building', 'key': 'examine', 'tags': '', 'text': '\n get detailed information about an object\n\n Usage:\n examine [&lt;object&gt;[/attrname]]\n examine [*&lt;account&gt;[/attrname]]\n\n Switch:\n account - examine an Account (same as adding *)\n object - examine an Object (useful when OOC)\n\n The examine command shows detailed game info about an\n object and optionally a specific attribute on it.\n If object is not specified, the current location is examined.\n\n Append a * before the search string to examine an account.\n\n '}</em><a class="headerlink" href="#evennia.commands.default.building.CmdExamine.search_index_entry" title="Permalink to this definition"></a></dt>
<dd></dd></dl>
</dd></dl>
<dl class="py class">
@ -1477,7 +1582,7 @@ one is given.</p>
<dl class="py attribute">
<dt id="evennia.commands.default.building.CmdFind.aliases">
<code class="sig-name descname">aliases</code><em class="property"> = ['locate', 'search']</em><a class="headerlink" href="#evennia.commands.default.building.CmdFind.aliases" title="Permalink to this definition"></a></dt>
<code class="sig-name descname">aliases</code><em class="property"> = ['search', 'locate']</em><a class="headerlink" href="#evennia.commands.default.building.CmdFind.aliases" title="Permalink to this definition"></a></dt>
<dd></dd></dl>
<dl class="py attribute">
@ -1506,6 +1611,11 @@ one is given.</p>
<code class="sig-name descname">lock_storage</code><em class="property"> = 'cmd:perm(find) or perm(Builder)'</em><a class="headerlink" href="#evennia.commands.default.building.CmdFind.lock_storage" title="Permalink to this definition"></a></dt>
<dd></dd></dl>
<dl class="py attribute">
<dt id="evennia.commands.default.building.CmdFind.search_index_entry">
<code class="sig-name descname">search_index_entry</code><em class="property"> = {'aliases': 'search locate', 'category': 'building', 'key': 'find', 'tags': '', 'text': '\n search the database for objects\n\n Usage:\n find[/switches] &lt;name or dbref or *account&gt; [= dbrefmin[-dbrefmax]]\n locate - this is a shorthand for using the /loc switch.\n\n Switches:\n room - only look for rooms (location=None)\n exit - only look for exits (destination!=None)\n char - only look for characters (BASE_CHARACTER_TYPECLASS)\n exact - only exact matches are returned.\n loc - display object location if exists and match has one result\n startswith - search for names starting with the string, rather than containing\n\n Searches the database for an object of a particular name or exact #dbref.\n Use *accountname to search for an account. The switches allows for\n limiting object matches to certain game entities. Dbrefmin and dbrefmax\n limits matches to within the given dbrefs range, or above/below if only\n one is given.\n '}</em><a class="headerlink" href="#evennia.commands.default.building.CmdFind.search_index_entry" title="Permalink to this definition"></a></dt>
<dd></dd></dl>
</dd></dl>
<dl class="py class">
@ -1579,6 +1689,11 @@ teleported to the target location.</p>
<code class="sig-name descname">lock_storage</code><em class="property"> = 'cmd:perm(teleport) or perm(Builder)'</em><a class="headerlink" href="#evennia.commands.default.building.CmdTeleport.lock_storage" title="Permalink to this definition"></a></dt>
<dd></dd></dl>
<dl class="py attribute">
<dt id="evennia.commands.default.building.CmdTeleport.search_index_entry">
<code class="sig-name descname">search_index_entry</code><em class="property"> = {'aliases': 'teleport', 'category': 'building', 'key': 'tel', 'tags': '', 'text': &quot;\n teleport object to another location\n\n Usage:\n tel/switch [&lt;object&gt; to||=] &lt;target location&gt;\n\n Examples:\n tel Limbo\n tel/quiet box = Limbo\n tel/tonone box\n\n Switches:\n quiet - don't echo leave/arrive messages to the source/target\n locations for the move.\n intoexit - if target is an exit, teleport INTO\n the exit object instead of to its destination\n tonone - if set, teleport the object to a None-location. If this\n switch is set, &lt;target location&gt; is ignored.\n Note that the only way to retrieve\n an object from a None location is by direct #dbref\n reference. A puppeted object cannot be moved to None.\n loc - teleport object to the target's location instead of its contents\n\n Teleports an object somewhere. If no object is given, you yourself are\n teleported to the target location.\n &quot;}</em><a class="headerlink" href="#evennia.commands.default.building.CmdTeleport.search_index_entry" title="Permalink to this definition"></a></dt>
<dd></dd></dl>
</dd></dl>
<dl class="py class">
@ -1636,6 +1751,11 @@ the object.</p>
<code class="sig-name descname">lock_storage</code><em class="property"> = 'cmd:perm(script) or perm(Builder)'</em><a class="headerlink" href="#evennia.commands.default.building.CmdScript.lock_storage" title="Permalink to this definition"></a></dt>
<dd></dd></dl>
<dl class="py attribute">
<dt id="evennia.commands.default.building.CmdScript.search_index_entry">
<code class="sig-name descname">search_index_entry</code><em class="property"> = {'aliases': 'addscript', 'category': 'building', 'key': 'script', 'tags': '', 'text': '\n attach a script to an object\n\n Usage:\n script[/switch] &lt;obj&gt; [= script_path or &lt;scriptkey&gt;]\n\n Switches:\n start - start all non-running scripts on object, or a given script only\n stop - stop all scripts on objects, or a given script only\n\n If no script path/key is given, lists all scripts active on the given\n object.\n Script path can be given from the base location for scripts as given in\n settings. If adding a new script, it will be started automatically\n (no /start switch is needed). Using the /start or /stop switches on an\n object without specifying a script key/path will start/stop ALL scripts on\n the object.\n '}</em><a class="headerlink" href="#evennia.commands.default.building.CmdScript.search_index_entry" title="Permalink to this definition"></a></dt>
<dd></dd></dl>
</dd></dl>
<dl class="py class">
@ -1702,6 +1822,11 @@ enough to for most grouping schemes.</p>
<code class="sig-name descname">lock_storage</code><em class="property"> = 'cmd:perm(tag) or perm(Builder)'</em><a class="headerlink" href="#evennia.commands.default.building.CmdTag.lock_storage" title="Permalink to this definition"></a></dt>
<dd></dd></dl>
<dl class="py attribute">
<dt id="evennia.commands.default.building.CmdTag.search_index_entry">
<code class="sig-name descname">search_index_entry</code><em class="property"> = {'aliases': 'tags', 'category': 'building', 'key': 'tag', 'tags': '', 'text': '\n handles the tags of an object\n\n Usage:\n tag[/del] &lt;obj&gt; [= &lt;tag&gt;[:&lt;category&gt;]]\n tag/search &lt;tag&gt;[:&lt;category]\n\n Switches:\n search - return all objects with a given Tag\n del - remove the given tag. If no tag is specified,\n clear all tags on object.\n\n Manipulates and lists tags on objects. Tags allow for quick\n grouping of and searching for objects. If only &lt;obj&gt; is given,\n list all tags on the object. If /search is used, list objects\n with the given tag.\n The category can be used for grouping tags themselves, but it\n should be used with restrain - tags on their own are usually\n enough to for most grouping schemes.\n '}</em><a class="headerlink" href="#evennia.commands.default.building.CmdTag.search_index_entry" title="Permalink to this definition"></a></dt>
<dd></dd></dl>
</dd></dl>
<dl class="py class">
@ -1808,6 +1933,11 @@ displays a list of available prototypes.</p>
<code class="sig-name descname">lock_storage</code><em class="property"> = 'cmd:perm(spawn) or perm(Builder)'</em><a class="headerlink" href="#evennia.commands.default.building.CmdSpawn.lock_storage" title="Permalink to this definition"></a></dt>
<dd></dd></dl>
<dl class="py attribute">
<dt id="evennia.commands.default.building.CmdSpawn.search_index_entry">
<code class="sig-name descname">search_index_entry</code><em class="property"> = {'aliases': 'olc', 'category': 'building', 'key': 'spawn', 'tags': '', 'text': '\n spawn objects from prototype\n\n Usage:\n spawn[/noloc] &lt;prototype_key&gt;\n spawn[/noloc] &lt;prototype_dict&gt;\n\n spawn/search [prototype_keykey][;tag[,tag]]\n spawn/list [tag, tag, ...]\n spawn/list modules - list only module-based prototypes\n spawn/show [&lt;prototype_key&gt;]\n spawn/update &lt;prototype_key&gt;\n\n spawn/save &lt;prototype_dict&gt;\n spawn/edit [&lt;prototype_key&gt;]\n olc - equivalent to spawn/edit\n\n Switches:\n noloc - allow location to be None if not specified explicitly. Otherwise,\n location will default to caller\'s current location.\n search - search prototype by name or tags.\n list - list available prototypes, optionally limit by tags.\n show, examine - inspect prototype by key. If not given, acts like list.\n raw - show the raw dict of the prototype as a one-line string for manual editing.\n save - save a prototype to the database. It will be listable by /list.\n delete - remove a prototype from database, if allowed to.\n update - find existing objects with the same prototype_key and update\n them with latest version of given prototype. If given with /save,\n will auto-update all objects with the old version of the prototype\n without asking first.\n edit, menu, olc - create/manipulate prototype in a menu interface.\n\n Example:\n spawn GOBLIN\n spawn {&quot;key&quot;:&quot;goblin&quot;, &quot;typeclass&quot;:&quot;monster.Monster&quot;, &quot;location&quot;:&quot;#2&quot;}\n spawn/save {&quot;key&quot;: &quot;grunt&quot;, prototype: &quot;goblin&quot;};;mobs;edit:all()\n \x0c\n Dictionary keys:\n |wprototype_parent |n - name of parent prototype to use. Required if typeclass is\n not set. Can be a path or a list for multiple inheritance (inherits\n left to right). If set one of the parents must have a typeclass.\n |wtypeclass |n - string. Required if prototype_parent is not set.\n |wkey |n - string, the main object identifier\n |wlocation |n - this should be a valid object or #dbref\n |whome |n - valid object or #dbref\n |wdestination|n - only valid for exits (object or dbref)\n |wpermissions|n - string or list of permission strings\n |wlocks |n - a lock-string\n |waliases |n - string or list of strings.\n |wndb_|n&lt;name&gt; - value of a nattribute (ndb_ is stripped)\n\n |wprototype_key|n - name of this prototype. Unique. Used to store/retrieve from db\n and update existing prototyped objects if desired.\n |wprototype_desc|n - desc of this prototype. Used in listings\n |wprototype_locks|n - locks of this prototype. Limits who may use prototype\n |wprototype_tags|n - tags of this prototype. Used to find prototype\n\n any other keywords are interpreted as Attributes and their values.\n\n The available prototypes are defined globally in modules set in\n settings.PROTOTYPE_MODULES. If spawn is used without arguments it\n displays a list of available prototypes.\n\n '}</em><a class="headerlink" href="#evennia.commands.default.building.CmdSpawn.search_index_entry" title="Permalink to this definition"></a></dt>
<dd></dd></dl>
</dd></dl>
</div>

View file

@ -63,7 +63,7 @@ aliases to an already joined channel.</p>
<dl class="py attribute">
<dt id="evennia.commands.default.comms.CmdAddCom.aliases">
<code class="sig-name descname">aliases</code><em class="property"> = ['aliaschan', 'chanalias']</em><a class="headerlink" href="#evennia.commands.default.comms.CmdAddCom.aliases" title="Permalink to this definition"></a></dt>
<code class="sig-name descname">aliases</code><em class="property"> = ['chanalias', 'aliaschan']</em><a class="headerlink" href="#evennia.commands.default.comms.CmdAddCom.aliases" title="Permalink to this definition"></a></dt>
<dd></dd></dl>
<dl class="py attribute">
@ -92,6 +92,11 @@ aliases to an already joined channel.</p>
<code class="sig-name descname">lock_storage</code><em class="property"> = 'cmd:not pperm(channel_banned)'</em><a class="headerlink" href="#evennia.commands.default.comms.CmdAddCom.lock_storage" title="Permalink to this definition"></a></dt>
<dd></dd></dl>
<dl class="py attribute">
<dt id="evennia.commands.default.comms.CmdAddCom.search_index_entry">
<code class="sig-name descname">search_index_entry</code><em class="property"> = {'aliases': 'chanalias aliaschan', 'category': 'comms', 'key': 'addcom', 'tags': '', 'text': '\n add a channel alias and/or subscribe to a channel\n\n Usage:\n addcom [alias=] &lt;channel&gt;\n\n Joins a given channel. If alias is given, this will allow you to\n refer to the channel by this alias rather than the full channel\n name. Subsequent calls of this command can be used to add multiple\n aliases to an already joined channel.\n '}</em><a class="headerlink" href="#evennia.commands.default.comms.CmdAddCom.search_index_entry" title="Permalink to this definition"></a></dt>
<dd></dd></dl>
</dd></dl>
<dl class="py class">
@ -144,6 +149,11 @@ for that channel.</p>
<code class="sig-name descname">lock_storage</code><em class="property"> = 'cmd:not perm(channel_banned)'</em><a class="headerlink" href="#evennia.commands.default.comms.CmdDelCom.lock_storage" title="Permalink to this definition"></a></dt>
<dd></dd></dl>
<dl class="py attribute">
<dt id="evennia.commands.default.comms.CmdDelCom.search_index_entry">
<code class="sig-name descname">search_index_entry</code><em class="property"> = {'aliases': 'delchanalias delaliaschan', 'category': 'comms', 'key': 'delcom', 'tags': '', 'text': &quot;\n remove a channel alias and/or unsubscribe from channel\n\n Usage:\n delcom &lt;alias or channel&gt;\n delcom/all &lt;channel&gt;\n\n If the full channel name is given, unsubscribe from the\n channel. If an alias is given, remove the alias but don't\n unsubscribe. If the 'all' switch is used, remove all aliases\n for that channel.\n &quot;}</em><a class="headerlink" href="#evennia.commands.default.comms.CmdDelCom.search_index_entry" title="Permalink to this definition"></a></dt>
<dd></dd></dl>
</dd></dl>
<dl class="py class">
@ -195,6 +205,11 @@ channels that you control.</p>
<code class="sig-name descname">lock_storage</code><em class="property"> = 'cmd: not pperm(channel_banned)'</em><a class="headerlink" href="#evennia.commands.default.comms.CmdAllCom.lock_storage" title="Permalink to this definition"></a></dt>
<dd></dd></dl>
<dl class="py attribute">
<dt id="evennia.commands.default.comms.CmdAllCom.search_index_entry">
<code class="sig-name descname">search_index_entry</code><em class="property"> = {'aliases': '', 'category': 'comms', 'key': 'allcom', 'tags': '', 'text': &quot;\n perform admin operations on all channels\n\n Usage:\n allcom [on | off | who | destroy]\n\n Allows the user to universally turn off or on all channels they are on, as\n well as perform a 'who' for all channels they are on. Destroy deletes all\n channels that you control.\n\n Without argument, works like comlist.\n &quot;}</em><a class="headerlink" href="#evennia.commands.default.comms.CmdAllCom.search_index_entry" title="Permalink to this definition"></a></dt>
<dd></dd></dl>
</dd></dl>
<dl class="py class">
@ -218,7 +233,7 @@ Use addcom/delcom to join and leave channels</p>
<dl class="py attribute">
<dt id="evennia.commands.default.comms.CmdChannels.aliases">
<code class="sig-name descname">aliases</code><em class="property"> = ['comlist', 'clist', 'all channels', 'channellist', 'chanlist']</em><a class="headerlink" href="#evennia.commands.default.comms.CmdChannels.aliases" title="Permalink to this definition"></a></dt>
<code class="sig-name descname">aliases</code><em class="property"> = ['comlist', 'chanlist', 'channellist', 'clist', 'all channels']</em><a class="headerlink" href="#evennia.commands.default.comms.CmdChannels.aliases" title="Permalink to this definition"></a></dt>
<dd></dd></dl>
<dl class="py attribute">
@ -247,6 +262,11 @@ Use addcom/delcom to join and leave channels</p>
<code class="sig-name descname">lock_storage</code><em class="property"> = 'cmd: not pperm(channel_banned)'</em><a class="headerlink" href="#evennia.commands.default.comms.CmdChannels.lock_storage" title="Permalink to this definition"></a></dt>
<dd></dd></dl>
<dl class="py attribute">
<dt id="evennia.commands.default.comms.CmdChannels.search_index_entry">
<code class="sig-name descname">search_index_entry</code><em class="property"> = {'aliases': 'comlist chanlist channellist clist all channels', 'category': 'comms', 'key': 'channels', 'tags': '', 'text': &quot;\n list all channels available to you\n\n Usage:\n channels\n clist\n comlist\n\n Lists all channels available to you, whether you listen to them or not.\n Use 'comlist' to only view your current channel subscriptions.\n Use addcom/delcom to join and leave channels\n &quot;}</em><a class="headerlink" href="#evennia.commands.default.comms.CmdChannels.search_index_entry" title="Permalink to this definition"></a></dt>
<dd></dd></dl>
</dd></dl>
<dl class="py class">
@ -295,6 +315,11 @@ Use addcom/delcom to join and leave channels</p>
<code class="sig-name descname">lock_storage</code><em class="property"> = 'cmd: not pperm(channel_banned)'</em><a class="headerlink" href="#evennia.commands.default.comms.CmdCdestroy.lock_storage" title="Permalink to this definition"></a></dt>
<dd></dd></dl>
<dl class="py attribute">
<dt id="evennia.commands.default.comms.CmdCdestroy.search_index_entry">
<code class="sig-name descname">search_index_entry</code><em class="property"> = {'aliases': '', 'category': 'comms', 'key': 'cdestroy', 'tags': '', 'text': '\n destroy a channel you created\n\n Usage:\n cdestroy &lt;channel&gt;\n\n Destroys a channel that you control.\n '}</em><a class="headerlink" href="#evennia.commands.default.comms.CmdCdestroy.search_index_entry" title="Permalink to this definition"></a></dt>
<dd></dd></dl>
</dd></dl>
<dl class="py class">
@ -350,6 +375,11 @@ Use addcom/delcom to join and leave channels</p>
<code class="sig-name descname">lock_storage</code><em class="property"> = 'cmd: not pperm(channel_banned)'</em><a class="headerlink" href="#evennia.commands.default.comms.CmdCBoot.lock_storage" title="Permalink to this definition"></a></dt>
<dd></dd></dl>
<dl class="py attribute">
<dt id="evennia.commands.default.comms.CmdCBoot.search_index_entry">
<code class="sig-name descname">search_index_entry</code><em class="property"> = {'aliases': '', 'category': 'comms', 'key': 'cboot', 'tags': '', 'text': &quot;\n kick an account from a channel you control\n\n Usage:\n cboot[/quiet] &lt;channel&gt; = &lt;account&gt; [:reason]\n\n Switch:\n quiet - don't notify the channel\n\n Kicks an account or object from a channel you control.\n\n &quot;}</em><a class="headerlink" href="#evennia.commands.default.comms.CmdCBoot.search_index_entry" title="Permalink to this definition"></a></dt>
<dd></dd></dl>
</dd></dl>
<dl class="py class">
@ -408,6 +438,11 @@ provide the /sendername switch.</p>
<code class="sig-name descname">lock_storage</code><em class="property"> = 'cmd: not pperm(channel_banned) and pperm(Player)'</em><a class="headerlink" href="#evennia.commands.default.comms.CmdCemit.lock_storage" title="Permalink to this definition"></a></dt>
<dd></dd></dl>
<dl class="py attribute">
<dt id="evennia.commands.default.comms.CmdCemit.search_index_entry">
<code class="sig-name descname">search_index_entry</code><em class="property"> = {'aliases': 'cmsg', 'category': 'comms', 'key': 'cemit', 'tags': '', 'text': &quot;\n send an admin message to a channel you control\n\n Usage:\n cemit[/switches] &lt;channel&gt; = &lt;message&gt;\n\n Switches:\n sendername - attach the sender's name before the message\n quiet - don't echo the message back to sender\n\n Allows the user to broadcast a message over a channel as long as\n they control it. It does not show the user's name unless they\n provide the /sendername switch.\n\n &quot;}</em><a class="headerlink" href="#evennia.commands.default.comms.CmdCemit.search_index_entry" title="Permalink to this definition"></a></dt>
<dd></dd></dl>
</dd></dl>
<dl class="py class">
@ -456,6 +491,11 @@ provide the /sendername switch.</p>
<code class="sig-name descname">lock_storage</code><em class="property"> = 'cmd: not pperm(channel_banned)'</em><a class="headerlink" href="#evennia.commands.default.comms.CmdCWho.lock_storage" title="Permalink to this definition"></a></dt>
<dd></dd></dl>
<dl class="py attribute">
<dt id="evennia.commands.default.comms.CmdCWho.search_index_entry">
<code class="sig-name descname">search_index_entry</code><em class="property"> = {'aliases': '', 'category': 'comms', 'key': 'cwho', 'tags': '', 'text': '\n show who is listening to a channel\n\n Usage:\n cwho &lt;channel&gt;\n\n List who is connected to a given channel you have access to.\n '}</em><a class="headerlink" href="#evennia.commands.default.comms.CmdCWho.search_index_entry" title="Permalink to this definition"></a></dt>
<dd></dd></dl>
</dd></dl>
<dl class="py class">
@ -504,6 +544,11 @@ provide the /sendername switch.</p>
<code class="sig-name descname">lock_storage</code><em class="property"> = 'cmd:not pperm(channel_banned) and pperm(Player)'</em><a class="headerlink" href="#evennia.commands.default.comms.CmdChannelCreate.lock_storage" title="Permalink to this definition"></a></dt>
<dd></dd></dl>
<dl class="py attribute">
<dt id="evennia.commands.default.comms.CmdChannelCreate.search_index_entry">
<code class="sig-name descname">search_index_entry</code><em class="property"> = {'aliases': 'channelcreate', 'category': 'comms', 'key': 'ccreate', 'tags': '', 'text': '\n create a new channel\n\n Usage:\n ccreate &lt;new channel&gt;[;alias;alias...] = description\n\n Creates a new channel owned by you.\n '}</em><a class="headerlink" href="#evennia.commands.default.comms.CmdChannelCreate.search_index_entry" title="Permalink to this definition"></a></dt>
<dd></dd></dl>
</dd></dl>
<dl class="py class">
@ -553,6 +598,11 @@ lockstring was given, view the current lock definitions.</p>
<code class="sig-name descname">lock_storage</code><em class="property"> = 'cmd:not pperm(channel_banned)'</em><a class="headerlink" href="#evennia.commands.default.comms.CmdClock.lock_storage" title="Permalink to this definition"></a></dt>
<dd></dd></dl>
<dl class="py attribute">
<dt id="evennia.commands.default.comms.CmdClock.search_index_entry">
<code class="sig-name descname">search_index_entry</code><em class="property"> = {'aliases': '', 'category': 'comms', 'key': 'clock', 'tags': '', 'text': '\n change channel locks of a channel you control\n\n Usage:\n clock &lt;channel&gt; [= &lt;lockstring&gt;]\n\n Changes the lock access restrictions of a channel. If no\n lockstring was given, view the current lock definitions.\n '}</em><a class="headerlink" href="#evennia.commands.default.comms.CmdClock.search_index_entry" title="Permalink to this definition"></a></dt>
<dd></dd></dl>
</dd></dl>
<dl class="py class">
@ -602,6 +652,11 @@ channel lists.</p>
<code class="sig-name descname">lock_storage</code><em class="property"> = 'cmd:not pperm(channel_banned)'</em><a class="headerlink" href="#evennia.commands.default.comms.CmdCdesc.lock_storage" title="Permalink to this definition"></a></dt>
<dd></dd></dl>
<dl class="py attribute">
<dt id="evennia.commands.default.comms.CmdCdesc.search_index_entry">
<code class="sig-name descname">search_index_entry</code><em class="property"> = {'aliases': '', 'category': 'comms', 'key': 'cdesc', 'tags': '', 'text': '\n describe a channel you control\n\n Usage:\n cdesc &lt;channel&gt; = &lt;description&gt;\n\n Changes the description of the channel as shown in\n channel lists.\n '}</em><a class="headerlink" href="#evennia.commands.default.comms.CmdCdesc.search_index_entry" title="Permalink to this definition"></a></dt>
<dd></dd></dl>
</dd></dl>
<dl class="py class">
@ -661,6 +716,11 @@ argument is given, you will get a list of your latest messages.</p>
<code class="sig-name descname">lock_storage</code><em class="property"> = 'cmd:not pperm(page_banned)'</em><a class="headerlink" href="#evennia.commands.default.comms.CmdPage.lock_storage" title="Permalink to this definition"></a></dt>
<dd></dd></dl>
<dl class="py attribute">
<dt id="evennia.commands.default.comms.CmdPage.search_index_entry">
<code class="sig-name descname">search_index_entry</code><em class="property"> = {'aliases': 'tell', 'category': 'comms', 'key': 'page', 'tags': '', 'text': &quot;\n send a private message to another account\n\n Usage:\n page[/switches] [&lt;account&gt;,&lt;account&gt;,... = &lt;message&gt;]\n tell ''\n page &lt;number&gt;\n\n Switch:\n last - shows who you last messaged\n list - show your last &lt;number&gt; of tells/pages (default)\n\n Send a message to target user (if online). If no\n argument is given, you will get a list of your latest messages.\n &quot;}</em><a class="headerlink" href="#evennia.commands.default.comms.CmdPage.search_index_entry" title="Permalink to this definition"></a></dt>
<dd></dd></dl>
</dd></dl>
<dl class="py class">
@ -738,6 +798,11 @@ Provide an optional bot class path to use a custom bot.</p>
<code class="sig-name descname">lock_storage</code><em class="property"> = 'cmd:serversetting(IRC_ENABLED) and pperm(Developer)'</em><a class="headerlink" href="#evennia.commands.default.comms.CmdIRC2Chan.lock_storage" title="Permalink to this definition"></a></dt>
<dd></dd></dl>
<dl class="py attribute">
<dt id="evennia.commands.default.comms.CmdIRC2Chan.search_index_entry">
<code class="sig-name descname">search_index_entry</code><em class="property"> = {'aliases': '', 'category': 'comms', 'key': 'irc2chan', 'tags': '', 'text': '\n Link an evennia channel to an external IRC channel\n\n Usage:\n irc2chan[/switches] &lt;evennia_channel&gt; = &lt;ircnetwork&gt; &lt;port&gt; &lt;#irchannel&gt; &lt;botname&gt;[:typeclass]\n irc2chan/delete botname|#dbid\n\n Switches:\n /delete - this will delete the bot and remove the irc connection\n to the channel. Requires the botname or #dbid as input.\n /remove - alias to /delete\n /disconnect - alias to /delete\n /list - show all irc&lt;-&gt;evennia mappings\n /ssl - use an SSL-encrypted connection\n\n Example:\n irc2chan myircchan = irc.dalnet.net 6667 #mychannel evennia-bot\n irc2chan public = irc.freenode.net 6667 #evgaming #evbot:accounts.mybot.MyBot\n\n This creates an IRC bot that connects to a given IRC network and\n channel. If a custom typeclass path is given, this will be used\n instead of the default bot class.\n The bot will relay everything said in the evennia channel to the\n IRC channel and vice versa. The bot will automatically connect at\n server start, so this command need only be given once. The\n /disconnect switch will permanently delete the bot. To only\n temporarily deactivate it, use the |wservices|n command instead.\n Provide an optional bot class path to use a custom bot.\n '}</em><a class="headerlink" href="#evennia.commands.default.comms.CmdIRC2Chan.search_index_entry" title="Permalink to this definition"></a></dt>
<dd></dd></dl>
</dd></dl>
<dl class="py class">
@ -789,6 +854,11 @@ messages sent to either channel will be lost.</p>
<code class="sig-name descname">lock_storage</code><em class="property"> = 'cmd:serversetting(IRC_ENABLED) and perm(ircstatus) or perm(Builder))'</em><a class="headerlink" href="#evennia.commands.default.comms.CmdIRCStatus.lock_storage" title="Permalink to this definition"></a></dt>
<dd></dd></dl>
<dl class="py attribute">
<dt id="evennia.commands.default.comms.CmdIRCStatus.search_index_entry">
<code class="sig-name descname">search_index_entry</code><em class="property"> = {'aliases': '', 'category': 'comms', 'key': 'ircstatus', 'tags': '', 'text': &quot;\n Check and reboot IRC bot.\n\n Usage:\n ircstatus [#dbref ping||nicklist||reconnect]\n\n If not given arguments, will return a list of all bots (like\n irc2chan/list). The 'ping' argument will ping the IRC network to\n see if the connection is still responsive. The 'nicklist' argument\n (aliases are 'who' and 'users') will return a list of users on the\n remote IRC channel. Finally, 'reconnect' will force the client to\n disconnect and reconnect again. This may be a last resort if the\n client has silently lost connection (this may happen if the remote\n network experience network issues). During the reconnection\n messages sent to either channel will be lost.\n\n &quot;}</em><a class="headerlink" href="#evennia.commands.default.comms.CmdIRCStatus.search_index_entry" title="Permalink to this definition"></a></dt>
<dd></dd></dl>
</dd></dl>
<dl class="py class">
@ -861,6 +931,11 @@ to identify the connection uniquely.</p>
<code class="sig-name descname">lock_storage</code><em class="property"> = 'cmd:serversetting(RSS_ENABLED) and pperm(Developer)'</em><a class="headerlink" href="#evennia.commands.default.comms.CmdRSS2Chan.lock_storage" title="Permalink to this definition"></a></dt>
<dd></dd></dl>
<dl class="py attribute">
<dt id="evennia.commands.default.comms.CmdRSS2Chan.search_index_entry">
<code class="sig-name descname">search_index_entry</code><em class="property"> = {'aliases': '', 'category': 'comms', 'key': 'rss2chan', 'tags': '', 'text': '\n link an evennia channel to an external RSS feed\n\n Usage:\n rss2chan[/switches] &lt;evennia_channel&gt; = &lt;rss_url&gt;\n\n Switches:\n /disconnect - this will stop the feed and remove the connection to the\n channel.\n /remove - &quot;\n /list - show all rss-&gt;evennia mappings\n\n Example:\n rss2chan rsschan = http://code.google.com/feeds/p/evennia/updates/basic\n\n This creates an RSS reader that connects to a given RSS feed url. Updates\n will be echoed as a title and news link to the given channel. The rate of\n updating is set with the RSS_UPDATE_INTERVAL variable in settings (default\n is every 10 minutes).\n\n When disconnecting you need to supply both the channel and url again so as\n to identify the connection uniquely.\n '}</em><a class="headerlink" href="#evennia.commands.default.comms.CmdRSS2Chan.search_index_entry" title="Permalink to this definition"></a></dt>
<dd></dd></dl>
</dd></dl>
<dl class="py class">
@ -934,6 +1009,11 @@ must be added to game settings.</p>
<code class="sig-name descname">lock_storage</code><em class="property"> = 'cmd:serversetting(GRAPEVINE_ENABLED) and pperm(Developer)'</em><a class="headerlink" href="#evennia.commands.default.comms.CmdGrapevine2Chan.lock_storage" title="Permalink to this definition"></a></dt>
<dd></dd></dl>
<dl class="py attribute">
<dt id="evennia.commands.default.comms.CmdGrapevine2Chan.search_index_entry">
<code class="sig-name descname">search_index_entry</code><em class="property"> = {'aliases': '', 'category': 'comms', 'key': 'grapevine2chan', 'tags': '', 'text': '\n Link an Evennia channel to an exteral Grapevine channel\n\n Usage:\n grapevine2chan[/switches] &lt;evennia_channel&gt; = &lt;grapevine_channel&gt;\n grapevine2chan/disconnect &lt;connection #id&gt;\n\n Switches:\n /list - (or no switch): show existing grapevine &lt;-&gt; Evennia\n mappings and available grapevine chans\n /remove - alias to disconnect\n /delete - alias to disconnect\n\n Example:\n grapevine2chan mygrapevine = gossip\n\n This creates a link between an in-game Evennia channel and an external\n Grapevine channel. The game must be registered with the Grapevine network\n (register at https://grapevine.haus) and the GRAPEVINE_* auth information\n must be added to game settings.\n '}</em><a class="headerlink" href="#evennia.commands.default.comms.CmdGrapevine2Chan.search_index_entry" title="Permalink to this definition"></a></dt>
<dd></dd></dl>
</dd></dl>
</div>

View file

@ -85,6 +85,11 @@
<code class="sig-name descname">lock_storage</code><em class="property"> = 'cmd:perm(home) or perm(Builder)'</em><a class="headerlink" href="#evennia.commands.default.general.CmdHome.lock_storage" title="Permalink to this definition"></a></dt>
<dd></dd></dl>
<dl class="py attribute">
<dt id="evennia.commands.default.general.CmdHome.search_index_entry">
<code class="sig-name descname">search_index_entry</code><em class="property"> = {'aliases': '', 'category': 'general', 'key': 'home', 'tags': '', 'text': &quot;\n move to your character's home location\n\n Usage:\n home\n\n Teleports you to your home location.\n &quot;}</em><a class="headerlink" href="#evennia.commands.default.general.CmdHome.search_index_entry" title="Permalink to this definition"></a></dt>
<dd></dd></dl>
</dd></dl>
<dl class="py class">
@ -135,6 +140,11 @@ look <a href="#id1"><span class="problematic" id="id2">*</span></a>&lt;account&g
<code class="sig-name descname">lock_storage</code><em class="property"> = 'cmd:all()'</em><a class="headerlink" href="#evennia.commands.default.general.CmdLook.lock_storage" title="Permalink to this definition"></a></dt>
<dd></dd></dl>
<dl class="py attribute">
<dt id="evennia.commands.default.general.CmdLook.search_index_entry">
<code class="sig-name descname">search_index_entry</code><em class="property"> = {'aliases': 'l ls', 'category': 'general', 'key': 'look', 'tags': '', 'text': '\n look at location or object\n\n Usage:\n look\n look &lt;obj&gt;\n look *&lt;account&gt;\n\n Observes your location or objects in your vicinity.\n '}</em><a class="headerlink" href="#evennia.commands.default.general.CmdLook.search_index_entry" title="Permalink to this definition"></a></dt>
<dd></dd></dl>
</dd></dl>
<dl class="py class">
@ -224,6 +234,11 @@ for everyone to use, you need build privileges and the alias command.</p>
<code class="sig-name descname">lock_storage</code><em class="property"> = 'cmd:all()'</em><a class="headerlink" href="#evennia.commands.default.general.CmdNick.lock_storage" title="Permalink to this definition"></a></dt>
<dd></dd></dl>
<dl class="py attribute">
<dt id="evennia.commands.default.general.CmdNick.search_index_entry">
<code class="sig-name descname">search_index_entry</code><em class="property"> = {'aliases': 'nickname nicks', 'category': 'general', 'key': 'nick', 'tags': '', 'text': '\n define a personal alias/nick by defining a string to\n match and replace it with another on the fly\n\n Usage:\n nick[/switches] &lt;string&gt; [= [replacement_string]]\n nick[/switches] &lt;template&gt; = &lt;replacement_template&gt;\n nick/delete &lt;string&gt; or number\n nicks\n\n Switches:\n inputline - replace on the inputline (default)\n object - replace on object-lookup\n account - replace on account-lookup\n list - show all defined aliases (also &quot;nicks&quot; works)\n delete - remove nick by index in /list\n clearall - clear all nicks\n\n Examples:\n nick hi = say Hello, I\'m Sarah!\n nick/object tom = the tall man\n nick build $1 $2 = create/drop $1;$2\n nick tell $1 $2=page $1=$2\n nick tm?$1=page tallman=$1\n nick tm\\=$1=page tallman=$1\n\n A \'nick\' is a personal string replacement. Use $1, $2, ... to catch arguments.\n Put the last $-marker without an ending space to catch all remaining text. You\n can also use unix-glob matching for the left-hand side &lt;string&gt;:\n\n * - matches everything\n ? - matches 0 or 1 single characters\n [abcd] - matches these chars in any order\n [!abcd] - matches everything not among these chars\n \\= - escape literal \'=\' you want in your &lt;string&gt;\n\n Note that no objects are actually renamed or changed by this command - your nicks\n are only available to you. If you want to permanently add keywords to an object\n for everyone to use, you need build privileges and the alias command.\n\n '}</em><a class="headerlink" href="#evennia.commands.default.general.CmdNick.search_index_entry" title="Permalink to this definition"></a></dt>
<dd></dd></dl>
</dd></dl>
<dl class="py class">
@ -244,7 +259,7 @@ inv</p>
<dl class="py attribute">
<dt id="evennia.commands.default.general.CmdInventory.aliases">
<code class="sig-name descname">aliases</code><em class="property"> = ['inv', 'i']</em><a class="headerlink" href="#evennia.commands.default.general.CmdInventory.aliases" title="Permalink to this definition"></a></dt>
<code class="sig-name descname">aliases</code><em class="property"> = ['i', 'inv']</em><a class="headerlink" href="#evennia.commands.default.general.CmdInventory.aliases" title="Permalink to this definition"></a></dt>
<dd></dd></dl>
<dl class="py attribute">
@ -273,6 +288,11 @@ inv</p>
<code class="sig-name descname">lock_storage</code><em class="property"> = 'cmd:all()'</em><a class="headerlink" href="#evennia.commands.default.general.CmdInventory.lock_storage" title="Permalink to this definition"></a></dt>
<dd></dd></dl>
<dl class="py attribute">
<dt id="evennia.commands.default.general.CmdInventory.search_index_entry">
<code class="sig-name descname">search_index_entry</code><em class="property"> = {'aliases': 'i inv', 'category': 'general', 'key': 'inventory', 'tags': '', 'text': '\n view inventory\n\n Usage:\n inventory\n inv\n\n Shows your inventory.\n '}</em><a class="headerlink" href="#evennia.commands.default.general.CmdInventory.search_index_entry" title="Permalink to this definition"></a></dt>
<dd></dd></dl>
</dd></dl>
<dl class="py class">
@ -323,6 +343,11 @@ look at you.</p>
<code class="sig-name descname">lock_storage</code><em class="property"> = 'cmd:all()'</em><a class="headerlink" href="#evennia.commands.default.general.CmdSetDesc.lock_storage" title="Permalink to this definition"></a></dt>
<dd></dd></dl>
<dl class="py attribute">
<dt id="evennia.commands.default.general.CmdSetDesc.search_index_entry">
<code class="sig-name descname">search_index_entry</code><em class="property"> = {'aliases': '', 'category': 'general', 'key': 'setdesc', 'tags': '', 'text': '\n describe yourself\n\n Usage:\n setdesc &lt;description&gt;\n\n Add a description to yourself. This\n will be visible to people when they\n look at you.\n '}</em><a class="headerlink" href="#evennia.commands.default.general.CmdSetDesc.search_index_entry" title="Permalink to this definition"></a></dt>
<dd></dd></dl>
</dd></dl>
<dl class="py class">
@ -372,6 +397,11 @@ your inventory.</p>
<code class="sig-name descname">lock_storage</code><em class="property"> = 'cmd:all()'</em><a class="headerlink" href="#evennia.commands.default.general.CmdGet.lock_storage" title="Permalink to this definition"></a></dt>
<dd></dd></dl>
<dl class="py attribute">
<dt id="evennia.commands.default.general.CmdGet.search_index_entry">
<code class="sig-name descname">search_index_entry</code><em class="property"> = {'aliases': 'grab', 'category': 'general', 'key': 'get', 'tags': '', 'text': '\n pick up something\n\n Usage:\n get &lt;obj&gt;\n\n Picks up an object from your location and puts it in\n your inventory.\n '}</em><a class="headerlink" href="#evennia.commands.default.general.CmdGet.search_index_entry" title="Permalink to this definition"></a></dt>
<dd></dd></dl>
</dd></dl>
<dl class="py class">
@ -421,6 +451,11 @@ location you are currently in.</p>
<code class="sig-name descname">lock_storage</code><em class="property"> = 'cmd:all()'</em><a class="headerlink" href="#evennia.commands.default.general.CmdDrop.lock_storage" title="Permalink to this definition"></a></dt>
<dd></dd></dl>
<dl class="py attribute">
<dt id="evennia.commands.default.general.CmdDrop.search_index_entry">
<code class="sig-name descname">search_index_entry</code><em class="property"> = {'aliases': '', 'category': 'general', 'key': 'drop', 'tags': '', 'text': '\n drop something\n\n Usage:\n drop &lt;obj&gt;\n\n Lets you drop an object from your inventory into the\n location you are currently in.\n '}</em><a class="headerlink" href="#evennia.commands.default.general.CmdDrop.search_index_entry" title="Permalink to this definition"></a></dt>
<dd></dd></dl>
</dd></dl>
<dl class="py class">
@ -475,6 +510,11 @@ placing it in their inventory.</p>
<code class="sig-name descname">lock_storage</code><em class="property"> = 'cmd:all()'</em><a class="headerlink" href="#evennia.commands.default.general.CmdGive.lock_storage" title="Permalink to this definition"></a></dt>
<dd></dd></dl>
<dl class="py attribute">
<dt id="evennia.commands.default.general.CmdGive.search_index_entry">
<code class="sig-name descname">search_index_entry</code><em class="property"> = {'aliases': '', 'category': 'general', 'key': 'give', 'tags': '', 'text': '\n give away something to someone\n\n Usage:\n give &lt;inventory obj&gt; &lt;to||=&gt; &lt;target&gt;\n\n Gives an items from your inventory to another character,\n placing it in their inventory.\n '}</em><a class="headerlink" href="#evennia.commands.default.general.CmdGive.search_index_entry" title="Permalink to this definition"></a></dt>
<dd></dd></dl>
</dd></dl>
<dl class="py class">
@ -518,6 +558,11 @@ placing it in their inventory.</p>
<code class="sig-name descname">lock_storage</code><em class="property"> = 'cmd:all()'</em><a class="headerlink" href="#evennia.commands.default.general.CmdSay.lock_storage" title="Permalink to this definition"></a></dt>
<dd></dd></dl>
<dl class="py attribute">
<dt id="evennia.commands.default.general.CmdSay.search_index_entry">
<code class="sig-name descname">search_index_entry</code><em class="property"> = {'aliases': '&quot; \'', 'category': 'general', 'key': 'say', 'tags': '', 'text': '\n speak as your character\n\n Usage:\n say &lt;message&gt;\n\n Talk to those in your current location.\n '}</em><a class="headerlink" href="#evennia.commands.default.general.CmdSay.search_index_entry" title="Permalink to this definition"></a></dt>
<dd></dd></dl>
</dd></dl>
<dl class="py class">
@ -563,6 +608,11 @@ others in the room being informed.</p>
<code class="sig-name descname">lock_storage</code><em class="property"> = 'cmd:all()'</em><a class="headerlink" href="#evennia.commands.default.general.CmdWhisper.lock_storage" title="Permalink to this definition"></a></dt>
<dd></dd></dl>
<dl class="py attribute">
<dt id="evennia.commands.default.general.CmdWhisper.search_index_entry">
<code class="sig-name descname">search_index_entry</code><em class="property"> = {'aliases': '', 'category': 'general', 'key': 'whisper', 'tags': '', 'text': '\n Speak privately as your character to another\n\n Usage:\n whisper &lt;character&gt; = &lt;message&gt;\n whisper &lt;char1&gt;, &lt;char2&gt; = &lt;message&gt;\n\n Talk privately to one or more characters in your current location, without\n others in the room being informed.\n '}</em><a class="headerlink" href="#evennia.commands.default.general.CmdWhisper.search_index_entry" title="Permalink to this definition"></a></dt>
<dd></dd></dl>
</dd></dl>
<dl class="py class">
@ -590,7 +640,7 @@ automatically begin with your name.</p>
<dl class="py attribute">
<dt id="evennia.commands.default.general.CmdPose.aliases">
<code class="sig-name descname">aliases</code><em class="property"> = ['emote', ':']</em><a class="headerlink" href="#evennia.commands.default.general.CmdPose.aliases" title="Permalink to this definition"></a></dt>
<code class="sig-name descname">aliases</code><em class="property"> = [':', 'emote']</em><a class="headerlink" href="#evennia.commands.default.general.CmdPose.aliases" title="Permalink to this definition"></a></dt>
<dd></dd></dl>
<dl class="py attribute">
@ -624,6 +674,11 @@ space.</p>
<code class="sig-name descname">lock_storage</code><em class="property"> = 'cmd:all()'</em><a class="headerlink" href="#evennia.commands.default.general.CmdPose.lock_storage" title="Permalink to this definition"></a></dt>
<dd></dd></dl>
<dl class="py attribute">
<dt id="evennia.commands.default.general.CmdPose.search_index_entry">
<code class="sig-name descname">search_index_entry</code><em class="property"> = {'aliases': ': emote', 'category': 'general', 'key': 'pose', 'tags': '', 'text': &quot;\n strike a pose\n\n Usage:\n pose &lt;pose text&gt;\n pose's &lt;pose text&gt;\n\n Example:\n pose is standing by the wall, smiling.\n -&gt; others will see:\n Tom is standing by the wall, smiling.\n\n Describe an action being taken. The pose text will\n automatically begin with your name.\n &quot;}</em><a class="headerlink" href="#evennia.commands.default.general.CmdPose.search_index_entry" title="Permalink to this definition"></a></dt>
<dd></dd></dl>
</dd></dl>
<dl class="py class">
@ -673,6 +728,11 @@ which permission groups you are a member of.</p>
<code class="sig-name descname">lock_storage</code><em class="property"> = 'cmd:all()'</em><a class="headerlink" href="#evennia.commands.default.general.CmdAccess.lock_storage" title="Permalink to this definition"></a></dt>
<dd></dd></dl>
<dl class="py attribute">
<dt id="evennia.commands.default.general.CmdAccess.search_index_entry">
<code class="sig-name descname">search_index_entry</code><em class="property"> = {'aliases': 'hierarchy groups', 'category': 'general', 'key': 'access', 'tags': '', 'text': '\n show your current game access\n\n Usage:\n access\n\n This command shows you the permission hierarchy and\n which permission groups you are a member of.\n '}</em><a class="headerlink" href="#evennia.commands.default.general.CmdAccess.search_index_entry" title="Permalink to this definition"></a></dt>
<dd></dd></dl>
</dd></dl>
</div>

View file

@ -125,7 +125,7 @@ entry is displayed.</p>
<dl class="py method">
<dt id="evennia.commands.default.help.CmdHelp.format_help_list">
<em class="property">static </em><code class="sig-name descname">format_help_list</code><span class="sig-paren">(</span><em class="sig-param"><span class="n">hdict_cmds</span></em>, <em class="sig-param"><span class="n">hdict_db</span></em><span class="sig-paren">)</span><a class="reference internal" href="../_modules/evennia/commands/default/help.html#CmdHelp.format_help_list"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#evennia.commands.default.help.CmdHelp.format_help_list" title="Permalink to this definition"></a></dt>
<code class="sig-name descname">format_help_list</code><span class="sig-paren">(</span><em class="sig-param"><span class="n">hdict_cmds</span></em>, <em class="sig-param"><span class="n">hdict_db</span></em><span class="sig-paren">)</span><a class="reference internal" href="../_modules/evennia/commands/default/help.html#CmdHelp.format_help_list"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#evennia.commands.default.help.CmdHelp.format_help_list" title="Permalink to this definition"></a></dt>
<dd><p>Output a category-ordered list. The input are the
pre-loaded help files for commands and database-helpfiles
respectively. You can override this method to return a
@ -199,6 +199,11 @@ False: the command shouldnt appear in the table.</p>
<code class="sig-name descname">lock_storage</code><em class="property"> = 'cmd:all()'</em><a class="headerlink" href="#evennia.commands.default.help.CmdHelp.lock_storage" title="Permalink to this definition"></a></dt>
<dd></dd></dl>
<dl class="py attribute">
<dt id="evennia.commands.default.help.CmdHelp.search_index_entry">
<code class="sig-name descname">search_index_entry</code><em class="property"> = {'aliases': '?', 'category': 'general', 'key': 'help', 'tags': '', 'text': '\n View help or a list of topics\n\n Usage:\n help &lt;topic or command&gt;\n help list\n help all\n\n This will search for help on commands and other\n topics related to the game.\n '}</em><a class="headerlink" href="#evennia.commands.default.help.CmdHelp.search_index_entry" title="Permalink to this definition"></a></dt>
<dd></dd></dl>
</dd></dl>
<dl class="py class">
@ -261,6 +266,11 @@ is to let everyone read the help file.</p>
<code class="sig-name descname">lock_storage</code><em class="property"> = 'cmd:perm(Helper)'</em><a class="headerlink" href="#evennia.commands.default.help.CmdSetHelp.lock_storage" title="Permalink to this definition"></a></dt>
<dd></dd></dl>
<dl class="py attribute">
<dt id="evennia.commands.default.help.CmdSetHelp.search_index_entry">
<code class="sig-name descname">search_index_entry</code><em class="property"> = {'aliases': '', 'category': 'building', 'key': 'sethelp', 'tags': '', 'text': '\n Edit the help database.\n\n Usage:\n help[/switches] &lt;topic&gt;[[;alias;alias][,category[,locks]] [= &lt;text&gt;]\n\n Switches:\n edit - open a line editor to edit the topic\'s help text.\n replace - overwrite existing help topic.\n append - add text to the end of existing topic with a newline between.\n extend - as append, but don\'t add a newline.\n delete - remove help topic.\n\n Examples:\n sethelp throw = This throws something at ...\n sethelp/append pickpocketing,Thievery = This steals ...\n sethelp/replace pickpocketing, ,attr(is_thief) = This steals ...\n sethelp/edit thievery\n\n This command manipulates the help database. A help entry can be created,\n appended/merged to and deleted. If you don\'t assign a category, the\n &quot;General&quot; category will be used. If no lockstring is specified, default\n is to let everyone read the help file.\n\n '}</em><a class="headerlink" href="#evennia.commands.default.help.CmdSetHelp.search_index_entry" title="Permalink to this definition"></a></dt>
<dd></dd></dl>
</dd></dl>
</div>

View file

@ -183,6 +183,11 @@ to all the variables defined therein.</p>
<code class="sig-name descname">lock_storage</code><em class="property"> = 'cmd:all();'</em><a class="headerlink" href="#evennia.commands.default.muxcommand.MuxCommand.lock_storage" title="Permalink to this definition"></a></dt>
<dd></dd></dl>
<dl class="py attribute">
<dt id="evennia.commands.default.muxcommand.MuxCommand.search_index_entry">
<code class="sig-name descname">search_index_entry</code><em class="property"> = {'aliases': '', 'category': 'general', 'key': 'command', 'tags': '', 'text': &quot;\n This sets up the basis for a MUX command. The idea\n is that most other Mux-related commands should just\n inherit from this and don't have to implement much\n parsing of their own unless they do something particularly\n advanced.\n\n Note that the class's __doc__ string (this text) is\n used by Evennia to create the automatic help entry for\n the command, so make sure to document consistently here.\n &quot;}</em><a class="headerlink" href="#evennia.commands.default.muxcommand.MuxCommand.search_index_entry" title="Permalink to this definition"></a></dt>
<dd></dd></dl>
</dd></dl>
<dl class="py class">
@ -223,6 +228,11 @@ character is actually attached to this Account and Session.</p>
<code class="sig-name descname">lock_storage</code><em class="property"> = 'cmd:all();'</em><a class="headerlink" href="#evennia.commands.default.muxcommand.MuxAccountCommand.lock_storage" title="Permalink to this definition"></a></dt>
<dd></dd></dl>
<dl class="py attribute">
<dt id="evennia.commands.default.muxcommand.MuxAccountCommand.search_index_entry">
<code class="sig-name descname">search_index_entry</code><em class="property"> = {'aliases': '', 'category': 'general', 'key': 'command', 'tags': '', 'text': '\n This is an on-Account version of the MuxCommand. Since these commands sit\n on Accounts rather than on Characters/Objects, we need to check\n this in the parser.\n\n Account commands are available also when puppeting a Character, it\'s\n just that they are applied with a lower priority and are always\n available, also when disconnected from a character (i.e. &quot;ooc&quot;).\n\n This class makes sure that caller is always an Account object, while\n creating a new property &quot;character&quot; that is set only if a\n character is actually attached to this Account and Session.\n '}</em><a class="headerlink" href="#evennia.commands.default.muxcommand.MuxAccountCommand.search_index_entry" title="Permalink to this definition"></a></dt>
<dd></dd></dl>
</dd></dl>
</div>

View file

@ -88,6 +88,11 @@ the line is just added to the editor buffer).</p>
<code class="sig-name descname">lock_storage</code><em class="property"> = 'cmd:all()'</em><a class="headerlink" href="#evennia.commands.default.syscommands.SystemNoInput.lock_storage" title="Permalink to this definition"></a></dt>
<dd></dd></dl>
<dl class="py attribute">
<dt id="evennia.commands.default.syscommands.SystemNoInput.search_index_entry">
<code class="sig-name descname">search_index_entry</code><em class="property"> = {'aliases': '', 'category': 'general', 'key': '__noinput_command', 'tags': '', 'text': '\n This is called when there is no input given\n '}</em><a class="headerlink" href="#evennia.commands.default.syscommands.SystemNoInput.search_index_entry" title="Permalink to this definition"></a></dt>
<dd></dd></dl>
</dd></dl>
<dl class="py class">
@ -126,6 +131,11 @@ the line is just added to the editor buffer).</p>
<code class="sig-name descname">lock_storage</code><em class="property"> = 'cmd:all()'</em><a class="headerlink" href="#evennia.commands.default.syscommands.SystemNoMatch.lock_storage" title="Permalink to this definition"></a></dt>
<dd></dd></dl>
<dl class="py attribute">
<dt id="evennia.commands.default.syscommands.SystemNoMatch.search_index_entry">
<code class="sig-name descname">search_index_entry</code><em class="property"> = {'aliases': '', 'category': 'general', 'key': '__nomatch_command', 'tags': '', 'text': '\n No command was found matching the given input.\n '}</em><a class="headerlink" href="#evennia.commands.default.syscommands.SystemNoMatch.search_index_entry" title="Permalink to this definition"></a></dt>
<dd></dd></dl>
</dd></dl>
<dl class="py class">
@ -174,6 +184,11 @@ the <strong>raw_cmdname</strong> is the cmdname unmodified by eventual prefix-st
<code class="sig-name descname">lock_storage</code><em class="property"> = 'cmd:all()'</em><a class="headerlink" href="#evennia.commands.default.syscommands.SystemMultimatch.lock_storage" title="Permalink to this definition"></a></dt>
<dd></dd></dl>
<dl class="py attribute">
<dt id="evennia.commands.default.syscommands.SystemMultimatch.search_index_entry">
<code class="sig-name descname">search_index_entry</code><em class="property"> = {'aliases': '', 'category': 'general', 'key': '__multimatch_command', 'tags': '', 'text': &quot;\n Multiple command matches.\n\n The cmdhandler adds a special attribute 'matches' to this\n system command.\n\n matches = [(cmdname, args, cmdobj, cmdlen, mratio, raw_cmdname) , (cmdname, ...), ...]\n\n Here, `cmdname` is the command's name and `args` the rest of the incoming string,\n without said command name. `cmdobj` is the Command instance, the cmdlen is\n the same as len(cmdname) and mratio is a measure of how big a part of the\n full input string the cmdname takes up - an exact match would be 1.0. Finally,\n the `raw_cmdname` is the cmdname unmodified by eventual prefix-stripping.\n\n &quot;}</em><a class="headerlink" href="#evennia.commands.default.syscommands.SystemMultimatch.search_index_entry" title="Permalink to this definition"></a></dt>
<dd></dd></dl>
</dd></dl>
<dl class="py class">
@ -288,6 +303,11 @@ the already formatted input.</p>
<code class="sig-name descname">lock_storage</code><em class="property"> = 'cmd:all()'</em><a class="headerlink" href="#evennia.commands.default.syscommands.SystemSendToChannel.lock_storage" title="Permalink to this definition"></a></dt>
<dd></dd></dl>
<dl class="py attribute">
<dt id="evennia.commands.default.syscommands.SystemSendToChannel.search_index_entry">
<code class="sig-name descname">search_index_entry</code><em class="property"> = {'aliases': '', 'category': 'general', 'key': '__send_to_channel_command', 'tags': '', 'text': '\n This is a special command that the cmdhandler calls\n when it detects that the command given matches\n an existing Channel object key (or alias).\n '}</em><a class="headerlink" href="#evennia.commands.default.syscommands.SystemSendToChannel.search_index_entry" title="Permalink to this definition"></a></dt>
<dd></dd></dl>
</dd></dl>
</div>

View file

@ -82,6 +82,11 @@ reset to purge) and at_reload() hooks will be called.</p>
<code class="sig-name descname">lock_storage</code><em class="property"> = 'cmd:perm(reload) or perm(Developer)'</em><a class="headerlink" href="#evennia.commands.default.system.CmdReload.lock_storage" title="Permalink to this definition"></a></dt>
<dd></dd></dl>
<dl class="py attribute">
<dt id="evennia.commands.default.system.CmdReload.search_index_entry">
<code class="sig-name descname">search_index_entry</code><em class="property"> = {'aliases': 'restart', 'category': 'system', 'key': 'reload', 'tags': '', 'text': '\n reload the server\n\n Usage:\n reload [reason]\n\n This restarts the server. The Portal is not\n affected. Non-persistent scripts will survive a reload (use\n reset to purge) and at_reload() hooks will be called.\n '}</em><a class="headerlink" href="#evennia.commands.default.system.CmdReload.search_index_entry" title="Permalink to this definition"></a></dt>
<dd></dd></dl>
</dd></dl>
<dl class="py class">
@ -134,6 +139,11 @@ cmdsets etc will be wiped.</p>
<code class="sig-name descname">lock_storage</code><em class="property"> = 'cmd:perm(reload) or perm(Developer)'</em><a class="headerlink" href="#evennia.commands.default.system.CmdReset.lock_storage" title="Permalink to this definition"></a></dt>
<dd></dd></dl>
<dl class="py attribute">
<dt id="evennia.commands.default.system.CmdReset.search_index_entry">
<code class="sig-name descname">search_index_entry</code><em class="property"> = {'aliases': 'reboot', 'category': 'system', 'key': 'reset', 'tags': '', 'text': '\n reset and reboot the server\n\n Usage:\n reset\n\n Notes:\n For normal updating you are recommended to use reload rather\n than this command. Use shutdown for a complete stop of\n everything.\n\n This emulates a cold reboot of the Server component of Evennia.\n The difference to shutdown is that the Server will auto-reboot\n and that it does not affect the Portal, so no users will be\n disconnected. Contrary to reload however, all shutdown hooks will\n be called and any non-database saved scripts, ndb-attributes,\n cmdsets etc will be wiped.\n\n '}</em><a class="headerlink" href="#evennia.commands.default.system.CmdReset.search_index_entry" title="Permalink to this definition"></a></dt>
<dd></dd></dl>
</dd></dl>
<dl class="py class">
@ -177,6 +187,11 @@ cmdsets etc will be wiped.</p>
<code class="sig-name descname">lock_storage</code><em class="property"> = 'cmd:perm(shutdown) or perm(Developer)'</em><a class="headerlink" href="#evennia.commands.default.system.CmdShutdown.lock_storage" title="Permalink to this definition"></a></dt>
<dd></dd></dl>
<dl class="py attribute">
<dt id="evennia.commands.default.system.CmdShutdown.search_index_entry">
<code class="sig-name descname">search_index_entry</code><em class="property"> = {'aliases': '', 'category': 'system', 'key': 'shutdown', 'tags': '', 'text': '\n stop the server completely\n\n Usage:\n shutdown [announcement]\n\n Gracefully shut down both Server and Portal.\n '}</em><a class="headerlink" href="#evennia.commands.default.system.CmdShutdown.search_index_entry" title="Permalink to this definition"></a></dt>
<dd></dd></dl>
</dd></dl>
<dl class="py class">
@ -264,6 +279,11 @@ should only be accessible by trusted server admins/superusers.|n</p>
<code class="sig-name descname">lock_storage</code><em class="property"> = 'cmd:perm(py) or perm(Developer)'</em><a class="headerlink" href="#evennia.commands.default.system.CmdPy.lock_storage" title="Permalink to this definition"></a></dt>
<dd></dd></dl>
<dl class="py attribute">
<dt id="evennia.commands.default.system.CmdPy.search_index_entry">
<code class="sig-name descname">search_index_entry</code><em class="property"> = {'aliases': '!', 'category': 'system', 'key': 'py', 'tags': '', 'text': &quot;\n execute a snippet of python code\n\n Usage:\n py [cmd]\n py/edit\n py/time &lt;cmd&gt;\n py/clientraw &lt;cmd&gt;\n py/noecho\n\n Switches:\n time - output an approximate execution time for &lt;cmd&gt;\n edit - open a code editor for multi-line code experimentation\n clientraw - turn off all client-specific escaping. Note that this may\n lead to different output depending on prototocol (such as angular brackets\n being parsed as HTML in the webclient but not in telnet clients)\n noecho - in Python console mode, turn off the input echo (e.g. if your client\n does this for you already)\n\n Without argument, open a Python console in-game. This is a full console,\n accepting multi-line Python code for testing and debugging. Type `exit()` to\n return to the game. If Evennia is reloaded, the console will be closed.\n\n Enter a line of instruction after the 'py' command to execute it\n immediately. Separate multiple commands by ';' or open the code editor\n using the /edit switch (all lines added in editor will be executed\n immediately when closing or using the execute command in the editor).\n\n A few variables are made available for convenience in order to offer access\n to the system (you can import more at execution time).\n\n Available variables in py environment:\n self, me : caller\n here : caller.location\n evennia : the evennia API\n inherits_from(obj, parent) : check object inheritance\n\n You can explore The evennia API from inside the game by calling\n the `__doc__` property on entities:\n py evennia.__doc__\n py evennia.managers.__doc__\n\n |rNote: In the wrong hands this command is a severe security risk. It\n should only be accessible by trusted server admins/superusers.|n\n\n &quot;}</em><a class="headerlink" href="#evennia.commands.default.system.CmdPy.search_index_entry" title="Permalink to this definition"></a></dt>
<dd></dd></dl>
</dd></dl>
<dl class="py class">
@ -327,6 +347,11 @@ required since whole classes of scripts often have the same name.</p>
<code class="sig-name descname">lock_storage</code><em class="property"> = 'cmd:perm(listscripts) or perm(Admin)'</em><a class="headerlink" href="#evennia.commands.default.system.CmdScripts.lock_storage" title="Permalink to this definition"></a></dt>
<dd></dd></dl>
<dl class="py attribute">
<dt id="evennia.commands.default.system.CmdScripts.search_index_entry">
<code class="sig-name descname">search_index_entry</code><em class="property"> = {'aliases': 'listscripts globalscript', 'category': 'system', 'key': 'scripts', 'tags': '', 'text': '\n list and manage all running scripts\n\n Usage:\n scripts[/switches] [#dbref, key, script.path or &lt;obj&gt;]\n\n Switches:\n start - start a script (must supply a script path)\n stop - stops an existing script\n kill - kills a script - without running its cleanup hooks\n validate - run a validation on the script(s)\n\n If no switches are given, this command just views all active\n scripts. The argument can be either an object, at which point it\n will be searched for all scripts defined on it, or a script name\n or #dbref. For using the /stop switch, a unique script #dbref is\n required since whole classes of scripts often have the same name.\n\n Use script for managing commands on objects.\n '}</em><a class="headerlink" href="#evennia.commands.default.system.CmdScripts.search_index_entry" title="Permalink to this definition"></a></dt>
<dd></dd></dl>
</dd></dl>
<dl class="py class">
@ -348,7 +373,7 @@ given, &lt;nr&gt; defaults to 10.</p>
<dl class="py attribute">
<dt id="evennia.commands.default.system.CmdObjects.aliases">
<code class="sig-name descname">aliases</code><em class="property"> = ['stats', 'listobjs', 'db', 'listobjects']</em><a class="headerlink" href="#evennia.commands.default.system.CmdObjects.aliases" title="Permalink to this definition"></a></dt>
<code class="sig-name descname">aliases</code><em class="property"> = ['listobjs', 'listobjects', 'stats', 'db']</em><a class="headerlink" href="#evennia.commands.default.system.CmdObjects.aliases" title="Permalink to this definition"></a></dt>
<dd></dd></dl>
<dl class="py attribute">
@ -372,6 +397,11 @@ given, &lt;nr&gt; defaults to 10.</p>
<code class="sig-name descname">lock_storage</code><em class="property"> = 'cmd:perm(listobjects) or perm(Builder)'</em><a class="headerlink" href="#evennia.commands.default.system.CmdObjects.lock_storage" title="Permalink to this definition"></a></dt>
<dd></dd></dl>
<dl class="py attribute">
<dt id="evennia.commands.default.system.CmdObjects.search_index_entry">
<code class="sig-name descname">search_index_entry</code><em class="property"> = {'aliases': 'listobjs listobjects stats db', 'category': 'system', 'key': 'objects', 'tags': '', 'text': '\n statistics on objects in the database\n\n Usage:\n objects [&lt;nr&gt;]\n\n Gives statictics on objects in database as well as\n a list of &lt;nr&gt; latest objects in database. If not\n given, &lt;nr&gt; defaults to 10.\n '}</em><a class="headerlink" href="#evennia.commands.default.system.CmdObjects.search_index_entry" title="Permalink to this definition"></a></dt>
<dd></dd></dl>
</dd></dl>
<dl class="py class">
@ -429,6 +459,11 @@ in the list.</p>
<code class="sig-name descname">lock_storage</code><em class="property"> = 'cmd:perm(service) or perm(Developer)'</em><a class="headerlink" href="#evennia.commands.default.system.CmdService.lock_storage" title="Permalink to this definition"></a></dt>
<dd></dd></dl>
<dl class="py attribute">
<dt id="evennia.commands.default.system.CmdService.search_index_entry">
<code class="sig-name descname">search_index_entry</code><em class="property"> = {'aliases': 'services', 'category': 'system', 'key': 'service', 'tags': '', 'text': '\n manage system services\n\n Usage:\n service[/switch] &lt;service&gt;\n\n Switches:\n list - shows all available services (default)\n start - activates or reactivate a service\n stop - stops/inactivate a service (can often be restarted)\n delete - tries to permanently remove a service\n\n Service management system. Allows for the listing,\n starting, and stopping of services. If no switches\n are given, services will be listed. Note that to operate on the\n service you have to supply the full (green or red) name as given\n in the list.\n '}</em><a class="headerlink" href="#evennia.commands.default.system.CmdService.search_index_entry" title="Permalink to this definition"></a></dt>
<dd></dd></dl>
</dd></dl>
<dl class="py class">
@ -472,6 +507,11 @@ in the list.</p>
<code class="sig-name descname">lock_storage</code><em class="property"> = 'cmd:all()'</em><a class="headerlink" href="#evennia.commands.default.system.CmdAbout.lock_storage" title="Permalink to this definition"></a></dt>
<dd></dd></dl>
<dl class="py attribute">
<dt id="evennia.commands.default.system.CmdAbout.search_index_entry">
<code class="sig-name descname">search_index_entry</code><em class="property"> = {'aliases': 'version', 'category': 'system', 'key': 'about', 'tags': '', 'text': '\n show Evennia info\n\n Usage:\n about\n\n Display info about the game engine.\n '}</em><a class="headerlink" href="#evennia.commands.default.system.CmdAbout.search_index_entry" title="Permalink to this definition"></a></dt>
<dd></dd></dl>
</dd></dl>
<dl class="py class">
@ -516,6 +556,11 @@ and the current time stamp.</p>
<code class="sig-name descname">lock_storage</code><em class="property"> = 'cmd:perm(time) or perm(Player)'</em><a class="headerlink" href="#evennia.commands.default.system.CmdTime.lock_storage" title="Permalink to this definition"></a></dt>
<dd></dd></dl>
<dl class="py attribute">
<dt id="evennia.commands.default.system.CmdTime.search_index_entry">
<code class="sig-name descname">search_index_entry</code><em class="property"> = {'aliases': 'uptime', 'category': 'system', 'key': 'time', 'tags': '', 'text': '\n show server time statistics\n\n Usage:\n time\n\n List Server time statistics such as uptime\n and the current time stamp.\n '}</em><a class="headerlink" href="#evennia.commands.default.system.CmdTime.search_index_entry" title="Permalink to this definition"></a></dt>
<dd></dd></dl>
</dd></dl>
<dl class="py class">
@ -584,6 +629,11 @@ the released memory will instead be re-used by the program.</p>
<code class="sig-name descname">lock_storage</code><em class="property"> = 'cmd:perm(list) or perm(Developer)'</em><a class="headerlink" href="#evennia.commands.default.system.CmdServerLoad.lock_storage" title="Permalink to this definition"></a></dt>
<dd></dd></dl>
<dl class="py attribute">
<dt id="evennia.commands.default.system.CmdServerLoad.search_index_entry">
<code class="sig-name descname">search_index_entry</code><em class="property"> = {'aliases': 'serverprocess serverload', 'category': 'system', 'key': 'server', 'tags': '', 'text': &quot;\n show server load and memory statistics\n\n Usage:\n server[/mem]\n\n Switches:\n mem - return only a string of the current memory usage\n flushmem - flush the idmapper cache\n\n This command shows server load statistics and dynamic memory\n usage. It also allows to flush the cache of accessed database\n objects.\n\n Some Important statistics in the table:\n\n |wServer load|n is an average of processor usage. It's usually\n between 0 (no usage) and 1 (100% usage), but may also be\n temporarily higher if your computer has multiple CPU cores.\n\n The |wResident/Virtual memory|n displays the total memory used by\n the server process.\n\n Evennia |wcaches|n all retrieved database entities when they are\n loaded by use of the idmapper functionality. This allows Evennia\n to maintain the same instances of an entity and allowing\n non-persistent storage schemes. The total amount of cached objects\n are displayed plus a breakdown of database object types.\n\n The |wflushmem|n switch allows to flush the object cache. Please\n note that due to how Python's memory management works, releasing\n caches may not show you a lower Residual/Virtual memory footprint,\n the released memory will instead be re-used by the program.\n\n &quot;}</em><a class="headerlink" href="#evennia.commands.default.system.CmdServerLoad.search_index_entry" title="Permalink to this definition"></a></dt>
<dd></dd></dl>
</dd></dl>
</div>

View file

@ -138,6 +138,18 @@ output sent to caller.msg in the game</p>
<dt id="evennia.commands.default.tests.TestHelp">
<em class="property">class </em><code class="sig-prename descclassname">evennia.commands.default.tests.</code><code class="sig-name descname">TestHelp</code><span class="sig-paren">(</span><em class="sig-param"><span class="n">methodName</span><span class="o">=</span><span class="default_value">'runTest'</span></em><span class="sig-paren">)</span><a class="reference internal" href="../_modules/evennia/commands/default/tests.html#TestHelp"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#evennia.commands.default.tests.TestHelp" title="Permalink to this definition"></a></dt>
<dd><p>Bases: <a class="reference internal" href="#evennia.commands.default.tests.CommandTest" title="evennia.commands.default.tests.CommandTest"><code class="xref py py-class docutils literal notranslate"><span class="pre">evennia.commands.default.tests.CommandTest</span></code></a></p>
<dl class="py method">
<dt id="evennia.commands.default.tests.TestHelp.setUp">
<code class="sig-name descname">setUp</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="reference internal" href="../_modules/evennia/commands/default/tests.html#TestHelp.setUp"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#evennia.commands.default.tests.TestHelp.setUp" title="Permalink to this definition"></a></dt>
<dd><p>Sets up testing environment</p>
</dd></dl>
<dl class="py method">
<dt id="evennia.commands.default.tests.TestHelp.tearDown">
<code class="sig-name descname">tearDown</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="reference internal" href="../_modules/evennia/commands/default/tests.html#TestHelp.tearDown"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#evennia.commands.default.tests.TestHelp.tearDown" title="Permalink to this definition"></a></dt>
<dd><p>Hook method for deconstructing the test fixture after testing it.</p>
</dd></dl>
<dl class="py method">
<dt id="evennia.commands.default.tests.TestHelp.test_help">
<code class="sig-name descname">test_help</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="reference internal" href="../_modules/evennia/commands/default/tests.html#TestHelp.test_help"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#evennia.commands.default.tests.TestHelp.test_help" title="Permalink to this definition"></a></dt>
@ -599,6 +611,11 @@ set in self.parse())</p>
<code class="sig-name descname">lock_storage</code><em class="property"> = 'cmd:all();'</em><a class="headerlink" href="#evennia.commands.default.tests.CmdInterrupt.lock_storage" title="Permalink to this definition"></a></dt>
<dd></dd></dl>
<dl class="py attribute">
<dt id="evennia.commands.default.tests.CmdInterrupt.search_index_entry">
<code class="sig-name descname">search_index_entry</code><em class="property"> = {'aliases': '', 'category': 'general', 'key': 'interrupt', 'tags': '', 'text': '\n Base command\n\n Usage:\n command [args]\n\n This is the base command class. Inherit from this\n to create new commands.\n\n The cmdhandler makes the following variables available to the\n command methods (so you can always assume them to be there):\n self.caller - the game object calling the command\n self.cmdstring - the command name used to trigger this command (allows\n you to know which alias was used, for example)\n cmd.args - everything supplied to the command following the cmdstring\n (this is usually what is parsed in self.parse())\n cmd.cmdset - the cmdset from which this command was matched (useful only\n seldomly, notably for help-type commands, to create dynamic\n help entries and lists)\n cmd.obj - the object on which this command is defined. If a default command,\n this is usually the same as caller.\n cmd.rawstring - the full raw string input, including any args and no parsing.\n\n The following class properties can/should be defined on your child class:\n\n key - identifier for command (e.g. &quot;look&quot;)\n aliases - (optional) list of aliases (e.g. [&quot;l&quot;, &quot;loo&quot;])\n locks - lock string (default is &quot;cmd:all()&quot;)\n help_category - how to organize this help entry in help system\n (default is &quot;General&quot;)\n auto_help - defaults to True. Allows for turning off auto-help generation\n arg_regex - (optional) raw string regex defining how the argument part of\n the command should look in order to match for this command\n (e.g. must it be a space between cmdname and arg?)\n auto_help_display_key - (optional) if given, this replaces the string shown\n in the auto-help listing. This is particularly useful for system-commands\n whose actual key is not really meaningful.\n\n (Note that if auto_help is on, this initial string is also used by the\n system to create the help entry for the command, so it\'s a good idea to\n format it similar to this one). This behavior can be changed by\n overriding the method \'get_help\' of a command: by default, this\n method returns cmd.__doc__ (that is, this very docstring, or\n the docstring of your command). You can, however, extend or\n replace this without disabling auto_help.\n '}</em><a class="headerlink" href="#evennia.commands.default.tests.CmdInterrupt.search_index_entry" title="Permalink to this definition"></a></dt>
<dd></dd></dl>
</dd></dl>
<dl class="py class">

View file

@ -58,7 +58,7 @@ connect “account name” “pass word”</p>
<dl class="py attribute">
<dt id="evennia.commands.default.unloggedin.CmdUnconnectedConnect.aliases">
<code class="sig-name descname">aliases</code><em class="property"> = ['con', 'conn', 'co']</em><a class="headerlink" href="#evennia.commands.default.unloggedin.CmdUnconnectedConnect.aliases" title="Permalink to this definition"></a></dt>
<code class="sig-name descname">aliases</code><em class="property"> = ['conn', 'con', 'co']</em><a class="headerlink" href="#evennia.commands.default.unloggedin.CmdUnconnectedConnect.aliases" title="Permalink to this definition"></a></dt>
<dd></dd></dl>
<dl class="py attribute">
@ -91,6 +91,11 @@ there is no object yet before the account has logged in)</p>
<code class="sig-name descname">lock_storage</code><em class="property"> = 'cmd:all()'</em><a class="headerlink" href="#evennia.commands.default.unloggedin.CmdUnconnectedConnect.lock_storage" title="Permalink to this definition"></a></dt>
<dd></dd></dl>
<dl class="py attribute">
<dt id="evennia.commands.default.unloggedin.CmdUnconnectedConnect.search_index_entry">
<code class="sig-name descname">search_index_entry</code><em class="property"> = {'aliases': 'conn con co', 'category': 'general', 'key': 'connect', 'tags': '', 'text': '\n connect to the game\n\n Usage (at login screen):\n connect accountname password\n connect &quot;account name&quot; &quot;pass word&quot;\n\n Use the create command to first create an account before logging in.\n\n If you have spaces in your name, enclose it in double quotes.\n '}</em><a class="headerlink" href="#evennia.commands.default.unloggedin.CmdUnconnectedConnect.search_index_entry" title="Permalink to this definition"></a></dt>
<dd></dd></dl>
</dd></dl>
<dl class="py class">
@ -112,7 +117,7 @@ create “account name” “pass word”</p>
<dl class="py attribute">
<dt id="evennia.commands.default.unloggedin.CmdUnconnectedCreate.aliases">
<code class="sig-name descname">aliases</code><em class="property"> = ['cre', 'cr']</em><a class="headerlink" href="#evennia.commands.default.unloggedin.CmdUnconnectedCreate.aliases" title="Permalink to this definition"></a></dt>
<code class="sig-name descname">aliases</code><em class="property"> = ['cr', 'cre']</em><a class="headerlink" href="#evennia.commands.default.unloggedin.CmdUnconnectedCreate.aliases" title="Permalink to this definition"></a></dt>
<dd></dd></dl>
<dl class="py attribute">
@ -141,6 +146,11 @@ create “account name” “pass word”</p>
<code class="sig-name descname">lock_storage</code><em class="property"> = 'cmd:all()'</em><a class="headerlink" href="#evennia.commands.default.unloggedin.CmdUnconnectedCreate.lock_storage" title="Permalink to this definition"></a></dt>
<dd></dd></dl>
<dl class="py attribute">
<dt id="evennia.commands.default.unloggedin.CmdUnconnectedCreate.search_index_entry">
<code class="sig-name descname">search_index_entry</code><em class="property"> = {'aliases': 'cr cre', 'category': 'general', 'key': 'create', 'tags': '', 'text': '\n create a new account account\n\n Usage (at login screen):\n create &lt;accountname&gt; &lt;password&gt;\n create &quot;account name&quot; &quot;pass word&quot;\n\n This creates a new account account.\n\n If you have spaces in your name, enclose it in double quotes.\n '}</em><a class="headerlink" href="#evennia.commands.default.unloggedin.CmdUnconnectedCreate.search_index_entry" title="Permalink to this definition"></a></dt>
<dd></dd></dl>
</dd></dl>
<dl class="py class">
@ -186,6 +196,11 @@ version is a bit more complicated.</p>
<code class="sig-name descname">lock_storage</code><em class="property"> = 'cmd:all()'</em><a class="headerlink" href="#evennia.commands.default.unloggedin.CmdUnconnectedQuit.lock_storage" title="Permalink to this definition"></a></dt>
<dd></dd></dl>
<dl class="py attribute">
<dt id="evennia.commands.default.unloggedin.CmdUnconnectedQuit.search_index_entry">
<code class="sig-name descname">search_index_entry</code><em class="property"> = {'aliases': 'q qu', 'category': 'general', 'key': 'quit', 'tags': '', 'text': '\n quit when in unlogged-in state\n\n Usage:\n quit\n\n We maintain a different version of the quit command\n here for unconnected accounts for the sake of simplicity. The logged in\n version is a bit more complicated.\n '}</em><a class="headerlink" href="#evennia.commands.default.unloggedin.CmdUnconnectedQuit.search_index_entry" title="Permalink to this definition"></a></dt>
<dd></dd></dl>
</dd></dl>
<dl class="py class">
@ -207,7 +222,7 @@ All it does is display the connect screen.</p>
<dl class="py attribute">
<dt id="evennia.commands.default.unloggedin.CmdUnconnectedLook.aliases">
<code class="sig-name descname">aliases</code><em class="property"> = ['look', 'l']</em><a class="headerlink" href="#evennia.commands.default.unloggedin.CmdUnconnectedLook.aliases" title="Permalink to this definition"></a></dt>
<code class="sig-name descname">aliases</code><em class="property"> = ['l', 'look']</em><a class="headerlink" href="#evennia.commands.default.unloggedin.CmdUnconnectedLook.aliases" title="Permalink to this definition"></a></dt>
<dd></dd></dl>
<dl class="py attribute">
@ -231,6 +246,11 @@ All it does is display the connect screen.</p>
<code class="sig-name descname">lock_storage</code><em class="property"> = 'cmd:all()'</em><a class="headerlink" href="#evennia.commands.default.unloggedin.CmdUnconnectedLook.lock_storage" title="Permalink to this definition"></a></dt>
<dd></dd></dl>
<dl class="py attribute">
<dt id="evennia.commands.default.unloggedin.CmdUnconnectedLook.search_index_entry">
<code class="sig-name descname">search_index_entry</code><em class="property"> = {'aliases': 'l look', 'category': 'general', 'key': '__unloggedin_look_command', 'tags': '', 'text': '\n look when in unlogged-in state\n\n Usage:\n look\n\n This is an unconnected version of the look command for simplicity.\n\n This is called by the server and kicks everything in gear.\n All it does is display the connect screen.\n '}</em><a class="headerlink" href="#evennia.commands.default.unloggedin.CmdUnconnectedLook.search_index_entry" title="Permalink to this definition"></a></dt>
<dd></dd></dl>
</dd></dl>
<dl class="py class">
@ -251,7 +271,7 @@ for simplicity. It shows a pane of info.</p>
<dl class="py attribute">
<dt id="evennia.commands.default.unloggedin.CmdUnconnectedHelp.aliases">
<code class="sig-name descname">aliases</code><em class="property"> = ['h', '?']</em><a class="headerlink" href="#evennia.commands.default.unloggedin.CmdUnconnectedHelp.aliases" title="Permalink to this definition"></a></dt>
<code class="sig-name descname">aliases</code><em class="property"> = ['?', 'h']</em><a class="headerlink" href="#evennia.commands.default.unloggedin.CmdUnconnectedHelp.aliases" title="Permalink to this definition"></a></dt>
<dd></dd></dl>
<dl class="py attribute">
@ -275,6 +295,11 @@ for simplicity. It shows a pane of info.</p>
<code class="sig-name descname">lock_storage</code><em class="property"> = 'cmd:all()'</em><a class="headerlink" href="#evennia.commands.default.unloggedin.CmdUnconnectedHelp.lock_storage" title="Permalink to this definition"></a></dt>
<dd></dd></dl>
<dl class="py attribute">
<dt id="evennia.commands.default.unloggedin.CmdUnconnectedHelp.search_index_entry">
<code class="sig-name descname">search_index_entry</code><em class="property"> = {'aliases': '? h', 'category': 'general', 'key': 'help', 'tags': '', 'text': '\n get help when in unconnected-in state\n\n Usage:\n help\n\n This is an unconnected version of the help command,\n for simplicity. It shows a pane of info.\n '}</em><a class="headerlink" href="#evennia.commands.default.unloggedin.CmdUnconnectedHelp.search_index_entry" title="Permalink to this definition"></a></dt>
<dd></dd></dl>
</dd></dl>
</div>

View file

@ -140,6 +140,11 @@ the already formatted input.</p>
<code class="sig-name descname">lock_storage</code><em class="property"> = 'cmd:all();'</em><a class="headerlink" href="#evennia.comms.channelhandler.ChannelCommand.lock_storage" title="Permalink to this definition"></a></dt>
<dd></dd></dl>
<dl class="py attribute">
<dt id="evennia.comms.channelhandler.ChannelCommand.search_index_entry">
<code class="sig-name descname">search_index_entry</code><em class="property"> = {'aliases': '', 'category': 'channel names', 'key': 'general', 'tags': '', 'text': '\n {channelkey} channel\n\n {channeldesc}\n\n Usage:\n {lower_channelkey} &lt;message&gt;\n {lower_channelkey}/history [start]\n {lower_channelkey} off - mutes the channel\n {lower_channelkey} on - unmutes the channel\n\n Switch:\n history: View 20 previous messages, either from the end or\n from &lt;start&gt; number of messages from the end.\n\n Example:\n {lower_channelkey} Hello World!\n {lower_channelkey}/history\n {lower_channelkey}/history 30\n\n '}</em><a class="headerlink" href="#evennia.comms.channelhandler.ChannelCommand.search_index_entry" title="Permalink to this definition"></a></dt>
<dd></dd></dl>
</dd></dl>
<dl class="py class">

View file

@ -402,6 +402,11 @@ available to the command</p>
<code class="sig-name descname">lock_storage</code><em class="property"> = 'cmd:all();'</em><a class="headerlink" href="#evennia.contrib.barter.CmdTradeBase.lock_storage" title="Permalink to this definition"></a></dt>
<dd></dd></dl>
<dl class="py attribute">
<dt id="evennia.contrib.barter.CmdTradeBase.search_index_entry">
<code class="sig-name descname">search_index_entry</code><em class="property"> = {'aliases': '', 'category': 'general', 'key': 'command', 'tags': '', 'text': '\n Base command for Trade commands to inherit from. Implements the\n custom parsing.\n '}</em><a class="headerlink" href="#evennia.contrib.barter.CmdTradeBase.search_index_entry" title="Permalink to this definition"></a></dt>
<dd></dd></dl>
</dd></dl>
<dl class="py class">
@ -445,6 +450,11 @@ available to the command</p>
<code class="sig-name descname">lock_storage</code><em class="property"> = 'cmd:all()'</em><a class="headerlink" href="#evennia.contrib.barter.CmdTradeHelp.lock_storage" title="Permalink to this definition"></a></dt>
<dd></dd></dl>
<dl class="py attribute">
<dt id="evennia.contrib.barter.CmdTradeHelp.search_index_entry">
<code class="sig-name descname">search_index_entry</code><em class="property"> = {'aliases': '', 'category': 'trade', 'key': 'trade help', 'tags': '', 'text': '\n help command for the trade system.\n\n Usage:\n trade help\n\n Displays help for the trade commands.\n '}</em><a class="headerlink" href="#evennia.contrib.barter.CmdTradeHelp.search_index_entry" title="Permalink to this definition"></a></dt>
<dd></dd></dl>
</dd></dl>
<dl class="py class">
@ -489,6 +499,11 @@ standing offer.</p>
<code class="sig-name descname">lock_storage</code><em class="property"> = 'cmd:all()'</em><a class="headerlink" href="#evennia.contrib.barter.CmdOffer.lock_storage" title="Permalink to this definition"></a></dt>
<dd></dd></dl>
<dl class="py attribute">
<dt id="evennia.contrib.barter.CmdOffer.search_index_entry">
<code class="sig-name descname">search_index_entry</code><em class="property"> = {'aliases': '', 'category': 'trading', 'key': 'offer', 'tags': '', 'text': '\n offer one or more items in trade.\n\n Usage:\n offer &lt;object&gt; [, object2, ...][:emote]\n\n Offer objects in trade. This will replace the currently\n standing offer.\n '}</em><a class="headerlink" href="#evennia.contrib.barter.CmdOffer.search_index_entry" title="Permalink to this definition"></a></dt>
<dd></dd></dl>
</dd></dl>
<dl class="py class">
@ -536,6 +551,11 @@ the current offer using the offers command.</p>
<code class="sig-name descname">lock_storage</code><em class="property"> = 'cmd:all()'</em><a class="headerlink" href="#evennia.contrib.barter.CmdAccept.lock_storage" title="Permalink to this definition"></a></dt>
<dd></dd></dl>
<dl class="py attribute">
<dt id="evennia.contrib.barter.CmdAccept.search_index_entry">
<code class="sig-name descname">search_index_entry</code><em class="property"> = {'aliases': 'agree', 'category': 'trading', 'key': 'accept', 'tags': '', 'text': &quot;\n accept the standing offer\n\n Usage:\n accept [:emote]\n agreee [:emote]\n\n This will accept the current offer. The other party must also accept\n for the deal to go through. You can use the 'decline' command to change\n your mind as long as the other party has not yet accepted. You can inspect\n the current offer using the 'offers' command.\n &quot;}</em><a class="headerlink" href="#evennia.contrib.barter.CmdAccept.search_index_entry" title="Permalink to this definition"></a></dt>
<dd></dd></dl>
</dd></dl>
<dl class="py class">
@ -582,6 +602,11 @@ decline the old offer.</p>
<code class="sig-name descname">lock_storage</code><em class="property"> = 'cmd:all()'</em><a class="headerlink" href="#evennia.contrib.barter.CmdDecline.lock_storage" title="Permalink to this definition"></a></dt>
<dd></dd></dl>
<dl class="py attribute">
<dt id="evennia.contrib.barter.CmdDecline.search_index_entry">
<code class="sig-name descname">search_index_entry</code><em class="property"> = {'aliases': '', 'category': 'trading', 'key': 'decline', 'tags': '', 'text': &quot;\n decline the standing offer\n\n Usage:\n decline [:emote]\n\n This will decline a previously 'accept'ed offer (so this allows you to\n change your mind). You can only use this as long as the other party\n has not yet accepted the deal. Also, changing the offer will automatically\n decline the old offer.\n &quot;}</em><a class="headerlink" href="#evennia.contrib.barter.CmdDecline.search_index_entry" title="Permalink to this definition"></a></dt>
<dd></dd></dl>
</dd></dl>
<dl class="py class">
@ -626,6 +651,11 @@ determine if its worth your while.</p>
<code class="sig-name descname">lock_storage</code><em class="property"> = 'cmd:all()'</em><a class="headerlink" href="#evennia.contrib.barter.CmdEvaluate.lock_storage" title="Permalink to this definition"></a></dt>
<dd></dd></dl>
<dl class="py attribute">
<dt id="evennia.contrib.barter.CmdEvaluate.search_index_entry">
<code class="sig-name descname">search_index_entry</code><em class="property"> = {'aliases': 'eval', 'category': 'trading', 'key': 'evaluate', 'tags': '', 'text': &quot;\n evaluate objects on offer\n\n Usage:\n evaluate &lt;offered object&gt;\n\n This allows you to examine any object currently on offer, to\n determine if it's worth your while.\n &quot;}</em><a class="headerlink" href="#evennia.contrib.barter.CmdEvaluate.search_index_entry" title="Permalink to this definition"></a></dt>
<dd></dd></dl>
</dd></dl>
<dl class="py class">
@ -650,7 +680,7 @@ try to influence the other part in the deal.</p>
<dl class="py attribute">
<dt id="evennia.contrib.barter.CmdStatus.aliases">
<code class="sig-name descname">aliases</code><em class="property"> = ['offers', 'deal']</em><a class="headerlink" href="#evennia.contrib.barter.CmdStatus.aliases" title="Permalink to this definition"></a></dt>
<code class="sig-name descname">aliases</code><em class="property"> = ['deal', 'offers']</em><a class="headerlink" href="#evennia.contrib.barter.CmdStatus.aliases" title="Permalink to this definition"></a></dt>
<dd></dd></dl>
<dl class="py attribute">
@ -674,6 +704,11 @@ try to influence the other part in the deal.</p>
<code class="sig-name descname">lock_storage</code><em class="property"> = 'cmd:all()'</em><a class="headerlink" href="#evennia.contrib.barter.CmdStatus.lock_storage" title="Permalink to this definition"></a></dt>
<dd></dd></dl>
<dl class="py attribute">
<dt id="evennia.contrib.barter.CmdStatus.search_index_entry">
<code class="sig-name descname">search_index_entry</code><em class="property"> = {'aliases': 'deal offers', 'category': 'trading', 'key': 'status', 'tags': '', 'text': &quot;\n show a list of the current deal\n\n Usage:\n status\n deal\n offers\n\n Shows the currently suggested offers on each sides of the deal. To\n accept the current deal, use the 'accept' command. Use 'offer' to\n change your deal. You might also want to use 'say', 'emote' etc to\n try to influence the other part in the deal.\n &quot;}</em><a class="headerlink" href="#evennia.contrib.barter.CmdStatus.search_index_entry" title="Permalink to this definition"></a></dt>
<dd></dd></dl>
</dd></dl>
<dl class="py class">
@ -718,6 +753,11 @@ finish trade [:say]</p>
<code class="sig-name descname">lock_storage</code><em class="property"> = 'cmd:all()'</em><a class="headerlink" href="#evennia.contrib.barter.CmdFinish.lock_storage" title="Permalink to this definition"></a></dt>
<dd></dd></dl>
<dl class="py attribute">
<dt id="evennia.contrib.barter.CmdFinish.search_index_entry">
<code class="sig-name descname">search_index_entry</code><em class="property"> = {'aliases': 'finish trade', 'category': 'trading', 'key': 'end trade', 'tags': '', 'text': '\n end the trade prematurely\n\n Usage:\n end trade [:say]\n finish trade [:say]\n\n This ends the trade prematurely. No trade will take place.\n\n '}</em><a class="headerlink" href="#evennia.contrib.barter.CmdFinish.search_index_entry" title="Permalink to this definition"></a></dt>
<dd></dd></dl>
</dd></dl>
<dl class="py class">
@ -792,6 +832,11 @@ info to your choice.</p>
<code class="sig-name descname">lock_storage</code><em class="property"> = 'cmd:all()'</em><a class="headerlink" href="#evennia.contrib.barter.CmdTrade.lock_storage" title="Permalink to this definition"></a></dt>
<dd></dd></dl>
<dl class="py attribute">
<dt id="evennia.contrib.barter.CmdTrade.search_index_entry">
<code class="sig-name descname">search_index_entry</code><em class="property"> = {'aliases': 'barter', 'category': 'general', 'key': 'trade', 'tags': '', 'text': '\n Initiate trade with another party\n\n Usage:\n trade &lt;other party&gt; [:say]\n trade &lt;other party&gt; accept [:say]\n trade &lt;other party&gt; decline [:say]\n\n Initiate trade with another party. The other party needs to repeat\n this command with trade accept/decline within a minute in order to\n properly initiate the trade action. You can use the decline option\n yourself if you want to retract an already suggested trade. The\n optional say part works like the say command and allows you to add\n info to your choice.\n '}</em><a class="headerlink" href="#evennia.contrib.barter.CmdTrade.search_index_entry" title="Permalink to this definition"></a></dt>
<dd></dd></dl>
</dd></dl>
</div>

View file

@ -250,6 +250,11 @@ overloading evential same-named class properties.</p>
<code class="sig-name descname">lock_storage</code><em class="property"> = 'cmd:all()'</em><a class="headerlink" href="#evennia.contrib.building_menu.CmdNoInput.lock_storage" title="Permalink to this definition"></a></dt>
<dd></dd></dl>
<dl class="py attribute">
<dt id="evennia.contrib.building_menu.CmdNoInput.search_index_entry">
<code class="sig-name descname">search_index_entry</code><em class="property"> = {'aliases': '', 'category': 'general', 'key': '__noinput_command', 'tags': '', 'text': 'No input has been found.'}</em><a class="headerlink" href="#evennia.contrib.building_menu.CmdNoInput.search_index_entry" title="Permalink to this definition"></a></dt>
<dd></dd></dl>
</dd></dl>
<dl class="py class">
@ -296,6 +301,11 @@ overloading evential same-named class properties.</p>
<code class="sig-name descname">lock_storage</code><em class="property"> = 'cmd:all()'</em><a class="headerlink" href="#evennia.contrib.building_menu.CmdNoMatch.lock_storage" title="Permalink to this definition"></a></dt>
<dd></dd></dl>
<dl class="py attribute">
<dt id="evennia.contrib.building_menu.CmdNoMatch.search_index_entry">
<code class="sig-name descname">search_index_entry</code><em class="property"> = {'aliases': '', 'category': 'general', 'key': '__nomatch_command', 'tags': '', 'text': 'No input has been found.'}</em><a class="headerlink" href="#evennia.contrib.building_menu.CmdNoMatch.search_index_entry" title="Permalink to this definition"></a></dt>
<dd></dd></dl>
</dd></dl>
<dl class="py class">
@ -860,6 +870,11 @@ set in self.parse())</p>
<code class="sig-name descname">lock_storage</code><em class="property"> = 'cmd:all();'</em><a class="headerlink" href="#evennia.contrib.building_menu.GenericBuildingCmd.lock_storage" title="Permalink to this definition"></a></dt>
<dd></dd></dl>
<dl class="py attribute">
<dt id="evennia.contrib.building_menu.GenericBuildingCmd.search_index_entry">
<code class="sig-name descname">search_index_entry</code><em class="property"> = {'aliases': '', 'category': 'general', 'key': '&#64;edit', 'tags': '', 'text': &quot;\n Generic building command.\n\n Syntax:\n &#64;edit [object]\n\n Open a building menu to edit the specified object. This menu allows to\n change the object's key and description.\n\n Examples:\n &#64;edit here\n &#64;edit self\n &#64;edit #142\n\n &quot;}</em><a class="headerlink" href="#evennia.contrib.building_menu.GenericBuildingCmd.search_index_entry" title="Permalink to this definition"></a></dt>
<dd></dd></dl>
</dd></dl>
</div>

View file

@ -106,6 +106,11 @@ that is checked by the &#64;ic command directly.</p>
<code class="sig-name descname">lock_storage</code><em class="property"> = 'cmd:all()'</em><a class="headerlink" href="#evennia.contrib.chargen.CmdOOCLook.lock_storage" title="Permalink to this definition"></a></dt>
<dd></dd></dl>
<dl class="py attribute">
<dt id="evennia.contrib.chargen.CmdOOCLook.search_index_entry">
<code class="sig-name descname">search_index_entry</code><em class="property"> = {'aliases': 'l ls', 'category': 'general', 'key': 'look', 'tags': '', 'text': '\n ooc look\n\n Usage:\n look\n look &lt;character&gt;\n\n This is an OOC version of the look command. Since an Account doesn\'t\n have an in-game existence, there is no concept of location or\n &quot;self&quot;.\n\n If any characters are available for you to control, you may look\n at them with this command.\n '}</em><a class="headerlink" href="#evennia.contrib.chargen.CmdOOCLook.search_index_entry" title="Permalink to this definition"></a></dt>
<dd></dd></dl>
</dd></dl>
<dl class="py class">
@ -151,6 +156,11 @@ attribute on ourselves to remember it.</p>
<code class="sig-name descname">lock_storage</code><em class="property"> = 'cmd:all()'</em><a class="headerlink" href="#evennia.contrib.chargen.CmdOOCCharacterCreate.lock_storage" title="Permalink to this definition"></a></dt>
<dd></dd></dl>
<dl class="py attribute">
<dt id="evennia.contrib.chargen.CmdOOCCharacterCreate.search_index_entry">
<code class="sig-name descname">search_index_entry</code><em class="property"> = {'aliases': '', 'category': 'general', 'key': 'create', 'tags': '', 'text': '\n creates a character\n\n Usage:\n create &lt;character name&gt;\n\n This will create a new character, assuming\n the given character name does not already exist.\n '}</em><a class="headerlink" href="#evennia.contrib.chargen.CmdOOCCharacterCreate.search_index_entry" title="Permalink to this definition"></a></dt>
<dd></dd></dl>
</dd></dl>
<dl class="py class">

View file

@ -358,6 +358,11 @@ provide will be displayed after the clothings name.</p>
<code class="sig-name descname">lock_storage</code><em class="property"> = 'cmd:all();'</em><a class="headerlink" href="#evennia.contrib.clothing.CmdWear.lock_storage" title="Permalink to this definition"></a></dt>
<dd></dd></dl>
<dl class="py attribute">
<dt id="evennia.contrib.clothing.CmdWear.search_index_entry">
<code class="sig-name descname">search_index_entry</code><em class="property"> = {'aliases': '', 'category': 'clothing', 'key': 'wear', 'tags': '', 'text': &quot;\n Puts on an item of clothing you are holding.\n\n Usage:\n wear &lt;obj&gt; [wear style]\n\n Examples:\n wear shirt\n wear scarf wrapped loosely about the shoulders\n\n All the clothes you are wearing are appended to your description.\n If you provide a 'wear style' after the command, the message you\n provide will be displayed after the clothing's name.\n &quot;}</em><a class="headerlink" href="#evennia.contrib.clothing.CmdWear.search_index_entry" title="Permalink to this definition"></a></dt>
<dd></dd></dl>
</dd></dl>
<dl class="py class">
@ -398,6 +403,11 @@ off the covering item first.</p>
<code class="sig-name descname">lock_storage</code><em class="property"> = 'cmd:all();'</em><a class="headerlink" href="#evennia.contrib.clothing.CmdRemove.lock_storage" title="Permalink to this definition"></a></dt>
<dd></dd></dl>
<dl class="py attribute">
<dt id="evennia.contrib.clothing.CmdRemove.search_index_entry">
<code class="sig-name descname">search_index_entry</code><em class="property"> = {'aliases': '', 'category': 'clothing', 'key': 'remove', 'tags': '', 'text': &quot;\n Takes off an item of clothing.\n\n Usage:\n remove &lt;obj&gt;\n\n Removes an item of clothing you are wearing. You can't remove\n clothes that are covered up by something else - you must take\n off the covering item first.\n &quot;}</em><a class="headerlink" href="#evennia.contrib.clothing.CmdRemove.search_index_entry" title="Permalink to this definition"></a></dt>
<dd></dd></dl>
</dd></dl>
<dl class="py class">
@ -438,6 +448,11 @@ You cant remove an item of clothing if its covered.</p>
<code class="sig-name descname">lock_storage</code><em class="property"> = 'cmd:all();'</em><a class="headerlink" href="#evennia.contrib.clothing.CmdCover.lock_storage" title="Permalink to this definition"></a></dt>
<dd></dd></dl>
<dl class="py attribute">
<dt id="evennia.contrib.clothing.CmdCover.search_index_entry">
<code class="sig-name descname">search_index_entry</code><em class="property"> = {'aliases': '', 'category': 'clothing', 'key': 'cover', 'tags': '', 'text': &quot;\n Covers a worn item of clothing with another you're holding or wearing.\n\n Usage:\n cover &lt;obj&gt; [with] &lt;obj&gt;\n\n When you cover a clothing item, it is hidden and no longer appears in\n your description until it's uncovered or the item covering it is removed.\n You can't remove an item of clothing if it's covered.\n &quot;}</em><a class="headerlink" href="#evennia.contrib.clothing.CmdCover.search_index_entry" title="Permalink to this definition"></a></dt>
<dd></dd></dl>
</dd></dl>
<dl class="py class">
@ -479,6 +494,11 @@ it is also covered by something else.</p>
<code class="sig-name descname">lock_storage</code><em class="property"> = 'cmd:all();'</em><a class="headerlink" href="#evennia.contrib.clothing.CmdUncover.lock_storage" title="Permalink to this definition"></a></dt>
<dd></dd></dl>
<dl class="py attribute">
<dt id="evennia.contrib.clothing.CmdUncover.search_index_entry">
<code class="sig-name descname">search_index_entry</code><em class="property"> = {'aliases': '', 'category': 'clothing', 'key': 'uncover', 'tags': '', 'text': &quot;\n Reveals a worn item of clothing that's currently covered up.\n\n Usage:\n uncover &lt;obj&gt;\n\n When you uncover an item of clothing, you allow it to appear in your\n description without having to take off the garment that's currently\n covering it. You can't uncover an item of clothing if the item covering\n it is also covered by something else.\n &quot;}</em><a class="headerlink" href="#evennia.contrib.clothing.CmdUncover.search_index_entry" title="Permalink to this definition"></a></dt>
<dd></dd></dl>
</dd></dl>
<dl class="py class">
@ -528,6 +548,11 @@ location you are currently in.</p>
<code class="sig-name descname">lock_storage</code><em class="property"> = 'cmd:all()'</em><a class="headerlink" href="#evennia.contrib.clothing.CmdDrop.lock_storage" title="Permalink to this definition"></a></dt>
<dd></dd></dl>
<dl class="py attribute">
<dt id="evennia.contrib.clothing.CmdDrop.search_index_entry">
<code class="sig-name descname">search_index_entry</code><em class="property"> = {'aliases': '', 'category': 'general', 'key': 'drop', 'tags': '', 'text': '\n drop something\n\n Usage:\n drop &lt;obj&gt;\n\n Lets you drop an object from your inventory into the\n location you are currently in.\n '}</em><a class="headerlink" href="#evennia.contrib.clothing.CmdDrop.search_index_entry" title="Permalink to this definition"></a></dt>
<dd></dd></dl>
</dd></dl>
<dl class="py class">
@ -577,6 +602,11 @@ placing it in their inventory.</p>
<code class="sig-name descname">lock_storage</code><em class="property"> = 'cmd:all()'</em><a class="headerlink" href="#evennia.contrib.clothing.CmdGive.lock_storage" title="Permalink to this definition"></a></dt>
<dd></dd></dl>
<dl class="py attribute">
<dt id="evennia.contrib.clothing.CmdGive.search_index_entry">
<code class="sig-name descname">search_index_entry</code><em class="property"> = {'aliases': '', 'category': 'general', 'key': 'give', 'tags': '', 'text': '\n give away something to someone\n\n Usage:\n give &lt;inventory obj&gt; = &lt;target&gt;\n\n Gives an items from your inventory to another character,\n placing it in their inventory.\n '}</em><a class="headerlink" href="#evennia.contrib.clothing.CmdGive.search_index_entry" title="Permalink to this definition"></a></dt>
<dd></dd></dl>
</dd></dl>
<dl class="py class">
@ -597,7 +627,7 @@ inv</p>
<dl class="py attribute">
<dt id="evennia.contrib.clothing.CmdInventory.aliases">
<code class="sig-name descname">aliases</code><em class="property"> = ['inv', 'i']</em><a class="headerlink" href="#evennia.contrib.clothing.CmdInventory.aliases" title="Permalink to this definition"></a></dt>
<code class="sig-name descname">aliases</code><em class="property"> = ['i', 'inv']</em><a class="headerlink" href="#evennia.contrib.clothing.CmdInventory.aliases" title="Permalink to this definition"></a></dt>
<dd></dd></dl>
<dl class="py attribute">
@ -626,6 +656,11 @@ inv</p>
<code class="sig-name descname">lock_storage</code><em class="property"> = 'cmd:all()'</em><a class="headerlink" href="#evennia.contrib.clothing.CmdInventory.lock_storage" title="Permalink to this definition"></a></dt>
<dd></dd></dl>
<dl class="py attribute">
<dt id="evennia.contrib.clothing.CmdInventory.search_index_entry">
<code class="sig-name descname">search_index_entry</code><em class="property"> = {'aliases': 'i inv', 'category': 'general', 'key': 'inventory', 'tags': '', 'text': '\n view inventory\n\n Usage:\n inventory\n inv\n\n Shows your inventory.\n '}</em><a class="headerlink" href="#evennia.contrib.clothing.CmdInventory.search_index_entry" title="Permalink to this definition"></a></dt>
<dd></dd></dl>
</dd></dl>
<dl class="py class">

View file

@ -172,6 +172,11 @@ everyone but the person rolling.</p>
<code class="sig-name descname">lock_storage</code><em class="property"> = 'cmd:all()'</em><a class="headerlink" href="#evennia.contrib.dice.CmdDice.lock_storage" title="Permalink to this definition"></a></dt>
<dd></dd></dl>
<dl class="py attribute">
<dt id="evennia.contrib.dice.CmdDice.search_index_entry">
<code class="sig-name descname">search_index_entry</code><em class="property"> = {'aliases': 'roll &#64;dice', 'category': 'general', 'key': 'dice', 'tags': '', 'text': &quot;\n roll dice\n\n Usage:\n dice[/switch] &lt;nr&gt;d&lt;sides&gt; [modifier] [success condition]\n\n Switch:\n hidden - tell the room the roll is being done, but don't show the result\n secret - don't inform the room about neither roll nor result\n\n Examples:\n dice 3d6 + 4\n dice 1d100 - 2 &lt; 50\n\n This will roll the given number of dice with given sides and modifiers.\n So e.g. 2d6 + 3 means to 'roll a 6-sided die 2 times and add the result,\n then add 3 to the total'.\n Accepted modifiers are +, -, * and /.\n A success condition is given as normal Python conditionals\n (&lt;,&gt;,&lt;=,&gt;=,==,!=). So e.g. 2d6 + 3 &gt; 10 means that the roll will succeed\n only if the final result is above 8. If a success condition is given, the\n outcome (pass/fail) will be echoed along with how much it succeeded/failed\n with. The hidden/secret switches will hide all or parts of the roll from\n everyone but the person rolling.\n &quot;}</em><a class="headerlink" href="#evennia.contrib.dice.CmdDice.search_index_entry" title="Permalink to this definition"></a></dt>
<dd></dd></dl>
</dd></dl>
<dl class="py class">

View file

@ -73,7 +73,7 @@ the module given by settings.CONNECTION_SCREEN_MODULE.</p>
<dl class="py attribute">
<dt id="evennia.contrib.email_login.CmdUnconnectedConnect.aliases">
<code class="sig-name descname">aliases</code><em class="property"> = ['con', 'conn', 'co']</em><a class="headerlink" href="#evennia.contrib.email_login.CmdUnconnectedConnect.aliases" title="Permalink to this definition"></a></dt>
<code class="sig-name descname">aliases</code><em class="property"> = ['conn', 'con', 'co']</em><a class="headerlink" href="#evennia.contrib.email_login.CmdUnconnectedConnect.aliases" title="Permalink to this definition"></a></dt>
<dd></dd></dl>
<dl class="py attribute">
@ -101,6 +101,11 @@ there is no object yet before the account has logged in)</p>
<code class="sig-name descname">lock_storage</code><em class="property"> = 'cmd:all()'</em><a class="headerlink" href="#evennia.contrib.email_login.CmdUnconnectedConnect.lock_storage" title="Permalink to this definition"></a></dt>
<dd></dd></dl>
<dl class="py attribute">
<dt id="evennia.contrib.email_login.CmdUnconnectedConnect.search_index_entry">
<code class="sig-name descname">search_index_entry</code><em class="property"> = {'aliases': 'conn con co', 'category': 'general', 'key': 'connect', 'tags': '', 'text': '\n Connect to the game.\n\n Usage (at login screen):\n connect &lt;email&gt; &lt;password&gt;\n\n Use the create command to first create an account before logging in.\n '}</em><a class="headerlink" href="#evennia.contrib.email_login.CmdUnconnectedConnect.search_index_entry" title="Permalink to this definition"></a></dt>
<dd></dd></dl>
</dd></dl>
<dl class="py class">
@ -120,7 +125,7 @@ there is no object yet before the account has logged in)</p>
<dl class="py attribute">
<dt id="evennia.contrib.email_login.CmdUnconnectedCreate.aliases">
<code class="sig-name descname">aliases</code><em class="property"> = ['cre', 'cr']</em><a class="headerlink" href="#evennia.contrib.email_login.CmdUnconnectedCreate.aliases" title="Permalink to this definition"></a></dt>
<code class="sig-name descname">aliases</code><em class="property"> = ['cr', 'cre']</em><a class="headerlink" href="#evennia.contrib.email_login.CmdUnconnectedCreate.aliases" title="Permalink to this definition"></a></dt>
<dd></dd></dl>
<dl class="py attribute">
@ -154,6 +159,11 @@ name enclosed in quotes:</p>
<code class="sig-name descname">lock_storage</code><em class="property"> = 'cmd:all()'</em><a class="headerlink" href="#evennia.contrib.email_login.CmdUnconnectedCreate.lock_storage" title="Permalink to this definition"></a></dt>
<dd></dd></dl>
<dl class="py attribute">
<dt id="evennia.contrib.email_login.CmdUnconnectedCreate.search_index_entry">
<code class="sig-name descname">search_index_entry</code><em class="property"> = {'aliases': 'cr cre', 'category': 'general', 'key': 'create', 'tags': '', 'text': '\n Create a new account.\n\n Usage (at login screen):\n create &quot;accountname&quot; &lt;email&gt; &lt;password&gt;\n\n This creates a new account account.\n\n '}</em><a class="headerlink" href="#evennia.contrib.email_login.CmdUnconnectedCreate.search_index_entry" title="Permalink to this definition"></a></dt>
<dd></dd></dl>
</dd></dl>
<dl class="py class">
@ -194,6 +204,11 @@ version is a bit more complicated.</p>
<code class="sig-name descname">lock_storage</code><em class="property"> = 'cmd:all()'</em><a class="headerlink" href="#evennia.contrib.email_login.CmdUnconnectedQuit.lock_storage" title="Permalink to this definition"></a></dt>
<dd></dd></dl>
<dl class="py attribute">
<dt id="evennia.contrib.email_login.CmdUnconnectedQuit.search_index_entry">
<code class="sig-name descname">search_index_entry</code><em class="property"> = {'aliases': 'q qu', 'category': 'general', 'key': 'quit', 'tags': '', 'text': '\n We maintain a different version of the `quit` command\n here for unconnected accounts for the sake of simplicity. The logged in\n version is a bit more complicated.\n '}</em><a class="headerlink" href="#evennia.contrib.email_login.CmdUnconnectedQuit.search_index_entry" title="Permalink to this definition"></a></dt>
<dd></dd></dl>
</dd></dl>
<dl class="py class">
@ -210,7 +225,7 @@ All it does is display the connect screen.</p>
<dl class="py attribute">
<dt id="evennia.contrib.email_login.CmdUnconnectedLook.aliases">
<code class="sig-name descname">aliases</code><em class="property"> = ['look', 'l']</em><a class="headerlink" href="#evennia.contrib.email_login.CmdUnconnectedLook.aliases" title="Permalink to this definition"></a></dt>
<code class="sig-name descname">aliases</code><em class="property"> = ['l', 'look']</em><a class="headerlink" href="#evennia.contrib.email_login.CmdUnconnectedLook.aliases" title="Permalink to this definition"></a></dt>
<dd></dd></dl>
<dl class="py attribute">
@ -234,6 +249,11 @@ All it does is display the connect screen.</p>
<code class="sig-name descname">lock_storage</code><em class="property"> = 'cmd:all()'</em><a class="headerlink" href="#evennia.contrib.email_login.CmdUnconnectedLook.lock_storage" title="Permalink to this definition"></a></dt>
<dd></dd></dl>
<dl class="py attribute">
<dt id="evennia.contrib.email_login.CmdUnconnectedLook.search_index_entry">
<code class="sig-name descname">search_index_entry</code><em class="property"> = {'aliases': 'l look', 'category': 'general', 'key': '__unloggedin_look_command', 'tags': '', 'text': '\n This is an unconnected version of the `look` command for simplicity.\n\n This is called by the server and kicks everything in gear.\n All it does is display the connect screen.\n '}</em><a class="headerlink" href="#evennia.contrib.email_login.CmdUnconnectedLook.search_index_entry" title="Permalink to this definition"></a></dt>
<dd></dd></dl>
</dd></dl>
<dl class="py class">
@ -249,7 +269,7 @@ for simplicity. It shows a pane of info.</p>
<dl class="py attribute">
<dt id="evennia.contrib.email_login.CmdUnconnectedHelp.aliases">
<code class="sig-name descname">aliases</code><em class="property"> = ['h', '?']</em><a class="headerlink" href="#evennia.contrib.email_login.CmdUnconnectedHelp.aliases" title="Permalink to this definition"></a></dt>
<code class="sig-name descname">aliases</code><em class="property"> = ['?', 'h']</em><a class="headerlink" href="#evennia.contrib.email_login.CmdUnconnectedHelp.aliases" title="Permalink to this definition"></a></dt>
<dd></dd></dl>
<dl class="py attribute">
@ -273,6 +293,11 @@ for simplicity. It shows a pane of info.</p>
<code class="sig-name descname">lock_storage</code><em class="property"> = 'cmd:all()'</em><a class="headerlink" href="#evennia.contrib.email_login.CmdUnconnectedHelp.lock_storage" title="Permalink to this definition"></a></dt>
<dd></dd></dl>
<dl class="py attribute">
<dt id="evennia.contrib.email_login.CmdUnconnectedHelp.search_index_entry">
<code class="sig-name descname">search_index_entry</code><em class="property"> = {'aliases': '? h', 'category': 'general', 'key': 'help', 'tags': '', 'text': '\n This is an unconnected version of the help command,\n for simplicity. It shows a pane of info.\n '}</em><a class="headerlink" href="#evennia.contrib.email_login.CmdUnconnectedHelp.search_index_entry" title="Permalink to this definition"></a></dt>
<dd></dd></dl>
</dd></dl>
</div>

View file

@ -293,6 +293,11 @@ look <a href="#id1"><span class="problematic" id="id2">*</span></a>&lt;account&g
<code class="sig-name descname">lock_storage</code><em class="property"> = 'cmd:all()'</em><a class="headerlink" href="#evennia.contrib.extended_room.CmdExtendedRoomLook.lock_storage" title="Permalink to this definition"></a></dt>
<dd></dd></dl>
<dl class="py attribute">
<dt id="evennia.contrib.extended_room.CmdExtendedRoomLook.search_index_entry">
<code class="sig-name descname">search_index_entry</code><em class="property"> = {'aliases': 'l ls', 'category': 'general', 'key': 'look', 'tags': '', 'text': '\n look\n\n Usage:\n look\n look &lt;obj&gt;\n look &lt;room detail&gt;\n look *&lt;account&gt;\n\n Observes your location, details at your location or objects in your vicinity.\n '}</em><a class="headerlink" href="#evennia.contrib.extended_room.CmdExtendedRoomLook.search_index_entry" title="Permalink to this definition"></a></dt>
<dd></dd></dl>
</dd></dl>
<dl class="py class">
@ -356,6 +361,11 @@ version of the <strong>desc</strong> command.</p>
<code class="sig-name descname">lock_storage</code><em class="property"> = 'cmd:perm(desc) or perm(Builder)'</em><a class="headerlink" href="#evennia.contrib.extended_room.CmdExtendedRoomDesc.lock_storage" title="Permalink to this definition"></a></dt>
<dd></dd></dl>
<dl class="py attribute">
<dt id="evennia.contrib.extended_room.CmdExtendedRoomDesc.search_index_entry">
<code class="sig-name descname">search_index_entry</code><em class="property"> = {'aliases': 'describe', 'category': 'building', 'key': 'desc', 'tags': '', 'text': '\n `desc` - describe an object or room.\n\n Usage:\n desc[/switch] [&lt;obj&gt; =] &lt;description&gt;\n\n Switches for `desc`:\n spring - set description for &lt;season&gt; in current room.\n summer\n autumn\n winter\n\n Sets the &quot;desc&quot; attribute on an object. If an object is not given,\n describe the current room.\n\n You can also embed special time markers in your room description, like this:\n\n ```\n &lt;night&gt;In the darkness, the forest looks foreboding.&lt;/night&gt;.\n ```\n\n Text marked this way will only display when the server is truly at the given\n timeslot. The available times are night, morning, afternoon and evening.\n\n Note that seasons and time-of-day slots only work on rooms in this\n version of the `desc` command.\n\n '}</em><a class="headerlink" href="#evennia.contrib.extended_room.CmdExtendedRoomDesc.search_index_entry" title="Permalink to this definition"></a></dt>
<dd></dd></dl>
</dd></dl>
<dl class="py class">
@ -414,6 +424,11 @@ to all the variables defined therein.</p>
<code class="sig-name descname">lock_storage</code><em class="property"> = 'cmd:perm(Builder)'</em><a class="headerlink" href="#evennia.contrib.extended_room.CmdExtendedRoomDetail.lock_storage" title="Permalink to this definition"></a></dt>
<dd></dd></dl>
<dl class="py attribute">
<dt id="evennia.contrib.extended_room.CmdExtendedRoomDetail.search_index_entry">
<code class="sig-name descname">search_index_entry</code><em class="property"> = {'aliases': '', 'category': 'building', 'key': '&#64;detail', 'tags': '', 'text': '\n sets a detail on a room\n\n Usage:\n &#64;detail[/del] &lt;key&gt; [= &lt;description&gt;]\n &#64;detail &lt;key&gt;;&lt;alias&gt;;... = description\n\n Example:\n &#64;detail\n &#64;detail walls = The walls are covered in ...\n &#64;detail castle;ruin;tower = The distant ruin ...\n &#64;detail/del wall\n &#64;detail/del castle;ruin;tower\n\n This command allows to show the current room details if you enter it\n without any argument. Otherwise, sets or deletes a detail on the current\n room, if this room supports details like an extended room. To add new\n detail, just use the &#64;detail command, specifying the key, an equal sign\n and the description. You can assign the same description to several\n details using the alias syntax (replace key by alias1;alias2;alias3;...).\n To remove one or several details, use the &#64;detail/del switch.\n\n '}</em><a class="headerlink" href="#evennia.contrib.extended_room.CmdExtendedRoomDetail.search_index_entry" title="Permalink to this definition"></a></dt>
<dd></dd></dl>
</dd></dl>
<dl class="py class">
@ -457,6 +472,11 @@ to all the variables defined therein.</p>
<code class="sig-name descname">lock_storage</code><em class="property"> = 'cmd:all()'</em><a class="headerlink" href="#evennia.contrib.extended_room.CmdExtendedRoomGameTime.lock_storage" title="Permalink to this definition"></a></dt>
<dd></dd></dl>
<dl class="py attribute">
<dt id="evennia.contrib.extended_room.CmdExtendedRoomGameTime.search_index_entry">
<code class="sig-name descname">search_index_entry</code><em class="property"> = {'aliases': '', 'category': 'general', 'key': 'time', 'tags': '', 'text': '\n Check the game time\n\n Usage:\n time\n\n Shows the current in-game time and season.\n '}</em><a class="headerlink" href="#evennia.contrib.extended_room.CmdExtendedRoomGameTime.search_index_entry" title="Permalink to this definition"></a></dt>
<dd></dd></dl>
</dd></dl>
<dl class="py class">

View file

@ -363,6 +363,11 @@ send</p>
<code class="sig-name descname">lock_storage</code><em class="property"> = 'cmd:all();'</em><a class="headerlink" href="#evennia.contrib.fieldfill.CmdTestMenu.lock_storage" title="Permalink to this definition"></a></dt>
<dd></dd></dl>
<dl class="py attribute">
<dt id="evennia.contrib.fieldfill.CmdTestMenu.search_index_entry">
<code class="sig-name descname">search_index_entry</code><em class="property"> = {'aliases': '', 'category': 'general', 'key': 'testmenu', 'tags': '', 'text': &quot;\n This test command will initialize a menu that presents you with a form.\n You can fill out the fields of this form in any order, and then type in\n 'send' to send a message to another online player, which will reach them\n after a delay you specify.\n\n Usage:\n &lt;field&gt; = &lt;new value&gt;\n clear &lt;field&gt;\n help\n look\n quit\n send\n &quot;}</em><a class="headerlink" href="#evennia.contrib.fieldfill.CmdTestMenu.search_index_entry" title="Permalink to this definition"></a></dt>
<dd></dd></dl>
</dd></dl>
<dl class="py function">

View file

@ -109,6 +109,11 @@ default cmdset before it becomes available.</p>
<code class="sig-name descname">lock_storage</code><em class="property"> = 'cmd:all();call:all()'</em><a class="headerlink" href="#evennia.contrib.gendersub.SetGender.lock_storage" title="Permalink to this definition"></a></dt>
<dd></dd></dl>
<dl class="py attribute">
<dt id="evennia.contrib.gendersub.SetGender.search_index_entry">
<code class="sig-name descname">search_index_entry</code><em class="property"> = {'aliases': '&#64;sex', 'category': 'general', 'key': '&#64;gender', 'tags': '', 'text': '\n Sets gender on yourself\n\n Usage:\n &#64;gender male||female||neutral||ambiguous\n\n '}</em><a class="headerlink" href="#evennia.contrib.gendersub.SetGender.search_index_entry" title="Permalink to this definition"></a></dt>
<dd></dd></dl>
</dd></dl>
<dl class="py class">

View file

@ -51,7 +51,7 @@
<dl class="py attribute">
<dt id="evennia.contrib.ingame_python.commands.CmdCallback.aliases">
<code class="sig-name descname">aliases</code><em class="property"> = ['&#64;callbacks', '&#64;calls', '&#64;callback']</em><a class="headerlink" href="#evennia.contrib.ingame_python.commands.CmdCallback.aliases" title="Permalink to this definition"></a></dt>
<code class="sig-name descname">aliases</code><em class="property"> = ['&#64;calls', '&#64;callback', '&#64;callbacks']</em><a class="headerlink" href="#evennia.contrib.ingame_python.commands.CmdCallback.aliases" title="Permalink to this definition"></a></dt>
<dd></dd></dl>
<dl class="py attribute">
@ -130,6 +130,11 @@ on user permission.</p>
<code class="sig-name descname">lock_storage</code><em class="property"> = 'cmd:perm(developer)'</em><a class="headerlink" href="#evennia.contrib.ingame_python.commands.CmdCallback.lock_storage" title="Permalink to this definition"></a></dt>
<dd></dd></dl>
<dl class="py attribute">
<dt id="evennia.contrib.ingame_python.commands.CmdCallback.search_index_entry">
<code class="sig-name descname">search_index_entry</code><em class="property"> = {'aliases': '&#64;calls &#64;callback &#64;callbacks', 'category': 'building', 'key': '&#64;call', 'tags': '', 'text': '\n Command to edit callbacks.\n '}</em><a class="headerlink" href="#evennia.contrib.ingame_python.commands.CmdCallback.search_index_entry" title="Permalink to this definition"></a></dt>
<dd></dd></dl>
</dd></dl>
</div>

View file

@ -217,6 +217,11 @@ the newly created mails.</p></li>
<code class="sig-name descname">lock_storage</code><em class="property"> = 'cmd:all();'</em><a class="headerlink" href="#evennia.contrib.mail.CmdMail.lock_storage" title="Permalink to this definition"></a></dt>
<dd></dd></dl>
<dl class="py attribute">
<dt id="evennia.contrib.mail.CmdMail.search_index_entry">
<code class="sig-name descname">search_index_entry</code><em class="property"> = {'aliases': 'mail', 'category': 'general', 'key': '&#64;mail', 'tags': '', 'text': '\n Communicate with others by sending mail.\n\n Usage:\n &#64;mail - Displays all the mail an account has in their mailbox\n &#64;mail &lt;#&gt; - Displays a specific message\n &#64;mail &lt;accounts&gt;=&lt;subject&gt;/&lt;message&gt;\n - Sends a message to the comma separated list of accounts.\n &#64;mail/delete &lt;#&gt; - Deletes a specific message\n &#64;mail/forward &lt;account list&gt;=&lt;#&gt;[/&lt;Message&gt;]\n - Forwards an existing message to the specified list of accounts,\n original message is delivered with optional Message prepended.\n &#64;mail/reply &lt;#&gt;=&lt;message&gt;\n - Replies to a message #. Prepends message to the original\n message text.\n Switches:\n delete - deletes a message\n forward - forward a received message to another object with an optional message attached.\n reply - Replies to a received message, appending the original message to the bottom.\n Examples:\n &#64;mail 2\n &#64;mail Griatch=New mail/Hey man, I am sending you a message!\n &#64;mail/delete 6\n &#64;mail/forward feend78 Griatch=4/You guys should read this.\n &#64;mail/reply 9=Thanks for the info!\n\n '}</em><a class="headerlink" href="#evennia.contrib.mail.CmdMail.search_index_entry" title="Permalink to this definition"></a></dt>
<dd></dd></dl>
</dd></dl>
<dl class="py class">
@ -285,6 +290,11 @@ reply - Replies to a received message, appending the original message to the b
<code class="sig-name descname">lock_storage</code><em class="property"> = 'cmd:all();'</em><a class="headerlink" href="#evennia.contrib.mail.CmdMailCharacter.lock_storage" title="Permalink to this definition"></a></dt>
<dd></dd></dl>
<dl class="py attribute">
<dt id="evennia.contrib.mail.CmdMailCharacter.search_index_entry">
<code class="sig-name descname">search_index_entry</code><em class="property"> = {'aliases': 'mail', 'category': 'general', 'key': '&#64;mail', 'tags': '', 'text': '\n Communicate with others by sending mail.\n\n Usage:\n &#64;mail - Displays all the mail an account has in their mailbox\n &#64;mail &lt;#&gt; - Displays a specific message\n &#64;mail &lt;accounts&gt;=&lt;subject&gt;/&lt;message&gt;\n - Sends a message to the comma separated list of accounts.\n &#64;mail/delete &lt;#&gt; - Deletes a specific message\n &#64;mail/forward &lt;account list&gt;=&lt;#&gt;[/&lt;Message&gt;]\n - Forwards an existing message to the specified list of accounts,\n original message is delivered with optional Message prepended.\n &#64;mail/reply &lt;#&gt;=&lt;message&gt;\n - Replies to a message #. Prepends message to the original\n message text.\n Switches:\n delete - deletes a message\n forward - forward a received message to another object with an optional message attached.\n reply - Replies to a received message, appending the original message to the bottom.\n Examples:\n &#64;mail 2\n &#64;mail Griatch=New mail/Hey man, I am sending you a message!\n &#64;mail/delete 6\n &#64;mail/forward feend78 Griatch=4/You guys should read this.\n &#64;mail/reply 9=Thanks for the info!\n\n '}</em><a class="headerlink" href="#evennia.contrib.mail.CmdMailCharacter.search_index_entry" title="Permalink to this definition"></a></dt>
<dd></dd></dl>
</dd></dl>
</div>

View file

@ -232,6 +232,11 @@ how many times the map is iterated over.</p>
<code class="sig-name descname">lock_storage</code><em class="property"> = 'cmd:superuser()'</em><a class="headerlink" href="#evennia.contrib.mapbuilder.CmdMapBuilder.lock_storage" title="Permalink to this definition"></a></dt>
<dd></dd></dl>
<dl class="py attribute">
<dt id="evennia.contrib.mapbuilder.CmdMapBuilder.search_index_entry">
<code class="sig-name descname">search_index_entry</code><em class="property"> = {'aliases': '&#64;buildmap', 'category': 'building', 'key': '&#64;mapbuilder', 'tags': '', 'text': '\n Build a map from a 2D ASCII map.\n\n Usage:\n &#64;mapbuilder[/switch] &lt;path.to.file.MAPNAME&gt; &lt;path.to.file.MAP_LEGEND&gt;\n\n Switches:\n one - execute build instructions once without automatic exit creation\n two - execute build instructions twice without automatic exit creation\n\n Example:\n &#64;mapbuilder world.gamemap.MAP world.maplegend.MAP_LEGEND\n &#64;mapbuilder evennia.contrib.mapbuilder.EXAMPLE1_MAP EXAMPLE1_LEGEND\n &#64;mapbuilder/two evennia.contrib.mapbuilder.EXAMPLE2_MAP EXAMPLE2_LEGEND\n (Legend path defaults to map path)\n\n This is a command which takes two inputs:\n A string of ASCII characters representing a map and a dictionary of\n functions containing build instructions. The characters of the map are\n iterated over and compared to a list of trigger characters. When a match\n is found the corresponding function is executed generating the rooms,\n exits and objects as defined by the users build instructions. If a\n character is not a match to a provided trigger character (including spaces)\n it is simply skipped and the process continues. By default exits are\n automatically generated but is turned off by switches which also determines\n how many times the map is iterated over.\n '}</em><a class="headerlink" href="#evennia.contrib.mapbuilder.CmdMapBuilder.search_index_entry" title="Permalink to this definition"></a></dt>
<dd></dd></dl>
</dd></dl>
</div>

View file

@ -141,6 +141,11 @@ to the menus own look command.</p>
<code class="sig-name descname">lock_storage</code><em class="property"> = 'cmd:all()'</em><a class="headerlink" href="#evennia.contrib.menu_login.CmdUnloggedinLook.lock_storage" title="Permalink to this definition"></a></dt>
<dd></dd></dl>
<dl class="py attribute">
<dt id="evennia.contrib.menu_login.CmdUnloggedinLook.search_index_entry">
<code class="sig-name descname">search_index_entry</code><em class="property"> = {'aliases': '', 'category': 'general', 'key': '__unloggedin_look_command', 'tags': '', 'text': &quot;\n An unloggedin version of the look command. This is called by the server\n when the account first connects. It sets up the menu before handing off\n to the menu's own look command.\n\n &quot;}</em><a class="headerlink" href="#evennia.contrib.menu_login.CmdUnloggedinLook.search_index_entry" title="Permalink to this definition"></a></dt>
<dd></dd></dl>
</dd></dl>
</div>

View file

@ -115,6 +115,11 @@ description in use and <strong>db.multidesc</strong> to store all descriptions.<
<code class="sig-name descname">lock_storage</code><em class="property"> = 'cmd:all()'</em><a class="headerlink" href="#evennia.contrib.multidescer.CmdMultiDesc.lock_storage" title="Permalink to this definition"></a></dt>
<dd></dd></dl>
<dl class="py attribute">
<dt id="evennia.contrib.multidescer.CmdMultiDesc.search_index_entry">
<code class="sig-name descname">search_index_entry</code><em class="property"> = {'aliases': 'desc', 'category': 'general', 'key': '+desc', 'tags': '', 'text': '\n Manage multiple descriptions\n\n Usage:\n +desc [key] - show current desc desc with &lt;key&gt;\n +desc &lt;key&gt; = &lt;text&gt; - add/replace desc with &lt;key&gt;\n +desc/list - list descriptions (abbreviated)\n +desc/list/full - list descriptions (full texts)\n +desc/edit &lt;key&gt; - add/edit desc &lt;key&gt; in line editor\n +desc/del &lt;key&gt; - delete desc &lt;key&gt;\n +desc/swap &lt;key1&gt;-&lt;key2&gt; - swap positions of &lt;key1&gt; and &lt;key2&gt; in list\n +desc/set &lt;key&gt; [+key+...] - set desc as default or combine multiple descs\n\n Notes:\n When combining multiple descs with +desc/set &lt;key&gt; + &lt;key2&gt; + ...,\n any keys not matching an actual description will be inserted\n as plain text. Use e.g. ansi line break ||/ to add a new\n paragraph and + + or ansi space ||_ to add extra whitespace.\n\n '}</em><a class="headerlink" href="#evennia.contrib.multidescer.CmdMultiDesc.search_index_entry" title="Permalink to this definition"></a></dt>
<dd></dd></dl>
</dd></dl>
</div>

View file

@ -205,6 +205,11 @@ to all the variables defined therein.</p>
<code class="sig-name descname">lock_storage</code><em class="property"> = 'cmd:perm(puzzle) or perm(Builder)'</em><a class="headerlink" href="#evennia.contrib.puzzles.CmdCreatePuzzleRecipe.lock_storage" title="Permalink to this definition"></a></dt>
<dd></dd></dl>
<dl class="py attribute">
<dt id="evennia.contrib.puzzles.CmdCreatePuzzleRecipe.search_index_entry">
<code class="sig-name descname">search_index_entry</code><em class="property"> = {'aliases': '&#64;puzzlerecipe', 'category': 'puzzles', 'key': '&#64;puzzle', 'tags': '', 'text': &quot;\n Creates a puzzle recipe. A puzzle consists of puzzle-parts that\n the player can 'use' together to create a specified result.\n\n Usage:\n &#64;puzzle name,&lt;part1[,part2,...&gt;] = &lt;result1[,result2,...]&gt;\n\n Example:\n create/drop balloon\n create/drop glass of water\n create/drop water balloon\n &#64;puzzle waterballon,balloon,glass of water = water balloon\n &#64;del ballon, glass of water, water balloon\n &#64;armpuzzle #1\n\n Notes:\n Each part and result are objects that must (temporarily) exist and be placed in their\n corresponding location in order to create the puzzle. After the creation of the puzzle,\n these objects are not needed anymore and can be deleted. Components of the puzzle\n will be re-created by use of the `&#64;armpuzzle` command later.\n\n &quot;}</em><a class="headerlink" href="#evennia.contrib.puzzles.CmdCreatePuzzleRecipe.search_index_entry" title="Permalink to this definition"></a></dt>
<dd></dd></dl>
</dd></dl>
<dl class="py class">
@ -268,6 +273,11 @@ to all the variables defined therein.</p>
<code class="sig-name descname">lock_storage</code><em class="property"> = 'cmd:perm(puzzleedit) or perm(Builder)'</em><a class="headerlink" href="#evennia.contrib.puzzles.CmdEditPuzzle.lock_storage" title="Permalink to this definition"></a></dt>
<dd></dd></dl>
<dl class="py attribute">
<dt id="evennia.contrib.puzzles.CmdEditPuzzle.search_index_entry">
<code class="sig-name descname">search_index_entry</code><em class="property"> = {'aliases': '', 'category': 'puzzles', 'key': '&#64;puzzleedit', 'tags': '', 'text': &quot;\n Edits puzzle properties\n\n Usage:\n &#64;puzzleedit[/delete] &lt;#dbref&gt;\n &#64;puzzleedit &lt;#dbref&gt;/use_success_message = &lt;Custom message&gt;\n &#64;puzzleedit &lt;#dbref&gt;/use_success_location_message = &lt;Custom message from {caller} producing {result_names}&gt;\n &#64;puzzleedit &lt;#dbref&gt;/mask = attr1[,attr2,...]&gt;\n &#64;puzzleedit[/addpart] &lt;#dbref&gt; = &lt;obj[,obj2,...]&gt;\n &#64;puzzleedit[/delpart] &lt;#dbref&gt; = &lt;obj[,obj2,...]&gt;\n &#64;puzzleedit[/addresult] &lt;#dbref&gt; = &lt;obj[,obj2,...]&gt;\n &#64;puzzleedit[/delresult] &lt;#dbref&gt; = &lt;obj[,obj2,...]&gt;\n\n Switches:\n addpart - adds parts to the puzzle\n delpart - removes parts from the puzzle\n addresult - adds results to the puzzle\n delresult - removes results from the puzzle\n delete - deletes the recipe. Existing parts and results aren't modified\n\n mask - attributes to exclude during matching (e.g. location, desc, etc.)\n use_success_location_message containing {result_names} and {caller} will\n automatically be replaced with correct values. Both are optional.\n\n When removing parts/results, it's possible to remove all.\n\n &quot;}</em><a class="headerlink" href="#evennia.contrib.puzzles.CmdEditPuzzle.search_index_entry" title="Permalink to this definition"></a></dt>
<dd></dd></dl>
</dd></dl>
<dl class="py class">
@ -315,6 +325,11 @@ to all the variables defined therein.</p>
<code class="sig-name descname">lock_storage</code><em class="property"> = 'cmd:perm(armpuzzle) or perm(Builder)'</em><a class="headerlink" href="#evennia.contrib.puzzles.CmdArmPuzzle.lock_storage" title="Permalink to this definition"></a></dt>
<dd></dd></dl>
<dl class="py attribute">
<dt id="evennia.contrib.puzzles.CmdArmPuzzle.search_index_entry">
<code class="sig-name descname">search_index_entry</code><em class="property"> = {'aliases': '', 'category': 'puzzles', 'key': '&#64;armpuzzle', 'tags': '', 'text': '\n Arms a puzzle by spawning all its parts.\n\n Usage:\n &#64;armpuzzle &lt;puzzle #dbref&gt;\n\n Notes:\n Create puzzles with `&#64;puzzle`; get list of\n defined puzzles using `&#64;lspuzzlerecipes`.\n\n '}</em><a class="headerlink" href="#evennia.contrib.puzzles.CmdArmPuzzle.search_index_entry" title="Permalink to this definition"></a></dt>
<dd></dd></dl>
</dd></dl>
<dl class="py class">
@ -363,6 +378,11 @@ to all the variables defined therein.</p>
<code class="sig-name descname">lock_storage</code><em class="property"> = 'cmd:pperm(use) or pperm(Player)'</em><a class="headerlink" href="#evennia.contrib.puzzles.CmdUsePuzzleParts.lock_storage" title="Permalink to this definition"></a></dt>
<dd></dd></dl>
<dl class="py attribute">
<dt id="evennia.contrib.puzzles.CmdUsePuzzleParts.search_index_entry">
<code class="sig-name descname">search_index_entry</code><em class="property"> = {'aliases': 'combine', 'category': 'puzzles', 'key': 'use', 'tags': '', 'text': '\n Use an object, or a group of objects at once.\n\n\n Example:\n You look around you and see a pole, a long string, and a needle.\n\n use pole, long string, needle\n\n Genius! You built a fishing pole.\n\n\n Usage:\n use &lt;obj1&gt; [,obj2,...]\n '}</em><a class="headerlink" href="#evennia.contrib.puzzles.CmdUsePuzzleParts.search_index_entry" title="Permalink to this definition"></a></dt>
<dd></dd></dl>
</dd></dl>
<dl class="py class">
@ -407,6 +427,11 @@ to all the variables defined therein.</p>
<code class="sig-name descname">lock_storage</code><em class="property"> = 'cmd:perm(lspuzzlerecipes) or perm(Builder)'</em><a class="headerlink" href="#evennia.contrib.puzzles.CmdListPuzzleRecipes.lock_storage" title="Permalink to this definition"></a></dt>
<dd></dd></dl>
<dl class="py attribute">
<dt id="evennia.contrib.puzzles.CmdListPuzzleRecipes.search_index_entry">
<code class="sig-name descname">search_index_entry</code><em class="property"> = {'aliases': '', 'category': 'puzzles', 'key': '&#64;lspuzzlerecipes', 'tags': '', 'text': '\n Searches for all puzzle recipes\n\n Usage:\n &#64;lspuzzlerecipes\n '}</em><a class="headerlink" href="#evennia.contrib.puzzles.CmdListPuzzleRecipes.search_index_entry" title="Permalink to this definition"></a></dt>
<dd></dd></dl>
</dd></dl>
<dl class="py class">
@ -451,6 +476,11 @@ to all the variables defined therein.</p>
<code class="sig-name descname">lock_storage</code><em class="property"> = 'cmd:perm(lsarmedpuzzles) or perm(Builder)'</em><a class="headerlink" href="#evennia.contrib.puzzles.CmdListArmedPuzzles.lock_storage" title="Permalink to this definition"></a></dt>
<dd></dd></dl>
<dl class="py attribute">
<dt id="evennia.contrib.puzzles.CmdListArmedPuzzles.search_index_entry">
<code class="sig-name descname">search_index_entry</code><em class="property"> = {'aliases': '', 'category': 'puzzles', 'key': '&#64;lsarmedpuzzles', 'tags': '', 'text': '\n Searches for all armed puzzles\n\n Usage:\n &#64;lsarmedpuzzles\n '}</em><a class="headerlink" href="#evennia.contrib.puzzles.CmdListArmedPuzzles.search_index_entry" title="Permalink to this definition"></a></dt>
<dd></dd></dl>
</dd></dl>
<dl class="py class">

View file

@ -265,7 +265,10 @@ langname can be None.</p>
</p>
</dd>
<dt class="field-odd">Raises</dt>
<dd class="field-odd"><p><a class="reference internal" href="evennia.contrib.rplanguage.html#evennia.contrib.rplanguage.LanguageError" title="evennia.contrib.rplanguage.LanguageError"><strong>rplanguage.LanguageError</strong></a> If an invalid language was specified.</p>
<dd class="field-odd"><ul class="simple">
<li><p><a class="reference internal" href="#evennia.contrib.rpsystem.LanguageError" title="evennia.contrib.rpsystem.LanguageError"><strong>evennia.contrib.rpsystem.LanguageError</strong></a> If an invalid language was</p></li>
<li><p><strong>specified.</strong> </p></li>
</ul>
</dd>
</dl>
<p class="rubric">Notes</p>
@ -550,6 +553,11 @@ mechanism. This is useful for adding masks/hoods etc.</p>
<code class="sig-name descname">lock_storage</code><em class="property"> = 'cmd:all();'</em><a class="headerlink" href="#evennia.contrib.rpsystem.RPCommand.lock_storage" title="Permalink to this definition"></a></dt>
<dd></dd></dl>
<dl class="py attribute">
<dt id="evennia.contrib.rpsystem.RPCommand.search_index_entry">
<code class="sig-name descname">search_index_entry</code><em class="property"> = {'aliases': '', 'category': 'general', 'key': 'command', 'tags': '', 'text': 'simple parent'}</em><a class="headerlink" href="#evennia.contrib.rpsystem.RPCommand.search_index_entry" title="Permalink to this definition"></a></dt>
<dd></dd></dl>
</dd></dl>
<dl class="py class">
@ -603,6 +611,11 @@ a different language.</p>
<code class="sig-name descname">lock_storage</code><em class="property"> = 'cmd:all()'</em><a class="headerlink" href="#evennia.contrib.rpsystem.CmdEmote.lock_storage" title="Permalink to this definition"></a></dt>
<dd></dd></dl>
<dl class="py attribute">
<dt id="evennia.contrib.rpsystem.CmdEmote.search_index_entry">
<code class="sig-name descname">search_index_entry</code><em class="property"> = {'aliases': ':', 'category': 'general', 'key': 'emote', 'tags': '', 'text': '\n Emote an action, allowing dynamic replacement of\n text in the emote.\n\n Usage:\n emote text\n\n Example:\n emote /me looks around.\n emote With a flurry /me attacks /tall man with his sword.\n emote &quot;Hello&quot;, /me says.\n\n Describes an event in the world. This allows the use of /ref\n markers to replace with the short descriptions or recognized\n strings of objects in the same room. These will be translated to\n emotes to match each person seeing it. Use &quot;...&quot; for saying\n things and langcode&quot;...&quot; without spaces to say something in\n a different language.\n\n '}</em><a class="headerlink" href="#evennia.contrib.rpsystem.CmdEmote.search_index_entry" title="Permalink to this definition"></a></dt>
<dd></dd></dl>
</dd></dl>
<dl class="py class">
@ -646,6 +659,11 @@ a different language.</p>
<code class="sig-name descname">lock_storage</code><em class="property"> = 'cmd:all()'</em><a class="headerlink" href="#evennia.contrib.rpsystem.CmdSay.lock_storage" title="Permalink to this definition"></a></dt>
<dd></dd></dl>
<dl class="py attribute">
<dt id="evennia.contrib.rpsystem.CmdSay.search_index_entry">
<code class="sig-name descname">search_index_entry</code><em class="property"> = {'aliases': '&quot; \'', 'category': 'general', 'key': 'say', 'tags': '', 'text': '\n speak as your character\n\n Usage:\n say &lt;message&gt;\n\n Talk to those in your current location.\n '}</em><a class="headerlink" href="#evennia.contrib.rpsystem.CmdSay.search_index_entry" title="Permalink to this definition"></a></dt>
<dd></dd></dl>
</dd></dl>
<dl class="py class">
@ -689,6 +707,11 @@ a different language.</p>
<code class="sig-name descname">lock_storage</code><em class="property"> = 'cmd:all()'</em><a class="headerlink" href="#evennia.contrib.rpsystem.CmdSdesc.lock_storage" title="Permalink to this definition"></a></dt>
<dd></dd></dl>
<dl class="py attribute">
<dt id="evennia.contrib.rpsystem.CmdSdesc.search_index_entry">
<code class="sig-name descname">search_index_entry</code><em class="property"> = {'aliases': '', 'category': 'general', 'key': 'sdesc', 'tags': '', 'text': '\n Assign yourself a short description (sdesc).\n\n Usage:\n sdesc &lt;short description&gt;\n\n Assigns a short description to yourself.\n\n '}</em><a class="headerlink" href="#evennia.contrib.rpsystem.CmdSdesc.search_index_entry" title="Permalink to this definition"></a></dt>
<dd></dd></dl>
</dd></dl>
<dl class="py class">
@ -747,6 +770,11 @@ sdesc in the emote, regardless of who is seeing it.</p>
<code class="sig-name descname">lock_storage</code><em class="property"> = 'cmd:all();'</em><a class="headerlink" href="#evennia.contrib.rpsystem.CmdPose.lock_storage" title="Permalink to this definition"></a></dt>
<dd></dd></dl>
<dl class="py attribute">
<dt id="evennia.contrib.rpsystem.CmdPose.search_index_entry">
<code class="sig-name descname">search_index_entry</code><em class="property"> = {'aliases': '', 'category': 'general', 'key': 'pose', 'tags': '', 'text': &quot;\n Set a static pose\n\n Usage:\n pose &lt;pose&gt;\n pose default &lt;pose&gt;\n pose reset\n pose obj = &lt;pose&gt;\n pose default obj = &lt;pose&gt;\n pose reset obj =\n\n Examples:\n pose leans against the tree\n pose is talking to the barkeep.\n pose box = is sitting on the floor.\n\n Set a static pose. This is the end of a full sentence that starts\n with your sdesc. If no full stop is given, it will be added\n automatically. The default pose is the pose you get when using\n pose reset. Note that you can use sdescs/recogs to reference\n people in your pose, but these always appear as that person's\n sdesc in the emote, regardless of who is seeing it.\n\n &quot;}</em><a class="headerlink" href="#evennia.contrib.rpsystem.CmdPose.search_index_entry" title="Permalink to this definition"></a></dt>
<dd></dd></dl>
</dd></dl>
<dl class="py class">
@ -772,7 +800,7 @@ Using the command without arguments will list all current recogs.</p>
<dl class="py attribute">
<dt id="evennia.contrib.rpsystem.CmdRecog.aliases">
<code class="sig-name descname">aliases</code><em class="property"> = ['recognize', 'forget']</em><a class="headerlink" href="#evennia.contrib.rpsystem.CmdRecog.aliases" title="Permalink to this definition"></a></dt>
<code class="sig-name descname">aliases</code><em class="property"> = ['forget', 'recognize']</em><a class="headerlink" href="#evennia.contrib.rpsystem.CmdRecog.aliases" title="Permalink to this definition"></a></dt>
<dd></dd></dl>
<dl class="py method">
@ -797,6 +825,11 @@ Using the command without arguments will list all current recogs.</p>
<code class="sig-name descname">lock_storage</code><em class="property"> = 'cmd:all();'</em><a class="headerlink" href="#evennia.contrib.rpsystem.CmdRecog.lock_storage" title="Permalink to this definition"></a></dt>
<dd></dd></dl>
<dl class="py attribute">
<dt id="evennia.contrib.rpsystem.CmdRecog.search_index_entry">
<code class="sig-name descname">search_index_entry</code><em class="property"> = {'aliases': 'forget recognize', 'category': 'general', 'key': 'recog', 'tags': '', 'text': '\n Recognize another person in the same room.\n\n Usage:\n recog\n recog sdesc as alias\n forget alias\n\n Example:\n recog tall man as Griatch\n forget griatch\n\n This will assign a personal alias for a person, or forget said alias.\n Using the command without arguments will list all current recogs.\n\n '}</em><a class="headerlink" href="#evennia.contrib.rpsystem.CmdRecog.search_index_entry" title="Permalink to this definition"></a></dt>
<dd></dd></dl>
</dd></dl>
<dl class="py class">
@ -841,6 +874,11 @@ set in self.parse())</p>
<code class="sig-name descname">lock_storage</code><em class="property"> = 'cmd:all();'</em><a class="headerlink" href="#evennia.contrib.rpsystem.CmdMask.lock_storage" title="Permalink to this definition"></a></dt>
<dd></dd></dl>
<dl class="py attribute">
<dt id="evennia.contrib.rpsystem.CmdMask.search_index_entry">
<code class="sig-name descname">search_index_entry</code><em class="property"> = {'aliases': 'unmask', 'category': 'general', 'key': 'mask', 'tags': '', 'text': &quot;\n Wear a mask\n\n Usage:\n mask &lt;new sdesc&gt;\n unmask\n\n This will put on a mask to hide your identity. When wearing\n a mask, your sdesc will be replaced by the sdesc you pick and\n people's recognitions of you will be disabled.\n\n &quot;}</em><a class="headerlink" href="#evennia.contrib.rpsystem.CmdMask.search_index_entry" title="Permalink to this definition"></a></dt>
<dd></dd></dl>
</dd></dl>
<dl class="py class">

View file

@ -179,6 +179,11 @@ unique.</p>
<code class="sig-name descname">lock_storage</code><em class="property"> = 'cmd:perm(open) or perm(Builder)'</em><a class="headerlink" href="#evennia.contrib.simpledoor.CmdOpen.lock_storage" title="Permalink to this definition"></a></dt>
<dd></dd></dl>
<dl class="py attribute">
<dt id="evennia.contrib.simpledoor.CmdOpen.search_index_entry">
<code class="sig-name descname">search_index_entry</code><em class="property"> = {'aliases': '', 'category': 'building', 'key': 'open', 'tags': '', 'text': '\n open a new exit from the current room\n\n Usage:\n open &lt;new exit&gt;[;alias;alias..][:typeclass] [,&lt;return exit&gt;[;alias;..][:typeclass]]] = &lt;destination&gt;\n\n Handles the creation of exits. If a destination is given, the exit\n will point there. The &lt;return exit&gt; argument sets up an exit at the\n destination leading back to the current room. Destination name\n can be given both as a #dbref and a name, if that name is globally\n unique.\n\n '}</em><a class="headerlink" href="#evennia.contrib.simpledoor.CmdOpen.search_index_entry" title="Permalink to this definition"></a></dt>
<dd></dd></dl>
</dd></dl>
<dl class="py class">
@ -222,6 +227,11 @@ close &lt;door&gt;</p>
<code class="sig-name descname">lock_storage</code><em class="property"> = 'cmd:all()'</em><a class="headerlink" href="#evennia.contrib.simpledoor.CmdOpenCloseDoor.lock_storage" title="Permalink to this definition"></a></dt>
<dd></dd></dl>
<dl class="py attribute">
<dt id="evennia.contrib.simpledoor.CmdOpenCloseDoor.search_index_entry">
<code class="sig-name descname">search_index_entry</code><em class="property"> = {'aliases': 'close', 'category': 'general', 'key': 'open', 'tags': '', 'text': '\n Open and close a door\n\n Usage:\n open &lt;door&gt;\n close &lt;door&gt;\n\n '}</em><a class="headerlink" href="#evennia.contrib.simpledoor.CmdOpenCloseDoor.search_index_entry" title="Permalink to this definition"></a></dt>
<dd></dd></dl>
</dd></dl>
</div>

View file

@ -133,6 +133,11 @@ is assumed.</p>
<code class="sig-name descname">lock_storage</code><em class="property"> = 'cmd:all();'</em><a class="headerlink" href="#evennia.contrib.slow_exit.CmdSetSpeed.lock_storage" title="Permalink to this definition"></a></dt>
<dd></dd></dl>
<dl class="py attribute">
<dt id="evennia.contrib.slow_exit.CmdSetSpeed.search_index_entry">
<code class="sig-name descname">search_index_entry</code><em class="property"> = {'aliases': '', 'category': 'general', 'key': 'setspeed', 'tags': '', 'text': &quot;\n set your movement speed\n\n Usage:\n setspeed stroll|walk|run|sprint\n\n This will set your movement speed, determining how long time\n it takes to traverse exits. If no speed is set, 'walk' speed\n is assumed.\n &quot;}</em><a class="headerlink" href="#evennia.contrib.slow_exit.CmdSetSpeed.search_index_entry" title="Permalink to this definition"></a></dt>
<dd></dd></dl>
</dd></dl>
<dl class="py class">
@ -172,6 +177,11 @@ stored deferred from the exit traversal above.</p>
<code class="sig-name descname">lock_storage</code><em class="property"> = 'cmd:all();'</em><a class="headerlink" href="#evennia.contrib.slow_exit.CmdStop.lock_storage" title="Permalink to this definition"></a></dt>
<dd></dd></dl>
<dl class="py attribute">
<dt id="evennia.contrib.slow_exit.CmdStop.search_index_entry">
<code class="sig-name descname">search_index_entry</code><em class="property"> = {'aliases': '', 'category': 'general', 'key': 'stop', 'tags': '', 'text': '\n stop moving\n\n Usage:\n stop\n\n Stops the current movement, if any.\n '}</em><a class="headerlink" href="#evennia.contrib.slow_exit.CmdStop.search_index_entry" title="Permalink to this definition"></a></dt>
<dd></dd></dl>
</dd></dl>
</div>

View file

@ -120,6 +120,11 @@ that NPC and give you options on what to talk about.</p>
<code class="sig-name descname">lock_storage</code><em class="property"> = 'cmd:all()'</em><a class="headerlink" href="#evennia.contrib.talking_npc.CmdTalk.lock_storage" title="Permalink to this definition"></a></dt>
<dd></dd></dl>
<dl class="py attribute">
<dt id="evennia.contrib.talking_npc.CmdTalk.search_index_entry">
<code class="sig-name descname">search_index_entry</code><em class="property"> = {'aliases': '', 'category': 'general', 'key': 'talk', 'tags': '', 'text': '\n Talks to an npc\n\n Usage:\n talk\n\n This command is only available if a talkative non-player-character\n (NPC) is actually present. It will strike up a conversation with\n that NPC and give you options on what to talk about.\n '}</em><a class="headerlink" href="#evennia.contrib.talking_npc.CmdTalk.search_index_entry" title="Permalink to this definition"></a></dt>
<dd></dd></dl>
</dd></dl>
<dl class="py class">

View file

@ -369,6 +369,11 @@ set in self.parse())</p>
<code class="sig-name descname">lock_storage</code><em class="property"> = 'cmd:all();'</em><a class="headerlink" href="#evennia.contrib.tree_select.CmdNameColor.lock_storage" title="Permalink to this definition"></a></dt>
<dd></dd></dl>
<dl class="py attribute">
<dt id="evennia.contrib.tree_select.CmdNameColor.search_index_entry">
<code class="sig-name descname">search_index_entry</code><em class="property"> = {'aliases': '', 'category': 'general', 'key': 'namecolor', 'tags': '', 'text': '\n Set or remove a special color on your name. Just an example for the\n easy menu selection tree contrib.\n '}</em><a class="headerlink" href="#evennia.contrib.tree_select.CmdNameColor.search_index_entry" title="Permalink to this definition"></a></dt>
<dd></dd></dl>
</dd></dl>
<dl class="py function">

View file

@ -500,6 +500,11 @@ When its your turn, you can attack other characters.</p>
<code class="sig-name descname">lock_storage</code><em class="property"> = 'cmd:all();'</em><a class="headerlink" href="#evennia.contrib.turnbattle.tb_basic.CmdFight.lock_storage" title="Permalink to this definition"></a></dt>
<dd></dd></dl>
<dl class="py attribute">
<dt id="evennia.contrib.turnbattle.tb_basic.CmdFight.search_index_entry">
<code class="sig-name descname">search_index_entry</code><em class="property"> = {'aliases': '', 'category': 'combat', 'key': 'fight', 'tags': '', 'text': &quot;\n Starts a fight with everyone in the same room as you.\n\n Usage:\n fight\n\n When you start a fight, everyone in the room who is able to\n fight is added to combat, and a turn order is randomly rolled.\n When it's your turn, you can attack other characters.\n &quot;}</em><a class="headerlink" href="#evennia.contrib.turnbattle.tb_basic.CmdFight.search_index_entry" title="Permalink to this definition"></a></dt>
<dd></dd></dl>
</dd></dl>
<dl class="py class">
@ -539,6 +544,11 @@ a chance to hit, and if successful, will deal damage.</p>
<code class="sig-name descname">lock_storage</code><em class="property"> = 'cmd:all();'</em><a class="headerlink" href="#evennia.contrib.turnbattle.tb_basic.CmdAttack.lock_storage" title="Permalink to this definition"></a></dt>
<dd></dd></dl>
<dl class="py attribute">
<dt id="evennia.contrib.turnbattle.tb_basic.CmdAttack.search_index_entry">
<code class="sig-name descname">search_index_entry</code><em class="property"> = {'aliases': '', 'category': 'combat', 'key': 'attack', 'tags': '', 'text': '\n Attacks another character.\n\n Usage:\n attack &lt;target&gt;\n\n When in a fight, you may attack another character. The attack has\n a chance to hit, and if successful, will deal damage.\n '}</em><a class="headerlink" href="#evennia.contrib.turnbattle.tb_basic.CmdAttack.search_index_entry" title="Permalink to this definition"></a></dt>
<dd></dd></dl>
</dd></dl>
<dl class="py class">
@ -559,7 +569,7 @@ if there are still any actions you can take.</p>
<dl class="py attribute">
<dt id="evennia.contrib.turnbattle.tb_basic.CmdPass.aliases">
<code class="sig-name descname">aliases</code><em class="property"> = ['hold', 'wait']</em><a class="headerlink" href="#evennia.contrib.turnbattle.tb_basic.CmdPass.aliases" title="Permalink to this definition"></a></dt>
<code class="sig-name descname">aliases</code><em class="property"> = ['wait', 'hold']</em><a class="headerlink" href="#evennia.contrib.turnbattle.tb_basic.CmdPass.aliases" title="Permalink to this definition"></a></dt>
<dd></dd></dl>
<dl class="py attribute">
@ -578,6 +588,11 @@ if there are still any actions you can take.</p>
<code class="sig-name descname">lock_storage</code><em class="property"> = 'cmd:all();'</em><a class="headerlink" href="#evennia.contrib.turnbattle.tb_basic.CmdPass.lock_storage" title="Permalink to this definition"></a></dt>
<dd></dd></dl>
<dl class="py attribute">
<dt id="evennia.contrib.turnbattle.tb_basic.CmdPass.search_index_entry">
<code class="sig-name descname">search_index_entry</code><em class="property"> = {'aliases': 'wait hold', 'category': 'combat', 'key': 'pass', 'tags': '', 'text': '\n Passes on your turn.\n\n Usage:\n pass\n\n When in a fight, you can use this command to end your turn early, even\n if there are still any actions you can take.\n '}</em><a class="headerlink" href="#evennia.contrib.turnbattle.tb_basic.CmdPass.search_index_entry" title="Permalink to this definition"></a></dt>
<dd></dd></dl>
</dd></dl>
<dl class="py class">
@ -618,6 +633,11 @@ fight ends.</p>
<code class="sig-name descname">lock_storage</code><em class="property"> = 'cmd:all();'</em><a class="headerlink" href="#evennia.contrib.turnbattle.tb_basic.CmdDisengage.lock_storage" title="Permalink to this definition"></a></dt>
<dd></dd></dl>
<dl class="py attribute">
<dt id="evennia.contrib.turnbattle.tb_basic.CmdDisengage.search_index_entry">
<code class="sig-name descname">search_index_entry</code><em class="property"> = {'aliases': 'spare', 'category': 'combat', 'key': 'disengage', 'tags': '', 'text': &quot;\n Passes your turn and attempts to end combat.\n\n Usage:\n disengage\n\n Ends your turn early and signals that you're trying to end\n the fight. If all participants in a fight disengage, the\n fight ends.\n &quot;}</em><a class="headerlink" href="#evennia.contrib.turnbattle.tb_basic.CmdDisengage.search_index_entry" title="Permalink to this definition"></a></dt>
<dd></dd></dl>
</dd></dl>
<dl class="py class">
@ -657,6 +677,11 @@ rest if youre not in a fight.</p>
<code class="sig-name descname">lock_storage</code><em class="property"> = 'cmd:all();'</em><a class="headerlink" href="#evennia.contrib.turnbattle.tb_basic.CmdRest.lock_storage" title="Permalink to this definition"></a></dt>
<dd></dd></dl>
<dl class="py attribute">
<dt id="evennia.contrib.turnbattle.tb_basic.CmdRest.search_index_entry">
<code class="sig-name descname">search_index_entry</code><em class="property"> = {'aliases': '', 'category': 'combat', 'key': 'rest', 'tags': '', 'text': &quot;\n Recovers damage.\n\n Usage:\n rest\n\n Resting recovers your HP to its maximum, but you can only\n rest if you're not in a fight.\n &quot;}</em><a class="headerlink" href="#evennia.contrib.turnbattle.tb_basic.CmdRest.search_index_entry" title="Permalink to this definition"></a></dt>
<dd></dd></dl>
</dd></dl>
<dl class="py class">
@ -698,6 +723,11 @@ topics related to the game.</p>
<code class="sig-name descname">lock_storage</code><em class="property"> = 'cmd:all()'</em><a class="headerlink" href="#evennia.contrib.turnbattle.tb_basic.CmdCombatHelp.lock_storage" title="Permalink to this definition"></a></dt>
<dd></dd></dl>
<dl class="py attribute">
<dt id="evennia.contrib.turnbattle.tb_basic.CmdCombatHelp.search_index_entry">
<code class="sig-name descname">search_index_entry</code><em class="property"> = {'aliases': '?', 'category': 'general', 'key': 'help', 'tags': '', 'text': '\n View help or a list of topics\n\n Usage:\n help &lt;topic or command&gt;\n help list\n help all\n\n This will search for help on commands and other\n topics related to the game.\n '}</em><a class="headerlink" href="#evennia.contrib.turnbattle.tb_basic.CmdCombatHelp.search_index_entry" title="Permalink to this definition"></a></dt>
<dd></dd></dl>
</dd></dl>
<dl class="py class">

View file

@ -617,6 +617,11 @@ When its your turn, you can attack other characters.</p>
<code class="sig-name descname">lock_storage</code><em class="property"> = 'cmd:all();'</em><a class="headerlink" href="#evennia.contrib.turnbattle.tb_equip.CmdFight.lock_storage" title="Permalink to this definition"></a></dt>
<dd></dd></dl>
<dl class="py attribute">
<dt id="evennia.contrib.turnbattle.tb_equip.CmdFight.search_index_entry">
<code class="sig-name descname">search_index_entry</code><em class="property"> = {'aliases': '', 'category': 'combat', 'key': 'fight', 'tags': '', 'text': &quot;\n Starts a fight with everyone in the same room as you.\n\n Usage:\n fight\n\n When you start a fight, everyone in the room who is able to\n fight is added to combat, and a turn order is randomly rolled.\n When it's your turn, you can attack other characters.\n &quot;}</em><a class="headerlink" href="#evennia.contrib.turnbattle.tb_equip.CmdFight.search_index_entry" title="Permalink to this definition"></a></dt>
<dd></dd></dl>
</dd></dl>
<dl class="py class">
@ -656,6 +661,11 @@ a chance to hit, and if successful, will deal damage.</p>
<code class="sig-name descname">lock_storage</code><em class="property"> = 'cmd:all();'</em><a class="headerlink" href="#evennia.contrib.turnbattle.tb_equip.CmdAttack.lock_storage" title="Permalink to this definition"></a></dt>
<dd></dd></dl>
<dl class="py attribute">
<dt id="evennia.contrib.turnbattle.tb_equip.CmdAttack.search_index_entry">
<code class="sig-name descname">search_index_entry</code><em class="property"> = {'aliases': '', 'category': 'combat', 'key': 'attack', 'tags': '', 'text': '\n Attacks another character.\n\n Usage:\n attack &lt;target&gt;\n\n When in a fight, you may attack another character. The attack has\n a chance to hit, and if successful, will deal damage.\n '}</em><a class="headerlink" href="#evennia.contrib.turnbattle.tb_equip.CmdAttack.search_index_entry" title="Permalink to this definition"></a></dt>
<dd></dd></dl>
</dd></dl>
<dl class="py class">
@ -676,7 +686,7 @@ if there are still any actions you can take.</p>
<dl class="py attribute">
<dt id="evennia.contrib.turnbattle.tb_equip.CmdPass.aliases">
<code class="sig-name descname">aliases</code><em class="property"> = ['hold', 'wait']</em><a class="headerlink" href="#evennia.contrib.turnbattle.tb_equip.CmdPass.aliases" title="Permalink to this definition"></a></dt>
<code class="sig-name descname">aliases</code><em class="property"> = ['wait', 'hold']</em><a class="headerlink" href="#evennia.contrib.turnbattle.tb_equip.CmdPass.aliases" title="Permalink to this definition"></a></dt>
<dd></dd></dl>
<dl class="py attribute">
@ -695,6 +705,11 @@ if there are still any actions you can take.</p>
<code class="sig-name descname">lock_storage</code><em class="property"> = 'cmd:all();'</em><a class="headerlink" href="#evennia.contrib.turnbattle.tb_equip.CmdPass.lock_storage" title="Permalink to this definition"></a></dt>
<dd></dd></dl>
<dl class="py attribute">
<dt id="evennia.contrib.turnbattle.tb_equip.CmdPass.search_index_entry">
<code class="sig-name descname">search_index_entry</code><em class="property"> = {'aliases': 'wait hold', 'category': 'combat', 'key': 'pass', 'tags': '', 'text': '\n Passes on your turn.\n\n Usage:\n pass\n\n When in a fight, you can use this command to end your turn early, even\n if there are still any actions you can take.\n '}</em><a class="headerlink" href="#evennia.contrib.turnbattle.tb_equip.CmdPass.search_index_entry" title="Permalink to this definition"></a></dt>
<dd></dd></dl>
</dd></dl>
<dl class="py class">
@ -735,6 +750,11 @@ fight ends.</p>
<code class="sig-name descname">lock_storage</code><em class="property"> = 'cmd:all();'</em><a class="headerlink" href="#evennia.contrib.turnbattle.tb_equip.CmdDisengage.lock_storage" title="Permalink to this definition"></a></dt>
<dd></dd></dl>
<dl class="py attribute">
<dt id="evennia.contrib.turnbattle.tb_equip.CmdDisengage.search_index_entry">
<code class="sig-name descname">search_index_entry</code><em class="property"> = {'aliases': 'spare', 'category': 'combat', 'key': 'disengage', 'tags': '', 'text': &quot;\n Passes your turn and attempts to end combat.\n\n Usage:\n disengage\n\n Ends your turn early and signals that you're trying to end\n the fight. If all participants in a fight disengage, the\n fight ends.\n &quot;}</em><a class="headerlink" href="#evennia.contrib.turnbattle.tb_equip.CmdDisengage.search_index_entry" title="Permalink to this definition"></a></dt>
<dd></dd></dl>
</dd></dl>
<dl class="py class">
@ -774,6 +794,11 @@ rest if youre not in a fight.</p>
<code class="sig-name descname">lock_storage</code><em class="property"> = 'cmd:all();'</em><a class="headerlink" href="#evennia.contrib.turnbattle.tb_equip.CmdRest.lock_storage" title="Permalink to this definition"></a></dt>
<dd></dd></dl>
<dl class="py attribute">
<dt id="evennia.contrib.turnbattle.tb_equip.CmdRest.search_index_entry">
<code class="sig-name descname">search_index_entry</code><em class="property"> = {'aliases': '', 'category': 'combat', 'key': 'rest', 'tags': '', 'text': &quot;\n Recovers damage.\n\n Usage:\n rest\n\n Resting recovers your HP to its maximum, but you can only\n rest if you're not in a fight.\n &quot;}</em><a class="headerlink" href="#evennia.contrib.turnbattle.tb_equip.CmdRest.search_index_entry" title="Permalink to this definition"></a></dt>
<dd></dd></dl>
</dd></dl>
<dl class="py class">
@ -815,6 +840,11 @@ topics related to the game.</p>
<code class="sig-name descname">lock_storage</code><em class="property"> = 'cmd:all()'</em><a class="headerlink" href="#evennia.contrib.turnbattle.tb_equip.CmdCombatHelp.lock_storage" title="Permalink to this definition"></a></dt>
<dd></dd></dl>
<dl class="py attribute">
<dt id="evennia.contrib.turnbattle.tb_equip.CmdCombatHelp.search_index_entry">
<code class="sig-name descname">search_index_entry</code><em class="property"> = {'aliases': '?', 'category': 'general', 'key': 'help', 'tags': '', 'text': '\n View help or a list of topics\n\n Usage:\n help &lt;topic or command&gt;\n help list\n help all\n\n This will search for help on commands and other\n topics related to the game.\n '}</em><a class="headerlink" href="#evennia.contrib.turnbattle.tb_equip.CmdCombatHelp.search_index_entry" title="Permalink to this definition"></a></dt>
<dd></dd></dl>
</dd></dl>
<dl class="py class">
@ -858,6 +888,11 @@ currently wielding.</p>
<code class="sig-name descname">lock_storage</code><em class="property"> = 'cmd:all();'</em><a class="headerlink" href="#evennia.contrib.turnbattle.tb_equip.CmdWield.lock_storage" title="Permalink to this definition"></a></dt>
<dd></dd></dl>
<dl class="py attribute">
<dt id="evennia.contrib.turnbattle.tb_equip.CmdWield.search_index_entry">
<code class="sig-name descname">search_index_entry</code><em class="property"> = {'aliases': '', 'category': 'combat', 'key': 'wield', 'tags': '', 'text': '\n Wield a weapon you are carrying\n\n Usage:\n wield &lt;weapon&gt;\n\n Select a weapon you are carrying to wield in combat. If\n you are already wielding another weapon, you will switch\n to the weapon you specify instead. Using this command in\n combat will spend your action for your turn. Use the\n &quot;unwield&quot; command to stop wielding any weapon you are\n currently wielding.\n '}</em><a class="headerlink" href="#evennia.contrib.turnbattle.tb_equip.CmdWield.search_index_entry" title="Permalink to this definition"></a></dt>
<dd></dd></dl>
</dd></dl>
<dl class="py class">
@ -897,6 +932,11 @@ weapon you are currently wielding and become unarmed.</p>
<code class="sig-name descname">lock_storage</code><em class="property"> = 'cmd:all();'</em><a class="headerlink" href="#evennia.contrib.turnbattle.tb_equip.CmdUnwield.lock_storage" title="Permalink to this definition"></a></dt>
<dd></dd></dl>
<dl class="py attribute">
<dt id="evennia.contrib.turnbattle.tb_equip.CmdUnwield.search_index_entry">
<code class="sig-name descname">search_index_entry</code><em class="property"> = {'aliases': '', 'category': 'combat', 'key': 'unwield', 'tags': '', 'text': '\n Stop wielding a weapon.\n\n Usage:\n unwield\n\n After using this command, you will stop wielding any\n weapon you are currently wielding and become unarmed.\n '}</em><a class="headerlink" href="#evennia.contrib.turnbattle.tb_equip.CmdUnwield.search_index_entry" title="Permalink to this definition"></a></dt>
<dd></dd></dl>
</dd></dl>
<dl class="py class">
@ -937,6 +977,11 @@ command to remove any armor you are wearing.</p>
<code class="sig-name descname">lock_storage</code><em class="property"> = 'cmd:all();'</em><a class="headerlink" href="#evennia.contrib.turnbattle.tb_equip.CmdDon.lock_storage" title="Permalink to this definition"></a></dt>
<dd></dd></dl>
<dl class="py attribute">
<dt id="evennia.contrib.turnbattle.tb_equip.CmdDon.search_index_entry">
<code class="sig-name descname">search_index_entry</code><em class="property"> = {'aliases': '', 'category': 'combat', 'key': 'don', 'tags': '', 'text': '\n Don armor that you are carrying\n\n Usage:\n don &lt;armor&gt;\n\n Select armor to wear in combat. You can\'t use this\n command in the middle of a fight. Use the &quot;doff&quot;\n command to remove any armor you are wearing.\n '}</em><a class="headerlink" href="#evennia.contrib.turnbattle.tb_equip.CmdDon.search_index_entry" title="Permalink to this definition"></a></dt>
<dd></dd></dl>
</dd></dl>
<dl class="py class">
@ -977,6 +1022,11 @@ You cant use this command in combat.</p>
<code class="sig-name descname">lock_storage</code><em class="property"> = 'cmd:all();'</em><a class="headerlink" href="#evennia.contrib.turnbattle.tb_equip.CmdDoff.lock_storage" title="Permalink to this definition"></a></dt>
<dd></dd></dl>
<dl class="py attribute">
<dt id="evennia.contrib.turnbattle.tb_equip.CmdDoff.search_index_entry">
<code class="sig-name descname">search_index_entry</code><em class="property"> = {'aliases': '', 'category': 'combat', 'key': 'doff', 'tags': '', 'text': &quot;\n Stop wearing armor.\n\n Usage:\n doff\n\n After using this command, you will stop wearing any\n armor you are currently using and become unarmored.\n You can't use this command in combat.\n &quot;}</em><a class="headerlink" href="#evennia.contrib.turnbattle.tb_equip.CmdDoff.search_index_entry" title="Permalink to this definition"></a></dt>
<dd></dd></dl>
</dd></dl>
<dl class="py class">

View file

@ -651,6 +651,11 @@ When its your turn, you can attack other characters.</p>
<code class="sig-name descname">lock_storage</code><em class="property"> = 'cmd:all();'</em><a class="headerlink" href="#evennia.contrib.turnbattle.tb_items.CmdFight.lock_storage" title="Permalink to this definition"></a></dt>
<dd></dd></dl>
<dl class="py attribute">
<dt id="evennia.contrib.turnbattle.tb_items.CmdFight.search_index_entry">
<code class="sig-name descname">search_index_entry</code><em class="property"> = {'aliases': '', 'category': 'combat', 'key': 'fight', 'tags': '', 'text': &quot;\n Starts a fight with everyone in the same room as you.\n\n Usage:\n fight\n\n When you start a fight, everyone in the room who is able to\n fight is added to combat, and a turn order is randomly rolled.\n When it's your turn, you can attack other characters.\n &quot;}</em><a class="headerlink" href="#evennia.contrib.turnbattle.tb_items.CmdFight.search_index_entry" title="Permalink to this definition"></a></dt>
<dd></dd></dl>
</dd></dl>
<dl class="py class">
@ -690,6 +695,11 @@ a chance to hit, and if successful, will deal damage.</p>
<code class="sig-name descname">lock_storage</code><em class="property"> = 'cmd:all();'</em><a class="headerlink" href="#evennia.contrib.turnbattle.tb_items.CmdAttack.lock_storage" title="Permalink to this definition"></a></dt>
<dd></dd></dl>
<dl class="py attribute">
<dt id="evennia.contrib.turnbattle.tb_items.CmdAttack.search_index_entry">
<code class="sig-name descname">search_index_entry</code><em class="property"> = {'aliases': '', 'category': 'combat', 'key': 'attack', 'tags': '', 'text': '\n Attacks another character.\n\n Usage:\n attack &lt;target&gt;\n\n When in a fight, you may attack another character. The attack has\n a chance to hit, and if successful, will deal damage.\n '}</em><a class="headerlink" href="#evennia.contrib.turnbattle.tb_items.CmdAttack.search_index_entry" title="Permalink to this definition"></a></dt>
<dd></dd></dl>
</dd></dl>
<dl class="py class">
@ -710,7 +720,7 @@ if there are still any actions you can take.</p>
<dl class="py attribute">
<dt id="evennia.contrib.turnbattle.tb_items.CmdPass.aliases">
<code class="sig-name descname">aliases</code><em class="property"> = ['hold', 'wait']</em><a class="headerlink" href="#evennia.contrib.turnbattle.tb_items.CmdPass.aliases" title="Permalink to this definition"></a></dt>
<code class="sig-name descname">aliases</code><em class="property"> = ['wait', 'hold']</em><a class="headerlink" href="#evennia.contrib.turnbattle.tb_items.CmdPass.aliases" title="Permalink to this definition"></a></dt>
<dd></dd></dl>
<dl class="py attribute">
@ -729,6 +739,11 @@ if there are still any actions you can take.</p>
<code class="sig-name descname">lock_storage</code><em class="property"> = 'cmd:all();'</em><a class="headerlink" href="#evennia.contrib.turnbattle.tb_items.CmdPass.lock_storage" title="Permalink to this definition"></a></dt>
<dd></dd></dl>
<dl class="py attribute">
<dt id="evennia.contrib.turnbattle.tb_items.CmdPass.search_index_entry">
<code class="sig-name descname">search_index_entry</code><em class="property"> = {'aliases': 'wait hold', 'category': 'combat', 'key': 'pass', 'tags': '', 'text': '\n Passes on your turn.\n\n Usage:\n pass\n\n When in a fight, you can use this command to end your turn early, even\n if there are still any actions you can take.\n '}</em><a class="headerlink" href="#evennia.contrib.turnbattle.tb_items.CmdPass.search_index_entry" title="Permalink to this definition"></a></dt>
<dd></dd></dl>
</dd></dl>
<dl class="py class">
@ -769,6 +784,11 @@ fight ends.</p>
<code class="sig-name descname">lock_storage</code><em class="property"> = 'cmd:all();'</em><a class="headerlink" href="#evennia.contrib.turnbattle.tb_items.CmdDisengage.lock_storage" title="Permalink to this definition"></a></dt>
<dd></dd></dl>
<dl class="py attribute">
<dt id="evennia.contrib.turnbattle.tb_items.CmdDisengage.search_index_entry">
<code class="sig-name descname">search_index_entry</code><em class="property"> = {'aliases': 'spare', 'category': 'combat', 'key': 'disengage', 'tags': '', 'text': &quot;\n Passes your turn and attempts to end combat.\n\n Usage:\n disengage\n\n Ends your turn early and signals that you're trying to end\n the fight. If all participants in a fight disengage, the\n fight ends.\n &quot;}</em><a class="headerlink" href="#evennia.contrib.turnbattle.tb_items.CmdDisengage.search_index_entry" title="Permalink to this definition"></a></dt>
<dd></dd></dl>
</dd></dl>
<dl class="py class">
@ -808,6 +828,11 @@ rest if youre not in a fight.</p>
<code class="sig-name descname">lock_storage</code><em class="property"> = 'cmd:all();'</em><a class="headerlink" href="#evennia.contrib.turnbattle.tb_items.CmdRest.lock_storage" title="Permalink to this definition"></a></dt>
<dd></dd></dl>
<dl class="py attribute">
<dt id="evennia.contrib.turnbattle.tb_items.CmdRest.search_index_entry">
<code class="sig-name descname">search_index_entry</code><em class="property"> = {'aliases': '', 'category': 'combat', 'key': 'rest', 'tags': '', 'text': &quot;\n Recovers damage.\n\n Usage:\n rest\n\n Resting recovers your HP to its maximum, but you can only\n rest if you're not in a fight.\n &quot;}</em><a class="headerlink" href="#evennia.contrib.turnbattle.tb_items.CmdRest.search_index_entry" title="Permalink to this definition"></a></dt>
<dd></dd></dl>
</dd></dl>
<dl class="py class">
@ -849,6 +874,11 @@ topics related to the game.</p>
<code class="sig-name descname">lock_storage</code><em class="property"> = 'cmd:all()'</em><a class="headerlink" href="#evennia.contrib.turnbattle.tb_items.CmdCombatHelp.lock_storage" title="Permalink to this definition"></a></dt>
<dd></dd></dl>
<dl class="py attribute">
<dt id="evennia.contrib.turnbattle.tb_items.CmdCombatHelp.search_index_entry">
<code class="sig-name descname">search_index_entry</code><em class="property"> = {'aliases': '?', 'category': 'general', 'key': 'help', 'tags': '', 'text': '\n View help or a list of topics\n\n Usage:\n help &lt;topic or command&gt;\n help list\n help all\n\n This will search for help on commands and other\n topics related to the game.\n '}</em><a class="headerlink" href="#evennia.contrib.turnbattle.tb_items.CmdCombatHelp.search_index_entry" title="Permalink to this definition"></a></dt>
<dd></dd></dl>
</dd></dl>
<dl class="py class">
@ -889,6 +919,11 @@ to attack others, and as such can only be used in combat.</p>
<code class="sig-name descname">lock_storage</code><em class="property"> = 'cmd:all();'</em><a class="headerlink" href="#evennia.contrib.turnbattle.tb_items.CmdUse.lock_storage" title="Permalink to this definition"></a></dt>
<dd></dd></dl>
<dl class="py attribute">
<dt id="evennia.contrib.turnbattle.tb_items.CmdUse.search_index_entry">
<code class="sig-name descname">search_index_entry</code><em class="property"> = {'aliases': '', 'category': 'combat', 'key': 'use', 'tags': '', 'text': '\n Use an item.\n\n Usage:\n use &lt;item&gt; [= target]\n\n An item can have various function - looking at the item may\n provide information as to its effects. Some items can be used\n to attack others, and as such can only be used in combat.\n '}</em><a class="headerlink" href="#evennia.contrib.turnbattle.tb_items.CmdUse.search_index_entry" title="Permalink to this definition"></a></dt>
<dd></dd></dl>
</dd></dl>
<dl class="py class">

View file

@ -523,6 +523,11 @@ When its your turn, you can attack other characters.</p>
<code class="sig-name descname">lock_storage</code><em class="property"> = 'cmd:all();'</em><a class="headerlink" href="#evennia.contrib.turnbattle.tb_magic.CmdFight.lock_storage" title="Permalink to this definition"></a></dt>
<dd></dd></dl>
<dl class="py attribute">
<dt id="evennia.contrib.turnbattle.tb_magic.CmdFight.search_index_entry">
<code class="sig-name descname">search_index_entry</code><em class="property"> = {'aliases': '', 'category': 'combat', 'key': 'fight', 'tags': '', 'text': &quot;\n Starts a fight with everyone in the same room as you.\n\n Usage:\n fight\n\n When you start a fight, everyone in the room who is able to\n fight is added to combat, and a turn order is randomly rolled.\n When it's your turn, you can attack other characters.\n &quot;}</em><a class="headerlink" href="#evennia.contrib.turnbattle.tb_magic.CmdFight.search_index_entry" title="Permalink to this definition"></a></dt>
<dd></dd></dl>
</dd></dl>
<dl class="py class">
@ -562,6 +567,11 @@ a chance to hit, and if successful, will deal damage.</p>
<code class="sig-name descname">lock_storage</code><em class="property"> = 'cmd:all();'</em><a class="headerlink" href="#evennia.contrib.turnbattle.tb_magic.CmdAttack.lock_storage" title="Permalink to this definition"></a></dt>
<dd></dd></dl>
<dl class="py attribute">
<dt id="evennia.contrib.turnbattle.tb_magic.CmdAttack.search_index_entry">
<code class="sig-name descname">search_index_entry</code><em class="property"> = {'aliases': '', 'category': 'combat', 'key': 'attack', 'tags': '', 'text': '\n Attacks another character.\n\n Usage:\n attack &lt;target&gt;\n\n When in a fight, you may attack another character. The attack has\n a chance to hit, and if successful, will deal damage.\n '}</em><a class="headerlink" href="#evennia.contrib.turnbattle.tb_magic.CmdAttack.search_index_entry" title="Permalink to this definition"></a></dt>
<dd></dd></dl>
</dd></dl>
<dl class="py class">
@ -582,7 +592,7 @@ if there are still any actions you can take.</p>
<dl class="py attribute">
<dt id="evennia.contrib.turnbattle.tb_magic.CmdPass.aliases">
<code class="sig-name descname">aliases</code><em class="property"> = ['hold', 'wait']</em><a class="headerlink" href="#evennia.contrib.turnbattle.tb_magic.CmdPass.aliases" title="Permalink to this definition"></a></dt>
<code class="sig-name descname">aliases</code><em class="property"> = ['wait', 'hold']</em><a class="headerlink" href="#evennia.contrib.turnbattle.tb_magic.CmdPass.aliases" title="Permalink to this definition"></a></dt>
<dd></dd></dl>
<dl class="py attribute">
@ -601,6 +611,11 @@ if there are still any actions you can take.</p>
<code class="sig-name descname">lock_storage</code><em class="property"> = 'cmd:all();'</em><a class="headerlink" href="#evennia.contrib.turnbattle.tb_magic.CmdPass.lock_storage" title="Permalink to this definition"></a></dt>
<dd></dd></dl>
<dl class="py attribute">
<dt id="evennia.contrib.turnbattle.tb_magic.CmdPass.search_index_entry">
<code class="sig-name descname">search_index_entry</code><em class="property"> = {'aliases': 'wait hold', 'category': 'combat', 'key': 'pass', 'tags': '', 'text': '\n Passes on your turn.\n\n Usage:\n pass\n\n When in a fight, you can use this command to end your turn early, even\n if there are still any actions you can take.\n '}</em><a class="headerlink" href="#evennia.contrib.turnbattle.tb_magic.CmdPass.search_index_entry" title="Permalink to this definition"></a></dt>
<dd></dd></dl>
</dd></dl>
<dl class="py class">
@ -641,6 +656,11 @@ fight ends.</p>
<code class="sig-name descname">lock_storage</code><em class="property"> = 'cmd:all();'</em><a class="headerlink" href="#evennia.contrib.turnbattle.tb_magic.CmdDisengage.lock_storage" title="Permalink to this definition"></a></dt>
<dd></dd></dl>
<dl class="py attribute">
<dt id="evennia.contrib.turnbattle.tb_magic.CmdDisengage.search_index_entry">
<code class="sig-name descname">search_index_entry</code><em class="property"> = {'aliases': 'spare', 'category': 'combat', 'key': 'disengage', 'tags': '', 'text': &quot;\n Passes your turn and attempts to end combat.\n\n Usage:\n disengage\n\n Ends your turn early and signals that you're trying to end\n the fight. If all participants in a fight disengage, the\n fight ends.\n &quot;}</em><a class="headerlink" href="#evennia.contrib.turnbattle.tb_magic.CmdDisengage.search_index_entry" title="Permalink to this definition"></a></dt>
<dd></dd></dl>
</dd></dl>
<dl class="py class">
@ -694,6 +714,11 @@ fight ends.</p>
<code class="sig-name descname">lock_storage</code><em class="property"> = 'cmd:all();'</em><a class="headerlink" href="#evennia.contrib.turnbattle.tb_magic.CmdLearnSpell.lock_storage" title="Permalink to this definition"></a></dt>
<dd></dd></dl>
<dl class="py attribute">
<dt id="evennia.contrib.turnbattle.tb_magic.CmdLearnSpell.search_index_entry">
<code class="sig-name descname">search_index_entry</code><em class="property"> = {'aliases': '', 'category': 'magic', 'key': 'learnspell', 'tags': '', 'text': &quot;\n Learn a magic spell.\n\n Usage:\n learnspell &lt;spell name&gt;\n\n Adds a spell by name to your list of spells known.\n\n The following spells are provided as examples:\n\n |wmagic missile|n (3 MP): Fires three missiles that never miss. Can target\n up to three different enemies.\n\n |wflame shot|n (3 MP): Shoots a high-damage jet of flame at one target.\n\n |wcure wounds|n (5 MP): Heals damage on one target.\n\n |wmass cure wounds|n (10 MP): Like 'cure wounds', but can heal up to 5\n targets at once.\n\n |wfull heal|n (12 MP): Heals one target back to full HP.\n\n |wcactus conjuration|n (2 MP): Creates a cactus.\n &quot;}</em><a class="headerlink" href="#evennia.contrib.turnbattle.tb_magic.CmdLearnSpell.search_index_entry" title="Permalink to this definition"></a></dt>
<dd></dd></dl>
</dd></dl>
<dl class="py class">
@ -741,6 +766,11 @@ function.</p>
<code class="sig-name descname">lock_storage</code><em class="property"> = 'cmd:all();'</em><a class="headerlink" href="#evennia.contrib.turnbattle.tb_magic.CmdCast.lock_storage" title="Permalink to this definition"></a></dt>
<dd></dd></dl>
<dl class="py attribute">
<dt id="evennia.contrib.turnbattle.tb_magic.CmdCast.search_index_entry">
<code class="sig-name descname">search_index_entry</code><em class="property"> = {'aliases': '', 'category': 'magic', 'key': 'cast', 'tags': '', 'text': &quot;\n Cast a magic spell that you know, provided you have the MP\n to spend on its casting.\n\n Usage:\n cast &lt;spellname&gt; [= &lt;target1&gt;, &lt;target2&gt;, etc...]\n\n Some spells can be cast on multiple targets, some can be cast\n on only yourself, and some don't need a target specified at all.\n Typing 'cast' by itself will give you a list of spells you know.\n &quot;}</em><a class="headerlink" href="#evennia.contrib.turnbattle.tb_magic.CmdCast.search_index_entry" title="Permalink to this definition"></a></dt>
<dd></dd></dl>
</dd></dl>
<dl class="py class">
@ -780,6 +810,11 @@ only rest if youre not in a fight.</p>
<code class="sig-name descname">lock_storage</code><em class="property"> = 'cmd:all();'</em><a class="headerlink" href="#evennia.contrib.turnbattle.tb_magic.CmdRest.lock_storage" title="Permalink to this definition"></a></dt>
<dd></dd></dl>
<dl class="py attribute">
<dt id="evennia.contrib.turnbattle.tb_magic.CmdRest.search_index_entry">
<code class="sig-name descname">search_index_entry</code><em class="property"> = {'aliases': '', 'category': 'combat', 'key': 'rest', 'tags': '', 'text': &quot;\n Recovers damage and restores MP.\n\n Usage:\n rest\n\n Resting recovers your HP and MP to their maximum, but you can\n only rest if you're not in a fight.\n &quot;}</em><a class="headerlink" href="#evennia.contrib.turnbattle.tb_magic.CmdRest.search_index_entry" title="Permalink to this definition"></a></dt>
<dd></dd></dl>
</dd></dl>
<dl class="py class">
@ -819,6 +854,11 @@ other targets in combat.</p>
<code class="sig-name descname">lock_storage</code><em class="property"> = 'cmd:all();'</em><a class="headerlink" href="#evennia.contrib.turnbattle.tb_magic.CmdStatus.lock_storage" title="Permalink to this definition"></a></dt>
<dd></dd></dl>
<dl class="py attribute">
<dt id="evennia.contrib.turnbattle.tb_magic.CmdStatus.search_index_entry">
<code class="sig-name descname">search_index_entry</code><em class="property"> = {'aliases': '', 'category': 'combat', 'key': 'status', 'tags': '', 'text': '\n Gives combat information.\n\n Usage:\n status\n\n Shows your current and maximum HP and your distance from\n other targets in combat.\n '}</em><a class="headerlink" href="#evennia.contrib.turnbattle.tb_magic.CmdStatus.search_index_entry" title="Permalink to this definition"></a></dt>
<dd></dd></dl>
</dd></dl>
<dl class="py class">
@ -860,6 +900,11 @@ topics related to the game.</p>
<code class="sig-name descname">lock_storage</code><em class="property"> = 'cmd:all()'</em><a class="headerlink" href="#evennia.contrib.turnbattle.tb_magic.CmdCombatHelp.lock_storage" title="Permalink to this definition"></a></dt>
<dd></dd></dl>
<dl class="py attribute">
<dt id="evennia.contrib.turnbattle.tb_magic.CmdCombatHelp.search_index_entry">
<code class="sig-name descname">search_index_entry</code><em class="property"> = {'aliases': '?', 'category': 'general', 'key': 'help', 'tags': '', 'text': '\n View help or a list of topics\n\n Usage:\n help &lt;topic or command&gt;\n help list\n help all\n\n This will search for help on commands and other\n topics related to the game.\n '}</em><a class="headerlink" href="#evennia.contrib.turnbattle.tb_magic.CmdCombatHelp.search_index_entry" title="Permalink to this definition"></a></dt>
<dd></dd></dl>
</dd></dl>
<dl class="py class">

View file

@ -814,6 +814,11 @@ When its your turn, you can attack other characters.</p>
<code class="sig-name descname">lock_storage</code><em class="property"> = 'cmd:all();'</em><a class="headerlink" href="#evennia.contrib.turnbattle.tb_range.CmdFight.lock_storage" title="Permalink to this definition"></a></dt>
<dd></dd></dl>
<dl class="py attribute">
<dt id="evennia.contrib.turnbattle.tb_range.CmdFight.search_index_entry">
<code class="sig-name descname">search_index_entry</code><em class="property"> = {'aliases': '', 'category': 'combat', 'key': 'fight', 'tags': '', 'text': &quot;\n Starts a fight with everyone in the same room as you.\n\n Usage:\n fight\n\n When you start a fight, everyone in the room who is able to\n fight is added to combat, and a turn order is randomly rolled.\n When it's your turn, you can attack other characters.\n &quot;}</em><a class="headerlink" href="#evennia.contrib.turnbattle.tb_range.CmdFight.search_index_entry" title="Permalink to this definition"></a></dt>
<dd></dd></dl>
</dd></dl>
<dl class="py class">
@ -855,6 +860,11 @@ you. Use the approach command to get closer to a target.</p>
<code class="sig-name descname">lock_storage</code><em class="property"> = 'cmd:all();'</em><a class="headerlink" href="#evennia.contrib.turnbattle.tb_range.CmdAttack.lock_storage" title="Permalink to this definition"></a></dt>
<dd></dd></dl>
<dl class="py attribute">
<dt id="evennia.contrib.turnbattle.tb_range.CmdAttack.search_index_entry">
<code class="sig-name descname">search_index_entry</code><em class="property"> = {'aliases': '', 'category': 'combat', 'key': 'attack', 'tags': '', 'text': &quot;\n Attacks another character in melee.\n\n Usage:\n attack &lt;target&gt;\n\n When in a fight, you may attack another character. The attack has\n a chance to hit, and if successful, will deal damage. You can only\n attack engaged targets - that is, targets that are right next to\n you. Use the 'approach' command to get closer to a target.\n &quot;}</em><a class="headerlink" href="#evennia.contrib.turnbattle.tb_range.CmdAttack.search_index_entry" title="Permalink to this definition"></a></dt>
<dd></dd></dl>
</dd></dl>
<dl class="py class">
@ -897,6 +907,11 @@ nearby enemies.</p>
<code class="sig-name descname">lock_storage</code><em class="property"> = 'cmd:all();'</em><a class="headerlink" href="#evennia.contrib.turnbattle.tb_range.CmdShoot.lock_storage" title="Permalink to this definition"></a></dt>
<dd></dd></dl>
<dl class="py attribute">
<dt id="evennia.contrib.turnbattle.tb_range.CmdShoot.search_index_entry">
<code class="sig-name descname">search_index_entry</code><em class="property"> = {'aliases': '', 'category': 'combat', 'key': 'shoot', 'tags': '', 'text': &quot;\n Attacks another character from range.\n\n Usage:\n shoot &lt;target&gt;\n\n When in a fight, you may shoot another character. The attack has\n a chance to hit, and if successful, will deal damage. You can attack\n any target in combat by shooting, but can't shoot if there are any\n targets engaged with you. Use the 'withdraw' command to retreat from\n nearby enemies.\n &quot;}</em><a class="headerlink" href="#evennia.contrib.turnbattle.tb_range.CmdShoot.search_index_entry" title="Permalink to this definition"></a></dt>
<dd></dd></dl>
</dd></dl>
<dl class="py class">
@ -936,6 +951,11 @@ characters you are 0 spaces away from.</p>
<code class="sig-name descname">lock_storage</code><em class="property"> = 'cmd:all();'</em><a class="headerlink" href="#evennia.contrib.turnbattle.tb_range.CmdApproach.lock_storage" title="Permalink to this definition"></a></dt>
<dd></dd></dl>
<dl class="py attribute">
<dt id="evennia.contrib.turnbattle.tb_range.CmdApproach.search_index_entry">
<code class="sig-name descname">search_index_entry</code><em class="property"> = {'aliases': '', 'category': 'combat', 'key': 'approach', 'tags': '', 'text': '\n Approaches an object.\n\n Usage:\n approach &lt;target&gt;\n\n Move one space toward a character or object. You can only attack\n characters you are 0 spaces away from.\n '}</em><a class="headerlink" href="#evennia.contrib.turnbattle.tb_range.CmdApproach.search_index_entry" title="Permalink to this definition"></a></dt>
<dd></dd></dl>
</dd></dl>
<dl class="py class">
@ -974,6 +994,11 @@ characters you are 0 spaces away from.</p>
<code class="sig-name descname">lock_storage</code><em class="property"> = 'cmd:all();'</em><a class="headerlink" href="#evennia.contrib.turnbattle.tb_range.CmdWithdraw.lock_storage" title="Permalink to this definition"></a></dt>
<dd></dd></dl>
<dl class="py attribute">
<dt id="evennia.contrib.turnbattle.tb_range.CmdWithdraw.search_index_entry">
<code class="sig-name descname">search_index_entry</code><em class="property"> = {'aliases': '', 'category': 'combat', 'key': 'withdraw', 'tags': '', 'text': '\n Moves away from an object.\n\n Usage:\n withdraw &lt;target&gt;\n\n Move one space away from a character or object.\n '}</em><a class="headerlink" href="#evennia.contrib.turnbattle.tb_range.CmdWithdraw.search_index_entry" title="Permalink to this definition"></a></dt>
<dd></dd></dl>
</dd></dl>
<dl class="py class">
@ -994,7 +1019,7 @@ if there are still any actions you can take.</p>
<dl class="py attribute">
<dt id="evennia.contrib.turnbattle.tb_range.CmdPass.aliases">
<code class="sig-name descname">aliases</code><em class="property"> = ['hold', 'wait']</em><a class="headerlink" href="#evennia.contrib.turnbattle.tb_range.CmdPass.aliases" title="Permalink to this definition"></a></dt>
<code class="sig-name descname">aliases</code><em class="property"> = ['wait', 'hold']</em><a class="headerlink" href="#evennia.contrib.turnbattle.tb_range.CmdPass.aliases" title="Permalink to this definition"></a></dt>
<dd></dd></dl>
<dl class="py attribute">
@ -1013,6 +1038,11 @@ if there are still any actions you can take.</p>
<code class="sig-name descname">lock_storage</code><em class="property"> = 'cmd:all();'</em><a class="headerlink" href="#evennia.contrib.turnbattle.tb_range.CmdPass.lock_storage" title="Permalink to this definition"></a></dt>
<dd></dd></dl>
<dl class="py attribute">
<dt id="evennia.contrib.turnbattle.tb_range.CmdPass.search_index_entry">
<code class="sig-name descname">search_index_entry</code><em class="property"> = {'aliases': 'wait hold', 'category': 'combat', 'key': 'pass', 'tags': '', 'text': '\n Passes on your turn.\n\n Usage:\n pass\n\n When in a fight, you can use this command to end your turn early, even\n if there are still any actions you can take.\n '}</em><a class="headerlink" href="#evennia.contrib.turnbattle.tb_range.CmdPass.search_index_entry" title="Permalink to this definition"></a></dt>
<dd></dd></dl>
</dd></dl>
<dl class="py class">
@ -1053,6 +1083,11 @@ fight ends.</p>
<code class="sig-name descname">lock_storage</code><em class="property"> = 'cmd:all();'</em><a class="headerlink" href="#evennia.contrib.turnbattle.tb_range.CmdDisengage.lock_storage" title="Permalink to this definition"></a></dt>
<dd></dd></dl>
<dl class="py attribute">
<dt id="evennia.contrib.turnbattle.tb_range.CmdDisengage.search_index_entry">
<code class="sig-name descname">search_index_entry</code><em class="property"> = {'aliases': 'spare', 'category': 'combat', 'key': 'disengage', 'tags': '', 'text': &quot;\n Passes your turn and attempts to end combat.\n\n Usage:\n disengage\n\n Ends your turn early and signals that you're trying to end\n the fight. If all participants in a fight disengage, the\n fight ends.\n &quot;}</em><a class="headerlink" href="#evennia.contrib.turnbattle.tb_range.CmdDisengage.search_index_entry" title="Permalink to this definition"></a></dt>
<dd></dd></dl>
</dd></dl>
<dl class="py class">
@ -1092,6 +1127,11 @@ rest if youre not in a fight.</p>
<code class="sig-name descname">lock_storage</code><em class="property"> = 'cmd:all();'</em><a class="headerlink" href="#evennia.contrib.turnbattle.tb_range.CmdRest.lock_storage" title="Permalink to this definition"></a></dt>
<dd></dd></dl>
<dl class="py attribute">
<dt id="evennia.contrib.turnbattle.tb_range.CmdRest.search_index_entry">
<code class="sig-name descname">search_index_entry</code><em class="property"> = {'aliases': '', 'category': 'combat', 'key': 'rest', 'tags': '', 'text': &quot;\n Recovers damage.\n\n Usage:\n rest\n\n Resting recovers your HP to its maximum, but you can only\n rest if you're not in a fight.\n &quot;}</em><a class="headerlink" href="#evennia.contrib.turnbattle.tb_range.CmdRest.search_index_entry" title="Permalink to this definition"></a></dt>
<dd></dd></dl>
</dd></dl>
<dl class="py class">
@ -1131,6 +1171,11 @@ other targets in combat.</p>
<code class="sig-name descname">lock_storage</code><em class="property"> = 'cmd:all();'</em><a class="headerlink" href="#evennia.contrib.turnbattle.tb_range.CmdStatus.lock_storage" title="Permalink to this definition"></a></dt>
<dd></dd></dl>
<dl class="py attribute">
<dt id="evennia.contrib.turnbattle.tb_range.CmdStatus.search_index_entry">
<code class="sig-name descname">search_index_entry</code><em class="property"> = {'aliases': '', 'category': 'combat', 'key': 'status', 'tags': '', 'text': '\n Gives combat information.\n\n Usage:\n status\n\n Shows your current and maximum HP and your distance from\n other targets in combat.\n '}</em><a class="headerlink" href="#evennia.contrib.turnbattle.tb_range.CmdStatus.search_index_entry" title="Permalink to this definition"></a></dt>
<dd></dd></dl>
</dd></dl>
<dl class="py class">
@ -1172,6 +1217,11 @@ topics related to the game.</p>
<code class="sig-name descname">lock_storage</code><em class="property"> = 'cmd:all()'</em><a class="headerlink" href="#evennia.contrib.turnbattle.tb_range.CmdCombatHelp.lock_storage" title="Permalink to this definition"></a></dt>
<dd></dd></dl>
<dl class="py attribute">
<dt id="evennia.contrib.turnbattle.tb_range.CmdCombatHelp.search_index_entry">
<code class="sig-name descname">search_index_entry</code><em class="property"> = {'aliases': '?', 'category': 'general', 'key': 'help', 'tags': '', 'text': '\n View help or a list of topics\n\n Usage:\n help &lt;topic or command&gt;\n help list\n help all\n\n This will search for help on commands and other\n topics related to the game.\n '}</em><a class="headerlink" href="#evennia.contrib.turnbattle.tb_range.CmdCombatHelp.search_index_entry" title="Permalink to this definition"></a></dt>
<dd></dd></dl>
</dd></dl>
<dl class="py class">

View file

@ -86,6 +86,11 @@ push the lid of the button away.</p>
<code class="sig-name descname">lock_storage</code><em class="property"> = 'cmd:all()'</em><a class="headerlink" href="#evennia.contrib.tutorial_examples.cmdset_red_button.CmdNudge.lock_storage" title="Permalink to this definition"></a></dt>
<dd></dd></dl>
<dl class="py attribute">
<dt id="evennia.contrib.tutorial_examples.cmdset_red_button.CmdNudge.search_index_entry">
<code class="sig-name descname">search_index_entry</code><em class="property"> = {'aliases': 'nudge', 'category': 'general', 'key': 'nudge lid', 'tags': '', 'text': &quot;\n Try to nudge the button's lid\n\n Usage:\n nudge lid\n\n This command will have you try to\n push the lid of the button away.\n &quot;}</em><a class="headerlink" href="#evennia.contrib.tutorial_examples.cmdset_red_button.CmdNudge.search_index_entry" title="Permalink to this definition"></a></dt>
<dd></dd></dl>
</dd></dl>
<dl class="py class">
@ -104,7 +109,7 @@ push the lid of the button away.</p>
<dl class="py attribute">
<dt id="evennia.contrib.tutorial_examples.cmdset_red_button.CmdPush.aliases">
<code class="sig-name descname">aliases</code><em class="property"> = ['push', 'press', 'press button']</em><a class="headerlink" href="#evennia.contrib.tutorial_examples.cmdset_red_button.CmdPush.aliases" title="Permalink to this definition"></a></dt>
<code class="sig-name descname">aliases</code><em class="property"> = ['press button', 'push', 'press']</em><a class="headerlink" href="#evennia.contrib.tutorial_examples.cmdset_red_button.CmdPush.aliases" title="Permalink to this definition"></a></dt>
<dd></dd></dl>
<dl class="py attribute">
@ -133,6 +138,11 @@ lid-state respectively.</p>
<code class="sig-name descname">lock_storage</code><em class="property"> = 'cmd:all()'</em><a class="headerlink" href="#evennia.contrib.tutorial_examples.cmdset_red_button.CmdPush.lock_storage" title="Permalink to this definition"></a></dt>
<dd></dd></dl>
<dl class="py attribute">
<dt id="evennia.contrib.tutorial_examples.cmdset_red_button.CmdPush.search_index_entry">
<code class="sig-name descname">search_index_entry</code><em class="property"> = {'aliases': 'press button push press', 'category': 'general', 'key': 'push button', 'tags': '', 'text': '\n Push the red button\n\n Usage:\n push button\n\n '}</em><a class="headerlink" href="#evennia.contrib.tutorial_examples.cmdset_red_button.CmdPush.search_index_entry" title="Permalink to this definition"></a></dt>
<dd></dd></dl>
</dd></dl>
<dl class="py class">
@ -177,6 +187,11 @@ of causing the lamp to break.</p>
<code class="sig-name descname">lock_storage</code><em class="property"> = 'cmd:all()'</em><a class="headerlink" href="#evennia.contrib.tutorial_examples.cmdset_red_button.CmdSmashGlass.lock_storage" title="Permalink to this definition"></a></dt>
<dd></dd></dl>
<dl class="py attribute">
<dt id="evennia.contrib.tutorial_examples.cmdset_red_button.CmdSmashGlass.search_index_entry">
<code class="sig-name descname">search_index_entry</code><em class="property"> = {'aliases': 'smash lid break lid smash', 'category': 'general', 'key': 'smash glass', 'tags': '', 'text': '\n smash glass\n\n Usage:\n smash glass\n\n Try to smash the glass of the button.\n '}</em><a class="headerlink" href="#evennia.contrib.tutorial_examples.cmdset_red_button.CmdSmashGlass.search_index_entry" title="Permalink to this definition"></a></dt>
<dd></dd></dl>
</dd></dl>
<dl class="py class">
@ -195,7 +210,7 @@ of causing the lamp to break.</p>
<dl class="py attribute">
<dt id="evennia.contrib.tutorial_examples.cmdset_red_button.CmdOpenLid.aliases">
<code class="sig-name descname">aliases</code><em class="property"> = ['open button', 'open']</em><a class="headerlink" href="#evennia.contrib.tutorial_examples.cmdset_red_button.CmdOpenLid.aliases" title="Permalink to this definition"></a></dt>
<code class="sig-name descname">aliases</code><em class="property"> = ['open', 'open button']</em><a class="headerlink" href="#evennia.contrib.tutorial_examples.cmdset_red_button.CmdOpenLid.aliases" title="Permalink to this definition"></a></dt>
<dd></dd></dl>
<dl class="py attribute">
@ -219,6 +234,11 @@ of causing the lamp to break.</p>
<code class="sig-name descname">lock_storage</code><em class="property"> = 'cmd:all()'</em><a class="headerlink" href="#evennia.contrib.tutorial_examples.cmdset_red_button.CmdOpenLid.lock_storage" title="Permalink to this definition"></a></dt>
<dd></dd></dl>
<dl class="py attribute">
<dt id="evennia.contrib.tutorial_examples.cmdset_red_button.CmdOpenLid.search_index_entry">
<code class="sig-name descname">search_index_entry</code><em class="property"> = {'aliases': 'open open button', 'category': 'general', 'key': 'open lid', 'tags': '', 'text': '\n open lid\n\n Usage:\n open lid\n\n '}</em><a class="headerlink" href="#evennia.contrib.tutorial_examples.cmdset_red_button.CmdOpenLid.search_index_entry" title="Permalink to this definition"></a></dt>
<dd></dd></dl>
</dd></dl>
<dl class="py class">
@ -262,6 +282,11 @@ of causing the lamp to break.</p>
<code class="sig-name descname">lock_storage</code><em class="property"> = 'cmd:all()'</em><a class="headerlink" href="#evennia.contrib.tutorial_examples.cmdset_red_button.CmdCloseLid.lock_storage" title="Permalink to this definition"></a></dt>
<dd></dd></dl>
<dl class="py attribute">
<dt id="evennia.contrib.tutorial_examples.cmdset_red_button.CmdCloseLid.search_index_entry">
<code class="sig-name descname">search_index_entry</code><em class="property"> = {'aliases': 'close', 'category': 'general', 'key': 'close lid', 'tags': '', 'text': '\n close the lid\n\n Usage:\n close lid\n\n Closes the lid of the red button.\n '}</em><a class="headerlink" href="#evennia.contrib.tutorial_examples.cmdset_red_button.CmdCloseLid.search_index_entry" title="Permalink to this definition"></a></dt>
<dd></dd></dl>
</dd></dl>
<dl class="py class">
@ -281,7 +306,7 @@ of causing the lamp to break.</p>
<dl class="py attribute">
<dt id="evennia.contrib.tutorial_examples.cmdset_red_button.CmdBlindLook.aliases">
<code class="sig-name descname">aliases</code><em class="property"> = ['listen', 'feel', 'ex', 'get', 'examine', 'l']</em><a class="headerlink" href="#evennia.contrib.tutorial_examples.cmdset_red_button.CmdBlindLook.aliases" title="Permalink to this definition"></a></dt>
<code class="sig-name descname">aliases</code><em class="property"> = ['examine', 'l', 'listen', 'get', 'ex', 'feel']</em><a class="headerlink" href="#evennia.contrib.tutorial_examples.cmdset_red_button.CmdBlindLook.aliases" title="Permalink to this definition"></a></dt>
<dd></dd></dl>
<dl class="py attribute">
@ -305,6 +330,11 @@ of causing the lamp to break.</p>
<code class="sig-name descname">lock_storage</code><em class="property"> = 'cmd:all()'</em><a class="headerlink" href="#evennia.contrib.tutorial_examples.cmdset_red_button.CmdBlindLook.lock_storage" title="Permalink to this definition"></a></dt>
<dd></dd></dl>
<dl class="py attribute">
<dt id="evennia.contrib.tutorial_examples.cmdset_red_button.CmdBlindLook.search_index_entry">
<code class="sig-name descname">search_index_entry</code><em class="property"> = {'aliases': 'examine l listen get ex feel', 'category': 'general', 'key': 'look', 'tags': '', 'text': &quot;\n Looking around in darkness\n\n Usage:\n look &lt;obj&gt;\n\n ... not that there's much to see in the dark.\n\n &quot;}</em><a class="headerlink" href="#evennia.contrib.tutorial_examples.cmdset_red_button.CmdBlindLook.search_index_entry" title="Permalink to this definition"></a></dt>
<dd></dd></dl>
</dd></dl>
<dl class="py class">
@ -347,6 +377,11 @@ of causing the lamp to break.</p>
<code class="sig-name descname">lock_storage</code><em class="property"> = 'cmd:all()'</em><a class="headerlink" href="#evennia.contrib.tutorial_examples.cmdset_red_button.CmdBlindHelp.lock_storage" title="Permalink to this definition"></a></dt>
<dd></dd></dl>
<dl class="py attribute">
<dt id="evennia.contrib.tutorial_examples.cmdset_red_button.CmdBlindHelp.search_index_entry">
<code class="sig-name descname">search_index_entry</code><em class="property"> = {'aliases': 'h', 'category': 'general', 'key': 'help', 'tags': '', 'text': '\n Help function while in the blinded state\n\n Usage:\n help\n\n '}</em><a class="headerlink" href="#evennia.contrib.tutorial_examples.cmdset_red_button.CmdBlindHelp.search_index_entry" title="Permalink to this definition"></a></dt>
<dd></dd></dl>
</dd></dl>
<dl class="py class">

View file

@ -87,6 +87,11 @@ to turn on/off the mob.”</p>
<code class="sig-name descname">lock_storage</code><em class="property"> = 'cmd:superuser()'</em><a class="headerlink" href="#evennia.contrib.tutorial_world.mob.CmdMobOnOff.lock_storage" title="Permalink to this definition"></a></dt>
<dd></dd></dl>
<dl class="py attribute">
<dt id="evennia.contrib.tutorial_world.mob.CmdMobOnOff.search_index_entry">
<code class="sig-name descname">search_index_entry</code><em class="property"> = {'aliases': 'moboff', 'category': 'general', 'key': 'mobon', 'tags': '', 'text': &quot;\n Activates/deactivates Mob\n\n Usage:\n mobon &lt;mob&gt;\n moboff &lt;mob&gt;\n\n This turns the mob from active (alive) mode\n to inactive (dead) mode. It is used during\n building to activate the mob once it's\n prepared.\n &quot;}</em><a class="headerlink" href="#evennia.contrib.tutorial_world.mob.CmdMobOnOff.search_index_entry" title="Permalink to this definition"></a></dt>
<dd></dd></dl>
</dd></dl>
<dl class="py class">
@ -122,7 +127,7 @@ the way it came. If unset, the mob will remain
stationary (idling) until attacked.</p>
</dd>
<dt>aggressive: if set, will attack Characters in</dt><dd><p>the same room using whatever Weapon it
carries (see tutorial_world.objects.Weapon).
carries (see tutorial_world.objects.TutorialWeapon).
if unset, the mob will never engage in combat
no matter what.</p>
</dd>

View file

@ -49,8 +49,8 @@ TutorialClimbable
Obelisk
LightSource
CrumblingWall
Weapon
WeaponRack</p>
TutorialWeapon
TutorialWeaponRack</p>
<dl class="py class">
<dt id="evennia.contrib.tutorial_world.objects.TutorialObject">
<em class="property">class </em><code class="sig-prename descclassname">evennia.contrib.tutorial_world.objects.</code><code class="sig-name descname">TutorialObject</code><span class="sig-paren">(</span><em class="sig-param"><span class="o">*</span><span class="n">args</span></em>, <em class="sig-param"><span class="o">**</span><span class="n">kwargs</span></em><span class="sig-paren">)</span><a class="reference internal" href="../_modules/evennia/contrib/tutorial_world/objects.html#TutorialObject"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#evennia.contrib.tutorial_world.objects.TutorialObject" title="Permalink to this definition"></a></dt>
@ -133,6 +133,11 @@ Attribute “readable_text” on the object and displays that.</p>
<code class="sig-name descname">lock_storage</code><em class="property"> = 'cmd:all()'</em><a class="headerlink" href="#evennia.contrib.tutorial_world.objects.CmdRead.lock_storage" title="Permalink to this definition"></a></dt>
<dd></dd></dl>
<dl class="py attribute">
<dt id="evennia.contrib.tutorial_world.objects.CmdRead.search_index_entry">
<code class="sig-name descname">search_index_entry</code><em class="property"> = {'aliases': '', 'category': 'tutorialworld', 'key': 'read', 'tags': '', 'text': '\n Usage:\n read [obj]\n\n Read some text of a readable object.\n '}</em><a class="headerlink" href="#evennia.contrib.tutorial_world.objects.CmdRead.search_index_entry" title="Permalink to this definition"></a></dt>
<dd></dd></dl>
</dd></dl>
<dl class="py class">
@ -230,6 +235,11 @@ Attribute and add the readable cmdset.</p>
<code class="sig-name descname">lock_storage</code><em class="property"> = 'cmd:all()'</em><a class="headerlink" href="#evennia.contrib.tutorial_world.objects.CmdClimb.lock_storage" title="Permalink to this definition"></a></dt>
<dd></dd></dl>
<dl class="py attribute">
<dt id="evennia.contrib.tutorial_world.objects.CmdClimb.search_index_entry">
<code class="sig-name descname">search_index_entry</code><em class="property"> = {'aliases': '', 'category': 'tutorialworld', 'key': 'climb', 'tags': '', 'text': '\n Climb an object\n\n Usage:\n climb &lt;object&gt;\n\n This allows you to climb.\n '}</em><a class="headerlink" href="#evennia.contrib.tutorial_world.objects.CmdClimb.search_index_entry" title="Permalink to this definition"></a></dt>
<dd></dd></dl>
</dd></dl>
<dl class="py class">
@ -350,7 +360,7 @@ of the object. We overload it with our own version.</p>
<dl class="py attribute">
<dt id="evennia.contrib.tutorial_world.objects.CmdLight.aliases">
<code class="sig-name descname">aliases</code><em class="property"> = ['light', 'burn']</em><a class="headerlink" href="#evennia.contrib.tutorial_world.objects.CmdLight.aliases" title="Permalink to this definition"></a></dt>
<code class="sig-name descname">aliases</code><em class="property"> = ['burn', 'light']</em><a class="headerlink" href="#evennia.contrib.tutorial_world.objects.CmdLight.aliases" title="Permalink to this definition"></a></dt>
<dd></dd></dl>
<dl class="py attribute">
@ -375,6 +385,11 @@ to sit on a “lightable” object, we operate only on self.obj.</p>
<code class="sig-name descname">lock_storage</code><em class="property"> = 'cmd:holds()'</em><a class="headerlink" href="#evennia.contrib.tutorial_world.objects.CmdLight.lock_storage" title="Permalink to this definition"></a></dt>
<dd></dd></dl>
<dl class="py attribute">
<dt id="evennia.contrib.tutorial_world.objects.CmdLight.search_index_entry">
<code class="sig-name descname">search_index_entry</code><em class="property"> = {'aliases': 'burn light', 'category': 'tutorialworld', 'key': 'on', 'tags': '', 'text': '\n Creates light where there was none. Something to burn.\n '}</em><a class="headerlink" href="#evennia.contrib.tutorial_world.objects.CmdLight.search_index_entry" title="Permalink to this definition"></a></dt>
<dd></dd></dl>
</dd></dl>
<dl class="py class">
@ -476,7 +491,7 @@ shift green root up/down</p>
<dl class="py attribute">
<dt id="evennia.contrib.tutorial_world.objects.CmdShiftRoot.aliases">
<code class="sig-name descname">aliases</code><em class="property"> = ['shiftroot', 'move', 'push', 'pull']</em><a class="headerlink" href="#evennia.contrib.tutorial_world.objects.CmdShiftRoot.aliases" title="Permalink to this definition"></a></dt>
<code class="sig-name descname">aliases</code><em class="property"> = ['move', 'push', 'pull', 'shiftroot']</em><a class="headerlink" href="#evennia.contrib.tutorial_world.objects.CmdShiftRoot.aliases" title="Permalink to this definition"></a></dt>
<dd></dd></dl>
<dl class="py attribute">
@ -510,6 +525,11 @@ yellow/green - horizontal roots</p>
<code class="sig-name descname">lock_storage</code><em class="property"> = 'cmd:locattr(is_lit)'</em><a class="headerlink" href="#evennia.contrib.tutorial_world.objects.CmdShiftRoot.lock_storage" title="Permalink to this definition"></a></dt>
<dd></dd></dl>
<dl class="py attribute">
<dt id="evennia.contrib.tutorial_world.objects.CmdShiftRoot.search_index_entry">
<code class="sig-name descname">search_index_entry</code><em class="property"> = {'aliases': 'move push pull shiftroot', 'category': 'tutorialworld', 'key': 'shift', 'tags': '', 'text': '\n Shifts roots around.\n\n Usage:\n shift blue root left/right\n shift red root left/right\n shift yellow root up/down\n shift green root up/down\n\n '}</em><a class="headerlink" href="#evennia.contrib.tutorial_world.objects.CmdShiftRoot.search_index_entry" title="Permalink to this definition"></a></dt>
<dd></dd></dl>
</dd></dl>
<dl class="py class">
@ -524,7 +544,7 @@ yellow/green - horizontal roots</p>
<dl class="py attribute">
<dt id="evennia.contrib.tutorial_world.objects.CmdPressButton.aliases">
<code class="sig-name descname">aliases</code><em class="property"> = ['button', 'push button', 'press button']</em><a class="headerlink" href="#evennia.contrib.tutorial_world.objects.CmdPressButton.aliases" title="Permalink to this definition"></a></dt>
<code class="sig-name descname">aliases</code><em class="property"> = ['push button', 'press button', 'button']</em><a class="headerlink" href="#evennia.contrib.tutorial_world.objects.CmdPressButton.aliases" title="Permalink to this definition"></a></dt>
<dd></dd></dl>
<dl class="py attribute">
@ -548,6 +568,11 @@ yellow/green - horizontal roots</p>
<code class="sig-name descname">lock_storage</code><em class="property"> = 'cmd:objattr(button_exposed) and objlocattr(is_lit)'</em><a class="headerlink" href="#evennia.contrib.tutorial_world.objects.CmdPressButton.lock_storage" title="Permalink to this definition"></a></dt>
<dd></dd></dl>
<dl class="py attribute">
<dt id="evennia.contrib.tutorial_world.objects.CmdPressButton.search_index_entry">
<code class="sig-name descname">search_index_entry</code><em class="property"> = {'aliases': 'push button press button button', 'category': 'tutorialworld', 'key': 'press', 'tags': '', 'text': '\n Presses a button.\n '}</em><a class="headerlink" href="#evennia.contrib.tutorial_world.objects.CmdPressButton.search_index_entry" title="Permalink to this definition"></a></dt>
<dd></dd></dl>
</dd></dl>
<dl class="py class">
@ -689,7 +714,7 @@ parry - forgoes your attack but will make you harder to hit on next</p>
<dl class="py attribute">
<dt id="evennia.contrib.tutorial_world.objects.CmdAttack.aliases">
<code class="sig-name descname">aliases</code><em class="property"> = ['fight', 'parry', 'kill', 'defend', 'thrust', 'chop', 'bash', 'stab', 'hit', 'slash', 'pierce']</em><a class="headerlink" href="#evennia.contrib.tutorial_world.objects.CmdAttack.aliases" title="Permalink to this definition"></a></dt>
<code class="sig-name descname">aliases</code><em class="property"> = ['thrust', 'parry', 'defend', 'stab', 'kill', 'slash', 'hit', 'pierce', 'chop', 'bash', 'fight']</em><a class="headerlink" href="#evennia.contrib.tutorial_world.objects.CmdAttack.aliases" title="Permalink to this definition"></a></dt>
<dd></dd></dl>
<dl class="py attribute">
@ -713,6 +738,11 @@ parry - forgoes your attack but will make you harder to hit on next</p>
<code class="sig-name descname">lock_storage</code><em class="property"> = 'cmd:all()'</em><a class="headerlink" href="#evennia.contrib.tutorial_world.objects.CmdAttack.lock_storage" title="Permalink to this definition"></a></dt>
<dd></dd></dl>
<dl class="py attribute">
<dt id="evennia.contrib.tutorial_world.objects.CmdAttack.search_index_entry">
<code class="sig-name descname">search_index_entry</code><em class="property"> = {'aliases': 'thrust parry defend stab kill slash hit pierce chop bash fight', 'category': 'tutorialworld', 'key': 'attack', 'tags': '', 'text': '\n Attack the enemy. Commands:\n\n stab &lt;enemy&gt;\n slash &lt;enemy&gt;\n parry\n\n stab - (thrust) makes a lot of damage but is harder to hit with.\n slash - is easier to land, but does not make as much damage.\n parry - forgoes your attack but will make you harder to hit on next\n enemy attack.\n\n '}</em><a class="headerlink" href="#evennia.contrib.tutorial_world.objects.CmdAttack.search_index_entry" title="Permalink to this definition"></a></dt>
<dd></dd></dl>
</dd></dl>
<dl class="py class">
@ -734,8 +764,8 @@ parry - forgoes your attack but will make you harder to hit on next</p>
</dd></dl>
<dl class="py class">
<dt id="evennia.contrib.tutorial_world.objects.Weapon">
<em class="property">class </em><code class="sig-prename descclassname">evennia.contrib.tutorial_world.objects.</code><code class="sig-name descname">Weapon</code><span class="sig-paren">(</span><em class="sig-param"><span class="o">*</span><span class="n">args</span></em>, <em class="sig-param"><span class="o">**</span><span class="n">kwargs</span></em><span class="sig-paren">)</span><a class="reference internal" href="../_modules/evennia/contrib/tutorial_world/objects.html#Weapon"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#evennia.contrib.tutorial_world.objects.Weapon" title="Permalink to this definition"></a></dt>
<dt id="evennia.contrib.tutorial_world.objects.TutorialWeapon">
<em class="property">class </em><code class="sig-prename descclassname">evennia.contrib.tutorial_world.objects.</code><code class="sig-name descname">TutorialWeapon</code><span class="sig-paren">(</span><em class="sig-param"><span class="o">*</span><span class="n">args</span></em>, <em class="sig-param"><span class="o">**</span><span class="n">kwargs</span></em><span class="sig-paren">)</span><a class="reference internal" href="../_modules/evennia/contrib/tutorial_world/objects.html#TutorialWeapon"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#evennia.contrib.tutorial_world.objects.TutorialWeapon" title="Permalink to this definition"></a></dt>
<dd><p>Bases: <a class="reference internal" href="#evennia.contrib.tutorial_world.objects.TutorialObject" title="evennia.contrib.tutorial_world.objects.TutorialObject"><code class="xref py py-class docutils literal notranslate"><span class="pre">evennia.contrib.tutorial_world.objects.TutorialObject</span></code></a></p>
<p>This defines a bladed weapon.</p>
<dl>
@ -748,38 +778,38 @@ damage - base damage given (modified by hit success and</p>
</dd>
</dl>
<dl class="py method">
<dt id="evennia.contrib.tutorial_world.objects.Weapon.at_object_creation">
<code class="sig-name descname">at_object_creation</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="reference internal" href="../_modules/evennia/contrib/tutorial_world/objects.html#Weapon.at_object_creation"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#evennia.contrib.tutorial_world.objects.Weapon.at_object_creation" title="Permalink to this definition"></a></dt>
<dt id="evennia.contrib.tutorial_world.objects.TutorialWeapon.at_object_creation">
<code class="sig-name descname">at_object_creation</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="reference internal" href="../_modules/evennia/contrib/tutorial_world/objects.html#TutorialWeapon.at_object_creation"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#evennia.contrib.tutorial_world.objects.TutorialWeapon.at_object_creation" title="Permalink to this definition"></a></dt>
<dd><p>Called at first creation of the object</p>
</dd></dl>
<dl class="py method">
<dt id="evennia.contrib.tutorial_world.objects.Weapon.reset">
<code class="sig-name descname">reset</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="reference internal" href="../_modules/evennia/contrib/tutorial_world/objects.html#Weapon.reset"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#evennia.contrib.tutorial_world.objects.Weapon.reset" title="Permalink to this definition"></a></dt>
<dt id="evennia.contrib.tutorial_world.objects.TutorialWeapon.reset">
<code class="sig-name descname">reset</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="reference internal" href="../_modules/evennia/contrib/tutorial_world/objects.html#TutorialWeapon.reset"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#evennia.contrib.tutorial_world.objects.TutorialWeapon.reset" title="Permalink to this definition"></a></dt>
<dd><p>When reset, the weapon is simply deleted, unless it has a place
to return to.</p>
</dd></dl>
<dl class="py exception">
<dt id="evennia.contrib.tutorial_world.objects.Weapon.DoesNotExist">
<em class="property">exception </em><code class="sig-name descname">DoesNotExist</code><a class="headerlink" href="#evennia.contrib.tutorial_world.objects.Weapon.DoesNotExist" title="Permalink to this definition"></a></dt>
<dt id="evennia.contrib.tutorial_world.objects.TutorialWeapon.DoesNotExist">
<em class="property">exception </em><code class="sig-name descname">DoesNotExist</code><a class="headerlink" href="#evennia.contrib.tutorial_world.objects.TutorialWeapon.DoesNotExist" title="Permalink to this definition"></a></dt>
<dd><p>Bases: <a class="reference internal" href="#evennia.contrib.tutorial_world.objects.TutorialObject.DoesNotExist" title="evennia.contrib.tutorial_world.objects.TutorialObject.DoesNotExist"><code class="xref py py-class docutils literal notranslate"><span class="pre">evennia.contrib.tutorial_world.objects.TutorialObject.DoesNotExist</span></code></a></p>
</dd></dl>
<dl class="py exception">
<dt id="evennia.contrib.tutorial_world.objects.Weapon.MultipleObjectsReturned">
<em class="property">exception </em><code class="sig-name descname">MultipleObjectsReturned</code><a class="headerlink" href="#evennia.contrib.tutorial_world.objects.Weapon.MultipleObjectsReturned" title="Permalink to this definition"></a></dt>
<dt id="evennia.contrib.tutorial_world.objects.TutorialWeapon.MultipleObjectsReturned">
<em class="property">exception </em><code class="sig-name descname">MultipleObjectsReturned</code><a class="headerlink" href="#evennia.contrib.tutorial_world.objects.TutorialWeapon.MultipleObjectsReturned" title="Permalink to this definition"></a></dt>
<dd><p>Bases: <a class="reference internal" href="#evennia.contrib.tutorial_world.objects.TutorialObject.MultipleObjectsReturned" title="evennia.contrib.tutorial_world.objects.TutorialObject.MultipleObjectsReturned"><code class="xref py py-class docutils literal notranslate"><span class="pre">evennia.contrib.tutorial_world.objects.TutorialObject.MultipleObjectsReturned</span></code></a></p>
</dd></dl>
<dl class="py attribute">
<dt id="evennia.contrib.tutorial_world.objects.Weapon.path">
<code class="sig-name descname">path</code><em class="property"> = 'evennia.contrib.tutorial_world.objects.Weapon'</em><a class="headerlink" href="#evennia.contrib.tutorial_world.objects.Weapon.path" title="Permalink to this definition"></a></dt>
<dt id="evennia.contrib.tutorial_world.objects.TutorialWeapon.path">
<code class="sig-name descname">path</code><em class="property"> = 'evennia.contrib.tutorial_world.objects.TutorialWeapon'</em><a class="headerlink" href="#evennia.contrib.tutorial_world.objects.TutorialWeapon.path" title="Permalink to this definition"></a></dt>
<dd></dd></dl>
<dl class="py attribute">
<dt id="evennia.contrib.tutorial_world.objects.Weapon.typename">
<code class="sig-name descname">typename</code><em class="property"> = 'Weapon'</em><a class="headerlink" href="#evennia.contrib.tutorial_world.objects.Weapon.typename" title="Permalink to this definition"></a></dt>
<dt id="evennia.contrib.tutorial_world.objects.TutorialWeapon.typename">
<code class="sig-name descname">typename</code><em class="property"> = 'TutorialWeapon'</em><a class="headerlink" href="#evennia.contrib.tutorial_world.objects.TutorialWeapon.typename" title="Permalink to this definition"></a></dt>
<dd></dd></dl>
</dd></dl>
@ -825,6 +855,11 @@ itself handle all messages.</p>
<code class="sig-name descname">lock_storage</code><em class="property"> = 'cmd:all()'</em><a class="headerlink" href="#evennia.contrib.tutorial_world.objects.CmdGetWeapon.lock_storage" title="Permalink to this definition"></a></dt>
<dd></dd></dl>
<dl class="py attribute">
<dt id="evennia.contrib.tutorial_world.objects.CmdGetWeapon.search_index_entry">
<code class="sig-name descname">search_index_entry</code><em class="property"> = {'aliases': '', 'category': 'tutorialworld', 'key': 'get weapon', 'tags': '', 'text': '\n Usage:\n get weapon\n\n This will try to obtain a weapon from the container.\n '}</em><a class="headerlink" href="#evennia.contrib.tutorial_world.objects.CmdGetWeapon.search_index_entry" title="Permalink to this definition"></a></dt>
<dd></dd></dl>
</dd></dl>
<dl class="py class">
@ -851,8 +886,8 @@ itself handle all messages.</p>
</dd></dl>
<dl class="py class">
<dt id="evennia.contrib.tutorial_world.objects.WeaponRack">
<em class="property">class </em><code class="sig-prename descclassname">evennia.contrib.tutorial_world.objects.</code><code class="sig-name descname">WeaponRack</code><span class="sig-paren">(</span><em class="sig-param"><span class="o">*</span><span class="n">args</span></em>, <em class="sig-param"><span class="o">**</span><span class="n">kwargs</span></em><span class="sig-paren">)</span><a class="reference internal" href="../_modules/evennia/contrib/tutorial_world/objects.html#WeaponRack"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#evennia.contrib.tutorial_world.objects.WeaponRack" title="Permalink to this definition"></a></dt>
<dt id="evennia.contrib.tutorial_world.objects.TutorialWeaponRack">
<em class="property">class </em><code class="sig-prename descclassname">evennia.contrib.tutorial_world.objects.</code><code class="sig-name descname">TutorialWeaponRack</code><span class="sig-paren">(</span><em class="sig-param"><span class="o">*</span><span class="n">args</span></em>, <em class="sig-param"><span class="o">**</span><span class="n">kwargs</span></em><span class="sig-paren">)</span><a class="reference internal" href="../_modules/evennia/contrib/tutorial_world/objects.html#TutorialWeaponRack"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#evennia.contrib.tutorial_world.objects.TutorialWeaponRack" title="Permalink to this definition"></a></dt>
<dd><p>Bases: <a class="reference internal" href="#evennia.contrib.tutorial_world.objects.TutorialObject" title="evennia.contrib.tutorial_world.objects.TutorialObject"><code class="xref py py-class docutils literal notranslate"><span class="pre">evennia.contrib.tutorial_world.objects.TutorialObject</span></code></a></p>
<p>This object represents a weapon store. When people use the
“get weapon” command on this rack, it will produce one
@ -870,14 +905,14 @@ grab another one.</p>
</dd>
</dl>
<dl class="py method">
<dt id="evennia.contrib.tutorial_world.objects.WeaponRack.at_object_creation">
<code class="sig-name descname">at_object_creation</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="reference internal" href="../_modules/evennia/contrib/tutorial_world/objects.html#WeaponRack.at_object_creation"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#evennia.contrib.tutorial_world.objects.WeaponRack.at_object_creation" title="Permalink to this definition"></a></dt>
<dt id="evennia.contrib.tutorial_world.objects.TutorialWeaponRack.at_object_creation">
<code class="sig-name descname">at_object_creation</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="reference internal" href="../_modules/evennia/contrib/tutorial_world/objects.html#TutorialWeaponRack.at_object_creation"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#evennia.contrib.tutorial_world.objects.TutorialWeaponRack.at_object_creation" title="Permalink to this definition"></a></dt>
<dd><p>called at creation</p>
</dd></dl>
<dl class="py method">
<dt id="evennia.contrib.tutorial_world.objects.WeaponRack.produce_weapon">
<code class="sig-name descname">produce_weapon</code><span class="sig-paren">(</span><em class="sig-param"><span class="n">caller</span></em><span class="sig-paren">)</span><a class="reference internal" href="../_modules/evennia/contrib/tutorial_world/objects.html#WeaponRack.produce_weapon"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#evennia.contrib.tutorial_world.objects.WeaponRack.produce_weapon" title="Permalink to this definition"></a></dt>
<dt id="evennia.contrib.tutorial_world.objects.TutorialWeaponRack.produce_weapon">
<code class="sig-name descname">produce_weapon</code><span class="sig-paren">(</span><em class="sig-param"><span class="n">caller</span></em><span class="sig-paren">)</span><a class="reference internal" href="../_modules/evennia/contrib/tutorial_world/objects.html#TutorialWeaponRack.produce_weapon"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#evennia.contrib.tutorial_world.objects.TutorialWeaponRack.produce_weapon" title="Permalink to this definition"></a></dt>
<dd><p>This will produce a new weapon from the rack,
assuming the caller hasnt already gotten one. When
doing so, the caller will get Tagged with the id
@ -886,25 +921,25 @@ pulling weapons from it indefinitely.</p>
</dd></dl>
<dl class="py exception">
<dt id="evennia.contrib.tutorial_world.objects.WeaponRack.DoesNotExist">
<em class="property">exception </em><code class="sig-name descname">DoesNotExist</code><a class="headerlink" href="#evennia.contrib.tutorial_world.objects.WeaponRack.DoesNotExist" title="Permalink to this definition"></a></dt>
<dt id="evennia.contrib.tutorial_world.objects.TutorialWeaponRack.DoesNotExist">
<em class="property">exception </em><code class="sig-name descname">DoesNotExist</code><a class="headerlink" href="#evennia.contrib.tutorial_world.objects.TutorialWeaponRack.DoesNotExist" title="Permalink to this definition"></a></dt>
<dd><p>Bases: <a class="reference internal" href="#evennia.contrib.tutorial_world.objects.TutorialObject.DoesNotExist" title="evennia.contrib.tutorial_world.objects.TutorialObject.DoesNotExist"><code class="xref py py-class docutils literal notranslate"><span class="pre">evennia.contrib.tutorial_world.objects.TutorialObject.DoesNotExist</span></code></a></p>
</dd></dl>
<dl class="py exception">
<dt id="evennia.contrib.tutorial_world.objects.WeaponRack.MultipleObjectsReturned">
<em class="property">exception </em><code class="sig-name descname">MultipleObjectsReturned</code><a class="headerlink" href="#evennia.contrib.tutorial_world.objects.WeaponRack.MultipleObjectsReturned" title="Permalink to this definition"></a></dt>
<dt id="evennia.contrib.tutorial_world.objects.TutorialWeaponRack.MultipleObjectsReturned">
<em class="property">exception </em><code class="sig-name descname">MultipleObjectsReturned</code><a class="headerlink" href="#evennia.contrib.tutorial_world.objects.TutorialWeaponRack.MultipleObjectsReturned" title="Permalink to this definition"></a></dt>
<dd><p>Bases: <a class="reference internal" href="#evennia.contrib.tutorial_world.objects.TutorialObject.MultipleObjectsReturned" title="evennia.contrib.tutorial_world.objects.TutorialObject.MultipleObjectsReturned"><code class="xref py py-class docutils literal notranslate"><span class="pre">evennia.contrib.tutorial_world.objects.TutorialObject.MultipleObjectsReturned</span></code></a></p>
</dd></dl>
<dl class="py attribute">
<dt id="evennia.contrib.tutorial_world.objects.WeaponRack.path">
<code class="sig-name descname">path</code><em class="property"> = 'evennia.contrib.tutorial_world.objects.WeaponRack'</em><a class="headerlink" href="#evennia.contrib.tutorial_world.objects.WeaponRack.path" title="Permalink to this definition"></a></dt>
<dt id="evennia.contrib.tutorial_world.objects.TutorialWeaponRack.path">
<code class="sig-name descname">path</code><em class="property"> = 'evennia.contrib.tutorial_world.objects.TutorialWeaponRack'</em><a class="headerlink" href="#evennia.contrib.tutorial_world.objects.TutorialWeaponRack.path" title="Permalink to this definition"></a></dt>
<dd></dd></dl>
<dl class="py attribute">
<dt id="evennia.contrib.tutorial_world.objects.WeaponRack.typename">
<code class="sig-name descname">typename</code><em class="property"> = 'WeaponRack'</em><a class="headerlink" href="#evennia.contrib.tutorial_world.objects.WeaponRack.typename" title="Permalink to this definition"></a></dt>
<dt id="evennia.contrib.tutorial_world.objects.TutorialWeaponRack.typename">
<code class="sig-name descname">typename</code><em class="property"> = 'TutorialWeaponRack'</em><a class="headerlink" href="#evennia.contrib.tutorial_world.objects.TutorialWeaponRack.typename" title="Permalink to this definition"></a></dt>
<dd></dd></dl>
</dd></dl>

View file

@ -86,6 +86,11 @@ called <strong>tutorial_info</strong> and display that.</p>
<code class="sig-name descname">lock_storage</code><em class="property"> = 'cmd:all()'</em><a class="headerlink" href="#evennia.contrib.tutorial_world.rooms.CmdTutorial.lock_storage" title="Permalink to this definition"></a></dt>
<dd></dd></dl>
<dl class="py attribute">
<dt id="evennia.contrib.tutorial_world.rooms.CmdTutorial.search_index_entry">
<code class="sig-name descname">search_index_entry</code><em class="property"> = {'aliases': 'tut', 'category': 'tutorialworld', 'key': 'tutorial', 'tags': '', 'text': '\n Get help during the tutorial\n\n Usage:\n tutorial [obj]\n\n This command allows you to get behind-the-scenes info\n about an object or the current location.\n\n '}</em><a class="headerlink" href="#evennia.contrib.tutorial_world.rooms.CmdTutorial.search_index_entry" title="Permalink to this definition"></a></dt>
<dd></dd></dl>
</dd></dl>
<dl class="py class">
@ -139,6 +144,11 @@ the set_detail method and uses it.</p>
<code class="sig-name descname">lock_storage</code><em class="property"> = 'cmd:perm(Builder)'</em><a class="headerlink" href="#evennia.contrib.tutorial_world.rooms.CmdTutorialSetDetail.lock_storage" title="Permalink to this definition"></a></dt>
<dd></dd></dl>
<dl class="py attribute">
<dt id="evennia.contrib.tutorial_world.rooms.CmdTutorialSetDetail.search_index_entry">
<code class="sig-name descname">search_index_entry</code><em class="property"> = {'aliases': '', 'category': 'tutorialworld', 'key': '&#64;detail', 'tags': '', 'text': '\n sets a detail on a room\n\n Usage:\n &#64;detail &lt;key&gt; = &lt;description&gt;\n &#64;detail &lt;key&gt;;&lt;alias&gt;;... = description\n\n Example:\n &#64;detail walls = The walls are covered in ...\n &#64;detail castle;ruin;tower = The distant ruin ...\n\n This sets a &quot;detail&quot; on the object this command is defined on\n (TutorialRoom for this tutorial). This detail can be accessed with\n the TutorialRoomLook command sitting on TutorialRoom objects (details\n are set as a simple dictionary on the room). This is a Builder command.\n\n We custom parse the key for the ;-separator in order to create\n multiple aliases to the detail all at once.\n '}</em><a class="headerlink" href="#evennia.contrib.tutorial_world.rooms.CmdTutorialSetDetail.search_index_entry" title="Permalink to this definition"></a></dt>
<dd></dd></dl>
</dd></dl>
<dl class="py class">
@ -186,6 +196,11 @@ code except for adding in the details.</p>
<code class="sig-name descname">lock_storage</code><em class="property"> = 'cmd:all()'</em><a class="headerlink" href="#evennia.contrib.tutorial_world.rooms.CmdTutorialLook.lock_storage" title="Permalink to this definition"></a></dt>
<dd></dd></dl>
<dl class="py attribute">
<dt id="evennia.contrib.tutorial_world.rooms.CmdTutorialLook.search_index_entry">
<code class="sig-name descname">search_index_entry</code><em class="property"> = {'aliases': 'l ls', 'category': 'tutorialworld', 'key': 'look', 'tags': '', 'text': '\n looks at the room and on details\n\n Usage:\n look &lt;obj&gt;\n look &lt;room detail&gt;\n look *&lt;account&gt;\n\n Observes your location, details at your location or objects\n in your vicinity.\n\n Tutorial: This is a child of the default Look command, that also\n allows us to look at &quot;details&quot; in the room. These details are\n things to examine and offers some extra description without\n actually having to be actual database objects. It uses the\n return_detail() hook on TutorialRooms for this.\n '}</em><a class="headerlink" href="#evennia.contrib.tutorial_world.rooms.CmdTutorialLook.search_index_entry" title="Permalink to this definition"></a></dt>
<dd></dd></dl>
</dd></dl>
<dl class="py class">
@ -222,6 +237,11 @@ to all the variables defined therein.</p>
<code class="sig-name descname">lock_storage</code><em class="property"> = 'cmd:all();'</em><a class="headerlink" href="#evennia.contrib.tutorial_world.rooms.CmdTutorialGiveUp.lock_storage" title="Permalink to this definition"></a></dt>
<dd></dd></dl>
<dl class="py attribute">
<dt id="evennia.contrib.tutorial_world.rooms.CmdTutorialGiveUp.search_index_entry">
<code class="sig-name descname">search_index_entry</code><em class="property"> = {'aliases': 'abort', 'category': 'general', 'key': 'give up', 'tags': '', 'text': '\n Give up the tutorial-world quest and return to Limbo, the start room of the\n server.\n\n '}</em><a class="headerlink" href="#evennia.contrib.tutorial_world.rooms.CmdTutorialGiveUp.search_index_entry" title="Permalink to this definition"></a></dt>
<dd></dd></dl>
</dd></dl>
<dl class="py class">
@ -427,6 +447,11 @@ set in self.parse())</p>
<code class="sig-name descname">lock_storage</code><em class="property"> = 'cmd:all();'</em><a class="headerlink" href="#evennia.contrib.tutorial_world.rooms.CmdEvenniaIntro.lock_storage" title="Permalink to this definition"></a></dt>
<dd></dd></dl>
<dl class="py attribute">
<dt id="evennia.contrib.tutorial_world.rooms.CmdEvenniaIntro.search_index_entry">
<code class="sig-name descname">search_index_entry</code><em class="property"> = {'aliases': '', 'category': 'general', 'key': 'intro', 'tags': '', 'text': '\n Start the Evennia intro wizard.\n\n Usage:\n intro\n\n '}</em><a class="headerlink" href="#evennia.contrib.tutorial_world.rooms.CmdEvenniaIntro.search_index_entry" title="Permalink to this definition"></a></dt>
<dd></dd></dl>
</dd></dl>
<dl class="py class">
@ -556,6 +581,11 @@ on the bridge, 0 - 4.</p></li>
<code class="sig-name descname">lock_storage</code><em class="property"> = 'cmd:all()'</em><a class="headerlink" href="#evennia.contrib.tutorial_world.rooms.CmdEast.lock_storage" title="Permalink to this definition"></a></dt>
<dd></dd></dl>
<dl class="py attribute">
<dt id="evennia.contrib.tutorial_world.rooms.CmdEast.search_index_entry">
<code class="sig-name descname">search_index_entry</code><em class="property"> = {'aliases': 'e', 'category': 'tutorialworld', 'key': 'east', 'tags': '', 'text': '\n Go eastwards across the bridge.\n\n Tutorial info:\n This command relies on the caller having two Attributes\n (assigned by the room when entering):\n - east_exit: a unique name or dbref to the room to go to\n when exiting east.\n - west_exit: a unique name or dbref to the room to go to\n when exiting west.\n The room must also have the following Attributes\n - tutorial_bridge_posistion: the current position on\n on the bridge, 0 - 4.\n\n '}</em><a class="headerlink" href="#evennia.contrib.tutorial_world.rooms.CmdEast.search_index_entry" title="Permalink to this definition"></a></dt>
<dd></dd></dl>
</dd></dl>
<dl class="py class">
@ -614,6 +644,11 @@ on the bridge, 0 - 4.</p></li>
<code class="sig-name descname">lock_storage</code><em class="property"> = 'cmd:all()'</em><a class="headerlink" href="#evennia.contrib.tutorial_world.rooms.CmdWest.lock_storage" title="Permalink to this definition"></a></dt>
<dd></dd></dl>
<dl class="py attribute">
<dt id="evennia.contrib.tutorial_world.rooms.CmdWest.search_index_entry">
<code class="sig-name descname">search_index_entry</code><em class="property"> = {'aliases': 'w', 'category': 'tutorialworld', 'key': 'west', 'tags': '', 'text': '\n Go westwards across the bridge.\n\n Tutorial info:\n This command relies on the caller having two Attributes\n (assigned by the room when entering):\n - east_exit: a unique name or dbref to the room to go to\n when exiting east.\n - west_exit: a unique name or dbref to the room to go to\n when exiting west.\n The room must also have the following property:\n - tutorial_bridge_posistion: the current position on\n on the bridge, 0 - 4.\n\n '}</em><a class="headerlink" href="#evennia.contrib.tutorial_world.rooms.CmdWest.search_index_entry" title="Permalink to this definition"></a></dt>
<dd></dd></dl>
</dd></dl>
<dl class="py class">
@ -658,6 +693,11 @@ if they fall off the bridge.</p>
<code class="sig-name descname">lock_storage</code><em class="property"> = 'cmd:all()'</em><a class="headerlink" href="#evennia.contrib.tutorial_world.rooms.CmdLookBridge.lock_storage" title="Permalink to this definition"></a></dt>
<dd></dd></dl>
<dl class="py attribute">
<dt id="evennia.contrib.tutorial_world.rooms.CmdLookBridge.search_index_entry">
<code class="sig-name descname">search_index_entry</code><em class="property"> = {'aliases': 'l', 'category': 'tutorialworld', 'key': 'look', 'tags': '', 'text': '\n looks around at the bridge.\n\n Tutorial info:\n This command assumes that the room has an Attribute\n &quot;fall_exit&quot;, a unique name or dbref to the place they end upp\n if they fall off the bridge.\n '}</em><a class="headerlink" href="#evennia.contrib.tutorial_world.rooms.CmdLookBridge.search_index_entry" title="Permalink to this definition"></a></dt>
<dd></dd></dl>
</dd></dl>
<dl class="py class">
@ -672,7 +712,7 @@ if they fall off the bridge.</p>
<dl class="py attribute">
<dt id="evennia.contrib.tutorial_world.rooms.CmdBridgeHelp.aliases">
<code class="sig-name descname">aliases</code><em class="property"> = ['h', '?']</em><a class="headerlink" href="#evennia.contrib.tutorial_world.rooms.CmdBridgeHelp.aliases" title="Permalink to this definition"></a></dt>
<code class="sig-name descname">aliases</code><em class="property"> = ['?', 'h']</em><a class="headerlink" href="#evennia.contrib.tutorial_world.rooms.CmdBridgeHelp.aliases" title="Permalink to this definition"></a></dt>
<dd></dd></dl>
<dl class="py attribute">
@ -696,6 +736,11 @@ if they fall off the bridge.</p>
<code class="sig-name descname">lock_storage</code><em class="property"> = 'cmd:all()'</em><a class="headerlink" href="#evennia.contrib.tutorial_world.rooms.CmdBridgeHelp.lock_storage" title="Permalink to this definition"></a></dt>
<dd></dd></dl>
<dl class="py attribute">
<dt id="evennia.contrib.tutorial_world.rooms.CmdBridgeHelp.search_index_entry">
<code class="sig-name descname">search_index_entry</code><em class="property"> = {'aliases': '? h', 'category': 'tutorial world', 'key': 'help', 'tags': '', 'text': '\n Overwritten help command while on the bridge.\n '}</em><a class="headerlink" href="#evennia.contrib.tutorial_world.rooms.CmdBridgeHelp.search_index_entry" title="Permalink to this definition"></a></dt>
<dd></dd></dl>
</dd></dl>
<dl class="py class">
@ -819,7 +864,7 @@ to find something.</p>
<dl class="py attribute">
<dt id="evennia.contrib.tutorial_world.rooms.CmdLookDark.aliases">
<code class="sig-name descname">aliases</code><em class="property"> = ['fiddle', 'feel', 'feel around', 'search', 'l']</em><a class="headerlink" href="#evennia.contrib.tutorial_world.rooms.CmdLookDark.aliases" title="Permalink to this definition"></a></dt>
<code class="sig-name descname">aliases</code><em class="property"> = ['l', 'search', 'fiddle', 'feel around', 'feel']</em><a class="headerlink" href="#evennia.contrib.tutorial_world.rooms.CmdLookDark.aliases" title="Permalink to this definition"></a></dt>
<dd></dd></dl>
<dl class="py attribute">
@ -845,6 +890,11 @@ random chance of eventually finding a light source.</p>
<code class="sig-name descname">lock_storage</code><em class="property"> = 'cmd:all()'</em><a class="headerlink" href="#evennia.contrib.tutorial_world.rooms.CmdLookDark.lock_storage" title="Permalink to this definition"></a></dt>
<dd></dd></dl>
<dl class="py attribute">
<dt id="evennia.contrib.tutorial_world.rooms.CmdLookDark.search_index_entry">
<code class="sig-name descname">search_index_entry</code><em class="property"> = {'aliases': 'l search fiddle feel around feel', 'category': 'tutorialworld', 'key': 'look', 'tags': '', 'text': '\n Look around in darkness\n\n Usage:\n look\n\n Look around in the darkness, trying\n to find something.\n '}</em><a class="headerlink" href="#evennia.contrib.tutorial_world.rooms.CmdLookDark.search_index_entry" title="Permalink to this definition"></a></dt>
<dd></dd></dl>
</dd></dl>
<dl class="py class">
@ -883,6 +933,11 @@ random chance of eventually finding a light source.</p>
<code class="sig-name descname">lock_storage</code><em class="property"> = 'cmd:all()'</em><a class="headerlink" href="#evennia.contrib.tutorial_world.rooms.CmdDarkHelp.lock_storage" title="Permalink to this definition"></a></dt>
<dd></dd></dl>
<dl class="py attribute">
<dt id="evennia.contrib.tutorial_world.rooms.CmdDarkHelp.search_index_entry">
<code class="sig-name descname">search_index_entry</code><em class="property"> = {'aliases': '', 'category': 'tutorialworld', 'key': 'help', 'tags': '', 'text': '\n Help command for the dark state.\n '}</em><a class="headerlink" href="#evennia.contrib.tutorial_world.rooms.CmdDarkHelp.search_index_entry" title="Permalink to this definition"></a></dt>
<dd></dd></dl>
</dd></dl>
<dl class="py class">
@ -925,6 +980,11 @@ suggestions)</p>
<code class="sig-name descname">lock_storage</code><em class="property"> = 'cmd:all()'</em><a class="headerlink" href="#evennia.contrib.tutorial_world.rooms.CmdDarkNoMatch.lock_storage" title="Permalink to this definition"></a></dt>
<dd></dd></dl>
<dl class="py attribute">
<dt id="evennia.contrib.tutorial_world.rooms.CmdDarkNoMatch.search_index_entry">
<code class="sig-name descname">search_index_entry</code><em class="property"> = {'aliases': '', 'category': 'general', 'key': '__nomatch_command', 'tags': '', 'text': &quot;\n This is a system command. Commands with special keys are used to\n override special sitations in the game. The CMD_NOMATCH is used\n when the given command is not found in the current command set (it\n replaces Evennia's default behavior or offering command\n suggestions)\n &quot;}</em><a class="headerlink" href="#evennia.contrib.tutorial_world.rooms.CmdDarkNoMatch.search_index_entry" title="Permalink to this definition"></a></dt>
<dd></dd></dl>
</dd></dl>
<dl class="py class">

View file

@ -317,6 +317,11 @@ use its <strong>add_argument</strong> method.</p>
<code class="sig-name descname">lock_storage</code><em class="property"> = 'cmd:all();'</em><a class="headerlink" href="#evennia.contrib.unixcommand.UnixCommand.lock_storage" title="Permalink to this definition"></a></dt>
<dd></dd></dl>
<dl class="py attribute">
<dt id="evennia.contrib.unixcommand.UnixCommand.search_index_entry">
<code class="sig-name descname">search_index_entry</code><em class="property"> = {'aliases': '', 'category': 'general', 'key': 'command', 'tags': '', 'text': '\n Unix-type commands, supporting short and long options.\n\n This command syntax uses the Unix-style commands with short options\n (-X) and long options (--something). The `argparse` module is\n used to parse the command.\n\n In order to use it, you should override two methods:\n - `init_parser`: this method is called when the command is created.\n It can be used to set options in the parser. `self.parser`\n contains the `argparse.ArgumentParser`, so you can add arguments\n here.\n - `func`: this method is called to execute the command, but after\n the parser has checked the arguments given to it are valid.\n You can access the namespace of valid arguments in `self.opts`\n at this point.\n\n The help of UnixCommands is derived from the docstring, in a\n slightly different way than usual: the first line of the docstring\n is used to represent the program description (the very short\n line at the top of the help message). The other lines below are\n used as the program\'s &quot;epilog&quot;, displayed below the options. It\n means in your docstring, you don\'t have to write the options.\n They will be automatically provided by the parser and displayed\n accordingly. The `argparse` module provides a default \'-h\' or\n \'--help\' option on the command. Typing |whelp commandname|n will\n display the same as |wcommandname -h|n, though this behavior can\n be changed.\n\n '}</em><a class="headerlink" href="#evennia.contrib.unixcommand.UnixCommand.search_index_entry" title="Permalink to this definition"></a></dt>
<dd></dd></dl>
</dd></dl>
</div>

View file

@ -139,6 +139,12 @@ access_type - type of access sought
default - what to return if no lock of access_type was found</p>
</dd></dl>
<dl class="py method">
<dt id="evennia.help.models.HelpEntry.search_index_entry">
<em class="property">property </em><code class="sig-name descname">search_index_entry</code><a class="headerlink" href="#evennia.help.models.HelpEntry.search_index_entry" title="Permalink to this definition"></a></dt>
<dd><p>Property for easily retaining a search index entry for this object.</p>
</dd></dl>
<dl class="py method">
<dt id="evennia.help.models.HelpEntry.web_get_admin_url">
<code class="sig-name descname">web_get_admin_url</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="reference internal" href="../_modules/evennia/help/models.html#HelpEntry.web_get_admin_url"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#evennia.help.models.HelpEntry.web_get_admin_url" title="Permalink to this definition"></a></dt>

View file

@ -371,8 +371,14 @@ with q, remove the break line and restart server when finished.</p></li>
<li class="toctree-l1"><a class="reference internal" href="evennia.utils.html">evennia.utils</a><ul>
<li class="toctree-l2"><a class="reference internal" href="evennia.utils.ansi.html">evennia.utils.ansi</a></li>
<li class="toctree-l2"><a class="reference internal" href="evennia.utils.batchprocessors.html">evennia.utils.batchprocessors</a><ul>
<li class="toctree-l3"><a class="reference internal" href="evennia.utils.batchprocessors.html#batch-command-processor-file-syntax">Batch-Command processor file syntax</a></li>
<li class="toctree-l3"><a class="reference internal" href="evennia.utils.batchprocessors.html#batch-code-processor-file-syntax">Batch-Code processor file syntax</a></li>
<li class="toctree-l3"><a class="reference internal" href="evennia.utils.batchprocessors.html#batch-command-processor-file-syntax">Batch-command processor file syntax</a><ul>
<li class="toctree-l4"><a class="reference internal" href="evennia.utils.batchprocessors.html#example-of-batch-ev-file">Example of batch.ev file:</a></li>
</ul>
</li>
<li class="toctree-l3"><a class="reference internal" href="evennia.utils.batchprocessors.html#batch-code-processor-file-syntax">Batch-code processor file syntax</a><ul>
<li class="toctree-l4"><a class="reference internal" href="evennia.utils.batchprocessors.html#example-batch-py-file">Example batch.py file</a></li>
</ul>
</li>
</ul>
</li>
<li class="toctree-l2"><a class="reference internal" href="evennia.utils.containers.html">evennia.utils.containers</a></li>

Some files were not shown because too many files have changed in this diff Show more