第98批:信誉积分推送全量玩家镜像(修分数恰好100时镜像停更)
Auto Release / build (push) Successful in 2m1s

This commit is contained in:
youpaishidifu
2026-11-08 15:05:31 +08:00
parent 2bc209356d
commit 98c3ab76fb
+5 -2
View File
@@ -11933,7 +11933,10 @@ public class WebManager {
DatabaseManager db = plugin.getDb();
if (db == null) return;
// 收集所有非默认积分的玩家(默认100分不推,减少数据量)
// 收集所有玩家的积分镜像(★ 第98批 #402:不再跳过默认 100 分的玩家)
// 旧过滤 credit_score != 100 会让「分数恰好恢复/调整回 100」的玩家从推送集消失,
// PHP 面板镜像停留在旧值;users 表很小(几十人),全量推的开销可忽略,
// 签名对比逻辑不变(数据没变照样跳过推送)。
// ★ 第58批-问题1修复:db.getConnection() 返回全局单例连接,不能 try-with-resources 关闭!
// 之前 try (Connection conn = db.getConnection(); ...) 会在块退出时 close() 掉单例连接,
// 导致下次访问触发"数据库连接已自动重建",断链频率大的根源。
@@ -11942,7 +11945,7 @@ public class WebManager {
Connection conn = db.getConnection();
try (Statement st = conn.createStatement();
ResultSet rs = st.executeQuery(
"SELECT player_name, credit_score FROM users WHERE credit_score IS NOT NULL AND credit_score != 100 ORDER BY player_name")) {
"SELECT player_name, credit_score FROM users WHERE credit_score IS NOT NULL ORDER BY player_name")) {
while (rs.next()) {
playersObj.addProperty(rs.getString("player_name"), rs.getDouble("credit_score"));
}