示例#1
0
 private void loadBuffConfig() {
   // 加载擂台赛配置
   String fileName = XlsSheetNameType.arena_buff_config.getXlsName();
   String sheetName = XlsSheetNameType.arena_buff_config.getSheetName();
   try {
     String sourceFile = GameContext.getPathConfig().getXlsPath() + fileName;
     List<ArenaBuffConfig> list =
         XlsPojoUtil.sheetToList(sourceFile, sheetName, ArenaBuffConfig.class);
     if (Util.isEmpty(list)) {
       return;
     }
     for (ArenaBuffConfig config : list) {
       if (null == config) {
         continue;
       }
       int arenaType = config.getArenaType();
       if (!buffConfigMap.containsKey(arenaType)) {
         buffConfigMap.put(arenaType, new ArrayList<ArenaBuffConfig>());
       }
       buffConfigMap.get(arenaType).add(config);
     }
   } catch (Exception ex) {
     Log4jManager.checkFail();
     Log4jManager.CHECK.error(
         "loadExel error : sourceFile = " + fileName + " sheetName =" + sheetName, ex);
   }
 }
示例#2
0
 private void loadReward3V3() {
   // 加载擂台赛配置
   String fileName = XlsSheetNameType.arena_reward_3v3.getXlsName();
   String sheetName = XlsSheetNameType.arena_reward_3v3.getSheetName();
   try {
     String sourceFile = GameContext.getPathConfig().getXlsPath() + fileName;
     reward3V3List = XlsPojoUtil.sheetToList(sourceFile, sheetName, Reward3V3Config.class);
   } catch (Exception ex) {
     Log4jManager.checkFail();
     Log4jManager.CHECK.error(
         "loadExel error : sourceFile = " + fileName + " sheetName =" + sheetName, ex);
   }
   if (Util.isEmpty(this.reward3V3List)) {
     Log4jManager.checkFail();
     Log4jManager.CHECK.error(
         "not any config: sourceFile = " + fileName + " sheetName =" + sheetName);
   }
   for (Reward3V3Config config : reward3V3List) {
     config.init();
   }
 }
示例#3
0
 private void loadAreanMapRule() {
   // 加载擂台赛配置
   String fileName = XlsSheetNameType.arena_map_rule.getXlsName();
   String sheetName = XlsSheetNameType.arena_map_rule.getSheetName();
   try {
     String sourceFile = GameContext.getPathConfig().getXlsPath() + fileName;
     mapRuleMap = XlsPojoUtil.sheetToGenericMap(sourceFile, sheetName, ArenaMapRule.class);
   } catch (Exception ex) {
     Log4jManager.checkFail();
     Log4jManager.CHECK.error(
         "loadExel error : sourceFile = " + fileName + " sheetName =" + sheetName, ex);
   }
   if (Util.isEmpty(this.mapRuleMap)) {
     Log4jManager.checkFail();
     Log4jManager.CHECK.error(
         "not any config: sourceFile = " + fileName + " sheetName =" + sheetName);
   }
   for (ArenaMapRule rule : mapRuleMap.values()) {
     if (null == rule) {
       continue;
     }
     String mapId = rule.getMapId();
     sacred.alliance.magic.app.map.Map map = GameContext.getMapApp().getMap(mapId);
     if (null == map) {
       Log4jManager.checkFail();
       Log4jManager.CHECK.error("The arena map is not exist.mapId = " + mapId);
       return;
     }
     if (!map.getMapConfig().changeLogicType(MapLogicType.arena3V3)) {
       Log4jManager.checkFail();
       Log4jManager.CHECK.error(
           "map not exist or change map:"
               + mapId
               + " to "
               + MapLogicType.arena3V3.getType()
               + " fail");
     }
     rule.init();
   }
 }
示例#4
0
 private void loadAreanMapConfig() {
   // 加载擂台赛配置
   String fileName = XlsSheetNameType.arena_map_config.getXlsName();
   String sheetName = XlsSheetNameType.arena_map_config.getSheetName();
   try {
     String sourceFile = GameContext.getPathConfig().getXlsPath() + fileName;
     mapConfigMap = XlsPojoUtil.sheetToGenericMap(sourceFile, sheetName, ArenaMapConfig.class);
   } catch (Exception ex) {
     Log4jManager.checkFail();
     Log4jManager.CHECK.error(
         "loadExel error : sourceFile = " + fileName + " sheetName =" + sheetName, ex);
   }
   if (Util.isEmpty(this.mapConfigMap)) {
     Log4jManager.checkFail();
     Log4jManager.CHECK.error(
         "not any config: sourceFile = " + fileName + " sheetName =" + sheetName);
   }
   for (ArenaMapConfig config : mapConfigMap.values()) {
     if (null == config) {
       continue;
     }
     config.init();
   }
 }