mirror of
https://github.com/evennia/evennia.git
synced 2026-03-28 02:36:32 +01:00
288 lines
No EOL
20 KiB
HTML
288 lines
No EOL
20 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>In-Game Reporting System — Evennia latest 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="Menu-based login system" href="Contrib-Menu-Login.html" />
|
||
<link rel="prev" title="A voice operated elevator using events" href="Contrib-Ingame-Python-Tutorial-Elevator.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="Contrib-Menu-Login.html" title="Menu-based login system"
|
||
accesskey="N">next</a> |</li>
|
||
<li class="right" >
|
||
<a href="Contrib-Ingame-Python-Tutorial-Elevator.html" title="A voice operated elevator using events"
|
||
accesskey="P">previous</a> |</li>
|
||
<li class="nav-item nav-item-0"><a href="../index.html">Evennia latest</a> »</li>
|
||
<li class="nav-item nav-item-1"><a href="Contribs-Overview.html" accesskey="U">Contribs</a> »</li>
|
||
<li class="nav-item nav-item-this"><a href="">In-Game Reporting System</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="#">In-Game Reporting System</a><ul>
|
||
<li><a class="reference internal" href="#installation">Installation</a></li>
|
||
<li><a class="reference internal" href="#usage">Usage</a><ul>
|
||
<li><a class="reference internal" href="#submitting-reports">Submitting reports</a></li>
|
||
<li><a class="reference internal" href="#managing-reports">Managing reports</a></li>
|
||
<li><a class="reference internal" href="#adding-new-types-of-reports">Adding new types of reports</a><ul>
|
||
<li><a class="reference internal" href="#update-your-settings">Update your settings</a></li>
|
||
<li><a class="reference internal" href="#create-a-new-reportcmd">Create a new ReportCmd</a></li>
|
||
</ul>
|
||
</li>
|
||
</ul>
|
||
</li>
|
||
</ul>
|
||
</li>
|
||
</ul>
|
||
|
||
<h4>Previous topic</h4>
|
||
<p class="topless"><a href="Contrib-Ingame-Python-Tutorial-Elevator.html"
|
||
title="previous chapter">A voice operated elevator using events</a></p>
|
||
<h4>Next topic</h4>
|
||
<p class="topless"><a href="Contrib-Menu-Login.html"
|
||
title="next chapter">Menu-based login system</a></p>
|
||
<div role="note" aria-label="source link">
|
||
<!--h3>This Page</h3-->
|
||
<ul class="this-page-menu">
|
||
<li><a href="../_sources/Contribs/Contrib-Ingame-Reports.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="Contrib-Ingame-Reports.html">latest (main branch)</a></li>
|
||
|
||
<li><a href="../4.x/index.html">v4.0.0 branch (outdated)</a></li>
|
||
|
||
<li><a href="../3.x/index.html">v3.0.0 branch (outdated)</a></li>
|
||
|
||
<li><a href="../2.x/index.html">v2.0.0 branch (outdated)</a></li>
|
||
|
||
<li><a href="../1.x/index.html">v1.0.0 branch (outdated)</a></li>
|
||
|
||
<li><a href="../0.x/index.html">v0.9.5 branch (outdated)</a></li>
|
||
|
||
|
||
</ul>
|
||
|
||
</div>
|
||
</div>
|
||
<div class="bodywrapper">
|
||
<div class="body" role="main">
|
||
|
||
<section class="tex2jax_ignore mathjax_ignore" id="in-game-reporting-system">
|
||
<h1>In-Game Reporting System<a class="headerlink" href="#in-game-reporting-system" title="Permalink to this headline">¶</a></h1>
|
||
<p>Contrib by InspectorCaracal, 2024</p>
|
||
<p>This contrib provides an in-game reports system, handling bug reports, player reports, and idea submissions by default. It also supports adding your own types of reports, or removing any of the default report types.</p>
|
||
<p>Each type of report has its own command for submitting new reports, and an admin command is also provided for managing the reports through a menu.</p>
|
||
<section id="installation">
|
||
<h2>Installation<a class="headerlink" href="#installation" title="Permalink to this headline">¶</a></h2>
|
||
<p>To install the reports contrib, just add the provided cmdset to your default AccountCmdSet:</p>
|
||
<div class="highlight-python notranslate"><div class="highlight"><pre><span></span><span class="c1"># in commands/default_cmdset.py</span>
|
||
|
||
<span class="kn">from</span> <span class="nn">evennia.contrib.base_systems.ingame_reports</span> <span class="kn">import</span> <span class="n">ReportsCmdSet</span>
|
||
|
||
<span class="k">class</span> <span class="nc">AccountCmdSet</span><span class="p">(</span><span class="n">default_cmds</span><span class="o">.</span><span class="n">AccountCmdSet</span><span class="p">):</span>
|
||
<span class="c1"># ...</span>
|
||
|
||
<span class="k">def</span> <span class="nf">at_cmdset_creation</span><span class="p">(</span><span class="bp">self</span><span class="p">):</span>
|
||
<span class="c1"># ...</span>
|
||
<span class="bp">self</span><span class="o">.</span><span class="n">add</span><span class="p">(</span><span class="n">ReportsCmdSet</span><span class="p">)</span>
|
||
</pre></div>
|
||
</div>
|
||
<p>The contrib also has two optional settings: <code class="docutils literal notranslate"><span class="pre">INGAME_REPORT_TYPES</span></code> and <code class="docutils literal notranslate"><span class="pre">INGAME_REPORT_STATUS_TAGS</span></code>.</p>
|
||
<p>The <code class="docutils literal notranslate"><span class="pre">INGAME_REPORT_TYPES</span></code> setting is covered in detail in the section “Adding new types of reports”.</p>
|
||
<p>The <code class="docutils literal notranslate"><span class="pre">INGAME_REPORT_STATUS_TAGS</span></code> setting is covered in the section “Managing reports”.</p>
|
||
</section>
|
||
<section id="usage">
|
||
<h2>Usage<a class="headerlink" href="#usage" title="Permalink to this headline">¶</a></h2>
|
||
<p>By default, the following report types are available:</p>
|
||
<ul class="simple">
|
||
<li><p>Bugs: Report bugs encountered during gameplay.</p></li>
|
||
<li><p>Ideas: Submit suggestions for game improvement.</p></li>
|
||
<li><p>Players: Report inappropriate player behavior.</p></li>
|
||
</ul>
|
||
<p>Players can submit new reports through the command for each report type, and staff are given access to a report-management command and menu.</p>
|
||
<section id="submitting-reports">
|
||
<h3>Submitting reports<a class="headerlink" href="#submitting-reports" title="Permalink to this headline">¶</a></h3>
|
||
<p>Players can submit reports using the following commands:</p>
|
||
<ul class="simple">
|
||
<li><p><code class="docutils literal notranslate"><span class="pre">bug</span> <span class="pre"><text></span></code> - Files a bug report. An optional target can be included - <code class="docutils literal notranslate"><span class="pre">bug</span> <span class="pre"><target></span> <span class="pre">=</span> <span class="pre"><text></span></code> - making it easier for devs/builders to track down issues.</p></li>
|
||
<li><p><code class="docutils literal notranslate"><span class="pre">report</span> <span class="pre"><player></span> <span class="pre">=</span> <span class="pre"><text></span></code> - Reports a player for inappropriate or rule-breaking behavior. <em>Requires</em> a target to be provided - it searches among accounts by default.</p></li>
|
||
<li><p><code class="docutils literal notranslate"><span class="pre">idea</span> <span class="pre"><text></span></code> - Submits a general suggestion, with no target. It also has an alias of <code class="docutils literal notranslate"><span class="pre">ideas</span></code> which allows you to view all of your submitted ideas.</p></li>
|
||
</ul>
|
||
</section>
|
||
<section id="managing-reports">
|
||
<h3>Managing reports<a class="headerlink" href="#managing-reports" title="Permalink to this headline">¶</a></h3>
|
||
<p>The <code class="docutils literal notranslate"><span class="pre">manage</span> <span class="pre">reports</span></code> command allows staff to review and manage the various types of reports by launching a management menu.</p>
|
||
<p>This command will dynamically add aliases to itself based on the types of reports available, with each command string launching a menu for that particular report type. The aliases are built on the pattern <code class="docutils literal notranslate"><span class="pre">manage</span> <span class="pre"><report</span> <span class="pre">type>s</span></code> - by default, this means it makes <code class="docutils literal notranslate"><span class="pre">manage</span> <span class="pre">bugs</span></code>, <code class="docutils literal notranslate"><span class="pre">manage</span> <span class="pre">players</span></code>, and <code class="docutils literal notranslate"><span class="pre">manage</span> <span class="pre">ideas</span></code> available along with the default <code class="docutils literal notranslate"><span class="pre">manage</span> <span class="pre">reports</span></code>, and that e.g. <code class="docutils literal notranslate"><span class="pre">manage</span> <span class="pre">bugs</span></code> will launch the management menu for <code class="docutils literal notranslate"><span class="pre">bug</span></code>-type reports.</p>
|
||
<p>Aside from reading over existing reports, the menu allows you to change the status of any given report. By default, the contrib includes two different status tags: <code class="docutils literal notranslate"><span class="pre">in</span> <span class="pre">progress</span></code> and <code class="docutils literal notranslate"><span class="pre">closed</span></code>.</p>
|
||
<blockquote>
|
||
<div><p>Note: A report is created with no status tags, which is considered “open”</p>
|
||
</div></blockquote>
|
||
<p>If you want a different set of statuses for your reports, you can define the <code class="docutils literal notranslate"><span class="pre">INGAME_REPORT_STATUS_TAGS</span></code> to your list of statuses.</p>
|
||
<p><strong>Example</strong></p>
|
||
<div class="highlight-python notranslate"><div class="highlight"><pre><span></span><span class="c1"># in server/conf/settings.py</span>
|
||
|
||
<span class="c1"># this will allow for the statuses of 'in progress', 'rejected', and 'completed', without the contrib-default of 'closed'</span>
|
||
<span class="n">INGAME_REPORT_STATUS_TAGS</span> <span class="o">=</span> <span class="p">(</span><span class="s1">'in progress'</span><span class="p">,</span> <span class="s1">'rejected'</span><span class="p">,</span> <span class="s1">'completed'</span><span class="p">)</span>
|
||
</pre></div>
|
||
</div>
|
||
</section>
|
||
<section id="adding-new-types-of-reports">
|
||
<h3>Adding new types of reports<a class="headerlink" href="#adding-new-types-of-reports" title="Permalink to this headline">¶</a></h3>
|
||
<p>The contrib is designed to make adding new types of reports to the system as simple as possible, requiring only two steps:</p>
|
||
<ol class="simple">
|
||
<li><p>Update your settings file to include an <code class="docutils literal notranslate"><span class="pre">INGAME_REPORT_TYPES</span></code> setting.</p></li>
|
||
<li><p>Create and add a new <code class="docutils literal notranslate"><span class="pre">ReportCmd</span></code> to your command set.</p></li>
|
||
</ol>
|
||
<section id="update-your-settings">
|
||
<h4>Update your settings<a class="headerlink" href="#update-your-settings" title="Permalink to this headline">¶</a></h4>
|
||
<p>The contrib optionally references <code class="docutils literal notranslate"><span class="pre">INGAME_REPORT_TYPES</span></code> in your <a class="reference external" href="http://settings.py">settings.py</a> to see which types of reports can be managed. If you want to change the available report types, you’ll need to define this setting.</p>
|
||
<div class="highlight-python notranslate"><div class="highlight"><pre><span></span><span class="c1"># in server/conf/settings.py</span>
|
||
|
||
<span class="c1"># this will include the contrib's report types as well as a custom 'complaint' report type</span>
|
||
<span class="n">INGAME_REPORT_TYPES</span> <span class="o">=</span> <span class="p">(</span><span class="s1">'bugs'</span><span class="p">,</span> <span class="s1">'ideas'</span><span class="p">,</span> <span class="s1">'players'</span><span class="p">,</span> <span class="s1">'complaints'</span><span class="p">)</span>
|
||
</pre></div>
|
||
</div>
|
||
<p>You can also use this setting to remove any of the contrib’s report types - the contrib will respect this setting when building its cmdset with no additional steps.</p>
|
||
<div class="highlight-python notranslate"><div class="highlight"><pre><span></span><span class="c1"># in server/conf/settings.py</span>
|
||
|
||
<span class="c1"># this redefines the setting to not include 'ideas', so the ideas command and reports won't be available</span>
|
||
<span class="n">INGAME_REPORT_TYPES</span> <span class="o">=</span> <span class="p">(</span><span class="s1">'bugs'</span><span class="p">,</span> <span class="s1">'players'</span><span class="p">)</span>
|
||
</pre></div>
|
||
</div>
|
||
</section>
|
||
<section id="create-a-new-reportcmd">
|
||
<h4>Create a new ReportCmd<a class="headerlink" href="#create-a-new-reportcmd" title="Permalink to this headline">¶</a></h4>
|
||
<p><code class="docutils literal notranslate"><span class="pre">ReportCmdBase</span></code> is a parent command class which comes with the main functionality for submitting reports. Creating a new reporting command is as simple as inheriting from this class and defining a couple of class attributes.</p>
|
||
<ul class="simple">
|
||
<li><p><code class="docutils literal notranslate"><span class="pre">key</span></code> - This is the same as for any other command, setting the command’s usable key. It also acts as the report type if that isn’t explicitly set.</p></li>
|
||
<li><p><code class="docutils literal notranslate"><span class="pre">report_type</span></code> - The type of report this command is for (e.g. <code class="docutils literal notranslate"><span class="pre">player</span></code>). You only need to set it if you want a different string from the key.</p></li>
|
||
<li><p><code class="docutils literal notranslate"><span class="pre">report_locks</span></code> - The locks you want applied to the created reports. Defaults to <code class="docutils literal notranslate"><span class="pre">"read:pperm(Admin)"</span></code></p></li>
|
||
<li><p><code class="docutils literal notranslate"><span class="pre">success_msg</span></code> - The string which is sent to players after submitting a report of this type. Defaults to <code class="docutils literal notranslate"><span class="pre">"Your</span> <span class="pre">report</span> <span class="pre">has</span> <span class="pre">been</span> <span class="pre">filed."</span></code></p></li>
|
||
<li><p><code class="docutils literal notranslate"><span class="pre">require_target</span></code>: Set to <code class="docutils literal notranslate"><span class="pre">True</span></code> if your report type requires a target (e.g. player reports).</p></li>
|
||
</ul>
|
||
<blockquote>
|
||
<div><p>Note: The contrib’s own commands - <code class="docutils literal notranslate"><span class="pre">CmdBug</span></code>, <code class="docutils literal notranslate"><span class="pre">CmdIdea</span></code>, and <code class="docutils literal notranslate"><span class="pre">CmdReport</span></code> - are implemented the same way, so you can review them as examples.</p>
|
||
</div></blockquote>
|
||
<p>Example:</p>
|
||
<div class="highlight-python notranslate"><div class="highlight"><pre><span></span><span class="kn">from</span> <span class="nn">evennia.contrib.base_systems.ingame_reports.reports</span> <span class="kn">import</span> <span class="n">ReportCmdBase</span>
|
||
|
||
<span class="k">class</span> <span class="nc">CmdCustomReport</span><span class="p">(</span><span class="n">ReportCmdBase</span><span class="p">):</span>
|
||
<span class="w"> </span><span class="sd">"""</span>
|
||
<span class="sd"> file a custom report</span>
|
||
|
||
<span class="sd"> Usage:</span>
|
||
<span class="sd"> customreport <message></span>
|
||
|
||
<span class="sd"> This is a custom report type.</span>
|
||
<span class="sd"> """</span>
|
||
|
||
<span class="n">key</span> <span class="o">=</span> <span class="s2">"customreport"</span>
|
||
<span class="n">report_type</span> <span class="o">=</span> <span class="s2">"custom"</span>
|
||
<span class="n">success_message</span> <span class="o">=</span> <span class="s2">"You have successfully filed a custom report."</span>
|
||
</pre></div>
|
||
</div>
|
||
<p>Add this new command to your default cmdset to enable filing your new report type.</p>
|
||
<hr class="docutils" />
|
||
<p><small>This document page is generated from <code class="docutils literal notranslate"><span class="pre">evennia/contrib/base_systems/ingame_reports/README.md</span></code>. Changes to this
|
||
file will be overwritten, so edit that file rather than this one.</small></p>
|
||
</section>
|
||
</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="Contrib-Menu-Login.html" title="Menu-based login system"
|
||
>next</a> |</li>
|
||
<li class="right" >
|
||
<a href="Contrib-Ingame-Python-Tutorial-Elevator.html" title="A voice operated elevator using events"
|
||
>previous</a> |</li>
|
||
<li class="nav-item nav-item-0"><a href="../index.html">Evennia latest</a> »</li>
|
||
<li class="nav-item nav-item-1"><a href="Contribs-Overview.html" >Contribs</a> »</li>
|
||
<li class="nav-item nav-item-this"><a href="">In-Game Reporting System</a></li>
|
||
</ul>
|
||
</div>
|
||
|
||
|
||
|
||
<div class="footer" role="contentinfo">
|
||
© Copyright 2024, The Evennia developer community.
|
||
Created using <a href="https://www.sphinx-doc.org/">Sphinx</a> 3.2.1.
|
||
</div>
|
||
</body>
|
||
</html> |