Beispiel #1
0
    void GetFriendsInfo()
    {
        if (m_Friends != null)
        {
            m_Friends.Clear();
        }
        if (m_Players != null)
        {
            m_Players.Clear();
        }
        switch (m_CurrentTab)
        {
        case eFriendsTabMode.FriendsSNS:
            return;

        case eFriendsTabMode.FriendsAdd:
        {
            C2G.FriendsCandidateList _packet = new C2G.FriendsCandidateList();
            Network.GameServer.JsonAsync <C2G.FriendsCandidateList, C2G.FriendsCandidateListAck>(_packet, OnFriendsCandidateListHandler);
            return;
        }
        }
        C2G.FriendsInfoGet packet = new C2G.FriendsInfoGet();
        packet.state = (eFriendsState)m_CurrentTab;
        Network.GameServer.JsonAsync <C2G.FriendsInfoGet, C2G.FriendsInfoGetAck>(packet, OnFriendsInfoGetHandler);
    }
Beispiel #2
0
 //C2G.FriendsInfoGetAck ack;
 void OnFriendsInfoGetHandler(C2G.FriendsInfoGet packet, C2G.FriendsInfoGetAck ack)
 {
     //this.ack = ack;
     m_Friends = ack.friends.FindAll(e => e.state_info.state == (eFriendsState)m_CurrentTab);
     m_Players = null;
     if (m_CurrentTab == eFriendsTabMode.FriendsList)
     {
         m_FriendsList.Clear();
         m_FriendsList.AddRange(ack.friends);
         UpdateSendGetButton();
     }
     if (m_CurrentTab == eFriendsTabMode.FriendsApproveList && m_Friends.Count > 0)
     {
         Network.Instance.NotifyMenu.is_friends_requested = true;
         UpdateNotify();
     }
     InitItem();
 }