Пример #1
0
        public static void AddCardReward(string userID, string cardUserID, short userlv)
        {
            var            cacheSet   = new PersonalCacheStruct <UserCardReward>();
            UserCardReward cardReward = new UserCardReward();

            cardReward.UserID     = userID;
            cardReward.CardUserID = cardUserID;
            cardReward.UserLv     = userlv;
            cardReward.CreateDate = DateTime.Now;
            cacheSet.Add(cardReward);
            cacheSet.Update();
        }
Пример #2
0
        public static void AddCardReward(string userID, string cardUserID, short userlv)
        {
            var            cacheSet   = new GameDataCacheSet <UserCardReward>();
            UserCardReward cardReward = new UserCardReward();

            cardReward.UserID     = userID;
            cardReward.CardUserID = cardUserID;
            cardReward.UserLv     = userlv;
            cardReward.CreateDate = DateTime.Now;
            cacheSet.Add(cardReward, GameEnvironment.CacheUserPeriod);
            cacheSet.Update();
        }
Пример #3
0
        /// <summary>
        /// 是否可领取奖励
        /// </summary>
        /// <param name="userID"></param>
        /// <param name="userLv"></param>
        /// <returns></returns>
        public static bool IsReward(string userID, short userLv, short newhandLv)
        {
            var cacheSet = new PersonalCacheStruct <UserCardReward>();

            if (userLv >= newhandLv)
            {
                UserCardReward card = cacheSet.FindKey(userID, strUserID, newhandLv);
                if (card == null)
                {
                    return(true);
                }
            }
            return(false);
        }