Esempio n. 1
0
        public static void ShowLBSUserData(CSDT_LBS_USER_INFO info, FriendShower com)
        {
            if (com == null)
            {
                return;
            }
            com.ullUid         = info.stLbsUserInfo.stUin.ullUid;
            com.dwLogicWorldID = info.stLbsUserInfo.stUin.dwLogicWorldId;
            if (info.stLbsUserInfo.szHeadUrl != null)
            {
                string url = UT.Bytes2String(info.stLbsUserInfo.szHeadUrl);
                com.HttpImage.SetImageUrl(Singleton <ApolloHelper> .GetInstance().ToSnsHeadUrl(url));
            }
            if (com.nobeIcon)
            {
                MonoSingleton <NobeSys> .GetInstance().SetNobeIcon(com.nobeIcon.GetComponent <Image>(), (int)info.stLbsUserInfo.stGameVip.dwCurLevel, false);
            }
            if (com.HeadIconBack)
            {
                MonoSingleton <NobeSys> .GetInstance().SetHeadIconBk(com.HeadIconBack.GetComponent <Image>(), (int)info.stLbsUserInfo.stGameVip.dwHeadIconId);
            }
            if (com.QQVipImage)
            {
                MonoSingleton <NobeSys> .GetInstance().SetOtherQQVipHead(com.QQVipImage.GetComponent <Image>(), (int)info.stLbsUserInfo.dwQQVIPMask);
            }
            com.intimacyNode.CustomSetActive(false);
            com.SetFriendItemType(FriendShower.ItemType.LBS, true);
            com.ShowName(UT.Bytes2String(info.stLbsUserInfo.szUserName));
            com.ShowLevel(info.stLbsUserInfo.dwPvpLvl);
            com.ShowLastTime(true, UT.GetTimeString(info.stLbsUserInfo.dwLastLoginTime));
            com.ShowGenderType(info.stLbsUserInfo.bGender);
            com.ShowDistance(UT.GetDistance(info.dwDistance));
            com.SetBGray(info.stLbsUserInfo.bIsOnline != 1);
            if (com.platChannelIcon != null)
            {
                com.platChannelIcon.CustomSetActive(false);
            }
            if (com.lbsAddFriendBtn != null)
            {
                CFriendModel model = Singleton <CFriendContoller> .get_instance().model;

                if (model.IsSnsFriend(com.ullUid, com.dwLogicWorldID) || model.IsGameFriend(com.ullUid, com.dwLogicWorldID))
                {
                    CUICommonSystem.SetButtonEnable(com.lbsAddFriendBtn, false, false, true);
                }
                else
                {
                    CUICommonSystem.SetButtonEnable(com.lbsAddFriendBtn, true, true, true);
                }
            }
            GameObject gameObject  = com.gameObject.transform.Find("body/LBS/Rank").gameObject;
            GameObject gameObject2 = com.gameObject.transform.Find("body/LBS/HisRank").gameObject;

            UT.ShowRank(com.formScript, gameObject, info.bGradeOfRank, info.stLbsUserInfo.dwRankClass);
            UT.ShowRank(com.formScript, gameObject2, info.bMaxGradeOfRank, info.stLbsUserInfo.dwRankClass);
        }
Esempio n. 2
0
        public void On_List_ElementEnable(CUIEvent uievent)
        {
            int          srcWidgetIndexInBelongedList = uievent.m_srcWidgetIndexInBelongedList;
            FriendShower component = uievent.m_srcWidget.GetComponent <FriendShower>();

            if (component != null)
            {
                if (this.CurTab == Tab.Friend_SNS)
                {
                    COMDT_FRIEND_INFO info = this._get_current_info(this.CurTab, srcWidgetIndexInBelongedList);
                    UT.ShowFriendData(info, component, FriendShower.ItemType.Normal, true, CFriendModel.FriendType.SNS);
                    component.sendHeartBtn_eventScript.m_onClickEventID = enUIEventID.Friend_SNS_SendCoin;
                    component.sendHeartBtn_eventScript.m_onClickEventParams.commonUInt64Param1 = info.stUin.ullUid;
                    component.sendHeartBtn_eventScript.m_onClickEventParams.commonUInt64Param2 = info.stUin.dwLogicWorldId;
                }
                else if (this.CurTab == Tab.Friend)
                {
                    COMDT_FRIEND_INFO comdt_friend_info2 = this._get_current_info(this.CurTab, srcWidgetIndexInBelongedList);
                    UT.ShowFriendData(comdt_friend_info2, component, FriendShower.ItemType.Normal, false, CFriendModel.FriendType.GameFriend);
                    component.sendHeartBtn_eventScript.m_onClickEventID = enUIEventID.Friend_SendCoin;
                    component.sendHeartBtn_eventScript.m_onClickEventParams.commonUInt64Param1 = comdt_friend_info2.stUin.ullUid;
                    component.sendHeartBtn_eventScript.m_onClickEventParams.commonUInt64Param2 = comdt_friend_info2.stUin.dwLogicWorldId;
                }
                else if (this.CurTab == Tab.Friend_Request)
                {
                    UT.ShowFriendData(this._get_current_info(this.CurTab, srcWidgetIndexInBelongedList), component, FriendShower.ItemType.Request, false, CFriendModel.FriendType.RequestFriend);
                }
                else if (this.CurTab == Tab.Friend_BlackList)
                {
                    List <CFriendModel.stBlackName> blackList = Singleton <CFriendContoller> .instance.model.GetBlackList();

                    if (srcWidgetIndexInBelongedList < blackList.Count)
                    {
                        CFriendModel.stBlackName name = blackList[srcWidgetIndexInBelongedList];
                        if (component != null)
                        {
                            UT.ShowBlackListData(ref name, component);
                        }
                    }
                }
                else if (this.CurTab == Tab.Friend_LBS)
                {
                    ListView <CSDT_LBS_USER_INFO> currentLBSList = Singleton <CFriendContoller> .instance.model.GetCurrentLBSList();

                    if (srcWidgetIndexInBelongedList < currentLBSList.Count)
                    {
                        CSDT_LBS_USER_INFO csdt_lbs_user_info = currentLBSList[srcWidgetIndexInBelongedList];
                        if (component != null)
                        {
                            UT.ShowLBSUserData(csdt_lbs_user_info, component);
                        }
                    }
                }
            }
        }
Esempio n. 3
0
 private void AddLBSUser(CSDT_LBS_USER_INFO info, ListView <CSDT_LBS_USER_INFO> list)
 {
     if ((info != null) && (list != null))
     {
         int index = this.GetLBSListIndex(info.stLbsUserInfo.stUin.ullUid, info.stLbsUserInfo.stUin.dwLogicWorldId, list);
         if (index != -1)
         {
             list.RemoveAt(index);
         }
         list.Add(info);
     }
 }
Esempio n. 4
0
 public void AddLBSUser(CSDT_LBS_USER_INFO info)
 {
     this.AddLBSUser(info, this.m_LBSList);
     if (info.stLbsUserInfo.bGender == 2)
     {
         this.AddLBSUser(info, this.m_LBSListNv);
     }
     if (info.stLbsUserInfo.bGender == 1)
     {
         this.AddLBSUser(info, this.m_LBSListNan);
     }
 }
Esempio n. 5
0
        public static void On_SC_Search_LBS_Rsp(CSPkg msg)
        {
            Singleton <CUIManager> .GetInstance().CloseSendMsgAlert();

            SCPKG_CMD_LBS_SEARCH stLbsSearchRsq = msg.stPkgData.get_stLbsSearchRsq();

            if (stLbsSearchRsq.dwResult == 0u)
            {
                Singleton <CFriendContoller> .get_instance().model.ClearLBSData();

                int num = 0;
                while ((long)num < (long)((ulong)stLbsSearchRsq.dwLbsListNum))
                {
                    CSDT_LBS_USER_INFO cSDT_LBS_USER_INFO = stLbsSearchRsq.astLbsList[num];
                    if (cSDT_LBS_USER_INFO != null)
                    {
                        if (cSDT_LBS_USER_INFO.stLbsUserInfo.stUin.ullUid != Singleton <CRoleInfoManager> .GetInstance().GetMasterRoleInfo().playerUllUID)
                        {
                            Singleton <CFriendContoller> .get_instance().model.RemoveLBSUser(cSDT_LBS_USER_INFO.stLbsUserInfo.stUin.ullUid, cSDT_LBS_USER_INFO.stLbsUserInfo.stUin.dwLogicWorldId);

                            Singleton <CFriendContoller> .get_instance().model.AddLBSUser(cSDT_LBS_USER_INFO);
                        }
                    }
                    num++;
                }
                if (stLbsSearchRsq.dwLbsListNum == 0u)
                {
                    string text = Singleton <CTextManager> .get_instance().GetText("LBS_Location_Error");

                    Singleton <CFriendContoller> .get_instance().model.searchLBSZero = text;

                    if (Singleton <CFriendContoller> .get_instance().view != null && Singleton <CFriendContoller> .get_instance().view.ifnoText != null)
                    {
                        Singleton <CFriendContoller> .get_instance().view.ifnoText.text = text;
                    }
                }
                else
                {
                    Singleton <CFriendContoller> .get_instance().model.searchLBSZero = string.Empty;
                }
                Singleton <CFriendContoller> .get_instance().model.SortLBSFriend();

                Singleton <EventRouter> .GetInstance().BroadCastEvent("Friend_LBS_User_Refresh");
            }
            else
            {
                Singleton <CUIManager> .GetInstance().OpenTips(UT.ErrorCode_String(stLbsSearchRsq.dwResult), false, 1.5f, null, new object[0]);
            }
        }
Esempio n. 6
0
        private static void SetLBSState(GameObject element, ref CSDT_LBS_USER_INFO LBSInfo)
        {
            COMDT_FRIEND_INFO stLbsUserInfo = LBSInfo.stLbsUserInfo;
            GameObject        gameObject    = element.transform.FindChild("HeadBg").gameObject;
            Text       component            = element.transform.FindChild("Online").GetComponent <Text>();
            GameObject obj3  = element.transform.FindChild("InviteButton").gameObject;
            Text       text2 = element.transform.FindChild("PlayerName").GetComponent <Text>();

            SetListElementLadderInfo(element, stLbsUserInfo);
            COM_ACNT_GAME_STATE friendInGamingState = COM_ACNT_GAME_STATE.COM_ACNT_GAME_STATE_IDLE;

            if (stLbsUserInfo.bIsOnline != 1)
            {
                component.text = string.Format(Singleton <CTextManager> .instance.GetText("Common_Offline"), new object[0]);
                text2.color    = CUIUtility.s_Color_Grey;
                CUIUtility.GetComponentInChildren <Image>(gameObject).color = CUIUtility.s_Color_GrayShader;
            }
            else
            {
                friendInGamingState = Singleton <CFriendContoller> .instance.model.GetFriendInGamingState(stLbsUserInfo.stUin.ullUid, stLbsUserInfo.stUin.dwLogicWorldId);

                switch (friendInGamingState)
                {
                case COM_ACNT_GAME_STATE.COM_ACNT_GAME_STATE_IDLE:
                {
                    component.text = Singleton <CInviteSystem> .instance.GetInviteStateStr(stLbsUserInfo.stUin.ullUid);

                    CUIEventScript script = obj3.GetComponent <CUIEventScript>();
                    script.m_onClickEventParams.tag  = (int)Singleton <CInviteSystem> .instance.InviteType;
                    script.m_onClickEventParams.tag2 = (int)stLbsUserInfo.stUin.dwLogicWorldId;
                    script.m_onClickEventParams.tag3 = (int)LBSInfo.dwGameSvrEntity;
                    script.m_onClickEventParams.commonUInt64Param1 = stLbsUserInfo.stUin.ullUid;
                    break;
                }

                case COM_ACNT_GAME_STATE.COM_ACNT_GAME_STATE_SINGLEGAME:
                case COM_ACNT_GAME_STATE.COM_ACNT_GAME_STATE_MULTIGAME:
                    component.text = string.Format("<color=#ffff00>{0}</color>", Singleton <CTextManager> .instance.GetText("Common_Gaming"));
                    break;

                case COM_ACNT_GAME_STATE.COM_ACNT_GAME_STATE_TEAM:
                    component.text = string.Format("<color=#ffff00>{0}</color>", Singleton <CTextManager> .instance.GetText("Common_Teaming"));
                    break;
                }
                text2.color = CUIUtility.s_Color_White;
                CUIUtility.GetComponentInChildren <Image>(gameObject).color = CUIUtility.s_Color_White;
            }
            obj3.CustomSetActive((stLbsUserInfo.bIsOnline == 1) && (friendInGamingState == COM_ACNT_GAME_STATE.COM_ACNT_GAME_STATE_IDLE));
        }
Esempio n. 7
0
 public int GetLBSListIndex(ulong ullUid, uint dwLogicWorldId, ListView <CSDT_LBS_USER_INFO> list)
 {
     if (list != null)
     {
         for (int i = 0; i < list.Count; i++)
         {
             CSDT_LBS_USER_INFO csdt_lbs_user_info = list[i];
             if (((csdt_lbs_user_info != null) && (csdt_lbs_user_info.stLbsUserInfo.stUin.ullUid == ullUid)) && (csdt_lbs_user_info.stLbsUserInfo.stUin.dwLogicWorldId == dwLogicWorldId))
             {
                 return(i);
             }
         }
     }
     return(-1);
 }
Esempio n. 8
0
        public CSDT_LBS_USER_INFO GetLBSUserInfo(ulong ullUid, uint dwLogicWorldId, LBSGenderType type = 0)
        {
            ListView <CSDT_LBS_USER_INFO> lBSList = this.GetLBSList(type);

            if (lBSList != null)
            {
                for (int i = 0; i < lBSList.Count; i++)
                {
                    CSDT_LBS_USER_INFO csdt_lbs_user_info = lBSList[i];
                    if (((csdt_lbs_user_info != null) && (csdt_lbs_user_info.stLbsUserInfo.stUin.ullUid == ullUid)) && (csdt_lbs_user_info.stLbsUserInfo.stUin.dwLogicWorldId == dwLogicWorldId))
                    {
                        return(csdt_lbs_user_info);
                    }
                }
            }
            return(null);
        }
Esempio n. 9
0
        private static void SetLBSState(GameObject element, ref CSDT_LBS_USER_INFO LBSInfo)
        {
            COMDT_FRIEND_INFO stLbsUserInfo = LBSInfo.stLbsUserInfo;
            GameObject        gameObject    = element.transform.FindChild("HeadBg").gameObject;
            Text       component            = element.transform.FindChild("Online").GetComponent <Text>();
            GameObject gameObject2          = element.transform.FindChild("InviteButton").gameObject;
            Text       component2           = element.transform.FindChild("PlayerName").GetComponent <Text>();

            CInviteView.SetListElementLadderInfo(element, stLbsUserInfo);
            COM_ACNT_GAME_STATE cOM_ACNT_GAME_STATE = 0;

            if (stLbsUserInfo.bIsOnline == 1)
            {
                cOM_ACNT_GAME_STATE = Singleton <CFriendContoller> .get_instance().model.GetFriendInGamingState(stLbsUserInfo.stUin.ullUid, stLbsUserInfo.stUin.dwLogicWorldId);

                if (cOM_ACNT_GAME_STATE == null)
                {
                    component.text = Singleton <CInviteSystem> .get_instance().GetInviteStateStr(stLbsUserInfo.stUin.ullUid, false);

                    CUIEventScript component3 = gameObject2.GetComponent <CUIEventScript>();
                    component3.m_onClickEventParams.tag = Singleton <CInviteSystem> .get_instance().InviteType;

                    component3.m_onClickEventParams.tag2 = (int)stLbsUserInfo.stUin.dwLogicWorldId;
                    component3.m_onClickEventParams.tag3 = (int)LBSInfo.dwGameSvrEntity;
                    component3.m_onClickEventParams.commonUInt64Param1 = stLbsUserInfo.stUin.ullUid;
                }
                else if (cOM_ACNT_GAME_STATE == 1 || cOM_ACNT_GAME_STATE == 2 || cOM_ACNT_GAME_STATE == 4)
                {
                    component.text = string.Format("<color=#ffff00>{0}</color>", Singleton <CTextManager> .get_instance().GetText("Common_Gaming"));
                }
                else if (cOM_ACNT_GAME_STATE == 3)
                {
                    component.text = string.Format("<color=#ffff00>{0}</color>", Singleton <CTextManager> .get_instance().GetText("Common_Teaming"));
                }
                component2.color = CUIUtility.s_Color_White;
                CUIUtility.GetComponentInChildren <Image>(gameObject).color = CUIUtility.s_Color_White;
            }
            else
            {
                component.text   = string.Format(Singleton <CTextManager> .get_instance().GetText("Common_Offline"), new object[0]);
                component2.color = CUIUtility.s_Color_Grey;
                CUIUtility.GetComponentInChildren <Image>(gameObject).color = CUIUtility.s_Color_GrayShader;
            }
            gameObject2.CustomSetActive(stLbsUserInfo.bIsOnline == 1 && cOM_ACNT_GAME_STATE == 0);
        }
Esempio n. 10
0
        public static void On_SC_Search_LBS_Rsp(CSPkg msg)
        {
            Singleton <CUIManager> .GetInstance().CloseSendMsgAlert();

            SCPKG_CMD_LBS_SEARCH stLbsSearchRsq = msg.stPkgData.stLbsSearchRsq;

            if (stLbsSearchRsq.dwResult == 0)
            {
                Singleton <CFriendContoller> .instance.model.ClearLBSData();

                for (int i = 0; i < stLbsSearchRsq.dwLbsListNum; i++)
                {
                    CSDT_LBS_USER_INFO info = stLbsSearchRsq.astLbsList[i];
                    if ((info != null) && (info.stLbsUserInfo.stUin.ullUid != Singleton <CRoleInfoManager> .GetInstance().GetMasterRoleInfo().playerUllUID))
                    {
                        Singleton <CFriendContoller> .instance.model.RemoveLBSUser(info.stLbsUserInfo.stUin.ullUid, info.stLbsUserInfo.stUin.dwLogicWorldId);

                        Singleton <CFriendContoller> .instance.model.AddLBSUser(info);
                    }
                }
                if (stLbsSearchRsq.dwLbsListNum == 0)
                {
                    string text = Singleton <CTextManager> .instance.GetText("LBS_Location_Error");

                    Singleton <CFriendContoller> .instance.model.searchLBSZero = text;
                    if ((Singleton <CFriendContoller> .instance.view != null) && (Singleton <CFriendContoller> .instance.view.ifnoText != null))
                    {
                        Singleton <CFriendContoller> .instance.view.ifnoText.text = text;
                    }
                }
                else
                {
                    Singleton <CFriendContoller> .instance.model.searchLBSZero = string.Empty;
                }
                Singleton <CFriendContoller> .instance.model.SortLBSFriend();

                Singleton <EventRouter> .GetInstance().BroadCastEvent("Friend_LBS_User_Refresh");
            }
            else
            {
                Singleton <CUIManager> .GetInstance().OpenTips(UT.ErrorCode_String(stLbsSearchRsq.dwResult), false, 1.5f, null, new object[0]);
            }
        }
Esempio n. 11
0
 public static int LBSDataSort(CSDT_LBS_USER_INFO l, CSDT_LBS_USER_INFO r)
 {
     if (l == r)
     {
         return(0);
     }
     if ((l == null) || (r == null))
     {
         return(0);
     }
     if (r.dwDistance != l.dwDistance)
     {
         return((int)(l.dwDistance - r.dwDistance));
     }
     if (r.bGradeOfRank != l.bGradeOfRank)
     {
         return(r.bGradeOfRank - l.bGradeOfRank);
     }
     if (r.stLbsUserInfo.stGameVip.dwCurLevel == l.stLbsUserInfo.stGameVip.dwCurLevel)
     {
         return((int)(r.stLbsUserInfo.dwPvpLvl - l.stLbsUserInfo.dwPvpLvl));
     }
     return((int)(r.stLbsUserInfo.stGameVip.dwCurLevel - l.stLbsUserInfo.stGameVip.dwCurLevel));
 }
Esempio n. 12
0
        public void ShowNormal(SCPKG_INVITE_JOIN_GAME_REQ info)
        {
            string          text            = CUIUtility.RemoveEmoji(StringHelper.UTF8BytesToString(ref info.stInviterInfo.szName));
            stUIEventParams stUIEventParams = default(stUIEventParams);

            stUIEventParams.tag = (int)info.bIndex;
            int num = 15;

            int.TryParse(Singleton <CTextManager> .get_instance().GetText("MessageBox_Close_Time"), ref num);
            this.form = Singleton <CUIManager> .GetInstance().OpenForm(string.Format("{0}{1}", "UGUI/Form/Common/", "Form_BeInvited.prefab"), false, false);

            GameObject gameObject = this.form.transform.Find("Panel/Panel/normal").gameObject;

            if (gameObject != null)
            {
                gameObject.CustomSetActive(true);
            }
            GameObject gameObject2 = this.form.transform.Find("Panel/Panel/refuse").gameObject;

            if (gameObject2 != null)
            {
                gameObject2.CustomSetActive(false);
            }
            this.listNode     = this.form.transform.Find("Panel/Panel/refuse/reasonPanel/DropList").gameObject;
            this.listScript   = this.listNode.transform.Find("List").GetComponent <CUIListScript>();
            this.m_inputFiled = this.form.transform.Find("Panel/Panel/refuse/reasonPanel/InputField").GetComponent <InputField>();
            this.m_sendBtn    = this.form.transform.Find("Panel/Panel/refuse/btnGroup/Button_Send").gameObject;
            this.form.transform.Find("Panel/Panel/refuse/MatchInfo").GetComponent <Text>().text = Singleton <CTextManager> .get_instance().GetText("Invite_Refuse_Title");

            if (this.form != null)
            {
                string text2 = null;
                string text3 = null;
                if (info.bInviteType == 1)
                {
                    ResDT_LevelCommonInfo pvpMapCommonInfo = CLevelCfgLogicManager.GetPvpMapCommonInfo(info.stInviteDetail.get_stRoomDetail().bMapType, info.stInviteDetail.get_stRoomDetail().dwMapId);
                    stUIEventParams.heroId      = (uint)info.stInviteDetail.get_stRoomDetail().bMapType;
                    stUIEventParams.weakGuideId = info.stInviteDetail.get_stRoomDetail().dwMapId;
                    if (pvpMapCommonInfo != null)
                    {
                        text2 = Singleton <CTextManager> .get_instance().GetText("Invite_Map_Desc", new string[]
                        {
                            ((int)(pvpMapCommonInfo.bMaxAcntNum / 2)).ToString(),
                            ((int)(pvpMapCommonInfo.bMaxAcntNum / 2)).ToString(),
                            Utility.UTF8Convert(pvpMapCommonInfo.szName)
                        });
                    }
                    text3 = Singleton <CTextManager> .GetInstance().GetText("Invite_Match_Type_4");
                }
                else if (info.bInviteType == 2)
                {
                    ResDT_LevelCommonInfo pvpMapCommonInfo2 = CLevelCfgLogicManager.GetPvpMapCommonInfo(info.stInviteDetail.get_stTeamDetail().bMapType, info.stInviteDetail.get_stTeamDetail().dwMapId);
                    stUIEventParams.heroId      = (uint)info.stInviteDetail.get_stTeamDetail().bMapType;
                    stUIEventParams.weakGuideId = info.stInviteDetail.get_stTeamDetail().dwMapId;
                    if (pvpMapCommonInfo2 != null)
                    {
                        text2 = Singleton <CTextManager> .get_instance().GetText("Invite_Map_Desc", new string[]
                        {
                            ((int)(pvpMapCommonInfo2.bMaxAcntNum / 2)).ToString(),
                            ((int)(pvpMapCommonInfo2.bMaxAcntNum / 2)).ToString(),
                            Utility.UTF8Convert(pvpMapCommonInfo2.szName)
                        });
                    }
                    if (info.stInviteDetail.get_stTeamDetail().bMapType == 3)
                    {
                        text3 = Singleton <CTextManager> .GetInstance().GetText("Invite_Match_Type_1");
                    }
                    else
                    {
                        text3 = Singleton <CTextManager> .GetInstance().GetText((info.stInviteDetail.get_stTeamDetail().bPkAI != 1) ? "Invite_Match_Type_3" : "Invite_Match_Type_2");
                    }
                }
                string text4 = Singleton <CTextManager> .get_instance().GetText("Be_Invited_Tips", new string[]
                {
                    text3,
                    text2
                });

                this.form.m_formWidgets[8].GetComponent <Text>().text = text4;
                uint   dwRelationMask = info.stInviterInfo.dwRelationMask;
                string text5;
                if ((dwRelationMask & 1u) > 0u)
                {
                    text5 = Singleton <CTextManager> .get_instance().GetText("Invite_Src_Type_1");

                    stUIEventParams.tag2 = 0;
                }
                else if ((dwRelationMask & 2u) > 0u)
                {
                    text5 = Singleton <CTextManager> .get_instance().GetText("Invite_Src_Type_4");

                    stUIEventParams.tag2 = 1;
                }
                else if ((dwRelationMask & 4u) > 0u)
                {
                    text5 = Singleton <CTextManager> .get_instance().GetText("Invite_Src_Type_5");

                    stUIEventParams.tag2 = 2;
                    CSDT_LBS_USER_INFO lBSUserInfo = Singleton <CFriendContoller> .get_instance().model.GetLBSUserInfo(info.stInviterInfo.ullUid, info.stInviterInfo.dwLogicWorldID, CFriendModel.LBSGenderType.Both);

                    if (lBSUserInfo != null)
                    {
                        stUIEventParams.tagUInt = lBSUserInfo.dwGameSvrEntity;
                    }
                }
                else
                {
                    text5 = Singleton <CTextManager> .get_instance().GetText("Invite_Src_Type_1");

                    stUIEventParams.tag2 = 3;
                }
                string text6 = string.Format(Singleton <CTextManager> .get_instance().GetText("Be_Invited_FromType"), text5);
                this.form.m_formWidgets[6].GetComponent <Text>().text = text6;
                stUIEventParams.tagStr             = string.Format("<color=#FFFFFF>{0}</color> {1} {2}", text, text4, text6);
                stUIEventParams.commonUInt64Param1 = info.stInviterInfo.ullUid;
                stUIEventParams.taskId             = info.stInviterInfo.dwLogicWorldID;
                stUIEventParams.tag3 = (int)info.bInviteType;
                if (num != 0)
                {
                    Transform transform = this.form.transform.Find("closeTimer");
                    if (transform != null)
                    {
                        this.timerScript = transform.GetComponent <CUITimerScript>();
                        if (this.timerScript != null)
                        {
                            this.timerScript.enabled = true;
                            this.timerScript.SetTotalTime((float)num);
                            this.timerScript.StartTimer();
                            this.timerScript.m_eventIDs[1]    = enUIEventID.Invite_TimeOut;
                            this.timerScript.m_eventParams[1] = stUIEventParams;
                        }
                    }
                }
                this.form.m_formWidgets[0].GetComponent <CUIEventScript>().SetUIEvent(enUIEventType.Click, enUIEventID.Invite_RefuseReason_Send, stUIEventParams);
                this.form.m_formWidgets[1].GetComponent <CUIEventScript>().SetUIEvent(enUIEventType.Click, enUIEventID.Invite_AcceptInvite, stUIEventParams);
                this.form.m_formWidgets[5].GetComponent <Text>().text = text;
                COM_SNSGENDER bGender   = info.stInviterInfo.bGender;
                Image         component = this.form.m_formWidgets[4].GetComponent <Image>();
                component.gameObject.CustomSetActive(bGender != 0);
                if (bGender == 1)
                {
                    CUIUtility.SetImageSprite(component, string.Format("{0}icon/Ico_boy.prefab", "UGUI/Sprite/Dynamic/"), null, true, false, false, false);
                }
                else if (bGender == 2)
                {
                    CUIUtility.SetImageSprite(component, string.Format("{0}icon/Ico_girl.prefab", "UGUI/Sprite/Dynamic/"), null, true, false, false, false);
                }
                CUIHttpImageScript component2 = this.form.m_formWidgets[3].GetComponent <CUIHttpImageScript>();
                component2.SetImageUrl(Singleton <ApolloHelper> .GetInstance().ToSnsHeadUrl(StringHelper.UTF8BytesToString(ref info.stInviterInfo.szHeadUrl)));
                MonoSingleton <NobeSys> .GetInstance().SetHeadIconBk(this.form.m_formWidgets[2].GetComponent <Image>(), (int)info.stInviterInfo.dwHeadImgId);

                MonoSingleton <NobeSys> .GetInstance().SetHeadIconBkEffect(this.form.m_formWidgets[2].GetComponent <Image>(), (int)info.stInviterInfo.dwHeadImgId, this.form, 1f);

                this.form.m_formWidgets[7].CustomSetActive(info.stInviterInfo.bGradeOfRank > 0);
                if (info.stInviterInfo.bGradeOfRank > 0)
                {
                    CLadderView.ShowRankDetail(this.form.m_formWidgets[7], info.stInviterInfo.bGradeOfRank, 0u, 1u, false, true, false, true, true);
                }
            }
        }
    private bool GetOtherPlayerState(COM_INVITE_RELATION_TYPE type, ulong uid, uint dwLogicWorldID, out string stateStr, out string headURL)
    {
        headURL = string.Empty;
        if (type == COM_INVITE_RELATION_TYPE.COM_INVITE_RELATION_FRIEND)
        {
            CFriendModel.FriendInGame friendInGaming = Singleton <CFriendContoller> .instance.model.GetFriendInGaming(uid, dwLogicWorldID);

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

            if (gameOrSnsFriend == null)
            {
                stateStr = Singleton <CMailSys> .instance.offlineStr;
                return(false);
            }
            headURL = Utility.UTF8Convert(gameOrSnsFriend.szHeadUrl);
            if (gameOrSnsFriend.bIsOnline != 1)
            {
                stateStr = Singleton <CMailSys> .instance.offlineStr;
                return(false);
            }
            stateStr = Singleton <CMailSys> .instance.onlineStr;
            if (friendInGaming == null)
            {
                return(gameOrSnsFriend.bIsOnline == 1);
            }
            if (friendInGaming.State == COM_ACNT_GAME_STATE.COM_ACNT_GAME_STATE_SINGLEGAME || friendInGaming.State == COM_ACNT_GAME_STATE.COM_ACNT_GAME_STATE_MULTIGAME)
            {
                if (friendInGaming.startTime > 0u)
                {
                    stateStr = Singleton <CMailSys> .instance.gamingStr;
                }
                else
                {
                    stateStr = string.Format("<color=#ffff00>{0}</color>", Singleton <CTextManager> .instance.GetText("Common_Gaming_NoTime"));
                }
            }
            else if (friendInGaming.State == COM_ACNT_GAME_STATE.COM_ACNT_GAME_STATE_TEAM)
            {
                stateStr = string.Format("<color=#ffff00>{0}</color>", Singleton <CTextManager> .instance.GetText("Common_Teaming"));
            }
            return(gameOrSnsFriend.bIsOnline == 1);
        }
        else if (type == COM_INVITE_RELATION_TYPE.COM_INVITE_RELATION_GUILDMEMBER)
        {
            GuildMemInfo guildMemberInfoByUid = CGuildHelper.GetGuildMemberInfoByUid(uid);
            if (guildMemberInfoByUid == null)
            {
                stateStr = Singleton <CMailSys> .instance.offlineStr;
                return(false);
            }
            headURL = guildMemberInfoByUid.stBriefInfo.szHeadUrl;
            if (!CGuildHelper.IsMemberOnline(guildMemberInfoByUid))
            {
                stateStr = Singleton <CMailSys> .instance.offlineStr;
                return(false);
            }
            stateStr = Singleton <CMailSys> .instance.onlineStr;
            if (guildMemberInfoByUid.GameState == COM_ACNT_GAME_STATE.COM_ACNT_GAME_STATE_SINGLEGAME || guildMemberInfoByUid.GameState == COM_ACNT_GAME_STATE.COM_ACNT_GAME_STATE_MULTIGAME)
            {
                if (guildMemberInfoByUid.dwGameStartTime > 0u)
                {
                    stateStr = Singleton <CMailSys> .instance.gamingStr;
                }
                else
                {
                    stateStr = string.Format("<color=#ffff00>{0}</color>", Singleton <CTextManager> .instance.GetText("Common_Gaming_NoTime"));
                }
            }
            return(true);
        }
        else
        {
            if (type != COM_INVITE_RELATION_TYPE.COM_INVITE_RELATION_LBS)
            {
                stateStr = Singleton <CMailSys> .instance.offlineStr;
                return(false);
            }
            CSDT_LBS_USER_INFO lBSUserInfo = Singleton <CFriendContoller> .instance.model.GetLBSUserInfo(uid, dwLogicWorldID, CFriendModel.LBSGenderType.Both);

            if (lBSUserInfo == null)
            {
                stateStr = Singleton <CMailSys> .instance.offlineStr;
                return(false);
            }
            headURL = Utility.UTF8Convert(lBSUserInfo.stLbsUserInfo.szHeadUrl);
            if (lBSUserInfo.stLbsUserInfo.bIsOnline == 1)
            {
                stateStr = Singleton <CMailSys> .instance.onlineStr;
            }
            else
            {
                stateStr = Singleton <CMailSys> .instance.offlineStr;
            }
            return(lBSUserInfo.stLbsUserInfo.bIsOnline == 1);
        }
    }
        private static void SetLBSState(GameObject element, ref CSDT_LBS_USER_INFO LBSInfo)
        {
            COMDT_FRIEND_INFO stLbsUserInfo = LBSInfo.stLbsUserInfo;
            GameObject        gameObject    = element.transform.FindChild("HeadBg").gameObject;
            Text       component            = element.transform.FindChild("Online").GetComponent <Text>();
            GameObject gameObject2          = element.transform.FindChild("InviteButton").gameObject;
            Text       component2           = element.transform.FindChild("PlayerName").GetComponent <Text>();
            GameObject obj = Utility.FindChild(element, "HeadBg/AntiDisturbBits");

            obj.CustomSetActive(false);
            bool flag = false;

            CInviteView.SetListElementLadderInfo(element, stLbsUserInfo);
            COM_ACNT_GAME_STATE cOM_ACNT_GAME_STATE = COM_ACNT_GAME_STATE.COM_ACNT_GAME_STATE_IDLE;

            if (stLbsUserInfo.bIsOnline == 1)
            {
                cOM_ACNT_GAME_STATE = COM_ACNT_GAME_STATE.COM_ACNT_GAME_STATE_IDLE;
                CFriendModel.FriendInGame friendInGaming = Singleton <CFriendContoller> .instance.model.GetFriendInGaming(stLbsUserInfo.stUin.ullUid, stLbsUserInfo.stUin.dwLogicWorldId);

                if (friendInGaming != null)
                {
                    cOM_ACNT_GAME_STATE = friendInGaming.State;
                    flag = ((friendInGaming.antiDisturbBits & 1u) == 1u);
                }
                if (cOM_ACNT_GAME_STATE == COM_ACNT_GAME_STATE.COM_ACNT_GAME_STATE_IDLE)
                {
                    if (flag)
                    {
                        component.set_text(Singleton <CTextManager> .instance.GetText("Common_NotDisturb"));
                        obj.CustomSetActive(true);
                    }
                    else
                    {
                        component.set_text(Singleton <CInviteSystem> .instance.GetInviteStateStr(stLbsUserInfo.stUin.ullUid, false));
                    }
                    CUIEventScript component3 = gameObject2.GetComponent <CUIEventScript>();
                    component3.m_onClickEventParams.tag  = (int)Singleton <CInviteSystem> .instance.InviteType;
                    component3.m_onClickEventParams.tag2 = (int)stLbsUserInfo.stUin.dwLogicWorldId;
                    component3.m_onClickEventParams.tag3 = (int)LBSInfo.dwGameSvrEntity;
                    component3.m_onClickEventParams.commonUInt64Param1 = stLbsUserInfo.stUin.ullUid;
                }
                else if (cOM_ACNT_GAME_STATE == COM_ACNT_GAME_STATE.COM_ACNT_GAME_STATE_SINGLEGAME || cOM_ACNT_GAME_STATE == COM_ACNT_GAME_STATE.COM_ACNT_GAME_STATE_MULTIGAME || cOM_ACNT_GAME_STATE == COM_ACNT_GAME_STATE.COM_ACNT_GAME_STATE_WAITMULTIGAME)
                {
                    component.set_text(string.Format("<color=#ffff00>{0}</color>", Singleton <CTextManager> .instance.GetText("Common_Gaming")));
                }
                else if (cOM_ACNT_GAME_STATE == COM_ACNT_GAME_STATE.COM_ACNT_GAME_STATE_TEAM)
                {
                    component.set_text(string.Format("<color=#ffff00>{0}</color>", Singleton <CTextManager> .instance.GetText("Common_Teaming")));
                }
                component2.set_color(CUIUtility.s_Color_White);
                CUIUtility.GetComponentInChildren <Image>(gameObject).set_color(CUIUtility.s_Color_White);
            }
            else
            {
                component.set_text(string.Format(Singleton <CTextManager> .instance.GetText("Common_Offline"), new object[0]));
                component2.set_color(CUIUtility.s_Color_Grey);
                CUIUtility.GetComponentInChildren <Image>(gameObject).set_color(CUIUtility.s_Color_GrayShader);
            }
            gameObject2.CustomSetActive(stLbsUserInfo.bIsOnline == 1 && !flag && cOM_ACNT_GAME_STATE == COM_ACNT_GAME_STATE.COM_ACNT_GAME_STATE_IDLE);
        }
 public static void UpdateLBSListElement(GameObject element, CSDT_LBS_USER_INFO LBSInfo)
 {
     CInviteView.UpdateFriendListElementBase(element, ref LBSInfo.stLbsUserInfo);
     CInviteView.SetLBSState(element, ref LBSInfo);
 }