GigaProtect
聊天过滤器、命令拦截器以及一个自动禁言和封禁的积分系统。能够识别“Leet Speak”(数字/符号替代字母)和带重音的拼写变体,并采用整词匹配模式,确保不会误伤无辜玩家。
附带惩罚阶梯功能的聊天过滤器。
过滤器
文本在匹配前会进行标准化处理:sh1t 会被 shit 这一条目捕获,带重音的拼写也会被对应的普通条目捕获。标准化过程保持文本长度不变,因此匹配结果仍能准确指向玩家实际输入的字符位置,且屏蔽后的文本对齐正确。
默认情况下按整词进行匹配。请保持开启状态。如果关闭此选项,输入 ass 也会误伤 class 和 passage 等词。
过滤条目来源于配置文件、custom-words.txt 文件以及通过 HTTP 获取的词列表。支持正则表达式。每个条目都可以拥有独立的权重值。
积分系统
每次违规命中都会增加积分。当总积分超过阈值时触发相应阶段:警告、限时禁言、封禁。积分会随时间衰减,因此旧的违规行为最终不再计入。
每个阶段还可以执行控制台命令,如果您已经使用了喜欢的惩罚插件,这提供了一个便捷的扩展方式。
命令
/gp 及其子命令:info、history、mute、unmute、resetpoints、addword、test、stats、update 和 reload。/gp mute 接受以秒为单位的纯数字,例如 /gp mute Steve 1800 spam。/gp test <text> 会将消息通过过滤器运行,并打印出预期会发生的情况。
/chatguard 和 /cg 是别名。
命令拦截
包含黑名单和白名单,两者均可从远程列表加载数据。带有命名空间的命令(如 minecraft:op)可以通过 op 这一条目进行拦截。
其他特性
- 可选的 Discord Webhook,每个阶段独立发送,始终在主线程之外异步执行
- 游戏内工作人员通知
- 支持 SQLite 或 MySQL
- 基于 Spigot API 开发,兼容 Spigot、Paper 以及 Folia
- PlaceholderAPI(可选):
%gigaprotect_points%、%gigaprotect_stage%、%gigaprotect_muted%、%gigaprotect_mute_remaining%
积分和禁言状态会在服务器关闭时同步写入,以确保停止服务时不会丢失最近的几次违规记录。
构建
需要 JDK 21 和 Maven。
mvn clean package
生成的 jar 包位于 target/GigaProtect-2.0.0.jar。
链接
许可证
GPL-3.0-only。请参阅 LICENSE。
GigaProtect
Chat filter, command blocker and a points system that mutes and bans by itself. Catches leet speak and accented spellings, and matches whole words so an entry never punishes an innocent one.
A chat filter with a punishment ladder attached.
The filter
Text is normalised before it is matched: sh1t is caught by an entry of shit, and an accented spelling is caught by the plain entry. Normalisation keeps the text the same length, so a match still points at the right characters in what the player actually typed and the censored version lines up.
Matching is on whole words by default. Leave that on. With it off, an entry of ass also punishes class and passage.
Entries come from the configuration, from custom-words.txt, and from word lists fetched over HTTP. Regular expressions are supported. Every entry can carry its own weight.
The points system
Each match adds points. Stages fire as the total crosses their threshold: warn, mute for a set time, ban. Points decay over time, so an old violation stops counting.
Every stage can also run console commands, which is the escape hatch if you already have a punishment plugin you like.
Commands
/gp with the subcommands info, history, mute, unmute, resetpoints, addword, test, stats, update and reload. /gp mute takes a plain number of seconds, as in /gp mute Steve 1800 spam. /gp test <text> runs a message through the filter and prints what would have happened.
/chatguard and /cg are aliases.
Command blocking
A block list and an allow list, both able to pull from remote lists. A namespaced command such as minecraft:op is caught by an entry of op.
Also
- Optional Discord webhook per stage, always sent off the main thread
- Staff notifications in game
- SQLite or MySQL
- Written against the Spigot API, so it runs on Spigot as well as Paper, and on Folia
- PlaceholderAPI (optional):
%gigaprotect_points%, %gigaprotect_stage%, %gigaprotect_muted%, %gigaprotect_mute_remaining%
Points and mutes are written synchronously on shutdown, so a stop does not lose the last few violations.
Building
Requires JDK 21 and Maven.
mvn clean package
The jar is written to target/GigaProtect-2.0.0.jar.
Links
License
GPL-3.0-only. See LICENSE.
评论 0
登录后参与评分
还没有评论,来抢沙发吧