コード例 #1
0
        public void build(byte[] data)
        {
            ByteBuffer buf = ByteBuffer.wrap(data);

            for (int i = 0; i < this.__flag.Length; i++)
            {
                this.__flag[i] = buf.get();
            }

            if (this.hasDismissStatus())
            {
                this.dismiss_status = (DISMISS_STATUS)buf.get();
            }
        }
コード例 #2
0
ファイル: SEAT_INFO.cs プロジェクト: guochaolinDLKF/LaiJu
        public void build(byte[] data)
        {
            ByteBuffer buf = ByteBuffer.wrap(data);

            for (int i = 0; i < this.__flag.Length; i++)
            {
                this.__flag[i] = buf.get();
            }

            if (this.hasPlayerId())
            {
                this.playerId = buf.getInt();
            }

            if (this.hasNickname())
            {
                byte[] bytes = new byte[buf.getShort()];
                buf.get(ref bytes, 0, bytes.Length);
                this.nickname = System.Text.Encoding.UTF8.GetString(bytes);
            }

            if (this.hasAvatar())
            {
                byte[] bytes = new byte[buf.getShort()];
                buf.get(ref bytes, 0, bytes.Length);
                this.avatar = System.Text.Encoding.UTF8.GetString(bytes);
            }

            if (this.hasGender())
            {
                this.gender = buf.get();
            }

            if (this.hasGold())
            {
                this.gold = buf.getInt();
            }

            if (this.hasType())
            {
                this.type = buf.getInt();
            }

            if (this.hasHandPocker())
            {
                this.HandPocker = buf.getInt();
            }

            if (this.hasSeatStatus())
            {
                this.seatStatus = (SEAT_STATUS)buf.get();
            }

            if (this.hasPokerInfo())
            {
                int size = buf.getShort();
                for (int i = 0; i < size; i++)
                {
                    byte[] bytes = new byte[buf.getInt()];
                    buf.get(ref bytes, 0, bytes.Length);
                    this.pokerInfo.Add(POKER_INFO.decode(bytes));
                }
            }

            if (this.hasPos())
            {
                this.pos = buf.getInt();
            }

            if (this.hasIsReady())
            {
                if (buf.get() == 1)
                {
                    this.isReady = true;
                }
                else
                {
                    this.isReady = false;
                }
            }

            if (this.hasDismissStatus())
            {
                this.dismiss_status = (DISMISS_STATUS)buf.get();
            }
        }