Exemplo n.º 1
0
    //---------------------------------------------------------------------------

    public void OnClickSend()
    {
        C2G.FriendsSend packet = new C2G.FriendsSend();
        packet.account_idx = m_Info.account_idx;
        packet.is_all      = false;
        Network.GameServer.JsonAsync <C2G.FriendsSend, C2G.FriendsAckBase>(packet, OnFriendsSendHandler);
    }
Exemplo n.º 2
0
    public void OnClickSendAll()
    {
        if (m_Friends.Exists(e => e.state_info.give_daily_index != Network.DailyIndex) == false)
        {
            Tooltip.Instance.ShowMessageKey("NotExistsFriendsGift");
            return;
        }

        C2G.FriendsSend packet = new C2G.FriendsSend();
        packet.account_idx = 0;
        packet.is_all      = true;
        Network.GameServer.JsonAsync <C2G.FriendsSend, C2G.FriendsAckBase>(packet, OnFriendsSendHandler);
    }
Exemplo n.º 3
0
    void OnFriendsSendHandler(C2G.FriendsSend packet, C2G.FriendsAckBase ack)
    {
        switch (ack.result)
        {
        case pe_FriendsResult.Success:
            Tooltip.Instance.ShowMessageKey("FriendsSendGiftSuccess");
            StateInfo.give_daily_index = Network.DailyIndex;
            UpdateButton();
            break;

        default:
            Friends.ShowFriendsErrorTooltip(ack.result);
            break;
        }
    }
Exemplo n.º 4
0
    void OnFriendsSendHandler(C2G.FriendsSend packet, C2G.FriendsAckBase ack)
    {
        if (ack.result != pe_FriendsResult.Success)
        {
            return;
        }

        int count = m_Friends.Count(e => e.state_info.give_daily_index != Network.DailyIndex);

        Tooltip.Instance.ShowMessageKeyFormat("FriendsGiftSendAllCompleted", count);
        m_Friends.ForEach(e => e.state_info.give_daily_index = Network.DailyIndex);
        //if(m_FriendsList.FindAll(e=>e.state_info.available_gift == true).Count * FriendsGiftValue + Network.PlayerInfo.GetGoodsValue(pe_GoodsType.token_friends) > FriendsGiftMax)
        //{
        //    Tooltip.Instance.ShowMessageKey("NoMoreGetFriendsGift");
        //    return;
        //}

        InitItem();
        UpdateSendGetButton();
    }