修复测试场/back返回不刷怪:startTest未写入chosenDiff/chosenEquip;注释领地PHP同步排查权限强制同步bug
This commit is contained in:
@@ -6000,12 +6000,12 @@ public class AreaProtection implements Listener {
|
||||
sender.sendMessage("§c未知配置项: " + key);
|
||||
return true;
|
||||
}
|
||||
// ★ 配置变更:立即触发PHP同步
|
||||
try {
|
||||
if (plugin.webManager != null) {
|
||||
plugin.webManager.requestImmediateLandSync();
|
||||
}
|
||||
} catch (Exception ignored) {}
|
||||
// ★ [已注释] 配置变更:PHP同步暂时禁用(排查领地权限被强制同步bug)
|
||||
// try {
|
||||
// if (plugin.webManager != null) {
|
||||
// plugin.webManager.requestImmediateLandSync();
|
||||
// }
|
||||
// } catch (Exception ignored) {}
|
||||
|
||||
// ★ 更新后显示完整配置页面(而非仅打印"已更新")
|
||||
if (plugin.areaCLIManager != null) {
|
||||
@@ -7597,8 +7597,8 @@ public class AreaProtection implements Listener {
|
||||
areaName, oldOwner, newOwner, expiresAt, 0, 0, snapshot
|
||||
);
|
||||
plugin.webManager.trackTransfer(areaName, info);
|
||||
// 通知PHP同步
|
||||
plugin.webManager.requestImmediateLandSync();
|
||||
// 通知PHP同步 [已注释 - 排查权限强制同步bug]
|
||||
// plugin.webManager.requestImmediateLandSync();
|
||||
}
|
||||
|
||||
sender.sendMessage("§a已将 §e" + areaName + " §a从 §e" + (oldOwner != null ? oldOwner : "无") + " §a转让给 §e" + newOwner + "§a,§e60秒冷却期内可取消");
|
||||
@@ -7953,12 +7953,12 @@ public class AreaProtection implements Listener {
|
||||
stmt.setInt(65, ac.allowVisitorTeleport ? 1 : 0);
|
||||
stmt.executeUpdate();
|
||||
stmt.close();
|
||||
// ★ 领地设置变更:立即触发PHP同步(防抖10秒)
|
||||
try {
|
||||
if (plugin.webManager != null) {
|
||||
plugin.webManager.requestImmediateLandSync();
|
||||
}
|
||||
} catch (Exception ignored) {}
|
||||
// ★ [已注释] 领地设置变更:PHP同步暂时禁用(排查权限强制同步bug)
|
||||
// try {
|
||||
// if (plugin.webManager != null) {
|
||||
// plugin.webManager.requestImmediateLandSync();
|
||||
// }
|
||||
// } catch (Exception ignored) {}
|
||||
} catch (SQLException e) {
|
||||
plugin.getLogger().warning("[防护] 保存到DB失败: " + ac.name + " - " + e.getMessage());
|
||||
}
|
||||
@@ -7974,12 +7974,12 @@ public class AreaProtection implements Listener {
|
||||
stmt.setString(1, name);
|
||||
stmt.executeUpdate();
|
||||
stmt.close();
|
||||
// ★ 领地删除:立即触发PHP同步
|
||||
try {
|
||||
if (plugin.webManager != null) {
|
||||
plugin.webManager.requestImmediateLandSync();
|
||||
}
|
||||
} catch (Exception ignored) {}
|
||||
// ★ [已注释] 领地删除:PHP同步暂时禁用(排查权限强制同步bug)
|
||||
// try {
|
||||
// if (plugin.webManager != null) {
|
||||
// plugin.webManager.requestImmediateLandSync();
|
||||
// }
|
||||
// } catch (Exception ignored) {}
|
||||
} catch (SQLException e) {
|
||||
plugin.getLogger().warning("[防护] 从DB删除领地失败: " + name + " - " + e.getMessage());
|
||||
}
|
||||
@@ -8759,7 +8759,8 @@ public class AreaProtection implements Listener {
|
||||
areaName, oldOwner, newOwner, expiresAt, 0, 0, snapshot
|
||||
);
|
||||
plugin.webManager.trackTransfer(areaName, info);
|
||||
plugin.webManager.requestImmediateLandSync();
|
||||
// [已注释] PHP同步暂时禁用(排查权限强制同步bug)
|
||||
// plugin.webManager.requestImmediateLandSync();
|
||||
}
|
||||
|
||||
p.sendMessage("§a已将 §e" + areaName + " §a从 §e" + (oldOwner != null ? oldOwner : "无") + " §a转让给 §e" + newOwner + "§a,§e60秒冷却期内可取消");
|
||||
|
||||
@@ -602,6 +602,10 @@ public class PVPTestManager implements Listener {
|
||||
|
||||
inTest.add(p.getUniqueId());
|
||||
|
||||
// ★ 写入 chosenDiff/chosenEquip(spawnWaveFor 依赖这两个 map,之前遗漏导致 null→不刷怪)
|
||||
chosenDiff.put(p.getUniqueId(), diff);
|
||||
chosenEquip.put(p.getUniqueId(), equip);
|
||||
|
||||
// 立即来一波(之后仅在玩家清空当前波次后,间隔10秒再补下一波)
|
||||
spawnWaveFor(p);
|
||||
|
||||
|
||||
@@ -3819,31 +3819,38 @@ public class WebManager {
|
||||
break;
|
||||
}
|
||||
case "perm_change": {
|
||||
// handleUpdateVisitorPerm: target_name=玩家名,changeData 不含 player
|
||||
// handleChangeVisitorRole: target_name=领地名,changeData 含 player
|
||||
String playerName = changeData.containsKey("player")
|
||||
? String.valueOf(changeData.get("player"))
|
||||
: targetName;
|
||||
String landNameJson = String.valueOf(changeData.getOrDefault("land_name", ""));
|
||||
String permsJson = String.valueOf(changeData.getOrDefault("permissions", "{}"));
|
||||
String roleJson = String.valueOf(changeData.getOrDefault("role", ""));
|
||||
if (!playerName.isEmpty() && !landNameJson.isEmpty()) {
|
||||
areaProtect.updateVisitorPermFromWeb(landNameJson, playerName, permsJson, roleJson);
|
||||
plugin.getLogger().info("[Web通信] PHP端更新访客权限: " + playerName + " @ " + landNameJson
|
||||
+ (roleJson.isEmpty() ? "" : " role=" + roleJson));
|
||||
applied = true;
|
||||
}
|
||||
// [已注释] PHP→Java权限同步暂时禁用(排查领地权限被强制同步bug)
|
||||
plugin.getLogger().info("[Web通信] [已跳过] PHP端perm_change: " + targetName + " (禁用中)");
|
||||
applied = true;
|
||||
break;
|
||||
// ★ 以下是原逻辑(暂时禁用)
|
||||
// String playerName = changeData.containsKey("player")
|
||||
// ? String.valueOf(changeData.get("player"))
|
||||
// : targetName;
|
||||
// String landNameJson = String.valueOf(changeData.getOrDefault("land_name", ""));
|
||||
// String permsJson = String.valueOf(changeData.getOrDefault("permissions", "{}"));
|
||||
// String roleJson = String.valueOf(changeData.getOrDefault("role", ""));
|
||||
// if (!playerName.isEmpty() && !landNameJson.isEmpty()) {
|
||||
// areaProtect.updateVisitorPermFromWeb(landNameJson, playerName, permsJson, roleJson);
|
||||
// plugin.getLogger().info("[Web通信] PHP端更新访客权限: " + playerName + " @ " + landNameJson
|
||||
// + (roleJson.isEmpty() ? "" : " role=" + roleJson));
|
||||
// applied = true;
|
||||
// }
|
||||
// break;
|
||||
}
|
||||
case "land_field_change": {
|
||||
String field = String.valueOf(changeData.getOrDefault("field", ""));
|
||||
String value = String.valueOf(changeData.getOrDefault("value", ""));
|
||||
if (!field.isEmpty() && !targetName.isEmpty()) {
|
||||
areaProtect.updateLandFieldFromWeb(targetName, field, value);
|
||||
plugin.getLogger().info("[Web通信] PHP端更新领地字段: " + targetName + "." + field);
|
||||
applied = true;
|
||||
}
|
||||
// [已注释] PHP→Java领地字段同步暂时禁用(排查权限强制同步bug)
|
||||
plugin.getLogger().info("[Web通信] [已跳过] PHP端land_field_change: " + targetName + " (禁用中)");
|
||||
applied = true;
|
||||
break;
|
||||
// String field = String.valueOf(changeData.getOrDefault("field", ""));
|
||||
// String value = String.valueOf(changeData.getOrDefault("value", ""));
|
||||
// if (!field.isEmpty() && !targetName.isEmpty()) {
|
||||
// areaProtect.updateLandFieldFromWeb(targetName, field, value);
|
||||
// plugin.getLogger().info("[Web通信] PHP端更新领地字段: " + targetName + "." + field);
|
||||
// applied = true;
|
||||
// }
|
||||
// break;
|
||||
}
|
||||
case "config_change": {
|
||||
String configKey = String.valueOf(changeData.getOrDefault("key", ""));
|
||||
|
||||
Reference in New Issue
Block a user