示例#1
0
    void OnFriendsRequestHandler(C2G.FriendsRequest packet, C2G.FriendsRequestAck ack)
    {
        switch (ack.result)
        {
        case pe_FriendsResult.Success:
            gameObject.SetActive(false);
            if (OnCallback != null)
            {
                OnCallback(new pd_FriendsInfo(m_Info));
            }
            break;

        case pe_FriendsResult.AlreadyRequest:
        case pe_FriendsResult.AlreadyRequested:
        case pe_FriendsResult.TargetFriendsCountMax:
            gameObject.SetActive(false);
            if (OnCallback != null)
            {
                OnCallback(m_Info);
            }
            Friends.ShowFriendsErrorTooltip(ack.result);
            break;

        default:
            Friends.ShowFriendsErrorTooltip(ack.result);
            break;
        }
    }
示例#2
0
 public void OnClickReqeust()
 {
     C2G.FriendsRequest packet = new C2G.FriendsRequest();
     packet.account_idx = new System.Collections.Generic.List <long>();
     packet.account_idx.Add(m_Info.account_idx);
     Network.GameServer.JsonAsync <C2G.FriendsRequest, C2G.FriendsRequestAck>(packet, OnFriendsRequestHandler);
 }
示例#3
0
 public void OnClickRequestAll()
 {
     if (m_Players.Count == 0)
     {
         return;
     }
     C2G.FriendsRequest packet = new C2G.FriendsRequest();
     packet.account_idx = m_Players.Select(e => e.account_idx).ToList();
     Network.GameServer.JsonAsync <C2G.FriendsRequest, C2G.FriendsRequestAck>(packet, OnFriendsRequestHandler);
 }
示例#4
0
    public void OnClickFriendsReuqest()
    {
        if (m_Chat.Line.AccountIdx == SHSavedData.AccountIdx)
        {
            return;
        }

        C2G.FriendsRequest packet = new C2G.FriendsRequest();
        packet.account_idx = new List <long>();
        packet.account_idx.Add(m_Chat.Line.AccountIdx);
        Network.GameServer.JsonAsync <C2G.FriendsRequest, C2G.FriendsRequestAck>(packet, OnFriendsRequestHandler);
    }
示例#5
0
    void OnFriendsRequestHandler(C2G.FriendsRequest packet, C2G.FriendsRequestAck ack)
    {
        switch (ack.result)
        {
        case pe_FriendsResult.Success:
            m_Players.Clear();
            InitItem();
            break;

        default:
            ShowFriendsErrorTooltip(ack.result);
            if (ack.request_count > 0)
            {
                m_Players.Clear();
                InitItem();
            }
            break;
        }
    }
示例#6
0
    void OnFriendsRequestHandler(C2G.FriendsRequest send, C2G.FriendsRequestAck ack)
    {
        switch (ack.result)
        {
        case pe_FriendsResult.Success:
            Tooltip.Instance.ShowMessageKey("RequestedFriends");
            Close();
            break;

        case pe_FriendsResult.AlreadyRequest:
        case pe_FriendsResult.AlreadyRequested:
        case pe_FriendsResult.TargetFriendsCountMax:
            gameObject.SetActive(false);
            Friends.ShowFriendsErrorTooltip(ack.result);
            break;

        default:
            Friends.ShowFriendsErrorTooltip(ack.result);
            break;
        }
    }