Exemplo n.º 1
0
        public static int FriendDataSort(COMDT_FRIEND_INFO l, COMDT_FRIEND_INFO r)
        {
            ushort        num;
            ushort        num2;
            EIntimacyType type;
            EIntimacyType type2;
            bool          flag;
            bool          flag2;

            if (l == r)
            {
                return(0);
            }
            if ((l == null) || (r == null))
            {
                return(0);
            }
            if (r.bIsOnline != l.bIsOnline)
            {
                return(r.bIsOnline - l.bIsOnline);
            }
            CFriendModel model = Singleton <CFriendContoller> .instance.model;

            model.GetFriendIntimacy(r.stUin.ullUid, r.stUin.dwLogicWorldId, out num, out type, out flag);
            model.GetFriendIntimacy(l.stUin.ullUid, l.stUin.dwLogicWorldId, out num2, out type2, out flag2);
            if (num2 != num)
            {
                return(num - num2);
            }
            if (r.stGameVip.dwCurLevel == l.stGameVip.dwCurLevel)
            {
                return((int)(r.dwPvpLvl - l.dwPvpLvl));
            }
            return((int)(r.stGameVip.dwCurLevel - l.stGameVip.dwCurLevel));
        }
        public void On_IntimacyRelation_Item_Enable(CUIEvent uievent)
        {
            if (uievent == null)
            {
                return;
            }
            int          srcWidgetIndexInBelongedList = uievent.m_srcWidgetIndexInBelongedList;
            CFriendModel model = Singleton <CFriendContoller> .GetInstance().model;

            ListView <CFR> list = model.FRData.GetList();

            if (list == null)
            {
                return;
            }
            CFR cFR = null;

            if (srcWidgetIndexInBelongedList >= 0 && srcWidgetIndexInBelongedList < list.Count)
            {
                cFR = list[srcWidgetIndexInBelongedList];
            }
            if (cFR != null && uievent.m_srcWidget != null)
            {
                CUIComponent component = uievent.m_srcWidget.GetComponent <CUIComponent>();
                if (component != null)
                {
                    this.ShowIntimacyRelation_Item(component, cFR, this.form);
                }
            }
        }
        public void On_Friend_Recruit_zmzListEnable(CUIEvent uievent)
        {
            if (uievent == null)
            {
                return;
            }
            int          srcWidgetIndexInBelongedList = uievent.m_srcWidgetIndexInBelongedList;
            CFriendModel model = Singleton <CFriendContoller> .GetInstance().model;

            ListView <CFriendRecruit.RecruitData> zhaoMuZheRewardList = model.friendRecruit.GetZhaoMuZheRewardList();

            if (zhaoMuZheRewardList == null)
            {
                return;
            }
            CFriendRecruit.RecruitData recruitData = null;
            if (srcWidgetIndexInBelongedList >= 0 && srcWidgetIndexInBelongedList < zhaoMuZheRewardList.Count)
            {
                recruitData = zhaoMuZheRewardList[srcWidgetIndexInBelongedList];
            }
            if (recruitData != null && uievent.m_srcWidget != null && uievent.m_srcWidget != null)
            {
                this.ShowZhaomuZhe_Item(uievent.m_srcWidget, recruitData);
            }
        }
Exemplo n.º 4
0
        public void Refresh_SnsSwitch()
        {
            if ((this.sns_share_switch != null) && (this.sns_add_switch != null))
            {
                this.sns_share_switch.CustomSetActive(false);
                this.sns_add_switch.CustomSetActive(false);
                CRoleInfo masterRoleInfo = Singleton <CRoleInfoManager> .instance.GetMasterRoleInfo();

                if ((masterRoleInfo != null) && !CSysDynamicBlock.bSocialBlocked)
                {
                    if (this.CurTab == Tab.Friend_SNS)
                    {
                        this.sns_share_switch.CustomSetActive(true);
                        bool flag = CFriendModel.IsOnSnsSwitch(masterRoleInfo.snsSwitchBits, COM_REFUSE_TYPE.COM_REFUSE_TYPE_DONOTE_AND_REC);
                        this.sns_share_switch.GetComponent <Toggle>().isOn = flag;
                    }
                    else if (this.CurTab == Tab.Friend_Request)
                    {
                        this.sns_add_switch.CustomSetActive(true);
                        bool flag2 = CFriendModel.IsOnSnsSwitch(masterRoleInfo.snsSwitchBits, COM_REFUSE_TYPE.COM_REFUSE_TYPE_ADDFRIEND);
                        this.sns_add_switch.GetComponent <Toggle>().isOn = flag2;
                    }
                }
            }
        }
Exemplo n.º 5
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);
        }
        public static void OnSendReserveReq(CSPkg msg)
        {
            SCPKG_RESERVE_MSG_RSP stSvrReserveMsgRsp = msg.stPkgData.stSvrReserveMsgRsp;
            ulong             ullUid          = stSvrReserveMsgRsp.stFromUin.ullUid;
            uint              dwLogicWorldId  = stSvrReserveMsgRsp.stFromUin.dwLogicWorldId;
            CFriendModel      model           = Singleton <CFriendContoller> .instance.model;
            COMDT_FRIEND_INFO gameOrSnsFriend = model.GetGameOrSnsFriend(ullUid, dwLogicWorldId);
            string            text            = UT.Bytes2String(gameOrSnsFriend.szUserName);

            if (gameOrSnsFriend == null)
            {
                return;
            }
            if (stSvrReserveMsgRsp.bErrCode == 0)
            {
                string key;
                if (stSvrReserveMsgRsp.bResult == 2)
                {
                    key = "Reserve_Success_Tips";
                    if (!model.friendReserve.sendReserve_accepted.Contains(text))
                    {
                        model.friendReserve.sendReserve_accepted.Add(text);
                    }
                }
                else
                {
                    key = "Reserve_Failed_Tips";
                }
                if (!Singleton <BattleLogic> .GetInstance().isRuning)
                {
                    string strContent = string.Format(Singleton <CTextManager> .instance.GetText(key), text);
                    Singleton <CUIManager> .instance.OpenTips(strContent, false, 1.5f, null, new object[0]);
                }
                model.friendReserve.SetData(ullUid, dwLogicWorldId, stSvrReserveMsgRsp.bResult, FriendReserve.ReserveDataType.Send);
                Singleton <EventRouter> .instance.BroadCastEvent(EventID.Friend_Game_State_Change);
            }
            else if (stSvrReserveMsgRsp.bErrCode == 1 || stSvrReserveMsgRsp.bErrCode == 2)
            {
                CS_RESERVE_MSG_PROCESS_RESULT bErrCode = (CS_RESERVE_MSG_PROCESS_RESULT)stSvrReserveMsgRsp.bErrCode;
                string text2 = Singleton <CTextManager> .instance.GetText(bErrCode.ToString());

                string strContent2 = string.Format(text2, text);
                Singleton <CUIManager> .instance.OpenTips(strContent2, false, 1.5f, null, new object[0]);

                model.friendReserve.SetData(ullUid, dwLogicWorldId, 1, FriendReserve.ReserveDataType.Send);
            }
            else
            {
                CS_RESERVE_MSG_PROCESS_RESULT bErrCode2 = (CS_RESERVE_MSG_PROCESS_RESULT)stSvrReserveMsgRsp.bErrCode;
                Singleton <CUIManager> .instance.OpenTips(bErrCode2.ToString(), true, 1.5f, null, new object[0]);

                model.friendReserve.SetData(ullUid, dwLogicWorldId, 1, FriendReserve.ReserveDataType.Send);
            }
        }
        public void Refresh_IntimacyRelation_List()
        {
            CFriendModel model = Singleton <CFriendContoller> .GetInstance().model;

            ListView <CFR> list = model.FRData.GetList();

            this.listScript.SetElementAmount(list.Count);
            for (int i = 0; i < list.Count; i++)
            {
                CUIListElementScript elemenet = this.listScript.GetElemenet(i);
                this.ShowIntimacyRelation_Item(elemenet, list[i], this.form);
            }
        }
        public void Refresh_ZhaomuZhe_List()
        {
            CFriendModel model = Singleton <CFriendContoller> .GetInstance().model;

            ListView <CFriendRecruit.RecruitData> zhaoMuZheRewardList = model.friendRecruit.GetZhaoMuZheRewardList();

            this.zhaomuzheList.SetElementAmount(zhaoMuZheRewardList.Count);
            for (int i = 0; i < zhaoMuZheRewardList.Count; i++)
            {
                CUIListElementScript elemenet = this.zhaomuzheList.GetElemenet(i);
                if (elemenet != null)
                {
                    this.ShowZhaomuZhe_Item(elemenet.gameObject, zhaoMuZheRewardList[i]);
                }
            }
        }
        public void Clear()
        {
            this.listScript = null;
            Singleton <CUIEventManager> .GetInstance().RemoveUIEventListener(enUIEventID.IntimacyRela_Menu_Close, new CUIEventManager.OnUIEventHandler(this.On_IntimacyRela_Menu_Close));

            Singleton <CUIEventManager> .GetInstance().RemoveUIEventListener(enUIEventID.IntimacyRela_Show_Drop_List, new CUIEventManager.OnUIEventHandler(this.On_IntimacyRela_Show_Drop_List));

            Singleton <CUIEventManager> .GetInstance().RemoveUIEventListener(enUIEventID.IntimacyRela_Drop_ListElement_Click, new CUIEventManager.OnUIEventHandler(this.On_IntimacyRela_Drop_ListElement_Click));

            Singleton <CUIEventManager> .GetInstance().RemoveUIEventListener(enUIEventID.IntimacyRela_Drop_ListElement_Enable, new CUIEventManager.OnUIEventHandler(this.On_Drop_ListElement_Enable));

            Singleton <CUIEventManager> .GetInstance().RemoveUIEventListener(enUIEventID.IntimacyRela_OK, new CUIEventManager.OnUIEventHandler(this.On_IntimacyRela_OK));

            Singleton <CUIEventManager> .GetInstance().RemoveUIEventListener(enUIEventID.IntimacyRela_Cancle, new CUIEventManager.OnUIEventHandler(this.On_IntimacyRela_Cancle));

            Singleton <CUIEventManager> .GetInstance().RemoveUIEventListener(enUIEventID.IntimacyRela_Item_Enable, new CUIEventManager.OnUIEventHandler(this.On_IntimacyRelation_Item_Enable));

            Singleton <CUIEventManager> .GetInstance().RemoveUIEventListener(enUIEventID.IntimacyRela_FristChoise, new CUIEventManager.OnUIEventHandler(this.On_IntimacyRela_FristChoise));

            Singleton <CUIEventManager> .GetInstance().RemoveUIEventListener(enUIEventID.IntimacyRela_Delete_Relation, new CUIEventManager.OnUIEventHandler(this.On_IntimacyRela_Delete_Relation));

            Singleton <CUIEventManager> .GetInstance().RemoveUIEventListener(enUIEventID.IntimacyRela_PrevState, new CUIEventManager.OnUIEventHandler(this.On_IntimacyRela_PrevState));

            Singleton <CUIEventManager> .GetInstance().RemoveUIEventListener(enUIEventID.IntimacyRela_Delete_Relation_OK, new CUIEventManager.OnUIEventHandler(this.On_IntimacyRela_Delete_Relation_OK));

            Singleton <EventRouter> .GetInstance().RemoveEventHandler("FRDataChange", new Action(this.On_FRDataChange));

            CFriendModel model = Singleton <CFriendContoller> .GetInstance().model;

            ListView <CFR> list = model.FRData.GetList();

            for (int i = 0; i < list.Count; i++)
            {
                CFR cFR = list[i];
                cFR.choiseRelation        = -1;
                cFR.bInShowChoiseRelaList = false;
                cFR.bRedDot = false;
            }
            if (Singleton <CFriendContoller> .instance.view != null)
            {
                Singleton <CFriendContoller> .instance.view.Refresh();
            }
            Singleton <EventRouter> .instance.BroadCastEvent("Friend_LobbyIconRedDot_Refresh");

            this.form = null;
        }
Exemplo n.º 10
0
        public static void On_Send_FriendPower(CSPkg msg)
        {
            Singleton <CUIManager> .GetInstance().CloseSendMsgAlert();

            SCPKG_CMD_DONATE_FRIEND_POINT stFriendDonatePointRsp = msg.stPkgData.stFriendDonatePointRsp;

            if (stFriendDonatePointRsp.dwResult == 0)
            {
                UT.Check_AddHeartCD(stFriendDonatePointRsp.stUin, (COM_FRIEND_TYPE)stFriendDonatePointRsp.bFriendType);
                Singleton <EventRouter> .GetInstance().BroadCastEvent("Friend_FriendList_Refresh");

                Singleton <EventRouter> .GetInstance().BroadCastEvent <SCPKG_CMD_DONATE_FRIEND_POINT>("Friend_Send_Coin_Done", stFriendDonatePointRsp);

                if (Singleton <CFriendContoller> .instance.model.IsSnsFriend(stFriendDonatePointRsp.stUin.ullUid, stFriendDonatePointRsp.stUin.dwLogicWorldId))
                {
                    COMDT_FRIEND_INFO info = Singleton <CFriendContoller> .instance.model.GetInfo(CFriendModel.FriendType.SNS, stFriendDonatePointRsp.stUin);

                    if (info != null)
                    {
                        string str = Utility.UTF8Convert(info.szOpenId);
                        if (!string.IsNullOrEmpty(str) && !CFriendModel.IsOnSnsSwitch(info.dwRefuseFriendBits, COM_REFUSE_TYPE.COM_REFUSE_TYPE_DONOTE_AND_REC))
                        {
                            string text = Singleton <CTextManager> .instance.GetText("Common_Sns_Tips_3");

                            string confirmStr = Singleton <CTextManager> .instance.GetText("Common_Sns_Tips_5");

                            string cancelStr = Singleton <CTextManager> .instance.GetText("Common_Sns_Tips_4");

                            stUIEventParams param = new stUIEventParams();
                            param.snsFriendEventParams.openId = str;
                            Singleton <CUIManager> .instance.OpenMessageBoxWithCancel(text, enUIEventID.Friend_Share_SendCoin, enUIEventID.None, param, confirmStr, cancelStr, false);

                            return;
                        }
                    }
                }
                Singleton <CUIManager> .GetInstance().OpenTips(UT.GetText("Friend_Tips_SendHeartOK"), false, 1.5f, null, new object[0]);
            }
            else
            {
                Singleton <CUIManager> .GetInstance().OpenTips(UT.ErrorCode_String(stFriendDonatePointRsp.dwResult), false, 1.5f, null, new object[0]);
            }
        }
Exemplo n.º 11
0
        private static void SetFriendState(GameObject element, ref COMDT_FRIEND_INFO friend)
        {
            if (element == null || friend == null)
            {
                return;
            }
            CFriendModel model       = Singleton <CFriendContoller> .instance.model;
            GameObject   gameObject  = element.transform.FindChild("HeadBg").gameObject;
            GameObject   gameObject2 = element.transform.FindChild("InviteButton").gameObject;
            Text         component   = element.transform.FindChild("Online").GetComponent <Text>();
            Text         component2  = element.transform.FindChild("PlayerName").GetComponent <Text>();
            GameObject   obj         = Utility.FindChild(element, "HeadBg/AntiDisturbBits");

            obj.CustomSetActive(false);
            Text component3 = element.transform.FindChild("Time").GetComponent <Text>();
            bool flag       = false;

            if (component3 != null)
            {
                component3.gameObject.CustomSetActive(false);
            }
            if (component != null)
            {
                component.gameObject.CustomSetActive(true);
            }
            GameObject gameObject3 = Utility.FindChild(element, "ReserveButton");

            gameObject3.CustomSetActive(false);
            GameObject gameObject4 = Utility.FindChild(element, "ReserveText");

            gameObject4.CustomSetActive(false);
            CInviteView.SetListElementLadderInfo(element, friend);
            COM_ACNT_GAME_STATE cOM_ACNT_GAME_STATE = COM_ACNT_GAME_STATE.COM_ACNT_GAME_STATE_IDLE;

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

                if (friendInGaming == null)
                {
                    cOM_ACNT_GAME_STATE = COM_ACNT_GAME_STATE.COM_ACNT_GAME_STATE_IDLE;
                }
                else
                {
                    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(friend.stUin.ullUid, false));
                    }
                    if (friendInGaming != null && friendInGaming.IsUseTGA())
                    {
                        component.gameObject.CustomSetActive(true);
                        component.set_text(string.Format("<color=#ffff00>{0}</color>", Singleton <CTextManager> .instance.GetText("TGA_Friend_State")));
                    }
                    CUIEventScript component4 = gameObject2.GetComponent <CUIEventScript>();
                    component4.m_onClickEventParams.tag  = (int)Singleton <CInviteSystem> .instance.InviteType;
                    component4.m_onClickEventParams.tag2 = (int)friend.stUin.dwLogicWorldId;
                    component4.m_onClickEventParams.commonUInt64Param1 = friend.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)
                {
                    if (friendInGaming == null)
                    {
                        component.gameObject.CustomSetActive(true);
                        component.set_text("friendInGame is null");
                        return;
                    }
                    if (friendInGaming.startTime > 0u)
                    {
                        component.gameObject.CustomSetActive(false);
                        component3.gameObject.CustomSetActive(true);
                        component3.set_text(string.Format(Singleton <CTextManager> .instance.GetText("Common_Gaming_Time"), CInviteView.GetStartMinute(friendInGaming.startTime)));
                        Singleton <CInviteSystem> .instance.CheckInviteListGameTimer();

                        if (Singleton <CFriendContoller> .instance.model.friendReserve.BServerEnableReverse)
                        {
                            FriendReserve.Ent          ent = model.friendReserve.Find(friend.stUin.ullUid, friend.stUin.dwLogicWorldId, FriendReserve.ReserveDataType.Send);
                            ushort                     num;
                            CFriendModel.EIntimacyType eIntimacyType;
                            bool flag2;
                            model.GetFriendIntimacy(friend.stUin.ullUid, friend.stUin.dwLogicWorldId, out num, out eIntimacyType, out flag2);
                            if (ent == null)
                            {
                                bool flag3 = (friendInGaming.antiDisturbBits & 1u) > 0u;
                                bool flag4 = (friend.dwRefuseFriendBits & 16u) == 0u;
                                if (flag4 && !flag3 && num >= 100)
                                {
                                    gameObject3.CustomSetActive(true);
                                    gameObject4.CustomSetActive(false);
                                    if (gameObject3 != null)
                                    {
                                        CUIEventScript component5 = gameObject3.GetComponent <CUIEventScript>();
                                        component5.m_onClickEventParams.commonUInt64Param1 = friend.stUin.ullUid;
                                        component5.m_onClickEventParams.tagUInt            = friend.stUin.dwLogicWorldId;
                                        component5.m_onClickEventParams.tagStr             = Utility.UTF8Convert(friend.szUserName);
                                    }
                                }
                            }
                            else
                            {
                                gameObject3.CustomSetActive(false);
                                gameObject4.CustomSetActive(true);
                                if (gameObject4 != null)
                                {
                                    Text component6 = gameObject4.GetComponent <Text>();
                                    if (component6 != null)
                                    {
                                        if (ent != null && ent.result == 2)
                                        {
                                            component6.set_text(model.friendReserve.Reserve_Success);
                                        }
                                        else if (ent != null && ent.result == 1)
                                        {
                                            component6.set_text(model.friendReserve.Reserve_Failed);
                                        }
                                        else
                                        {
                                            component6.set_text(model.friendReserve.Reserve_Wait4Rsp);
                                        }
                                    }
                                }
                            }
                        }
                    }
                    else
                    {
                        component.gameObject.CustomSetActive(true);
                        component.set_text(string.Format("<color=#ffff00>{0}</color>", Singleton <CTextManager> .instance.GetText("Common_Gaming_NoTime")));
                    }
                }
                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(friend.bIsOnline == 1 && !flag && cOM_ACNT_GAME_STATE == COM_ACNT_GAME_STATE.COM_ACNT_GAME_STATE_IDLE);
        }
Exemplo n.º 12
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));
            }
        }
Exemplo n.º 13
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);
            }
        }