mirror of
https://github.com/evennia/evennia.git
synced 2026-04-07 00:45:22 +02:00
Updated HTML docs.
This commit is contained in:
parent
755324d29d
commit
06297c3976
31 changed files with 287 additions and 173 deletions
|
|
@ -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: c9b7991b1043e53483fa42e6286f4f64
|
||||
config: 224d24ea1bf52e25659e937a71f17735
|
||||
tags: 645f666f9bcd5a90fca523b33c5a78b7
|
||||
|
|
|
|||
|
|
@ -204,6 +204,8 @@ admins an explicit action and opens up <code class="docutils literal notranslate
|
|||
<li><p>Feature: Add <code class="docutils literal notranslate"><span class="pre">ON_DEMAND_HANDLER.set_dt(key,</span> <span class="pre">category,</span> <span class="pre">dt)</span></code> and
|
||||
<code class="docutils literal notranslate"><span class="pre">.set_stage(key,</span> <span class="pre">category,</span> <span class="pre">stage)</span></code> to allow manual tweaking of task timings,
|
||||
for example for a spell speeding a plant’s growth (Griatch)</p></li>
|
||||
<li><p>Feature: Add <code class="docutils literal notranslate"><span class="pre">ON_DEMAND_HANDLER.get_dt/stages(key,category,</span> <span class="pre">**kwargs)</span></code>, where
|
||||
the kwargs are passed into any stage-callable defined with the stages. (Griatch)</p></li>
|
||||
<li><p>Feature: Add <code class="docutils literal notranslate"><span class="pre">use_assertequal</span></code> kwarg to the <code class="docutils literal notranslate"><span class="pre">EvenniaCommandTestMixin</span></code> testing
|
||||
class; this uses django’s <code class="docutils literal notranslate"><span class="pre">assertEqual</span></code> over the default more lenient checker,
|
||||
which can be useful for testing table whitespace (Griatch)</p></li>
|
||||
|
|
|
|||
|
|
@ -68,6 +68,7 @@
|
|||
<li><a class="reference internal" href="#">OnDemandHandler</a><ul>
|
||||
<li><a class="reference internal" href="#a-blooming-flower-using-the-ondemandhandler">A blooming flower using the OnDemandHandler</a></li>
|
||||
<li><a class="reference internal" href="#more-usage-examples">More usage examples</a><ul>
|
||||
<li><a class="reference internal" href="#stage-callables">Stage callables</a></li>
|
||||
<li><a class="reference internal" href="#looping-repeatedly">Looping repeatedly</a></li>
|
||||
<li><a class="reference internal" href="#bouncing-back-and-forth">Bouncing back and forth</a></li>
|
||||
</ul>
|
||||
|
|
@ -185,6 +186,7 @@
|
|||
<span class="bp">self</span><span class="o">.</span><span class="n">delete</span><span class="p">()</span>
|
||||
</pre></div>
|
||||
</div>
|
||||
<p>The <code class="docutils literal notranslate"><span class="pre">get_state(key,</span> <span class="pre">category=None,</span> <span class="pre">**kwargs)</span></code> methoid is used to get the current stage. The <code class="docutils literal notranslate"><span class="pre">get_dt(key,</span> <span class="pre">category=None,</span> <span class="pre">**kwargs)</span></code> method instead retrieves the currently passed time.</p>
|
||||
<p>You could now create the rose and it would figure out its state only when you are actually looking at it. It will stay a seedling for 10 minutes (of in-game real time) before it sprouts. Within 12 hours it will be dead again.</p>
|
||||
<p>If you had a <code class="docutils literal notranslate"><span class="pre">harvest</span></code> command in your game, you could equally have it check the stage of bloom and give you different results depending on if you pick the rose at the right time or not.</p>
|
||||
<p>The on-demand handler’s tasks survive a reload and will properly account for downtime.</p>
|
||||
|
|
@ -210,7 +212,7 @@
|
|||
<ul class="simple">
|
||||
<li><p>The <code class="docutils literal notranslate"><span class="pre">key</span></code> can be a string, but also a typeclassed object (its string representation will be used, which normally includes its <code class="docutils literal notranslate"><span class="pre">#dbref</span></code>). You can also pass a <code class="docutils literal notranslate"><span class="pre">callable</span></code> - this will be called without arguments and is expected to return a string to use for the <code class="docutils literal notranslate"><span class="pre">key</span></code>. Finally, you can also pass <a class="reference internal" href="../api/evennia.scripts.ondemandhandler.html#evennia.scripts.ondemandhandler.OnDemandTask" title="evennia.scripts.ondemandhandler.OnDemandTask"><span class="xref myst py py-class">OnDemandTask</span></a> entities - these are the objects the handler uses under the hood to represent each task.</p></li>
|
||||
<li><p>The <code class="docutils literal notranslate"><span class="pre">category</span></code> allows you to further categorize your demandhandler tasks to make sure they are unique. Since the handler is global, you need to make sure <code class="docutils literal notranslate"><span class="pre">key</span></code> + <code class="docutils literal notranslate"><span class="pre">category</span></code> is unique. While <code class="docutils literal notranslate"><span class="pre">category</span></code> is optional, if you use it you must also use it to retrieve your state later.</p></li>
|
||||
<li><p><code class="docutils literal notranslate"><span class="pre">stages</span></code> is a <code class="docutils literal notranslate"><span class="pre">dict</span></code> <code class="docutils literal notranslate"><span class="pre">{dt:</span> <span class="pre">statename}</span></code> or <code class="docutils literal notranslate"><span class="pre">{dt:</span> <span class="pre">(statename,</span> <span class="pre">callable)}</span></code> that represents how much time (in seconds) from <em>the start of the task</em> it takes for that stage to begin. In the flower example above, it was 10 hours until the <code class="docutils literal notranslate"><span class="pre">wilting</span></code> state began. If a <code class="docutils literal notranslate"><span class="pre">callable</span></code> is also included, this will be called <em>the first time</em> that state is checked for (only!). The callable takes a <code class="docutils literal notranslate"><span class="pre">evennia.OnDemandTask</span></code> as an argument and allows for tweaking the task on the fly. The <code class="docutils literal notranslate"><span class="pre">dt</span></code> can also be a <code class="docutils literal notranslate"><span class="pre">float</span></code> if you desire higher than per-second precision. Having <code class="docutils literal notranslate"><span class="pre">stages</span></code> is optional - sometimes you only want to know how much time has passed.</p></li>
|
||||
<li><p><code class="docutils literal notranslate"><span class="pre">stages</span></code> is a <code class="docutils literal notranslate"><span class="pre">dict</span></code> <code class="docutils literal notranslate"><span class="pre">{dt:</span> <span class="pre">statename}</span></code> or <code class="docutils literal notranslate"><span class="pre">{dt:</span> <span class="pre">(statename,</span> <span class="pre">callable)}</span></code> that represents how much time (in seconds) from <em>the start of the task</em> it takes for that stage to begin. In the flower example above, it was 10 hours until the <code class="docutils literal notranslate"><span class="pre">wilting</span></code> state began. If a callable is included, it will fire the first time that stage is reached. This callable takes the current <code class="docutils literal notranslate"><span class="pre">OnDemandTask</span></code> and <code class="docutils literal notranslate"><span class="pre">**kwargs</span></code> as arguments; the keywords are passed on from the <code class="docutils literal notranslate"><span class="pre">get_stages/dt</span></code> methods. <a class="reference internal" href="#stage-callables"><span class="std std-doc">See below</span></a> for information about the allowed callables. Having <code class="docutils literal notranslate"><span class="pre">stages</span></code> is optional - sometimes you only want to know how much time has passed.</p></li>
|
||||
<li><p><code class="docutils literal notranslate"><span class="pre">.get_dt()</span></code> - get the current time (in seconds) since the task started. This is a <code class="docutils literal notranslate"><span class="pre">float</span></code>.</p></li>
|
||||
<li><p><code class="docutils literal notranslate"><span class="pre">.get_stage()</span></code> - get the current state name, such as “flowering” or “seedling”. If you didn’t specify any <code class="docutils literal notranslate"><span class="pre">stages</span></code>, this will return <code class="docutils literal notranslate"><span class="pre">None</span></code>, and you need to interpret the <code class="docutils literal notranslate"><span class="pre">dt</span></code> yourself to determine which state you are in.</p></li>
|
||||
</ul>
|
||||
|
|
@ -231,10 +233,46 @@
|
|||
<span class="n">ON_DEMAND_HANDLER</span><span class="o">.</span><span class="n">batch_remove</span><span class="p">(</span><span class="n">task1</span><span class="p">,</span> <span class="n">task2</span><span class="p">)</span>
|
||||
</pre></div>
|
||||
</div>
|
||||
<section id="stage-callables">
|
||||
<h3>Stage callables<a class="headerlink" href="#stage-callables" title="Permalink to this headline">¶</a></h3>
|
||||
<p>If you define one or more of your <code class="docutils literal notranslate"><span class="pre">stages</span></code> dict keys as <code class="docutils literal notranslate"><span class="pre">{dt:</span> <span class="pre">(statename,</span> <span class="pre">callable)}</span></code>, this callable will be called when that stage is checked for the first time. This ‘stage callable’ have a few requirements:</p>
|
||||
<ul class="simple">
|
||||
<li><p>The stage callable must be <a class="reference external" href="https://docs.python.org/3/library/pickle.html#pickle-picklable">possible to pickle</a> because it will be saved to the database. This basically means your callable needs to be a stand-alone function or a method decorated with <code class="docutils literal notranslate"><span class="pre">@staticmethod</span></code>. You won’t be able to access the object instance as <code class="docutils literal notranslate"><span class="pre">self</span></code> directly from such a method or function - you need to pass it explicitly.</p></li>
|
||||
<li><p>The callable must always take <code class="docutils literal notranslate"><span class="pre">task</span></code> as its first element. This is the <code class="docutils literal notranslate"><span class="pre">OnDemandTask</span></code> object firing this callable.</p></li>
|
||||
<li><p>It may optionally take <code class="docutils literal notranslate"><span class="pre">**kwargs</span></code> . This will be passed down from your call of <code class="docutils literal notranslate"><span class="pre">get_dt</span></code> or <code class="docutils literal notranslate"><span class="pre">get_stages</span></code>.</p></li>
|
||||
</ul>
|
||||
<p>Here’s an example:</p>
|
||||
<div class="highlight-python notranslate"><div class="highlight"><pre><span></span><span class="kn">from</span> <span class="nn">evennia</span> <span class="n">DefaultObject</span><span class="p">,</span> <span class="n">ON_DEMAND_HANDLER</span>
|
||||
|
||||
<span class="k">def</span> <span class="nf">mycallable</span><span class="p">(</span><span class="n">task</span><span class="p">,</span> <span class="o">**</span><span class="n">kwargs</span><span class="p">)</span>
|
||||
<span class="c1"># this function is outside the class and is pickleable just fine</span>
|
||||
<span class="n">obj</span> <span class="o">=</span> <span class="n">kwargs</span><span class="o">.</span><span class="n">get</span><span class="p">(</span><span class="s2">"obj"</span><span class="p">)</span>
|
||||
<span class="c1"># do something with the object</span>
|
||||
|
||||
<span class="k">class</span> <span class="nc">SomeObject</span><span class="p">(</span><span class="n">DefaultObject</span><span class="p">):</span>
|
||||
|
||||
<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="n">ON_DEMAND_HANDLER</span><span class="o">.</span><span class="n">add</span><span class="p">(</span>
|
||||
<span class="s2">"key1"</span><span class="p">,</span>
|
||||
<span class="n">stages</span><span class="o">=</span><span class="p">{</span><span class="mi">0</span><span class="p">:</span> <span class="s2">"new"</span><span class="p">,</span> <span class="mi">10</span><span class="p">:</span> <span class="p">(</span><span class="s2">"old"</span><span class="p">,</span> <span class="n">mycallable</span><span class="p">)}</span>
|
||||
<span class="p">)</span>
|
||||
|
||||
<span class="k">def</span> <span class="nf">do_something</span><span class="p">(</span><span class="bp">self</span><span class="p">):</span>
|
||||
<span class="c1"># pass obj=self into the handler; to be passed into</span>
|
||||
<span class="c1"># mycallable if we are in the 'old' stage.</span>
|
||||
<span class="n">state</span> <span class="o">=</span> <span class="n">ON_DEMAND_HANDLER</span><span class="o">.</span><span class="n">get_state</span><span class="p">(</span><span class="s2">"key1"</span><span class="p">,</span> <span class="n">obj</span><span class="o">=</span><span class="bp">self</span><span class="p">)</span>
|
||||
|
||||
</pre></div>
|
||||
</div>
|
||||
<p>Above, the <code class="docutils literal notranslate"><span class="pre">obj=self</span></code> will passed into <code class="docutils literal notranslate"><span class="pre">mycallable</span></code> once we reach the ‘old’ state. If we are not in the ‘old’ stage, the extra kwargs go nowhere. This way a function can be made aware of the object calling it while still being possible to pickle. You can also pass any other information into the callable this way.</p>
|
||||
<blockquote>
|
||||
<div><p>If you don’t want to deal with the complexity of callables you can also just read off the current stage and do all the logic outside of the handler. This can often be easier to read and maintain.</p>
|
||||
</div></blockquote>
|
||||
</section>
|
||||
<section id="looping-repeatedly">
|
||||
<h3>Looping repeatedly<a class="headerlink" href="#looping-repeatedly" title="Permalink to this headline">¶</a></h3>
|
||||
<p>Normally, when a sequence of <code class="docutils literal notranslate"><span class="pre">stages</span></code> have been cycled through, the task will just stop at the last stage indefinitely.</p>
|
||||
<p><code class="docutils literal notranslate"><span class="pre">evennia.OnDemandTask.stagefunc_loop</span></code> is an included static-method callable you can use to make the task loop. Here’s an example of how to use it:</p>
|
||||
<p><code class="docutils literal notranslate"><span class="pre">evennia.OnDemandTask.stagefunc_loop</span></code> is an included static-method stage callable you can use to make the task loop. Here’s an example of how to use it:</p>
|
||||
<div class="highlight-python notranslate"><div class="highlight"><pre><span></span><span class="kn">from</span> <span class="nn">evennia</span> <span class="kn">import</span> <span class="n">ON_DEMAND_HANDLER</span><span class="p">,</span> <span class="n">OnDemandTask</span>
|
||||
|
||||
<span class="n">ON_DEMAND_HANDLER</span><span class="o">.</span><span class="n">add</span><span class="p">(</span>
|
||||
|
|
|
|||
|
|
@ -94,11 +94,10 @@
|
|||
<span class="kn">import</span> <span class="nn">re</span>
|
||||
<span class="kn">import</span> <span class="nn">typing</span>
|
||||
|
||||
<span class="kn">import</span> <span class="nn">evennia</span>
|
||||
<span class="kn">from</span> <span class="nn">django.conf</span> <span class="kn">import</span> <span class="n">settings</span>
|
||||
<span class="kn">from</span> <span class="nn">django.core.paginator</span> <span class="kn">import</span> <span class="n">Paginator</span>
|
||||
<span class="kn">from</span> <span class="nn">django.db.models</span> <span class="kn">import</span> <span class="n">Max</span><span class="p">,</span> <span class="n">Min</span><span class="p">,</span> <span class="n">Q</span>
|
||||
|
||||
<span class="kn">import</span> <span class="nn">evennia</span>
|
||||
<span class="kn">from</span> <span class="nn">evennia</span> <span class="kn">import</span> <span class="n">InterruptCommand</span>
|
||||
<span class="kn">from</span> <span class="nn">evennia.commands.cmdhandler</span> <span class="kn">import</span> <span class="n">generate_cmdset_providers</span><span class="p">,</span> <span class="n">get_and_merge_cmdsets</span>
|
||||
<span class="kn">from</span> <span class="nn">evennia.locks.lockhandler</span> <span class="kn">import</span> <span class="n">LockException</span>
|
||||
|
|
@ -3418,14 +3417,23 @@
|
|||
<span class="n">string</span> <span class="o">=</span> <span class="sa">f</span><span class="s2">"|w</span><span class="si">{</span><span class="n">header</span><span class="si">}</span><span class="s2">|n(#</span><span class="si">{</span><span class="n">low</span><span class="si">}</span><span class="s2">-#</span><span class="si">{</span><span class="n">high</span><span class="si">}{</span><span class="n">restrictions</span><span class="si">}</span><span class="s2">):"</span>
|
||||
<span class="n">res</span> <span class="o">=</span> <span class="kc">None</span>
|
||||
<span class="k">for</span> <span class="n">res</span> <span class="ow">in</span> <span class="n">results</span><span class="p">:</span>
|
||||
<span class="n">string</span> <span class="o">+=</span> <span class="sa">f</span><span class="s2">"</span><span class="se">\n</span><span class="s2"> |g</span><span class="si">{</span><span class="n">res</span><span class="o">.</span><span class="n">get_display_name</span><span class="p">(</span><span class="n">caller</span><span class="p">)</span><span class="si">}</span><span class="s2"> - </span><span class="si">{</span><span class="n">res</span><span class="o">.</span><span class="n">path</span><span class="si">}</span><span class="s2">|n"</span>
|
||||
<span class="n">string</span> <span class="o">+=</span> <span class="p">(</span>
|
||||
<span class="s2">"</span><span class="se">\n</span><span class="s2"> "</span>
|
||||
<span class="sa">f</span><span class="s2">" |g</span><span class="si">{</span><span class="n">res</span><span class="o">.</span><span class="n">get_display_name</span><span class="p">(</span><span class="n">caller</span><span class="p">)</span><span class="si">}</span><span class="s2">"</span>
|
||||
<span class="sa">f</span><span class="s2">"</span><span class="si">{</span><span class="n">res</span><span class="o">.</span><span class="n">get_extra_display_name_info</span><span class="p">(</span><span class="n">caller</span><span class="p">)</span><span class="si">}</span><span class="s2"> -"</span>
|
||||
<span class="sa">f</span><span class="s2">" </span><span class="si">{</span><span class="n">res</span><span class="o">.</span><span class="n">path</span><span class="si">}</span><span class="s2">|n"</span>
|
||||
<span class="p">)</span>
|
||||
<span class="k">if</span> <span class="p">(</span>
|
||||
<span class="s2">"loc"</span> <span class="ow">in</span> <span class="bp">self</span><span class="o">.</span><span class="n">switches</span>
|
||||
<span class="ow">and</span> <span class="n">nresults</span> <span class="o">==</span> <span class="mi">1</span>
|
||||
<span class="ow">and</span> <span class="n">res</span>
|
||||
<span class="ow">and</span> <span class="nb">getattr</span><span class="p">(</span><span class="n">res</span><span class="p">,</span> <span class="s2">"location"</span><span class="p">,</span> <span class="kc">None</span><span class="p">)</span>
|
||||
<span class="p">):</span>
|
||||
<span class="n">string</span> <span class="o">+=</span> <span class="sa">f</span><span class="s2">" (|wlocation|n: |g</span><span class="si">{</span><span class="n">res</span><span class="o">.</span><span class="n">location</span><span class="o">.</span><span class="n">get_display_name</span><span class="p">(</span><span class="n">caller</span><span class="p">)</span><span class="si">}</span><span class="s2">|n)"</span>
|
||||
<span class="n">string</span> <span class="o">+=</span> <span class="p">(</span>
|
||||
<span class="s2">" (|wlocation|n:"</span>
|
||||
<span class="sa">f</span><span class="s2">" |g</span><span class="si">{</span><span class="n">res</span><span class="o">.</span><span class="n">location</span><span class="o">.</span><span class="n">get_display_name</span><span class="p">(</span><span class="n">caller</span><span class="p">)</span><span class="si">}</span><span class="s2">"</span>
|
||||
<span class="sa">f</span><span class="s2">"</span><span class="si">{</span><span class="n">res</span><span class="o">.</span><span class="n">get_extra_display_name_info</span><span class="p">(</span><span class="n">caller</span><span class="p">)</span><span class="si">}</span><span class="s2">|n)"</span>
|
||||
<span class="p">)</span>
|
||||
<span class="k">else</span><span class="p">:</span>
|
||||
<span class="n">string</span> <span class="o">=</span> <span class="sa">f</span><span class="s2">"|wNo Matches|n(#</span><span class="si">{</span><span class="n">low</span><span class="si">}</span><span class="s2">-#</span><span class="si">{</span><span class="n">high</span><span class="si">}{</span><span class="n">restrictions</span><span class="si">}</span><span class="s2">):"</span>
|
||||
<span class="n">string</span> <span class="o">+=</span> <span class="sa">f</span><span class="s2">"</span><span class="se">\n</span><span class="s2"> |RNo matches found for '</span><span class="si">{</span><span class="n">searchstring</span><span class="si">}</span><span class="s2">'|n"</span>
|
||||
|
|
|
|||
|
|
@ -93,10 +93,10 @@
|
|||
<span class="sd">actually needs the information. This is a very efficient way to handle gradual changes, requiring</span>
|
||||
<span class="sd">not computer resources until the state is actually needed.</span>
|
||||
|
||||
<span class="sd">For example, consider a flowering system, where a seed sprouts, grows and blooms over a certain time.</span>
|
||||
<span class="sd">One _could_ implement this with e.g. a Script or a ticker that gradually moves the flower along</span>
|
||||
<span class="sd">its stages of growth. But what if that flower is in a remote location, and no one is around to see it?</span>
|
||||
<span class="sd">You are then wasting computational resources on something that no one is looking at.</span>
|
||||
<span class="sd">For example, consider a flowering system, where a seed sprouts, grows and blooms over a certain</span>
|
||||
<span class="sd">time. One _could_ implement this with e.g. a Script or a ticker that gradually moves the flower</span>
|
||||
<span class="sd">along its stages of growth. But what if that flower is in a remote location, and no one is around to</span>
|
||||
<span class="sd">see it? You are then wasting computational resources on something that no one is looking at.</span>
|
||||
|
||||
<span class="sd">The truth is that most of the time, players are not looking at most of the things in the game. They</span>
|
||||
<span class="sd">_only_ need to know about which state the flower is in when they are actually looking at it, or</span>
|
||||
|
|
@ -118,8 +118,8 @@
|
|||
<span class="sd"> since too long time has passed and the plant has died.</span>
|
||||
|
||||
<span class="sd">With a system like this you could have growing plants all over your world and computing usage would</span>
|
||||
<span class="sd">only scale by how many players you have exploring your world. The players will not know the difference</span>
|
||||
<span class="sd">between this and a system that is always running, but your server will thank you.</span>
|
||||
<span class="sd">only scale by how many players you have exploring your world. The players will not know the</span>
|
||||
<span class="sd">difference between this and a system that is always running, but your server will thank you.</span>
|
||||
|
||||
<span class="sd">There is only one situation where this system is not ideal, and that is when a player should be</span>
|
||||
<span class="sd">informed of the state change _even if they perform no action_. That is, even if they are just idling</span>
|
||||
|
|
@ -159,6 +159,7 @@
|
|||
<span class="n">_RUNTIME</span> <span class="o">=</span> <span class="kc">None</span>
|
||||
|
||||
<span class="n">ON_DEMAND_HANDLER</span> <span class="o">=</span> <span class="kc">None</span>
|
||||
<span class="n">ONDEMAND_HANDLER_SAVE_NAME</span> <span class="o">=</span> <span class="s2">"on_demand_timers"</span>
|
||||
|
||||
|
||||
<div class="viewcode-block" id="OnDemandTask"><a class="viewcode-back" href="../../../api/evennia.scripts.ondemandhandler.html#evennia.scripts.ondemandhandler.OnDemandTask">[docs]</a><span class="k">class</span> <span class="nc">OnDemandTask</span><span class="p">:</span>
|
||||
|
|
@ -166,10 +167,10 @@
|
|||
<span class="sd"> Stores information about an on-demand task.</span>
|
||||
|
||||
<span class="sd"> Default property:</span>
|
||||
<span class="sd"> - `default_stage_function (callable)`: This is called if no stage function is given in the stages dict.</span>
|
||||
<span class="sd"> This is meant for changing the task itself (such as restarting it). Actual game code should</span>
|
||||
<span class="sd"> be handled elsewhere, by checking this task. See the `stagefunc_*` static methods for examples</span>
|
||||
<span class="sd"> of how to manipulate the task when a stage is reached.</span>
|
||||
<span class="sd"> - `default_stage_function (callable)`: This is called if no stage function is given in the</span>
|
||||
<span class="sd"> stages dict. This is meant for changing the task itself (such as restarting it). Actual</span>
|
||||
<span class="sd"> game code should be handled elsewhere, by checking this task. See the `stagefunc_*` static</span>
|
||||
<span class="sd"> methods for examples of how to manipulate the task when a stage is reached.</span>
|
||||
|
||||
<span class="sd"> """</span>
|
||||
|
||||
|
|
@ -190,7 +191,7 @@
|
|||
<span class="k">return</span> <span class="n">_RUNTIME</span><span class="p">()</span></div>
|
||||
|
||||
<div class="viewcode-block" id="OnDemandTask.stagefunc_loop"><a class="viewcode-back" href="../../../api/evennia.scripts.ondemandhandler.html#evennia.scripts.ondemandhandler.OnDemandTask.stagefunc_loop">[docs]</a> <span class="nd">@staticmethod</span>
|
||||
<span class="k">def</span> <span class="nf">stagefunc_loop</span><span class="p">(</span><span class="n">task</span><span class="p">):</span>
|
||||
<span class="k">def</span> <span class="nf">stagefunc_loop</span><span class="p">(</span><span class="n">task</span><span class="p">,</span> <span class="o">**</span><span class="n">kwargs</span><span class="p">):</span>
|
||||
<span class="w"> </span><span class="sd">"""</span>
|
||||
<span class="sd"> Attach this to the last stage to have the task start over from</span>
|
||||
<span class="sd"> the beginning</span>
|
||||
|
|
@ -221,7 +222,7 @@
|
|||
<span class="n">task</span><span class="o">.</span><span class="n">start_time</span> <span class="o">=</span> <span class="n">now</span> <span class="o">-</span> <span class="n">current_loop_time</span></div>
|
||||
|
||||
<div class="viewcode-block" id="OnDemandTask.stagefunc_bounce"><a class="viewcode-back" href="../../../api/evennia.scripts.ondemandhandler.html#evennia.scripts.ondemandhandler.OnDemandTask.stagefunc_bounce">[docs]</a> <span class="nd">@staticmethod</span>
|
||||
<span class="k">def</span> <span class="nf">stagefunc_bounce</span><span class="p">(</span><span class="n">task</span><span class="p">):</span>
|
||||
<span class="k">def</span> <span class="nf">stagefunc_bounce</span><span class="p">(</span><span class="n">task</span><span class="p">,</span> <span class="o">**</span><span class="n">kwargs</span><span class="p">):</span>
|
||||
<span class="w"> </span><span class="sd">"""</span>
|
||||
<span class="sd"> This endfunc will have the task reverse direction and go through the stages in</span>
|
||||
<span class="sd"> reverse order. This stage-function must be placed at both 'ends' of the stage sequence</span>
|
||||
|
|
@ -251,7 +252,8 @@
|
|||
<span class="n">stages</span> <span class="o">=</span> <span class="n">task</span><span class="o">.</span><span class="n">stages</span>
|
||||
<span class="n">task</span><span class="o">.</span><span class="n">stages</span> <span class="o">=</span> <span class="p">{</span><span class="nb">abs</span><span class="p">(</span><span class="n">k</span> <span class="o">-</span> <span class="n">max_dt</span><span class="p">):</span> <span class="n">v</span> <span class="k">for</span> <span class="n">k</span><span class="p">,</span> <span class="n">v</span> <span class="ow">in</span> <span class="nb">sorted</span><span class="p">(</span><span class="n">stages</span><span class="o">.</span><span class="n">items</span><span class="p">())}</span></div>
|
||||
|
||||
<span class="c1"># default fallback stage function. This is called if no stage function is given in the stages dict.</span>
|
||||
<span class="c1"># default fallback stage function. This is called if no stage function is given in the stages</span>
|
||||
<span class="c1"># dict.</span>
|
||||
<span class="n">default_stage_function</span> <span class="o">=</span> <span class="kc">None</span>
|
||||
|
||||
<div class="viewcode-block" id="OnDemandTask.__init__"><a class="viewcode-back" href="../../../api/evennia.scripts.ondemandhandler.html#evennia.scripts.ondemandhandler.OnDemandTask.__init__">[docs]</a> <span class="k">def</span> <span class="fm">__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="n">category</span><span class="p">,</span> <span class="n">stages</span><span class="o">=</span><span class="kc">None</span><span class="p">,</span> <span class="n">autostart</span><span class="o">=</span><span class="kc">True</span><span class="p">):</span>
|
||||
|
|
@ -329,13 +331,14 @@
|
|||
<span class="k">return</span> <span class="kc">False</span>
|
||||
<span class="k">return</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="bp">self</span><span class="o">.</span><span class="n">category</span><span class="p">)</span> <span class="o">==</span> <span class="p">(</span><span class="n">other</span><span class="o">.</span><span class="n">key</span><span class="p">,</span> <span class="n">other</span><span class="o">.</span><span class="n">category</span><span class="p">)</span>
|
||||
|
||||
<div class="viewcode-block" id="OnDemandTask.check"><a class="viewcode-back" href="../../../api/evennia.scripts.ondemandhandler.html#evennia.scripts.ondemandhandler.OnDemandTask.check">[docs]</a> <span class="k">def</span> <span class="nf">check</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">autostart</span><span class="o">=</span><span class="kc">True</span><span class="p">):</span>
|
||||
<div class="viewcode-block" id="OnDemandTask.check"><a class="viewcode-back" href="../../../api/evennia.scripts.ondemandhandler.html#evennia.scripts.ondemandhandler.OnDemandTask.check">[docs]</a> <span class="k">def</span> <span class="nf">check</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">autostart</span><span class="o">=</span><span class="kc">True</span><span class="p">,</span> <span class="o">**</span><span class="n">kwargs</span><span class="p">):</span>
|
||||
<span class="w"> </span><span class="sd">"""</span>
|
||||
<span class="sd"> Check the current stage of the task and return the time-delta to the next stage.</span>
|
||||
|
||||
<span class="sd"> Args:</span>
|
||||
<span class="sd"> Keyword Args:</span>
|
||||
<span class="sd"> autostart (bool, optional): If this is set, and the task has not been started yet,</span>
|
||||
<span class="sd"> it will be started by this check. This is mainly used internally.</span>
|
||||
<span class="sd"> **kwargs: Will be passed to the stage function, if one is called.</span>
|
||||
|
||||
<span class="sd"> Returns:</span>
|
||||
<span class="sd"> tuple: A tuple (dt, stage) where `dt` is the time-delta (in seconds) since the test</span>
|
||||
|
|
@ -358,7 +361,7 @@
|
|||
|
||||
<span class="k">if</span> <span class="n">stage_func</span><span class="p">:</span>
|
||||
<span class="k">try</span><span class="p">:</span>
|
||||
<span class="n">stage_func</span><span class="p">(</span><span class="bp">self</span><span class="p">)</span>
|
||||
<span class="n">stage_func</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="k">except</span> <span class="ne">Exception</span> <span class="k">as</span> <span class="n">err</span><span class="p">:</span>
|
||||
<span class="n">logger</span><span class="o">.</span><span class="n">log_trace</span><span class="p">(</span>
|
||||
<span class="sa">f</span><span class="s2">"Error getting stage of on-demand task </span><span class="si">{</span><span class="bp">self</span><span class="si">}</span><span class="s2"> "</span>
|
||||
|
|
@ -392,16 +395,17 @@
|
|||
|
||||
<span class="k">return</span> <span class="n">dt</span><span class="p">,</span> <span class="n">stage</span></div>
|
||||
|
||||
<div class="viewcode-block" id="OnDemandTask.get_dt"><a class="viewcode-back" href="../../../api/evennia.scripts.ondemandhandler.html#evennia.scripts.ondemandhandler.OnDemandTask.get_dt">[docs]</a> <span class="k">def</span> <span class="nf">get_dt</span><span class="p">(</span><span class="bp">self</span><span class="p">):</span>
|
||||
<div class="viewcode-block" id="OnDemandTask.get_dt"><a class="viewcode-back" href="../../../api/evennia.scripts.ondemandhandler.html#evennia.scripts.ondemandhandler.OnDemandTask.get_dt">[docs]</a> <span class="k">def</span> <span class="nf">get_dt</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="w"> </span><span class="sd">"""</span>
|
||||
<span class="sd"> Get the time-delta since last check.</span>
|
||||
|
||||
<span class="sd"> Returns:</span>
|
||||
<span class="sd"> int: The time since the last check, or 0 if this is the first time the task is checked.</span>
|
||||
<span class="sd"> **kwargs: Will be passed to the stage function, if one is called.</span>
|
||||
|
||||
<span class="sd"> """</span>
|
||||
|
||||
<span class="k">return</span> <span class="bp">self</span><span class="o">.</span><span class="n">check</span><span class="p">()[</span><span class="mi">0</span><span class="p">]</span></div>
|
||||
<span class="k">return</span> <span class="bp">self</span><span class="o">.</span><span class="n">check</span><span class="p">(</span><span class="n">autostart</span><span class="o">=</span><span class="kc">True</span><span class="p">,</span> <span class="o">**</span><span class="n">kwargs</span><span class="p">)[</span><span class="mi">0</span><span class="p">]</span></div>
|
||||
|
||||
<div class="viewcode-block" id="OnDemandTask.set_dt"><a class="viewcode-back" href="../../../api/evennia.scripts.ondemandhandler.html#evennia.scripts.ondemandhandler.OnDemandTask.set_dt">[docs]</a> <span class="k">def</span> <span class="nf">set_dt</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">dt</span><span class="p">):</span>
|
||||
<span class="w"> </span><span class="sd">"""</span>
|
||||
|
|
@ -420,16 +424,17 @@
|
|||
<span class="sd"> """</span>
|
||||
<span class="bp">self</span><span class="o">.</span><span class="n">start_time</span> <span class="o">=</span> <span class="n">OnDemandTask</span><span class="o">.</span><span class="n">runtime</span><span class="p">()</span> <span class="o">-</span> <span class="n">dt</span></div>
|
||||
|
||||
<div class="viewcode-block" id="OnDemandTask.get_stage"><a class="viewcode-back" href="../../../api/evennia.scripts.ondemandhandler.html#evennia.scripts.ondemandhandler.OnDemandTask.get_stage">[docs]</a> <span class="k">def</span> <span class="nf">get_stage</span><span class="p">(</span><span class="bp">self</span><span class="p">):</span>
|
||||
<div class="viewcode-block" id="OnDemandTask.get_stage"><a class="viewcode-back" href="../../../api/evennia.scripts.ondemandhandler.html#evennia.scripts.ondemandhandler.OnDemandTask.get_stage">[docs]</a> <span class="k">def</span> <span class="nf">get_stage</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="w"> </span><span class="sd">"""</span>
|
||||
<span class="sd"> Get the current stage of the task. If no stage was given, this will return `None` but</span>
|
||||
<span class="sd"> still update the last_checked time.</span>
|
||||
|
||||
<span class="sd"> Returns:</span>
|
||||
<span class="sd"> str or None: The current stage of the task, or `None` if no stages are set.</span>
|
||||
<span class="sd"> **kwargs: Will be passed to the stage function, if one is called.</span>
|
||||
|
||||
<span class="sd"> """</span>
|
||||
<span class="k">return</span> <span class="bp">self</span><span class="o">.</span><span class="n">check</span><span class="p">()[</span><span class="mi">1</span><span class="p">]</span></div>
|
||||
<span class="k">return</span> <span class="bp">self</span><span class="o">.</span><span class="n">check</span><span class="p">(</span><span class="n">autostart</span><span class="o">=</span><span class="kc">True</span><span class="p">,</span> <span class="o">**</span><span class="n">kwargs</span><span class="p">)[</span><span class="mi">1</span><span class="p">]</span></div>
|
||||
|
||||
<div class="viewcode-block" id="OnDemandTask.set_stage"><a class="viewcode-back" href="../../../api/evennia.scripts.ondemandhandler.html#evennia.scripts.ondemandhandler.OnDemandTask.set_stage">[docs]</a> <span class="k">def</span> <span class="nf">set_stage</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">stage</span><span class="o">=</span><span class="kc">None</span><span class="p">):</span>
|
||||
<span class="w"> </span><span class="sd">"""</span>
|
||||
|
|
@ -476,14 +481,14 @@
|
|||
<span class="sd"> This should be automatically called when Evennia starts.</span>
|
||||
|
||||
<span class="sd"> """</span>
|
||||
<span class="bp">self</span><span class="o">.</span><span class="n">tasks</span> <span class="o">=</span> <span class="nb">dict</span><span class="p">(</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">"on_demand_timers"</span><span class="p">,</span> <span class="n">default</span><span class="o">=</span><span class="nb">dict</span><span class="p">))</span></div>
|
||||
<span class="bp">self</span><span class="o">.</span><span class="n">tasks</span> <span class="o">=</span> <span class="nb">dict</span><span class="p">(</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="n">ONDEMAND_HANDLER_SAVE_NAME</span><span class="p">,</span> <span class="n">default</span><span class="o">=</span><span class="nb">dict</span><span class="p">))</span></div>
|
||||
|
||||
<div class="viewcode-block" id="OnDemandHandler.save"><a class="viewcode-back" href="../../../api/evennia.scripts.ondemandhandler.html#evennia.scripts.ondemandhandler.OnDemandHandler.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="w"> </span><span class="sd">"""</span>
|
||||
<span class="sd"> Save the on-demand timers to ServerConfig storage. Should be called when Evennia shuts down.</span>
|
||||
|
||||
<span class="sd"> """</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">"on_demand_timers"</span><span class="p">,</span> <span class="bp">self</span><span class="o">.</span><span class="n">tasks</span><span class="p">)</span></div>
|
||||
<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="n">ONDEMAND_HANDLER_SAVE_NAME</span><span class="p">,</span> <span class="bp">self</span><span class="o">.</span><span class="n">tasks</span><span class="p">)</span></div>
|
||||
|
||||
<span class="k">def</span> <span class="nf">_build_key</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">category</span><span class="p">):</span>
|
||||
<span class="w"> </span><span class="sd">"""</span>
|
||||
|
|
@ -494,7 +499,8 @@
|
|||
<span class="sd"> called without arguments. If an Object, will be converted to a string. If</span>
|
||||
<span class="sd"> an `OnDemandTask`, then all other arguments are ignored and the task will be used</span>
|
||||
<span class="sd"> to build the internal storage key.</span>
|
||||
<span class="sd"> category (str or callable): The task category. If callable, it will be called without arguments.</span>
|
||||
<span class="sd"> category (str or callable): The task category. If callable, it will be called without</span>
|
||||
<span class="sd"> arguments.</span>
|
||||
|
||||
<span class="sd"> Returns:</span>
|
||||
<span class="sd"> tuple (str, str or None): The unique key.</span>
|
||||
|
|
@ -527,7 +533,8 @@
|
|||
|
||||
<span class="sd"> Returns:</span>
|
||||
<span class="sd"> OnDemandTask: The created task (or the same that was added, if given an `OnDemandTask`</span>
|
||||
<span class="sd"> as a `key`). Use `task.get_dt()` and `task.get_stage()` to get data from it manually.</span>
|
||||
<span class="sd"> as a `key`). Use `task.get_dt()` and `task.get_stage()` to get data from it</span>
|
||||
<span class="sd"> manually.</span>
|
||||
|
||||
<span class="sd"> """</span>
|
||||
<span class="k">if</span> <span class="nb">isinstance</span><span class="p">(</span><span class="n">key</span><span class="p">,</span> <span class="n">OnDemandTask</span><span class="p">):</span>
|
||||
|
|
@ -553,9 +560,10 @@
|
|||
<span class="sd"> Remove an on-demand task.</span>
|
||||
|
||||
<span class="sd"> Args:</span>
|
||||
<span class="sd"> key (str, callable, OnDemandTask or Object): The unique identifier for the task. If a callable, will</span>
|
||||
<span class="sd"> be called without arguments. If an Object, will be converted to a string. If an `OnDemandTask`,</span>
|
||||
<span class="sd"> then all other arguments are ignored and the task will be used to identify the task to remove.</span>
|
||||
<span class="sd"> key (str, callable, OnDemandTask or Object): The unique identifier for the task. If a</span>
|
||||
<span class="sd"> callable, will be called without arguments. If an Object, will be converted to a</span>
|
||||
<span class="sd"> string. If an `OnDemandTask`, then all other arguments are ignored and the task</span>
|
||||
<span class="sd"> will be used to identify the task to remove.</span>
|
||||
<span class="sd"> category (str or callable, optional): The category of the task.</span>
|
||||
|
||||
<span class="sd"> Returns:</span>
|
||||
|
|
@ -607,10 +615,10 @@
|
|||
<span class="sd"> Clear all on-demand tasks.</span>
|
||||
|
||||
<span class="sd"> Args:</span>
|
||||
<span class="sd"> category (str, optional): The category of the tasks to clear. What `None` means is determined</span>
|
||||
<span class="sd"> by the `all_on_none` kwarg.</span>
|
||||
<span class="sd"> all_on_none (bool, optional): Determines what to clear if `category` is `None`. If `True`,</span>
|
||||
<span class="sd"> clear all tasks, if `False`, only clear tasks with no category.</span>
|
||||
<span class="sd"> category (str, optional): The category of the tasks to clear. What `None` means is</span>
|
||||
<span class="sd"> determined by the `all_on_none` kwarg.</span>
|
||||
<span class="sd"> all_on_none (bool, optional): Determines what to clear if `category` is `None`. If</span>
|
||||
<span class="sd"> `True`, clear all tasks, if `False`, only clear tasks with no category.</span>
|
||||
|
||||
<span class="sd"> """</span>
|
||||
<span class="k">if</span> <span class="n">category</span> <span class="ow">is</span> <span class="kc">None</span> <span class="ow">and</span> <span class="n">all_on_none</span><span class="p">:</span>
|
||||
|
|
@ -628,9 +636,9 @@
|
|||
|
||||
<span class="sd"> Args:</span>
|
||||
<span class="sd"> key (str, callable, OnDemandTask or Object): The unique identifier for the task. If a</span>
|
||||
<span class="sd"> callable, will be called without arguments. If an Object, will be converted to a string.</span>
|
||||
<span class="sd"> If an `OnDemandTask`, then all other arguments are ignored and the task will be used</span>
|
||||
<span class="sd"> (only useful to check the task is the same).</span>
|
||||
<span class="sd"> callable, will be called without arguments. If an Object, will be converted to a</span>
|
||||
<span class="sd"> string. If an `OnDemandTask`, then all other arguments are ignored and the task</span>
|
||||
<span class="sd"> will be used (only useful to check the task is the same).</span>
|
||||
|
||||
<span class="sd"> category (str, optional): The category of the task. If unset, this will only return</span>
|
||||
<span class="sd"> tasks with no category.</span>
|
||||
|
|
@ -641,22 +649,23 @@
|
|||
<span class="sd"> """</span>
|
||||
<span class="k">return</span> <span class="bp">self</span><span class="o">.</span><span class="n">tasks</span><span class="o">.</span><span class="n">get</span><span class="p">(</span><span class="bp">self</span><span class="o">.</span><span class="n">_build_key</span><span class="p">(</span><span class="n">key</span><span class="p">,</span> <span class="n">category</span><span class="p">))</span></div>
|
||||
|
||||
<div class="viewcode-block" id="OnDemandHandler.get_dt"><a class="viewcode-back" href="../../../api/evennia.scripts.ondemandhandler.html#evennia.scripts.ondemandhandler.OnDemandHandler.get_dt">[docs]</a> <span class="k">def</span> <span class="nf">get_dt</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">category</span><span class="o">=</span><span class="kc">None</span><span class="p">):</span>
|
||||
<div class="viewcode-block" id="OnDemandHandler.get_dt"><a class="viewcode-back" href="../../../api/evennia.scripts.ondemandhandler.html#evennia.scripts.ondemandhandler.OnDemandHandler.get_dt">[docs]</a> <span class="k">def</span> <span class="nf">get_dt</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">category</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="w"> </span><span class="sd">"""</span>
|
||||
<span class="sd"> Get the time-delta since the task started.</span>
|
||||
|
||||
<span class="sd"> Args:</span>
|
||||
<span class="sd"> key (str, callable, OnDemandTask or Object): The unique identifier for the task. If a</span>
|
||||
<span class="sd"> callable, will be called without arguments. If an Object, will be converted to a string.</span>
|
||||
<span class="sd"> If an `OnDemandTask`, then all other arguments are ignored and the task will be used</span>
|
||||
<span class="sd"> to identify the task to get the time-delta from.</span>
|
||||
<span class="sd"> callable, will be called without arguments. If an Object, will be converted to a</span>
|
||||
<span class="sd"> string. If an `OnDemandTask`, then all other arguments are ignored and the task</span>
|
||||
<span class="sd"> will be used to identify the task to get the time-delta from.</span>
|
||||
<span class="sd"> **kwargs: Will be passed to the stage function, if one is called.</span>
|
||||
|
||||
<span class="sd"> Returns:</span>
|
||||
<span class="sd"> int or None: The time since the last check, or `None` if no task was found.</span>
|
||||
|
||||
<span class="sd"> """</span>
|
||||
<span class="n">task</span> <span class="o">=</span> <span class="bp">self</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">category</span><span class="p">)</span>
|
||||
<span class="k">return</span> <span class="n">task</span><span class="o">.</span><span class="n">get_dt</span><span class="p">()</span> <span class="k">if</span> <span class="n">task</span> <span class="k">else</span> <span class="kc">None</span></div>
|
||||
<span class="k">return</span> <span class="n">task</span><span class="o">.</span><span class="n">get_dt</span><span class="p">(</span><span class="o">**</span><span class="n">kwargs</span><span class="p">)</span> <span class="k">if</span> <span class="n">task</span> <span class="k">else</span> <span class="kc">None</span></div>
|
||||
|
||||
<div class="viewcode-block" id="OnDemandHandler.set_dt"><a class="viewcode-back" href="../../../api/evennia.scripts.ondemandhandler.html#evennia.scripts.ondemandhandler.OnDemandHandler.set_dt">[docs]</a> <span class="k">def</span> <span class="nf">set_dt</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">category</span><span class="p">,</span> <span class="n">dt</span><span class="p">):</span>
|
||||
<span class="w"> </span><span class="sd">"""</span>
|
||||
|
|
@ -666,9 +675,9 @@
|
|||
|
||||
<span class="sd"> Args:</span>
|
||||
<span class="sd"> key (str, callable, OnDemandTask or Object): The unique identifier for the task. If a</span>
|
||||
<span class="sd"> callable, will be called without arguments. If an Object, will be converted to a string.</span>
|
||||
<span class="sd"> If an `OnDemandTask`, then all other arguments are ignored and the task will be used</span>
|
||||
<span class="sd"> to identify the task to set the time-delta for.</span>
|
||||
<span class="sd"> callable, will be called without arguments. If an Object, will be converted to a</span>
|
||||
<span class="sd"> string. If an `OnDemandTask`, then all other arguments are ignored and the task will</span>
|
||||
<span class="sd"> be used to identify the task to set the time-delta for.</span>
|
||||
<span class="sd"> category (str, optional): The category of the task.</span>
|
||||
<span class="sd"> dt (int): The time-delta to set. This is an absolute value in seconds, same as returned</span>
|
||||
<span class="sd"> by `get_dt`.</span>
|
||||
|
|
@ -682,22 +691,24 @@
|
|||
<span class="k">if</span> <span class="n">task</span><span class="p">:</span>
|
||||
<span class="n">task</span><span class="o">.</span><span class="n">set_dt</span><span class="p">(</span><span class="n">dt</span><span class="p">)</span></div>
|
||||
|
||||
<div class="viewcode-block" id="OnDemandHandler.get_stage"><a class="viewcode-back" href="../../../api/evennia.scripts.ondemandhandler.html#evennia.scripts.ondemandhandler.OnDemandHandler.get_stage">[docs]</a> <span class="k">def</span> <span class="nf">get_stage</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">category</span><span class="o">=</span><span class="kc">None</span><span class="p">):</span>
|
||||
<div class="viewcode-block" id="OnDemandHandler.get_stage"><a class="viewcode-back" href="../../../api/evennia.scripts.ondemandhandler.html#evennia.scripts.ondemandhandler.OnDemandHandler.get_stage">[docs]</a> <span class="k">def</span> <span class="nf">get_stage</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">category</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="w"> </span><span class="sd">"""</span>
|
||||
<span class="sd"> Get the current stage of an on-demand task.</span>
|
||||
|
||||
<span class="sd"> Args:</span>
|
||||
<span class="sd"> key (str, callable, OnDemandTask or Object): The unique identifier for the task. If a</span>
|
||||
<span class="sd"> callable, will be called without arguments. If an Object, will be converted to a string.</span>
|
||||
<span class="sd"> If an `OnDemandTask`, then all other arguments are ignored and the task will be used</span>
|
||||
<span class="sd"> to identify the task to get the stage from.</span>
|
||||
<span class="sd"> callable, will be called without arguments. If an Object, will be converted to a</span>
|
||||
<span class="sd"> string. If an `OnDemandTask`, then all other arguments are ignored and the task</span>
|
||||
<span class="sd"> will be used to identify the task to get the stage from.</span>
|
||||
<span class="sd"> category (str, optional): The category of the task.</span>
|
||||
<span class="sd"> **kwargs: Will be passed to the stage function, if one is called.</span>
|
||||
|
||||
<span class="sd"> Returns:</span>
|
||||
<span class="sd"> str or None: The current stage of the task, or `None` if no task was found.</span>
|
||||
|
||||
<span class="sd"> """</span>
|
||||
<span class="n">task</span> <span class="o">=</span> <span class="bp">self</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">category</span><span class="p">)</span>
|
||||
<span class="k">return</span> <span class="n">task</span><span class="o">.</span><span class="n">get_stage</span><span class="p">()</span> <span class="k">if</span> <span class="n">task</span> <span class="k">else</span> <span class="kc">None</span></div>
|
||||
<span class="k">return</span> <span class="n">task</span><span class="o">.</span><span class="n">get_stage</span><span class="p">(</span><span class="o">**</span><span class="n">kwargs</span><span class="p">)</span> <span class="k">if</span> <span class="n">task</span> <span class="k">else</span> <span class="kc">None</span></div>
|
||||
|
||||
<div class="viewcode-block" id="OnDemandHandler.set_stage"><a class="viewcode-back" href="../../../api/evennia.scripts.ondemandhandler.html#evennia.scripts.ondemandhandler.OnDemandHandler.set_stage">[docs]</a> <span class="k">def</span> <span class="nf">set_stage</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">category</span><span class="o">=</span><span class="kc">None</span><span class="p">,</span> <span class="n">stage</span><span class="o">=</span><span class="kc">None</span><span class="p">):</span>
|
||||
<span class="w"> </span><span class="sd">"""</span>
|
||||
|
|
|
|||
|
|
@ -12,6 +12,8 @@
|
|||
- Feature: Add `ON_DEMAND_HANDLER.set_dt(key, category, dt)` and
|
||||
`.set_stage(key, category, stage)` to allow manual tweaking of task timings,
|
||||
for example for a spell speeding a plant's growth (Griatch)
|
||||
- Feature: Add `ON_DEMAND_HANDLER.get_dt/stages(key,category, **kwargs)`, where
|
||||
the kwargs are passed into any stage-callable defined with the stages. (Griatch)
|
||||
- Feature: Add `use_assertequal` kwarg to the `EvenniaCommandTestMixin` testing
|
||||
class; this uses django's `assertEqual` over the default more lenient checker,
|
||||
which can be useful for testing table whitespace (Griatch)
|
||||
|
|
|
|||
|
|
@ -67,6 +67,8 @@ class Flower(Object):
|
|||
```
|
||||
|
||||
|
||||
The `get_state(key, category=None, **kwargs)` methoid is used to get the current stage. The `get_dt(key, category=None, **kwargs)` method instead retrieves the currently passed time.
|
||||
|
||||
You could now create the rose and it would figure out its state only when you are actually looking at it. It will stay a seedling for 10 minutes (of in-game real time) before it sprouts. Within 12 hours it will be dead again.
|
||||
|
||||
If you had a `harvest` command in your game, you could equally have it check the stage of bloom and give you different results depending on if you pick the rose at the right time or not.
|
||||
|
|
@ -94,13 +96,12 @@ This is important. If no-one checks in on the flower until a time when it's alr
|
|||
```
|
||||
- The `key` can be a string, but also a typeclassed object (its string representation will be used, which normally includes its `#dbref`). You can also pass a `callable` - this will be called without arguments and is expected to return a string to use for the `key`. Finally, you can also pass [OnDemandTask](evennia.scripts.ondemandhandler.OnDemandTask) entities - these are the objects the handler uses under the hood to represent each task.
|
||||
- The `category` allows you to further categorize your demandhandler tasks to make sure they are unique. Since the handler is global, you need to make sure `key` + `category` is unique. While `category` is optional, if you use it you must also use it to retrieve your state later.
|
||||
- `stages` is a `dict` `{dt: statename}` or `{dt: (statename, callable)}` that represents how much time (in seconds) from _the start of the task_ it takes for that stage to begin. In the flower example above, it was 10 hours until the `wilting` state began. If a `callable` is also included, this will be called *the first time* that state is checked for (only!). The callable takes a `evennia.OnDemandTask` as an argument and allows for tweaking the task on the fly. The `dt` can also be a `float` if you desire higher than per-second precision. Having `stages` is optional - sometimes you only want to know how much time has passed.
|
||||
- `stages` is a `dict` `{dt: statename}` or `{dt: (statename, callable)}` that represents how much time (in seconds) from _the start of the task_ it takes for that stage to begin. In the flower example above, it was 10 hours until the `wilting` state began. If a callable is included, it will fire the first time that stage is reached. This callable takes the current `OnDemandTask` and `**kwargs` as arguments; the keywords are passed on from the `get_stages/dt` methods. [See below](#stage-callables) for information about the allowed callables. Having `stages` is optional - sometimes you only want to know how much time has passed.
|
||||
- `.get_dt()` - get the current time (in seconds) since the task started. This is a `float`.
|
||||
- `.get_stage()` - get the current state name, such as "flowering" or "seedling". If you didn't specify any `stages`, this will return `None`, and you need to interpret the `dt` yourself to determine which state you are in.
|
||||
|
||||
Under the hood, the handler uses [OnDemandTask](evennia.scripts.ondemandhandler.OnDemandTask) objects. It can sometimes be practical to create tasks directly with these, and pass them to the handler in bulk:
|
||||
|
||||
|
||||
```python
|
||||
from evennia import ON_DEMAND_HANDLER, OnDemandTask
|
||||
|
||||
|
|
@ -118,11 +119,49 @@ task2 = ON_DEMAND_HANDLER.get("key1", category="state-category")
|
|||
ON_DEMAND_HANDLER.batch_remove(task1, task2)
|
||||
```
|
||||
|
||||
### Stage callables
|
||||
|
||||
If you define one or more of your `stages` dict keys as `{dt: (statename, callable)}`, this callable will be called when that stage is checked for the first time. This 'stage callable' have a few requirements:
|
||||
|
||||
- The stage callable must be [possible to pickle](https://docs.python.org/3/library/pickle.html#pickle-picklable) because it will be saved to the database. This basically means your callable needs to be a stand-alone function or a method decorated with `@staticmethod`. You won't be able to access the object instance as `self` directly from such a method or function - you need to pass it explicitly.
|
||||
- The callable must always take `task` as its first element. This is the `OnDemandTask` object firing this callable.
|
||||
- It may optionally take `**kwargs` . This will be passed down from your call of `get_dt` or `get_stages`.
|
||||
|
||||
Here's an example:
|
||||
|
||||
```python
|
||||
from evennia DefaultObject, ON_DEMAND_HANDLER
|
||||
|
||||
def mycallable(task, **kwargs)
|
||||
# this function is outside the class and is pickleable just fine
|
||||
obj = kwargs.get("obj")
|
||||
# do something with the object
|
||||
|
||||
class SomeObject(DefaultObject):
|
||||
|
||||
def at_object_creation(self):
|
||||
ON_DEMAND_HANDLER.add(
|
||||
"key1",
|
||||
stages={0: "new", 10: ("old", mycallable)}
|
||||
)
|
||||
|
||||
def do_something(self):
|
||||
# pass obj=self into the handler; to be passed into
|
||||
# mycallable if we are in the 'old' stage.
|
||||
state = ON_DEMAND_HANDLER.get_state("key1", obj=self)
|
||||
|
||||
```
|
||||
|
||||
Above, the `obj=self` will passed into `mycallable` once we reach the 'old' state. If we are not in the 'old' stage, the extra kwargs go nowhere. This way a function can be made aware of the object calling it while still being possible to pickle. You can also pass any other information into the callable this way.
|
||||
|
||||
> If you don't want to deal with the complexity of callables you can also just read off the current stage and do all the logic outside of the handler. This can often be easier to read and maintain.
|
||||
|
||||
|
||||
### Looping repeatedly
|
||||
|
||||
Normally, when a sequence of `stages` have been cycled through, the task will just stop at the last stage indefinitely.
|
||||
|
||||
`evennia.OnDemandTask.stagefunc_loop` is an included static-method callable you can use to make the task loop. Here's an example of how to use it:
|
||||
`evennia.OnDemandTask.stagefunc_loop` is an included static-method stage callable you can use to make the task loop. Here's an example of how to use it:
|
||||
|
||||
```python
|
||||
from evennia import ON_DEMAND_HANDLER, OnDemandTask
|
||||
|
|
|
|||
|
|
@ -329,7 +329,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"> = ['pemit', 'remit']</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"> = ['remit', 'pemit']</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">
|
||||
|
|
@ -360,7 +360,7 @@ to accounts respectively.</p>
|
|||
|
||||
<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', 'no_prefix': ' pemit remit', 'tags': '', 'text': '\n admin command for emitting message to multiple objects\n\n Usage:\n emit[/switches] [<obj>, <obj>, ... =] <message>\n remit [<obj>, <obj>, ... =] <message>\n pemit [<obj>, <obj>, ... =] <message>\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>
|
||||
<code class="sig-name descname">search_index_entry</code><em class="property"> = {'aliases': 'remit pemit', 'category': 'admin', 'key': 'emit', 'no_prefix': ' remit pemit', 'tags': '', 'text': '\n admin command for emitting message to multiple objects\n\n Usage:\n emit[/switches] [<obj>, <obj>, ... =] <message>\n remit [<obj>, <obj>, ... =] <message>\n pemit [<obj>, <obj>, ... =] <message>\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>
|
||||
|
|
|
|||
|
|
@ -150,7 +150,7 @@ skipping, reloading etc.</p>
|
|||
|
||||
<dl class="py attribute">
|
||||
<dt id="evennia.commands.default.batchprocess.CmdBatchCommands.aliases">
|
||||
<code class="sig-name descname">aliases</code><em class="property"> = ['batchcmd', 'batchcommand']</em><a class="headerlink" href="#evennia.commands.default.batchprocess.CmdBatchCommands.aliases" title="Permalink to this definition">¶</a></dt>
|
||||
<code class="sig-name descname">aliases</code><em class="property"> = ['batchcommand', 'batchcmd']</em><a class="headerlink" href="#evennia.commands.default.batchprocess.CmdBatchCommands.aliases" title="Permalink to this definition">¶</a></dt>
|
||||
<dd></dd></dl>
|
||||
|
||||
<dl class="py attribute">
|
||||
|
|
@ -181,7 +181,7 @@ skipping, reloading etc.</p>
|
|||
|
||||
<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': 'batchcmd batchcommand', 'category': 'building', 'key': 'batchcommands', 'no_prefix': ' batchcmd batchcommand', 'tags': '', 'text': '\n build from batch-command file\n\n Usage:\n batchcommands[/interactive] <python.path.to.file>\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>
|
||||
<code class="sig-name descname">search_index_entry</code><em class="property"> = {'aliases': 'batchcommand batchcmd', 'category': 'building', 'key': 'batchcommands', 'no_prefix': ' batchcommand batchcmd', 'tags': '', 'text': '\n build from batch-command file\n\n Usage:\n batchcommands[/interactive] <python.path.to.file>\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>
|
||||
|
|
|
|||
|
|
@ -641,7 +641,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"> = ['@del', '@delete']</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"> = ['@delete', '@del']</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">
|
||||
|
|
@ -682,7 +682,7 @@ You can specify the /force switch to bypass this confirmation.</p>
|
|||
|
||||
<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', 'no_prefix': 'destroy del delete', '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>
|
||||
<code class="sig-name descname">search_index_entry</code><em class="property"> = {'aliases': '@delete @del', 'category': 'building', 'key': '@destroy', 'no_prefix': 'destroy delete del', '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>
|
||||
|
|
@ -1409,7 +1409,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"> = ['@typeclasses', '@type', '@update', '@parent', '@swap']</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"> = ['@parent', '@update', '@typeclasses', '@swap', '@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">
|
||||
|
|
@ -1440,7 +1440,7 @@ server settings.</p>
|
|||
|
||||
<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': '@typeclasses @type @update @parent @swap', 'category': 'building', 'key': '@typeclass', 'no_prefix': 'typeclass typeclasses type update parent swap', 'tags': '', 'text': "\n set or change an object's typeclass\n\n Usage:\n typeclass[/switch] <object> [= typeclass.path]\n typeclass/prototype <object> = prototype_key\n\n typeclasses or 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. This will also\n reset cmdsets!\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 "}</em><a class="headerlink" href="#evennia.commands.default.building.CmdTypeclass.search_index_entry" title="Permalink to this definition">¶</a></dt>
|
||||
<code class="sig-name descname">search_index_entry</code><em class="property"> = {'aliases': '@parent @update @typeclasses @swap @type', 'category': 'building', 'key': '@typeclass', 'no_prefix': 'typeclass parent update typeclasses swap type', 'tags': '', 'text': "\n set or change an object's typeclass\n\n Usage:\n typeclass[/switch] <object> [= typeclass.path]\n typeclass/prototype <object> = prototype_key\n\n typeclasses or 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. This will also\n reset cmdsets!\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 "}</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>
|
||||
|
|
@ -1595,7 +1595,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"> = ['@exam', '@ex']</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"> = ['@ex', '@exam']</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">
|
||||
|
|
@ -1868,7 +1868,7 @@ the cases, see the module doc.</p>
|
|||
|
||||
<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', 'no_prefix': 'examine exam ex', 'tags': '', 'text': '\n get detailed information about an object\n\n Usage:\n examine [<object>[/attrname]]\n examine [*<account>[/attrname]]\n\n Switch:\n account - examine an Account (same as adding *)\n object - examine an Object (useful when OOC)\n script - examine a Script\n channel - examine a Channel\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>
|
||||
<code class="sig-name descname">search_index_entry</code><em class="property"> = {'aliases': '@ex @exam', 'category': 'building', 'key': '@examine', 'no_prefix': 'examine ex exam', 'tags': '', 'text': '\n get detailed information about an object\n\n Usage:\n examine [<object>[/attrname]]\n examine [*<account>[/attrname]]\n\n Switch:\n account - examine an Account (same as adding *)\n object - examine an Object (useful when OOC)\n script - examine a Script\n channel - examine a Channel\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>
|
||||
|
|
|
|||
File diff suppressed because one or more lines are too long
|
|
@ -721,7 +721,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">
|
||||
|
|
@ -762,7 +762,7 @@ space.</p>
|
|||
|
||||
<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', 'no_prefix': ' : emote', 'tags': '', 'text': "\n strike a pose\n\n Usage:\n pose <pose text>\n pose's <pose text>\n\n Example:\n pose is standing by the wall, smiling.\n -> 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 "}</em><a class="headerlink" href="#evennia.commands.default.general.CmdPose.search_index_entry" title="Permalink to this definition">¶</a></dt>
|
||||
<code class="sig-name descname">search_index_entry</code><em class="property"> = {'aliases': 'emote :', 'category': 'general', 'key': 'pose', 'no_prefix': ' emote :', 'tags': '', 'text': "\n strike a pose\n\n Usage:\n pose <pose text>\n pose's <pose text>\n\n Example:\n pose is standing by the wall, smiling.\n -> 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 "}</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>
|
||||
|
|
@ -785,7 +785,7 @@ which permission groups you are a member of.</p>
|
|||
|
||||
<dl class="py attribute">
|
||||
<dt id="evennia.commands.default.general.CmdAccess.aliases">
|
||||
<code class="sig-name descname">aliases</code><em class="property"> = ['hierarchy', 'groups']</em><a class="headerlink" href="#evennia.commands.default.general.CmdAccess.aliases" title="Permalink to this definition">¶</a></dt>
|
||||
<code class="sig-name descname">aliases</code><em class="property"> = ['groups', 'hierarchy']</em><a class="headerlink" href="#evennia.commands.default.general.CmdAccess.aliases" title="Permalink to this definition">¶</a></dt>
|
||||
<dd></dd></dl>
|
||||
|
||||
<dl class="py attribute">
|
||||
|
|
@ -816,7 +816,7 @@ which permission groups you are a member of.</p>
|
|||
|
||||
<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', 'no_prefix': ' hierarchy groups', '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>
|
||||
<code class="sig-name descname">search_index_entry</code><em class="property"> = {'aliases': 'groups hierarchy', 'category': 'general', 'key': 'access', 'no_prefix': ' groups hierarchy', '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>
|
||||
|
|
|
|||
|
|
@ -973,7 +973,7 @@ main test suite started with</p>
|
|||
<p>Test the batch processor.</p>
|
||||
<dl class="py attribute">
|
||||
<dt id="evennia.commands.default.tests.TestBatchProcess.red_button">
|
||||
<code class="sig-name descname">red_button</code><em class="property"> = <module 'evennia.contrib.tutorials.red_button.red_button' from '/tmp/tmp66rtn6r2/6e6ab208a6b53fc30dd91a6f83124e641d851601/evennia/contrib/tutorials/red_button/red_button.py'></em><a class="headerlink" href="#evennia.commands.default.tests.TestBatchProcess.red_button" title="Permalink to this definition">¶</a></dt>
|
||||
<code class="sig-name descname">red_button</code><em class="property"> = <module 'evennia.contrib.tutorials.red_button.red_button' from '/tmp/tmplcp4h0sa/34b5f1133cd6ff4cd29f6d909ef3387fce667288/evennia/contrib/tutorials/red_button/red_button.py'></em><a class="headerlink" href="#evennia.commands.default.tests.TestBatchProcess.red_button" title="Permalink to this definition">¶</a></dt>
|
||||
<dd></dd></dl>
|
||||
|
||||
<dl class="py method">
|
||||
|
|
|
|||
|
|
@ -134,7 +134,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"> = ['conn', 'con', '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"> = ['co', 'conn', 'con']</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">
|
||||
|
|
@ -169,7 +169,7 @@ there is no object yet before the account has logged in)</p>
|
|||
|
||||
<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', 'no_prefix': ' conn con co', 'tags': '', 'text': '\n connect to the game\n\n Usage (at login screen):\n connect accountname password\n connect "account name" "pass word"\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>
|
||||
<code class="sig-name descname">search_index_entry</code><em class="property"> = {'aliases': 'co conn con', 'category': 'general', 'key': 'connect', 'no_prefix': ' co conn con', 'tags': '', 'text': '\n connect to the game\n\n Usage (at login screen):\n connect accountname password\n connect "account name" "pass word"\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>
|
||||
|
|
@ -304,7 +304,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"> = ['l', 'look']</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"> = ['look', 'l']</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">
|
||||
|
|
@ -330,7 +330,7 @@ All it does is display the connect screen.</p>
|
|||
|
||||
<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', 'no_prefix': ' l look', '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>
|
||||
<code class="sig-name descname">search_index_entry</code><em class="property"> = {'aliases': 'look l', 'category': 'general', 'key': '__unloggedin_look_command', 'no_prefix': ' look l', '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>
|
||||
|
|
@ -353,7 +353,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">
|
||||
|
|
@ -379,7 +379,7 @@ for simplicity. It shows a pane of info.</p>
|
|||
|
||||
<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', 'no_prefix': ' h ?', '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>
|
||||
<code class="sig-name descname">search_index_entry</code><em class="property"> = {'aliases': '? h', 'category': 'general', 'key': 'help', 'no_prefix': ' ? h', '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>
|
||||
|
|
|
|||
|
|
@ -151,7 +151,7 @@ the module given by settings.CONNECTION_SCREEN_MODULE.</p>
|
|||
|
||||
<dl class="py attribute">
|
||||
<dt id="evennia.contrib.base_systems.email_login.email_login.CmdUnconnectedConnect.aliases">
|
||||
<code class="sig-name descname">aliases</code><em class="property"> = ['conn', 'con', 'co']</em><a class="headerlink" href="#evennia.contrib.base_systems.email_login.email_login.CmdUnconnectedConnect.aliases" title="Permalink to this definition">¶</a></dt>
|
||||
<code class="sig-name descname">aliases</code><em class="property"> = ['co', 'conn', 'con']</em><a class="headerlink" href="#evennia.contrib.base_systems.email_login.email_login.CmdUnconnectedConnect.aliases" title="Permalink to this definition">¶</a></dt>
|
||||
<dd></dd></dl>
|
||||
|
||||
<dl class="py attribute">
|
||||
|
|
@ -181,7 +181,7 @@ there is no object yet before the account has logged in)</p>
|
|||
|
||||
<dl class="py attribute">
|
||||
<dt id="evennia.contrib.base_systems.email_login.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', 'no_prefix': ' conn con co', 'tags': '', 'text': '\n Connect to the game.\n\n Usage (at login screen):\n connect <email> <password>\n\n Use the create command to first create an account before logging in.\n '}</em><a class="headerlink" href="#evennia.contrib.base_systems.email_login.email_login.CmdUnconnectedConnect.search_index_entry" title="Permalink to this definition">¶</a></dt>
|
||||
<code class="sig-name descname">search_index_entry</code><em class="property"> = {'aliases': 'co conn con', 'category': 'general', 'key': 'connect', 'no_prefix': ' co conn con', 'tags': '', 'text': '\n Connect to the game.\n\n Usage (at login screen):\n connect <email> <password>\n\n Use the create command to first create an account before logging in.\n '}</em><a class="headerlink" href="#evennia.contrib.base_systems.email_login.email_login.CmdUnconnectedConnect.search_index_entry" title="Permalink to this definition">¶</a></dt>
|
||||
<dd></dd></dl>
|
||||
|
||||
</dd></dl>
|
||||
|
|
@ -309,7 +309,7 @@ All it does is display the connect screen.</p>
|
|||
|
||||
<dl class="py attribute">
|
||||
<dt id="evennia.contrib.base_systems.email_login.email_login.CmdUnconnectedLook.aliases">
|
||||
<code class="sig-name descname">aliases</code><em class="property"> = ['l', 'look']</em><a class="headerlink" href="#evennia.contrib.base_systems.email_login.email_login.CmdUnconnectedLook.aliases" title="Permalink to this definition">¶</a></dt>
|
||||
<code class="sig-name descname">aliases</code><em class="property"> = ['look', 'l']</em><a class="headerlink" href="#evennia.contrib.base_systems.email_login.email_login.CmdUnconnectedLook.aliases" title="Permalink to this definition">¶</a></dt>
|
||||
<dd></dd></dl>
|
||||
|
||||
<dl class="py attribute">
|
||||
|
|
@ -335,7 +335,7 @@ All it does is display the connect screen.</p>
|
|||
|
||||
<dl class="py attribute">
|
||||
<dt id="evennia.contrib.base_systems.email_login.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', 'no_prefix': ' l look', '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.base_systems.email_login.email_login.CmdUnconnectedLook.search_index_entry" title="Permalink to this definition">¶</a></dt>
|
||||
<code class="sig-name descname">search_index_entry</code><em class="property"> = {'aliases': 'look l', 'category': 'general', 'key': '__unloggedin_look_command', 'no_prefix': ' look l', '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.base_systems.email_login.email_login.CmdUnconnectedLook.search_index_entry" title="Permalink to this definition">¶</a></dt>
|
||||
<dd></dd></dl>
|
||||
|
||||
</dd></dl>
|
||||
|
|
@ -353,7 +353,7 @@ for simplicity. It shows a pane of info.</p>
|
|||
|
||||
<dl class="py attribute">
|
||||
<dt id="evennia.contrib.base_systems.email_login.email_login.CmdUnconnectedHelp.aliases">
|
||||
<code class="sig-name descname">aliases</code><em class="property"> = ['h', '?']</em><a class="headerlink" href="#evennia.contrib.base_systems.email_login.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.base_systems.email_login.email_login.CmdUnconnectedHelp.aliases" title="Permalink to this definition">¶</a></dt>
|
||||
<dd></dd></dl>
|
||||
|
||||
<dl class="py attribute">
|
||||
|
|
@ -379,7 +379,7 @@ for simplicity. It shows a pane of info.</p>
|
|||
|
||||
<dl class="py attribute">
|
||||
<dt id="evennia.contrib.base_systems.email_login.email_login.CmdUnconnectedHelp.search_index_entry">
|
||||
<code class="sig-name descname">search_index_entry</code><em class="property"> = {'aliases': 'h ?', 'category': 'general', 'key': 'help', 'no_prefix': ' h ?', '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.base_systems.email_login.email_login.CmdUnconnectedHelp.search_index_entry" title="Permalink to this definition">¶</a></dt>
|
||||
<code class="sig-name descname">search_index_entry</code><em class="property"> = {'aliases': '? h', 'category': 'general', 'key': 'help', 'no_prefix': ' ? h', '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.base_systems.email_login.email_login.CmdUnconnectedHelp.search_index_entry" title="Permalink to this definition">¶</a></dt>
|
||||
<dd></dd></dl>
|
||||
|
||||
</dd></dl>
|
||||
|
|
|
|||
|
|
@ -128,7 +128,7 @@
|
|||
|
||||
<dl class="py attribute">
|
||||
<dt id="evennia.contrib.base_systems.ingame_python.commands.CmdCallback.aliases">
|
||||
<code class="sig-name descname">aliases</code><em class="property"> = ['@callbacks', '@callback', '@calls']</em><a class="headerlink" href="#evennia.contrib.base_systems.ingame_python.commands.CmdCallback.aliases" title="Permalink to this definition">¶</a></dt>
|
||||
<code class="sig-name descname">aliases</code><em class="property"> = ['@callbacks', '@calls', '@callback']</em><a class="headerlink" href="#evennia.contrib.base_systems.ingame_python.commands.CmdCallback.aliases" title="Permalink to this definition">¶</a></dt>
|
||||
<dd></dd></dl>
|
||||
|
||||
<dl class="py attribute">
|
||||
|
|
@ -209,7 +209,7 @@ on user permission.</p>
|
|||
|
||||
<dl class="py attribute">
|
||||
<dt id="evennia.contrib.base_systems.ingame_python.commands.CmdCallback.search_index_entry">
|
||||
<code class="sig-name descname">search_index_entry</code><em class="property"> = {'aliases': '@callbacks @callback @calls', 'category': 'building', 'key': '@call', 'no_prefix': 'call callbacks callback calls', 'tags': '', 'text': '\n Command to edit callbacks.\n '}</em><a class="headerlink" href="#evennia.contrib.base_systems.ingame_python.commands.CmdCallback.search_index_entry" title="Permalink to this definition">¶</a></dt>
|
||||
<code class="sig-name descname">search_index_entry</code><em class="property"> = {'aliases': '@callbacks @calls @callback', 'category': 'building', 'key': '@call', 'no_prefix': 'call callbacks calls callback', 'tags': '', 'text': '\n Command to edit callbacks.\n '}</em><a class="headerlink" href="#evennia.contrib.base_systems.ingame_python.commands.CmdCallback.search_index_entry" title="Permalink to this definition">¶</a></dt>
|
||||
<dd></dd></dl>
|
||||
|
||||
</dd></dl>
|
||||
|
|
|
|||
|
|
@ -172,7 +172,7 @@ aliases to an already joined channel.</p>
|
|||
|
||||
<dl class="py attribute">
|
||||
<dt id="evennia.contrib.base_systems.mux_comms_cmds.mux_comms_cmds.CmdAddCom.aliases">
|
||||
<code class="sig-name descname">aliases</code><em class="property"> = ['aliaschan', 'chanalias']</em><a class="headerlink" href="#evennia.contrib.base_systems.mux_comms_cmds.mux_comms_cmds.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.contrib.base_systems.mux_comms_cmds.mux_comms_cmds.CmdAddCom.aliases" title="Permalink to this definition">¶</a></dt>
|
||||
<dd></dd></dl>
|
||||
|
||||
<dl class="py attribute">
|
||||
|
|
@ -203,7 +203,7 @@ aliases to an already joined channel.</p>
|
|||
|
||||
<dl class="py attribute">
|
||||
<dt id="evennia.contrib.base_systems.mux_comms_cmds.mux_comms_cmds.CmdAddCom.search_index_entry">
|
||||
<code class="sig-name descname">search_index_entry</code><em class="property"> = {'aliases': 'aliaschan chanalias', 'category': 'comms', 'key': 'addcom', 'no_prefix': ' aliaschan chanalias', 'tags': '', 'text': '\n Add a channel alias and/or subscribe to a channel\n\n Usage:\n addcom [alias=] <channel>\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.contrib.base_systems.mux_comms_cmds.mux_comms_cmds.CmdAddCom.search_index_entry" title="Permalink to this definition">¶</a></dt>
|
||||
<code class="sig-name descname">search_index_entry</code><em class="property"> = {'aliases': 'chanalias aliaschan', 'category': 'comms', 'key': 'addcom', 'no_prefix': ' chanalias aliaschan', 'tags': '', 'text': '\n Add a channel alias and/or subscribe to a channel\n\n Usage:\n addcom [alias=] <channel>\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.contrib.base_systems.mux_comms_cmds.mux_comms_cmds.CmdAddCom.search_index_entry" title="Permalink to this definition">¶</a></dt>
|
||||
<dd></dd></dl>
|
||||
|
||||
</dd></dl>
|
||||
|
|
|
|||
|
|
@ -383,7 +383,7 @@ shout</p>
|
|||
|
||||
<dl class="py attribute">
|
||||
<dt id="evennia.contrib.full_systems.evscaperoom.commands.CmdSpeak.aliases">
|
||||
<code class="sig-name descname">aliases</code><em class="property"> = [';', 'shout', 'whisper']</em><a class="headerlink" href="#evennia.contrib.full_systems.evscaperoom.commands.CmdSpeak.aliases" title="Permalink to this definition">¶</a></dt>
|
||||
<code class="sig-name descname">aliases</code><em class="property"> = [';', 'whisper', 'shout']</em><a class="headerlink" href="#evennia.contrib.full_systems.evscaperoom.commands.CmdSpeak.aliases" title="Permalink to this definition">¶</a></dt>
|
||||
<dd></dd></dl>
|
||||
|
||||
<dl class="py attribute">
|
||||
|
|
@ -412,7 +412,7 @@ set in self.parse())</p>
|
|||
|
||||
<dl class="py attribute">
|
||||
<dt id="evennia.contrib.full_systems.evscaperoom.commands.CmdSpeak.search_index_entry">
|
||||
<code class="sig-name descname">search_index_entry</code><em class="property"> = {'aliases': '; shout whisper', 'category': 'general', 'key': 'say', 'no_prefix': ' ; shout whisper', 'tags': '', 'text': '\n Perform an communication action.\n\n Usage:\n say <text>\n whisper\n shout\n\n '}</em><a class="headerlink" href="#evennia.contrib.full_systems.evscaperoom.commands.CmdSpeak.search_index_entry" title="Permalink to this definition">¶</a></dt>
|
||||
<code class="sig-name descname">search_index_entry</code><em class="property"> = {'aliases': '; whisper shout', 'category': 'general', 'key': 'say', 'no_prefix': ' ; whisper shout', 'tags': '', 'text': '\n Perform an communication action.\n\n Usage:\n say <text>\n whisper\n shout\n\n '}</em><a class="headerlink" href="#evennia.contrib.full_systems.evscaperoom.commands.CmdSpeak.search_index_entry" title="Permalink to this definition">¶</a></dt>
|
||||
<dd></dd></dl>
|
||||
|
||||
</dd></dl>
|
||||
|
|
@ -440,7 +440,7 @@ emote /me points to /box and /lever.</p>
|
|||
|
||||
<dl class="py attribute">
|
||||
<dt id="evennia.contrib.full_systems.evscaperoom.commands.CmdEmote.aliases">
|
||||
<code class="sig-name descname">aliases</code><em class="property"> = [':', 'pose']</em><a class="headerlink" href="#evennia.contrib.full_systems.evscaperoom.commands.CmdEmote.aliases" title="Permalink to this definition">¶</a></dt>
|
||||
<code class="sig-name descname">aliases</code><em class="property"> = ['pose', ':']</em><a class="headerlink" href="#evennia.contrib.full_systems.evscaperoom.commands.CmdEmote.aliases" title="Permalink to this definition">¶</a></dt>
|
||||
<dd></dd></dl>
|
||||
|
||||
<dl class="py attribute">
|
||||
|
|
@ -479,7 +479,7 @@ set in self.parse())</p>
|
|||
|
||||
<dl class="py attribute">
|
||||
<dt id="evennia.contrib.full_systems.evscaperoom.commands.CmdEmote.search_index_entry">
|
||||
<code class="sig-name descname">search_index_entry</code><em class="property"> = {'aliases': ': pose', 'category': 'general', 'key': 'emote', 'no_prefix': ' : pose', 'tags': '', 'text': '\n Perform a free-form emote. Use /me to\n include yourself in the emote and /name\n to include other objects or characters.\n Use "..." to enact speech.\n\n Usage:\n emote <emote>\n :<emote\n\n Example:\n emote /me smiles at /peter\n emote /me points to /box and /lever.\n\n '}</em><a class="headerlink" href="#evennia.contrib.full_systems.evscaperoom.commands.CmdEmote.search_index_entry" title="Permalink to this definition">¶</a></dt>
|
||||
<code class="sig-name descname">search_index_entry</code><em class="property"> = {'aliases': 'pose :', 'category': 'general', 'key': 'emote', 'no_prefix': ' pose :', 'tags': '', 'text': '\n Perform a free-form emote. Use /me to\n include yourself in the emote and /name\n to include other objects or characters.\n Use "..." to enact speech.\n\n Usage:\n emote <emote>\n :<emote\n\n Example:\n emote /me smiles at /peter\n emote /me points to /box and /lever.\n\n '}</em><a class="headerlink" href="#evennia.contrib.full_systems.evscaperoom.commands.CmdEmote.search_index_entry" title="Permalink to this definition">¶</a></dt>
|
||||
<dd></dd></dl>
|
||||
|
||||
</dd></dl>
|
||||
|
|
@ -502,7 +502,7 @@ looks and what actions is available.</p>
|
|||
|
||||
<dl class="py attribute">
|
||||
<dt id="evennia.contrib.full_systems.evscaperoom.commands.CmdFocus.aliases">
|
||||
<code class="sig-name descname">aliases</code><em class="property"> = ['ex', 'e', 'examine', 'unfocus']</em><a class="headerlink" href="#evennia.contrib.full_systems.evscaperoom.commands.CmdFocus.aliases" title="Permalink to this definition">¶</a></dt>
|
||||
<code class="sig-name descname">aliases</code><em class="property"> = ['unfocus', 'ex', 'examine', 'e']</em><a class="headerlink" href="#evennia.contrib.full_systems.evscaperoom.commands.CmdFocus.aliases" title="Permalink to this definition">¶</a></dt>
|
||||
<dd></dd></dl>
|
||||
|
||||
<dl class="py attribute">
|
||||
|
|
@ -531,7 +531,7 @@ set in self.parse())</p>
|
|||
|
||||
<dl class="py attribute">
|
||||
<dt id="evennia.contrib.full_systems.evscaperoom.commands.CmdFocus.search_index_entry">
|
||||
<code class="sig-name descname">search_index_entry</code><em class="property"> = {'aliases': 'ex e examine unfocus', 'category': 'evscaperoom', 'key': 'focus', 'no_prefix': ' ex e examine unfocus', 'tags': '', 'text': '\n Focus your attention on a target.\n\n Usage:\n focus <obj>\n\n Once focusing on an object, use look to get more information about how it\n looks and what actions is available.\n\n '}</em><a class="headerlink" href="#evennia.contrib.full_systems.evscaperoom.commands.CmdFocus.search_index_entry" title="Permalink to this definition">¶</a></dt>
|
||||
<code class="sig-name descname">search_index_entry</code><em class="property"> = {'aliases': 'unfocus ex examine e', 'category': 'evscaperoom', 'key': 'focus', 'no_prefix': ' unfocus ex examine e', 'tags': '', 'text': '\n Focus your attention on a target.\n\n Usage:\n focus <obj>\n\n Once focusing on an object, use look to get more information about how it\n looks and what actions is available.\n\n '}</em><a class="headerlink" href="#evennia.contrib.full_systems.evscaperoom.commands.CmdFocus.search_index_entry" title="Permalink to this definition">¶</a></dt>
|
||||
<dd></dd></dl>
|
||||
|
||||
</dd></dl>
|
||||
|
|
@ -593,7 +593,7 @@ set in self.parse())</p>
|
|||
|
||||
<dl class="py attribute">
|
||||
<dt id="evennia.contrib.full_systems.evscaperoom.commands.CmdGet.aliases">
|
||||
<code class="sig-name descname">aliases</code><em class="property"> = ['inv', 'give', 'inventory', 'i']</em><a class="headerlink" href="#evennia.contrib.full_systems.evscaperoom.commands.CmdGet.aliases" title="Permalink to this definition">¶</a></dt>
|
||||
<code class="sig-name descname">aliases</code><em class="property"> = ['i', 'inventory', 'inv', 'give']</em><a class="headerlink" href="#evennia.contrib.full_systems.evscaperoom.commands.CmdGet.aliases" title="Permalink to this definition">¶</a></dt>
|
||||
<dd></dd></dl>
|
||||
|
||||
<dl class="py method">
|
||||
|
|
@ -617,7 +617,7 @@ set in self.parse())</p>
|
|||
|
||||
<dl class="py attribute">
|
||||
<dt id="evennia.contrib.full_systems.evscaperoom.commands.CmdGet.search_index_entry">
|
||||
<code class="sig-name descname">search_index_entry</code><em class="property"> = {'aliases': 'inv give inventory i', 'category': 'evscaperoom', 'key': 'get', 'no_prefix': ' inv give inventory i', 'tags': '', 'text': '\n Use focus / examine instead.\n\n '}</em><a class="headerlink" href="#evennia.contrib.full_systems.evscaperoom.commands.CmdGet.search_index_entry" title="Permalink to this definition">¶</a></dt>
|
||||
<code class="sig-name descname">search_index_entry</code><em class="property"> = {'aliases': 'i inventory inv give', 'category': 'evscaperoom', 'key': 'get', 'no_prefix': ' i inventory inv give', 'tags': '', 'text': '\n Use focus / examine instead.\n\n '}</em><a class="headerlink" href="#evennia.contrib.full_systems.evscaperoom.commands.CmdGet.search_index_entry" title="Permalink to this definition">¶</a></dt>
|
||||
<dd></dd></dl>
|
||||
|
||||
</dd></dl>
|
||||
|
|
|
|||
|
|
@ -434,7 +434,7 @@ there is no room above/below you, your movement will fail.</p>
|
|||
|
||||
<dl class="py attribute">
|
||||
<dt id="evennia.contrib.grid.xyzgrid.commands.CmdFlyAndDive.aliases">
|
||||
<code class="sig-name descname">aliases</code><em class="property"> = ['fly', 'dive']</em><a class="headerlink" href="#evennia.contrib.grid.xyzgrid.commands.CmdFlyAndDive.aliases" title="Permalink to this definition">¶</a></dt>
|
||||
<code class="sig-name descname">aliases</code><em class="property"> = ['dive', 'fly']</em><a class="headerlink" href="#evennia.contrib.grid.xyzgrid.commands.CmdFlyAndDive.aliases" title="Permalink to this definition">¶</a></dt>
|
||||
<dd></dd></dl>
|
||||
|
||||
<dl class="py method">
|
||||
|
|
@ -457,7 +457,7 @@ to all the variables defined therein.</p>
|
|||
|
||||
<dl class="py attribute">
|
||||
<dt id="evennia.contrib.grid.xyzgrid.commands.CmdFlyAndDive.search_index_entry">
|
||||
<code class="sig-name descname">search_index_entry</code><em class="property"> = {'aliases': 'fly dive', 'category': 'general', 'key': 'fly or dive', 'no_prefix': ' fly dive', 'tags': '', 'text': '\n Fly or Dive up and down.\n\n Usage:\n fly\n dive\n\n Will fly up one room or dive down one room at your current position. If\n there is no room above/below you, your movement will fail.\n\n '}</em><a class="headerlink" href="#evennia.contrib.grid.xyzgrid.commands.CmdFlyAndDive.search_index_entry" title="Permalink to this definition">¶</a></dt>
|
||||
<code class="sig-name descname">search_index_entry</code><em class="property"> = {'aliases': 'dive fly', 'category': 'general', 'key': 'fly or dive', 'no_prefix': ' dive fly', 'tags': '', 'text': '\n Fly or Dive up and down.\n\n Usage:\n fly\n dive\n\n Will fly up one room or dive down one room at your current position. If\n there is no room above/below you, your movement will fail.\n\n '}</em><a class="headerlink" href="#evennia.contrib.grid.xyzgrid.commands.CmdFlyAndDive.search_index_entry" title="Permalink to this definition">¶</a></dt>
|
||||
<dd></dd></dl>
|
||||
|
||||
</dd></dl>
|
||||
|
|
|
|||
|
|
@ -478,7 +478,7 @@ turn of combat, performing everyone’s actions in random order.</p>
|
|||
|
||||
<dl class="py attribute">
|
||||
<dt id="evennia.contrib.tutorials.evadventure.combat_turnbased.CmdTurnAttack.aliases">
|
||||
<code class="sig-name descname">aliases</code><em class="property"> = ['turnbased combat', 'hit']</em><a class="headerlink" href="#evennia.contrib.tutorials.evadventure.combat_turnbased.CmdTurnAttack.aliases" title="Permalink to this definition">¶</a></dt>
|
||||
<code class="sig-name descname">aliases</code><em class="property"> = ['hit', 'turnbased combat']</em><a class="headerlink" href="#evennia.contrib.tutorials.evadventure.combat_turnbased.CmdTurnAttack.aliases" title="Permalink to this definition">¶</a></dt>
|
||||
<dd></dd></dl>
|
||||
|
||||
<dl class="py attribute">
|
||||
|
|
@ -524,7 +524,7 @@ set in self.parse())</p>
|
|||
|
||||
<dl class="py attribute">
|
||||
<dt id="evennia.contrib.tutorials.evadventure.combat_turnbased.CmdTurnAttack.search_index_entry">
|
||||
<code class="sig-name descname">search_index_entry</code><em class="property"> = {'aliases': 'turnbased combat hit', 'category': 'general', 'key': 'attack', 'no_prefix': ' turnbased combat hit', 'tags': '', 'text': '\n Start or join combat.\n\n Usage:\n attack [<target>]\n\n '}</em><a class="headerlink" href="#evennia.contrib.tutorials.evadventure.combat_turnbased.CmdTurnAttack.search_index_entry" title="Permalink to this definition">¶</a></dt>
|
||||
<code class="sig-name descname">search_index_entry</code><em class="property"> = {'aliases': 'hit turnbased combat', 'category': 'general', 'key': 'attack', 'no_prefix': ' hit turnbased combat', 'tags': '', 'text': '\n Start or join combat.\n\n Usage:\n attack [<target>]\n\n '}</em><a class="headerlink" href="#evennia.contrib.tutorials.evadventure.combat_turnbased.CmdTurnAttack.search_index_entry" title="Permalink to this definition">¶</a></dt>
|
||||
<dd></dd></dl>
|
||||
|
||||
</dd></dl>
|
||||
|
|
|
|||
|
|
@ -204,7 +204,7 @@ self.args).</p>
|
|||
|
||||
<dl class="py attribute">
|
||||
<dt id="evennia.contrib.tutorials.evadventure.commands.CmdInventory.aliases">
|
||||
<code class="sig-name descname">aliases</code><em class="property"> = ['inv', 'i']</em><a class="headerlink" href="#evennia.contrib.tutorials.evadventure.commands.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.tutorials.evadventure.commands.CmdInventory.aliases" title="Permalink to this definition">¶</a></dt>
|
||||
<dd></dd></dl>
|
||||
|
||||
<dl class="py method">
|
||||
|
|
@ -228,7 +228,7 @@ set in self.parse())</p>
|
|||
|
||||
<dl class="py attribute">
|
||||
<dt id="evennia.contrib.tutorials.evadventure.commands.CmdInventory.search_index_entry">
|
||||
<code class="sig-name descname">search_index_entry</code><em class="property"> = {'aliases': 'inv i', 'category': 'general', 'key': 'inventory', 'no_prefix': ' inv i', 'tags': '', 'text': '\n View your inventory\n\n Usage:\n inventory\n\n '}</em><a class="headerlink" href="#evennia.contrib.tutorials.evadventure.commands.CmdInventory.search_index_entry" title="Permalink to this definition">¶</a></dt>
|
||||
<code class="sig-name descname">search_index_entry</code><em class="property"> = {'aliases': 'i inv', 'category': 'general', 'key': 'inventory', 'no_prefix': ' i inv', 'tags': '', 'text': '\n View your inventory\n\n Usage:\n inventory\n\n '}</em><a class="headerlink" href="#evennia.contrib.tutorials.evadventure.commands.CmdInventory.search_index_entry" title="Permalink to this definition">¶</a></dt>
|
||||
<dd></dd></dl>
|
||||
|
||||
</dd></dl>
|
||||
|
|
|
|||
|
|
@ -264,7 +264,7 @@ check if the lid is open or closed.</p>
|
|||
|
||||
<dl class="py attribute">
|
||||
<dt id="evennia.contrib.tutorials.red_button.red_button.CmdSmashGlass.aliases">
|
||||
<code class="sig-name descname">aliases</code><em class="property"> = ['smash lid', 'smash', 'break lid']</em><a class="headerlink" href="#evennia.contrib.tutorials.red_button.red_button.CmdSmashGlass.aliases" title="Permalink to this definition">¶</a></dt>
|
||||
<code class="sig-name descname">aliases</code><em class="property"> = ['break lid', 'smash lid', 'smash']</em><a class="headerlink" href="#evennia.contrib.tutorials.red_button.red_button.CmdSmashGlass.aliases" title="Permalink to this definition">¶</a></dt>
|
||||
<dd></dd></dl>
|
||||
|
||||
<dl class="py attribute">
|
||||
|
|
@ -291,7 +291,7 @@ break.</p>
|
|||
|
||||
<dl class="py attribute">
|
||||
<dt id="evennia.contrib.tutorials.red_button.red_button.CmdSmashGlass.search_index_entry">
|
||||
<code class="sig-name descname">search_index_entry</code><em class="property"> = {'aliases': 'smash lid smash break lid', 'category': 'general', 'key': 'smash glass', 'no_prefix': ' smash lid smash break lid', 'tags': '', 'text': '\n Smash the protective glass.\n\n Usage:\n smash glass\n\n Try to smash the glass of the button.\n\n '}</em><a class="headerlink" href="#evennia.contrib.tutorials.red_button.red_button.CmdSmashGlass.search_index_entry" title="Permalink to this definition">¶</a></dt>
|
||||
<code class="sig-name descname">search_index_entry</code><em class="property"> = {'aliases': 'break lid smash lid smash', 'category': 'general', 'key': 'smash glass', 'no_prefix': ' break lid smash lid smash', 'tags': '', 'text': '\n Smash the protective glass.\n\n Usage:\n smash glass\n\n Try to smash the glass of the button.\n\n '}</em><a class="headerlink" href="#evennia.contrib.tutorials.red_button.red_button.CmdSmashGlass.search_index_entry" title="Permalink to this definition">¶</a></dt>
|
||||
<dd></dd></dl>
|
||||
|
||||
</dd></dl>
|
||||
|
|
@ -518,7 +518,7 @@ be mutually exclusive.</p>
|
|||
|
||||
<dl class="py attribute">
|
||||
<dt id="evennia.contrib.tutorials.red_button.red_button.CmdBlindLook.aliases">
|
||||
<code class="sig-name descname">aliases</code><em class="property"> = ['get', 'feel', 'l', 'listen', 'ex', 'examine']</em><a class="headerlink" href="#evennia.contrib.tutorials.red_button.red_button.CmdBlindLook.aliases" title="Permalink to this definition">¶</a></dt>
|
||||
<code class="sig-name descname">aliases</code><em class="property"> = ['ex', 'examine', 'get', 'listen', 'feel', 'l']</em><a class="headerlink" href="#evennia.contrib.tutorials.red_button.red_button.CmdBlindLook.aliases" title="Permalink to this definition">¶</a></dt>
|
||||
<dd></dd></dl>
|
||||
|
||||
<dl class="py attribute">
|
||||
|
|
@ -544,7 +544,7 @@ be mutually exclusive.</p>
|
|||
|
||||
<dl class="py attribute">
|
||||
<dt id="evennia.contrib.tutorials.red_button.red_button.CmdBlindLook.search_index_entry">
|
||||
<code class="sig-name descname">search_index_entry</code><em class="property"> = {'aliases': 'get feel l listen ex examine', 'category': 'general', 'key': 'look', 'no_prefix': ' get feel l listen ex examine', 'tags': '', 'text': "\n Looking around in darkness\n\n Usage:\n look <obj>\n\n ... not that there's much to see in the dark.\n\n "}</em><a class="headerlink" href="#evennia.contrib.tutorials.red_button.red_button.CmdBlindLook.search_index_entry" title="Permalink to this definition">¶</a></dt>
|
||||
<code class="sig-name descname">search_index_entry</code><em class="property"> = {'aliases': 'ex examine get listen feel l', 'category': 'general', 'key': 'look', 'no_prefix': ' ex examine get listen feel l', 'tags': '', 'text': "\n Looking around in darkness\n\n Usage:\n look <obj>\n\n ... not that there's much to see in the dark.\n\n "}</em><a class="headerlink" href="#evennia.contrib.tutorials.red_button.red_button.CmdBlindLook.search_index_entry" title="Permalink to this definition">¶</a></dt>
|
||||
<dd></dd></dl>
|
||||
|
||||
</dd></dl>
|
||||
|
|
|
|||
|
|
@ -437,7 +437,7 @@ of the object. We overload it with our own version.</p>
|
|||
|
||||
<dl class="py attribute">
|
||||
<dt id="evennia.contrib.tutorials.tutorial_world.objects.CmdLight.aliases">
|
||||
<code class="sig-name descname">aliases</code><em class="property"> = ['light', 'burn']</em><a class="headerlink" href="#evennia.contrib.tutorials.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.tutorials.tutorial_world.objects.CmdLight.aliases" title="Permalink to this definition">¶</a></dt>
|
||||
<dd></dd></dl>
|
||||
|
||||
<dl class="py attribute">
|
||||
|
|
@ -464,7 +464,7 @@ to sit on a “lightable” object, we operate only on self.obj.</p>
|
|||
|
||||
<dl class="py attribute">
|
||||
<dt id="evennia.contrib.tutorials.tutorial_world.objects.CmdLight.search_index_entry">
|
||||
<code class="sig-name descname">search_index_entry</code><em class="property"> = {'aliases': 'light burn', 'category': 'tutorialworld', 'key': 'on', 'no_prefix': ' light burn', 'tags': '', 'text': '\n Creates light where there was none. Something to burn.\n '}</em><a class="headerlink" href="#evennia.contrib.tutorials.tutorial_world.objects.CmdLight.search_index_entry" title="Permalink to this definition">¶</a></dt>
|
||||
<code class="sig-name descname">search_index_entry</code><em class="property"> = {'aliases': 'burn light', 'category': 'tutorialworld', 'key': 'on', 'no_prefix': ' burn light', 'tags': '', 'text': '\n Creates light where there was none. Something to burn.\n '}</em><a class="headerlink" href="#evennia.contrib.tutorials.tutorial_world.objects.CmdLight.search_index_entry" title="Permalink to this definition">¶</a></dt>
|
||||
<dd></dd></dl>
|
||||
|
||||
</dd></dl>
|
||||
|
|
@ -568,7 +568,7 @@ shift green root up/down</p>
|
|||
|
||||
<dl class="py attribute">
|
||||
<dt id="evennia.contrib.tutorials.tutorial_world.objects.CmdShiftRoot.aliases">
|
||||
<code class="sig-name descname">aliases</code><em class="property"> = ['move', 'shiftroot', 'pull', 'push']</em><a class="headerlink" href="#evennia.contrib.tutorials.tutorial_world.objects.CmdShiftRoot.aliases" title="Permalink to this definition">¶</a></dt>
|
||||
<code class="sig-name descname">aliases</code><em class="property"> = ['shiftroot', 'pull', 'move', 'push']</em><a class="headerlink" href="#evennia.contrib.tutorials.tutorial_world.objects.CmdShiftRoot.aliases" title="Permalink to this definition">¶</a></dt>
|
||||
<dd></dd></dl>
|
||||
|
||||
<dl class="py attribute">
|
||||
|
|
@ -604,7 +604,7 @@ yellow/green - horizontal roots</p>
|
|||
|
||||
<dl class="py attribute">
|
||||
<dt id="evennia.contrib.tutorials.tutorial_world.objects.CmdShiftRoot.search_index_entry">
|
||||
<code class="sig-name descname">search_index_entry</code><em class="property"> = {'aliases': 'move shiftroot pull push', 'category': 'tutorialworld', 'key': 'shift', 'no_prefix': ' move shiftroot pull push', '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.tutorials.tutorial_world.objects.CmdShiftRoot.search_index_entry" title="Permalink to this definition">¶</a></dt>
|
||||
<code class="sig-name descname">search_index_entry</code><em class="property"> = {'aliases': 'shiftroot pull move push', 'category': 'tutorialworld', 'key': 'shift', 'no_prefix': ' shiftroot pull move push', '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.tutorials.tutorial_world.objects.CmdShiftRoot.search_index_entry" title="Permalink to this definition">¶</a></dt>
|
||||
<dd></dd></dl>
|
||||
|
||||
</dd></dl>
|
||||
|
|
@ -791,7 +791,7 @@ parry - forgoes your attack but will make you harder to hit on next</p>
|
|||
|
||||
<dl class="py attribute">
|
||||
<dt id="evennia.contrib.tutorials.tutorial_world.objects.CmdAttack.aliases">
|
||||
<code class="sig-name descname">aliases</code><em class="property"> = ['defend', 'pierce', 'slash', 'fight', 'kill', 'hit', 'stab', 'chop', 'bash', 'thrust', 'parry']</em><a class="headerlink" href="#evennia.contrib.tutorials.tutorial_world.objects.CmdAttack.aliases" title="Permalink to this definition">¶</a></dt>
|
||||
<code class="sig-name descname">aliases</code><em class="property"> = ['parry', 'hit', 'defend', 'kill', 'thrust', 'stab', 'chop', 'slash', 'fight', 'bash', 'pierce']</em><a class="headerlink" href="#evennia.contrib.tutorials.tutorial_world.objects.CmdAttack.aliases" title="Permalink to this definition">¶</a></dt>
|
||||
<dd></dd></dl>
|
||||
|
||||
<dl class="py attribute">
|
||||
|
|
@ -817,7 +817,7 @@ parry - forgoes your attack but will make you harder to hit on next</p>
|
|||
|
||||
<dl class="py attribute">
|
||||
<dt id="evennia.contrib.tutorials.tutorial_world.objects.CmdAttack.search_index_entry">
|
||||
<code class="sig-name descname">search_index_entry</code><em class="property"> = {'aliases': 'defend pierce slash fight kill hit stab chop bash thrust parry', 'category': 'tutorialworld', 'key': 'attack', 'no_prefix': ' defend pierce slash fight kill hit stab chop bash thrust parry', 'tags': '', 'text': '\n Attack the enemy. Commands:\n\n stab <enemy>\n slash <enemy>\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.tutorials.tutorial_world.objects.CmdAttack.search_index_entry" title="Permalink to this definition">¶</a></dt>
|
||||
<code class="sig-name descname">search_index_entry</code><em class="property"> = {'aliases': 'parry hit defend kill thrust stab chop slash fight bash pierce', 'category': 'tutorialworld', 'key': 'attack', 'no_prefix': ' parry hit defend kill thrust stab chop slash fight bash pierce', 'tags': '', 'text': '\n Attack the enemy. Commands:\n\n stab <enemy>\n slash <enemy>\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.tutorials.tutorial_world.objects.CmdAttack.search_index_entry" title="Permalink to this definition">¶</a></dt>
|
||||
<dd></dd></dl>
|
||||
|
||||
</dd></dl>
|
||||
|
|
|
|||
|
|
@ -828,7 +828,7 @@ if they fall off the bridge.</p>
|
|||
|
||||
<dl class="py attribute">
|
||||
<dt id="evennia.contrib.tutorials.tutorial_world.rooms.CmdBridgeHelp.aliases">
|
||||
<code class="sig-name descname">aliases</code><em class="property"> = ['h', '?']</em><a class="headerlink" href="#evennia.contrib.tutorials.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.tutorials.tutorial_world.rooms.CmdBridgeHelp.aliases" title="Permalink to this definition">¶</a></dt>
|
||||
<dd></dd></dl>
|
||||
|
||||
<dl class="py attribute">
|
||||
|
|
@ -854,7 +854,7 @@ if they fall off the bridge.</p>
|
|||
|
||||
<dl class="py attribute">
|
||||
<dt id="evennia.contrib.tutorials.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', 'no_prefix': ' h ?', 'tags': '', 'text': '\n Overwritten help command while on the bridge.\n '}</em><a class="headerlink" href="#evennia.contrib.tutorials.tutorial_world.rooms.CmdBridgeHelp.search_index_entry" title="Permalink to this definition">¶</a></dt>
|
||||
<code class="sig-name descname">search_index_entry</code><em class="property"> = {'aliases': '? h', 'category': 'tutorial world', 'key': 'help', 'no_prefix': ' ? h', 'tags': '', 'text': '\n Overwritten help command while on the bridge.\n '}</em><a class="headerlink" href="#evennia.contrib.tutorials.tutorial_world.rooms.CmdBridgeHelp.search_index_entry" title="Permalink to this definition">¶</a></dt>
|
||||
<dd></dd></dl>
|
||||
|
||||
</dd></dl>
|
||||
|
|
@ -980,7 +980,7 @@ to find something.</p>
|
|||
|
||||
<dl class="py attribute">
|
||||
<dt id="evennia.contrib.tutorials.tutorial_world.rooms.CmdLookDark.aliases">
|
||||
<code class="sig-name descname">aliases</code><em class="property"> = ['feel', 'search', 'l', 'fiddle', 'feel around']</em><a class="headerlink" href="#evennia.contrib.tutorials.tutorial_world.rooms.CmdLookDark.aliases" title="Permalink to this definition">¶</a></dt>
|
||||
<code class="sig-name descname">aliases</code><em class="property"> = ['feel around', 'feel', 'fiddle', 'search', 'l']</em><a class="headerlink" href="#evennia.contrib.tutorials.tutorial_world.rooms.CmdLookDark.aliases" title="Permalink to this definition">¶</a></dt>
|
||||
<dd></dd></dl>
|
||||
|
||||
<dl class="py attribute">
|
||||
|
|
@ -1008,7 +1008,7 @@ random chance of eventually finding a light source.</p>
|
|||
|
||||
<dl class="py attribute">
|
||||
<dt id="evennia.contrib.tutorials.tutorial_world.rooms.CmdLookDark.search_index_entry">
|
||||
<code class="sig-name descname">search_index_entry</code><em class="property"> = {'aliases': 'feel search l fiddle feel around', 'category': 'tutorialworld', 'key': 'look', 'no_prefix': ' feel search l fiddle feel around', '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.tutorials.tutorial_world.rooms.CmdLookDark.search_index_entry" title="Permalink to this definition">¶</a></dt>
|
||||
<code class="sig-name descname">search_index_entry</code><em class="property"> = {'aliases': 'feel around feel fiddle search l', 'category': 'tutorialworld', 'key': 'look', 'no_prefix': ' feel around feel fiddle search l', '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.tutorials.tutorial_world.rooms.CmdLookDark.search_index_entry" title="Permalink to this definition">¶</a></dt>
|
||||
<dd></dd></dl>
|
||||
|
||||
</dd></dl>
|
||||
|
|
|
|||
|
|
@ -220,7 +220,7 @@ git evennia pull - Pull the latest evennia code.</p>
|
|||
|
||||
<dl class="py attribute">
|
||||
<dt id="evennia.contrib.utils.git_integration.git_integration.CmdGitEvennia.directory">
|
||||
<code class="sig-name descname">directory</code><em class="property"> = '/tmp/tmp66rtn6r2/6e6ab208a6b53fc30dd91a6f83124e641d851601/evennia'</em><a class="headerlink" href="#evennia.contrib.utils.git_integration.git_integration.CmdGitEvennia.directory" title="Permalink to this definition">¶</a></dt>
|
||||
<code class="sig-name descname">directory</code><em class="property"> = '/tmp/tmplcp4h0sa/34b5f1133cd6ff4cd29f6d909ef3387fce667288/evennia'</em><a class="headerlink" href="#evennia.contrib.utils.git_integration.git_integration.CmdGitEvennia.directory" title="Permalink to this definition">¶</a></dt>
|
||||
<dd></dd></dl>
|
||||
|
||||
<dl class="py attribute">
|
||||
|
|
@ -281,7 +281,7 @@ git pull - Pull the latest code from your current branch.</p>
|
|||
|
||||
<dl class="py attribute">
|
||||
<dt id="evennia.contrib.utils.git_integration.git_integration.CmdGit.directory">
|
||||
<code class="sig-name descname">directory</code><em class="property"> = '/tmp/tmp66rtn6r2/6e6ab208a6b53fc30dd91a6f83124e641d851601/evennia/game_template'</em><a class="headerlink" href="#evennia.contrib.utils.git_integration.git_integration.CmdGit.directory" title="Permalink to this definition">¶</a></dt>
|
||||
<code class="sig-name descname">directory</code><em class="property"> = '/tmp/tmplcp4h0sa/34b5f1133cd6ff4cd29f6d909ef3387fce667288/evennia/game_template'</em><a class="headerlink" href="#evennia.contrib.utils.git_integration.git_integration.CmdGit.directory" title="Permalink to this definition">¶</a></dt>
|
||||
<dd></dd></dl>
|
||||
|
||||
<dl class="py attribute">
|
||||
|
|
|
|||
|
|
@ -124,10 +124,10 @@
|
|||
<p>Helper to handle on-demand requests, allowing a system to change state only when a player or system
|
||||
actually needs the information. This is a very efficient way to handle gradual changes, requiring
|
||||
not computer resources until the state is actually needed.</p>
|
||||
<p>For example, consider a flowering system, where a seed sprouts, grows and blooms over a certain time.
|
||||
One _could_ implement this with e.g. a Script or a ticker that gradually moves the flower along
|
||||
its stages of growth. But what if that flower is in a remote location, and no one is around to see it?
|
||||
You are then wasting computational resources on something that no one is looking at.</p>
|
||||
<p>For example, consider a flowering system, where a seed sprouts, grows and blooms over a certain
|
||||
time. One _could_ implement this with e.g. a Script or a ticker that gradually moves the flower
|
||||
along its stages of growth. But what if that flower is in a remote location, and no one is around to
|
||||
see it? You are then wasting computational resources on something that no one is looking at.</p>
|
||||
<p>The truth is that most of the time, players are not looking at most of the things in the game. They
|
||||
_only_ need to know about which state the flower is in when they are actually looking at it, or
|
||||
when they are in the same room as it (so it can be incorporated in the room description). This is
|
||||
|
|
@ -154,8 +154,8 @@ up after a long time, it may not show as a “wilted” state or be outright del
|
|||
since too long time has passed and the plant has died.</p></li>
|
||||
</ol>
|
||||
<p>With a system like this you could have growing plants all over your world and computing usage would
|
||||
only scale by how many players you have exploring your world. The players will not know the difference
|
||||
between this and a system that is always running, but your server will thank you.</p>
|
||||
only scale by how many players you have exploring your world. The players will not know the
|
||||
difference between this and a system that is always running, but your server will thank you.</p>
|
||||
<p>There is only one situation where this system is not ideal, and that is when a player should be
|
||||
informed of the state change _even if they perform no <a href="#id1"><span class="problematic" id="id2">action_</span></a>. That is, even if they are just idling
|
||||
in the room, they should get a message like ‘the plant suddenly blooms’ (or, more commonly, for
|
||||
|
|
@ -186,11 +186,11 @@ handling instead.</p>
|
|||
<dd><p>Bases: <code class="xref py py-class docutils literal notranslate"><span class="pre">object</span></code></p>
|
||||
<p>Stores information about an on-demand task.</p>
|
||||
<p>Default property:
|
||||
- <strong>default_stage_function (callable)</strong>: This is called if no stage function is given in the stages dict.</p>
|
||||
- <strong>default_stage_function (callable)</strong>: This is called if no stage function is given in the</p>
|
||||
<blockquote>
|
||||
<div><p>This is meant for changing the task itself (such as restarting it). Actual game code should
|
||||
be handled elsewhere, by checking this task. See the <strong>stagefunc_*</strong> static methods for examples
|
||||
of how to manipulate the task when a stage is reached.</p>
|
||||
<div><p>stages dict. This is meant for changing the task itself (such as restarting it). Actual
|
||||
game code should be handled elsewhere, by checking this task. See the <strong>stagefunc_*</strong> static
|
||||
methods for examples of how to manipulate the task when a stage is reached.</p>
|
||||
</div></blockquote>
|
||||
<dl class="py method">
|
||||
<dt id="evennia.scripts.ondemandhandler.OnDemandTask.runtime">
|
||||
|
|
@ -202,7 +202,7 @@ It’s a callable to allow easier unit testing.</p>
|
|||
|
||||
<dl class="py method">
|
||||
<dt id="evennia.scripts.ondemandhandler.OnDemandTask.stagefunc_loop">
|
||||
<em class="property">static </em><code class="sig-name descname">stagefunc_loop</code><span class="sig-paren">(</span><em class="sig-param"><span class="n">task</span></em><span class="sig-paren">)</span><a class="reference internal" href="../_modules/evennia/scripts/ondemandhandler.html#OnDemandTask.stagefunc_loop"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#evennia.scripts.ondemandhandler.OnDemandTask.stagefunc_loop" title="Permalink to this definition">¶</a></dt>
|
||||
<em class="property">static </em><code class="sig-name descname">stagefunc_loop</code><span class="sig-paren">(</span><em class="sig-param"><span class="n">task</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/scripts/ondemandhandler.html#OnDemandTask.stagefunc_loop"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#evennia.scripts.ondemandhandler.OnDemandTask.stagefunc_loop" title="Permalink to this definition">¶</a></dt>
|
||||
<dd><p>Attach this to the last stage to have the task start over from
|
||||
the beginning</p>
|
||||
<p class="rubric">Example</p>
|
||||
|
|
@ -216,7 +216,7 @@ can an idea to mark that end state with a <strong>_</strong> just to indicate th
|
|||
|
||||
<dl class="py method">
|
||||
<dt id="evennia.scripts.ondemandhandler.OnDemandTask.stagefunc_bounce">
|
||||
<em class="property">static </em><code class="sig-name descname">stagefunc_bounce</code><span class="sig-paren">(</span><em class="sig-param"><span class="n">task</span></em><span class="sig-paren">)</span><a class="reference internal" href="../_modules/evennia/scripts/ondemandhandler.html#OnDemandTask.stagefunc_bounce"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#evennia.scripts.ondemandhandler.OnDemandTask.stagefunc_bounce" title="Permalink to this definition">¶</a></dt>
|
||||
<em class="property">static </em><code class="sig-name descname">stagefunc_bounce</code><span class="sig-paren">(</span><em class="sig-param"><span class="n">task</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/scripts/ondemandhandler.html#OnDemandTask.stagefunc_bounce"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#evennia.scripts.ondemandhandler.OnDemandTask.stagefunc_bounce" title="Permalink to this definition">¶</a></dt>
|
||||
<dd><p>This endfunc will have the task reverse direction and go through the stages in
|
||||
reverse order. This stage-function must be placed at both ‘ends’ of the stage sequence
|
||||
for the bounce to continue indefinitely.</p>
|
||||
|
|
@ -273,12 +273,15 @@ time will not start counting until the first call of <strong>get_dt</strong> or
|
|||
|
||||
<dl class="py method">
|
||||
<dt id="evennia.scripts.ondemandhandler.OnDemandTask.check">
|
||||
<code class="sig-name descname">check</code><span class="sig-paren">(</span><em class="sig-param"><span class="n">autostart</span><span class="o">=</span><span class="default_value">True</span></em><span class="sig-paren">)</span><a class="reference internal" href="../_modules/evennia/scripts/ondemandhandler.html#OnDemandTask.check"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#evennia.scripts.ondemandhandler.OnDemandTask.check" title="Permalink to this definition">¶</a></dt>
|
||||
<code class="sig-name descname">check</code><span class="sig-paren">(</span><em class="sig-param"><span class="n">autostart</span><span class="o">=</span><span class="default_value">True</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/scripts/ondemandhandler.html#OnDemandTask.check"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#evennia.scripts.ondemandhandler.OnDemandTask.check" title="Permalink to this definition">¶</a></dt>
|
||||
<dd><p>Check the current stage of the task and return the time-delta to the next stage.</p>
|
||||
<dl class="field-list simple">
|
||||
<dt class="field-odd">Parameters</dt>
|
||||
<dd class="field-odd"><p><strong>autostart</strong> (<em>bool</em><em>, </em><em>optional</em>) – If this is set, and the task has not been started yet,
|
||||
it will be started by this check. This is mainly used internally.</p>
|
||||
<dt class="field-odd">Keyword Arguments</dt>
|
||||
<dd class="field-odd"><ul class="simple">
|
||||
<li><p><strong>autostart</strong> (<em>bool</em><em>, </em><em>optional</em>) – If this is set, and the task has not been started yet,
|
||||
it will be started by this check. This is mainly used internally.</p></li>
|
||||
<li><p><strong>**kwargs</strong> – Will be passed to the stage function, if one is called.</p></li>
|
||||
</ul>
|
||||
</dd>
|
||||
<dt class="field-even">Returns</dt>
|
||||
<dd class="field-even"><p><em>tuple</em> – A tuple (dt, stage) where <strong>dt</strong> is the time-delta (in seconds) since the test
|
||||
|
|
@ -291,11 +294,12 @@ current stage. If no stages are defined, <strong>stage</strong> will always be <
|
|||
|
||||
<dl class="py method">
|
||||
<dt id="evennia.scripts.ondemandhandler.OnDemandTask.get_dt">
|
||||
<code class="sig-name descname">get_dt</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="reference internal" href="../_modules/evennia/scripts/ondemandhandler.html#OnDemandTask.get_dt"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#evennia.scripts.ondemandhandler.OnDemandTask.get_dt" title="Permalink to this definition">¶</a></dt>
|
||||
<code class="sig-name descname">get_dt</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/scripts/ondemandhandler.html#OnDemandTask.get_dt"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#evennia.scripts.ondemandhandler.OnDemandTask.get_dt" title="Permalink to this definition">¶</a></dt>
|
||||
<dd><p>Get the time-delta since last check.</p>
|
||||
<dl class="field-list simple">
|
||||
<dt class="field-odd">Returns</dt>
|
||||
<dd class="field-odd"><p><em>int</em> – The time since the last check, or 0 if this is the first time the task is checked.</p>
|
||||
<dd class="field-odd"><p><em>int</em> – The time since the last check, or 0 if this is the first time the task is checked.
|
||||
<a href="#id1"><span class="problematic" id="id2">**</span></a>kwargs: Will be passed to the stage function, if one is called.</p>
|
||||
</dd>
|
||||
</dl>
|
||||
</dd></dl>
|
||||
|
|
@ -319,12 +323,13 @@ as normal, next time the state is checked and the stage is found to have changed
|
|||
|
||||
<dl class="py method">
|
||||
<dt id="evennia.scripts.ondemandhandler.OnDemandTask.get_stage">
|
||||
<code class="sig-name descname">get_stage</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="reference internal" href="../_modules/evennia/scripts/ondemandhandler.html#OnDemandTask.get_stage"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#evennia.scripts.ondemandhandler.OnDemandTask.get_stage" title="Permalink to this definition">¶</a></dt>
|
||||
<code class="sig-name descname">get_stage</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/scripts/ondemandhandler.html#OnDemandTask.get_stage"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#evennia.scripts.ondemandhandler.OnDemandTask.get_stage" title="Permalink to this definition">¶</a></dt>
|
||||
<dd><p>Get the current stage of the task. If no stage was given, this will return <strong>None</strong> but
|
||||
still update the last_checked time.</p>
|
||||
<dl class="field-list simple">
|
||||
<dt class="field-odd">Returns</dt>
|
||||
<dd class="field-odd"><p><em>str or None</em> – The current stage of the task, or <strong>None</strong> if no stages are set.</p>
|
||||
<dd class="field-odd"><p><em>str or None</em> – The current stage of the task, or <strong>None</strong> if no stages are set.
|
||||
<a href="#id3"><span class="problematic" id="id4">**</span></a>kwargs: Will be passed to the stage function, if one is called.</p>
|
||||
</dd>
|
||||
</dl>
|
||||
</dd></dl>
|
||||
|
|
@ -399,7 +404,8 @@ check and start the timer.</p></li>
|
|||
<dt class="field-even">Returns</dt>
|
||||
<dd class="field-even"><p><p><em>OnDemandTask</em> –</p>
|
||||
<dl class="simple">
|
||||
<dt>The created task (or the same that was added, if given an <strong>OnDemandTask</strong></dt><dd><p>as a <strong>key</strong>). Use <strong>task.get_dt()</strong> and <strong>task.get_stage()</strong> to get data from it manually.</p>
|
||||
<dt>The created task (or the same that was added, if given an <strong>OnDemandTask</strong></dt><dd><p>as a <strong>key</strong>). Use <strong>task.get_dt()</strong> and <strong>task.get_stage()</strong> to get data from it
|
||||
manually.</p>
|
||||
</dd>
|
||||
</dl>
|
||||
</p>
|
||||
|
|
@ -425,9 +431,10 @@ check and start the timer.</p></li>
|
|||
<dl class="field-list simple">
|
||||
<dt class="field-odd">Parameters</dt>
|
||||
<dd class="field-odd"><ul class="simple">
|
||||
<li><p><strong>key</strong> (<em>str</em><em>, </em><em>callable</em><em>, </em><a class="reference internal" href="#evennia.scripts.ondemandhandler.OnDemandTask" title="evennia.scripts.ondemandhandler.OnDemandTask"><em>OnDemandTask</em></a><em> or </em><em>Object</em>) – The unique identifier for the task. If a callable, will
|
||||
be called without arguments. If an Object, will be converted to a string. If an <strong>OnDemandTask</strong>,
|
||||
then all other arguments are ignored and the task will be used to identify the task to remove.</p></li>
|
||||
<li><p><strong>key</strong> (<em>str</em><em>, </em><em>callable</em><em>, </em><a class="reference internal" href="#evennia.scripts.ondemandhandler.OnDemandTask" title="evennia.scripts.ondemandhandler.OnDemandTask"><em>OnDemandTask</em></a><em> or </em><em>Object</em>) – The unique identifier for the task. If a
|
||||
callable, will be called without arguments. If an Object, will be converted to a
|
||||
string. If an <strong>OnDemandTask</strong>, then all other arguments are ignored and the task
|
||||
will be used to identify the task to remove.</p></li>
|
||||
<li><p><strong>category</strong> (<em>str</em><em> or </em><em>callable</em><em>, </em><em>optional</em>) – The category of the task.</p></li>
|
||||
</ul>
|
||||
</dd>
|
||||
|
|
@ -482,10 +489,10 @@ manually.</p>
|
|||
<dl class="field-list simple">
|
||||
<dt class="field-odd">Parameters</dt>
|
||||
<dd class="field-odd"><ul class="simple">
|
||||
<li><p><strong>category</strong> (<em>str</em><em>, </em><em>optional</em>) – The category of the tasks to clear. What <strong>None</strong> means is determined
|
||||
by the <strong>all_on_none</strong> kwarg.</p></li>
|
||||
<li><p><strong>all_on_none</strong> (<em>bool</em><em>, </em><em>optional</em>) – Determines what to clear if <strong>category</strong> is <strong>None</strong>. If <strong>True</strong>,
|
||||
clear all tasks, if <strong>False</strong>, only clear tasks with no category.</p></li>
|
||||
<li><p><strong>category</strong> (<em>str</em><em>, </em><em>optional</em>) – The category of the tasks to clear. What <strong>None</strong> means is
|
||||
determined by the <strong>all_on_none</strong> kwarg.</p></li>
|
||||
<li><p><strong>all_on_none</strong> (<em>bool</em><em>, </em><em>optional</em>) – Determines what to clear if <strong>category</strong> is <strong>None</strong>. If
|
||||
<strong>True</strong>, clear all tasks, if <strong>False</strong>, only clear tasks with no category.</p></li>
|
||||
</ul>
|
||||
</dd>
|
||||
</dl>
|
||||
|
|
@ -499,9 +506,9 @@ clear all tasks, if <strong>False</strong>, only clear tasks with no category.</
|
|||
<dt class="field-odd">Parameters</dt>
|
||||
<dd class="field-odd"><ul class="simple">
|
||||
<li><p><strong>key</strong> (<em>str</em><em>, </em><em>callable</em><em>, </em><a class="reference internal" href="#evennia.scripts.ondemandhandler.OnDemandTask" title="evennia.scripts.ondemandhandler.OnDemandTask"><em>OnDemandTask</em></a><em> or </em><em>Object</em>) – The unique identifier for the task. If a
|
||||
callable, will be called without arguments. If an Object, will be converted to a string.
|
||||
If an <strong>OnDemandTask</strong>, then all other arguments are ignored and the task will be used
|
||||
(only useful to check the task is the same).</p></li>
|
||||
callable, will be called without arguments. If an Object, will be converted to a
|
||||
string. If an <strong>OnDemandTask</strong>, then all other arguments are ignored and the task
|
||||
will be used (only useful to check the task is the same).</p></li>
|
||||
<li><p><strong>category</strong> (<em>str</em><em>, </em><em>optional</em>) – The category of the task. If unset, this will only return
|
||||
tasks with no category.</p></li>
|
||||
</ul>
|
||||
|
|
@ -514,14 +521,17 @@ tasks with no category.</p></li>
|
|||
|
||||
<dl class="py method">
|
||||
<dt id="evennia.scripts.ondemandhandler.OnDemandHandler.get_dt">
|
||||
<code class="sig-name descname">get_dt</code><span class="sig-paren">(</span><em class="sig-param"><span class="n">key</span></em>, <em class="sig-param"><span class="n">category</span><span class="o">=</span><span class="default_value">None</span></em><span class="sig-paren">)</span><a class="reference internal" href="../_modules/evennia/scripts/ondemandhandler.html#OnDemandHandler.get_dt"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#evennia.scripts.ondemandhandler.OnDemandHandler.get_dt" title="Permalink to this definition">¶</a></dt>
|
||||
<code class="sig-name descname">get_dt</code><span class="sig-paren">(</span><em class="sig-param"><span class="n">key</span></em>, <em class="sig-param"><span class="n">category</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/scripts/ondemandhandler.html#OnDemandHandler.get_dt"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#evennia.scripts.ondemandhandler.OnDemandHandler.get_dt" title="Permalink to this definition">¶</a></dt>
|
||||
<dd><p>Get the time-delta since the task started.</p>
|
||||
<dl class="field-list simple">
|
||||
<dt class="field-odd">Parameters</dt>
|
||||
<dd class="field-odd"><p><strong>key</strong> (<em>str</em><em>, </em><em>callable</em><em>, </em><a class="reference internal" href="#evennia.scripts.ondemandhandler.OnDemandTask" title="evennia.scripts.ondemandhandler.OnDemandTask"><em>OnDemandTask</em></a><em> or </em><em>Object</em>) – The unique identifier for the task. If a
|
||||
callable, will be called without arguments. If an Object, will be converted to a string.
|
||||
If an <strong>OnDemandTask</strong>, then all other arguments are ignored and the task will be used
|
||||
to identify the task to get the time-delta from.</p>
|
||||
<dd class="field-odd"><ul class="simple">
|
||||
<li><p><strong>key</strong> (<em>str</em><em>, </em><em>callable</em><em>, </em><a class="reference internal" href="#evennia.scripts.ondemandhandler.OnDemandTask" title="evennia.scripts.ondemandhandler.OnDemandTask"><em>OnDemandTask</em></a><em> or </em><em>Object</em>) – The unique identifier for the task. If a
|
||||
callable, will be called without arguments. If an Object, will be converted to a
|
||||
string. If an <strong>OnDemandTask</strong>, then all other arguments are ignored and the task
|
||||
will be used to identify the task to get the time-delta from.</p></li>
|
||||
<li><p><strong>**kwargs</strong> – Will be passed to the stage function, if one is called.</p></li>
|
||||
</ul>
|
||||
</dd>
|
||||
<dt class="field-even">Returns</dt>
|
||||
<dd class="field-even"><p><em>int or None</em> – The time since the last check, or <strong>None</strong> if no task was found.</p>
|
||||
|
|
@ -539,9 +549,9 @@ somehow (like using a potion that speeds up the growth of a plant).</p>
|
|||
<dt class="field-odd">Parameters</dt>
|
||||
<dd class="field-odd"><ul class="simple">
|
||||
<li><p><strong>key</strong> (<em>str</em><em>, </em><em>callable</em><em>, </em><a class="reference internal" href="#evennia.scripts.ondemandhandler.OnDemandTask" title="evennia.scripts.ondemandhandler.OnDemandTask"><em>OnDemandTask</em></a><em> or </em><em>Object</em>) – The unique identifier for the task. If a
|
||||
callable, will be called without arguments. If an Object, will be converted to a string.
|
||||
If an <strong>OnDemandTask</strong>, then all other arguments are ignored and the task will be used
|
||||
to identify the task to set the time-delta for.</p></li>
|
||||
callable, will be called without arguments. If an Object, will be converted to a
|
||||
string. If an <strong>OnDemandTask</strong>, then all other arguments are ignored and the task will
|
||||
be used to identify the task to set the time-delta for.</p></li>
|
||||
<li><p><strong>category</strong> (<em>str</em><em>, </em><em>optional</em>) – The category of the task.</p></li>
|
||||
<li><p><strong>dt</strong> (<em>int</em>) – The time-delta to set. This is an absolute value in seconds, same as returned
|
||||
by <strong>get_dt</strong>.</p></li>
|
||||
|
|
@ -555,14 +565,18 @@ as normal, next time the state is checked and the stage is found to have changed
|
|||
|
||||
<dl class="py method">
|
||||
<dt id="evennia.scripts.ondemandhandler.OnDemandHandler.get_stage">
|
||||
<code class="sig-name descname">get_stage</code><span class="sig-paren">(</span><em class="sig-param"><span class="n">key</span></em>, <em class="sig-param"><span class="n">category</span><span class="o">=</span><span class="default_value">None</span></em><span class="sig-paren">)</span><a class="reference internal" href="../_modules/evennia/scripts/ondemandhandler.html#OnDemandHandler.get_stage"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#evennia.scripts.ondemandhandler.OnDemandHandler.get_stage" title="Permalink to this definition">¶</a></dt>
|
||||
<code class="sig-name descname">get_stage</code><span class="sig-paren">(</span><em class="sig-param"><span class="n">key</span></em>, <em class="sig-param"><span class="n">category</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/scripts/ondemandhandler.html#OnDemandHandler.get_stage"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#evennia.scripts.ondemandhandler.OnDemandHandler.get_stage" title="Permalink to this definition">¶</a></dt>
|
||||
<dd><p>Get the current stage of an on-demand task.</p>
|
||||
<dl class="field-list simple">
|
||||
<dt class="field-odd">Parameters</dt>
|
||||
<dd class="field-odd"><p><strong>key</strong> (<em>str</em><em>, </em><em>callable</em><em>, </em><a class="reference internal" href="#evennia.scripts.ondemandhandler.OnDemandTask" title="evennia.scripts.ondemandhandler.OnDemandTask"><em>OnDemandTask</em></a><em> or </em><em>Object</em>) – The unique identifier for the task. If a
|
||||
callable, will be called without arguments. If an Object, will be converted to a string.
|
||||
If an <strong>OnDemandTask</strong>, then all other arguments are ignored and the task will be used
|
||||
to identify the task to get the stage from.</p>
|
||||
<dd class="field-odd"><ul class="simple">
|
||||
<li><p><strong>key</strong> (<em>str</em><em>, </em><em>callable</em><em>, </em><a class="reference internal" href="#evennia.scripts.ondemandhandler.OnDemandTask" title="evennia.scripts.ondemandhandler.OnDemandTask"><em>OnDemandTask</em></a><em> or </em><em>Object</em>) – The unique identifier for the task. If a
|
||||
callable, will be called without arguments. If an Object, will be converted to a
|
||||
string. If an <strong>OnDemandTask</strong>, then all other arguments are ignored and the task
|
||||
will be used to identify the task to get the stage from.</p></li>
|
||||
<li><p><strong>category</strong> (<em>str</em><em>, </em><em>optional</em>) – The category of the task.</p></li>
|
||||
<li><p><strong>**kwargs</strong> – Will be passed to the stage function, if one is called.</p></li>
|
||||
</ul>
|
||||
</dd>
|
||||
<dt class="field-even">Returns</dt>
|
||||
<dd class="field-even"><p><em>str or None</em> – The current stage of the task, or <strong>None</strong> if no task was found.</p>
|
||||
|
|
|
|||
|
|
@ -348,7 +348,7 @@ indentation.</p>
|
|||
|
||||
<dl class="py attribute">
|
||||
<dt id="evennia.utils.eveditor.CmdEditorGroup.aliases">
|
||||
<code class="sig-name descname">aliases</code><em class="property"> = [':uu', ':h', ':q!', ':dd', ':=', ':A', ':q', '::', ':f', ':', ':w', ':fi', ':::', ':s', ':I', ':wq', ':j', ':!', ':r', ':fd', ':i', ':DD', ':<', ':x', ':>', ':u', ':p', ':dw', ':S', ':echo', ':UU', ':y']</em><a class="headerlink" href="#evennia.utils.eveditor.CmdEditorGroup.aliases" title="Permalink to this definition">¶</a></dt>
|
||||
<code class="sig-name descname">aliases</code><em class="property"> = [':I', ':i', ':', ':f', ':h', ':>', ':uu', ':A', ':y', ':S', ':fd', ':j', ':x', ':<', '::', ':::', ':echo', ':=', ':p', ':fi', ':dw', ':UU', ':q', ':u', ':r', ':w', ':dd', ':s', ':!', ':q!', ':DD', ':wq']</em><a class="headerlink" href="#evennia.utils.eveditor.CmdEditorGroup.aliases" title="Permalink to this definition">¶</a></dt>
|
||||
<dd></dd></dl>
|
||||
|
||||
<dl class="py attribute">
|
||||
|
|
@ -376,7 +376,7 @@ efficient presentation.</p>
|
|||
|
||||
<dl class="py attribute">
|
||||
<dt id="evennia.utils.eveditor.CmdEditorGroup.search_index_entry">
|
||||
<code class="sig-name descname">search_index_entry</code><em class="property"> = {'aliases': ':uu :h :q! :dd := :A :q :: :f : :w :fi ::: :s :I :wq :j :! :r :fd :i :DD :< :x :> :u :p :dw :S :echo :UU :y', 'category': 'general', 'key': ':editor_command_group', 'no_prefix': ' :uu :h :q! :dd := :A :q :: :f : :w :fi ::: :s :I :wq :j :! :r :fd :i :DD :< :x :> :u :p :dw :S :echo :UU :y', 'tags': '', 'text': '\n Commands for the editor\n '}</em><a class="headerlink" href="#evennia.utils.eveditor.CmdEditorGroup.search_index_entry" title="Permalink to this definition">¶</a></dt>
|
||||
<code class="sig-name descname">search_index_entry</code><em class="property"> = {'aliases': ':I :i : :f :h :> :uu :A :y :S :fd :j :x :< :: ::: :echo := :p :fi :dw :UU :q :u :r :w :dd :s :! :q! :DD :wq', 'category': 'general', 'key': ':editor_command_group', 'no_prefix': ' :I :i : :f :h :> :uu :A :y :S :fd :j :x :< :: ::: :echo := :p :fi :dw :UU :q :u :r :w :dd :s :! :q! :DD :wq', 'tags': '', 'text': '\n Commands for the editor\n '}</em><a class="headerlink" href="#evennia.utils.eveditor.CmdEditorGroup.search_index_entry" title="Permalink to this definition">¶</a></dt>
|
||||
<dd></dd></dl>
|
||||
|
||||
</dd></dl>
|
||||
|
|
|
|||
|
|
@ -951,7 +951,7 @@ single question.</p>
|
|||
|
||||
<dl class="py attribute">
|
||||
<dt id="evennia.utils.evmenu.CmdYesNoQuestion.aliases">
|
||||
<code class="sig-name descname">aliases</code><em class="property"> = ['abort', 'y', 'yes', 'no', 'n', 'a', '__nomatch_command']</em><a class="headerlink" href="#evennia.utils.evmenu.CmdYesNoQuestion.aliases" title="Permalink to this definition">¶</a></dt>
|
||||
<code class="sig-name descname">aliases</code><em class="property"> = ['y', 'abort', 'n', 'a', 'no', '__nomatch_command', 'yes']</em><a class="headerlink" href="#evennia.utils.evmenu.CmdYesNoQuestion.aliases" title="Permalink to this definition">¶</a></dt>
|
||||
<dd></dd></dl>
|
||||
|
||||
<dl class="py attribute">
|
||||
|
|
@ -977,7 +977,7 @@ single question.</p>
|
|||
|
||||
<dl class="py attribute">
|
||||
<dt id="evennia.utils.evmenu.CmdYesNoQuestion.search_index_entry">
|
||||
<code class="sig-name descname">search_index_entry</code><em class="property"> = {'aliases': 'abort y yes no n a __nomatch_command', 'category': 'general', 'key': '__noinput_command', 'no_prefix': ' abort y yes no n a __nomatch_command', 'tags': '', 'text': '\n Handle a prompt for yes or no. Press [return] for the default choice.\n\n '}</em><a class="headerlink" href="#evennia.utils.evmenu.CmdYesNoQuestion.search_index_entry" title="Permalink to this definition">¶</a></dt>
|
||||
<code class="sig-name descname">search_index_entry</code><em class="property"> = {'aliases': 'y abort n a no __nomatch_command yes', 'category': 'general', 'key': '__noinput_command', 'no_prefix': ' y abort n a no __nomatch_command yes', 'tags': '', 'text': '\n Handle a prompt for yes or no. Press [return] for the default choice.\n\n '}</em><a class="headerlink" href="#evennia.utils.evmenu.CmdYesNoQuestion.search_index_entry" title="Permalink to this definition">¶</a></dt>
|
||||
<dd></dd></dl>
|
||||
|
||||
</dd></dl>
|
||||
|
|
|
|||
|
|
@ -149,7 +149,7 @@ the <strong>caller.msg()</strong> construct every time the page is updated.</p>
|
|||
|
||||
<dl class="py attribute">
|
||||
<dt id="evennia.utils.evmore.CmdMore.aliases">
|
||||
<code class="sig-name descname">aliases</code><em class="property"> = ['abort', 'quit', 'e', 'q', 'next', 'p', 'previous', 'n', 'top', 'end', 'a', 't']</em><a class="headerlink" href="#evennia.utils.evmore.CmdMore.aliases" title="Permalink to this definition">¶</a></dt>
|
||||
<code class="sig-name descname">aliases</code><em class="property"> = ['t', 'p', 'e', 'abort', 'n', 'a', 'previous', 'next', 'q', 'top', 'end', 'quit']</em><a class="headerlink" href="#evennia.utils.evmore.CmdMore.aliases" title="Permalink to this definition">¶</a></dt>
|
||||
<dd></dd></dl>
|
||||
|
||||
<dl class="py attribute">
|
||||
|
|
@ -175,7 +175,7 @@ the <strong>caller.msg()</strong> construct every time the page is updated.</p>
|
|||
|
||||
<dl class="py attribute">
|
||||
<dt id="evennia.utils.evmore.CmdMore.search_index_entry">
|
||||
<code class="sig-name descname">search_index_entry</code><em class="property"> = {'aliases': 'abort quit e q next p previous n top end a t', 'category': 'general', 'key': '__noinput_command', 'no_prefix': ' abort quit e q next p previous n top end a t', 'tags': '', 'text': '\n Manipulate the text paging. Catch no-input with aliases.\n '}</em><a class="headerlink" href="#evennia.utils.evmore.CmdMore.search_index_entry" title="Permalink to this definition">¶</a></dt>
|
||||
<code class="sig-name descname">search_index_entry</code><em class="property"> = {'aliases': 't p e abort n a previous next q top end quit', 'category': 'general', 'key': '__noinput_command', 'no_prefix': ' t p e abort n a previous next q top end quit', 'tags': '', 'text': '\n Manipulate the text paging. Catch no-input with aliases.\n '}</em><a class="headerlink" href="#evennia.utils.evmore.CmdMore.search_index_entry" title="Permalink to this definition">¶</a></dt>
|
||||
<dd></dd></dl>
|
||||
|
||||
</dd></dl>
|
||||
|
|
|
|||
Binary file not shown.
File diff suppressed because one or more lines are too long
Loading…
Add table
Add a link
Reference in a new issue