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(); }
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(); }
/// <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); }