Skip to content

Spectrum反作弊系统 - 配置文档

📋 目录

📁 配置文件概述

Spectrum反作弊系统使用YAML格式的配置文件,提供了丰富的配置选项,允许服务器管理员根据自己的需求自定义反作弊系统的行为。

配置文件位于服务器的plugins/Spectrum/目录下:

  • config.yml:主配置文件,包含基本设置、数据库配置、通知设置等
  • checks.yml:检测模块配置文件,用于配置各种检测模块的参数
  • messages.yml:消息配置文件,用于自定义插件发送的所有消息
  • punishments.yml:惩罚配置文件,用于配置违规行为的惩罚措施
  • compatibility.yml:兼容性配置文件,用于配置与其他插件的兼容性设置

⚙️ 主配置文件 (config.yml)

主配置文件包含Spectrum的基本设置和全局配置选项。

基本设置

yaml
# 基本设置
settings:
  # 语言设置 (可用: en, zh_CN, ru, es, fr, de)
  language: zh_CN
  # 是否启用调试模式
  debug: false
  # 是否自动更新
  auto-update: true
  # 性能设置 (低, 中, 高)
  performance-mode: 
  # 是否启用指标收集
  metrics: true
  # 日志级别 (INFO, WARN, ERROR, DEBUG)
  log-level: INFO
  # 控制台通知开关
  console-notifications: true
  # 最大同时检查数量
  max-concurrent-checks: 100

数据库设置

yaml
# 数据库设置
database:
  # 数据库类型 (sqlite, mysql, mongodb)
  type: sqlite
  # MySQL 设置 (如果使用 MySQL)
  mysql:
    host: localhost
    port: 3306
    database: spectrum
    username: root
    password: password
    ssl: false
    # 连接池设置
    pool:
      max-connections: 10
      min-connections: 2
      max-idle-time: 300
  # SQLite 设置 (如果使用 SQLite)
  sqlite:
    file: spectrum.db
    # 自动清理过期数据(天)
    auto-purge-days: 30
  # MongoDB 设置 (如果使用 MongoDB)
  mongodb:
    connection-string: mongodb://localhost:27017
    database: spectrum
    collection: violations

通知设置

yaml
# 通知设置
notifications:
  # 游戏内通知
  in-game:
    enabled: true
    # 通知前缀
    prefix: "&b[Spectrum] &r"
    # 通知颜色
    color: "&7"
  # Discord 通知
  discord:
    enabled: false
    webhook-url: "https://discord.com/api/webhooks/..."
    # 通知格式
    embed:
      title: "Spectrum 反作弊警报"
      color: 16711680
      footer: "Spectrum 反作弊系统"
    # 通知类型
    notify-types:
      violations: true
      bans: true
      kicks: true
      warnings: true
  # 邮件通知
  email:
    enabled: false
    smtp-host: smtp.example.com
    smtp-port: 587
    username: user@example.com
    password: password
    recipient: admin@example.com
    use-tls: true
    # 邮件模板
    template:
      subject: "[Spectrum] 作弊警报 - {player}"
      body: "玩家 {player} 因 {violation} 被检测到作弊行为。"

性能设置

yaml
# 性能设置
performance:
  # 检查间隔(刻)
  check-interval: 1
  # 违规衰减率(每分钟)
  violation-decay: 0.5
  # TPS自适应阈值
  tps-threshold: 18.0
  # 高负载时降低检测频率
  reduce-checks-on-high-load: true
  # 内存缓存大小
  cache-size: 1000
  # 异步处理数据包
  async-packet-processing: true
  # 玩家数据清理间隔(分钟)
  data-cleanup-interval: 15

🔍 检测配置文件 (checks.yml)

检测配置文件用于配置Spectrum的各种检测模块。每个检测模块都可以独立启用/禁用,并可以调整其参数。

全局检测设置

yaml
# 全局设置
global:
  # 全局启用/禁用所有检查
  enabled: true
  # 全局检查间隔 (刻)
  check-interval: 1
  # 全局违规衰减率 (每分钟)
  violation-decay: 0.5
  # 忽略具有特定权限的玩家
  ignore-permission: spectrum.bypass
  # 检测延迟(玩家加入后多少秒开始检测)
  detection-delay: 10

移动检测配置

yaml
# 移动检测
movement:
  # 飞行检测
  flight:
    enabled: true
    # 检测灵敏度 (1-10)
    sensitivity: 5
    # 违规阈值
    threshold: 10
    # 惩罚级别
    punishment-level: 2
    # 特殊设置
    settings:
      # 考虑鞘翅
      check-elytra: true
      # 考虑药水效果
      check-potions: true
      # 考虑创造模式
      ignore-creative: true
      # 考虑旁观者模式
      ignore-spectator: true
      # 考虑特殊权限
      ignore-permission: spectrum.bypass.movement
  
  # 速度检测
  speed:
    enabled: true
    sensitivity: 6
    threshold: 15
    punishment-level: 2
    settings:
      check-ice: true
      check-soul-speed: true
      check-depth-strider: true
      check-potions: true
      ignore-creative: true
      ignore-spectator: true
  
  # 无坠落伤害检测
  nofall:
    enabled: true
    sensitivity: 7
    threshold: 8
    punishment-level: 2
    settings:
      check-water: true
      check-cobwebs: true
      check-vine: true
      check-slime-block: true
  
  # 其他移动检测配置...

战斗检测配置

yaml
# 战斗检测
combat:
  # 杀戮光环检测
  killaura:
    enabled: true
    sensitivity: 7
    threshold: 8
    punishment-level: 3
    settings:
      check-rotation: true
      check-accuracy: true
      check-pattern: true
      check-reach: true
      # 考虑连点器
      check-autoclicker: true
  
  # 攻击距离检测
  reach:
    enabled: true
    sensitivity: 6
    threshold: 10
    punishment-level: 2
    settings:
      max-reach: 3.1
      check-ping: true
      ping-compensation: true
      # 考虑延迟
      lag-compensation: true
  
  # 强制暴击检测
  criticals:
    enabled: true
    sensitivity: 5
    threshold: 12
    punishment-level: 2
    settings:
      check-ground: true
      check-jump: true
      check-velocity: true
  
  # 其他战斗检测配置...

数据包检测配置

yaml
# 数据包检测
packets:
  # 异常数据包检测
  badpackets:
    enabled: true
    sensitivity: 8
    threshold: 5
    punishment-level: 3
    settings:
      check-invalid-packets: true
      check-duplicate-packets: true
      check-out-of-order: true
      max-packet-rate: 100
  
  # 快速使用检测
  fastuse:
    enabled: true
    sensitivity: 6
    threshold: 15
    punishment-level: 2
    settings:
      max-use-rate: 10
      check-items: true
      check-bow: true
      check-eating: true
  
  # 其他数据包检测配置...

💬 消息配置文件 (messages.yml)

消息配置文件用于自定义Spectrum发送的所有消息。Spectrum支持多语言,可以通过修改此文件来添加或修改语言。

消息格式

yaml
# 消息配置
messages:
  # 前缀
  prefix: "&b[Spectrum] &r"
  # 成功消息
  success: "&a成功!"
  # 错误消息
  error: "&c错误!"
  # 警告消息
  warning: "&e警告!"
  # 信息消息
  info: "&7信息:"
  
  # 命令消息
  commands:
    help: "&b==== 命令帮助 ====\n&7/spectrum help - 显示此帮助\n&7/spectrum reload - 重新加载配置..."
    reload: "&a配置已成功重新加载!"
    check: "&7玩家 {player} 的违规记录: {violations}"
    ban: "&c玩家 {player} 已被封禁!"
    tempban: "&c玩家 {player} 已被临时封禁 {duration}!"
    kick: "&c玩家 {player} 已被踢出!"
    warn: "&e玩家 {player} 已被警告: {reason}"
    # 更多命令消息...
  
  # 惩罚消息
  punishments:
    warn: "&c请不要使用作弊客户端!"
    kick: "&c检测到作弊行为,请不要使用作弊客户端!"
    tempban: "&c因使用作弊客户端被临时封禁 {duration}"
    ban: "&c因多次使用作弊客户端被永久封禁"
    # 更多惩罚消息...
  
  # 通知消息
  notifications:
    violation: "&c[{check}] &7玩家 {player} 触发了违规 (VL: {vl})"
    ban: "&c[{check}] &7玩家 {player} 因多次违规被封禁"
    tempban: "&c[{check}] &7玩家 {player} 因违规被临时封禁 {duration}"
    kick: "&c[{check}] &7玩家 {player} 因违规被踢出"
    # 更多通知消息...

⚖️ 惩罚配置文件 (punishments.yml)

惩罚配置文件用于配置Spectrum的惩罚系统,包括自动惩罚和手动惩罚的设置。

自动惩罚设置

yaml
# 自动惩罚
auto-punish:
  enabled: true
  # 惩罚等级
  levels:
    1:
      violations: 5
      action: warn
      message: "&c请不要使用作弊客户端!"
    2:
      violations: 10
      action: kick
      message: "&c检测到作弊行为,请不要使用作弊客户端!"
    3:
      violations: 20
      action: tempban
      duration: 1d
      message: "&c因使用作弊客户端被临时封禁1天"
    4:
      violations: 30
      action: ban
      message: "&c因多次使用作弊客户端被永久封禁"
  
  # 特定检测的惩罚设置
  check-specific:
    movement.flight:
      enabled: true
      violations: 15
      action: tempban
      duration: 12h
      message: "&c因使用飞行作弊被临时封禁12小时"
    combat.killaura:
      enabled: true
      violations: 10
      action: ban
      message: "&c因使用杀戮光环作弊被永久封禁"
    # 更多特定检测的惩罚设置...

惩罚类型

Spectrum支持以下惩罚类型:

  • warn:警告玩家
  • kick:踢出玩家
  • tempban:临时封禁玩家(需要指定duration参数)
  • ban:永久封禁玩家
  • mute:禁言玩家
  • command:执行自定义命令(需要指定command参数)

🤝 兼容性配置文件 (compatibility.yml)

兼容性配置文件用于配置Spectrum与其他插件的兼容性设置。

插件兼容性

yaml
# 其他反作弊插件兼容
other-anticheat:
  # 列出其他反作弊插件的名称,Spectrum将自动调整以避免冲突
  - "AAC"
  - "Spartan"
  - "Matrix"
  
# 特殊插件兼容
special-plugins:
  # 基岩版兼容
  geyser:
    enabled: true
    # 基岩版玩家的特殊设置
    settings:
      reduce-checks: true
      ignore-reach: true
      ignore-movement: false
  
  # 多版本兼容
  viaversion:
    enabled: true
    # 旧版本玩家的特殊设置
    settings:
      ping-compensation: true
      reduce-checks: false
  
  # 其他特殊插件的兼容性设置...

服务器特性兼容

yaml
# 服务器特性兼容
server-features:
  # 1.8+ 版本特性
  modern-features:
    enabled: true
    # 鞘翅飞行兼容
    elytra:
      enabled: true
      check-speed: true
      check-fly: false
    # 三叉戟兼容
    trident:
      enabled: true
      check-throw: true
    # 其他现代特性兼容...
  
  # 旧版本特性兼容
  legacy-features:
    enabled: true
    # 1.8以下版本的特殊设置
    settings:
      reduce-checks: true
      adjust-reach: true
  
  # 自定义服务器特性
  custom-features:
    # 自定义物品或机制的兼容设置
    custom-items:
      enabled: false
      list: []
    custom-mechanics:
      enabled: false
      # 自定义机制的特殊设置

💡 高级配置技巧

配置优化建议

  1. 根据服务器类型调整配置

    • PvP服务器:提高战斗检测的灵敏度
    • 生存服务器:重点关注Xray、Nuker等破坏类作弊
    • 创造服务器:可以适当降低移动检测的灵敏度
  2. 性能优化

    • 高延迟服务器:启用ping-compensation和lag-compensation
    • 低配置服务器:降低检测频率,选择"低"性能模式
    • 大型服务器:考虑使用MySQL或MongoDB数据库
  3. 减少误报

    • 为管理员和测试玩家设置白名单
    • 对高延迟地区的玩家调整检测阈值
    • 启用机器学习模式,让系统学习正常玩家行为

配置备份和恢复

  • 定期备份配置文件,特别是在更新插件之前
  • 使用版本控制系统管理配置文件的变更
  • 在测试新配置时,可以创建多个配置文件版本进行对比

📝 配置示例

PvP服务器推荐配置

yaml
# config.yml
settings:
  performance-mode: 
  debug: false

database:
  type: mysql
  mysql:
    host: localhost
    port: 3306
    database: spectrum
    username: root
    password: password

# checks.yml
combat:
  killaura:
    enabled: true
    sensitivity: 8
    threshold: 6
  reach:
    enabled: true
    sensitivity: 7
    threshold: 8
  autoclicker:
    enabled: true
    sensitivity: 8
    threshold: 10

生存服务器推荐配置

yaml
# config.yml
settings:
  performance-mode: 
  debug: false

# checks.yml
vision:
  xray:
    enabled: true
    sensitivity: 9
    threshold: 5
  esp:
    enabled: true
    sensitivity: 7
    threshold: 8

environment:
  nuker:
    enabled: true
    sensitivity: 9
    threshold: 5

❓ 配置常见问题

Q: 如何快速找到特定配置项? A: 使用文本编辑器的搜索功能,输入关键词来定位特定配置项。

Q: 配置修改后没有生效怎么办? A: 使用/spectrum reload命令重新加载配置文件,或者重启服务器。

Q: 如何恢复默认配置? A: 删除对应的配置文件,然后重启服务器,Spectrum会自动生成默认配置文件。


最后更新时间:2025年10月2日