Exemple #1
0
        public void ProcessFriendList(COMDT_ACNT_UNIQ uniq, COMDT_INTIMACY_DATA data)
        {
            if (uniq == null || data == null)
            {
                return;
            }
            byte bIntimacyState = data.bIntimacyState;
            CFR  cfr            = this.GetCfr(uniq.ullUid, uniq.dwLogicWorldId);

            if (cfr != null && cfr.state != null)
            {
                return;
            }
            if (CFR.GetCDDays(data.dwTerminateTime) != -1)
            {
                this.Add(uniq.ullUid, uniq.dwLogicWorldId, bIntimacyState, 0, data.dwTerminateTime, false);
                return;
            }
            if (data.bIntimacyState == 0 && (uint)data.wIntimacyValue == Singleton <CFriendContoller> .get_instance().model.GetMaxIntimacyNum())
            {
                this.Add(uniq.ullUid, uniq.dwLogicWorldId, 24, 0, data.dwTerminateTime, false);
                return;
            }
            if (bIntimacyState != 0)
            {
                this.Add(uniq.ullUid, uniq.dwLogicWorldId, bIntimacyState, 0, data.dwTerminateTime, false);
            }
        }
Exemple #2
0
        public void Add(ulong ulluid, uint worldId, COM_INTIMACY_STATE state, COM_INTIMACY_RELATION_CHG_TYPE op, uint timeStamp, bool bReceiveNtf = false)
        {
            CRoleInfo masterRoleInfo = Singleton <CRoleInfoManager> .get_instance().GetMasterRoleInfo();

            if (masterRoleInfo != null && masterRoleInfo.playerUllUID == ulluid && (long)masterRoleInfo.logicWorldID == (long)((ulong)worldId))
            {
                return;
            }
            CFR cfr = this.GetCfr(ulluid, worldId);

            if (cfr == null)
            {
                this.m_cfrList.Add(new CFR(ulluid, worldId, state, op, timeStamp, bReceiveNtf));
            }
            else
            {
                cfr.SetData(ulluid, worldId, state, op, timeStamp, bReceiveNtf);
            }
            if (state == 1)
            {
                this.FindSetState(20, 24);
            }
            if (state == 2)
            {
                this.FindSetState(22, 24);
            }
            Singleton <EventRouter> .GetInstance().BroadCastEvent("FRDataChange");
        }
        public void ProcessFriendList(COMDT_ACNT_UNIQ uniq, COMDT_INTIMACY_DATA data)
        {
            if (uniq == null || data == null)
            {
                return;
            }
            byte bIntimacyState = data.bIntimacyState;
            CFR  cfr            = this.GetCfr(uniq.ullUid, uniq.dwLogicWorldId);

            if (cfr != null && cfr.state != COM_INTIMACY_STATE.COM_INTIMACY_STATE_NULL)
            {
                return;
            }
            if (CFR.GetCDDays(data.dwTerminateTime) != -1)
            {
                this.Add(uniq.ullUid, uniq.dwLogicWorldId, (COM_INTIMACY_STATE)bIntimacyState, COM_INTIMACY_RELATION_CHG_TYPE.COM_INTIMACY_RELATION_NULL, data.dwTerminateTime, false);
                return;
            }
            if (data.bIntimacyState == 0 && (uint)data.wIntimacyValue >= Singleton <CFriendContoller> .instance.model.GetIntimacyRequestValue())
            {
                this.Add(uniq.ullUid, uniq.dwLogicWorldId, COM_INTIMACY_STATE.COM_INTIMACY_STATE_VALUE_FULL, COM_INTIMACY_RELATION_CHG_TYPE.COM_INTIMACY_RELATION_NULL, data.dwTerminateTime, false);
                return;
            }
            if (bIntimacyState != 0)
            {
                this.Add(uniq.ullUid, uniq.dwLogicWorldId, (COM_INTIMACY_STATE)bIntimacyState, COM_INTIMACY_RELATION_CHG_TYPE.COM_INTIMACY_RELATION_NULL, data.dwTerminateTime, false);
            }
        }
        public void Add(ulong ulluid, uint worldId, COM_INTIMACY_STATE state, COM_INTIMACY_RELATION_CHG_TYPE op, uint timeStamp, bool bReceiveNtf = false)
        {
            CRoleInfo masterRoleInfo = Singleton <CRoleInfoManager> .instance.GetMasterRoleInfo();

            if (masterRoleInfo != null && masterRoleInfo.playerUllUID == ulluid && (long)masterRoleInfo.logicWorldID == (long)((ulong)worldId))
            {
                return;
            }
            CFR cfr = this.GetCfr(ulluid, worldId);

            if (cfr == null)
            {
                this.m_cfrList.Add(new CFR(ulluid, worldId, state, op, timeStamp, bReceiveNtf));
            }
            else
            {
                cfr.SetData(ulluid, worldId, state, op, timeStamp, bReceiveNtf);
            }
            if (IntimacyRelationViewUT.IsRelaState(state))
            {
                COM_INTIMACY_STATE confirmState = IntimacyRelationViewUT.GetConfirmState(state);
                this.FindSetState(confirmState, COM_INTIMACY_STATE.COM_INTIMACY_STATE_VALUE_FULL);
            }
            Singleton <EventRouter> .GetInstance().BroadCastEvent("FRDataChange");
        }
        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 ShowIntimacyRelation_Item(CUIComponent com, CFR frData, CUIFormScript uiFrom)
 {
     if (com == null || frData == null)
     {
         return;
     }
     IntimacyRelationViewUT.Show_Item(com, frData, uiFrom);
 }
 public void ShowIntimacyRelation_Item(CUIComponent com, CFR frData)
 {
     if (com == null || frData == null)
     {
         return;
     }
     IntimacyRelationViewUT.Show_Item(com, frData);
 }
        public void ResetChoiseRelaState(ulong ulluid, uint worldID)
        {
            CFR cfr = this.GetCfr(ulluid, worldID);

            if (cfr != null)
            {
                cfr.choiseRelation        = -1;
                cfr.bInShowChoiseRelaList = false;
            }
        }
 public void FindSetState(COM_INTIMACY_STATE target1, COM_INTIMACY_STATE newState)
 {
     for (int i = 0; i < this.m_cfrList.Count; i++)
     {
         CFR cFR = this.m_cfrList[i];
         if (cFR != null && cFR.state == target1 && !cFR.bReciveOthersRequest)
         {
             cFR.state = newState;
         }
     }
 }
        private void On_IntimacyRela_Delete_Relation_OK(CUIEvent uievent)
        {
            ulong commonUInt64Param = uievent.m_eventParams.commonUInt64Param1;
            uint  tagUInt           = uievent.m_eventParams.tagUInt;
            CFR   cfr = Singleton <CFriendContoller> .instance.model.FRData.GetCfr(commonUInt64Param, tagUInt);

            if (cfr != null && IntimacyRelationViewUT.IsRelaState(cfr.state))
            {
                FriendRelationNetCore.Send_INTIMACY_RELATION_REQUEST(commonUInt64Param, tagUInt, cfr.state, COM_INTIMACY_RELATION_CHG_TYPE.COM_INTIMACY_RELATION_DEL);
            }
        }
 public void FindSetState(COM_INTIMACY_STATE target1, COM_INTIMACY_STATE target2, COM_INTIMACY_STATE newState)
 {
     for (int i = 0; i < this.m_cfrList.Count; i++)
     {
         CFR cFR = this.m_cfrList[i];
         if (cFR != null && (cFR.state == target1 || cFR.state == target2))
         {
             cFR.state = newState;
         }
     }
 }
		private static void SetButtonParam(GameObject obj, CFR frData)
		{
			CUIEventScript component = obj.GetComponent<CUIEventScript>();
			if (component != null)
			{
				component.m_onClickEventParams.commonUInt64Param1 = frData.ulluid;
				component.m_onClickEventParams.tagUInt = frData.worldID;
				component.m_onClickEventParams.tag = (int)frData.state;
				component.m_onClickEventParams.tag2 = frData.choiseRelation;
			}
		}
        private void On_IntimacyRela_FristChoise(CUIEvent uievent)
        {
            ulong commonUInt64Param = uievent.m_eventParams.commonUInt64Param1;
            uint  tagUInt           = uievent.m_eventParams.tagUInt;
            CFR   cfr = Singleton <CFriendContoller> .instance.model.FRData.GetCfr(commonUInt64Param, tagUInt);

            if (cfr != null)
            {
                FriendRelationNetCore.Send_CHG_INTIMACYPRIORITY(cfr.state);
            }
        }
Exemple #14
0
 public void FindSetState(COM_INTIMACY_STATE target1, COM_INTIMACY_STATE newState)
 {
     for (int i = 0; i < this.m_cfrList.get_Count(); i++)
     {
         CFR cFR = this.m_cfrList.get_Item(i);
         if (cFR != null && cFR.state == target1)
         {
             cFR.state = newState;
         }
     }
 }
 public bool HasRedDot()
 {
     for (int i = 0; i < this.m_cfrList.Count; i++)
     {
         CFR cFR = this.m_cfrList[i];
         if (cFR != null && cFR.bRedDot)
         {
             return(true);
         }
     }
     return(false);
 }
 public CFR GetCfr(ulong ulluid, uint worldID)
 {
     for (int i = 0; i < this.m_cfrList.Count; i++)
     {
         CFR cFR = this.m_cfrList[i];
         if (cFR != null && cFR.ulluid == ulluid && cFR.worldID == worldID)
         {
             return(cFR);
         }
     }
     return(null);
 }
 public CFR FindFrist(COM_INTIMACY_STATE state)
 {
     for (int i = 0; i < this.m_cfrList.Count; i++)
     {
         CFR cFR = this.m_cfrList[i];
         if (cFR != null && cFR.state == state)
         {
             return(cFR);
         }
     }
     return(null);
 }
 public void Clear()
 {
     for (int i = 0; i < this.m_cfrList.Count; i++)
     {
         CFR cFR = this.m_cfrList[i];
         if (cFR != null)
         {
             cFR.Clear();
         }
     }
     this.m_cfrList.Clear();
     this._initmacyLimitTime = 0u;
 }
        public static void Show_Item(CUIComponent com, CFR frData)
        {
            CRoleInfo masterRoleInfo = Singleton <CRoleInfoManager> .get_instance().GetMasterRoleInfo();

            if (masterRoleInfo != null && masterRoleInfo.playerUllUID == frData.ulluid && (long)masterRoleInfo.logicWorldID == (long)((ulong)frData.worldID))
            {
                return;
            }
            IntimacyRelationViewUT.Show_Item_Top(com, frData);
            IntimacyRelationViewUT.Show_Item_Middle(com, frData);
            IntimacyRelationViewUT.Show_Item_Bottom(com, frData);
            frData.bRedDot = false;
        }
		public static void Show_Item(CUIComponent com, CFR frData, CUIFormScript uiFrom)
		{
			CRoleInfo masterRoleInfo = Singleton<CRoleInfoManager>.instance.GetMasterRoleInfo();
			if (masterRoleInfo != null && masterRoleInfo.playerUllUID == frData.ulluid && (long)masterRoleInfo.logicWorldID == (long)((ulong)frData.worldID))
			{
				return;
			}
			IntimacyRelationViewUT.Show_Item_Top(com, frData, uiFrom);
			IntimacyRelationViewUT.Show_Item_Middle(com, frData, uiFrom);
			IntimacyRelationViewUT.Show_Item_Bottom(com, frData);
			frData.bRedDot = false;
			GameObject obj = Utility.FindChild(com.m_widgets[1], "NobeImag");
			obj.CustomSetActive(!frData.bInShowChoiseRelaList);
		}
		public static void Set_Drop_Text(CUIComponent com, bool bShow, CFR frData)
		{
			com.m_widgets[9].CustomSetActive(bShow);
			string text = string.Empty;
			CFriendRelationship.FRConfig cFGByIndex = Singleton<CFriendContoller>.instance.model.FRData.GetCFGByIndex(frData.choiseRelation);
			if (cFGByIndex != null)
			{
				text = cFGByIndex.cfgRelaStr;
			}
			else
			{
				text = UT.FRData().IntimRela_Tips_SelectRelation;
			}
			com.m_widgets[9].GetComponent<Text>().set_text(text);
		}
Exemple #22
0
 public static void ProcessByErrorCode(uint errorCode, ulong ulluid, uint worldID)
 {
     if (errorCode == 0u)
     {
         return;
     }
     if (errorCode == 191u || errorCode == 193u || errorCode == 188u || errorCode == 189u || errorCode == 189u || errorCode == 101u || errorCode == 189u)
     {
         CFR cfr = CFriendRelationship.FRData.GetCfr(ulluid, worldID);
         if (cfr != null)
         {
             cfr.state = COM_INTIMACY_STATE.COM_INTIMACY_STATE_VALUE_FULL;
         }
     }
 }
        private void On_IntimacyRela_Drop_ListElement_Click(CUIEvent uievent)
        {
            CUIComponent   component         = uievent.m_srcWidgetScript.m_widgets[0].GetComponent <CUIComponent>();
            CUIEventScript component2        = component.m_widgets[7].GetComponent <CUIEventScript>();
            ulong          commonUInt64Param = component2.m_onClickEventParams.commonUInt64Param1;
            uint           tagUInt           = component2.m_onClickEventParams.tagUInt;
            CFR            cfr = Singleton <CFriendContoller> .instance.model.FRData.GetCfr(commonUInt64Param, tagUInt);

            if (cfr == null)
            {
                return;
            }
            cfr.bInShowChoiseRelaList = false;
            cfr.choiseRelation        = uievent.m_srcWidgetIndexInBelongedList;
            IntimacyRelationViewUT.Show_Item(component, cfr, this.form);
        }
        private void On_IntimacyRela_PrevState(CUIEvent uievent)
        {
            ulong commonUInt64Param = uievent.m_eventParams.commonUInt64Param1;
            uint  tagUInt           = uievent.m_eventParams.tagUInt;
            CFR   cfr = Singleton <CFriendContoller> .instance.model.FRData.GetCfr(commonUInt64Param, tagUInt);

            if (IntimacyRelationViewUT.IsRelaStateConfirm(cfr.state) && !cfr.bReciveOthersRequest)
            {
                cfr.state = COM_INTIMACY_STATE.COM_INTIMACY_STATE_VALUE_FULL;
            }
            if (IntimacyRelationViewUT.IsRelaStateDeny(cfr.state) && !cfr.bReciveOthersRequest)
            {
                cfr.state = IntimacyRelationViewUT.GetStateByDenyState(cfr.state);
            }
            Singleton <EventRouter> .GetInstance().BroadCastEvent("FRDataChange");
        }
        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;
        }
        private void On_IntimacyRela_Show_Drop_List(CUIEvent uievent)
        {
            ulong commonUInt64Param = uievent.m_eventParams.commonUInt64Param1;
            uint  tagUInt           = uievent.m_eventParams.tagUInt;
            CFR   cfr = Singleton <CFriendContoller> .instance.model.FRData.GetCfr(commonUInt64Param, tagUInt);

            if (cfr != null)
            {
                cfr.bInShowChoiseRelaList = !cfr.bInShowChoiseRelaList;
                CUIComponent  component  = uievent.m_srcWidgetScript.m_widgets[0].GetComponent <CUIComponent>();
                CUIListScript component2 = uievent.m_srcWidgetScript.m_widgets[1].GetComponent <CUIListScript>();
                if (component2 != null)
                {
                    component2.SetElementAmount(4);
                }
                IntimacyRelationViewUT.Show_Item(component, cfr, this.form);
            }
        }
        private void On_IntimacyRela_Delete_Relation(CUIEvent uievent)
        {
            ulong commonUInt64Param = uievent.m_eventParams.commonUInt64Param1;
            uint  tagUInt           = uievent.m_eventParams.tagUInt;
            CFR   cfr = Singleton <CFriendContoller> .get_instance().model.FRData.GetCfr(commonUInt64Param, tagUInt);

            if (cfr != null)
            {
                if (cfr.state == 1)
                {
                    FriendRelationNetCore.Send_INTIMACY_RELATION_REQUEST(commonUInt64Param, tagUInt, 1, 2);
                }
                if (cfr.state == 2)
                {
                    FriendRelationNetCore.Send_INTIMACY_RELATION_REQUEST(commonUInt64Param, tagUInt, 2, 2);
                }
            }
        }
        public void Remove(ulong ulluid, uint worldID)
        {
            int num = -1;

            for (int i = 0; i < this.m_cfrList.Count; i++)
            {
                CFR cFR = this.m_cfrList[i];
                if (cFR != null && cFR.ulluid == ulluid && cFR.worldID == worldID)
                {
                    num = i;
                }
            }
            if (num != -1)
            {
                this.m_cfrList.RemoveAt(num);
                Singleton <EventRouter> .GetInstance().BroadCastEvent("FRDataChange");
            }
        }
		public static void Show_Item_Top(CUIComponent com, CFR frData, CUIFormScript uiFrom)
		{
			Image componetInChild = Utility.GetComponetInChild<Image>(com.gameObject, "Image");
			IntimacyRelationViewUT.SetRelationBGImg(componetInChild, frData.state);
			IntimacyRelationViewUT.SetButtonParam(com.m_widgets[19], frData);
			if (IntimacyRelationViewUT.IsRelaState(frData.state))
			{
				com.m_widgets[19].CustomSetActive(true);
			}
			else
			{
				com.m_widgets[19].CustomSetActive(false);
			}
			COMDT_FRIEND_INFO friendInfo = frData.friendInfo;
			if (friendInfo == null)
			{
				return;
			}
			CUIHttpImageScript component = com.m_widgets[1].GetComponent<CUIHttpImageScript>();
			UT.SetHttpImage(component, friendInfo.szHeadUrl);
			Image componetInChild2 = Utility.GetComponetInChild<Image>(component.gameObject, "NobeImag");
			if (componetInChild2 && uiFrom != null)
			{
				MonoSingleton<NobeSys>.GetInstance().SetHeadIconBk(componetInChild2, (int)friendInfo.stGameVip.dwHeadIconId);
				MonoSingleton<NobeSys>.GetInstance().SetHeadIconBkEffect(componetInChild2, (int)friendInfo.stGameVip.dwHeadIconId, uiFrom, 1f, true);
			}
			GameObject gameObject = com.m_widgets[2];
			if (gameObject)
			{
				MonoSingleton<NobeSys>.GetInstance().SetNobeIcon(gameObject.GetComponent<Image>(), (int)friendInfo.stGameVip.dwCurLevel, false, false, friendInfo.ullUserPrivacyBits);
			}
			Text component2 = com.m_widgets[3].GetComponent<Text>();
			string text = UT.Bytes2String(friendInfo.szUserName);
			if (component2 != null)
			{
				component2.set_text(text);
			}
			GameObject genderImage = com.m_widgets[4];
			FriendShower.ShowGender(genderImage, (COM_SNSGENDER)friendInfo.bGender);
		}
        public static void Show_Item_Top(CUIComponent com, CFR frData)
        {
            IntimacyRelationViewUT.SetButtonParam(com.m_widgets[19], frData);
            if (frData.state == 1 || frData.state == 2)
            {
                com.m_widgets[19].CustomSetActive(true);
            }
            else
            {
                com.m_widgets[19].CustomSetActive(false);
            }
            COMDT_FRIEND_INFO friendInfo = frData.friendInfo;

            if (friendInfo == null)
            {
                return;
            }
            CUIHttpImageScript component = com.m_widgets[1].GetComponent <CUIHttpImageScript>();

            UT.SetHttpImage(component, friendInfo.szHeadUrl);
            GameObject gameObject = com.m_widgets[2];

            if (gameObject)
            {
                MonoSingleton <NobeSys> .GetInstance().SetNobeIcon(gameObject.GetComponent <Image>(), (int)friendInfo.stGameVip.dwCurLevel, false);
            }
            Text   component2 = com.m_widgets[3].GetComponent <Text>();
            string text       = UT.Bytes2String(friendInfo.szUserName);

            if (component2 != null)
            {
                component2.text = text;
            }
            GameObject genderImage = com.m_widgets[4];

            FriendShower.ShowGender(genderImage, friendInfo.bGender);
        }