mirror of
https://github.com/evennia/evennia.git
synced 2026-03-31 13:07:16 +02:00
Updated HTML docs
This commit is contained in:
parent
86fb09d6bf
commit
86c930be7a
1221 changed files with 76528 additions and 29095 deletions
|
|
@ -30,6 +30,7 @@
|
|||
<li class="nav-item nav-item-0"><a href="../index.html">Evennia 1.0-dev</a> »</li>
|
||||
<li class="nav-item nav-item-this"><a href="">evennia.server.profiling.dummyrunner_settings</a></li>
|
||||
</ul>
|
||||
<div class="develop">develop branch</div>
|
||||
</div>
|
||||
|
||||
<div class="document">
|
||||
|
|
@ -43,51 +44,48 @@
|
|||
<p>This module defines dummyrunner settings and sets up
|
||||
the actions available to dummy accounts.</p>
|
||||
<p>The settings are global variables:</p>
|
||||
<p>TIMESTEP - time in seconds between each ‘tick’
|
||||
CHANCE_OF_ACTION - chance 0-1 of action happening
|
||||
CHANCE_OF_LOGIN - chance 0-1 of login happening
|
||||
TELNET_PORT - port to use, defaults to settings.TELNET_PORT
|
||||
ACTIONS - see below</p>
|
||||
<ul class="simple">
|
||||
<li><p>TIMESTEP - time in seconds between each ‘tick’. 1 is a good start.</p></li>
|
||||
<li><p>CHANCE_OF_ACTION - chance 0-1 of action happening. Default is 0.5.</p></li>
|
||||
<li><p>CHANCE_OF_LOGIN - chance 0-1 of login happening. 0.01 is a good number.</p></li>
|
||||
<li><p>TELNET_PORT - port to use, defaults to settings.TELNET_PORT</p></li>
|
||||
<li><p>ACTIONS - see below</p></li>
|
||||
</ul>
|
||||
<p>ACTIONS is a tuple</p>
|
||||
<p>(login_func, logout_func, (0.3, func1), (0.1, func2) … )</p>
|
||||
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="p">(</span><span class="n">login_func</span><span class="p">,</span> <span class="n">logout_func</span><span class="p">,</span> <span class="p">(</span><span class="mf">0.3</span><span class="p">,</span> <span class="n">func1</span><span class="p">),</span> <span class="p">(</span><span class="mf">0.1</span><span class="p">,</span> <span class="n">func2</span><span class="p">)</span> <span class="o">...</span> <span class="p">)</span>
|
||||
</pre></div>
|
||||
</div>
|
||||
<p>where the first entry is the function to call on first connect, with a
|
||||
chance of occurring given by CHANCE_OF_LOGIN. This function is usually
|
||||
responsible for logging in the account. The second entry is always
|
||||
called when the dummyrunner disconnects from the server and should
|
||||
thus issue a logout command. The other entries are tuples (chance,
|
||||
thus issue a logout command. The other entries are tuples (chance,
|
||||
func). They are picked randomly, their commonality based on the
|
||||
cumulative chance given (the chance is normalized between all options
|
||||
so if will still work also if the given chances don’t add up to 1).
|
||||
Since each function can return a list of game-command strings, each
|
||||
function may result in multiple operations.</p>
|
||||
so if will still work also if the given chances don’t add up to 1).</p>
|
||||
<p>The PROFILE variable define pre-made ACTION tuples for convenience.</p>
|
||||
<p>Each function should return an iterable of one or more command-call
|
||||
strings (like “look here”), so each can group multiple command operations.</p>
|
||||
<p>An action-function is called with a “client” argument which is a
|
||||
reference to the dummy client currently performing the action. It
|
||||
returns a string or a list of command strings to execute. Use the
|
||||
client object for optionally saving data between actions.</p>
|
||||
reference to the dummy client currently performing the action.</p>
|
||||
<p>The client object has the following relevant properties and methods:</p>
|
||||
<ul class="simple">
|
||||
<li><dl class="simple">
|
||||
<dt>key - an optional client key. This is only used for dummyrunner output.</dt><dd><p>Default is “Dummy-<cid>”</p>
|
||||
</dd>
|
||||
</dl>
|
||||
</li>
|
||||
<li><p>key - an optional client key. This is only used for dummyrunner output.
|
||||
Default is “Dummy-<cid>”</p></li>
|
||||
<li><p>cid - client id</p></li>
|
||||
<li><p>gid - globally unique id, hashed with time stamp</p></li>
|
||||
<li><p>istep - the current step</p></li>
|
||||
<li><p>exits - an empty list. Can be used to store exit names</p></li>
|
||||
<li><p>objs - an empty list. Can be used to store object names</p></li>
|
||||
<li><dl class="simple">
|
||||
<dt>counter() - returns a unique increasing id, hashed with time stamp</dt><dd><p>to make it unique also between dummyrunner instances.</p>
|
||||
</dd>
|
||||
</dl>
|
||||
</li>
|
||||
<li><p>counter() - returns a unique increasing id, hashed with time stamp
|
||||
to make it unique also between dummyrunner instances.</p></li>
|
||||
</ul>
|
||||
<p>The return should either be a single command string or a tuple of
|
||||
command strings. This list of commands will always be executed every
|
||||
TIMESTEP with a chance given by CHANCE_OF_ACTION by in the order given
|
||||
(no randomness) and allows for setting up a more complex chain of
|
||||
commands (such as creating an account and logging in).</p>
|
||||
<p>—</p>
|
||||
<hr class="docutils" />
|
||||
<dl class="py function">
|
||||
<dt id="evennia.server.profiling.dummyrunner_settings.c_login">
|
||||
<code class="sig-prename descclassname">evennia.server.profiling.dummyrunner_settings.</code><code class="sig-name descname">c_login</code><span class="sig-paren">(</span><em class="sig-param"><span class="n">client</span></em><span class="sig-paren">)</span><a class="reference internal" href="../_modules/evennia/server/profiling/dummyrunner_settings.html#c_login"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#evennia.server.profiling.dummyrunner_settings.c_login" title="Permalink to this definition">¶</a></dt>
|
||||
|
|
@ -172,6 +170,16 @@ commands (such as creating an account and logging in).</p>
|
|||
<dd><p>move through south exit if available</p>
|
||||
</dd></dl>
|
||||
|
||||
<dl class="py function">
|
||||
<dt id="evennia.server.profiling.dummyrunner_settings.c_measure_lag">
|
||||
<code class="sig-prename descclassname">evennia.server.profiling.dummyrunner_settings.</code><code class="sig-name descname">c_measure_lag</code><span class="sig-paren">(</span><em class="sig-param"><span class="n">client</span></em><span class="sig-paren">)</span><a class="reference internal" href="../_modules/evennia/server/profiling/dummyrunner_settings.html#c_measure_lag"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#evennia.server.profiling.dummyrunner_settings.c_measure_lag" title="Permalink to this definition">¶</a></dt>
|
||||
<dd><p>Special dummyrunner command, injected in c_login. It measures
|
||||
response time. Including this in the ACTION tuple will give more
|
||||
dummyrunner output about just how fast commands are being processed.</p>
|
||||
<p>The dummyrunner will treat this special and inject the
|
||||
{timestamp} just before sending.</p>
|
||||
</dd></dl>
|
||||
|
||||
</section>
|
||||
|
||||
|
||||
|
|
@ -217,7 +225,6 @@ commands (such as creating an account and logging in).</p>
|
|||
<li><a href="../../0.9.5/api/evennia.server.profiling.dummyrunner_settings.html">0.9.5 (v0.9.5 branch)</a></li>
|
||||
</ul>
|
||||
|
||||
|
||||
</div>
|
||||
</div>
|
||||
<div class="clearer"></div>
|
||||
|
|
@ -234,6 +241,7 @@ commands (such as creating an account and logging in).</p>
|
|||
<li class="nav-item nav-item-0"><a href="../index.html">Evennia 1.0-dev</a> »</li>
|
||||
<li class="nav-item nav-item-this"><a href="">evennia.server.profiling.dummyrunner_settings</a></li>
|
||||
</ul>
|
||||
<div class="develop">develop branch</div>
|
||||
</div>
|
||||
<div class="footer" role="contentinfo">
|
||||
© Copyright 2020, The Evennia developer community.
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue