Skip to content

配置文件详解文档

📋 目录

🔍 配置文件概述

鍏夎氨Spectrum反作弊插件使用YAML格式的配置文件,所有配置文件都位于plugins/鍏夎氨Spectrum/目录下。配置文件包含以下几个主要部分:

  1. config.yml:主配置文件,包含插件的基本设置
  2. checks.yml:检测配置文件,包含所有检测模块的设置
  3. punishments.yml:惩罚配置文件,包含所有惩罚类型的设置
  4. messages.yml:消息配置文件,包含所有游戏内消息的设置
  5. compatibility.yml:兼容性配置文件,包含与其他插件的兼容设置

YAML配置文件使用缩进表示层级关系,使用冒号表示键值对,使用连字符表示列表项。配置文件修改后,需要使用/鍏夎氨Spectrum reload命令重新加载配置才能生效。

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

主配置文件包含鍏夎氨Spectrum反作弊插件的基本设置,包括语言、调试模式、性能设置等。

基本设置

yaml
# 插件语言设置
default-language: "en_us"  # 支持的语言:en_us, zh_cn, ja_jp, ko_kr, fr_fr, de_de, es_es, ru_ru

# 调试模式开关
debug-mode: false  # 开启后会输出详细的调试信息到控制台

# 性能模式设置
performance-mode: balanced  # 可选值:low, balanced, high

# 自动更新设置
auto-update: true  # 是否自动检查并下载插件更新
notify-updates: true  # 是否通知管理员插件更新

# 后台任务设置
background-tasks:  # 后台任务配置
  enabled: true  # 是否启用后台任务
  interval: 60  # 后台任务执行间隔(秒)

# 日志设置
logging:  # 日志配置
  enabled: true  # 是否启用日志记录
  level: info  # 日志级别:debug, info, warning, error
  file-size: 5  # 日志文件大小限制(MB)
  max-files: 5  # 最大保留日志文件数量

# 开发者模式开关
developer-mode: false  # 仅用于开发测试,请勿在生产环境开启

检测系统设置

yaml
# 检测系统设置
detection:  # 检测系统配置
  enabled: true  # 是否启用检测系统
  check-interval: 50  # 检测间隔(毫秒)
  player-check-throttle: 100  # 玩家检测节流(毫秒)
  max-violations: 30  # 全局最大违规次数
  violation-reset-time: 300  # 违规计数重置时间(秒)
  latency-compensation: true  # 是否启用延迟补偿
  ping-threshold: 200  # 延迟阈值(毫秒)
  performance-variation-tolerance: 0.1  # 性能变化容差(0-1)

# 客户端检测设置
client-detection:  # 客户端检测配置
  enabled: true  # 是否启用客户端检测
  max-packet-rate: 500  # 最大数据包速率(包/秒)
  connection-timeout: 30  # 连接超时时间(秒)
  max-clients-per-ip: 3  # 单IP最大客户端数量

数据库设置

yaml
# 数据库设置
database:  # 数据库配置
  type: sqlite  # 数据库类型:sqlite, mysql, mongodb
  host: "localhost"  # 数据库主机(仅mysql和mongodb需要)
  port: 3306  # 数据库端口(仅mysql和mongodb需要)
  database: "鍏夎氨Spectrum"  # 数据库名称(仅mysql和mongodb需要)
  username: "root"  # 数据库用户名(仅mysql和mongodb需要)
  password: "password"  # 数据库密码(仅mysql和mongodb需要)
  prefix: "鍏夎氨Spectrum_"  # 表前缀(仅mysql需要)
  ssl: false  # 是否启用SSL连接(仅mysql和mongodb需要)
  pool-size: 10  # 连接池大小(仅mysql和mongodb需要)
  timeout: 30  # 数据库操作超时时间(秒)
  cache-size: 1000  # 数据库缓存大小
  save-interval: 60  # 数据保存间隔(秒)

# SQLite特定设置(当type为sqlite时)
sqlite:
  file: "鍏夎氨Spectrum.db"  # SQLite数据库文件名
  synchronous: true  # 是否启用同步模式

# MongoDB特定设置(当type为mongodb时)
mongodb:
  auth-database: "admin"  # 认证数据库名称
  replica-set: ""  # 副本集名称(可选)
  write-concern: "majority"  # 写入关注级别

通知设置

yaml
# 通知设置
notifications:  # 通知配置
  in-game:  # 游戏内通知配置
    enabled: true  # 是否启用游戏内通知
    admin-chat: true  # 是否发送管理员聊天通知
    staff-prefix: "[STAFF]"  # 管理员通知前缀
    violation-alerts: true  # 是否发送违规警告通知
    punishment-alerts: true  # 是否发送惩罚通知
  discord:  # Discord通知配置
    enabled: false  # 是否启用Discord通知
    webhook-url: ""  # Discord Webhook URL
    bot-name: "鍏夎氨Spectrum Anticheat"  # Discord机器人名称
    bot-avatar: ""  # Discord机器人头像URL
    embed-color: 16711680  # 嵌入消息颜色(十进制RGB)
    log-violations: true  # 是否记录违规到Discord
    log-punishments: true  # 是否记录惩罚到Discord
    log-kicks: true  # 是否记录踢出到Discord
    log-bans: true  # 是否记录封禁到Discord

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

检测配置文件包含所有检测模块的详细设置,每个检测模块都有自己的配置部分。

移动检测模块

yaml
# 移动检测模块配置
movement:  # 移动检测配置
  enabled: true  # 是否启用移动检测
  flight:  # 飞行检测
    enabled: true  # 是否启用飞行检测
    threshold: 0.7  # 检测阈值(0-1)
    violation-rate: 1.0  # 违规积累速度
    max-violations: 10  # 最大违规次数
    punishment: "kick"  # 惩罚类型:warning, kick, tempban, ban
  speed:  # 速度检测
    enabled: true  # 是否启用速度检测
    threshold: 0.6  # 检测阈值(0-1)
    violation-rate: 1.0  # 违规积累速度
    max-violations: 10  # 最大违规次数
    punishment: "kick"  # 惩罚类型:warning, kick, tempban, ban
  climb:  # 攀爬检测
    enabled: true  # 是否启用攀爬检测
    threshold: 0.6  # 检测阈值(0-1)
    violation-rate: 1.0  # 违规积累速度
    max-violations: 10  # 最大违规次数
    punishment: "warning"  # 惩罚类型:warning, kick, tempban, ban
  strafe:  # 侧移检测
    enabled: true  # 是否启用侧移检测
    threshold: 0.6  # 检测阈值(0-1)
    violation-rate: 1.0  # 违规积累速度
    max-violations: 10  # 最大违规次数
    punishment: "warning"  # 惩罚类型:warning, kick, tempban, ban
  nofall:  # 无掉落伤害检测
    enabled: true  # 是否启用无掉落伤害检测
    threshold: 0.7  # 检测阈值(0-1)
    violation-rate: 1.0  # 违规积累速度
    max-violations: 10  # 最大违规次数
    punishment: "warning"  # 惩罚类型:warning, kick, tempban, ban
  waterwalk:  # 水上行走检测
    enabled: true  # 是否启用水上行走检测
    threshold: 0.7  # 检测阈值(0-1)
    violation-rate: 1.0  # 违规积累速度
    max-violations: 10  # 最大违规次数
    punishment: "warning"  # 惩罚类型:warning, kick, tempban, ban
  step:  # 台阶检测
    enabled: true  # 是否启用台阶检测
    threshold: 0.6  # 检测阈值(0-1)
    violation-rate: 1.0  # 违规积累速度
    max-violations: 10  # 最大违规次数
    punishment: "warning"  # 惩罚类型:warning, kick, tempban, ban
  glide:  # 滑翔检测
    enabled: true  # 是否启用滑翔检测
    threshold: 0.6  # 检测阈值(0-1)
    violation-rate: 1.0  # 违规积累速度
    max-violations: 10  # 最大违规次数
    punishment: "warning"  # 惩罚类型:warning, kick, tempban, ban
  Jesus:  # 水上行走增强检测
    enabled: true  # 是否启用水上行走增强检测
    threshold: 0.7  # 检测阈值(0-1)
    violation-rate: 1.0  # 违规积累速度
    max-violations: 10  # 最大违规次数
    punishment: "warning"  # 惩罚类型:warning, kick, tempban, ban
  spider:  # 蜘蛛攀爬检测
    enabled: true  # 是否启用蜘蛛攀爬检测
    threshold: 0.6  # 检测阈值(0-1)
    violation-rate: 1.0  # 违规积累速度
    max-violations: 10  # 最大违规次数
    punishment: "warning"  # 惩罚类型:warning, kick, tempban, ban

战斗检测模块

yaml
# 战斗检测模块配置
combat:  # 战斗检测配置
  enabled: true  # 是否启用战斗检测
  killaura:  # 杀戮光环检测
    enabled: true  # 是否启用杀戮光环检测
    threshold: 0.8  # 检测阈值(0-1)
    violation-rate: 1.0  # 违规积累速度
    max-violations: 5  # 最大违规次数
    punishment: "ban"  # 惩罚类型:warning, kick, tempban, ban
  aimbot:  # 自瞄检测
    enabled: true  # 是否启用自瞄检测
    threshold: 0.7  # 检测阈值(0-1)
    violation-rate: 1.0  # 违规积累速度
    max-violations: 5  # 最大违规次数
    punishment: "ban"  # 惩罚类型:warning, kick, tempban, ban
  criticals:  # 暴击检测
    enabled: true  # 是否启用暴击检测
    threshold: 0.6  # 检测阈值(0-1)
    violation-rate: 1.0  # 违规积累速度
    max-violations: 10  # 最大违规次数
    punishment: "warning"  # 惩罚类型:warning, kick, tempban, ban
  reach:  # 攻击距离检测
    enabled: true  # 是否启用攻击距离检测
    threshold: 0.7  # 检测阈值(0-1)
    violation-rate: 1.0  # 违规积累速度
    max-violations: 5  # 最大违规次数
    punishment: "kick"  # 惩罚类型:warning, kick, tempban, ban
  hitbox:  # 碰撞箱检测
    enabled: true  # 是否启用碰撞箱检测
    threshold: 0.7  # 检测阈值(0-1)
    violation-rate: 1.0  # 违规积累速度
    max-violations: 5  # 最大违规次数
    punishment: "ban"  # 惩罚类型:warning, kick, tempban, ban
  velocity:  # 击退检测
    enabled: true  # 是否启用击退检测
    threshold: 0.6  # 检测阈值(0-1)
    violation-rate: 1.0  # 违规积累速度
    max-violations: 10  # 最大违规次数
    punishment: "warning"  # 惩罚类型:warning, kick, tempban, ban
  autoblock:  # 自动格挡检测
    enabled: true  # 是否启用自动格挡检测
    threshold: 0.6  # 检测阈值(0-1)
    violation-rate: 1.0  # 违规积累速度
    max-violations: 10  # 最大违规次数
    punishment: "warning"  # 惩罚类型:warning, kick, tempban, ban
  rapidfire:  # 快速射击检测
    enabled: true  # 是否启用快速射击检测
    threshold: 0.6  # 检测阈值(0-1)
    violation-rate: 1.0  # 违规积累速度
    max-violations: 10  # 最大违规次数
    punishment: "warning"  # 惩罚类型:warning, kick, tempban, ban
  bowaim:  # 弓箭自瞄检测
    enabled: true  # 是否启用弓箭自瞄检测
    threshold: 0.7  # 检测阈值(0-1)
    violation-rate: 1.0  # 违规积累速度
    max-violations: 5  # 最大违规次数
    punishment: "kick"  # 惩罚类型:warning, kick, tempban, ban
  triggerbot:  # 触发bot检测
    enabled: true  # 是否启用触发bot检测
    threshold: 0.7  # 检测阈值(0-1)
    violation-rate: 1.0  # 违规积累速度
    max-violations: 5  # 最大违规次数
    punishment: "ban"  # 惩罚类型:warning, kick, tempban, ban

数据包检测模块

yaml
# 数据包检测模块配置
packets:  # 数据包检测配置
  enabled: true  # 是否启用数据包检测
  packetspoof:  # 数据包伪造检测
    enabled: true  # 是否启用数据包伪造检测
    threshold: 0.8  # 检测阈值(0-1)
    violation-rate: 1.0  # 违规积累速度
    max-violations: 5  # 最大违规次数
    punishment: "ban"  # 惩罚类型:warning, kick, tempban, ban
  packetmod:  # 数据包修改检测
    enabled: true  # 是否启用数据包修改检测
    threshold: 0.7  # 检测阈值(0-1)
    violation-rate: 1.0  # 违规积累速度
    max-violations: 5  # 最大违规次数
    punishment: "ban"  # 惩罚类型:warning, kick, tempban, ban
  packetfly:  # 数据包飞行检测
    enabled: true  # 是否启用数据包飞行检测
    threshold: 0.7  # 检测阈值(0-1)
    violation-rate: 1.0  # 违规积累速度
    max-violations: 5  # 最大违规次数
    punishment: "ban"  # 惩罚类型:warning, kick, tempban, ban
  packetspam:  # 数据包垃圾检测
    enabled: true  # 是否启用数据包垃圾检测
    threshold: 0.6  # 检测阈值(0-1)
    violation-rate: 1.0  # 违规积累速度
    max-violations: 5  # 最大违规次数
    punishment: "kick"  # 惩罚类型:warning, kick, tempban, ban
  invalidpackets:  # 无效数据包检测
    enabled: true  # 是否启用无效数据包检测
    threshold: 0.7  # 检测阈值(0-1)
    violation-rate: 1.0  # 违规积累速度
    max-violations: 5  # 最大违规次数
    punishment: "kick"  # 惩罚类型:warning, kick, tempban, ban
  packetorder:  # 数据包顺序检测
    enabled: true  # 是否启用数据包顺序检测
    threshold: 0.7  # 检测阈值(0-1)
    violation-rate: 1.0  # 违规积累速度
    max-violations: 5  # 最大违规次数
    punishment: "kick"  # 惩罚类型:warning, kick, tempban, ban
  packetdelay:  # 数据包延迟检测
    enabled: true  # 是否启用数据包延迟检测
    threshold: 0.6  # 检测阈值(0-1)
    violation-rate: 1.0  # 违规积累速度
    max-violations: 10  # 最大违规次数
    punishment: "warning"  # 惩罚类型:warning, kick, tempban, ban
  packetresend:  # 数据包重发检测
    enabled: true  # 是否启用数据包重发检测
    threshold: 0.6  # 检测阈值(0-1)
    violation-rate: 1.0  # 违规积累速度
    max-violations: 10  # 最大违规次数
    punishment: "warning"  # 惩罚类型:warning, kick, tempban, ban

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

惩罚配置文件包含所有惩罚类型的详细设置,包括警告、踢出、临时封禁和永久封禁等。

警告设置

yaml
# 警告配置
warning:  # 警告惩罚配置
  enabled: true  # 是否启用警告惩罚
  message: "&c[鍏夎氨Spectrum] 警告: 检测到作弊行为,请立即停止!"
  sound: "block.note_block.bass"
  title: "&c⚠️ 作弊警告"
  subtitle: "检测到作弊行为"
  broadcast: false  # 是否广播警告信息
  log: true  # 是否记录警告日志

踢出设置

yaml
# 踢出配置
kick:  # 踢出惩罚配置
  enabled: true  # 是否启用踢出惩罚
  message: "&c[鍏夎氨Spectrum] 你因使用作弊被踢出服务器!"
  broadcast: true  # 是否广播踢出信息
  log: true  # 是否记录踢出日志
  banip: false  # 是否同时封禁IP

临时封禁设置

yaml
# 临时封禁配置
tempban:  # 临时封禁惩罚配置
  enabled: true  # 是否启用临时封禁惩罚
  message: "&c[鍏夎氨Spectrum] 你因使用作弊被临时封禁 {duration}!"
  broadcast: true  # 是否广播临时封禁信息
  log: true  # 是否记录临时封禁日志
  banip: true  # 是否同时封禁IP
  default-duration: "1d"  # 默认临时封禁时长(如1d, 2h, 30m等)
  duration-multiplier: 1.5  # 重复违规时的时长乘数

永久封禁设置

yaml
# 永久封禁配置
ban:  # 永久封禁惩罚配置
  enabled: true  # 是否启用永久封禁惩罚
  message: "&c[鍏夎氨Spectrum] 你因使用作弊被永久封禁!"
  broadcast: true  # 是否广播永久封禁信息
  log: true  # 是否记录永久封禁日志
  banip: true  # 是否同时封禁IP
  reason: "使用作弊程序"

自动惩罚设置

yaml
# 自动惩罚配置
auto-punish:  # 自动惩罚配置
  enabled: true  # 是否启用自动惩罚
  warning-count: 3  # 警告次数达到此值后执行更严厉的惩罚
  kick-count: 2  # 踢出次数达到此值后执行更严厉的惩罚
  tempban-count: 1  # 临时封禁次数达到此值后执行更严厉的惩罚
  progression: "warning->kick->tempban->ban"  # 惩罚递进顺序
  reset-time: 604800  # 惩罚计数重置时间(秒),默认为7天

惩罚记录设置

yaml
# 惩罚记录配置
punishment-logging:  # 惩罚记录配置
  enabled: true  # 是否启用惩罚记录
  include-reason: true  # 是否包含惩罚原因
  include-evidence: true  # 是否包含惩罚证据
  include-staff: true  # 是否包含执行惩罚的管理员
  include-date: true  # 是否包含惩罚日期和时间
  database-storage: true  # 是否存储到数据库
  file-storage: true  # 是否存储到文件
  file-path: "punishments.log"  # 惩罚日志文件路径

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

消息配置文件包含所有游戏内消息的设置,包括通知消息、错误消息、状态消息等。

通知消息

yaml
# 通知消息
notifications:  # 通知消息配置
  prefix: "&b[鍏夎氨Spectrum] "
  success: "&a操作成功!"
  error: "&c操作失败!"
  warning: "&e警告: {message}"
  info: "&6信息: {message}"
  no-permission: "&c你没有权限执行此操作!"
  player-not-found: "&c找不到该玩家!"
  config-reloaded: "&a配置文件已重新加载!"
  detection-started: "&a反作弊检测系统已启动!"
  detection-stopped: "&c反作弊检测系统已停止!"
  detection-restarted: "&a反作弊检测系统已重启!"

检测消息

yaml
# 检测消息
detections:  # 检测消息配置
  violation: "&c检测到 {player} 的作弊行为: {type} (置信度: {confidence}%)"
  warning: "&e[鍏夎氨Spectrum] 警告: 检测到 {type} 作弊行为,请立即停止!"
  kick: "&c[鍏夎氨Spectrum] 你因 {type} 作弊被踢出服务器!"
  tempban: "&c[鍏夎氨Spectrum] 你因 {type} 作弊被临时封禁 {duration}!"
  ban: "&c[鍏夎氨Spectrum] 你因 {type} 作弊被永久封禁!"
  staff-alert: "&4[ALERT] {player} 被检测到 {type} 作弊 (置信度: {confidence}%)"
  debug-info: "&7[DEBUG] {module}: {info}"

命令消息

yaml
# 命令消息
commands:  # 命令消息配置
  help-header: "&b===== &6鍏夎氨Spectrum 命令帮助 &b====="
  help-footer: "&b====================="
  help-entry: "&e/{command} &7- &f{description}"
  status-header: "&b===== &6鍏夎氨Spectrum 状态信息 &b====="
  status-version: "&7版本: &f{version}"
  status-detection: "&7检测状态: &f{status}"
  status-players: "&7在线玩家: &f{count}"
  about-header: "&b===== &6关于 鍏夎氨Spectrum &b====="
  about-developer: "&7开发者: &fStarLakeStudio"
  about-website: "&7官方网站: &fhttps://starlakestudio.com"
  about-discord: "&7Discord: &fhttps://discord.gg/starlakestudio"
  about-license: "&7许可证: &fGPL-3.0"

数据库消息

yaml
# 数据库消息
database:  # 数据库消息配置
  connected: "&a数据库连接成功!"
  connection-error: "&c数据库连接失败: {error}"
  query-success: "&a数据库查询成功!"
  query-error: "&c数据库查询失败: {error}"
  save-success: "&a数据保存成功!"
  save-error: "&c数据保存失败: {error}"

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

兼容性配置文件包含与其他插件的兼容设置,用于避免插件之间的冲突。

插件兼容性

yaml
# 插件兼容性
plugins:  # 插件兼容配置
  # 常用插件的兼容设置
  Essentials:  # Essentials插件兼容配置
    enabled: true  # 是否启用兼容
    ignore-commands: true  # 是否忽略Essentials命令
    ignore-fly: true  # 是否忽略Essentials飞行权限
    ignore-vanish: true  # 是否忽略Essentials隐身功能
  WorldEdit:  # WorldEdit插件兼容配置
    enabled: true  # 是否启用兼容
    ignore-fastbreak: true  # 是否忽略WorldEdit快速破坏
    ignore-fastplace: true  # 是否忽略WorldEdit快速放置
    ignore-nuker: true  # 是否忽略WorldEdit区域破坏
  WorldGuard:  # WorldGuard插件兼容配置
    enabled: true  # 是否启用兼容
    ignore-regions: []  # 忽略检测的区域列表
    bypass-regions: []  # 允许绕过检测的区域列表
  Vault:  # Vault插件兼容配置
    enabled: true  # 是否启用兼容
    use-economy: true  # 是否使用经济系统
  LuckPerms:  # LuckPerms插件兼容配置
    enabled: true  # 是否启用兼容
    use-permissions: true  # 是否使用权限系统
  PlaceholderAPI:  # PlaceholderAPI插件兼容配置
    enabled: true  # 是否启用兼容
    use-placeholders: true  # 是否使用占位符

服务器版本兼容性

yaml
# 服务器版本兼容性
versions:  # 版本兼容配置
  # Minecraft版本特定的兼容设置
  "1.17":  # Minecraft 1.17版本兼容配置
    enabled: true  # 是否启用兼容
    ignore-issues: []  # 忽略的问题列表
  "1.18":  # Minecraft 1.18版本兼容配置
    enabled: true  # 是否启用兼容
    ignore-issues: []  # 忽略的问题列表
  "1.19":  # Minecraft 1.19版本兼容配置
    enabled: true  # 是否启用兼容
    ignore-issues: []  # 忽略的问题列表
  "1.20":  # Minecraft 1.20版本兼容配置
    enabled: true  # 是否启用兼容
    ignore-issues: []  # 忽略的问题列表
  "1.21":  # Minecraft 1.21版本兼容配置
    enabled: true  # 是否启用兼容
    ignore-issues: []  # 忽略的问题列表

白名单设置

yaml
# 白名单设置
whitelist:  # 白名单配置
  # 玩家白名单
  players: []  # 白名单玩家列表
  # 方块白名单
  blocks: []  # 白名单方块列表
  # 物品白名单
  items: []  # 白名单物品列表
  # 世界白名单
  worlds: []  # 白名单世界列表
  # 区域白名单
  regions: []  # 白名单区域列表

黑名单设置

yaml
# 黑名单设置
blacklist:  # 黑名单配置
  # 玩家黑名单
  players: []  # 黑名单玩家列表
  # 方块黑名单
  blocks: []  # 黑名单方块列表
  # 物品黑名单
  items: []  # 黑名单物品列表
  # 世界黑名单
  worlds: []  # 黑名单世界列表
  # 区域黑名单
  regions: []  # 黑名单区域列表

📝 配置文件示例

以下是一些常用的配置文件示例,适用于不同类型的服务器。

小型服务器配置

yaml
# 小型服务器推荐配置 (config.yml)
default-language: "zh_cn"
debug-mode: false
performance-mode: balanced
auto-update: true
notify-updates: true

# 检测系统设置
detection:
  enabled: true
  check-interval: 100
  player-check-throttle: 200
  max-violations: 30
  violation-reset-time: 300
  latency-compensation: true
  ping-threshold: 300
  performance-variation-tolerance: 0.2

# 数据库设置
database:
  type: sqlite
  file: "鍏夎氨Spectrum.db"
  save-interval: 120

中型服务器配置

yaml
# 中型服务器推荐配置 (config.yml)
default-language: "zh_cn"
debug-mode: false
performance-mode: high
auto-update: true
notify-updates: true

# 检测系统设置
detection:
  enabled: true
  check-interval: 50
  player-check-throttle: 100
  max-violations: 30
  violation-reset-time: 300
  latency-compensation: true
  ping-threshold: 200
  performance-variation-tolerance: 0.1

# 数据库设置
database:
  type: mysql
  host: "localhost"
  port: 3306
  database: "鍏夎氨Spectrum"
  username: "鍏夎氨Spectrum"
  password: "password"
  prefix: "鍏夎氨Spectrum_"
  pool-size: 10
  timeout: 30
  cache-size: 2000
  save-interval: 60

大型服务器配置

yaml
# 大型服务器推荐配置 (config.yml)
default-language: "zh_cn"
debug-mode: false
performance-mode: high
auto-update: true
notify-updates: true

# 检测系统设置
detection:
  enabled: true
  check-interval: 30
  player-check-throttle: 50
  max-violations: 30
  violation-reset-time: 300
  latency-compensation: true
  ping-threshold: 100
  performance-variation-tolerance: 0.05

# 数据库设置
database:
  type: mongodb
  host: "localhost"
  port: 27017
  database: "鍏夎氨Spectrum"
  username: "鍏夎氨Spectrum"
  password: "password"
  auth-database: "admin"
  pool-size: 20
  timeout: 30
  cache-size: 5000
  save-interval: 30

# 通知设置
notifications:
  in-game:
    enabled: true
    admin-chat: true
    staff-prefix: "[STAFF]"
    violation-alerts: true
    punishment-alerts: true
  discord:
    enabled: true
    webhook-url: "https://discord.com/api/webhooks/your-webhook-url"
    bot-name: "鍏夎氨Spectrum Anticheat"
    embed-color: 16711680
    log-violations: true
    log-punishments: true
    log-kicks: true
    log-bans: true

📤 配置导入与导出

鍏夎氨Spectrum反作弊插件支持配置的导入与导出,方便在多个服务器之间共享配置。

配置导出

使用以下命令导出配置:

/鍏夎氨Spectrum export config <filename>

参数说明:

  • <filename>:导出的配置文件名,将保存在plugins/鍏夎氨Spectrum/exports/目录下

配置导入

使用以下命令导入配置:

/鍏夎氨Spectrum import config <filename>

参数说明:

  • <filename>:要导入的配置文件名,必须位于plugins/鍏夎氨Spectrum/imports/目录下

配置备份

鍏夎氨Spectrum反作弊插件会自动备份配置文件,备份文件保存在plugins/鍏夎氨Spectrum/backups/目录下,备份文件命名格式为config.yml.bak.<timestamp>

也可以使用以下命令手动备份配置:

/鍏夎氨Spectrum backup config

配置恢复

使用以下命令恢复配置:

/鍏夎氨Spectrum restore config <timestamp>

参数说明:

  • <timestamp>:要恢复的备份文件的时间戳,可以在plugins/鍏夎氨Spectrum/backups/目录下查看

❓ 常见问题

如何调整检测的严格程度?

可以通过修改检测配置文件(checks.yml)中的threshold参数来调整检测的严格程度。threshold值越低,检测越严格;值越高,检测越宽松。

如何减少误报?

  1. 调整检测阈值:增加threshold值可以降低检测的严格程度
  2. 启用延迟补偿:在config.yml中设置latency-compensation: true
  3. 调整延迟阈值:增加ping-threshold值以适应高延迟玩家
  4. 配置兼容模式:在compatibility.yml中添加与其他插件的兼容设置
  5. 添加白名单:使用/鍏夎氨Spectrum whitelist命令将特定玩家、方块或物品添加到白名单

如何优化鍏夎氨Spectrum的性能?

  1. 调整性能模式:在config.yml中设置performance-mode: low可以降低资源占用
  2. 增加检测间隔:增加check-interval值可以减少检测频率
  3. 启用异步检测:对于计算密集型的检测模块,将async设置为true
  4. 降低数据采样率:在不影响检测效果的前提下,适当降低数据采样频率
  5. 使用高性能数据库:对于大型服务器,推荐使用MySQL或MongoDB代替SQLite

配置文件修改后不生效怎么办?

确保在修改配置文件后使用/鍏夎氨Spectrum reload命令重新加载配置。如果问题仍然存在,可以尝试以下解决方法:

  1. 检查配置文件格式是否正确,YAML对缩进和格式要求严格
  2. 查看服务器日志是否有配置文件加载错误的信息
  3. 尝试使用/鍏夎氨Spectrum backup config/鍏夎氨Spectrum restore config命令恢复默认配置
  4. 重新生成配置文件:删除旧的配置文件,重启服务器让插件自动生成新的配置文件

如何备份和迁移配置?

  1. 使用/鍏夎氨Spectrum backup config命令备份配置
  2. 手动备份plugins/鍏夎氨Spectrum/目录下的所有配置文件
  3. 使用/鍏夎氨Spectrum export config <filename>命令导出配置
  4. 在新服务器上使用/鍏夎氨Spectrum import config <filename>命令导入配置

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