示例#1
0
 public static string GetFriendSourceDesc(ulong friendUid, COMDT_FRIEND_SOURCE friendSource)
 {
     if (friendSource != null)
     {
         COM_ADD_FRIEND_TYPE bAddFriendType = friendSource.bAddFriendType;
         if (bAddFriendType == 1)
         {
             string heroName = CHeroInfo.GetHeroName(friendSource.stAddFriendInfo.get_stPvp().dwHeroID);
             if (!string.IsNullOrEmpty(heroName))
             {
                 return(Singleton <CTextManager> .GetInstance().GetText("Friend_Apply_Play_With_You_Tip", new string[]
                 {
                     heroName
                 }));
             }
             DebugHelper.Assert(false, "好友来源是PVP,但却获取不了英雄名,heroId={0}", new object[]
             {
                 friendSource.stAddFriendInfo.get_stPvp().dwHeroID
             });
         }
         else
         {
             if (CGuildHelper.IsInSameGuild(friendUid))
             {
                 return(Singleton <CTextManager> .GetInstance().GetText("Friend_Apply_Same_Guild_Tip"));
             }
             if (bAddFriendType == 2)
             {
                 return(Singleton <CTextManager> .GetInstance().GetText("Friend_Apply_Nearby_You_Tip"));
             }
         }
     }
     return(string.Empty);
 }
示例#2
0
 public stFriendVerifyContent(ulong ullUid, uint dwLogicWorldID, string content, COMDT_FRIEND_SOURCE friendSource, int mentor_type = 0)
 {
     this.ullUid         = ullUid;
     this.dwLogicWorldID = dwLogicWorldID;
     this.content        = content;
     this.friendSource   = friendSource;
     this.mentorType     = mentor_type;
 }
示例#3
0
        public static void ShowFriendData(COMDT_FRIEND_INFO info, FriendShower com, FriendShower.ItemType type, bool bShowNickName, CFriendModel.FriendType friendType)
        {
            if (info == null)
            {
                return;
            }
            com.ullUid         = info.stUin.ullUid;
            com.dwLogicWorldID = info.stUin.dwLogicWorldId;
            UT.SetHttpImage(com.HttpImage, info.szHeadUrl);
            if (com.nobeIcon)
            {
                MonoSingleton <NobeSys> .GetInstance().SetNobeIcon(com.nobeIcon.GetComponent <Image>(), (int)info.stGameVip.dwCurLevel, false);
            }
            if (com.HeadIconBack)
            {
                MonoSingleton <NobeSys> .GetInstance().SetHeadIconBk(com.HeadIconBack.GetComponent <Image>(), (int)info.stGameVip.dwHeadIconId);
            }
            if (com.QQVipImage)
            {
                MonoSingleton <NobeSys> .GetInstance().SetOtherQQVipHead(com.QQVipImage.GetComponent <Image>(), (int)info.dwQQVIPMask);
            }
            if ((type == FriendShower.ItemType.Normal && friendType == CFriendModel.FriendType.GameFriend) || type == FriendShower.ItemType.Mentor || type == FriendShower.ItemType.Apprentice)
            {
                CFriendModel model = Singleton <CFriendContoller> .get_instance().model;

                ushort num;
                CFriendModel.EIntimacyType type2;
                bool bFreeze;
                if (model.GetFriendIntimacy(info.stUin.ullUid, info.stUin.dwLogicWorldId, out num, out type2, out bFreeze))
                {
                    if (num == 0)
                    {
                        com.intimacyNode.CustomSetActive(false);
                    }
                    else
                    {
                        com.intimacyNode.CustomSetActive(true);
                        CFR cfr = model.FRData.GetCfr(info.stUin.ullUid, info.stUin.dwLogicWorldId);
                        if (cfr != null)
                        {
                            com.ShowIntimacyNum((int)num, type2, bFreeze, cfr.state);
                        }
                        else
                        {
                            com.ShowIntimacyNum((int)num, type2, bFreeze, 0);
                        }
                    }
                }
                else
                {
                    com.intimacyNode.CustomSetActive(false);
                }
            }
            else
            {
                com.intimacyNode.CustomSetActive(false);
            }
            com.SetFriendItemType(type, !bShowNickName);
            bool flag = type == FriendShower.ItemType.Normal || type == FriendShower.ItemType.Mentor || type == FriendShower.ItemType.Apprentice || type == FriendShower.ItemType.AddMentor || type == FriendShower.ItemType.AddApprentice || type == FriendShower.ItemType.MentorRequest;

            com.SetBGray(flag && info.bIsOnline != 1);
            com.ShowLevel(info.dwPvpLvl);
            com.ShowVipLevel(info.dwVipLvl);
            com.ShowLastTime(info.bIsOnline != 1, UT.GetTimeString(info.dwLastLoginTime));
            switch (type)
            {
            case FriendShower.ItemType.Request:
            {
                string friendVerifyContent = Singleton <CFriendContoller> .get_instance().model.GetFriendVerifyContent(info.stUin.ullUid, info.stUin.dwLogicWorldId, CFriendModel.enVerifyDataSet.Friend);

                com.ShowVerify(friendVerifyContent);
                break;
            }

            case FriendShower.ItemType.MentorRequest:
            {
                string friendVerifyContent2 = Singleton <CFriendContoller> .get_instance().model.GetFriendVerifyContent(info.stUin.ullUid, info.stUin.dwLogicWorldId, CFriendModel.enVerifyDataSet.Mentor);

                com.ShowVerify(friendVerifyContent2);
                break;
            }
            }
            CFriendModel.FriendInGame friendInGaming = Singleton <CFriendContoller> .get_instance().model.GetFriendInGaming(info.stUin.ullUid, info.stUin.dwLogicWorldId);

            string text;

            if (friendInGaming == null)
            {
                text = UT.Bytes2String(info.szUserName);
                com.ShowGameState(0, info.bIsOnline == 1);
            }
            else
            {
                if (!string.IsNullOrEmpty(friendInGaming.NickName) && bShowNickName)
                {
                    text = string.Format("{0}({1})", UT.Bytes2String(info.szUserName), friendInGaming.NickName);
                }
                else
                {
                    text = UT.Bytes2String(info.szUserName);
                }
                com.ShowGameState(friendInGaming.State, info.bIsOnline == 1);
            }
            switch (type)
            {
            case FriendShower.ItemType.Request:
            {
                string friendSourceDesc = UT.GetFriendSourceDesc(info.stUin.ullUid, Singleton <CFriendContoller> .get_instance().model.GetFriendVerifySource(info.stUin.ullUid, info.stUin.dwLogicWorldId, CFriendModel.enVerifyDataSet.Friend));
                if (!string.IsNullOrEmpty(friendSourceDesc))
                {
                    text = text + " " + friendSourceDesc;
                }
                break;
            }

            case FriendShower.ItemType.MentorRequest:
            {
                COMDT_FRIEND_SOURCE friendVerifySource = Singleton <CFriendContoller> .get_instance().model.GetFriendVerifySource(info.stUin.ullUid, info.stUin.dwLogicWorldId, CFriendModel.enVerifyDataSet.Mentor);

                if (friendVerifySource != null)
                {
                    string friendSourceDesc2 = UT.GetFriendSourceDesc(info.stUin.ullUid, friendVerifySource);
                    if (!string.IsNullOrEmpty(friendSourceDesc2))
                    {
                        text = text + " " + friendSourceDesc2;
                    }
                }
                break;
            }
            }
            com.ShowName(text);
            if (Singleton <CGuildSystem> .GetInstance().CanInvite(info))
            {
                if (Singleton <CGuildSystem> .GetInstance().HasInvited(info.stUin.ullUid))
                {
                    com.ShowinviteGuild(true, false);
                }
                else
                {
                    com.ShowinviteGuild(true, true);
                }
            }
            else if (Singleton <CGuildSystem> .GetInstance().CanRecommend(info))
            {
                if (Singleton <CGuildSystem> .GetInstance().HasRecommended(info.stUin.ullUid))
                {
                    com.ShowRecommendGuild(true, false);
                }
                else
                {
                    com.ShowRecommendGuild(true, true);
                }
            }
            else
            {
                com.ShowinviteGuild(false, false);
            }
            bool bEnable = Singleton <CFriendContoller> .get_instance().model.HeartData.BCanSendHeart(info.stUin);

            com.ShowSendButton(bEnable);
            if (CSysDynamicBlock.bSocialBlocked)
            {
                com.HideSendButton();
            }
            if (com.m_mentorTitleObj != null && com.m_mentorTitleObj.transform.parent != null)
            {
                com.m_mentorTitleObj.transform.parent.gameObject.CustomSetActive(false);
            }
            if (UT.NeedShowGenderGradeByMentor(type, friendType))
            {
                com.ShowMentorSearchInfo(info, friendType, type);
                com.HideSendButton();
            }
            else if (friendType == CFriendModel.FriendType.Mentor || friendType == CFriendModel.FriendType.Apprentice)
            {
                com.ShowInviteButton(false, false);
            }
            else if (CSysDynamicBlock.bSocialBlocked)
            {
                com.ShowInviteButton(false, false);
            }
            else if (friendType == CFriendModel.FriendType.GameFriend)
            {
                com.ShowInviteButton(false, false);
            }
            else if (friendType == CFriendModel.FriendType.SNS)
            {
                bool isShow = CFriendReCallData.BLose(info.stUin, 2);
                bool flag2  = Singleton <CFriendContoller> .get_instance().model.SnsReCallData.BInCd(info.stUin, 2);

                bool flag3 = CFriendModel.IsOnSnsSwitch(info.dwRefuseFriendBits, 0);
                com.ShowInviteButton(isShow, !flag2 && !flag3);
            }
            if (Singleton <COBSystem> .get_instance().IsInOBFriendList(info.stUin.ullUid))
            {
                com.ShowOBButton(true);
            }
            else
            {
                com.ShowOBButton(false);
            }
            com.ShowGenderType(info.bGender);
            com.ShowPlatChannelIcon(info);
            com.ShowSendGiftBtn(true);
            if (friendType == CFriendModel.FriendType.Mentor || friendType == CFriendModel.FriendType.Apprentice)
            {
                enMentorRelationType enMentorRelationType = (enMentorRelationType)(info.bStudentType >> 4);
                int num2 = (int)(info.bStudentType & 15);
                switch (enMentorRelationType)
                {
                case enMentorRelationType.mentor:
                    if (com.mentor_relationship != null)
                    {
                        com.mentor_relationship.CustomSetActive(friendType == CFriendModel.FriendType.Mentor);
                        com.mentor_relationship.transform.Find("MentorRelationText").GetComponent <Text>().text = Singleton <CTextManager> .GetInstance().GetText("Mentor_mentor");
                    }
                    break;

                case enMentorRelationType.schoolmate:
                    if (com.mentor_relationship != null)
                    {
                        com.mentor_relationship.CustomSetActive(friendType == CFriendModel.FriendType.Mentor);
                        com.mentor_relationship.transform.Find("MentorRelationText").GetComponent <Text>().text = Singleton <CTextManager> .GetInstance().GetText("Mentor_schoolmate");
                    }
                    if (com.normal_node != null)
                    {
                        com.normal_node.CustomSetActive(true);
                    }
                    for (int i = 0; i < com.normal_node.transform.childCount; i++)
                    {
                        Transform child = com.normal_node.transform.GetChild(i);
                        if (child != null)
                        {
                            child.gameObject.CustomSetActive(false);
                        }
                    }
                    break;
                }
                int num3 = num2;
                if (num3 != 1)
                {
                    if (num3 == 2)
                    {
                        if (com.mentor_graduation != null)
                        {
                            com.mentor_graduation.CustomSetActive(friendType == CFriendModel.FriendType.Apprentice || enMentorRelationType == enMentorRelationType.schoolmate);
                            com.mentor_graduation.transform.Find("MentorStatusText").GetComponent <Text>().text = Singleton <CTextManager> .GetInstance().GetText("Mentor_Graduated");

                            if (com.normal_node != null)
                            {
                                com.normal_node.CustomSetActive(true);
                            }
                            for (int j = 0; j < com.normal_node.transform.childCount; j++)
                            {
                                Transform child2 = com.normal_node.transform.GetChild(j);
                                if (child2 != null)
                                {
                                    child2.gameObject.CustomSetActive(false);
                                }
                            }
                            if (com.del_node != null)
                            {
                                com.del_node.CustomSetActive(enMentorRelationType == enMentorRelationType.apprentice);
                            }
                        }
                    }
                }
                else if (com.mentor_graduation != null)
                {
                    com.mentor_graduation.CustomSetActive(friendType == CFriendModel.FriendType.Apprentice || enMentorRelationType == enMentorRelationType.schoolmate);
                    com.mentor_graduation.transform.Find("MentorStatusText").GetComponent <Text>().text = Singleton <CTextManager> .GetInstance().GetText("Mentor_InStudy");
                }
                CFriendModel model2 = Singleton <CFriendContoller> .get_instance().model;

                UT.SetAddNodeActive(com.add_node, friendType, model2.IsSnsFriend(com.ullUid, com.dwLogicWorldID) || model2.IsGameFriend(com.ullUid, com.dwLogicWorldID));
            }
        }