From c3fe0ac2c85607fe274e68faf5fcc4f14849aa7c Mon Sep 17 00:00:00 2001 From: duhui Date: Mon, 21 Nov 2022 16:04:36 +0800 Subject: [PATCH] =?UTF-8?q?=E5=8A=9F=E8=83=BD=E8=A1=A8=E7=BB=93=E6=9E=84?= =?UTF-8?q?=E4=BF=AE=E6=94=B9=E5=85=BC=E5=AE=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../clazzStaticCfg/CommonStaticConfig.java | 19 ++++--- .../ljsd/jieling/core/HandlerLogicThread.java | 53 +++++++++---------- .../main/java/config/SGlobalSystemConfig.java | 4 +- 3 files changed, 37 insertions(+), 39 deletions(-) diff --git a/serverlogic/src/main/java/com/ljsd/jieling/config/clazzStaticCfg/CommonStaticConfig.java b/serverlogic/src/main/java/com/ljsd/jieling/config/clazzStaticCfg/CommonStaticConfig.java index f8ecc4d29..058fc1209 100644 --- a/serverlogic/src/main/java/com/ljsd/jieling/config/clazzStaticCfg/CommonStaticConfig.java +++ b/serverlogic/src/main/java/com/ljsd/jieling/config/clazzStaticCfg/CommonStaticConfig.java @@ -146,17 +146,16 @@ public class CommonStaticConfig extends AbstractClassStaticConfig { break; } - for (int[] openRule : sGlobalSystemConfig.getOpenRules()) { - int openType = openRule[0]; - int openCondition = openRule[1]; - if (!sGlobalSystemConfigMapByTypeAndConditionMapTmp.containsKey(openType)) { - sGlobalSystemConfigMapByTypeAndConditionMapTmp.put(openType, new HashMap<>()); - } - if (!sGlobalSystemConfigMapByTypeAndConditionMapTmp.get(openType).containsKey(openCondition)) { - sGlobalSystemConfigMapByTypeAndConditionMapTmp.get(openType).put(openCondition, new ArrayList<>()); - } - sGlobalSystemConfigMapByTypeAndConditionMapTmp.get(openType).get(openCondition).add(sGlobalSystemConfig); + int[] openRules = sGlobalSystemConfig.getOpenRules(); + int openType = openRules[0]; + int openCondition = openRules[1]; + if (!sGlobalSystemConfigMapByTypeAndConditionMapTmp.containsKey(openType)) { + sGlobalSystemConfigMapByTypeAndConditionMapTmp.put(openType, new HashMap<>()); } + if (!sGlobalSystemConfigMapByTypeAndConditionMapTmp.get(openType).containsKey(openCondition)) { + sGlobalSystemConfigMapByTypeAndConditionMapTmp.get(openType).put(openCondition, new ArrayList<>()); + } + sGlobalSystemConfigMapByTypeAndConditionMapTmp.get(openType).get(openCondition).add(sGlobalSystemConfig); } } diff --git a/serverlogic/src/main/java/com/ljsd/jieling/core/HandlerLogicThread.java b/serverlogic/src/main/java/com/ljsd/jieling/core/HandlerLogicThread.java index a7c3c1102..0e3f44fe1 100644 --- a/serverlogic/src/main/java/com/ljsd/jieling/core/HandlerLogicThread.java +++ b/serverlogic/src/main/java/com/ljsd/jieling/core/HandlerLogicThread.java @@ -262,37 +262,36 @@ public class HandlerLogicThread extends Thread{ return false; } boolean result = true; - outside: for (int[] openRule : sGlobalSystemConfig.getOpenRules()) { - switch (openRule[0]){ - case 1: - if (!SMainLevelConfig.biggerThanFight(user.getMainLevelManager().getFightId(),openRule[1])) { - result = false; - break outside; - } + int[] openRule = sGlobalSystemConfig.getOpenRules(); + switch (openRule[0]){ + case 1: + if (!SMainLevelConfig.biggerThanFight(user.getMainLevelManager().getFightId(),openRule[1])) { + result = false; break; - case 2: - if (user.getPlayerInfoManager().getLevel() < openRule[1]){ - result = false; - break outside; - } + } + break; + case 2: + if (user.getPlayerInfoManager().getLevel() < openRule[1]){ + result = false; break; - case 3: - if (user.getHeroManager().getHongmengMaxLevelByInt() < openRule[1]){ - result = false; - break outside; - } + } + break; + case 3: + if (user.getHeroManager().getHongmengMaxLevelByInt() < openRule[1]){ + result = false; break; - case 4: - SRechargeCommodityNewConfig config = SRechargeCommodityNewConfig.getConfigById(openRule[1]); - RechargeHandler rechargeHandler = BuyGoodsNewLogic.getRechargeHandler(config.getOtype()); - AbstractWelfareBag bag = rechargeHandler.getRechargeMap(user).get(config.getId()); - if (bag == null || !bag.buyAgo()){ - result = false; - break outside; - } + } + break; + case 4: + SRechargeCommodityNewConfig config = SRechargeCommodityNewConfig.getConfigById(openRule[1]); + RechargeHandler rechargeHandler = BuyGoodsNewLogic.getRechargeHandler(config.getOtype()); + AbstractWelfareBag bag = rechargeHandler.getRechargeMap(user).get(config.getId()); + if (bag == null || !bag.buyAgo()){ + result = false; break; - default:break; - } + } + break; + default:break; } return result; } diff --git a/tablemanager/src/main/java/config/SGlobalSystemConfig.java b/tablemanager/src/main/java/config/SGlobalSystemConfig.java index 4a80efe86..4b18fdf05 100644 --- a/tablemanager/src/main/java/config/SGlobalSystemConfig.java +++ b/tablemanager/src/main/java/config/SGlobalSystemConfig.java @@ -15,7 +15,7 @@ public class SGlobalSystemConfig implements BaseConfig { private String name; - private int[][] openRules; + private int[] openRules; private String systemOpen; @@ -82,7 +82,7 @@ public class SGlobalSystemConfig implements BaseConfig { return id; } - public int[][] getOpenRules() { + public int[] getOpenRules() { return openRules; }