コード例 #1
0
    private void RecvNotifyDraw(byte[] args)
    {
        int gId = MsgParse.PopInt(ref args);

        if (gId != RoomManager.Instance.rData.gId.Value)
        {
            return;
        }

        byte rank      = MsgParse.PopByte(ref args);
        byte suit      = MsgParse.PopByte(ref args);
        int  pId       = MsgParse.PopInt(ref args);
        int  localRank = CardManager.CardConvert2C(suit, rank);
        var  player    = RoomManager.Instance.rData.GetPlayer(pId);

        if (player != null)
        {
            if (player.handCardsData.Count == 0)
            {
                player.state = EPlayerState.Deal;
            }

            player.handCardsData.Add(localRank);
        }

        Log.Debug("给id={2},{0}发牌数据,本地序号={1},牌个数={3}", player.name, localRank, pId, player.handCardsData.Count);
    }