当前位置: 首页>>代码示例>>C#>>正文


C# ConfigCacheSet类代码示例

本文整理汇总了C#中ConfigCacheSet的典型用法代码示例。如果您正苦于以下问题:C# ConfigCacheSet类的具体用法?C# ConfigCacheSet怎么用?C# ConfigCacheSet使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


ConfigCacheSet类属于命名空间,在下文中一共展示了ConfigCacheSet类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: CheckTrumpEscalate

        /// <summary>
        /// 法宝加经验,升级
        /// </summary>
        /// <param name="userID"></param>
        /// <param name="experience"></param>
        public static void CheckTrumpEscalate(string userID, int experience)
        {
            UserTrump userTrump = new GameDataCacheSet<UserTrump>().FindKey(userID, TrumpInfo.CurrTrumpID);
            if (userTrump != null)
            {
                userTrump.Experience = MathUtils.Addition(userTrump.Experience, experience);
                while (userTrump.TrumpLv < GameConfigSet.MaxTrumpLv)
                {
                    short upLv = MathUtils.Addition(userTrump.TrumpLv, (short)1, GameConfigSet.MaxTrumpLv.ToShort());
                    TrumpInfo trumpInfo = new ConfigCacheSet<TrumpInfo>().FindKey(TrumpInfo.CurrTrumpID, upLv);
                    if (trumpInfo != null && userTrump.Experience >= trumpInfo.Experience)
                    {
                        userTrump.TrumpLv = MathUtils.Addition(userTrump.TrumpLv, (short)1, GameConfigSet.MaxTrumpLv.ToShort());
                        userTrump.Experience = MathUtils.Subtraction(userTrump.Experience, trumpInfo.Experience);
                        if (trumpInfo.SkillID > 0)
                        {
                            SkillInfo skillInfo = new SkillInfo();
                            skillInfo.AbilityID = trumpInfo.SkillID.ToInt();
                            skillInfo.AbilityLv = 1;
                            userTrump.SkillInfo.Add(skillInfo);
                        }
                    }
                    else
                    {
                        break;
                    }

                }
                if (userTrump.TrumpLv >= GameConfigSet.MaxTrumpLv)
                {
                    userTrump.Experience = 0;
                }
            }
        }
开发者ID:rongxiong,项目名称:Scut,代码行数:39,代码来源:TrumpHelper.cs

示例2: BuildPacket

        public override void BuildPacket()
        {
            this.PushIntoStack(magicList.Count);
            foreach (MagicInfo magicInfo in magicList)
            {
                DataStruct dsItem = new DataStruct();
                dsItem.PushIntoStack(magicInfo.MagicID);
                dsItem.PushIntoStack(magicInfo.MagicType.ToInt());
                dsItem.PushIntoStack(magicInfo.MagicName.ToNotNullString());
                dsItem.PushIntoStack(magicInfo.HeadID.ToNotNullString());
                dsItem.PushIntoStack(magicInfo.MagicDesc.ToNotNullString());

                var magicLvList = new ConfigCacheSet<MagicLvInfo>().FindAll(m => m.MagicID == magicInfo.MagicID);
                dsItem.PushIntoStack(magicLvList.Count);
                foreach (MagicLvInfo magicLv in magicLvList)
                {
                    DataStruct dsItem1 = new DataStruct();
                    dsItem1.PushIntoStack(magicLv.MagicLv.ToShort());
                    dsItem1.PushIntoStack(magicLv.ExpNum);
                    dsItem1.PushIntoStack(magicLv.ColdTime);
                    dsItem1.PushIntoStack(magicLv.EscalateMinLv.ToShort());
                    dsItem1.PushIntoStack(magicLv.AbilityType.ToShort());
                    dsItem1.PushIntoStack(magicLv.EffectNum.ToNotNullString());
                    dsItem1.PushIntoStack(magicLv.GridMaxNum);

                    dsItem.PushIntoStack(dsItem1);
                }

                this.PushIntoStack(dsItem);
            }
        }
开发者ID:0jpq0,项目名称:Scut,代码行数:31,代码来源:Action1504.cs

示例3: BuildPacket

 public override void BuildPacket()
 {
     PushIntoStack(_pageCount);
     PushIntoStack(ContextUser.GameCoin);
     PushIntoStack(ContextUser.GoldNum);
     PushIntoStack(_mallItemsInfoArray.Count);
     foreach (MallItemsInfo mallItems in _mallItemsInfoArray)
     {
         ItemBaseInfo itemInfo = new ConfigCacheSet<ItemBaseInfo>().FindKey(mallItems.ItemID);
         int mallPrice = 0;
         int specilPrice = 0;
         if (itemInfo != null)
         {
             mallPrice = mallItems.Price;
             if (mallItems.MallType == ShopType.Props || mallItems.MallType == ShopType.PresendBox)
             {
                 mallPrice = (FestivalHelper.StoreDiscount() * mallPrice).ToInt();
             }
             specilPrice = mallItems.SpecialPrice;
         }
         DataStruct dsItem = new DataStruct();
         dsItem.PushIntoStack(mallItems.ItemID);
         dsItem.PushIntoStack(itemInfo == null ? string.Empty : itemInfo.ItemName.ToNotNullString());
         dsItem.PushIntoStack(itemInfo == null ? string.Empty : itemInfo.HeadID.ToNotNullString());
         dsItem.PushIntoStack(itemInfo == null ? string.Empty : itemInfo.MaxHeadID.ToNotNullString());
         dsItem.PushIntoStack(itemInfo == null ? string.Empty : itemInfo.ItemDesc.ToNotNullString());
         dsItem.PushIntoStack(itemInfo == null ? LanguageManager.GetLang().shortInt : (short)itemInfo.QualityType);
         dsItem.PushIntoStack(mallPrice);
         dsItem.PushIntoStack(specilPrice);
         dsItem.PushIntoStack(mallItems.SeqNO);
         dsItem.PushIntoStack((short)_commandType);
         PushIntoStack(dsItem);
     }
     PushIntoStack(ContextUser.ObtainNum);
 }
开发者ID:jinfei426,项目名称:Scut,代码行数:35,代码来源:Action7001.cs

示例4: TakeAction

        public override bool TakeAction()
        {
            UserDailyRestrain dailyRestrain = new GameDataCacheSet<UserDailyRestrain>().FindKey(ContextUser.UserID);
            if (RankingHelper.IsGainSportsReward(ContextUser.UserID) && dailyRestrain != null && dailyRestrain.UserExtend != null)
            {
                var envSet = ServerEnvSet.Get(ServerEnvKey.JingJiChangReward, "");
                SportsRewardInfo sportsInfo = new ConfigCacheSet<SportsRewardInfo>().FindKey(dailyRestrain.UserExtend.UserRankID);
                {                if (envSet != null && sportsInfo != null)

                    if (envSet.ToDateTime().Date > dailyRestrain.Funtion11.Date && dailyRestrain.UserExtend.UserRankID > 0)
                    {

                        dailyRestrain.Funtion11 = DateTime.Now;
                        dailyRestrain.UserExtend.UserRankID = 0;
                        //dailyRestrain.Update();

                        ContextUser.ObtainNum = MathUtils.Addition(ContextUser.ObtainNum, sportsInfo.RewardObtian, int.MaxValue);
                        ContextUser.GameCoin = MathUtils.Addition(ContextUser.GameCoin, sportsInfo.RewardGoin, int.MaxValue);
                        //ContextUser.Update();
                        UserHelper.Contribution(ContextUser.UserID, sportsInfo.RewardObtian);
                        ErrorInfo = string.Format(LanguageManager.GetLang().St5106_JingJiChangRankReward, sportsInfo.RewardObtian, sportsInfo.RewardGoin);
                    }
                }
            }
            return true;
        }
开发者ID:rongxiong,项目名称:Scut,代码行数:26,代码来源:Action5106.cs

示例5: GetItemID

 //��ȡ�������ж��ֽ����������ȡһ��
 public static int GetItemID(LairRewardType lairRewardType)
 {
     var rewardTypeAll = new ConfigCacheSet<LairRewardInfo>().FindAll(u => u.LairRewardType == lairRewardType.ToInt());
     var i = RandomUtils.GetRandom(0, rewardTypeAll.Count);
     var itemID = rewardTypeAll[i].ItemID;
     return itemID;
 }
开发者ID:rongxiong,项目名称:Scut,代码行数:8,代码来源:LairTreasuerHelp.cs

示例6: BuildPacket

        public override void BuildPacket()
        {
            this.PushIntoStack(TaskHelper.DailyEveryMaxNum);
            this.PushIntoStack(currNum);
            this.PushIntoStack(userTaskList.Count);
            foreach (UserTask userTask in userTaskList)
            {
                DailyTaskInfo dtaskInfo = new ConfigCacheSet<DailyTaskInfo>().FindKey(userTask.TaskID);
                var userItem = userTask.GetDailyItem(userLv);
                ItemBaseInfo itemInfo = new ConfigCacheSet<ItemBaseInfo>().FindKey(userItem != null ? userItem.ItemID : 0);

                DataStruct dsItem = new DataStruct();
                dsItem.PushIntoStack(userTask.TaskID);
                dsItem.PushIntoStack(dtaskInfo.TaskName.ToNotNullString());
                dsItem.PushIntoStack((short)userTask.TaskState);
                dsItem.PushIntoStack((short)userTask.TaskType);
                dsItem.PushIntoStack((short)userTask.TaskStar);
                dsItem.PushIntoStack(dtaskInfo.TaskDescp.ToNotNullString());
                dsItem.PushIntoStack(dtaskInfo.TaskTarget);
                dsItem.PushIntoStack((int)userTask.TaskStar);
                dsItem.PushIntoStack(userTask.TaskTargetNum.ToInt());
                dsItem.PushIntoStack(userTask.GetDailyExpNum(userLv));
                dsItem.PushIntoStack(itemInfo != null ? itemInfo.ItemName.ToNotNullString() : string.Empty);
                dsItem.PushIntoStack(userItem != null ? userItem.Num : 0);

                this.PushIntoStack(dsItem);
            }
        }
开发者ID:0jpq0,项目名称:Scut,代码行数:28,代码来源:Action3005.cs

示例7: ProcessCmd

        protected override void ProcessCmd(string[] args)
        {
            int magicID = args.Length > 0 ? args[0].Trim().ToInt() : 0;
            short magicLv = args.Length > 1 ? args[1].Trim().ToShort() : (short)1;

            var cacheSet = new GameDataCacheSet<UserMagic>();
            var userMagic = cacheSet.FindKey(UserID, magicID);
            MagicInfo magic = new ConfigCacheSet<MagicInfo>().FindKey(magicID);
            if (magic == null)
            {
                return;
            }
            if (userMagic == null)
            {
                userMagic = new UserMagic()
                {
                    UserID = UserID,
                    MagicID = magicID,
                    MagicLv = magicLv,
                    IsEnabled = false,
                    MagicType = magic.MagicType,
                };
                cacheSet.Add(userMagic);
            }
            else
            {
                userMagic.MagicLv = magicLv;
            }
        }
开发者ID:jinfei426,项目名称:Scut,代码行数:29,代码来源:MagicCommand.cs

示例8: GetVipUseNum

 /// <summary>
 /// 每日限制次数
 /// </summary>
 /// <returns></returns>
 public static int GetVipUseNum(int vipLv, RestrainType restrainType)
 {
     int rType = (int)restrainType;
     int baseNum = 0;
     int MaxNum = 0;
     int vipNum = 0;
     DailyRestrainSet restrainSet = new ShareCacheStruct<DailyRestrainSet>().FindKey(restrainType);
     if (restrainSet != null)
     {
         baseNum = restrainSet.MaxNum;
     }
     VipLvInfo lvInfo = new ConfigCacheSet<VipLvInfo>().FindKey(vipLv);
     var restrainArray = new CacheList<DailyRestrain>();
     if (lvInfo != null)
     {
         restrainArray = lvInfo.DailyRestrain;
     }
     foreach (DailyRestrain daily in restrainArray)
     {
         if (daily.ID == rType)
         {
             vipNum = daily.Num;
         }
     }
     MaxNum = MathUtils.Addition(baseNum, vipNum, int.MaxValue);
     return MaxNum;
 }
开发者ID:jinfei426,项目名称:Scut,代码行数:31,代码来源:VipHelper.cs

示例9: BuildPacket

        public override void BuildPacket()
        {
            PushIntoStack(firstName.ToNotNullString());
            this.PushIntoStack((short)postType);
            this.PushIntoStack((short)isApply);
            this.PushIntoStack(fightList.Count);
            foreach (var fight in fightList)
            {
                CityInfo cityInfo = new ConfigCacheSet<CityInfo>().FindKey(fight.CityID);
                DataStruct dsItem = new DataStruct();
                dsItem.PushIntoStack(fight.CityID);
                dsItem.PushIntoStack(cityInfo == null ? string.Empty : cityInfo.CityName.ToNotNullString());
                dsItem.PushIntoStack(fight.CityHead.ToNotNullString());
                dsItem.PushIntoStack((short)fight.GuildLv);
                dsItem.PushIntoStack(fight.SkillNum);
                this.PushIntoStack(dsItem);
            }
            this.PushIntoStack(currCityName.ToNotNullString());
            this.PushIntoStack(rewardDesc.ToNotNullString());
            this.PushIntoStack(guildName.ToNotNullString());
            this.PushIntoStack(endData);
            this.PushIntoStack((short)isChampion);


        }
开发者ID:jinfei426,项目名称:Scut,代码行数:25,代码来源:Action6401.cs

示例10: TakeAction

 public override bool TakeAction()
 {
     var package = UserItemPackage.Get(ContextUser.UserID);
     UserItemInfo useritem = package.ItemPackage.Find(m => !m.IsRemove && m.UserItemID.Equals(userItemID));
     if (useritem != null)
     {
         ItemBaseInfo itemInfo = new ConfigCacheSet<ItemBaseInfo>().FindKey(useritem.ItemID);
         if (itemInfo != null && itemInfo.DemandLv > ContextUser.VipLv)
         {
             ErrorCode = LanguageManager.GetLang().ErrorCode;
             ErrorInfo = LanguageManager.GetLang().St_VipNotEnough;
             return false;
         }
     }
     ItemUseHelper itemuse = new ItemUseHelper();
     itemuse.UseItem(userItemID, Uid);
     if (itemuse.result && itemuse.content != string.Empty)
     {
         ErrorCode = 0;
     }
     if (!itemuse.result)
     {
         ErrorCode = LanguageManager.GetLang().ErrorCode;
     }
     ErrorInfo = itemuse.content.Trim(',');
     return true;
 }
开发者ID:jinfei426,项目名称:Scut,代码行数:27,代码来源:Action1609.cs

示例11: BuildPacket

        public override void BuildPacket()
        {

            PushIntoStack(generalInfo == null ? string.Empty : generalInfo.GeneralName.ToNotNullString());
            PushIntoStack(generalMedicineArray.Count);
            foreach (GeneralMedicine item in generalMedicineArray)
            {
                ItemBaseInfo itemInfo = new ConfigCacheSet<ItemBaseInfo>().FindKey(item.MedicineID);

                int itemcount = TrumpHelper.GetUserItemNum(item.UserID, item.MedicineID);
                if (itemcount > 0)
                {
                    gridStatus = 1;
                }
                else
                {
                    gridStatus = 2;
                }

                DataStruct ds = new DataStruct();
                ds.PushIntoStack(item.MedicineID);
                ds.PushIntoStack(itemInfo == null ? string.Empty : itemInfo.HeadID.ToNotNullString());
                ds.PushIntoStack(itemInfo == null ? LanguageManager.GetLang().shortInt : itemInfo.MedicineLv);
                ds.PushIntoStack(itemInfo == null ? LanguageManager.GetLang().shortInt : itemInfo.MedicineType);
                ds.PushIntoStack((short)GetGeneralMedicine(item));
                ds.PushIntoStack(gridStatus);
                ds.PushIntoStack(itemInfo == null ? string.Empty : itemInfo.ItemName.ToNotNullString());
                PushIntoStack(ds);
            }
            this.PushIntoStack(powerNum);
            this.PushIntoStack(soulNum);
            this.PushIntoStack(intellectNum);
        }
开发者ID:jinfei426,项目名称:Scut,代码行数:33,代码来源:Action1406.cs

示例12: BuildPacket

        public override void BuildPacket()
        {
            this.PushIntoStack(lifeNum);
            this.PushIntoStack((short)powerNum);
            this.PushIntoStack((short)soulNum);
            this.PushIntoStack((short)intelligenceNum);
            this.PushIntoStack((short)isPractice);
            this.PushIntoStack(storyTaskArray.Length);
            foreach (var task in storyTaskArray)
            {
                int collectNum = TrumpHelper.GetUserItemNum(ContextUser.UserID, task.TargetItemID);
                iscomplete = IsComplete(ContextUser, task);
                PlotInfo plotInfo = new ConfigCacheSet<PlotInfo>().FindKey(task.PlotID);
                ItemBaseInfo itemInfo = new ConfigCacheSet<ItemBaseInfo>().FindKey(task.TargetItemID);
                DataStruct dsItem = new DataStruct();
                dsItem.PushIntoStack(task.TaskID);
                dsItem.PushIntoStack(task.TaskName.ToNotNullString());
                dsItem.PushIntoStack(task.TaskDescp.ToNotNullString());
                dsItem.PushIntoStack(plotInfo == null ? 0 : plotInfo.CityID);
                dsItem.PushIntoStack(task.PlotID);
                dsItem.PushIntoStack(task.TargetItemID);
                dsItem.PushIntoStack(itemInfo == null ? string.Empty : itemInfo.ItemName.ToNotNullString());
                dsItem.PushIntoStack(itemInfo == null ? string.Empty : itemInfo.HeadID.ToNotNullString());
                dsItem.PushIntoStack(collectNum);
                dsItem.PushIntoStack(task.TargetItemNum);
                dsItem.PushIntoStack((short)iscomplete);

                this.PushIntoStack(dsItem);
            }

        }
开发者ID:jinfei426,项目名称:Scut,代码行数:31,代码来源:Action1451.cs

示例13: PrizeItemName

        public static short _currMaxLv = GameConfigSet.CurrMaxLv.ToShort(); //玩家最大等级

        /// <summary>
        /// 将星佣兵完成任务后奖励物品名称
        /// </summary>
        /// <param name="prize"></param>
        /// <returns></returns>
        public static string PrizeItemName(PrizeInfo prize)
        {
            string name = string.Empty;
            switch (prize.Type)
            {
                case RewardType.CrystalId:
                    CrystalInfo crystal = new ConfigCacheSet<CrystalInfo>().FindKey(prize.ItemID);
                    name = crystal == null ? string.Empty : crystal.CrystalName;
                    break;
                case RewardType.Item:
                    ItemBaseInfo itemInfo = new ConfigCacheSet<ItemBaseInfo>().FindKey(prize.ItemID);
                    name = itemInfo == null ? string.Empty : itemInfo.ItemName;
                    break;
                case RewardType.Spare:
                    SparePartInfo sparePartInfo = new ConfigCacheSet<SparePartInfo>().FindKey(prize.ItemID);
                    name = sparePartInfo == null ? string.Empty : sparePartInfo.Name;
                    break;
                case RewardType.CrystalType:
                    name = string.Format(LanguageManager.GetLang().St_Crystal,
                                         CrystalHelper.GetQualityName(prize.CrystalType.ToEnum<CrystalQualityType>()),
                                         string.Empty);
                    break;

            }
            return name;
        }
开发者ID:jinfei426,项目名称:Scut,代码行数:33,代码来源:GeneralHelper.cs

示例14: BuildPacket

        public override void BuildPacket()
        {
            PushIntoStack(moreTeam.MorePlot.PlotID);
            PushIntoStack(moreTeam.MorePlot.PlotName.ToNotNullString());
            PushIntoStack(moreTeam.UserList.Count);
            PushIntoStack(PlotTeamCombat.TeamMaxPeople);
            PushIntoStack(moreTeam.MorePlot.ItemId);
            PushIntoStack(moreTeam.MorePlot.ItemName.ToNotNullString());
            PushIntoStack(moreTeam.MorePlot.ItemNum);
            PushIntoStack(moreTeam.MorePlot.ExpNum);
            PushIntoStack(moreTeam.TeamUser != null && moreTeam.TeamUser.UserId.ToNotNullString().Equals(Uid) ? 1 : 0);
            PushIntoStack(moreTeam.Status);

            PushIntoStack(moreTeam.UserList.Count);
            foreach (var teamUser in moreTeam.UserList)
            {
                var gameUser = new GameDataCacheSet<GameUser>().FindKey(teamUser.UserId);
                UserGeneral general = UserGeneral.GetMainGeneral(teamUser.UserId);
                CareerInfo careerInfo = null;
                if (general != null)
                {
                    careerInfo = new ConfigCacheSet<CareerInfo>().FindKey(general.CareerID);
                }

                DataStruct dsItem = new DataStruct();
                dsItem.PushIntoStack(teamUser.UserId);
                dsItem.PushIntoStack(teamUser.NickName.ToNotNullString());
                dsItem.PushIntoStack(careerInfo == null ? 0 : (int)careerInfo.CareerID);
                dsItem.PushIntoStack(careerInfo == null ? string.Empty : careerInfo.CareerName.ToNotNullString());
                dsItem.PushIntoStack(gameUser == null ? (short)0 : gameUser.UserLv);
                PushIntoStack(dsItem);
            }
        }
开发者ID:0jpq0,项目名称:Scut,代码行数:33,代码来源:Action4204.cs

示例15: BuildPacket

        public override void BuildPacket()
        {
            PushIntoStack(ContextUser.GoldNum);
            PushIntoStack(ContextUser.GameCoin);
            PushIntoStack(freeNum);
            PushIntoStack(isSale);
            PushIntoStack(issTelegrams);
            PushIntoStack(grayCrystalArray.Count);
            foreach (GrayCrystal crystal in grayCrystalArray)
            {
                CrystalInfo crystalInfo = new ConfigCacheSet<CrystalInfo>().FindKey(crystal.CrystalID) ?? new CrystalInfo();
                DataStruct dsItem = new DataStruct();
                dsItem.PushIntoStack(crystal.UserCrystalID);
                dsItem.PushIntoStack(crystalInfo.CrystalID);
                dsItem.PushIntoStack(crystalInfo.CrystalName.ToNotNullString());
                dsItem.PushIntoStack(crystalInfo.HeadID.ToNotNullString());
                dsItem.PushIntoStack((short)crystalInfo.CrystalQuality);
                PushIntoStack(dsItem);
            }
            PushIntoStack(userLightArray.Count);
            foreach (UserLight light in userLightArray)
            {
                ProbabilityInfo probabilityInfo = new ConfigCacheSet<ProbabilityInfo>().FindKey(light.HuntingID);
                DataStruct dsItem = new DataStruct();
                dsItem.PushIntoStack(light.HuntingID);
                dsItem.PushIntoStack(probabilityInfo == null ? 0 : probabilityInfo.Price);
                dsItem.PushIntoStack(light.IsLight);
                PushIntoStack(dsItem);
            }
            this.PushIntoStack(prompt.ToNotNullString());

        }
开发者ID:jinfei426,项目名称:Scut,代码行数:32,代码来源:Action1312.cs


注:本文中的ConfigCacheSet类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。