示例#1
0
        void InitCache()
        {
            LogHelper.Insert("Equipment cache init start", LogType.Info);

            var list  = DicEquipmentMgr.GetAllForCache();
            var list2 = ConfigEquipmentplusMgr.GetAll();

            //var list3 = ConfigEquipmentsynthesizeMgr.GetAll();
            //var list4 = DicEquipmentsuitMgr.GetAllForCache();
            _equipmentDic        = list.ToDictionary(d => d.Idx, d => d);
            _equipmentQuarityDic = new Dictionary <int, List <DicEquipmentEntity> >(list2.Count);
            foreach (var entity in list)
            {
                if (!_equipmentQuarityDic.ContainsKey(entity.Quality))
                {
                    _equipmentQuarityDic.Add(entity.Quality, new List <DicEquipmentEntity>());
                }
                _equipmentQuarityDic[entity.Quality].Add(entity);
            }

            _equipmentPlusDic = list2.ToDictionary(d => d.Quality, d => d);
            //_equipmentSynthesizeDic = list3.ToDictionary(d => d.Quarity, d => d);
            //_equipmentsuitDic = list4.ToDictionary(d => d.Idx, d => d);

            var propertyType = CacheFactory.AppsettingCache.GetAppSetting(EnumAppsetting.EquipmentPropertyTypeRange);
            var ss           = propertyType.Split(',');

            _propertyTypeMin = ConvertHelper.ConvertToInt(ss[0]);
            _propertyTypeMax = ConvertHelper.ConvertToInt(ss[1]);

            LogHelper.Insert("Equipment cache init end", LogType.Info);
        }
示例#2
0
        public static DescriptionConfigEntity ExportDescriptionDic()
        {
            var config = new DescriptionConfigEntity();
            var list   = DicGrowMgr.GetAll();

            config.GrowDic = new List <LDescriptionEntity>(list.Count);
            foreach (var dicGrowEntity in list)
            {
                config.GrowDic.Add(new LDescriptionEntity()
                {
                    Description = dicGrowEntity.Name, Idx = dicGrowEntity.Idx, GrowTip = dicGrowEntity.GrowTip
                });
            }
            var suitList = DicEquipmentsuitMgr.GetAll();

            config.EquipmentSuit = new List <EquipmentsuitEntity>(suitList.Count);
            foreach (var entity in suitList)
            {
                config.EquipmentSuit.Add(new EquipmentsuitEntity()
                {
                    Idx = entity.Idx, Memo1 = entity.Memo1, Memo2 = entity.Memo2, Memo3 = entity.Memo3, Name = entity.Name, SuitType = entity.SuitType
                });
            }
            var appsettings = ConfigAppsettingMgr.GetAllForCache();

            config.WChallengeNameTemplate = GetAppSettingName("WChallengeStageNameTemplate", appsettings);
            config.HighBallsoulName       = GetAppSettingName("HighBallsoulName", appsettings);
            config.NormalBallsoulName     = GetAppSettingName("NormalBallsoulName", appsettings);

            var funcs = ConfigFunctionopenMgr.GetAll();

            config.Functionopens = new List <WpfConfigFunctionopenEntity>();
            foreach (var entity in funcs)
            {
                if (entity.FunctionId > 0)
                {
                    config.Functionopens.Add(new WpfConfigFunctionopenEntity()
                    {
                        Idx = entity.FunctionId, LockMemo = entity.LockMemo, Name = entity.Name, ManagerLevel = entity.ManagerLevel
                    });
                }
            }
            config.BuffTips = new List <BuffTipsEntity>();
            foreach (var item in DicBuffMgr.GetAll())
            {
                if (item.BuffType == 2)
                {
                    config.BuffTips.Add(new BuffTipsEntity(item));
                }
            }
            config.BuffSrcTips = new List <BuffSrcTipsEntity>();
            foreach (var item in DicSkillMgr.GetAll())
            {
                if (item.BuffSrcType == 1)
                {
                    config.BuffSrcTips.Add(new BuffSrcTipsEntity(item));
                }
            }

            config.PlayerCardStrengthPlus = GetAppSettingName("PlayerCardStrengthPlus", appsettings);
            config.Equipmentplus          = ConfigEquipmentplusMgr.GetAll();
            config.Mails = DicMailMgr.GetAll();

            var ladderExchanges = DicLadderexchangeMgr.GetAll();

            config.LadderExchanges = new List <LadderExchangeEntity>();
            foreach (var entity in ladderExchanges)
            {
                var exchange = new LadderExchangeEntity()
                {
                    Idx        = entity.Type,
                    CostHonor  = entity.CostHonor,
                    LadderCoin = entity.LadderCoin
                };
                config.LadderExchanges.Add(exchange);
            }

            var leagueExchanges = DicLeagueexchangeMgr.GetAll();

            config.LeagueExchanges = new List <LeagueExchangeEntity>();
            foreach (var entity in leagueExchanges)
            {
                var exchange = new LeagueExchangeEntity()
                {
                    Idx       = entity.Idx,
                    CostScore = entity.CostScore
                };
                config.LeagueExchanges.Add(exchange);
            }

            var taskList  = ConfigTaskMgr.GetAll();
            var taskList2 = ConfigTaskrequireMgr.GetAll();
            var giftItems = DicGiftpackprizeMgr.GetAll();

            foreach (var entity in taskList2)
            {
                var task = taskList.Find(d => d.Idx == entity.TaskId);
                if (!string.IsNullOrEmpty(task.RequireFuncs))
                {
                    task.RequireFuncs += ",";
                }
                task.RequireFuncs += entity.RequireType;
            }

            config.Tasks = new List <TaskDescriptionEntity>(taskList.Count);
            foreach (var entity in taskList)
            {
                config.Tasks.Add(new TaskDescriptionEntity()
                {
                    Idx           = entity.Idx,
                    Name          = entity.Name,
                    Level         = entity.ManagerLevel,
                    Description   = entity.Tip,
                    PrizeCoin     = entity.PrizeCoin,
                    PrizeExp      = entity.PrizeExp,
                    PrizeItemCode = entity.PrizeItemCode,
                    PrizeItems    = GetGiftItems(giftItems, entity.PrizeItemCode),
                    RequireFuncs  = entity.RequireFuncs,
                    TaskType      = entity.TaskType,
                    Times         = entity.Times,
                    NpcIdx        = entity.NpcIdx
                });
            }

            config.Turntable = new List <ConfigTurntableprizeEntity>();
            var allturntable = ConfigTurntableprizeMgr.GetAll();

            config.Turntable = allturntable;

            return(config);
        }