evennia.contrib.base_systems.ingame_reports.reports

In-Game Reporting System

This contrib provides an in-game reporting system, with player-facing commands and a staff management interface.

Installation

To install, just add the provided cmdset to your default AccountCmdSet:

# in commands/default_cmdset.py

from evennia.contrib.base_systems.ingame_reports import ReportsCmdSet

class AccountCmdSet(default_cmds.AccountCmdSet):

# …

def at_cmdset_creation(self):

# … self.add(ReportsCmdSet)

Features

The contrib provides three commands by default and their associated report types: CmdBug, CmdIdea, and CmdReport (which is for reporting other players).

The ReportCmdBase class holds most of the functionality for creating new reports, providing a convenient parent class for adding your own categories of reports.

The contrib can be further configured through two settings, INGAME_REPORT_TYPES and INGAME_REPORT_STATUS_TAGS

class evennia.contrib.base_systems.ingame_reports.reports.CmdManageReports(**kwargs)[源代码]

基类:evennia.commands.default.muxcommand.MuxCommand

manage the various reports

Usage:

manage [report type]

Available report types:

bugs ideas players

Initializes a menu for reviewing and changing the status of current reports.

key = 'manage reports'
aliases = ['manage ideas', 'manage players', 'manage bugs']
locks = 'cmd:pperm(Admin)'
get_help(caller, cmdset)[源代码]

Returns a help string containing the configured available report types

func()[源代码]

This is the hook function that actually does all the work. It is called by the cmdhandler right after self.parser() finishes, and so has access to all the variables defined therein.

help_category = 'general'
lock_storage = 'cmd:pperm(Admin)'
search_index_entry = {'aliases': 'manage ideas manage players manage bugs', 'category': 'general', 'key': 'manage reports', 'no_prefix': ' manage ideas manage players manage bugs', 'tags': '', 'text': '\n manage the various reports\n\n Usage:\n manage [report type]\n\n Available report types:\n bugs\n ideas\n players\n\n Initializes a menu for reviewing and changing the status of current reports.\n '}
class evennia.contrib.base_systems.ingame_reports.reports.ReportCmdBase(**kwargs)[源代码]

基类:evennia.commands.default.muxcommand.MuxCommand

A parent class for creating report commands. This help text may be displayed if your command’s help text is not properly configured.

help_category = 'reports'
report_locks = 'read:pperm(Admin)'
require_target = False
success_msg = 'Your report has been filed.'
report_type = None
at_pre_cmd()[源代码]

validate that the needed hub script exists - if not, cancel the command

parse()[源代码]

Parse the target and message out of the arguments.

Override if you want different syntax, but make sure to assign report_message and target_str.

Search for a target that matches the given search term. By default, does a normal search via the caller - a local object search for a Character, or an account search for an Account.

参数

searchterm (str) –

返回

result (Object, Account, or None) - the result of the search

create_report(*args, **kwargs)[源代码]

Creates the report. By default, this creates a Msg with any provided args and kwargs.

返回

success (bool) - True if the report was created successfully, or False if there was an issue.

func()[源代码]

This is the hook function that actually does all the work. It is called by the cmdhandler right after self.parser() finishes, and so has access to all the variables defined therein.

aliases = []
key = 'command'
lock_storage = 'cmd:all();'
search_index_entry = {'aliases': '', 'category': 'reports', 'key': 'command', 'no_prefix': ' ', 'tags': '', 'text': "\n A parent class for creating report commands. This help text may be displayed if\n your command's help text is not properly configured.\n "}
class evennia.contrib.base_systems.ingame_reports.reports.CmdBug(**kwargs)[源代码]

基类:evennia.contrib.base_systems.ingame_reports.reports.ReportCmdBase

file a bug

Usage:

bug [<target> =] <message>

Note: If a specific object, location or character is bugged, please target it for the report.

实际案例

bug hammer = This doesn’t work as a crafting tool but it should bug every time I go through a door I get the message twice

key = 'bug'
report_locks = 'read:pperm(Developer)'
aliases = []
help_category = 'reports'
lock_storage = 'cmd:all();'
search_index_entry = {'aliases': '', 'category': 'reports', 'key': 'bug', 'no_prefix': ' ', 'tags': '', 'text': "\n file a bug\n\n Usage:\n bug [<target> =] <message>\n\n Note: If a specific object, location or character is bugged, please target it for the report.\n\n Examples:\n bug hammer = This doesn't work as a crafting tool but it should\n bug every time I go through a door I get the message twice\n "}
class evennia.contrib.base_systems.ingame_reports.reports.CmdReport(**kwargs)[源代码]

基类:evennia.contrib.base_systems.ingame_reports.reports.ReportCmdBase

report a player

Usage:

report <player> = <message>

All player reports will be reviewed.

key = 'report'
report_type = 'player'
require_target = True
account_caller = True
aliases = []
help_category = 'reports'
lock_storage = 'cmd:all();'
search_index_entry = {'aliases': '', 'category': 'reports', 'key': 'report', 'no_prefix': ' ', 'tags': '', 'text': '\n report a player\n\n Usage:\n report <player> = <message>\n\n All player reports will be reviewed.\n '}
class evennia.contrib.base_systems.ingame_reports.reports.CmdIdea(**kwargs)[源代码]

基类:evennia.contrib.base_systems.ingame_reports.reports.ReportCmdBase

submit a suggestion

Usage:

ideas idea <message>

示例

idea wouldn’t it be cool if we had horses we could ride

key = 'idea'
aliases = ['ideas']
report_locks = 'read:pperm(Builder)'
success_msg = 'Thank you for your suggestion!'
func()[源代码]

This is the hook function that actually does all the work. It is called by the cmdhandler right after self.parser() finishes, and so has access to all the variables defined therein.

help_category = 'reports'
lock_storage = 'cmd:all();'
search_index_entry = {'aliases': 'ideas', 'category': 'reports', 'key': 'idea', 'no_prefix': ' ideas', 'tags': '', 'text': "\n submit a suggestion\n\n Usage:\n ideas\n idea <message>\n\n Example:\n idea wouldn't it be cool if we had horses we could ride\n "}
class evennia.contrib.base_systems.ingame_reports.reports.ReportsCmdSet(cmdsetobj=None, key=None)[源代码]

基类:evennia.commands.cmdset.CmdSet

key = 'Reports CmdSet'
at_cmdset_creation()[源代码]

Hook method - this should be overloaded in the inheriting class, and should take care of populating the cmdset by use of self.add().

path = 'evennia.contrib.base_systems.ingame_reports.reports.ReportsCmdSet'