예제 #1
0
        public static void ShowFriendData(COMDT_FRIEND_INFO info, FriendShower com, FriendShower.ItemType type, bool bShowNickName, CFriendModel.FriendType friendType)
        {
            if (info != null)
            {
                com.ullUid         = info.stUin.ullUid;
                com.dwLogicWorldID = info.stUin.dwLogicWorldId;
                SetHttpImage(com.HttpImage, info.szHeadUrl);
                if (com.nobeIcon != null)
                {
                    MonoSingleton <NobeSys> .GetInstance().SetNobeIcon(com.nobeIcon.GetComponent <Image>(), (int)info.stGameVip.dwCurLevel, false);
                }
                if (com.HeadIconBack != null)
                {
                    MonoSingleton <NobeSys> .GetInstance().SetHeadIconBk(com.HeadIconBack.GetComponent <Image>(), (int)info.stGameVip.dwHeadIconId);
                }
                if (com.QQVipImage != null)
                {
                    MonoSingleton <NobeSys> .GetInstance().SetOtherQQVipHead(com.QQVipImage.GetComponent <Image>(), (int)info.dwQQVIPMask);
                }
                if ((type == FriendShower.ItemType.Normal) && (friendType == CFriendModel.FriendType.GameFriend))
                {
                    ushort num;
                    CFriendModel.EIntimacyType type2;
                    bool flag;
                    if (Singleton <CFriendContoller> .instance.model.GetFriendIntimacy(info.stUin.ullUid, info.stUin.dwLogicWorldId, out num, out type2, out flag))
                    {
                        if (num == 0)
                        {
                            com.intimacyNode.CustomSetActive(false);
                        }
                        else
                        {
                            com.intimacyNode.CustomSetActive(true);
                            com.ShowIntimacyNum(num, type2, flag);
                        }
                    }
                    else
                    {
                        com.intimacyNode.CustomSetActive(false);
                    }
                }
                else
                {
                    com.intimacyNode.CustomSetActive(false);
                }
                com.SetFriendItemType(type, !bShowNickName);
                com.SetBGray((type == FriendShower.ItemType.Normal) && (info.bIsOnline != 1));
                com.ShowLevel(info.dwPvpLvl);
                com.ShowVipLevel(info.dwVipLvl);
                com.ShowLastTime(info.bIsOnline != 1, GetTimeString(info.dwLastLoginTime));
                if (type == FriendShower.ItemType.Request)
                {
                    string friendVerifyContent = Singleton <CFriendContoller> .instance.model.GetFriendVerifyContent(info.stUin.ullUid, info.stUin.dwLogicWorldId);

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

                if (friendInGaming == null)
                {
                    com.ShowName(Bytes2String(info.szUserName));
                    com.ShowGameState(COM_ACNT_GAME_STATE.COM_ACNT_GAME_STATE_IDLE, info.bIsOnline == 1);
                }
                else
                {
                    if (!string.IsNullOrEmpty(friendInGaming.NickName) && bShowNickName)
                    {
                        com.ShowName(string.Format("{0}({1})", Bytes2String(info.szUserName), friendInGaming.NickName));
                    }
                    else
                    {
                        com.ShowName(Bytes2String(info.szUserName));
                    }
                    com.ShowGameState(friendInGaming.State, info.bIsOnline == 1);
                }
                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 flag2 = Singleton <CFriendContoller> .instance.model.HeartData.BCanSendHeart(info.stUin, COM_FRIEND_TYPE.COM_FRIEND_TYPE_GAME);

                bool flag3 = Singleton <CFriendContoller> .instance.model.HeartData.BCanSendHeart(info.stUin, COM_FRIEND_TYPE.COM_FRIEND_TYPE_SNS);

                com.ShowSendButton(flag2 && flag3);
                if (CSysDynamicBlock.bSocialBlocked)
                {
                    com.HideSendButton();
                }
                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, COM_FRIEND_TYPE.COM_FRIEND_TYPE_SNS);
                    bool flag5  = Singleton <CFriendContoller> .instance.model.SnsReCallData.BInCd(info.stUin, COM_FRIEND_TYPE.COM_FRIEND_TYPE_SNS);

                    bool flag6 = CFriendModel.IsOnSnsSwitch(info.dwRefuseFriendBits, COM_REFUSE_TYPE.COM_REFUSE_TYPE_DONOTE_AND_REC);
                    com.ShowInviteButton(isShow, !flag5 && !flag6);
                }
                if (Singleton <COBSystem> .instance.IsInOBFriendList(info.stUin.ullUid))
                {
                    com.ShowOBButton(true);
                }
                else
                {
                    com.ShowOBButton(false);
                }
                com.ShowGenderType((COM_SNSGENDER)info.bGender);
                com.ShowPlatChannelIcon(info);
                com.ShowSendGiftBtn(true);
            }
        }
예제 #2
0
 public void ClearAll()
 {
     this.model.ClearAll();
     this.search_info = null;
     this.com         = null;
 }
예제 #3
0
    private bool GetOtherPlayerState(COM_INVITE_RELATION_TYPE type, ulong uid, uint dwLogicWorldID, out string stateStr, out string headURL)
    {
        headURL = string.Empty;
        if (type == null)
        {
            CFriendModel.FriendInGame friendInGaming = Singleton <CFriendContoller> .get_instance().model.GetFriendInGaming(uid, dwLogicWorldID);

            COMDT_FRIEND_INFO gameOrSnsFriend = Singleton <CFriendContoller> .get_instance().model.GetGameOrSnsFriend(uid, dwLogicWorldID);

            if (gameOrSnsFriend == null)
            {
                stateStr = Singleton <CMailSys> .get_instance().offlineStr;

                return(false);
            }
            headURL = Utility.UTF8Convert(gameOrSnsFriend.szHeadUrl);
            if (gameOrSnsFriend.bIsOnline != 1)
            {
                stateStr = Singleton <CMailSys> .get_instance().offlineStr;

                return(false);
            }
            stateStr = Singleton <CMailSys> .get_instance().onlineStr;

            if (friendInGaming == null)
            {
                return(gameOrSnsFriend.bIsOnline == 1);
            }
            if (friendInGaming.State == 1 || friendInGaming.State == 2)
            {
                if (friendInGaming.startTime > 0u)
                {
                    stateStr = Singleton <CMailSys> .get_instance().gamingStr;
                }
                else
                {
                    stateStr = string.Format("<color=#ffff00>{0}</color>", Singleton <CTextManager> .get_instance().GetText("Common_Gaming_NoTime"));
                }
            }
            else if (friendInGaming.State == 3)
            {
                stateStr = string.Format("<color=#ffff00>{0}</color>", Singleton <CTextManager> .get_instance().GetText("Common_Teaming"));
            }
            return(gameOrSnsFriend.bIsOnline == 1);
        }
        else if (type == 1)
        {
            GuildMemInfo guildMemberInfoByUid = CGuildHelper.GetGuildMemberInfoByUid(uid);
            if (guildMemberInfoByUid == null)
            {
                stateStr = Singleton <CMailSys> .get_instance().offlineStr;

                return(false);
            }
            headURL = guildMemberInfoByUid.stBriefInfo.szHeadUrl;
            if (!CGuildHelper.IsMemberOnline(guildMemberInfoByUid))
            {
                stateStr = Singleton <CMailSys> .get_instance().offlineStr;

                return(false);
            }
            stateStr = Singleton <CMailSys> .get_instance().onlineStr;

            if (guildMemberInfoByUid.GameState == 1 || guildMemberInfoByUid.GameState == 2)
            {
                if (guildMemberInfoByUid.dwGameStartTime > 0u)
                {
                    stateStr = Singleton <CMailSys> .get_instance().gamingStr;
                }
                else
                {
                    stateStr = string.Format("<color=#ffff00>{0}</color>", Singleton <CTextManager> .get_instance().GetText("Common_Gaming_NoTime"));
                }
            }
            return(true);
        }
        else
        {
            if (type != 2)
            {
                stateStr = Singleton <CMailSys> .get_instance().offlineStr;

                return(false);
            }
            CSDT_LBS_USER_INFO lBSUserInfo = Singleton <CFriendContoller> .get_instance().model.GetLBSUserInfo(uid, dwLogicWorldID, CFriendModel.LBSGenderType.Both);

            if (lBSUserInfo == null)
            {
                stateStr = Singleton <CMailSys> .get_instance().offlineStr;

                return(false);
            }
            headURL = Utility.UTF8Convert(lBSUserInfo.stLbsUserInfo.szHeadUrl);
            if (lBSUserInfo.stLbsUserInfo.bIsOnline == 1)
            {
                stateStr = Singleton <CMailSys> .get_instance().onlineStr;
            }
            else
            {
                stateStr = Singleton <CMailSys> .get_instance().offlineStr;
            }
            return(lBSUserInfo.stLbsUserInfo.bIsOnline == 1);
        }
    }
예제 #4
0
    private void OnPlayerInfoSystemRecivedMsg(CSPkg msg)
    {
        if (msg.stPkgData.get_stGetAcntDetailInfoRsp().iErrCode != 0)
        {
            Singleton <CUIManager> .GetInstance().OpenMessageBox(string.Format("Error Code {0}", msg.stPkgData.get_stGetAcntDetailInfoRsp().iErrCode), false);

            return;
        }
        this.m_BackPlayeInfoMsg = msg;
        this.m_PlayerProfile.ConvertServerDetailData(msg.stPkgData.get_stGetAcntDetailInfoRsp().stAcntDetail.get_stOfSucc());
        CUIFormScript cUIFormScript = Singleton <CUIManager> .GetInstance().OpenForm(CMiniPlayerInfoSystem.sPlayerInfoFormPath, false, true);

        if (cUIFormScript == null)
        {
            return;
        }
        if (this.m_bUp)
        {
            cUIFormScript.SetPriority(enFormPriority.Priority5);
        }
        else
        {
            cUIFormScript.RestorePriority();
        }
        GameObject    widget        = cUIFormScript.GetWidget(0);
        RectTransform rectTransform = cUIFormScript.transform.Find("panel") as RectTransform;

        if (rectTransform == null)
        {
            Debug.LogError("mini player info form's panel is null");
            Singleton <CUIEventManager> .GetInstance().DispatchUIEvent(enUIEventID.Mini_Player_Info_CloseForm);
        }
        CMiniPlayerInfoSystem.OpenSrc openSrc = this.m_OpenSrc;
        if (openSrc != CMiniPlayerInfoSystem.OpenSrc.Rank)
        {
            if (openSrc == CMiniPlayerInfoSystem.OpenSrc.Chat)
            {
                CUIFormScript form = Singleton <CUIManager> .GetInstance().GetForm(CChatController.ChatFormPath);

                if (form == null)
                {
                    Debug.LogError("can't get chat form");
                    Singleton <CUIEventManager> .GetInstance().DispatchUIEvent(enUIEventID.Mini_Player_Info_CloseForm);

                    return;
                }
                RectTransform rectTransform2 = form.transform.Find("node/null") as RectTransform;
                if (rectTransform2 == null)
                {
                    Debug.LogError("chat form's close btn is null");
                    Singleton <CUIEventManager> .GetInstance().DispatchUIEvent(enUIEventID.Mini_Player_Info_CloseForm);

                    return;
                }
                widget.CustomSetActive(true);
                Vector3[] array = new Vector3[4];
                rectTransform2.GetWorldCorners(array);
                Vector2   vector      = CUIUtility.WorldToScreenPoint(Singleton <CUIManager> .get_instance().FormCamera, array[3]);
                Vector2   screenPoint = new Vector2(0f, vector.y);
                Vector3[] array2      = new Vector3[4];
                rectTransform.GetWorldCorners(array2);
                float num = CUIUtility.WorldToScreenPoint(Singleton <CUIManager> .get_instance().FormCamera, array2[3]).x - CUIUtility.WorldToScreenPoint(Singleton <CUIManager> .get_instance().FormCamera, array2[0]).x;
                if (vector.x + num + 100f > (float)Screen.width)
                {
                    screenPoint.x = (float)Screen.width - num - 15f;
                }
                else
                {
                    screenPoint = new Vector2(vector.x + 20f, vector.y);
                }
                rectTransform.position = CUIUtility.ScreenToWorldPoint(cUIFormScript.GetCamera(), screenPoint, rectTransform.position.z);
            }
        }
        else
        {
            CUIFormScript form2 = Singleton <CUIManager> .GetInstance().GetForm(RankingSystem.s_rankingForm);

            if (form2 == null)
            {
                Debug.LogError("can't get ranking form");
                Singleton <CUIEventManager> .GetInstance().DispatchUIEvent(enUIEventID.Mini_Player_Info_CloseForm);

                return;
            }
            RectTransform rectTransform3 = form2.transform.Find("bg") as RectTransform;
            if (rectTransform3 == null)
            {
                Debug.LogError("ranking form's bg is null");
                Singleton <CUIEventManager> .GetInstance().DispatchUIEvent(enUIEventID.Mini_Player_Info_CloseForm);

                return;
            }
            widget.CustomSetActive(true);
            Vector3[] array3 = new Vector3[4];
            rectTransform3.GetWorldCorners(array3);
            Vector2   vector2      = CUIUtility.WorldToScreenPoint(Singleton <CUIManager> .get_instance().FormCamera, array3[2]);
            Vector2   screenPoint2 = new Vector2(0f, vector2.y - 100f);
            Vector3[] array4       = new Vector3[4];
            rectTransform.GetWorldCorners(array4);
            float num2 = CUIUtility.WorldToScreenPoint(Singleton <CUIManager> .get_instance().FormCamera, array4[3]).x - CUIUtility.WorldToScreenPoint(Singleton <CUIManager> .get_instance().FormCamera, array4[0]).x;
            if (vector2.x + 80f + num2 > (float)Screen.width)
            {
                screenPoint2.x = (float)Screen.width - num2 - 15f;
            }
            else
            {
                screenPoint2.x = vector2.x + 80f;
            }
            rectTransform.position = CUIUtility.ScreenToWorldPoint(cUIFormScript.GetCamera(), screenPoint2, rectTransform.position.z);
        }
        Text componetInChild = Utility.GetComponetInChild <Text>(cUIFormScript.gameObject, "panel/Name/Text");

        if (componetInChild != null)
        {
            componetInChild.text = this.m_PlayerProfile.Name();
        }
        COMDT_FRIEND_INFO info = Singleton <CFriendContoller> .get_instance().model.GetInfo(CFriendModel.FriendType.GameFriend, this.m_CurSelectedUuid, (uint)this.m_CurSelectedLogicWorld);

        COMDT_FRIEND_INFO info2 = Singleton <CFriendContoller> .get_instance().model.GetInfo(CFriendModel.FriendType.SNS, this.m_CurSelectedUuid, (uint)this.m_CurSelectedLogicWorld);

        Text componetInChild2 = Utility.GetComponetInChild <Text>(cUIFormScript.gameObject, "panel/Online/Text");

        if (componetInChild2 != null)
        {
            if (this.m_PlayerProfile.IsOnLine())
            {
                COMDT_FRIEND_INFO cOMDT_FRIEND_INFO = (info != null) ? info : ((info2 != null) ? info2 : null);
                if (cOMDT_FRIEND_INFO != null)
                {
                    COM_ACNT_GAME_STATE friendInGamingState = Singleton <CFriendContoller> .get_instance().model.GetFriendInGamingState(this.m_CurSelectedUuid, (uint)this.m_CurSelectedLogicWorld);

                    if (friendInGamingState == null)
                    {
                        componetInChild2.text = string.Format("<color=#00ff00>{0}</color>", Singleton <CTextManager> .get_instance().GetText("Common_Online"));
                    }
                    else if (friendInGamingState == 1 || friendInGamingState == 2)
                    {
                        componetInChild2.text = string.Format("<color=#ffff00>{0}</color>", Singleton <CTextManager> .get_instance().GetText("Common_Gaming"));
                    }
                    else if (friendInGamingState == 3)
                    {
                        componetInChild2.text = string.Format("<color=#ffff00>{0}</color>", Singleton <CTextManager> .get_instance().GetText("Common_Teaming"));
                    }
                }
                else
                {
                    componetInChild2.text = string.Format("<color=#00ff00>{0}</color>", Singleton <CTextManager> .get_instance().GetText("Common_Online"));
                }
            }
            else
            {
                Text   arg_5D9_0 = componetInChild2;
                string text      = Singleton <CTextManager> .GetInstance().GetText("Common_Offline");

                componetInChild2.text = text;
                arg_5D9_0.text        = text;
            }
        }
        Text componetInChild3 = Utility.GetComponetInChild <Text>(cUIFormScript.gameObject, "panel/DuanWei/Text");

        if (componetInChild3 != null)
        {
            string rankName = CLadderView.GetRankName(this.m_PlayerProfile.GetRankGrade(), (uint)this.m_PlayerProfile.GetRankClass());
            componetInChild3.text = ((!string.IsNullOrEmpty(rankName)) ? rankName : Singleton <CTextManager> .GetInstance().GetText("Common_NoData"));
        }
        Text componetInChild4 = Utility.GetComponetInChild <Text>(cUIFormScript.gameObject, "panel/Team/Text");
        Text componetInChild5 = Utility.GetComponetInChild <Text>(cUIFormScript.gameObject, "panel/Position/Text");

        if (!CGuildSystem.IsInNormalGuild(this.m_PlayerProfile.GuildState) || string.IsNullOrEmpty(this.m_PlayerProfile.GuildName))
        {
            if (componetInChild4 != null)
            {
                componetInChild4.text = Singleton <CTextManager> .GetInstance().GetText("PlayerInfo_Guild");
            }
            if (componetInChild5 != null)
            {
                componetInChild5.text = Singleton <CTextManager> .GetInstance().GetText("PlayerInfo_Guild");
            }
        }
        else
        {
            if (componetInChild4 != null)
            {
                componetInChild4.text = this.m_PlayerProfile.GuildName;
            }
            if (componetInChild5 != null)
            {
                componetInChild5.text = CGuildHelper.GetPositionName(this.m_PlayerProfile.GuildState);
            }
        }
        GameObject obj        = Utility.FindChild(cUIFormScript.gameObject, "panel/Btn/AddFriend");
        GameObject obj2       = Utility.FindChild(cUIFormScript.gameObject, "panel/Btn/Profile");
        GameObject obj3       = Utility.FindChild(cUIFormScript.gameObject, "panel/Btn/3v3");
        GameObject obj4       = Utility.FindChild(cUIFormScript.gameObject, "panel/Btn/5v5");
        GameObject gameObject = Utility.FindChild(cUIFormScript.gameObject, "panel/Btn/Block");

        obj2.CustomSetActive(true);
        openSrc = this.m_OpenSrc;
        if (openSrc != CMiniPlayerInfoSystem.OpenSrc.Rank)
        {
            if (openSrc == CMiniPlayerInfoSystem.OpenSrc.Chat)
            {
                switch (Singleton <CChatController> .GetInstance().view.CurTab)
                {
                case EChatChannel.Lobby:
                case EChatChannel.GuildMatchTeam:
                    obj3.CustomSetActive(false);
                    obj4.CustomSetActive(false);
                    if (info != null || info2 != null)
                    {
                        obj.CustomSetActive(false);
                    }
                    else
                    {
                        obj.CustomSetActive(true);
                    }
                    gameObject.CustomSetActive(true);
                    this.SetBlockButtonBlocked(gameObject, Singleton <CFriendContoller> .get_instance().model.IsBlack(this.m_CurSelectedUuid, (uint)this.m_CurSelectedLogicWorld));
                    break;

                case EChatChannel.Guild:
                    if (info != null || info2 != null)
                    {
                        obj.CustomSetActive(false);
                        obj3.CustomSetActive(true);
                        obj4.CustomSetActive(true);
                    }
                    else
                    {
                        obj.CustomSetActive(true);
                        obj3.CustomSetActive(false);
                        obj4.CustomSetActive(false);
                    }
                    gameObject.CustomSetActive(true);
                    this.SetBlockButtonBlocked(gameObject, Singleton <CFriendContoller> .get_instance().model.IsBlack(this.m_CurSelectedUuid, (uint)this.m_CurSelectedLogicWorld));
                    break;

                case EChatChannel.Friend_Chat:
                    obj.CustomSetActive(false);
                    obj3.CustomSetActive(true);
                    obj4.CustomSetActive(true);
                    gameObject.CustomSetActive(true);
                    this.SetBlockButtonBlocked(gameObject, Singleton <CFriendContoller> .get_instance().model.IsBlack(this.m_CurSelectedUuid, (uint)this.m_CurSelectedLogicWorld));
                    break;

                case EChatChannel.Settle:
                    obj.CustomSetActive(false);
                    obj3.CustomSetActive(false);
                    obj4.CustomSetActive(false);
                    gameObject.CustomSetActive(true);
                    this.SetBlockButtonBlocked(gameObject, Singleton <CFriendContoller> .get_instance().model.IsBlack(this.m_CurSelectedUuid, (uint)this.m_CurSelectedLogicWorld));
                    break;
                }
            }
        }
        else
        {
            if (info != null || info2 != null)
            {
                obj.CustomSetActive(false);
                obj3.CustomSetActive(true);
                obj4.CustomSetActive(true);
            }
            else
            {
                obj.CustomSetActive(true);
                obj3.CustomSetActive(false);
                obj4.CustomSetActive(false);
            }
            gameObject.CustomSetActive(false);
        }
    }
예제 #5
0
    public void UpdateListElenment(GameObject element, CMail mail)
    {
        int                currentUTCTime = CRoleInfo.GetCurrentUTCTime();
        Text               component      = element.transform.FindChild("Title").GetComponent <Text>();
        Text               component2     = element.transform.FindChild("MailTime").GetComponent <Text>();
        GameObject         gameObject     = element.transform.FindChild("New").gameObject;
        GameObject         gameObject2    = element.transform.FindChild("ReadMailIcon").gameObject;
        GameObject         gameObject3    = element.transform.FindChild("UnReadMailIcon").gameObject;
        GameObject         gameObject4    = element.transform.FindChild("CoinImg").gameObject;
        Text               component3     = element.transform.FindChild("From").GetComponent <Text>();
        CUIHttpImageScript component4     = element.transform.FindChild("HeadBg/imgHead").GetComponent <CUIHttpImageScript>();
        GameObject         obj            = null;
        Text               text           = null;
        Transform          transform      = element.transform.FindChild("OnlineBg");

        if (transform != null)
        {
            obj = transform.gameObject;
        }
        Transform transform2 = element.transform.FindChild("Online");

        if (transform2 != null)
        {
            text = transform2.GetComponent <Text>();
        }
        component.text  = mail.subject;
        component2.text = Utility.GetTimeBeforString((long)((ulong)mail.sendTime), (long)currentUTCTime);
        bool flag = mail.mailState == 1;

        gameObject.CustomSetActive(flag);
        if (mail.mailType == 1)
        {
            gameObject2.CustomSetActive(!flag);
            gameObject3.CustomSetActive(flag);
            component3.text = string.Empty;
            component4.gameObject.CustomSetActive(false);
            gameObject4.SetActive(false);
            obj.CustomSetActive(false);
            if (text != null)
            {
                text.gameObject.CustomSetActive(false);
            }
        }
        else if (mail.mailType == 2)
        {
            obj.CustomSetActive(false);
            if (text != null)
            {
                text.gameObject.CustomSetActive(false);
            }
            gameObject2.CustomSetActive(false);
            gameObject3.CustomSetActive(false);
            component3.text = mail.from;
            component4.gameObject.CustomSetActive(true);
            if (mail.subType == 3)
            {
                gameObject4.CustomSetActive(false);
                component4.SetImageSprite(CGuildHelper.GetGuildHeadPath(), this.m_CUIForm);
            }
            else
            {
                gameObject4.CustomSetActive(true);
                if (!CSysDynamicBlock.bFriendBlocked)
                {
                    COMDT_FRIEND_INFO friendByName = Singleton <CFriendContoller> .get_instance().model.getFriendByName(mail.from, CFriendModel.FriendType.GameFriend);

                    if (friendByName == null)
                    {
                        friendByName = Singleton <CFriendContoller> .get_instance().model.getFriendByName(mail.from, CFriendModel.FriendType.SNS);
                    }
                    if (friendByName != null)
                    {
                        string url = Utility.UTF8Convert(friendByName.szHeadUrl);
                        component4.SetImageUrl(Singleton <ApolloHelper> .GetInstance().ToSnsHeadUrl(url));
                    }
                }
            }
        }
        else if (mail.mailType == 3)
        {
            obj.CustomSetActive(true);
            if (text != null)
            {
                text.gameObject.CustomSetActive(true);
            }
            gameObject2.CustomSetActive(false);
            gameObject3.CustomSetActive(false);
            component3.text = string.Empty;
            component4.gameObject.CustomSetActive(true);
            gameObject4.SetActive(false);
            Transform  transform3 = element.transform.FindChild("invite_btn");
            GameObject obj2       = null;
            if (transform3 != null)
            {
                obj2 = transform3.gameObject;
            }
            if (mail.relationType == 1)
            {
                GuildMemInfo guildMemberInfoByUid = CGuildHelper.GetGuildMemberInfoByUid(mail.uid);
                Singleton <CMailSys> .get_instance().AddGuildMemInfo(guildMemberInfoByUid);
            }
            this.SetEventParams(element, mail);
            string text2;
            string url2;
            bool   flag2             = !this.GetOtherPlayerState(mail.relationType, mail.uid, mail.dwLogicWorldID, out text2, out url2);
            string processTypeString = this.GetProcessTypeString((CMailSys.enProcessInviteType)mail.processType);
            component.text = string.Format("{0} {1}", mail.subject, processTypeString);
            if (text != null)
            {
                text.text = text2;
            }
            component4.SetImageUrl(Singleton <ApolloHelper> .GetInstance().ToSnsHeadUrl(url2));
            if (flag2)
            {
                CUIUtility.GetComponentInChildren <Image>(component4.gameObject).color = CUIUtility.s_Color_GrayShader;
            }
            else
            {
                CUIUtility.GetComponentInChildren <Image>(component4.gameObject).color = CUIUtility.s_Color_Full;
            }
            obj2.CustomSetActive(!flag2);
        }
    }
예제 #6
0
        public static string Build_4_EntryString(EChatChannel type, ulong ullUid, uint iLogicWorldID, string rawText)
        {
            string result = string.Empty;

            if (type == EChatChannel.Friend)
            {
                COMDT_FRIEND_INFO gameOrSnsFriend = Singleton <CFriendContoller> .GetInstance().model.GetGameOrSnsFriend(ullUid, iLogicWorldID);

                if (gameOrSnsFriend != null)
                {
                    result = string.Format(CChatController.fmt, UT.Bytes2String(gameOrSnsFriend.szUserName), rawText);
                }
            }
            else if (type == EChatChannel.Lobby)
            {
                COMDT_CHAT_PLAYER_INFO cOMDT_CHAT_PLAYER_INFO = Singleton <CChatController> .GetInstance().model.Get_Palyer_Info(ullUid, iLogicWorldID);

                if (cOMDT_CHAT_PLAYER_INFO != null)
                {
                    result = string.Format(CChatController.fmt, UT.Bytes2String(cOMDT_CHAT_PLAYER_INFO.szName), rawText);
                }
            }
            else if (type == EChatChannel.Guild)
            {
                COMDT_CHAT_PLAYER_INFO cOMDT_CHAT_PLAYER_INFO2 = Singleton <CChatController> .GetInstance().model.Get_Palyer_Info(ullUid, iLogicWorldID);

                if (cOMDT_CHAT_PLAYER_INFO2 != null)
                {
                    result = string.Format(CChatController.fmt, UT.Bytes2String(cOMDT_CHAT_PLAYER_INFO2.szName), rawText);
                }
            }
            else if (type == EChatChannel.GuildMatchTeam)
            {
                COMDT_CHAT_PLAYER_INFO cOMDT_CHAT_PLAYER_INFO3 = Singleton <CChatController> .GetInstance().model.Get_Palyer_Info(ullUid, iLogicWorldID);

                if (cOMDT_CHAT_PLAYER_INFO3 != null)
                {
                    result = string.Format(CChatController.fmt, UT.Bytes2String(cOMDT_CHAT_PLAYER_INFO3.szName), rawText);
                }
            }
            else if (type == EChatChannel.Room)
            {
                COMDT_CHAT_PLAYER_INFO cOMDT_CHAT_PLAYER_INFO4 = Singleton <CChatController> .GetInstance().model.Get_Palyer_Info(ullUid, iLogicWorldID);

                if (cOMDT_CHAT_PLAYER_INFO4 != null)
                {
                    result = string.Format(CChatController.fmt, UT.Bytes2String(cOMDT_CHAT_PLAYER_INFO4.szName), rawText);
                }
            }
            else if (type == EChatChannel.Team)
            {
                COMDT_CHAT_PLAYER_INFO cOMDT_CHAT_PLAYER_INFO5 = Singleton <CChatController> .GetInstance().model.Get_Palyer_Info(ullUid, iLogicWorldID);

                if (cOMDT_CHAT_PLAYER_INFO5 != null)
                {
                    result = string.Format(CChatController.fmt, UT.Bytes2String(cOMDT_CHAT_PLAYER_INFO5.szName), rawText);
                }
            }
            else if (type == EChatChannel.Settle)
            {
                COMDT_CHAT_PLAYER_INFO cOMDT_CHAT_PLAYER_INFO6 = Singleton <CChatController> .GetInstance().model.Get_Palyer_Info(ullUid, iLogicWorldID);

                if (cOMDT_CHAT_PLAYER_INFO6 != null)
                {
                    result = string.Format(CChatController.fmt, UT.Bytes2String(cOMDT_CHAT_PLAYER_INFO6.szName), rawText);
                }
            }
            else
            {
                result = "ERROR, in Build_4_EntryString";
            }
            return(result);
        }
        public static void OnRankingArenaElementEnable(CUIEvent uiEvent)
        {
            int        srcWidgetIndexInBelongedList = uiEvent.m_srcWidgetIndexInBelongedList;
            GameObject srcWidget   = uiEvent.m_srcWidget;
            GameObject gameObject  = Utility.FindChild(srcWidget, "addFriendBtn");
            GameObject gameObject2 = Utility.FindChild(srcWidget, "sendButton");

            if (Singleton <CArenaSystem> .instance.m_rankInfoList.astFigterDetail[srcWidgetIndexInBelongedList].stFigterData.bMemberType == 1)
            {
                COMDT_ARENA_MEMBER_OF_ACNT fighterInfo = CArenaSystem.GetFighterInfo(Singleton <CArenaSystem> .instance.m_rankInfoList.astFigterDetail[srcWidgetIndexInBelongedList].stFigterData);
                ulong ullUid       = fighterInfo.ullUid;
                uint  logicWorldID = (uint)MonoSingleton <TdirMgr> .GetInstance().SelectedTdir.logicWorldID;

                COMDT_FRIEND_INFO info = Singleton <CFriendContoller> .instance.model.GetInfo(CFriendModel.FriendType.GameFriend, ullUid, logicWorldID);

                COMDT_FRIEND_INFO info2 = Singleton <CFriendContoller> .instance.model.GetInfo(CFriendModel.FriendType.SNS, ullUid, logicWorldID);

                bool flag  = info != null;
                bool flag2 = info2 != null;
                if (!flag && !flag2)
                {
                    ulong num = (ulong)((uint)Singleton <CRoleInfoManager> .instance.GetMasterRoleInfo().playerUllUID);
                    gameObject.CustomSetActive(num != fighterInfo.ullUid);
                    gameObject2.CustomSetActive(false);
                    CUIEventScript componetInChild = Utility.GetComponetInChild <CUIEventScript>(gameObject, "AddFriend");
                    componetInChild.m_onClickEventID         = enUIEventID.Ranking_ArenaAddFriend;
                    componetInChild.m_onClickEventParams.tag = (int)logicWorldID;
                    componetInChild.m_onClickEventParams.commonUInt64Param1 = fighterInfo.ullUid;
                }
                else
                {
                    COMDT_ACNT_UNIQ cOMDT_ACNT_UNIQ = (info == null) ? info2.stUin : info.stUin;
                    gameObject.CustomSetActive(false);
                    gameObject2.CustomSetActive(true);
                    bool flag3 = Singleton <CFriendContoller> .instance.model.HeartData.BCanSendHeart(cOMDT_ACNT_UNIQ);

                    CUICommonSystem.SetButtonEnableWithShader(gameObject2.GetComponent <Button>(), flag3, true);
                    if (flag3)
                    {
                        CUIEventScript component = gameObject2.GetComponent <CUIEventScript>();
                        if (flag)
                        {
                            component.m_onClickEventID = enUIEventID.Ranking_Friend_GAME_SendCoin;
                        }
                        else
                        {
                            component.m_onClickEventID = enUIEventID.Friend_SendCoin;
                        }
                        component.m_onClickEventParams.tag = srcWidgetIndexInBelongedList;
                        component.m_onClickEventParams.commonUInt64Param1 = cOMDT_ACNT_UNIQ.ullUid;
                        component.m_onClickEventParams.commonUInt64Param2 = (ulong)cOMDT_ACNT_UNIQ.dwLogicWorldId;
                    }
                }
            }
            else
            {
                gameObject.CustomSetActive(false);
                gameObject2.CustomSetActive(false);
            }
            CArenaSystem.Arena_RankElementEnable(uiEvent);
        }
예제 #8
0
 public void Record_SearchFriend(COMDT_FRIEND_INFO info)
 {
     this.search_info_Game = info;
 }
예제 #9
0
 public void Clear_SearchFriend()
 {
     this.search_info_Game = null;
 }