Beispiel #1
0
 public void Remove(long uid, eFriendType type, System.Action <EB.Sparx.Response> dataHandler)
 {
     EB.Sparx.Request request = endPoint.Post("/friend/remove");
     request.AddData("uid", uid);
     request.AddData("type", (int)type);
     BlockService(request, dataHandler);
 }
Beispiel #2
0
        public void OnSearchFriendClick()
        {
            if (mType == eFriendType.Search)
            {
                return;
            }

            ContentObj.CustomSetActive(false);
            Type = eFriendType.Search;
            FriendSearchObj.CustomSetActive(true);
        }
Beispiel #3
0
        public void OnTeamTabClick()
        {
            if (mType == eFriendType.Team)
            {
                return;
            }

            ContentObj.CustomSetActive(true);
            Type = eFriendType.Team;
            Open(1);
            FriendSearchObj.CustomSetActive(false);
        }
Beispiel #4
0
        public void OnRecentlyContactTabClick()
        {
            if (mType == eFriendType.Recently)
            {
                return;
            }

            ContentObj.CustomSetActive(true);
            Type = eFriendType.Recently;
            Open(0);
            FriendSearchObj.CustomSetActive(false);
        }
Beispiel #5
0
        public void OnBlackListTabClick()
        {
            if (mType == eFriendType.Black)
            {
                return;
            }

            ContentObj.CustomSetActive(true);
            Type = eFriendType.Black;
            Open(1);
            FriendSearchObj.CustomSetActive(false);
        }
Beispiel #6
0
        public void OnMyFriendTabClick()
        {
            if (mType == eFriendType.My && !FriendHudController.mFirstOpen)
            {
                return;
            }

            ContentObj.CustomSetActive(true);
            Type = eFriendType.My;
            Open(0);
            FriendSearchObj.CustomSetActive(false);
        }
Beispiel #7
0
 public void Remove(long uid, eFriendType type, System.Action <bool> callback)
 {
     Api.Remove(uid, type, delegate(EB.Sparx.Response response)
     {
         if (response != null)
         {
             FetchDataHandler(response);
             callback(response.sucessful);
         }
         else
         {
             callback(false);
         }
     });
 }
Beispiel #8
0
 public void Open(eFriendType type)
 {
     if (type == eFriendType.My)
     {
         OnMyFriendTabClick();
     }
     else if (type == eFriendType.Black)
     {
         OnBlackListTabClick();
     }
     else if (type == eFriendType.Recently)
     {
         OnRecentlyContactTabClick();
     }
     else if (type == eFriendType.Team)
     {
         OnTeamTabClick();
     }
 }
Beispiel #9
0
        private void OnTeamListener(string path, INodeData data)
        {
            TeamList list = data as TeamList;

            if (list == null || !list.IsHaveUpdate)
            {
                return;
            }

            TeamNum = list.List.Count;
            TabController.SetPeopleNum(null, null, null, string.Format("{0}/{1}", list.List.Count, FriendManager.Instance.Config.MaxTeamNum));
            list.List.Sort(new FriendComparer());

            if (mFirstOpen)
            {
                if (mParam != null)
                {
                    Hashtable   ht   = mParam as Hashtable;
                    eFriendType type = (eFriendType)ht["type"];
                    TabController.Open(type);
                    int index = (int)type - 1;
                    titleCon.SetTitleBtn(index);
                }
                else
                {
                    TabController.Open(eFriendType.My);
                    titleCon.SetTitleBtn(0);
                }
                mFirstOpen = false;
            }
            else
            {
                DoSelectFriendAction();
                if (TabController.Type == eFriendType.My && FriendManager.Instance.MyFriends.List.Count <= 0)
                {
                    controller.GObjects["FriendRedPoint"].CustomSetActive(false);
                }
            }
        }
Beispiel #10
0
        public eFriendType ParseFriendType(string name, object value, eFriendType defaultType)
        {
            Hashtable obj = null;

            if (value is Hashtable)
            {
                var ht = (Hashtable)value;
                obj = (Hashtable)ht[name];
                if (obj != null)
                {
                    foreach (int VARIABLE in Enum.GetValues(typeof(eFriendType)))
                    {
                        string key = Enum.GetName(typeof(eFriendType), VARIABLE)?.ToLower();
                        if (obj.Contains(key))
                        {
                            return((eFriendType)VARIABLE);
                        }
                    }
                }
            }
            Debug.LogWarning("-----obj:{0} not Contain an eFriendType key--------", obj);
            return(defaultType);
        }
Beispiel #11
0
        private void MoveToFirst(eFriendType type, long targetUid)
        {
            switch (type)
            {
            case eFriendType.My:
                var friend = FriendManager.Instance.MyFriends.Find(targetUid);
                if (friend != null)
                {
                    if (FriendManager.Instance.MyFriends.List.IndexOf(friend) == 0)
                    {
                        return;
                    }
                    FriendManager.Instance.MyFriends.Remove(targetUid);
                    FriendManager.Instance.MyFriends.List.Insert(0, friend);
                }
                break;

            case eFriendType.Black:
                var blackList = FriendManager.Instance.BlackLists.Find(targetUid);
                if (blackList != null)
                {
                    if (FriendManager.Instance.BlackLists.List.IndexOf(blackList) == 0)
                    {
                        return;
                    }
                    FriendManager.Instance.BlackLists.Remove(targetUid);
                    FriendManager.Instance.BlackLists.List.Insert(0, blackList);
                }
                break;

            case eFriendType.Recently:
                var recently = FriendManager.Instance.Recentlys.Find(targetUid);
                if (recently != null)
                {
                    if (FriendManager.Instance.Recentlys.List.IndexOf(recently) == 0)
                    {
                        return;
                    }

                    FriendManager.Instance.Recentlys.Remove(targetUid);
                    FriendManager.Instance.Recentlys.List.Insert(0, recently);
                }
                else
                {
                    EB.Debug.LogWarning("while moveToFirst cannot find recently targetuid={0}", targetUid);
                }
                break;

            case eFriendType.Team:
                var team = FriendManager.Instance.Teams.Find(targetUid);
                if (team != null)
                {
                    if (FriendManager.Instance.Teams.List.IndexOf(team) == 0)
                    {
                        return;
                    }
                    FriendManager.Instance.Teams.Remove(targetUid);
                    FriendManager.Instance.Teams.List.Insert(0, team);
                }
                break;
            }
        }