第65批-续3:修复NOT NULL约束/规则同步后不执行/弹窗毛玻璃化
Check Source / check (push) Successful in 6s
Auto Release / build (push) Successful in 3m45s
Simple Test / test (push) Successful in 1s
Test Env / test (push) Successful in 2s

- CreditManager.insertScoreRecord:reporter_player NULL → 空字符串(NOT NULL约束)
- CreditManager.syncCreditRulesFromPhp:同步规则后对在线玩家重新执行checkRestrictions
- admin.php showModal:黑色弹窗 → 毛玻璃风格(backdrop-filter:blur)
This commit is contained in:
youpaishidifu
2026-10-30 19:42:46 +08:00
parent 8670ced16b
commit 2f44462a2a
+7 -1
View File
@@ -297,7 +297,7 @@ public class CreditManager {
} }
PreparedStatement ps = db.getConnection().prepareStatement( PreparedStatement ps = db.getConnection().prepareStatement(
"INSERT INTO credit_records (target_player, reporter_player, type, content, status, score_change, created_at, source) " "INSERT INTO credit_records (target_player, reporter_player, type, content, status, score_change, created_at, source) "
+ "VALUES (?, NULL, ?, ?, 'approved', ?, ?, 'game')"); + "VALUES (?, '', ?, ?, 'approved', ?, ?, 'game')");
ps.setString(1, playerName); ps.setString(1, playerName);
ps.setString(2, type); ps.setString(2, type);
ps.setString(3, reason); ps.setString(3, reason);
@@ -2308,6 +2308,12 @@ public class CreditManager {
} }
if (synced > 0) { if (synced > 0) {
plugin.getLogger().info("[信誉同步] 从PHP同步了 " + synced + " 条规则 (新增" + inserted + " 更新" + (synced - inserted) + ")"); plugin.getLogger().info("[信誉同步] 从PHP同步了 " + synced + " 条规则 (新增" + inserted + " 更新" + (synced - inserted) + ")");
// ★ 第65批修复(#343):规则同步后对在线玩家重新执行限制检查
// 之前只更新了本地表,不会触发 checkRestrictions → 在线玩家不执行新规则
for (org.bukkit.entity.Player p : org.bukkit.Bukkit.getOnlinePlayers()) {
double score = getScore(p.getName());
checkRestrictions(p.getName(), score);
}
} else if (failed > 0) { } else if (failed > 0) {
plugin.getLogger().info("[信誉同步] PHP 规则同步无写入 (" + failed + " 条跳过)"); plugin.getLogger().info("[信誉同步] PHP 规则同步无写入 (" + failed + " 条跳过)");
} }