Ejemplo n.º 1
0
        void InitCache()
        {
            LogHelper.Insert("TurntableCache init start", LogType.Info);
            _TurntablePrizeDic = new Dictionary <int, List <ConfigTurntableprizeEntity> >();
            _TurntablePrize    = new Dictionary <int, ConfigTurntableprizeEntity>();
            _TurntableResetDic = new Dictionary <int, int>();
            var allTurntablePrize = ConfigTurntableprizeMgr.GetAll();

            foreach (var item in allTurntablePrize)
            {
                if (!_TurntablePrizeDic.ContainsKey(item.TurntableType))
                {
                    _TurntablePrizeDic.Add(item.TurntableType, new List <ConfigTurntableprizeEntity>());
                }
                _TurntablePrizeDic[item.TurntableType].Add(item);
                var key = GetKey(item.TurntableType, item.TurntableId);
                if (!_TurntablePrize.ContainsKey(key))
                {
                    _TurntablePrize.Add(key, item);
                }
            }
            var allResetConfig = ConfigTurntableresetMgr.GetAll();

            foreach (var item in allResetConfig)
            {
                var key = GetKey(item.TurntableType, item.ResetNumber);
                if (!_TurntableResetDic.ContainsKey(item.TurntableType))
                {
                    _TurntableResetDic.Add(key, item.Point);
                }
            }
            giveLuckyCoin       = 2;
            dayProduceLuckyCoin = 5;

            #region 感恩回馈

            _CrossActivityList  = ConfigCrossactivityprizeMgr.GetAll();
            _CrossActiviryPrize = _CrossActivityList.ToDictionary(r => r.PrizeId, r => r);
            int rate = 0;
            _CrossActivityRateDic = new Dictionary <int, int>();
            foreach (var item in _CrossActivityList)
            {
                rate += item.Rate;
                if (!_CrossActivityRateDic.ContainsKey(rate))
                {
                    _CrossActivityRateDic.Add(rate, item.PrizeId);
                }
            }
            #endregion

            LogHelper.Insert("TurntableCache init end", LogType.Info);
        }
Ejemplo n.º 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);
        }