fix: applyPunishment 通知逻辑按 chat.txt 配置的 通知管理员/全服通报 开关执行
Auto Release / build (push) Successful in 31s
Auto Release / build (push) Successful in 31s
This commit is contained in:
@@ -1092,32 +1092,32 @@ public class ChatFilterManager {
|
||||
}
|
||||
break;
|
||||
}
|
||||
// 非 warn → 通知在线管理员
|
||||
// 非 warn → 按配置通知
|
||||
if (!"warn".equals(fType)) {
|
||||
String adminMsg = "§c[聊天监控] §f玩家 "
|
||||
+ fName + " 因" + fReason
|
||||
String punishInfo = "玩家 " + fName
|
||||
+ " 因" + fReason
|
||||
+ "被" + fIssuer + "处罚:"
|
||||
+ fType;
|
||||
if ("mute".equals(fType))
|
||||
adminMsg += " " + durStr;
|
||||
for (Player op :
|
||||
Bukkit.getOnlinePlayers()) {
|
||||
if (op.hasPermission(
|
||||
"sdf1.admin")
|
||||
|| op.isOp()) {
|
||||
op.sendMessage(adminMsg);
|
||||
punishInfo += " " + durStr;
|
||||
// 通知管理员(插件 tag 管理员/OP)
|
||||
if (notifyAdmin) {
|
||||
String adminMsg = "§c[聊天监控] §f"
|
||||
+ punishInfo;
|
||||
for (Player op :
|
||||
Bukkit.getOnlinePlayers()) {
|
||||
if (op.hasPermission(
|
||||
"sdf1.admin")
|
||||
|| op.isOp()) {
|
||||
op.sendMessage(adminMsg);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
// kick/ban/banip → 全服公告
|
||||
if (fType.equals("kick")
|
||||
|| fType.equals("ban")
|
||||
|| fType.equals("banip")) {
|
||||
Bukkit.broadcastMessage(
|
||||
"§c[公告] §f玩家 " + fName
|
||||
+ " 因" + fReason
|
||||
+ "被" + fIssuer
|
||||
+ "处罚");
|
||||
// 全服公告
|
||||
if (notifyAll) {
|
||||
Bukkit.broadcastMessage(
|
||||
"§c[公告] §f" + punishInfo);
|
||||
}
|
||||
}
|
||||
});
|
||||
return type;
|
||||
|
||||
@@ -3428,32 +3428,6 @@ public class Main extends JavaPlugin
|
||||
"chat_url_violation",
|
||||
"count", String.valueOf(count)));
|
||||
|
||||
// 通知管理员
|
||||
if (chatFilter.isNotifyAdmin()) {
|
||||
String notify = chatFilter.msg(
|
||||
"chat_url_admin_notify",
|
||||
"player", p.getName(),
|
||||
"url", blocked.get(0),
|
||||
"count", String.valueOf(count));
|
||||
for (Player op :
|
||||
Bukkit.getOnlinePlayers()) {
|
||||
if (op.hasPermission(
|
||||
"sdf1.admin")
|
||||
|| op.isOp()) {
|
||||
op.sendMessage(notify);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// 通报
|
||||
if (chatFilter.isNotifyAll()) {
|
||||
Bukkit.broadcastMessage(
|
||||
chatFilter.msg(
|
||||
"chat_url_broadcast",
|
||||
"player",
|
||||
p.getName()));
|
||||
}
|
||||
|
||||
// 处罚
|
||||
chatFilter.applyPunishment(p, count,
|
||||
"发送违规链接", "系统");
|
||||
|
||||
Reference in New Issue
Block a user