• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

C# PersonalCacheStruct类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

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



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

示例1: BuildPacket

        public override void BuildPacket()
        {
            PushIntoStack(isSuccess);
            PushIntoStack(memberArray.Count);
            foreach (GuildMember member in memberArray)
            {
                UserCacheGlobal.CheckLoadUser(member.UserID);
                GameUser gameUser = new PersonalCacheStruct<GameUser>().FindKey(member.UserID);
                UserGeneral general = UserGeneral.GetMainGeneral(member.UserID);
                int isHelp = 0;
                if (member.DevilNum > 1)
                {
                    isHelp = 1;
                }
                else
                {
                    isHelp = 2;
                }
                DataStruct dsItem = new DataStruct();
                dsItem.PushIntoStack(member.UserID);
                dsItem.PushIntoStack(gameUser == null ? string.Empty : gameUser.NickName.ToNotNullString());
                dsItem.PushIntoStack(general == null ? string.Empty : general.HeadID.ToNotNullString());
                dsItem.PushIntoStack(isHelp);

                PushIntoStack(dsItem);
            }
            PushIntoStack(currNum);
            PushIntoStack(isPilgrimage);
            PushIntoStack(chaoShengNum);
        }
开发者ID:daneric,项目名称:Scut-samples,代码行数:30,代码来源:Action6013.cs


示例2: TakeAction

        public override bool TakeAction()
        {
            int sumGold = 0;
            UserExpedition userExp = new PersonalCacheStruct<UserExpedition>().FindKey(ContextUser.UserID);
            if (userExp == null)
            {
                ErrorCode = LanguageManager.GetLang().ErrorCode;
                return false;
            }
            if (DateTime.Now.Date == userExp.InsertDate.Date)
            {
                sumGold = MathUtils.Addition(userExp.DoRefresh() / 60, 1, int.MaxValue);
            }

            if (ops == 1)
            {
                this.ErrorCode = 1;
                this.ErrorInfo = string.Format(LanguageManager.GetLang().St11003_DelCodeTime, sumGold);
                return false;
            }
            else if (ops == 2)
            {
                if (ContextUser.GoldNum < sumGold)
                {
                    this.ErrorCode = LanguageManager.GetLang().ErrorCode;
                    this.ErrorInfo = LanguageManager.GetLang().St_GoldNotEnough;
                    return false;
                }
                ContextUser.UseGold = MathUtils.Addition(ContextUser.UseGold, sumGold, int.MaxValue);
                userExp.CodeTime = 0;
            }
            return true;
        }
开发者ID:daneric,项目名称:Scut-samples,代码行数:33,代码来源:Action11003.cs


示例3: TakeAction

 public override bool TakeAction()
 {
     UserGeneral userGeneral = new PersonalCacheStruct<UserGeneral>().FindKey(ContextUser.UserID, generalID);
     if (userGeneral == null)
     {
         ErrorCode = LanguageManager.GetLang().ErrorCode;
         this.ErrorInfo = LanguageManager.GetLang().St1405_GeneralIDNotEnough;
         return false;
     }
     if (ops == 1)
     {
         //佣兵离队时,传承清空
         if (ContextUser.HeritageList.Count > 0)
         {
             GeneralHeritage heritage = ContextUser.HeritageList.Find(m => m.GeneralID == generalID);
             if (heritage != null)
             {
                 ContextUser.HeritageList = new CacheList<GeneralHeritage>();
             }
         }
         List<UserEmbattle> embattleArray = new PersonalCacheStruct<UserEmbattle>().FindAll(ContextUser.UserID, u => u.GeneralID == generalID);
         foreach (UserEmbattle embattle in embattleArray)
         {
             embattle.GeneralID = 0;
         }
         if (userGeneral.GeneralID == LanguageManager.GetLang().GameUserGeneralID)
         {
             this.ErrorCode = LanguageManager.GetLang().ErrorCode;
             this.ErrorInfo = LanguageManager.GetLang().St1405_LiDuiNotFilter;
             return false;
         }
         userGeneral.GeneralStatus = GeneralStatus.LiDui;
     }
     return true;
 }
开发者ID:daneric,项目名称:Scut-samples,代码行数:35,代码来源:Action1405.cs


示例4: GetMaxLife

        public static short _currMaxLv = ObjectExtend.ToShort(ConfigEnvSet.GetInt("User.CurrMaxLv")); //玩家最大等级
        /// <summary>
        /// 获取生命上限,等级*职业初始值+装备+命运水晶(未完成)
        /// </summary>
        /// <returns></returns>
        public static int GetMaxLife(string userID, int generalID)
        {
            //修改者wuzf 2012-04-19
            UserGeneral general = new PersonalCacheStruct<UserGeneral>().FindKey(userID, generalID);

            return general == null ? 0 : general.LifeMaxNum;
        }
开发者ID:daneric,项目名称:Scut-samples,代码行数:12,代码来源:UserHelper.cs


示例5: TakeAction

        public override bool TakeAction()
        {
            UserDailyRestrain dailyRestrain = new PersonalCacheStruct<UserDailyRestrain>().FindKey(ContextUser.UserID);
            if (RankingHelper.IsGainSportsReward(ContextUser.UserID) && dailyRestrain != null && dailyRestrain.UserExtend != null)
            {
                var envSet = ServerEnvSet.Get(ServerEnvKey.JingJiChangReward, "");
                SportsRewardInfo sportsInfo = new ShareCacheStruct<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:daneric,项目名称:Scut-samples,代码行数:26,代码来源:Action5106.cs


示例6: TakeAction

        public override bool TakeAction()
        {

            if (new PersonalCacheStruct<UserFunction>().FindKey(Uid, FunctionEnum.PetRun) == null)
            {
                ErrorCode = LanguageManager.GetLang().ErrorCode;
                ErrorInfo = LanguageManager.GetLang().St_NoFun;
                return false;
            }
            UserDailyRestrain restrain = new PersonalCacheStruct<UserDailyRestrain>().FindKey(Uid);
            if (restrain != null && restrain.UserExtend != null)
            {
                var dailyCacheSet = new ShareCacheStruct<DailyRestrainSet>();
                if (dailyCacheSet.FindKey(RestrainType.PetRun) != null)
                    _runTimes = MathUtils.Subtraction(dailyCacheSet.FindKey(RestrainType.PetRun).MaxNum, restrain.UserExtend.PetRunTimes, 0);
                if (dailyCacheSet.FindKey(RestrainType.PetIntercept) != null)
                    _interceptTimes = MathUtils.Subtraction(dailyCacheSet.FindKey(RestrainType.PetIntercept).MaxNum, restrain.UserExtend.PetIntercept, 0);
                if (dailyCacheSet.FindKey(RestrainType.PetHelp) != null)
                    _helpTimes = MathUtils.Subtraction(dailyCacheSet.FindKey(RestrainType.PetHelp).MaxNum, restrain.UserExtend.PetHelp, 0);
            }
            var petRun = new ShareCacheStruct<PetRunPool>().FindKey(Uid);
            if (petRun != null)
            {
                //问题:在赛跑时有重刷点亮宠物后,等赛跑完服务端与客户端记录宠物ID不一致,原因是赛跑完有将宠物ID清除
                if (petRun.PetID > 0 && petRun.ColdTime == 0)
                {
                    UserHelper.ProcessPetPrize(petRun);
                }
                _coldTime = petRun.ColdTime;
                _petHead = (new ShareCacheStruct<PetInfo>().FindKey(petRun.PetID) ?? new PetInfo()).PetHead;
                if (ContextUser.UserExtend != null)
                    _petId = ContextUser.UserExtend.LightPetID;
            }
            return true;
        }
开发者ID:daneric,项目名称:Scut-samples,代码行数:35,代码来源:Action3201.cs


示例7: TakeAction

        public override bool TakeAction()
        {

            if (ops == 0)
            {
                UserGeneral userGeneral = new PersonalCacheStruct<UserGeneral>().FindKey(ContextUser.UserID, ContextUser.GeneralID);
                if (userGeneral == null)
                {
                    ErrorCode = LanguageManager.GetLang().ErrorCode;
                    return false;
                }
                userGeneral.TrainingPower = ContextUser.TrainingPower;
                userGeneral.TrainingSoul = ContextUser.TrainingSoul;
                userGeneral.TrainingIntellect = ContextUser.TrainingIntellect;
                UserHelper.GetGameUserCombat(ContextUser.UserID);
            }
            else if (ops == 1)
            {
                this.ErrorCode = ops;
            }
            else
            {
                this.ErrorCode = LanguageManager.GetLang().ErrorCode;
                this.ErrorInfo = LanguageManager.GetLang().ServerBusy;
                return false;
            }
            return true;
        }
开发者ID:daneric,项目名称:Scut-samples,代码行数:28,代码来源:Action1410.cs


示例8: TakeAction

        public override bool TakeAction()
        {
            int sumGold = 0;
            int userGold = ConfigEnvSet.GetInt("UserLand.UseGold");
            int intervalDate = ConfigEnvSet.GetInt("UserLand.IntervalDate");
            UserLand land = new PersonalCacheStruct<UserLand>().FindKey(ContextUser.UserID, landPostion);
            if (land != null)
            {
                int subDate = (land.DoRefresh() / intervalDate);
                sumGold = (MathUtils.Addition(subDate, 1, int.MaxValue) * userGold);
            }
            if (Ops == 1)
            {
                this.ErrorCode = 1;
                this.ErrorInfo = string.Format(LanguageManager.GetLang().St10007_DoRefresh, sumGold);
                return false;
            }
            else if (Ops == 2)
            {
                if (ContextUser.GoldNum < sumGold)
                {
                    this.ErrorCode = 2;
                    this.ErrorInfo = LanguageManager.GetLang().St_GoldNotEnough;
                    return false;
                }
                if (land != null && (DateTime.Now - land.GainDate).TotalSeconds < 28800)
                {
                    land.GainDate = MathUtils.SqlMinDate; 
                    ContextUser.UseGold = MathUtils.Addition(ContextUser.UseGold, sumGold, int.MaxValue);
                }
            }

            return true;
        }
开发者ID:daneric,项目名称:Scut-samples,代码行数:34,代码来源:Action10007.cs


示例9: TakeAction

 public override bool TakeAction()
 {
     if (ContextUser.UserStatus == UserStatus.CountryCombat)
     {
         ErrorCode = LanguageManager.GetLang().ErrorCode;
         ErrorInfo = LanguageManager.GetLang().St1902_CountryCombatNotUpEmbattle;
         return false;
     }
     var userMagicArray = new PersonalCacheStruct<UserMagic>().FindAll(ContextUser.UserID, m => m.MagicType == MagicType.MoFaZhen);
     foreach (UserMagic magic in userMagicArray)
     {
         if (magic.MagicID == _magicID)
         {
             magic.IsEnabled = true;
             ContextUser.UseMagicID = _magicID;
             //ContextUser.Update();
         }
         else
         {
             magic.IsEnabled = false;
         }
         //magic.Update();
         UserHelper.GetGameUserCombat(ContextUser.UserID);
     }
     return true;
 }
开发者ID:daneric,项目名称:Scut-samples,代码行数:26,代码来源:Action1903.cs


示例10: FathersDay

 /// <summary>
 /// 父亲节奖励
 /// </summary>
 public static void FathersDay(GameUser user)
 {
     short energyNum = 30;
     int obtainNum = 50;
     int gameGoin = 20000;
     string fatherTime = "2012-06-17 00:00:00";
     DateTime fatherDate = DateTime.Parse(fatherTime);
     UserDailyRestrain dailyRestrain = new PersonalCacheStruct<UserDailyRestrain>().FindKey(user.UserID);
     if (dailyRestrain != null && dailyRestrain.Funtion13 < 1)
     {
         if (DateTime.Now.Date == fatherDate.Date)
         {
             dailyRestrain.Funtion13 = 1;
             //dailyRestrain.Update();
             user.EnergyNum = MathUtils.Addition(user.EnergyNum, energyNum, short.MaxValue);
             user.ObtainNum = MathUtils.Addition(user.ObtainNum, obtainNum, int.MaxValue);
             user.GameCoin = MathUtils.Addition(user.GameCoin, gameGoin, int.MaxValue);
             //user.Update();
             string content = string.Format(LanguageManager.GetLang().St_FathersDay,
                                            energyNum, obtainNum,
                                            gameGoin);
             new TjxChatService().SystemSendWhisper(user, content);
         }
     }
 }
开发者ID:daneric,项目名称:Scut-samples,代码行数:28,代码来源:ActivitiesAward.cs


示例11: action_HappyModeData_enterNum

 public void action_HappyModeData_enterNum(object state)
 {
     ConsoleLog.showNotifyInfo("action_HappyModeData_enterNum begin.");
     var cache = new PersonalCacheStruct<HappyModeData>();
     cache.Foreach(update_HappyModeData_enterNum);
     ConsoleLog.showNotifyInfo("action_HappyModeData_enterNum end.");
 }
开发者ID:guccang,项目名称:scutlogic,代码行数:7,代码来源:RealItemCntUpdate.cs


示例12: BuildPacket

        public override void BuildPacket()
        {
            this.PushIntoStack(heritageList.Count);
            foreach (var item in heritageList)
            {
                UserGeneral userGeneral = new PersonalCacheStruct<UserGeneral>().FindKey(ContextUser.UserID, item.GeneralID);
                GeneralInfo general = new ShareCacheStruct<GeneralInfo>().FindKey(item.GeneralID);
                DataStruct dsItem = new DataStruct();
                dsItem.PushIntoStack((short)item.Type);
                dsItem.PushIntoStack(userGeneral == null ? 0 : userGeneral.GeneralID);
                dsItem.PushIntoStack(userGeneral == null ? string.Empty : ObjectExtend.ToNotNullString(userGeneral.GeneralName));
                dsItem.PushIntoStack(general == null ? string.Empty : ObjectExtend.ToNotNullString(general.BattleHeadID));
                dsItem.PushIntoStack(item.GeneralLv);
                dsItem.PushIntoStack(item.PowerNum);
                dsItem.PushIntoStack(item.SoulNum);
                dsItem.PushIntoStack(item.IntellectNum);
                dsItem.PushIntoStack(userGeneral == null ? (short)0 : (short)userGeneral.GeneralQuality);
                this.PushIntoStack(dsItem);
            }
            this.PushIntoStack(opsInfoList.Count);
            foreach (var item in opsInfoList)
            {
                DataStruct dsItem = new DataStruct();
                dsItem.PushIntoStack(item.Type);
                dsItem.PushIntoStack(item.VipLv);
                dsItem.PushIntoStack(item.UseGold);
                dsItem.PushIntoStack(item.ItemID);
                dsItem.PushIntoStack(item.ItemNum);
                this.PushIntoStack(dsItem);
            }
            this.PushIntoStack(heritageName.ToNotNullString());
            this.PushIntoStack(heritageLv);
            this.PushIntoStack(disGeneralName.ToNotNullString());

        }
开发者ID:daneric,项目名称:Scut-samples,代码行数:35,代码来源:Action1416.cs


示例13: CreateSkillLvInfo

 public static List<SkillLvInfo> CreateSkillLvInfo(CombatGeneral general)
 {
     List<SkillLvInfo> _skillLvList = new List<SkillLvInfo>();
     if (general.GeneralID == LanguageManager.GetLang().GameUserGeneralID)
     {
         var abilityCacheSet = new ShareCacheStruct<AbilityInfo>();
         var skillLvSet = new ShareCacheStruct<SkillLvInfo>();
         UserTrump userTrump = new PersonalCacheStruct<UserTrump>().FindKey(general.UserID, TrumpInfo.CurrTrumpID) ?? new UserTrump();
         if (userTrump.LiftNum > 0)
         {
             userTrump.SkillInfo.Foreach(obj =>
             {
                 var abilityInfo = abilityCacheSet.FindKey(obj.AbilityID) ?? new AbilityInfo();
                 if (abilityInfo.AttackType == AttackType.Trigger)
                 {
                     var temp = skillLvSet.FindKey(obj.AbilityID, obj.AbilityLv);
                     if (temp != null)
                     {
                         _skillLvList.Add(temp);
                     }
                 }
                 return true;
             });
         }
     }
     return _skillLvList;
 }
开发者ID:daneric,项目名称:Scut-samples,代码行数:27,代码来源:TrumpAbilityAttack.cs


示例14: GetPayment

        private static bool GetPayment(int game, int server, string account, string userID)
        {
            try
            {
                GameUser userInfo = new PersonalCacheStruct<GameUser>().FindKey(userID);
                if (userInfo == null) return false;
                var chatService = new TjxChatService();
                OrderInfo[] model = PayManager.getPayment(game, server, account);
                foreach (OrderInfo order in model)
                {
                    userInfo.PayGold = MathUtils.Addition(userInfo.PayGold, order.GameCoins, int.MaxValue);
                    //userInfo.Update();
                    PayManager.Abnormal(order.OrderNO);

                    DialHelper.ReturnRatioGold(userID, order.GameCoins);  //大转盘抽奖奖励充值返还
                    chatService.SystemSendWhisper(userInfo, string.Format(LanguageManager.GetLang().PaySuccessMsg, order.GameCoins));

                    DoGiff(userID, order);
                    FestivalHelper.GetPayReward(userInfo, order.GameCoins, FestivalType.PayReward);
                }
                return true;
            }
            catch (Exception ex)
            {
                BaseLog log = new BaseLog("PaymentLog");
                log.SaveLog(ex);
                return false;
            }
        }
开发者ID:daneric,项目名称:Scut-samples,代码行数:29,代码来源:PaymentService.cs


示例15: TakeAction

        public override bool TakeAction()
        {
            UserTrump userTrump = new PersonalCacheStruct<UserTrump>().FindKey(ContextUser.UserID, TrumpInfo.CurrTrumpID);
            if (userTrump != null && userTrump.PropertyInfo.Count > 0)
            {
                GeneralProperty property = userTrump.PropertyInfo.Find(m => m.AbilityType == propertyID);
                if (property != null)
                {
                    if (property.AbilityLv >= TrumpPropertyInfo.MaxTrumpPropertyLv)
                    {
                        ErrorCode = LanguageManager.GetLang().ErrorCode;
                        ErrorInfo = LanguageManager.GetLang().St1466_OutPropertyMaxLv;
                        return false;
                    }
                    TrumpPropertyInfo trumpProperty = new ShareCacheStruct<TrumpPropertyInfo>().FindKey(property.AbilityType, property.AbilityLv);
                    if (trumpProperty != null)
                    {
                        int upItemNum = TrumpHelper.GetUserItemNum(ContextUser.UserID, trumpProperty.ItemID);
                        if (upItemNum < trumpProperty.ItemNum)
                        {
                            ErrorCode = LanguageManager.GetLang().ErrorCode;
                            ErrorInfo = LanguageManager.GetLang().St1462_ItemNumNotEnough;
                            return false;
                        }
                        if (ContextUser.GameCoin < trumpProperty.GameCoin)
                        {
                            ErrorCode = LanguageManager.GetLang().ErrorCode;
                            ErrorInfo = LanguageManager.GetLang().St_GameCoinNotEnough;
                            return false;
                        }
                        if (ContextUser.ObtainNum < trumpProperty.ObtainNum)
                        {
                            ErrorCode = LanguageManager.GetLang().ErrorCode;
                            ErrorInfo = LanguageManager.GetLang().St_ObtainNumNotEnough;
                            return false;
                        }
                        ContextUser.ObtainNum = MathUtils.Subtraction(ContextUser.ObtainNum, trumpProperty.ObtainNum);
                        ContextUser.GameCoin = MathUtils.Subtraction(ContextUser.GameCoin, trumpProperty.GameCoin);
                        UserItemHelper.UseUserItem(ContextUser.UserID, trumpProperty.ItemID, trumpProperty.ItemNum);
                        short upLv = MathUtils.Addition(property.AbilityLv, (short)1, (short)TrumpPropertyInfo.MaxTrumpPropertyLv);
                        TrumpPropertyInfo uptrumpProperty = new ShareCacheStruct<TrumpPropertyInfo>().FindKey(property.AbilityType, upLv);
                        property.UpdateNotify(obj =>
                        {
                            property.AbilityLv = MathUtils.Addition(property.AbilityLv, (short)1, TrumpPropertyInfo.MaxTrumpPropertyLv);
                            property.AbilityValue = uptrumpProperty.PropertyNum;
                            return true;
                        });
                        var usergeneral = UserGeneral.GetMainGeneral(ContextUser.UserID);
                        if (usergeneral != null)
                        {
                            usergeneral.RefreshMaxLife();
                        }
                        ErrorCode = 0;
                        ErrorInfo = LanguageManager.GetLang().St1464_UpgradeWasSsuccessful;

                    }
                }
            }
            return true;
        }
开发者ID:daneric,项目名称:Scut-samples,代码行数:60,代码来源:Action1469.cs


示例16: 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 PersonalCacheStruct<GameUser>().FindKey(teamUser.UserId);
                UserGeneral general = UserGeneral.GetMainGeneral(teamUser.UserId);
                CareerInfo careerInfo = null;
                if (general != null)
                {
                    careerInfo = new ShareCacheStruct<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:daneric,项目名称:Scut-samples,代码行数:33,代码来源:Action4204.cs


示例17: TakeAction

        public override bool TakeAction()
        {
            var cacheSet = new PersonalCacheStruct<UserQueue>();
            List<UserQueue> userQueueList = cacheSet.FindAll(ContextUser.UserID, m => m.QueueType == QueueType.SaoDang);

            foreach (UserQueue queue in userQueueList)
            {
                if (queue != null)
                {
                    int npcCount = new ShareCacheStruct<PlotNPCInfo>().FindAll(m => m.PlotID == plotID).Count;
                    //战斗次数
                    int totalBattleNum = (int)Math.Floor((double)(queue.TotalColdTime - queue.DoRefresh()) / PlotInfo.BattleSpeedNum);
                    int turnsNum = totalBattleNum / npcCount;
                    int battleNum = totalBattleNum % npcCount;
                    //没发生战斗或上未通关都返还精力
                    //if (turnsNum == 0 || battleNum > 0)
                    //{
                    //    ContextUser.EnergyNum = ContextUser.EnergyNum.Addition(PlotInfo.BattleEnergyNum, short.MaxValue);
                    //}
                    cacheSet.Delete(queue);
                }
            }

            if (ContextUser.UserStatus == UserStatus.SaoDang)
            {
                ContextUser.ResetSweepPool(0);
                ContextUser.UserStatus = UserStatus.Normal;
                //ContextUser.Update();
            }
            return true;
        }
开发者ID:daneric,项目名称:Scut-samples,代码行数:31,代码来源:Action4010.cs


示例18: BuildPacket

        public override void BuildPacket()
        {
            PushIntoStack(_chargePacksArray.Count);
            foreach (RechargePacks packs in _chargePacksArray)
            {
                short _isRevice = 0;
                short _isShow = 0;
                List<PackageReceive> receivesArray = new PersonalCacheStruct<PackageReceive>().FindAll(ContextUser.UserID, u => u.IsReceive == false && u.PacksID == packs.PacksID);
                if (receivesArray.Count == 0)
                {
                    _isRevice = 2;
                }
                else
                {
                    _isRevice = 1;
                }
                SaveLog(receivesArray.Count + ContextUser.UserID + packs.PacksID);

                DataStruct dsItem = new DataStruct();
                dsItem.PushIntoStack(packs.PacksID);
                dsItem.PushIntoStack(packs.PacksName);
                dsItem.PushIntoStack(_isRevice);
                dsItem.PushIntoStack(_isShow);
                dsItem.PushIntoStack(receivesArray.Count);
                PushIntoStack(dsItem);
            }
        }
开发者ID:daneric,项目名称:Scut-samples,代码行数:27,代码来源:Action9003.cs


示例19: TakeAction

        public override bool TakeAction()
        {

            if (ContextUser.TempEnergyNum > 0 && ContextUser.UserStatus != UserStatus.Combat)
            {
                List<UserPlotCombat> plotCombatList = new PersonalCacheStruct<UserPlotCombat>().FindAll(ContextUser.UserID, m => m.PlotID == plotID);
                //没发生战斗或上次战斗失败都返还精力
                if (plotCombatList.Count == 0 || (ContextUser.TempEnergyNum > 0 && IsNotCombat(plotCombatList)))
                {
                    if (ContextUser.SurplusEnergy == 0 && !ContextUser.IsSurplus) //策划要求:领取的不返还
                    {
                        if (ContextUser.UserExtend != null && ContextUser.UserExtend.PlotStatusID > 0 && ContextUser.UserExtend.MercenarySeq <= 1)
                        {
                            ContextUser.TempEnergyNum = 0;
                            ContextUser.EnergyNum = MathUtils.Addition(ContextUser.EnergyNum, PlotInfo.BattleEnergyNum, short.MaxValue);
                        }
                        //ContextUser.Update();
                    }
                }
            }
            if (ContextUser.UserExtend != null)
            {
                ContextUser.UserExtend.UpdateNotify(obj =>
                {
                    ContextUser.UserExtend.PlotStatusID = 0;
                    ContextUser.UserExtend.PlotNpcID = -1;
                    ContextUser.UserExtend.MercenarySeq = 0;
                    ContextUser.UserExtend.IsBoss = false;
                    return true;
                });
            }
            return true;
        }
开发者ID:daneric,项目名称:Scut-samples,代码行数:33,代码来源:Action4005.cs


示例20: TakeAction

        public override bool TakeAction()
        {
            GeneralProperty property = null;
            UserTrump userTrump = new PersonalCacheStruct<UserTrump>().FindKey(ContextUser.UserID, TrumpInfo.CurrTrumpID);
            if (userTrump != null && userTrump.PropertyInfo.Count > 0)
            {
                property = userTrump.PropertyInfo.Find(m => m.AbilityType == propertyID);
            }
            if (property == null)
            {
                return false;
            }
            if (ops == 1)
            {
                ErrorCode = ops;
                ErrorInfo = LanguageManager.GetLang().St1467_WorshipGridNotEnough;
                return false;
            }
            else if (ops == 2)
            {
                ErrorCode = ops;
                userTrump.PropertyInfo.Remove(property);
                
                var usergeneral = UserGeneral.GetMainGeneral(ContextUser.UserID);
                if (usergeneral != null)
                {
                    usergeneral.RefreshMaxLife();
                }
            }

            return true;
        }
开发者ID:daneric,项目名称:Scut-samples,代码行数:32,代码来源:Action1467.cs



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C# PersonalizationScope类代码示例发布时间:2022-05-24
下一篇:
C# Personal类代码示例发布时间:2022-05-24
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap