mirror of
https://github.com/evennia/evennia.git
synced 2026-03-18 22:06:30 +01:00
356 lines
No EOL
28 KiB
HTML
356 lines
No EOL
28 KiB
HTML
|
||
<!DOCTYPE html>
|
||
|
||
<html>
|
||
<head>
|
||
<meta charset="utf-8" />
|
||
<meta name="viewport" content="width=device-width, initial-scale=1.0" /><meta name="generator" content="Docutils 0.17.1: http://docutils.sourceforge.net/" />
|
||
|
||
<title>Out-of-Band messaging — Evennia 2.x documentation</title>
|
||
<link rel="stylesheet" href="../_static/nature.css" type="text/css" />
|
||
<link rel="stylesheet" href="../_static/pygments.css" type="text/css" />
|
||
<script id="documentation_options" data-url_root="../" src="../_static/documentation_options.js"></script>
|
||
<script src="../_static/jquery.js"></script>
|
||
<script src="../_static/underscore.js"></script>
|
||
<script src="../_static/doctools.js"></script>
|
||
<script src="../_static/language_data.js"></script>
|
||
<link rel="shortcut icon" href="../_static/favicon.ico"/>
|
||
<link rel="index" title="Index" href="../genindex.html" />
|
||
<link rel="search" title="Search" href="../search.html" />
|
||
<link rel="next" title="Async Process" href="Async-Process.html" />
|
||
<link rel="prev" title="The Message path" href="Messagepath.html" />
|
||
</head><body>
|
||
|
||
|
||
|
||
|
||
<div class="related" role="navigation" aria-label="related navigation">
|
||
<h3>Navigation</h3>
|
||
<ul>
|
||
<li class="right" style="margin-right: 10px">
|
||
<a href="../genindex.html" title="General Index"
|
||
accesskey="I">index</a></li>
|
||
<li class="right" >
|
||
<a href="../py-modindex.html" title="Python Module Index"
|
||
>modules</a> |</li>
|
||
<li class="right" >
|
||
<a href="Async-Process.html" title="Async Process"
|
||
accesskey="N">next</a> |</li>
|
||
<li class="right" >
|
||
<a href="Messagepath.html" title="The Message path"
|
||
accesskey="P">previous</a> |</li>
|
||
<li class="nav-item nav-item-0"><a href="../index.html">Evennia 2.x</a> »</li>
|
||
<li class="nav-item nav-item-1"><a href="Concepts-Overview.html" accesskey="U">Core Concepts</a> »</li>
|
||
<li class="nav-item nav-item-this"><a href="">Out-of-Band messaging</a></li>
|
||
</ul>
|
||
</div>
|
||
|
||
<div class="document">
|
||
|
||
<div class="documentwrapper">
|
||
<div class="sphinxsidebar" role="navigation" aria-label="main navigation">
|
||
<div class="sphinxsidebarwrapper">
|
||
<p class="logo"><a href="../index.html">
|
||
<img class="logo" src="../_static/evennia_logo.png" alt="Logo"/>
|
||
</a></p>
|
||
<div id="searchbox" style="display: none" role="search">
|
||
<h3 id="searchlabel">Quick search</h3>
|
||
<div class="searchformwrapper">
|
||
<form class="search" action="../search.html" method="get">
|
||
<input type="text" name="q" aria-labelledby="searchlabel" />
|
||
<input type="submit" value="Go" />
|
||
</form>
|
||
</div>
|
||
</div>
|
||
<script>$('#searchbox').show(0);</script>
|
||
<h3><a href="../index.html">Table of Contents</a></h3>
|
||
<ul>
|
||
<li><a class="reference internal" href="#">Out-of-Band messaging</a><ul>
|
||
<li><a class="reference internal" href="#sending-and-receiving-an-oob-message">Sending and receiving an OOB message</a><ul>
|
||
<li><a class="reference internal" href="#which-command-names-can-i-send">Which command-names can I send?</a></li>
|
||
<li><a class="reference internal" href="#which-command-names-can-i-receive">Which command-names can I receive</a></li>
|
||
</ul>
|
||
</li>
|
||
<li><a class="reference internal" href="#supported-oob-protocols">Supported OOB protocols</a><ul>
|
||
<li><a class="reference internal" href="#telnet">Telnet</a><ul>
|
||
<li><a class="reference internal" href="#telnet-gmcp">Telnet + GMCP</a></li>
|
||
<li><a class="reference internal" href="#telnet-msdp">Telnet + MSDP</a></li>
|
||
</ul>
|
||
</li>
|
||
<li><a class="reference internal" href="#ssh">SSH</a></li>
|
||
<li><a class="reference internal" href="#web-client">Web client</a></li>
|
||
</ul>
|
||
</li>
|
||
</ul>
|
||
</li>
|
||
</ul>
|
||
|
||
<h4>Previous topic</h4>
|
||
<p class="topless"><a href="Messagepath.html"
|
||
title="previous chapter">The Message path</a></p>
|
||
<h4>Next topic</h4>
|
||
<p class="topless"><a href="Async-Process.html"
|
||
title="next chapter">Async Process</a></p>
|
||
<div role="note" aria-label="source link">
|
||
<!--h3>This Page</h3-->
|
||
<ul class="this-page-menu">
|
||
<li><a href="../_sources/Concepts/OOB.md.txt"
|
||
rel="nofollow">Show Page Source</a></li>
|
||
</ul>
|
||
</div><h3>Links</h3>
|
||
<ul>
|
||
<li><a href="https://www.evennia.com/docs/latest/index.html">Documentation Top</a> </li>
|
||
<li><a href="https://www.evennia.com">Evennia Home</a> </li>
|
||
<li><a href="https://github.com/evennia/evennia">Github</a> </li>
|
||
<li><a href="http://games.evennia.com">Game Index</a> </li>
|
||
<li>
|
||
<a href="https://discord.gg/AJJpcRUhtF">Discord</a> -
|
||
<a href="https://github.com/evennia/evennia/discussions">Discussions</a> -
|
||
<a href="https://evennia.blogspot.com/">Blog</a>
|
||
</li>
|
||
</ul>
|
||
<h3>Doc Versions</h3>
|
||
<ul>
|
||
|
||
<li><a href="OOB.html">2.x (main branch)</a></li>
|
||
<ul>
|
||
<li><a href="../1.3.0/index.html">1.3.0 (v1.3.0 branch)</a></li>
|
||
|
||
<li><a href="../0.9.5/index.html">0.9.5 (v0.9.5 branch)</a></li>
|
||
|
||
|
||
</ul>
|
||
|
||
</div>
|
||
</div>
|
||
<div class="bodywrapper">
|
||
<div class="body" role="main">
|
||
|
||
<section class="tex2jax_ignore mathjax_ignore" id="out-of-band-messaging">
|
||
<h1>Out-of-Band messaging<a class="headerlink" href="#out-of-band-messaging" title="Permalink to this headline">¶</a></h1>
|
||
<p>OOB, or Out-Of-Band, means sending data between Evennia and the user’s client without the user
|
||
prompting it or necessarily being aware that it’s being passed. Common uses would be to update
|
||
client health-bars, handle client button-presses or to display certain tagged text in a different
|
||
window pane.</p>
|
||
<p>If you haven’t, you should be familiar with the <a class="reference internal" href="Messagepath.html"><span class="doc std std-doc">Messagepath</span></a>, which describes how a message enters and leaves Evennia and how along the way, all messages are converted to a generic format called a <code class="docutils literal notranslate"><span class="pre">commandtuple</span></code>:</p>
|
||
<div class="highlight-none notranslate"><div class="highlight"><pre><span></span>(commandname, (args), {kwargs})
|
||
</pre></div>
|
||
</div>
|
||
<section id="sending-and-receiving-an-oob-message">
|
||
<h2>Sending and receiving an OOB message<a class="headerlink" href="#sending-and-receiving-an-oob-message" title="Permalink to this headline">¶</a></h2>
|
||
<p>Sending is simple. You just use the normal <code class="docutils literal notranslate"><span class="pre">msg</span></code> method of the object whose session you want to send to.</p>
|
||
<div class="highlight-python notranslate"><div class="highlight"><pre><span></span> <span class="n">caller</span><span class="o">.</span><span class="n">msg</span><span class="p">(</span><span class="n">commandname</span><span class="o">=</span><span class="p">((</span><span class="n">args</span><span class="p">,</span> <span class="o">...</span><span class="p">),</span> <span class="p">{</span><span class="n">key</span><span class="p">:</span><span class="n">value</span><span class="p">,</span> <span class="o">...</span><span class="p">}))</span>
|
||
</pre></div>
|
||
</div>
|
||
<p>The keyword becomes the command-name part of the <code class="docutils literal notranslate"><span class="pre">commandtuple</span></code> and the value its <code class="docutils literal notranslate"><span class="pre">args</span></code> and <code class="docutils literal notranslate"><span class="pre">kwargs</span></code> parts. You can also send multiple messages of different <code class="docutils literal notranslate"><span class="pre">commandname</span></code>s at the same time.</p>
|
||
<p>A special case is the <code class="docutils literal notranslate"><span class="pre">text</span></code> call. It’s so common that it’s the default of the <code class="docutils literal notranslate"><span class="pre">msg</span></code> method. So these are equivalent:</p>
|
||
<div class="highlight-python notranslate"><div class="highlight"><pre><span></span> <span class="n">caller</span><span class="o">.</span><span class="n">msg</span><span class="p">(</span><span class="s2">"Hello"</span><span class="p">)</span>
|
||
<span class="n">caller</span><span class="o">.</span><span class="n">msg</span><span class="p">(</span><span class="n">text</span><span class="o">=</span><span class="s2">"Hello"</span><span class="p">)</span>
|
||
</pre></div>
|
||
</div>
|
||
<p>You don’t have to specify the full <code class="docutils literal notranslate"><span class="pre">commandtuple</span></code> definition. So for example, if your particular command only needs kwargs, you can skip the <code class="docutils literal notranslate"><span class="pre">(args)</span></code> part. Like in the <code class="docutils literal notranslate"><span class="pre">text</span></code> case you can skip
|
||
writing the tuple if there is only one arg … and so on - the input is pretty flexible. If there
|
||
are no args at all you need to give the empty tuple <code class="docutils literal notranslate"><span class="pre">msg(cmdname=(,)</span></code> (giving <code class="docutils literal notranslate"><span class="pre">None</span></code> would mean a
|
||
single argument <code class="docutils literal notranslate"><span class="pre">None</span></code>).</p>
|
||
<section id="which-command-names-can-i-send">
|
||
<h3>Which command-names can I send?<a class="headerlink" href="#which-command-names-can-i-send" title="Permalink to this headline">¶</a></h3>
|
||
<p>This depends on the client and protocol. If you use the Evennia <a class="reference internal" href="../Components/Webclient.html"><span class="doc std std-doc">webclient</span></a>, you can modify it to have it support whatever command-names you like.</p>
|
||
<p>Many third-party MUD clients support a range of OOB protocols listed below. If a client does not support a particular OOB instruction/command, Evennia will just send the <code class="docutils literal notranslate"><span class="pre">text</span></code> command to them and quietly drop all other OOB instructions.</p>
|
||
<blockquote>
|
||
<div><p>Note that a given message may go to multiple clients with different capabilities. So unless you turn off telnet completely and only rely on the webclient, you should never rely on non-<code class="docutils literal notranslate"><span class="pre">text</span></code> OOB messages always reaching all targets.</p>
|
||
</div></blockquote>
|
||
</section>
|
||
<section id="which-command-names-can-i-receive">
|
||
<h3>Which command-names can I receive<a class="headerlink" href="#which-command-names-can-i-receive" title="Permalink to this headline">¶</a></h3>
|
||
<p>This is decided by which <a class="reference internal" href="../Components/Inputfuncs.html"><span class="doc std std-doc">Inputfuncs</span></a> you define. You can extend Evennia’s default as you like, but adding your own functions in a module pointed to by <code class="docutils literal notranslate"><span class="pre">settings.INPUT_FUNC_MODULES</span></code>.</p>
|
||
</section>
|
||
</section>
|
||
<section id="supported-oob-protocols">
|
||
<h2>Supported OOB protocols<a class="headerlink" href="#supported-oob-protocols" title="Permalink to this headline">¶</a></h2>
|
||
<p>Evennia supports clients using one of the following protocols:</p>
|
||
<section id="telnet">
|
||
<h3>Telnet<a class="headerlink" href="#telnet" title="Permalink to this headline">¶</a></h3>
|
||
<p>By default telnet (and telnet+SSL) supports only the plain <code class="docutils literal notranslate"><span class="pre">text</span></code> outputcommand. Evennia detects if the Client supports one of two MUD-specific OOB <em>extensions</em> to the standard telnet protocol - GMCP or MSDP. Evennia supports both simultaneously and will switch to the protocol the client uses. If the client supports both, GMCP will be used.</p>
|
||
<blockquote>
|
||
<div><p>Note that for Telnet, <code class="docutils literal notranslate"><span class="pre">text</span></code> has a special status as the “in-band” operation. So the <code class="docutils literal notranslate"><span class="pre">text</span></code> outputcommand sends the <code class="docutils literal notranslate"><span class="pre">text</span></code> argument directly over the wire, without going through the OOB translations described below.</p>
|
||
</div></blockquote>
|
||
<section id="telnet-gmcp">
|
||
<h4>Telnet + GMCP<a class="headerlink" href="#telnet-gmcp" title="Permalink to this headline">¶</a></h4>
|
||
<p><a class="reference external" href="https://www.gammon.com.au/gmcp">GMCP</a>, the <em>Generic Mud Communication Protocol</em> sends data on the form <code class="docutils literal notranslate"><span class="pre">cmdname</span> <span class="pre">+</span> <span class="pre">JSONdata</span></code>. Here the cmdname is expected to be on the form “Package.Subpackage”. There could also be additional Sub-sub packages etc. The names of these ‘packages’ and ‘subpackages’ are not that well standardized beyond what individual MUDs or companies have chosen to go with over the years. You can decide on your own package names, but here are what others are using:</p>
|
||
<ul class="simple">
|
||
<li><p><a class="reference external" href="https://www.aardwolf.com/wiki/index.php/Clients/GMCP">Aardwolf GMCP</a></p></li>
|
||
<li><p><a class="reference external" href="https://discworld.starturtle.net/lpc/playing/documentation.c?path=/concepts/gmcp">Discworld GMCP</a></p></li>
|
||
<li><p><a class="reference external" href="https://www.outland.org/infusions/wiclear/index.php?title=MUD%20Protocols&lang=en">Avatar GMCP</a></p></li>
|
||
<li><p><a class="reference external" href="https://nexus.ironrealms.com/GMCP">IRE games GMCP</a></p></li>
|
||
</ul>
|
||
<p>Evennia will translate underscores to <code class="docutils literal notranslate"><span class="pre">.</span></code> and capitalize to fit the specification. So the outputcommand <code class="docutils literal notranslate"><span class="pre">foo_bar</span></code> will become a GMCP command-name <code class="docutils literal notranslate"><span class="pre">Foo.Bar</span></code>. A GMCP command “Foo.Bar” will be come <code class="docutils literal notranslate"><span class="pre">foo_bar</span></code>. To send a GMCP command that turns into an Evennia inputcommand without an underscore, use the <code class="docutils literal notranslate"><span class="pre">Core</span></code> package. So <code class="docutils literal notranslate"><span class="pre">Core.Cmdname</span></code> becomes just <code class="docutils literal notranslate"><span class="pre">cmdname</span></code> in Evennia and vice versa.</p>
|
||
<p>On the wire, the <code class="docutils literal notranslate"><span class="pre">commandtuple</span></code></p>
|
||
<div class="highlight-none notranslate"><div class="highlight"><pre><span></span>("cmdname", ("arg",), {})
|
||
</pre></div>
|
||
</div>
|
||
<p>will be sent over the wire as this GMCP telnet instruction</p>
|
||
<div class="highlight-none notranslate"><div class="highlight"><pre><span></span>IAC SB GMCP "cmdname" "arg" IAC SE
|
||
</pre></div>
|
||
</div>
|
||
<p>where all the capitalized words are telnet character constants specified in ]<span class="xref myst">evennia/server/portal/telnet_oob</span>. These are parsed/added by the protocol and we don’t include these in the listings below.</p>
|
||
<table class="colwidths-auto docutils align-default">
|
||
<thead>
|
||
<tr class="row-odd"><th class="head"><p><code class="docutils literal notranslate"><span class="pre">commandtuple</span></code></p></th>
|
||
<th class="head"><p>GMCP-Command</p></th>
|
||
</tr>
|
||
</thead>
|
||
<tbody>
|
||
<tr class="row-even"><td><p><code class="docutils literal notranslate"><span class="pre">(cmd_name,</span> <span class="pre">(),</span> <span class="pre">{})</span></code></p></td>
|
||
<td><p><code class="docutils literal notranslate"><span class="pre">Cmd.Name</span></code></p></td>
|
||
</tr>
|
||
<tr class="row-odd"><td><p><code class="docutils literal notranslate"><span class="pre">(cmd_name,</span> <span class="pre">(arg,),</span> <span class="pre">{})</span></code></p></td>
|
||
<td><p><code class="docutils literal notranslate"><span class="pre">Cmd.Name</span> <span class="pre">arg</span></code></p></td>
|
||
</tr>
|
||
<tr class="row-even"><td><p><code class="docutils literal notranslate"><span class="pre">(cmd_na_me,</span> <span class="pre">(args,...),{})</span></code></p></td>
|
||
<td><p><code class="docutils literal notranslate"><span class="pre">Cmd.Na.Me</span> <span class="pre">[arg,</span> <span class="pre">arg...]</span></code></p></td>
|
||
</tr>
|
||
<tr class="row-odd"><td><p><code class="docutils literal notranslate"><span class="pre">(cmd_name,</span> <span class="pre">(),</span> <span class="pre">{kwargs})</span></code></p></td>
|
||
<td><p><code class="docutils literal notranslate"><span class="pre">Cmd.Name</span> <span class="pre">{kwargs}</span></code></p></td>
|
||
</tr>
|
||
<tr class="row-even"><td><p><code class="docutils literal notranslate"><span class="pre">(cmdname,</span> <span class="pre">(arg,),</span> <span class="pre">{kwargs})</span></code></p></td>
|
||
<td><p><code class="docutils literal notranslate"><span class="pre">Core.Cmdname</span> <span class="pre">[[args],{kwargs}]</span></code></p></td>
|
||
</tr>
|
||
</tbody>
|
||
</table>
|
||
<p>Since Evennia already supplies default Inputfuncs that don’t match the names expected by the most common GMCP implementations we have a few hard-coded mappings for those:</p>
|
||
<table class="colwidths-auto docutils align-default">
|
||
<thead>
|
||
<tr class="row-odd"><th class="head"><p>GMCP command name</p></th>
|
||
<th class="head"><p><code class="docutils literal notranslate"><span class="pre">commandtuple</span></code> command name</p></th>
|
||
</tr>
|
||
</thead>
|
||
<tbody>
|
||
<tr class="row-even"><td><p><code class="docutils literal notranslate"><span class="pre">"Core.Hello"</span></code></p></td>
|
||
<td><p><code class="docutils literal notranslate"><span class="pre">"client_options"</span></code></p></td>
|
||
</tr>
|
||
<tr class="row-odd"><td><p><code class="docutils literal notranslate"><span class="pre">"Core.Supports.Get"</span></code></p></td>
|
||
<td><p><code class="docutils literal notranslate"><span class="pre">"client_options"</span></code></p></td>
|
||
</tr>
|
||
<tr class="row-even"><td><p><code class="docutils literal notranslate"><span class="pre">"Core.Commands.Get"</span></code></p></td>
|
||
<td><p><code class="docutils literal notranslate"><span class="pre">"get_inputfuncs"</span></code></p></td>
|
||
</tr>
|
||
<tr class="row-odd"><td><p><code class="docutils literal notranslate"><span class="pre">"Char.Value.Get"</span></code></p></td>
|
||
<td><p><code class="docutils literal notranslate"><span class="pre">"get_value"</span></code></p></td>
|
||
</tr>
|
||
<tr class="row-even"><td><p><code class="docutils literal notranslate"><span class="pre">"Char.Repeat.Update"</span></code></p></td>
|
||
<td><p><code class="docutils literal notranslate"><span class="pre">"repeat"</span></code></p></td>
|
||
</tr>
|
||
<tr class="row-odd"><td><p><code class="docutils literal notranslate"><span class="pre">"Char.Monitor.Update"</span></code></p></td>
|
||
<td><p><code class="docutils literal notranslate"><span class="pre">"monitor"</span></code></p></td>
|
||
</tr>
|
||
</tbody>
|
||
</table>
|
||
</section>
|
||
<section id="telnet-msdp">
|
||
<h4>Telnet + MSDP<a class="headerlink" href="#telnet-msdp" title="Permalink to this headline">¶</a></h4>
|
||
<p><a class="reference external" href="http://tintin.sourceforge.net/msdp/">MSDP</a>, the <em>Mud Server Data Protocol</em>, is a competing standard to GMCP. The MSDP protocol page specifies a range of “recommended” available MSDP command names. Evennia does <em>not</em> support those - since MSDP doesn’t specify a special format for its command names (like GMCP does) the client can and should just call the internal Evennia inputfunc by its actual name.</p>
|
||
<p>MSDP uses Telnet character constants to package various structured data over the wire. MSDP supports strings, arrays (lists) and tables (dicts). These are used to define the cmdname, args and kwargs needed. When sending MSDP for <code class="docutils literal notranslate"><span class="pre">("cmdname",</span> <span class="pre">("arg",),</span> <span class="pre">{})</span></code> the resulting MSDP instruction will look like this:</p>
|
||
<div class="highlight-none notranslate"><div class="highlight"><pre><span></span>IAC SB MSDP VAR cmdname VAL arg IAC SE
|
||
</pre></div>
|
||
</div>
|
||
<p>The various available MSDP constants like <code class="docutils literal notranslate"><span class="pre">VAR</span></code> (variable), <code class="docutils literal notranslate"><span class="pre">VAL</span></code> (value), <code class="docutils literal notranslate"><span class="pre">ARRAYOPEN</span></code>/<code class="docutils literal notranslate"><span class="pre">ARRAYCLOSE</span></code>
|
||
and <code class="docutils literal notranslate"><span class="pre">TABLEOPEN</span></code>/<code class="docutils literal notranslate"><span class="pre">TABLECLOSE</span></code> are specified in <code class="docutils literal notranslate"><span class="pre">evennia/server/portal/telnet_oob</span></code>.</p>
|
||
<table class="colwidths-auto docutils align-default">
|
||
<thead>
|
||
<tr class="row-odd"><th class="head"><p><code class="docutils literal notranslate"><span class="pre">commandtuple</span></code></p></th>
|
||
<th class="head"><p>MSDP instruction</p></th>
|
||
</tr>
|
||
</thead>
|
||
<tbody>
|
||
<tr class="row-even"><td><p><code class="docutils literal notranslate"><span class="pre">(cmdname,</span> <span class="pre">(),</span> <span class="pre">{})</span></code></p></td>
|
||
<td><p><code class="docutils literal notranslate"><span class="pre">VAR</span> <span class="pre">cmdname</span> <span class="pre">VAL</span></code></p></td>
|
||
</tr>
|
||
<tr class="row-odd"><td><p><code class="docutils literal notranslate"><span class="pre">(cmdname,</span> <span class="pre">(arg,),</span> <span class="pre">{})</span></code></p></td>
|
||
<td><p><code class="docutils literal notranslate"><span class="pre">VAR</span> <span class="pre">cmdname</span> <span class="pre">VAL</span> <span class="pre">arg</span></code></p></td>
|
||
</tr>
|
||
<tr class="row-even"><td><p><code class="docutils literal notranslate"><span class="pre">(cmdname,</span> <span class="pre">(arg,...),{})</span></code></p></td>
|
||
<td><p><code class="docutils literal notranslate"><span class="pre">VAR</span> <span class="pre">cmdname</span> <span class="pre">VAL</span> <span class="pre">ARRAYOPEN</span> <span class="pre">VAL</span> <span class="pre">arg</span> <span class="pre">VAL</span> <span class="pre">arg</span> <span class="pre">...</span> <span class="pre">ARRAYCLOSE</span></code></p></td>
|
||
</tr>
|
||
<tr class="row-odd"><td><p><code class="docutils literal notranslate"><span class="pre">(cmdname,</span> <span class="pre">(),</span> <span class="pre">{kwargs})</span></code></p></td>
|
||
<td><p><code class="docutils literal notranslate"><span class="pre">VAR</span> <span class="pre">cmdname</span> <span class="pre">VAL</span> <span class="pre">TABLEOPEN</span> <span class="pre">VAR</span> <span class="pre">key</span> <span class="pre">VAL</span> <span class="pre">val</span> <span class="pre">...</span> <span class="pre">TABLECLOSE</span></code></p></td>
|
||
</tr>
|
||
<tr class="row-even"><td><p><code class="docutils literal notranslate"><span class="pre">(cmdname,</span> <span class="pre">(args,...),</span> <span class="pre">{kwargs})</span></code></p></td>
|
||
<td><p><code class="docutils literal notranslate"><span class="pre">VAR</span> <span class="pre">cmdname</span> <span class="pre">VAL</span> <span class="pre">ARRAYOPEN</span> <span class="pre">VAL</span> <span class="pre">arg</span> <span class="pre">VAL</span> <span class="pre">arg</span> <span class="pre">...</span> <span class="pre">ARRAYCLOSE</span> <span class="pre">VAR</span> <span class="pre">cmdname</span> <span class="pre">VAL</span> <span class="pre">TABLEOPEN</span> <span class="pre">VAR</span> <span class="pre">key</span> <span class="pre">VAL</span> <span class="pre">val</span> <span class="pre">...</span> <span class="pre">TABLECLOSE</span></code></p></td>
|
||
</tr>
|
||
</tbody>
|
||
</table>
|
||
<p>Observe that <code class="docutils literal notranslate"><span class="pre">VAR</span> <span class="pre">...</span> <span class="pre">VAL</span></code> always identifies <code class="docutils literal notranslate"><span class="pre">cmdnames</span></code>, so if there are multiple arrays/dicts tagged with the same cmdname they will be appended to the args, kwargs of that inputfunc. Vice-versa, a
|
||
different <code class="docutils literal notranslate"><span class="pre">VAR</span> <span class="pre">...</span> <span class="pre">VAL</span></code> (outside a table) will come out as a second, different command input.</p>
|
||
</section>
|
||
</section>
|
||
<section id="ssh">
|
||
<h3>SSH<a class="headerlink" href="#ssh" title="Permalink to this headline">¶</a></h3>
|
||
<p>SSH only supports the <code class="docutils literal notranslate"><span class="pre">text</span></code> input/outputcommand.</p>
|
||
</section>
|
||
<section id="web-client">
|
||
<h3>Web client<a class="headerlink" href="#web-client" title="Permalink to this headline">¶</a></h3>
|
||
<p>Our web client uses pure <a class="reference external" href="https://en.wikipedia.org/wiki/JSON">JSON</a> structures for all its communication, including <code class="docutils literal notranslate"><span class="pre">text</span></code>. This maps directly to the Evennia internal output/inputcommand, including eventual empty args/kwargs.</p>
|
||
<table class="colwidths-auto docutils align-default">
|
||
<thead>
|
||
<tr class="row-odd"><th class="head"><p><code class="docutils literal notranslate"><span class="pre">commandtuple</span></code></p></th>
|
||
<th class="head"><p>Evennia Webclient JSON</p></th>
|
||
</tr>
|
||
</thead>
|
||
<tbody>
|
||
<tr class="row-even"><td><p><code class="docutils literal notranslate"><span class="pre">(cmdname,</span> <span class="pre">(),</span> <span class="pre">{})</span></code></p></td>
|
||
<td><p><code class="docutils literal notranslate"><span class="pre">["cmdname",</span> <span class="pre">[],</span> <span class="pre">{}]</span></code></p></td>
|
||
</tr>
|
||
<tr class="row-odd"><td><p><code class="docutils literal notranslate"><span class="pre">(cmdname,</span> <span class="pre">(arg,),</span> <span class="pre">{})</span></code></p></td>
|
||
<td><p><code class="docutils literal notranslate"><span class="pre">["cmdname",</span> <span class="pre">[arg],</span> <span class="pre">{}]</span></code></p></td>
|
||
</tr>
|
||
<tr class="row-even"><td><p><code class="docutils literal notranslate"><span class="pre">(cmdname,</span> <span class="pre">(arg,...),{})</span></code></p></td>
|
||
<td><p><code class="docutils literal notranslate"><span class="pre">["cmdname",</span> <span class="pre">[arg,</span> <span class="pre">...],</span> <span class="pre">{})</span></code></p></td>
|
||
</tr>
|
||
<tr class="row-odd"><td><p><code class="docutils literal notranslate"><span class="pre">(cmdname,</span> <span class="pre">(),</span> <span class="pre">{kwargs})</span></code></p></td>
|
||
<td><p><code class="docutils literal notranslate"><span class="pre">["cmdname",</span> <span class="pre">[],</span> <span class="pre">{kwargs})</span></code></p></td>
|
||
</tr>
|
||
<tr class="row-even"><td><p><code class="docutils literal notranslate"><span class="pre">(cmdname,</span> <span class="pre">(arg,...),</span> <span class="pre">{kwargs})</span></code></p></td>
|
||
<td><p><code class="docutils literal notranslate"><span class="pre">["cmdname",</span> <span class="pre">[arg,</span> <span class="pre">...],</span> <span class="pre">{kwargs})</span></code></p></td>
|
||
</tr>
|
||
</tbody>
|
||
</table>
|
||
<p>Since JSON is native to Javascript, this becomes very easy for the webclient to handle.</p>
|
||
</section>
|
||
</section>
|
||
</section>
|
||
|
||
|
||
</div>
|
||
</div>
|
||
</div>
|
||
|
||
</div>
|
||
<div class="related" role="navigation" aria-label="related navigation">
|
||
<h3>Navigation</h3>
|
||
<ul>
|
||
<li class="right" style="margin-right: 10px">
|
||
<a href="../genindex.html" title="General Index"
|
||
>index</a></li>
|
||
<li class="right" >
|
||
<a href="../py-modindex.html" title="Python Module Index"
|
||
>modules</a> |</li>
|
||
<li class="right" >
|
||
<a href="Async-Process.html" title="Async Process"
|
||
>next</a> |</li>
|
||
<li class="right" >
|
||
<a href="Messagepath.html" title="The Message path"
|
||
>previous</a> |</li>
|
||
<li class="nav-item nav-item-0"><a href="../index.html">Evennia 2.x</a> »</li>
|
||
<li class="nav-item nav-item-1"><a href="Concepts-Overview.html" >Core Concepts</a> »</li>
|
||
<li class="nav-item nav-item-this"><a href="">Out-of-Band messaging</a></li>
|
||
</ul>
|
||
</div>
|
||
|
||
|
||
|
||
<div class="footer" role="contentinfo">
|
||
© Copyright 2023, The Evennia developer community.
|
||
Created using <a href="https://www.sphinx-doc.org/">Sphinx</a> 3.2.1.
|
||
</div>
|
||
</body>
|
||
</html> |