<spanid="evennia-game-template-server-conf-package"></span><h1>evennia.game_template.server.conf package<aclass="headerlink"href="#module-evennia.game_template.server.conf"title="Permalink to this headline">¶</a></h1>
<divclass="section"id="submodules">
<h2>Submodules<aclass="headerlink"href="#submodules"title="Permalink to this headline">¶</a></h2>
<spanid="evennia-game-template-server-conf-at-initial-setup-module"></span><h2>evennia.game_template.server.conf.at_initial_setup module<aclass="headerlink"href="#module-evennia.game_template.server.conf.at_initial_setup"title="Permalink to this headline">¶</a></h2>
<p>At_initial_setup module template</p>
<p>Custom at_initial_setup method. This allows you to hook special
modifications to the initial server startup process. Note that this
will only be run once - when the server starts up for the very first
time! It is called last in the startup process and can thus be used to
overload things that happened before it.</p>
<p>The module must contain a global function at_initial_setup(). This
will be called without arguments. Note that tracebacks in this module
will be QUIETLY ignored, so make sure to check it well to make sure it
<codeclass="sig-prename descclassname">evennia.game_template.server.conf.at_initial_setup.</code><codeclass="sig-name descname">at_initial_setup</code><spanclass="sig-paren">(</span><spanclass="sig-paren">)</span><aclass="reference internal"href="../_modules/evennia/game_template/server/conf/at_initial_setup.html#at_initial_setup"><spanclass="viewcode-link">[source]</span></a><aclass="headerlink"href="#evennia.game_template.server.conf.at_initial_setup.at_initial_setup"title="Permalink to this definition">¶</a></dt>
<spanid="evennia-game-template-server-conf-at-search-module"></span><h2>evennia.game_template.server.conf.at_search module<aclass="headerlink"href="#module-evennia.game_template.server.conf.at_search"title="Permalink to this headline">¶</a></h2>
<p>Search and multimatch handling</p>
<p>This module allows for overloading two functions used by Evennia’s
search functionality:</p>
<blockquote>
<div><dlclass="simple">
<dt>at_search_result:</dt><dd><p>This is called whenever a result is returned from an object
search (a common operation in commands). It should (together
with at_multimatch_input below) define some way to present and
differentiate between multiple matches (by default these are
presented as 1-ball, 2-ball etc)</p>
</dd>
<dt>at_multimatch_input:</dt><dd><p>This is called with a search term and should be able to
identify if the user wants to separate a multimatch-result
(such as that from a previous search). By default, this
function understands input on the form 1-ball, 2-ball etc as
indicating that the 1st or 2nd match for “ball” should be
used.</p>
</dd>
</dl>
</div></blockquote>
<p>This module is not called by default, to use it, add the following
<spanid="evennia-game-template-server-conf-at-server-startstop-module"></span><h2>evennia.game_template.server.conf.at_server_startstop module<aclass="headerlink"href="#module-evennia.game_template.server.conf.at_server_startstop"title="Permalink to this headline">¶</a></h2>
<p>Server startstop hooks</p>
<p>This module contains functions called by Evennia at various
points during its startup, reload and shutdown sequence. It
allows for customizing the server operation as desired.</p>
<p>This module must contain at least these global functions:</p>
<codeclass="sig-prename descclassname">evennia.game_template.server.conf.at_server_startstop.</code><codeclass="sig-name descname">at_server_cold_start</code><spanclass="sig-paren">(</span><spanclass="sig-paren">)</span><aclass="reference internal"href="../_modules/evennia/game_template/server/conf/at_server_startstop.html#at_server_cold_start"><spanclass="viewcode-link">[source]</span></a><aclass="headerlink"href="#evennia.game_template.server.conf.at_server_startstop.at_server_cold_start"title="Permalink to this definition">¶</a></dt>
<dd><p>This is called only when the server starts “cold”, i.e. after a
<codeclass="sig-prename descclassname">evennia.game_template.server.conf.at_server_startstop.</code><codeclass="sig-name descname">at_server_cold_stop</code><spanclass="sig-paren">(</span><spanclass="sig-paren">)</span><aclass="reference internal"href="../_modules/evennia/game_template/server/conf/at_server_startstop.html#at_server_cold_stop"><spanclass="viewcode-link">[source]</span></a><aclass="headerlink"href="#evennia.game_template.server.conf.at_server_startstop.at_server_cold_stop"title="Permalink to this definition">¶</a></dt>
<dd><p>This is called only when the server goes down due to a shutdown or
<codeclass="sig-prename descclassname">evennia.game_template.server.conf.at_server_startstop.</code><codeclass="sig-name descname">at_server_reload_start</code><spanclass="sig-paren">(</span><spanclass="sig-paren">)</span><aclass="reference internal"href="../_modules/evennia/game_template/server/conf/at_server_startstop.html#at_server_reload_start"><spanclass="viewcode-link">[source]</span></a><aclass="headerlink"href="#evennia.game_template.server.conf.at_server_startstop.at_server_reload_start"title="Permalink to this definition">¶</a></dt>
<dd><p>This is called only when server starts back up after a reload.</p>
<codeclass="sig-prename descclassname">evennia.game_template.server.conf.at_server_startstop.</code><codeclass="sig-name descname">at_server_reload_stop</code><spanclass="sig-paren">(</span><spanclass="sig-paren">)</span><aclass="reference internal"href="../_modules/evennia/game_template/server/conf/at_server_startstop.html#at_server_reload_stop"><spanclass="viewcode-link">[source]</span></a><aclass="headerlink"href="#evennia.game_template.server.conf.at_server_startstop.at_server_reload_stop"title="Permalink to this definition">¶</a></dt>
<dd><p>This is called only time the server stops before a reload.</p>
<codeclass="sig-prename descclassname">evennia.game_template.server.conf.at_server_startstop.</code><codeclass="sig-name descname">at_server_start</code><spanclass="sig-paren">(</span><spanclass="sig-paren">)</span><aclass="reference internal"href="../_modules/evennia/game_template/server/conf/at_server_startstop.html#at_server_start"><spanclass="viewcode-link">[source]</span></a><aclass="headerlink"href="#evennia.game_template.server.conf.at_server_startstop.at_server_start"title="Permalink to this definition">¶</a></dt>
<dd><p>This is called every time the server starts up, regardless of
<codeclass="sig-prename descclassname">evennia.game_template.server.conf.at_server_startstop.</code><codeclass="sig-name descname">at_server_stop</code><spanclass="sig-paren">(</span><spanclass="sig-paren">)</span><aclass="reference internal"href="../_modules/evennia/game_template/server/conf/at_server_startstop.html#at_server_stop"><spanclass="viewcode-link">[source]</span></a><aclass="headerlink"href="#evennia.game_template.server.conf.at_server_startstop.at_server_stop"title="Permalink to this definition">¶</a></dt>
<dd><p>This is called just before the server is shut down, regardless
<spanid="evennia-game-template-server-conf-cmdparser-module"></span><h2>evennia.game_template.server.conf.cmdparser module<aclass="headerlink"href="#module-evennia.game_template.server.conf.cmdparser"title="Permalink to this headline">¶</a></h2>
<p>Changing the default command parser</p>
<p>The cmdparser is responsible for parsing the raw text inserted by the
user, identifying which command/commands match and return one or more
matching command objects. It is called by Evennia’s cmdhandler and
must accept input and return results on the same form. The default
handler is very generic so you usually don’t need to overload this
unless you have very exotic parsing needs; advanced parsing is best
done at the Command.parse level.</p>
<p>The default cmdparser understands the following command combinations
(where [] marks optional parts.)</p>
<p>[cmdname[ cmdname2 cmdname3 …] [the rest]</p>
<p>A command may consist of any number of space-separated words of any
length, and contain any character. It may also be empty.</p>
<p>The parser makes use of the cmdset to find command candidates. The
parser return a list of matches. Each match is a tuple with its first
three elements being the parsed cmdname (lower case), the remaining
arguments, and the matched cmdobject from the cmdset.</p>
<p>This module is not accessed by default. To tell Evennia to use it
instead of the default command parser, add the following line to
<codeclass="sig-prename descclassname">evennia.game_template.server.conf.cmdparser.</code><codeclass="sig-name descname">cmdparser</code><spanclass="sig-paren">(</span><emclass="sig-param">raw_string</em>, <emclass="sig-param">cmdset</em>, <emclass="sig-param">caller</em>, <emclass="sig-param">match_index=None</em><spanclass="sig-paren">)</span><aclass="reference internal"href="../_modules/evennia/game_template/server/conf/cmdparser.html#cmdparser"><spanclass="viewcode-link">[source]</span></a><aclass="headerlink"href="#evennia.game_template.server.conf.cmdparser.cmdparser"title="Permalink to this definition">¶</a></dt>
<dd><p>This function is called by the cmdhandler once it has
gathered and merged all valid cmdsets valid for this particular parsing.</p>
<p>raw_string - the unparsed text entered by the caller.
cmdset - the merged, currently valid cmdset
caller - the caller triggering this parsing
match_index - an optional integer index to pick a given match in a</p>
<blockquote>
<div><p>list of same-named command matches.</p>
</div></blockquote>
<dlclass="field-list simple">
<dtclass="field-odd">Returns</dt>
<ddclass="field-odd"><p><dlclass="simple">
<dt>[(cmdname, args, cmdobj, cmdlen, mratio), …]</dt><dd><p>where cmdname is the matching command name and args is
everything not included in the cmdname. Cmdobj is the actual
command instance taken from the cmdset, cmdlen is the length
of the command name and the mratio is some quality value to
<spanid="evennia-game-template-server-conf-connection-screens-module"></span><h2>evennia.game_template.server.conf.connection_screens module<aclass="headerlink"href="#module-evennia.game_template.server.conf.connection_screens"title="Permalink to this headline">¶</a></h2>
<p>Connection screen</p>
<p>This is the text to show the user when they first connect to the game (before
they log in).</p>
<p>To change the login screen in this module, do one of the following:</p>
<ulclass="simple">
<li><p>Define a function <cite>connection_screen()</cite>, taking no arguments. This will be
called first and must return the full string to act as the connection screen.
This can be used to produce more dynamic screens.</p></li>
<li><p>Alternatively, define a string variable in the outermost scope of this module
with the connection string that should be displayed. If more than one such
variable is given, Evennia will pick one of them at random.</p></li>
</ul>
<p>The commands available to the user when the connection screen is shown
are defined in evennia.default_cmds.UnloggedinCmdSet. The parsing and display
of the screen is done by the unlogged-in “look” command.</p>
<spanid="evennia-game-template-server-conf-inlinefuncs-module"></span><h2>evennia.game_template.server.conf.inlinefuncs module<aclass="headerlink"href="#module-evennia.game_template.server.conf.inlinefuncs"title="Permalink to this headline">¶</a></h2>
<p>Inlinefunc</p>
<p>Inline functions allow for direct conversion of text users mark in a
special way. Inlinefuncs are deactivated by default. To activate, add</p>
<blockquote>
<div><p>INLINEFUNC_ENABLED = True</p>
</div></blockquote>
<p>to your settings file. The default inlinefuncs are found in
evennia.utils.inlinefunc.</p>
<p>In text, usage is straightforward:</p>
<p>$funcname([arg1,[arg2,…]])</p>
<dlclass="simple">
<dt>Example 1 (using the “pad” inlinefunc):</dt><dd><p>say This is $pad(“a center-padded text”, 50,c,-) of width 50.
->
John says, “This is ————– a center-padded text————— of width 50.”</p>
</dd>
<dt>Example 2 (using nested “pad” and “time” inlinefuncs):</dt><dd><p>say The time is $pad($time(), 30)right now.
->
John says, “The time is Oct 25, 11:09 right now.”</p>
</dd>
</dl>
<p>To add more inline functions, add them to this module, using
<spanid="evennia-game-template-server-conf-inputfuncs-module"></span><h2>evennia.game_template.server.conf.inputfuncs module<aclass="headerlink"href="#module-evennia.game_template.server.conf.inputfuncs"title="Permalink to this headline">¶</a></h2>
<p>Input functions</p>
<p>Input functions are always called from the client (they handle server
<p>Where session will be the active session and <ahref="#id13"><spanclass="problematic"id="id14">*</span></a>args, <ahref="#id15"><spanclass="problematic"id="id16">**</span></a>kwargs are extra
incoming arguments and keyword properties.</p>
<p>A special command is the “default” command, which is will be called
when no other cmdname matches. It also receives the non-found cmdname
<spanid="evennia-game-template-server-conf-lockfuncs-module"></span><h2>evennia.game_template.server.conf.lockfuncs module<aclass="headerlink"href="#module-evennia.game_template.server.conf.lockfuncs"title="Permalink to this headline">¶</a></h2>
<p>Lockfuncs</p>
<p>Lock functions are functions available when defining lock strings,
which in turn limits access to various game systems.</p>
<p>All functions defined globally in this module are assumed to be
available for use in lockstrings to determine access. See the
Evennia documentation for more info on locks.</p>
<p>A lock function is always called with two arguments, accessing_obj and
accessed_obj, followed by any number of arguments. All possible
arguments should be handled with <ahref="#id21"><spanclass="problematic"id="id22">*</span></a>args, <ahref="#id23"><spanclass="problematic"id="id24">**</span></a>kwargs. The lock function
should handle all eventual tracebacks by logging the error and
returning False.</p>
<p>Lock functions in this module extend (and will overload same-named)
<spanid="evennia-game-template-server-conf-mssp-module"></span><h2>evennia.game_template.server.conf.mssp module<aclass="headerlink"href="#module-evennia.game_template.server.conf.mssp"title="Permalink to this headline">¶</a></h2>
<p>MSSP (Mud Server Status Protocol) meta information</p>
<p>Modify this file to specify what MUD listing sites will report about your game.
All fields are static. The number of currently active players and your game’s
current uptime will be added automatically by Evennia.</p>
<p>You don’t have to fill in everything (and most fields are not shown/used by all
crawlers anyway); leave the default if so needed. You need to reload the server
before the updated information is made available to crawlers (reloading does
not affect uptime).</p>
<p>After changing the values in this file, you must register your game with the
MUD website list you want to track you. The listing crawler will then regularly
connect to your server to get the latest info. No further configuration is
<spanid="evennia-game-template-server-conf-portal-services-plugins-module"></span><h2>evennia.game_template.server.conf.portal_services_plugins module<aclass="headerlink"href="#module-evennia.game_template.server.conf.portal_services_plugins"title="Permalink to this headline">¶</a></h2>
<p>Start plugin services</p>
<p>This plugin module can define user-created services for the Portal to
start.</p>
<p>This module must handle all imports and setups required to start
twisted services (see examples in evennia.server.portal.portal). It
must also contain a function start_plugin_services(application).
Evennia will call this function with the main Portal application (so
your services can be added to it). The function should not return
anything. Plugin services are started last in the Portal startup
<codeclass="sig-prename descclassname">evennia.game_template.server.conf.portal_services_plugins.</code><codeclass="sig-name descname">start_plugin_services</code><spanclass="sig-paren">(</span><emclass="sig-param">portal</em><spanclass="sig-paren">)</span><aclass="reference internal"href="../_modules/evennia/game_template/server/conf/portal_services_plugins.html#start_plugin_services"><spanclass="viewcode-link">[source]</span></a><aclass="headerlink"href="#evennia.game_template.server.conf.portal_services_plugins.start_plugin_services"title="Permalink to this definition">¶</a></dt>
<dd><p>This hook is called by Evennia, last in the Portal startup process.</p>
<p>portal - a reference to the main portal application.</p>
<h2>evennia.game_template.server.conf.secret_settings module<aclass="headerlink"href="#evennia-game-template-server-conf-secret-settings-module"title="Permalink to this headline">¶</a></h2>
<spanid="evennia-game-template-server-conf-server-services-plugins-module"></span><h2>evennia.game_template.server.conf.server_services_plugins module<aclass="headerlink"href="#module-evennia.game_template.server.conf.server_services_plugins"title="Permalink to this headline">¶</a></h2>
<p>Server plugin services</p>
<p>This plugin module can define user-created services for the Server to
start.</p>
<p>This module must handle all imports and setups required to start a
twisted service (see examples in evennia.server.server). It must also
contain a function start_plugin_services(application). Evennia will
call this function with the main Server application (so your services
can be added to it). The function should not return anything. Plugin
services are started last in the Server startup process.</p>
<codeclass="sig-prename descclassname">evennia.game_template.server.conf.server_services_plugins.</code><codeclass="sig-name descname">start_plugin_services</code><spanclass="sig-paren">(</span><emclass="sig-param">server</em><spanclass="sig-paren">)</span><aclass="reference internal"href="../_modules/evennia/game_template/server/conf/server_services_plugins.html#start_plugin_services"><spanclass="viewcode-link">[source]</span></a><aclass="headerlink"href="#evennia.game_template.server.conf.server_services_plugins.start_plugin_services"title="Permalink to this definition">¶</a></dt>
<dd><p>This hook is called by Evennia, last in the Server startup process.</p>
<p>server - a reference to the main server application.</p>
<spanid="evennia-game-template-server-conf-serversession-module"></span><h2>evennia.game_template.server.conf.serversession module<aclass="headerlink"href="#module-evennia.game_template.server.conf.serversession"title="Permalink to this headline">¶</a></h2>
<p>ServerSession</p>
<p>The serversession is the Server-side in-memory representation of a
user connecting to the game. Evennia manages one Session per
connection to the game. So a user logged into the game with multiple
clients (if Evennia is configured to allow that) will have multiple
sessions tied to one Account object. All communication between Evennia
and the real-world user goes through the Session(s) associated with that user.</p>
<p>It should be noted that modifying the Session object is not usually
necessary except for the most custom and exotic designs - and even
then it might be enough to just add custom session-level commands to
the SessionCmdSet instead.</p>
<p>This module is not normally called. To tell Evennia to use the class
in this module instead of the default one, add the following to your
<emclass="property">class </em><codeclass="sig-prename descclassname">evennia.game_template.server.conf.serversession.</code><codeclass="sig-name descname">ServerSession</code><aclass="reference internal"href="../_modules/evennia/game_template/server/conf/serversession.html#ServerSession"><spanclass="viewcode-link">[source]</span></a><aclass="headerlink"href="#evennia.game_template.server.conf.serversession.ServerSession"title="Permalink to this definition">¶</a></dt>
<h2>evennia.game_template.server.conf.settings module<aclass="headerlink"href="#evennia-game-template-server-conf-settings-module"title="Permalink to this headline">¶</a></h2>
<spanid="evennia-game-template-server-conf-web-plugins-module"></span><h2>evennia.game_template.server.conf.web_plugins module<aclass="headerlink"href="#module-evennia.game_template.server.conf.web_plugins"title="Permalink to this headline">¶</a></h2>
<codeclass="sig-prename descclassname">evennia.game_template.server.conf.web_plugins.</code><codeclass="sig-name descname">at_webproxy_root_creation</code><spanclass="sig-paren">(</span><emclass="sig-param">web_root</em><spanclass="sig-paren">)</span><aclass="reference internal"href="../_modules/evennia/game_template/server/conf/web_plugins.html#at_webproxy_root_creation"><spanclass="viewcode-link">[source]</span></a><aclass="headerlink"href="#evennia.game_template.server.conf.web_plugins.at_webproxy_root_creation"title="Permalink to this definition">¶</a></dt>
<dd><p>This function can modify the portal proxy service.
:param web_root: The Evennia</p>
<blockquote>
<div><p>Website application. Use .putChild() to add new
subdomains that are Portal-accessible over TCP;
primarily for new protocol development, but suitable
<codeclass="sig-prename descclassname">evennia.game_template.server.conf.web_plugins.</code><codeclass="sig-name descname">at_webserver_root_creation</code><spanclass="sig-paren">(</span><emclass="sig-param">web_root</em><spanclass="sig-paren">)</span><aclass="reference internal"href="../_modules/evennia/game_template/server/conf/web_plugins.html#at_webserver_root_creation"><spanclass="viewcode-link">[source]</span></a><aclass="headerlink"href="#evennia.game_template.server.conf.web_plugins.at_webserver_root_creation"title="Permalink to this definition">¶</a></dt>
<dd><p>This is called as the web server has finished building its default
path tree. At this point, the media/ and static/ URIs have already
been added to the web root.</p>
<dlclass="field-list simple">
<dtclass="field-odd">Parameters</dt>
<ddclass="field-odd"><p><strong>web_root</strong> (<em>twisted.web.resource.Resource</em>) – The root