阈值系统
阈值系统是 EMC 大数据的核心算法,根据玩家的消费能力动态计算允许持有的物品上限。
计算公式
阈值分数 = 充值金额 × 充值权重 + 在线时长 × 时长权重 + 肝帝值 × 肝帝权重
默认权重配置:
threshold:
weights:
recharge: 1.0
online-time: 0.5
grind-value: 0.8
示例
假设玩家数据为:
- 充值金额:500
- 在线时长:1000(tick 单位由 PAPI 返回)
- 肝帝值:200
阈值分数 = 500 × 1.0 + 1000 × 0.5 + 200 × 0.8 = 500 + 500 + 160 = 1160
当检测项使用 threshold 模式时,该玩家的氪金物品上限为 1160 个。
数据来源
阈值计算依赖 PlaceholderAPI 变量获取玩家数据:
papi:
recharge: "%playerpoints_points%"
online-time: "%statistic_time_played%"
grind-value: "%placeholder_grind%"
lottery-count: "%ny_lottery_count%"
lottery-total: "%ny_lottery_total%"
points: "%playerpoints_points%"
coins: "%vault_eco_balance%"
请根据服务器实际安装的 PAPI 扩展修改变量名。
岛屿共享阈值
当联动独立空岛插件时,可以将岛屿成员的阈值合并计算:
threshold:
island-share: true
island-share-mode: "sum"
| 模式 | 说明 |
|---|---|
sum | 所有岛屿成员的阈值分数相加 |
max | 取岛屿成员中最高的阈值分数 |
共享计算流程
- 计算当前玩家的个人阈值分数
- 获取所属岛屿的全部成员列表
- 在线成员:实时通过 PAPI 计算分数
- 离线成员:从数据库缓存中读取上次保存的分数
- 按模式合并为最终阈值
玩家档案
插件会为每个玩家维护一份数据档案(PlayerProfile),包含:
| 字段 | 说明 |
|---|---|
recharge | 充值累计 |
onlineTime | 在线时长 |
grindValue | 肝帝值 |
lotteryCount | 抽奖次数 |
lotteryTotal | 累抽数据 |
points | 点券余额 |
coins | 金币余额 |
thresholdScore | 阈值分数 |
lastCheckTime | 上次检测时间 |
lastUpdateTime | 数据更新时间 |
每次检测时自动通过 PAPI 更新数据并持久化存储。