<spanid="evennia-server-portal-telnet-oob"></span><h1>evennia.server.portal.telnet_oob<aclass="headerlink"href="#module-evennia.server.portal.telnet_oob"title="Permalink to this headline">¶</a></h1>
<p>Telnet OOB (Out of band communication)</p>
<p>OOB protocols allow for asynchronous communication between Evennia and
compliant telnet clients. The “text” type of send command will always
be sent “in-band”, appearing in the client’s main text output. OOB
commands, by contrast, can have many forms and it is up to the client
how and if they are handled. Examples of OOB instructions could be to
instruct the client to play sounds or to update a graphical health
bar.</p>
<p>Note that in Evennia’s Web client, all send commands are “OOB
commands”, (including the “text” one), there is no equivalence to
MSDP/GMCP for the webclient since it doesn’t need it.</p>
<p>This implements the following telnet OOB communication protocols:</p>
<ulclass="simple">
<li><p>MSDP (Mud Server Data Protocol), as per <aclass="reference external"href="http://tintin.sourceforge.net/msdp/">http://tintin.sourceforge.net/msdp/</a></p></li>
<li><p>GMCP (Generic Mud Communication Protocol) as per
<emclass="property">class </em><codeclass="sig-prename descclassname">evennia.server.portal.telnet_oob.</code><codeclass="sig-name descname">TelnetOOB</code><spanclass="sig-paren">(</span><emclass="sig-param"><spanclass="n">protocol</span></em><spanclass="sig-paren">)</span><aclass="reference internal"href="../_modules/evennia/server/portal/telnet_oob.html#TelnetOOB"><spanclass="viewcode-link">[source]</span></a><aclass="headerlink"href="#evennia.server.portal.telnet_oob.TelnetOOB"title="Permalink to this definition">¶</a></dt>
<codeclass="sig-name descname">__init__</code><spanclass="sig-paren">(</span><emclass="sig-param"><spanclass="n">protocol</span></em><spanclass="sig-paren">)</span><aclass="reference internal"href="../_modules/evennia/server/portal/telnet_oob.html#TelnetOOB.__init__"><spanclass="viewcode-link">[source]</span></a><aclass="headerlink"href="#evennia.server.portal.telnet_oob.TelnetOOB.__init__"title="Permalink to this definition">¶</a></dt>
<dd><p>Initiates by storing the protocol on itself and trying to
determine if the client supports MSDP.</p>
<dlclass="field-list simple">
<dtclass="field-odd">Parameters</dt>
<ddclass="field-odd"><p><strong>protocol</strong> (<em>Protocol</em>) – The active protocol.</p>
<codeclass="sig-name descname">no_msdp</code><spanclass="sig-paren">(</span><emclass="sig-param"><spanclass="n">option</span></em><spanclass="sig-paren">)</span><aclass="reference internal"href="../_modules/evennia/server/portal/telnet_oob.html#TelnetOOB.no_msdp"><spanclass="viewcode-link">[source]</span></a><aclass="headerlink"href="#evennia.server.portal.telnet_oob.TelnetOOB.no_msdp"title="Permalink to this definition">¶</a></dt>
<dd><p>Client reports No msdp supported or wanted.</p>
<dlclass="field-list simple">
<dtclass="field-odd">Parameters</dt>
<ddclass="field-odd"><p><strong>option</strong> (<em>Option</em>) – Not used.</p>
<codeclass="sig-name descname">do_msdp</code><spanclass="sig-paren">(</span><emclass="sig-param"><spanclass="n">option</span></em><spanclass="sig-paren">)</span><aclass="reference internal"href="../_modules/evennia/server/portal/telnet_oob.html#TelnetOOB.do_msdp"><spanclass="viewcode-link">[source]</span></a><aclass="headerlink"href="#evennia.server.portal.telnet_oob.TelnetOOB.do_msdp"title="Permalink to this definition">¶</a></dt>
<dd><p>Client reports that it supports msdp.</p>
<dlclass="field-list simple">
<dtclass="field-odd">Parameters</dt>
<ddclass="field-odd"><p><strong>option</strong> (<em>Option</em>) – Not used.</p>
<codeclass="sig-name descname">no_gmcp</code><spanclass="sig-paren">(</span><emclass="sig-param"><spanclass="n">option</span></em><spanclass="sig-paren">)</span><aclass="reference internal"href="../_modules/evennia/server/portal/telnet_oob.html#TelnetOOB.no_gmcp"><spanclass="viewcode-link">[source]</span></a><aclass="headerlink"href="#evennia.server.portal.telnet_oob.TelnetOOB.no_gmcp"title="Permalink to this definition">¶</a></dt>
<dd><p>If this is reached, it means neither MSDP nor GMCP is
supported.</p>
<dlclass="field-list simple">
<dtclass="field-odd">Parameters</dt>
<ddclass="field-odd"><p><strong>option</strong> (<em>Option</em>) – Not used.</p>
<codeclass="sig-name descname">do_gmcp</code><spanclass="sig-paren">(</span><emclass="sig-param"><spanclass="n">option</span></em><spanclass="sig-paren">)</span><aclass="reference internal"href="../_modules/evennia/server/portal/telnet_oob.html#TelnetOOB.do_gmcp"><spanclass="viewcode-link">[source]</span></a><aclass="headerlink"href="#evennia.server.portal.telnet_oob.TelnetOOB.do_gmcp"title="Permalink to this definition">¶</a></dt>
<dd><p>Called when client confirms that it can do MSDP or GMCP.</p>
<dlclass="field-list simple">
<dtclass="field-odd">Parameters</dt>
<ddclass="field-odd"><p><strong>option</strong> (<em>Option</em>) – Not used.</p>
<codeclass="sig-name descname">encode_msdp</code><spanclass="sig-paren">(</span><emclass="sig-param"><spanclass="n">cmdname</span></em>, <emclass="sig-param"><spanclass="o">*</span><spanclass="n">args</span></em>, <emclass="sig-param"><spanclass="o">**</span><spanclass="n">kwargs</span></em><spanclass="sig-paren">)</span><aclass="reference internal"href="../_modules/evennia/server/portal/telnet_oob.html#TelnetOOB.encode_msdp"><spanclass="viewcode-link">[source]</span></a><aclass="headerlink"href="#evennia.server.portal.telnet_oob.TelnetOOB.encode_msdp"title="Permalink to this definition">¶</a></dt>
<dd><p>Encode into a valid MSDP command.</p>
<dlclass="field-list simple">
<dtclass="field-odd">Parameters</dt>
<ddclass="field-odd"><ulclass="simple">
<li><p><strong>cmdname</strong> (<em>str</em>) – Name of send instruction.</p></li>
<li><p><strong>args</strong> (<em>any</em>) – Arguments to OOB command.</p></li>
<li><p><strong>kwargs</strong> (<em>any</em>) – Arguments to OOB command.</p></li>
<codeclass="sig-name descname">encode_gmcp</code><spanclass="sig-paren">(</span><emclass="sig-param"><spanclass="n">cmdname</span></em>, <emclass="sig-param"><spanclass="o">*</span><spanclass="n">args</span></em>, <emclass="sig-param"><spanclass="o">**</span><spanclass="n">kwargs</span></em><spanclass="sig-paren">)</span><aclass="reference internal"href="../_modules/evennia/server/portal/telnet_oob.html#TelnetOOB.encode_gmcp"><spanclass="viewcode-link">[source]</span></a><aclass="headerlink"href="#evennia.server.portal.telnet_oob.TelnetOOB.encode_gmcp"title="Permalink to this definition">¶</a></dt>
<codeclass="sig-name descname">decode_msdp</code><spanclass="sig-paren">(</span><emclass="sig-param"><spanclass="n">data</span></em><spanclass="sig-paren">)</span><aclass="reference internal"href="../_modules/evennia/server/portal/telnet_oob.html#TelnetOOB.decode_msdp"><spanclass="viewcode-link">[source]</span></a><aclass="headerlink"href="#evennia.server.portal.telnet_oob.TelnetOOB.decode_msdp"title="Permalink to this definition">¶</a></dt>
<dd><p>Decodes incoming MSDP data.</p>
<dlclass="field-list simple">
<dtclass="field-odd">Parameters</dt>
<ddclass="field-odd"><p><strong>data</strong> (<em>str</em><em> or </em><em>list</em>) – MSDP data.</p>
<codeclass="sig-name descname">decode_gmcp</code><spanclass="sig-paren">(</span><emclass="sig-param"><spanclass="n">data</span></em><spanclass="sig-paren">)</span><aclass="reference internal"href="../_modules/evennia/server/portal/telnet_oob.html#TelnetOOB.decode_gmcp"><spanclass="viewcode-link">[source]</span></a><aclass="headerlink"href="#evennia.server.portal.telnet_oob.TelnetOOB.decode_gmcp"title="Permalink to this definition">¶</a></dt>
<dd><p>Decodes incoming GMCP data on the form ‘varname <structure>’.</p>
<dlclass="field-list simple">
<dtclass="field-odd">Parameters</dt>
<ddclass="field-odd"><p><strong>data</strong> (<em>str</em><em> or </em><em>list</em>) – GMCP data.</p>
</dd>
</dl>
<pclass="rubric">Notes</p>
<p>Clients send data on the form “Module.Submodule.Cmdname <structure>”.
We assume the structure is valid JSON.</p>
<p>The following is parsed into Evennia’s formal structure:</p>
<codeclass="sig-name descname">data_out</code><spanclass="sig-paren">(</span><emclass="sig-param"><spanclass="n">cmdname</span></em>, <emclass="sig-param"><spanclass="o">*</span><spanclass="n">args</span></em>, <emclass="sig-param"><spanclass="o">**</span><spanclass="n">kwargs</span></em><spanclass="sig-paren">)</span><aclass="reference internal"href="../_modules/evennia/server/portal/telnet_oob.html#TelnetOOB.data_out"><spanclass="viewcode-link">[source]</span></a><aclass="headerlink"href="#evennia.server.portal.telnet_oob.TelnetOOB.data_out"title="Permalink to this definition">¶</a></dt>
<dd><p>Return a MSDP- or GMCP-valid subnegotiation across the protocol.</p>