Beispiel #1
0
    public void AddFriend(COM_ContactInfo v)
    {
        Add(v, friends_);

        if (UpdateFriend != null)
        {
            UpdateFriend(v, true);
        }
    }
Beispiel #2
0
    public void AddOffen(COM_ContactInfo v)
    {
        Add(v, offens_);

        if (UpdateOffen != null)
        {
            UpdateOffen(v, true);
        }
    }
Beispiel #3
0
    public void AddBlack(COM_ContactInfo v)
    {
        Add(v, blacks_);

        if (UpdateBlack != null)
        {
            UpdateBlack(v, true);
        }
    }
Beispiel #4
0
    public List <COM_Chat> ChatCache(COM_ContactInfo contact)
    {
        if (_chatDic.ContainsKey(contact.name_))
        {
            return(_chatDic [contact.name_]);
        }

        return(null);
    }
Beispiel #5
0
    private void Add(COM_ContactInfo v, IList l)
    {
        if (Get(v.instId_, l) != null)
        {
            return;
        }

        l.Add(v);
    }
Beispiel #6
0
    private void Del(string name, IList l)
    {
        COM_ContactInfo v = Get(name, l);

        if (v != null)
        {
            l.Remove(v);
        }
    }
Beispiel #7
0
    private void Del(uint uuid, IList l)
    {
        COM_ContactInfo v = Get(uuid, l);

        if (v != null)
        {
            l.Remove(v);
        }
    }
Beispiel #8
0
 void OnCellDelBlack(GameObject obj, COM_ContactInfo info)
 {
     if (info == null)
     {
         return;
     }
     MessageBoxUI.ShowMe(LanguageManager.instance.GetValue("delback"), () => {
         NetConnection.Instance.delBlacklist(info.instId_);
     });
 }
Beispiel #9
0
 private int SortContactInfo(COM_ContactInfo Info, COM_ContactInfo Info1)
 {
     if (Info.rank_ > Info1.rank_)
     {
         return(1);
     }
     else
     {
         return(-1);
     }
 }
Beispiel #10
0
    public void DelOffen(uint uuid)
    {
        COM_ContactInfo off = Get(uuid, offens_);

        if (UpdateOffen != null)
        {
            UpdateOffen(off, false);
        }

        Del(uuid, offens_);
    }
Beispiel #11
0
 public void RequestContactInfoOk(COM_ContactInfo req)
 {
     if (req == null)
     {
         return;
     }
     if (FindFriendOkEvent != null)
     {
         FindFriendOkEvent(req);
     }
 }
Beispiel #12
0
 void OnUpdataFriendList(COM_ContactInfo contact, bool isNew)
 {
     if (isNew)
     {
         //	PopText.Instance.Show(LanguageManager.instance.GetValue("addfriendok"));
     }
     else
     {
         //PopText.Instance.Show(LanguageManager.instance.GetValue("delfriendOk"));
     }
     UpdataFriendList();
 }
Beispiel #13
0
 void OnUpdataBlackList(COM_ContactInfo contact, bool isNew)
 {
     if (isNew)
     {
         PopText.Instance.Show(LanguageManager.instance.GetValue("addbackok"));
     }
     else
     {
         PopText.Instance.Show(LanguageManager.instance.GetValue("delbackok"));
     }
     UpdataBlackList();
 }
Beispiel #14
0
    public void DelBlack(uint uuid)
    {
        COM_ContactInfo v = Get(uuid, blacks_);

        if (v != null)
        {
            Del(uuid, blacks_);
            if (UpdateBlack != null)
            {
                UpdateBlack(v, false);
            }
        }
    }
Beispiel #15
0
    public void DelFriend(uint uuid)
    {
        COM_ContactInfo v = Get(uuid, friends_);

        if (v != null)
        {
            Del(uuid, friends_);

            if (UpdateFriend != null)
            {
                UpdateFriend(v, false);
            }
        }
    }
Beispiel #16
0
    private COM_ContactInfo Get(string name, IList l)
    {
        COM_ContactInfo ci = null;

        for (int i = 0; i < l.Count; ++i)
        {
            ci = (COM_ContactInfo)l[i];
            if (ci.name_ == name)
            {
                return(ci);
            }
        }
        return(null);
    }
Beispiel #17
0
    private COM_ContactInfo Get(uint uuid, IList l)
    {
        COM_ContactInfo ci = null;

        for (int i = 0; i < l.Count; ++i)
        {
            ci = (COM_ContactInfo)l[i];
            if (ci.instId_ == uuid)
            {
                return(ci);
            }
        }
        return(null);
    }
Beispiel #18
0
    public bool IsmyFriend(int id)
    {
        COM_ContactInfo ci = null;

        for (int i = 0; i < friends_.Count; ++i)
        {
            ci = (COM_ContactInfo)friends_[i];
            if (ci.instId_ == id)
            {
                return(true);
            }
        }
        return(false);
    }
Beispiel #19
0
 private void OnAddBlackList(ButtonScript obj, COM_ContactInfo info)
 {
     if (info == null)
     {
         return;
     }
     if (FriendSystem.Instance().GetBlack(info.instId_) != null)
     {
         MessageBoxUI.ShowMe(LanguageManager.instance.GetValue("alreadyhaveback"), null, true);
         return;
     }
     MessageBoxUI.ShowMe(LanguageManager.instance.GetValue("addback").Replace("{n}", info.name_), () => {
         NetConnection.Instance.addBlacklist(info.instId_);
     });
 }
Beispiel #20
0
    private void OnFunBtn(GameObject obj, COM_ContactInfo info)
    {
        if (info == null)
        {
            return;
        }
        if (_selectFriendBtn != null)
        {
            _selectFriendBtn.GetComponent <UISprite> ().spriteName = "jn_jinlan";
        }
        _selectFriendBtn = obj;
        _selectFriendBtn.GetComponent <UISprite> ().spriteName = "jn_jinlanliang";
        _selectFriend = info;


        if (FriendSystem.Instance().offens_.Contains(_selectFriend) && !FriendSystem.Instance().friends_.Contains(_selectFriend))
        {
            funAddFriend.gameObject.SetActive(true);
        }
        else
        {
            funAddFriend.gameObject.SetActive(false);
        }

        funPane.gameObject.SetActive(true);

        if (TeamSystem.IsInTeam() && TeamSystem.IsTeamLeader())
        {
            ctlTeamBtn.gameObject.GetComponentInChildren <UILabel>().text = LanguageManager.instance.GetValue("yaoqingrudui");
        }
        else
        {
            if (TeamSystem.IsInTeam())
            {
                ctlTeamBtn.gameObject.GetComponentInChildren <UILabel>().text = LanguageManager.instance.GetValue("haoyoushenqingrudui");;
            }
        }

        funBtns.transform.position = new Vector3(funBtns.transform.position.x, obj.gameObject.transform.position.y, 0f);
    }
Beispiel #21
0
    void OnFriendChat(COM_ContactInfo contact, COM_Chat msg)
    {
        if (_selectFriend != null && contact.instId_ == _selectFriend.instId_)
        {
            /*GameObject obj = Object.Instantiate(chatCell.gameObject) as GameObject;
             * obj.SetActive(true);
             * FriendItem cellUI = obj.GetComponent<FriendItem>();
             * cellUI._chatInfo = msg;
             * if(msg.audio_ != null && msg.audio_.Length > 0)
             * {
             * //	obj.transform.Find ("info").GetComponent<UILabel> ().gameObject.SetActive(false);
             *      obj.transform.Find ("vButton").GetComponent<UIButton> ().gameObject.SetActive(true);
             * }
             * else
             * {
             *      obj.transform.Find ("vButton").GetComponent<UIButton> ().gameObject.SetActive(false);
             * }
             * //obj.transform.Find ("info").GetComponent<UILabel> ().text = msg.content_;
             *
             * //cellUI.SetInfoBack(msg.content_);
             * cellUI.ParseSymbol(msg.content_);
             *
             * HeadIconLoader.Instance.LoadIcon(EntityAssetsData.GetData((int)contact.assetId_).assetsIocn_, obj.transform.Find ("icon").Find ("Sprite").GetComponent<UITexture>());
             * if(!_icons.Contains(EntityAssetsData.GetData((int)contact.assetId_).assetsIocn_))
             * {
             *      _icons.Add(EntityAssetsData.GetData((int)contact.assetId_).assetsIocn_);
             * }
             *
             * cellUI.name_.text = contact.name_;
             * //cellUI.level_.text = contact.level_.ToString ();
             * chatGrid.AddChild(obj.transform);
             * obj.transform.localScale = Vector3.one;
             */



            GameObject tf = null;
            tf = GameObject.Instantiate(_GridItem) as GameObject;
            cGrid.AddChild(tf.transform);
            tf.transform.localScale = Vector3.one;
            tf.gameObject.SetActive(true);
            ChatMaxCell  cmi  = tf.gameObject.GetComponent <ChatMaxCell>();
            COM_ChatInfo info = new COM_ChatInfo();
            Filt(ref msg.content_, 0, 1);
            info.content_    = msg.content_;
            info.ck_         = ChatKind.CK_Friend;
            info.playerName_ = contact.name_;
            info.assetId_    = (ushort)contact.assetId_;
            cmi.Info         = info;
            cmi._LChatKindBackground.gameObject.SetActive(false);
            cmi._RChatKindBackground.gameObject.SetActive(false);
            chatCellList.Add(tf);
        }
        else
        {
            foreach (var x in friendCellList)
            {
                if (x.GetComponent <FriendItem>().ContactInfo.instId_ == contact.instId_)
                {
                    //x.GetComponent<FriendItem>().red.gameObject.SetActive(true);
                    x.GetComponent <UISprite>().MarkOn();                   //UISprite.MarkAnthor.MA_RightTop,0,0);
                    break;
                }
            }
            foreach (COM_ContactInfo f in FriendSystem.Instance().offens_)
            {
                if (f.instId_ == contact.instId_)
                {
                    offTabBtn.GetComponentInChildren <UISprite>().MarkOn(UISprite.MarkAnthor.MA_RightTop, -10, -10);
                    break;
                }
            }
        }
    }
Beispiel #22
0
    private void UpdateChatList(COM_ContactInfo contact)
    {
        List <COM_Chat> strArr = FriendSystem.Instance().ChatCache(contact);

        for (int i = 0; i < chatCellList.Count; i++)
        {
            //chatGrid.RemoveChild(chatCellList[i].transform);
            cGrid.RemoveChild(chatCellList[i].transform);
            chatCellList[i].transform.parent = null;
            chatCellList[i].gameObject.SetActive(false);
            GameObject.Destroy(chatCellList[i]);
        }
        chatCellList.Clear();
        //	return;
        //}
        if (strArr != null && strArr.Count > 0)
        {
            for (int i = 0; i < strArr.Count; i++)
            {
                if (!strArr[i].isMe)
                {
                    GameObject tf = null;
                    tf = GameObject.Instantiate(_GridItem) as GameObject;
                    cGrid.AddChild(tf.transform);
                    tf.transform.localScale = Vector3.one;
                    tf.gameObject.SetActive(true);
                    ChatMaxCell  cmi  = tf.gameObject.GetComponent <ChatMaxCell>();
                    COM_ChatInfo info = new COM_ChatInfo();
                    Filt(ref strArr[i].content_, 0, 1);
                    info.content_    = strArr[i].content_;
                    info.ck_         = ChatKind.CK_Friend;
                    info.playerName_ = contact.name_;
                    info.assetId_    = (ushort)contact.assetId_;
                    cmi.Info         = info;
                    cmi._LChatKindBackground.gameObject.SetActive(false);
                    cmi._RChatKindBackground.gameObject.SetActive(false);
                    chatCellList.Add(tf);
                }
                else
                {
                    GameObject tf = null;
                    tf = GameObject.Instantiate(_GridItem) as GameObject;
                    cGrid.AddChild(tf.transform);
                    tf.transform.localScale = Vector3.one;
                    tf.gameObject.SetActive(true);
                    ChatMaxCell  cmi  = tf.gameObject.GetComponent <ChatMaxCell>();
                    COM_ChatInfo info = new COM_ChatInfo();
                    Filt(ref strArr[i].content_, 0, 1);
                    info.content_    = strArr[i].content_;
                    info.ck_         = ChatKind.CK_Friend;
                    info.playerName_ = GamePlayer.Instance.InstName;
                    info.assetId_    = (ushort)GamePlayer.Instance.GetIprop(PropertyType.PT_AssetId);
                    cmi.Info         = info;
                    cmi._LChatKindBackground.gameObject.SetActive(false);
                    cmi._RChatKindBackground.gameObject.SetActive(false);
                    chatCellList.Add(tf);
                }
            }
        }
        cGrid.Reposition();
        scrollBar.value = 1;
        //FriendSystem.Instance ().ChatDict.Remove(contact.name_);
    }
Beispiel #23
0
 void OnUpdateOffens(COM_ContactInfo contact, bool isNew)
 {
     UpdateLatelyList();
 }