예제 #1
0
        public void RefreshFriendInfo(FriendReqType type_)
        {
            CSFriendRequest req = new CSFriendRequest();

            req.Type = type_;
            GameEvents.NetWorkEvents.SendAsyncMsg.SafeInvoke(req);
        }
예제 #2
0
 public void RemoveData(long id_, FriendReqType type_)
 {
     if (this.m_datas_dict.ContainsKey(type_) && this.m_datas_dict[type_].ContainsKey(id_))
     {
         this.m_datas_dict[type_].Remove(id_);
     }
 }
예제 #3
0
 public void RemoveDatas(FriendReqType type_)
 {
     if (this.m_datas_dict.ContainsKey(type_))
     {
         this.m_datas_dict.Remove(type_);
     }
 }
예제 #4
0
        public Dictionary <long, PlayerFriendMsg> GetDatas(FriendReqType type_)
        {
            if (this.m_datas_dict.ContainsKey(type_))
            {
                return(this.m_datas_dict[type_]);
            }

            return(null);
        }
예제 #5
0
        public PlayerFriendMsg GetData(long id_, FriendReqType type_)
        {
            PlayerFriendMsg ret;

            if (this.m_datas_dict.ContainsKey(type_) && this.m_datas_dict[type_].TryGetValue(id_, out ret))
            {
                return(ret);
            }

            return(null);
        }
예제 #6
0
        //public void AddData(PlayerFriendMsg data_, FriendReqType type_)
        //{
        //    if (!m_datas_dict.ContainsKey(type_))
        //    {
        //        m_datas_dict[type_] = new Dictionary<long, PlayerFriendMsg>();
        //    }

        //    if (!m_datas_dict[type_].ContainsKey(data_.PlayerId))
        //    {
        //        m_datas_dict[type_].Add(data_.PlayerId, data_);
        //    }
        //    else
        //    {
        //        this.m_datas_dict[type_][data_.PlayerId] = data_;
        //    }

        //}

        public void SetDatas(IEnumerable <PlayerFriendMsg> datas_, FriendReqType type_)
        {
            if (!m_datas_dict.ContainsKey(type_))
            {
                m_datas_dict[type_] = new Dictionary <long, PlayerFriendMsg>();
            }
            else
            {
                m_datas_dict[type_].Clear();
            }

            foreach (var data in datas_)

            {
                if (!this.m_datas_dict[type_].ContainsKey(data.PlayerId))
                {
                    m_datas_dict[type_].Add(data.PlayerId, data);
                }
                else
                {
                    this.m_datas_dict[type_][data.PlayerId] = data;
                }
            }
        }
예제 #7
0
        void OnRefreshPage(FriendReqType type_)
        {
            if (m_friend_list_view.Visible)
            {
#if TEST
                m_friend_list_view.Refresh(type_);
#else
                if (FriendReqType.Added == type_)
                {
                    RequestFriendInfos();
                }
                else if (FriendReqType.Agreeing == type_)
                {
                    RequestApplications();
                }
                else if (FriendReqType.Addinfo == type_)
                {
                    RequestConfirms();
                }

                if (FriendReqType.Added == type_)
                {
                    FriendDataManager.Instance.Last_apply = false;
                }
                else if (FriendReqType.Agreeing == type_)
                {
                    GameEvents.RedPointEvents.Sys_OnNewApplyReadedEvent.SafeInvoke();
                }
                else if (FriendReqType.Addinfo == type_)
                {
                    FriendDataManager.Instance.Last_apply = false;
                    GameEvents.RedPointEvents.Sys_OnNewFriendReadedEvent.SafeInvoke();
                }
#endif
            }
        }
예제 #8
0
        public override void OnPackageRequest(IMessage imsg, params object[] msg_params)
        {
            base.OnPackageRequest(imsg, msg_params);

            if (imsg is CSFriendRequest)
            {
                FriendReqType   r_type = (FriendReqType)(msg_params[0]);
                CSFriendRequest req    = imsg as CSFriendRequest;
                req.Type = r_type;
            }
            else if (imsg is CSFriendAddRequest)
            {
                CSFriendAddRequest req = imsg as CSFriendAddRequest;
                req.PlayerId = (long)(msg_params[0]);
            }
            else if (imsg is CSFriendDelRequest)
            {
                CSFriendDelRequest req = imsg as CSFriendDelRequest;
                req.PlayerId = (long)(msg_params[0]);
            }
            else if (imsg is CSFriendAgreeRequest)
            {
                CSFriendAgreeRequest req = imsg as CSFriendAgreeRequest;
                req.PlayerId = (long)(msg_params[0]);
            }
            else if (imsg is CSFriendDelApplyRequest)
            {
                CSFriendDelApplyRequest req = imsg as CSFriendDelApplyRequest;
                req.FriendId = (long)(msg_params[0]);
            }
            else if (imsg is CSFriendGiftRequest)
            {
                CSFriendGiftRequest req = imsg as CSFriendGiftRequest;
            }
            else if (imsg is CSFriendGiftSendRequest)
            {
                CSFriendGiftSendRequest req = imsg as CSFriendGiftSendRequest;
                req.FriendId = (long)(msg_params[0]);
            }
            else if (imsg is CSFriendGiftDrawRequest)
            {
                CSFriendGiftDrawRequest req = imsg as CSFriendGiftDrawRequest;
                req.GiftId = (long)(msg_params[0]);
            }
            else if (imsg is CSFriendViewRequest)
            {
                CSFriendViewRequest req = imsg as CSFriendViewRequest;
                req.FriendId = (long)(msg_params[0]);
            }
            else if (imsg is CSFriendRecommendListRequest)
            {
            }
            else if (imsg is CSFriendRecommendGetRequest)
            {
                CSFriendRecommendGetRequest req = imsg as CSFriendRecommendGetRequest;
                req.RecommendId = (long)(msg_params[0]);
            }
            else if (imsg is CSFriendRecommendApplyRequest)
            {
                CSFriendRecommendApplyRequest req = imsg as CSFriendRecommendApplyRequest;
                req.RecommendId.AddRange((List <long>)(msg_params[0]));
            }
        }