Example #1
0
        public static GameUser GetGameUser(string userID)
        {
            var      cacheSet = new GameDataCacheSet <GameUser>();
            GameUser userInfo = cacheSet.FindKey(userID);

            if (userInfo == null)
            {
                UserCacheGlobal.Load(userID);//重新刷缓存
                userInfo = cacheSet.FindKey(userID);
            }
            return(userInfo);
        }
Example #2
0
        /// <summary>
        /// ����,�����Ա���ߵģ�ְ�������ܹ��׽��򣬼���ʱ�併��
        /// </summary>
        /// <param name="itemData"></param>
        /// <returns></returns>
        public override int CompareTo(ShareEntity itemData)
        {
            GuildMember other  = itemData as GuildMember;
            int         result = 0;

            if (this == null && other == null)
            {
                return(0);
            }
            if (this != null && other == null)
            {
                return(1);
            }
            if (this == null && other != null)
            {
                return(-1);
            }

            var      cacheSet  = new GameDataCacheSet <GameUser>();
            GameUser otherUser = cacheSet.FindKey(other.UserID);

            if (otherUser == null)
            {
                otherUser = UserCacheGlobal.CheckLoadUser(other.UserID);
            }
            GameUser user = cacheSet.FindKey(UserID);

            if (user == null)
            {
                user = UserCacheGlobal.CheckLoadUser(UserID);
            }
            if (otherUser != null && user != null)
            {
                result = otherUser.IsOnline.CompareTo(user.IsOnline);
            }
            if (result == 0)
            {
                result = ((int)PostType).CompareTo((int)other.PostType);
                if (result == 0)
                {
                    result = other.TotalContribution.CompareTo(TotalContribution);
                    if (result == 0)
                    {
                        result = other.InsertDate.CompareTo(InsertDate);
                    }
                }
            }
            return(result);
        }