コード例 #1
0
ファイル: SocketNiuNiuEvent.cs プロジェクト: wly2/BaiLaoHui
    //服务端返回用户选牌
    public void OnEventChooseCard(byte[] buffer, int size)
    {
        CMD_S_SelectCard sendCard = NetUtil.BytesToStruct <CMD_S_SelectCard>(buffer);

        MyDebug.Log("========================用户选择的牌================================" + sendCard.w_selected_type);
        MyDebug.Log("========================选好后剩余的牌的可选牌型================================" + sendCard.w_left_card_type);
    }
コード例 #2
0
    //服务端返回用户选牌
    public void OnEventChooseCard(byte[] buffer, int size)
    {
        GameDataSSS.Instance.choiceCard.Clear();
        CMD_S_SelectCard sendCard = NetUtil.BytesToStruct <CMD_S_SelectCard>(buffer);

        if (sendCard.cb_select_card[4] > 0)
        {
            GameDataSSS.Instance.choiceCard.Clear();
            for (int i = 0; i < sendCard.cb_select_card.Length; i++)
            {
                int cardPoint = NetUtil.PuCardChange((PU_KE)sendCard.cb_select_card[i]);
                GameDataSSS.Instance.choiceCard.Add(cardPoint);
                GameDataSSS.Instance.lastCard.Remove(cardPoint);
            }
            MyDebug.Log("LastCard:" + GameDataSSS.Instance.lastCard.Count);
            MyDebug.Log("ChoicedCard:" + GameDataSSS.Instance.choiceCard.Count);
            SocketEventHandle.Instance.SetClientResponse(APIS.PICKCARD_RESPONSE, null);
            //用户选牌,返回选的牌
        }
        else
        {
            //用户放牌,剩余可选类型
            SetPuKType(sendCard.w_left_card_type);
            SocketEventHandle.Instance.SetClientResponse(APIS.RETURN_INFO_RESPONSE, null);
            MyDebug.Log("LastCard:" + GameDataSSS.Instance.lastCard.Count);
            MyDebug.Log("ChoicedCard:" + GameDataSSS.Instance.choiceCard.Count);
        }
        MyDebug.Log("========================用户选择的牌================================" + sendCard.w_selected_type);
        MyDebug.Log("========================选好后剩余的牌的可选牌型================================" + sendCard.w_left_card_type);
    }