YASF: Yet Another Swearing Filter
YASF 是又一款脏话过滤插件,它内置了高级的“智能过滤器”,并支持创建自定义过滤器。YASF 还允许你选择在检测到违规行为时采取哪些操作(踢出、杀死、燃烧、封禁、取消管理员权限、向玩家发送消息,以及/或执行任意数量的自定义服务器命令)。
功能特性
- 高级“智能过滤器”(见下文),以及用户定义的 RegEx(正则表达式)过滤器;
- 拦截包含脏话的命令(通过可自定义的服务器列表);
- 在发生违规时应用各种操作(踢出、杀死、燃烧、封禁、取消管理员权限、发送消息,以及/或运行自定义服务器命令);
- 可选择封禁收到过多脏话违规行为的玩家(可配置),或应用一组自定义操作和命令;
- 如果玩家名称中包含已定义的脏话之一,可选择禁止其加入服务器(可配置;如果启用了此功能,您还可以提供一个排除检查的玩家名单);
- 能够将您自己的自定义词汇(规则)添加到列表中(使用正则表达式)。
目前有十一种内置的智能过滤器可供选择(您也可以定义自己的自定义过滤器;默认的 "filters.yml" 文件中包含十几个自定义过滤词汇,既作为示例,也作为额外的过滤词),这些过滤器不仅针对单词本身,还针对该单词的多种变体进行过滤。所有过滤器(自定义和内置)均不区分大小写,并自动考虑带重音字符的情况。
例如:
- 单词 "Duck" 可能会过滤:duck, duk, dvck, d*u*c*k, d uck, dűćķ, d\_/ck, ddddddduuuuuucccckkkkk 等。
- 单词 "Shot" 可能会过滤:shot, sh0t, $hot, s*h*o*t, s h o t;但不会过滤像 it's hot. 这样的短语。
- 单词 "All":可能会过滤:all, allhole ;-) 但不会过滤 call, ball, alloy 等单词。
- 同样,对于既可能是人名也可能是侮辱性词语的词(即 Dick),内置的智能过滤器会尝试判断其用法/意图并进行相应过滤。注意:由于包含此名称/词语的一些句子可能被解释为两种含义,在某些情况下,该过滤器可能无法正确识别负面用法(如果您希望对此情况采用更严格的过滤,可以定义自己的自定义过滤器)。
您还可以选择为任何一组词汇分配多少扣分(例如,更严重的词汇比不太贬义的词汇获得更多扣分)。
命令
- /yasf - 打印出用户当前的违规扣分数量。
- /yasf test <phrase> - [仅限管理员控制台] 允许您测试单词/短语是否匹配当前运行的脏话过滤器。
- /yasf player <playerName> - [仅限管理员控制台] 查询给定玩家当前的扣分数量。
- /yasf setplayer <playerName> <demeritCount> - [仅限管理员控制台] 设置给定玩家的扣分数量。
- /yasf reload - [仅限管理员控制台] 重新加载插件以及所有配置和规则更改。
配置
请参阅(编辑)filters.yml 文件以获取有关配置您自己的规则和过滤器的说明(默认设置对许多人来说已经足够)。
警告:"filters.yml" 文件包含冒犯性语言,因为所有需要过滤的脏话都在那里进行了配置。
安装方法
- 将 .jar 文件拖放到您的 plugins 文件夹中。
- 停止并重新启动服务器,或在服务器运行时 "/reload" 插件。初始过滤器默认值现在生效。
- 根据需要设置 "filters.yml" 文件(定义您自己的过滤器和/或使用内置的),并从服务器控制台键入 "yasf reload"(或使用 "/reload" 重新加载所有插件)以使新设置生效。
注意:要取消因说脏话过多而被自动封禁的玩家的封禁状态,您需要手动编辑 "warnings.yml" 文件。在玩家姓名旁边是他们当前的违规数量。将该数字重置或降低到低于封禁阈值的水平。
示例
默认的 "filters.yml" 文件包含有关如何创建规则、如何使用内置的智能过滤器、如何创建自定义过滤器(利用强大的“正则表达式”)以及如何定义采取的操作(包括定义您自己的自定义操作)的文档和示例。
另请参阅此页面以获取更多信息:Usage-Examples
请报告过滤器中的任何不准确之处,以便尽快更正。谢谢。
注意:此插件会将使用数据发送到 MCStats(参见:)。
YASF: Yet Another Swearing Filter
YASF is yet another swearing filter, which has advanced, built-in "Smart Filters" along with the ability to create your own custom Filters. YASF also allows you to choose which Actions to take when a violation is detected (kick, kill, burn, ban, deop, send a message to the player, and/or any number of custom server actions).
Features
- Advanced "Smart Filters" (see below), along with user-defined RegEx (regular expression) Filters;
- Blocks commands that contain swear words (via a server customizable list);
- Applies various actions when a violation occurs (kick, kill, burn, ban, deop, send message, and/or run custom server commands);
- Optionally bans players that receive too many swearing violations (configurable), or applies a set of custom actions and commands;
- Optionally bans players from joining the server if their name contains one of the defined swear words (configurable; you can also provide a list of players that are excluded from this check if this is enabled);
- Ability to add your own custom words (rules) to the list (using regular expressions).
Currently there are eleven built-in Smart Filters to choose from (you may define your own custom filters as well; a dozen custom filtered words are included in the default "filters.yml" file, both as examples and as additional words to filter on), which filter not only on the word itself but also on many variations of that word. All filters (custom and built-in) are case-insensitive and automatically take into account accented characters.
For example:
- the word "Duck" might filter on: duck, duk, dvck, d*u*c*k, d uck, dűćķ, d\_/ck, ddddddduuuuuucccckkkkk, etc.
- the word "Shot" might filter on: shot, sh0t, $hot, s*h*o*t, s h o t; BUT NOT phrases like: it's hot.
- the word "All": might filter on: all, allhole ;-) BUT NOT words like: call, or ball, or alloy.
- similarly, for a word that could be both a person's name and also an offensive word depending on its usage (i.e., Dick), the built-in Smart Filter makes an attempt to determine the usage/intent and filter accordingly. Note: because some sentences with this name/word could be interpreted either way, there are situations where this filter won't correctly identify the negative usage (you can define your own custom filter if you prefer a more strict filter for this case).
You can also choose how many swearing de-merits should be given for any set of words (e.g., more severe words can receive more de-merits than less derogatory words).
Commands
- /yasf - prints out the user's current number of violation demerits.
- /yasf test <phrase> - [admin console only] allows you to test words/phrases against the currently running swear filters.
- /yasf player <playerName> - [admin console only] queries how many de-merits the given player currently has.
- /yasf setplayer <playerName> <demeritCount> - [admin console only] sets the number of de-merits for the given player.
- /yasf reload - [admin console only] reloads the plugin and all configuration and rule changes.
Configuration
See (edit) the filters.yml file for instructions on configuring your own Rules and Filters (the defaults may be fine for many people).
Warning: The "filters.yml" file contains offensive language, as all of the swear words to filter on are configured there.
How to Install
- Drag and drop the .jar file into your plugins folder.
- Stop and restart your server, or "/reload" the plugins while your server is running. The initial filter defaults are now active.
- Set up the "filters.yml" file however you want (define your own filters and/or use the built-in ones), and type "yasf reload" from the server console (or use "/reload" to reload all of the plugins) for the new settings to take effect.
Note: to unban someone that has been automatically banned from the server for too much swearing, you'll need to manually edit the "warnings.yml" file. Beside the players' names are the number of violations they currently have. Reset or lower that number to below the ban-threshold.
Examples
The default "filters.yml" file contains documentation and examples on how to create Rules, how to use the built-in smart filters, how to create your own custom filters (which utilize powerful "regular expressions"), and how to define what Actions to take (including defining your own custom actions).
See also this page for more information: Usage-Examples
Please report any inaccuracies in the filters so that they can be corrected as quickly as possible. Thanks.
Note: this plugin sends usage data to MCStats (see: ).
评论 0
登录后参与评分
还没有评论,来抢沙发吧