Exemplo n.º 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);
   }
 }
Exemplo n.º 2
0
 private void checkGoods(int goodsId) {
   // 验证物品ID是否存在
   GoodsBase gb = GameContext.getGoodsApp().getGoodsBase(goodsId);
   if (null == gb) {
     Log4jManager.CHECK.error(
         "goods not exist(GoodsBox),goodsId=" + goodsId + " goodsBoxId=" + this.id);
     Log4jManager.checkFail();
   }
 }
Exemplo n.º 3
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();
   }
 }
Exemplo n.º 4
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();
   }
 }
Exemplo n.º 5
0
 private void addItemData(int itemId, int num, int weight, int bindType) {
   if (weight <= 0 || itemId <= 0 || num <= 0) {
     return;
   }
   GoodsBase gb = GameContext.getGoodsApp().getGoodsBase(itemId);
   if (null == gb) {
     Log4jManager.CHECK.error(
         "LootGroup config error,goods not exist,groupId=" + this.groupId + " goodsId=" + itemId);
     Log4jManager.checkFail();
   }
   BindingType bt = this.getBindingType(itemId, bindType);
   this.groupList.add(new ItemData(itemId, num, weight, bt.getType()));
 }
Exemplo n.º 6
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();
   }
 }
Exemplo n.º 7
0
  private void load() {
    String fileName = "";
    String sheetName = "";
    String sourceFile = "";
    try {
      String path = GameContext.getPathConfig().getXlsPath();
      // 世界掉落组
      fileName = XlsSheetNameType.loot_group_world.getXlsName();
      sheetName = XlsSheetNameType.loot_group_world.getSheetName();
      sourceFile = path + fileName;
      this.worldLootListMap = LootLoader.loadLootList(sourceFile);

      // NPC掉落组
      fileName = XlsSheetNameType.loot_group_npc.getXlsName();
      sheetName = XlsSheetNameType.loot_group_npc.getSheetName();
      sourceFile = path + fileName;
      this.npcLootListMap = LootLoader.loadLootList(sourceFile);
    } catch (Exception e) {
      Log4jManager.CHECK.error(
          "loadExel error : sourceFile = " + fileName + " sheetName =" + sheetName, e);
      Log4jManager.checkFail();
    }
  }
Exemplo n.º 8
0
 private void checkFail(String info) {
   Log4jManager.CHECK.error(info);
   Log4jManager.checkFail();
 }