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


C# GameDataCacheSet类代码示例

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


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

示例1: TakeAction

        public override bool TakeAction()
        {
            var cacheSet = new GameDataCacheSet<GameUser>();

            GameUser user = cacheSet.FindKey(_useridreq);
            if (null != user)
            {
                if ((user.UserName != _username)
                    || (user.UserType != _usertype))
                {
                    return false;
                }

                /*更新客户端上报的存档信息*/
                user.ClientArchive = _clientarchive;

                cacheSet.Add(user);
                cacheSet.Update();

                return true;
            }
            else
            {
                return false;
            }
        }
开发者ID:wenhulove333,项目名称:ScutServer,代码行数:26,代码来源:Action1001.cs

示例2: TakeAction

        public override bool TakeAction()
        {

            if (ops == 0)
            {
                UserGeneral userGeneral = new GameDataCacheSet<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:jinfei426,项目名称:Scut,代码行数:28,代码来源:Action1410.cs

示例3: TakeAction

 public override bool TakeAction()
 {
     int useGold = ConfigEnvSet.GetInt("TrumpZodiac.ChangeZodiacUseGold");
     if (ops == 1)
     {
         ErrorCode = ops;
         ErrorInfo = string.Format(LanguageManager.GetLang().St1471_ChangeZodiac, useGold);
         return false;
     }
     else if (ops == 2)
     {
         if (ContextUser.GoldNum < useGold)
         {
             ErrorCode = LanguageManager.GetLang().ErrorCode;
             ErrorInfo = LanguageManager.GetLang().St_GoldNotEnough;
             return false;
         }
         var cacheSet = new GameDataCacheSet<UserTrump>();
         UserTrump userTrump = cacheSet.FindKey(ContextUser.UserID, TrumpInfo.CurrTrumpID);
         if (userTrump != null)
         {
             userTrump.Zodiac = TrumpHelper.GetZodiacType(userTrump.Zodiac);
             ContextUser.UseGold = MathUtils.Addition(ContextUser.UseGold, useGold, int.MaxValue);
         }
         ErrorCode = ops;
     }
     return true;
 }
开发者ID:jinfei426,项目名称:Scut,代码行数:28,代码来源:Action1471.cs

示例4: AddExprerience

 public static void AddExprerience(GameUser user, int experience)
 {
     string userID = user.UserID;
     var userEmbattleList = new GameDataCacheSet<UserEmbattle>().FindAll(userID, m => m.MagicID == user.UseMagicID);
     HashSet<int> generalHash = new HashSet<int>();
     foreach (UserEmbattle userEmbattle in userEmbattleList)
     {
         //wuzf 8-18 修复多个相同佣兵阵形数据
         if (generalHash.Contains(userEmbattle.GeneralID))
         {
             userEmbattle.GeneralID = 0;
             //userEmbattle.Update();
             continue;
         }
         else
         {
             generalHash.Add(userEmbattle.GeneralID);
         }
         //UserGeneral userGeneral = new GameDataCacheSet<UserGeneral>().FindKey(userID, userEmbattle.GeneralID);
         //if (userGeneral != null)
         //{
         //    userGeneral.CurrExperience = MathUtils.Addition(userGeneral.CurrExperience, experience);
         //}
     }
     //UserHelper.UserGeneralExp(user.UserID, experience);
 }
开发者ID:0jpq0,项目名称:Scut,代码行数:26,代码来源:PlotHelper.cs

示例5: TakeAction

 public override bool TakeAction()
 {
     if (ContextUser.UserStatus == UserStatus.CountryCombat)
     {
         ErrorCode = LanguageManager.GetLang().ErrorCode;
         ErrorInfo = LanguageManager.GetLang().St1902_CountryCombatNotUpEmbattle;
         return false;
     }
     var userMagicArray = new GameDataCacheSet<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:jinfei426,项目名称:Scut,代码行数:26,代码来源:Action1903.cs

示例6: TakeAction

 public override bool TakeAction()
 {
     var package = UserItemPackage.Get(ContextUser.UserID);
     UserItemInfo userItem = package.ItemPackage.Find(m => !m.IsRemove && m.UserItemID == userItemID);
     if (userItem != null)
     {
         UserTrump userTrump = new GameDataCacheSet<UserTrump>().FindKey(ContextUser.UserID, TrumpInfo.CurrTrumpID);
         if (userTrump != null && userTrump.TrumpLv >= GameConfigSet.MaxTrumpLv)
         {
             ErrorCode = LanguageManager.GetLang().ErrorCode;
             ErrorInfo = LanguageManager.GetLang().St1456_OutTrumpMaxLv;
             return false;
         }
         ItemBaseInfo itemInfo = new ConfigCacheSet<ItemBaseInfo>().FindKey(userItem.ItemID);
         if (itemInfo != null && itemInfo.PropType == 10)
         {
             TrumpHelper.CheckTrumpEscalate(ContextUser.UserID, itemInfo.EffectNum);
             UserItemHelper.UseUserItem(ContextUser.UserID, itemInfo.ItemID, 1);
             var usergeneral = UserGeneral.GetMainGeneral(ContextUser.UserID);
             if (usergeneral != null)
             {
                 usergeneral.RefreshMaxLife();
             }
         }
     }
     return true;
 }
开发者ID:0jpq0,项目名称:Scut,代码行数:27,代码来源:Action1456.cs

示例7: CheckUserPlotHurdleNum

        /// <summary>
        /// 天地劫副本关数
        /// </summary>
        /// <param name="user"></param>
        public static int CheckUserPlotHurdleNum(GameUser user)
        {
            int hurdleNum = 0;
            PlotInfo plotInfo = CheckUserPlotKalpa(user);
            if (plotInfo != null)
            {
                UserDailyRestrain dailyRestrain = new GameDataCacheSet<UserDailyRestrain>().FindKey(user.UserID);
                if (dailyRestrain != null && dailyRestrain.UserExtend != null && dailyRestrain.UserExtend.KalpaDate.Date == DateTime.Now.Date)
                {
                    hurdleNum = user.UserExtend.HurdleNum;
                }
                else
                {
                    hurdleNum = plotInfo.PlotSeqNo;

                    if (user.UserExtend != null && hurdleNum > 0)
                    {
                        user.UserExtend.UpdateNotify(obj =>
                            {
                                user.UserExtend.HurdleNum = hurdleNum;
                                return true;
                            });
                        //user.Update();
                    }
                }
            }
            else
            {
                hurdleNum = 1;
            }
            return hurdleNum;
        }
开发者ID:rongxiong,项目名称:Scut,代码行数:36,代码来源:Action4301.cs

示例8: TakeAction

 public override bool TakeAction()
 {
     if (ContextUser.TempEnergyNum > 0 && ContextUser.UserStatus != UserStatus.Combat)
     {
         List<UserPlotCombat> plotCombatList = new GameDataCacheSet<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:0jpq0,项目名称:Scut,代码行数:32,代码来源:Action4005.cs

示例9: TakeAction

        public override bool TakeAction()
        {
            GeneralProperty property = null;
            UserTrump userTrump = new GameDataCacheSet<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:jinfei426,项目名称:Scut,代码行数:32,代码来源:Action1467.cs

示例10: 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

示例11: 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

示例12: CreateSkillLvInfo

 public static List<SkillLvInfo> CreateSkillLvInfo(CombatGeneral general)
 {
     List<SkillLvInfo> _skillLvList = new List<SkillLvInfo>();
     if (general.GeneralID == LanguageManager.GetLang().GameUserGeneralID)
     {
         var abilityCacheSet = new ConfigCacheSet<AbilityInfo>();
         var skillLvSet = new ConfigCacheSet<SkillLvInfo>();
         UserTrump userTrump = new GameDataCacheSet<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:kehaoran74,项目名称:Scut,代码行数:27,代码来源:TrumpAbilityAttack.cs

示例13: GetPayment

        private static bool GetPayment(int game, int server, string account, string userID)
        {
            try
            {
                GameUser userInfo = new GameDataCacheSet<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:jinfei426,项目名称:Scut,代码行数:29,代码来源:PaymentService.cs

示例14: BuildPacket

 public override void BuildPacket()
 {
     this.PushIntoStack(heritageList.Count);
     foreach (var item in heritageList)
     {
         UserGeneral userGeneral = new GameDataCacheSet<UserGeneral>().FindKey(ContextUser.UserID, item.GeneralID);
         GeneralInfo general = new ConfigCacheSet<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:rongxiong,项目名称:Scut,代码行数:34,代码来源:Action1416.cs

示例15: GameTable

 private GameTable()
 {
     _cardRole = new CardRole();
     _pokerConfig = new ShareCacheStruct<PokerInfo>();
     _userCacheSet = new GameDataCacheSet<GameUser>();
     _roomStruct = new MemoryCacheStruct<RoomData>();
 }
开发者ID:kehaoran74,项目名称:Scut,代码行数:7,代码来源:GameTable.cs


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