Esempio n. 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.hasPlayerId())
            {
                this.playerId = buf.getInt();
            }

            if (this.hasPokerList())
            {
                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.pokerList.Add(DDZ_POCKER.decode(bytes));
                }
            }

            if (this.hasPokerListType())
            {
                this.pokerListType = (POKERLIST_TYPE)buf.get();
            }
        }
Esempio n. 2
0
        public static DDZ_POCKER decode(byte[] data)
        {
            DDZ_POCKER proto = newBuilder();

            proto.build(data);
            return(proto);
        }
Esempio n. 3
0
 public void addPocker(DDZ_POCKER value)
 {
     if (!this.hasPocker())
     {
         this.__flag[1] = (byte)(this.__flag[1] | 1);
     }
     this.pocker.Add(value);
 }
Esempio n. 4
0
 public void addPokerList(DDZ_POCKER value)
 {
     if (!this.hasPokerList())
     {
         this.__flag[0] = (byte)(this.__flag[0] | 2);
     }
     this.pokerList.Add(value);
 }
Esempio n. 5
0
 public void addLastPlayPokerList(DDZ_POCKER value)
 {
     if (!this.hasLastPlayPokerList())
     {
         this.__flag[1] = (byte)(this.__flag[1] | 4);
     }
     this.lastPlayPokerList.Add(value);
 }
Esempio n. 6
0
 public void addBasePokerList(DDZ_POCKER value)
 {
     if (!this.hasBasePokerList())
     {
         this.__flag[1] = (byte)(this.__flag[1] | 8);
     }
     this.basePokerList.Add(value);
 }
Esempio n. 7
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.hasPos())
            {
                this.pos = buf.getInt();
            }

            if (this.hasPocker())
            {
                byte[] bytes = new byte[buf.getInt()];
                buf.get(ref bytes, 0, bytes.Length);
                this.pocker = DDZ_POCKER.decode(bytes);
            }
        }
Esempio n. 8
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.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.hasCountdown())
            {
                this.countdown = buf.getLong();
            }

            if (this.hasRoomId())
            {
                this.roomId = buf.getInt();
            }

            if (this.hasIsBanker())
            {
                if (buf.get() == 1)
                {
                    this.isBanker = true;
                }
                else
                {
                    this.isBanker = false;
                }
            }

            if (this.hasPocker())
            {
                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.pocker.Add(DDZ_POCKER.decode(bytes));
                }
            }
        }
Esempio n. 9
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.hasPos())
            {
                this.pos = buf.getInt();
            }

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

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

            if (this.hasPour())
            {
                this.pour = buf.getInt();
            }

            if (this.hasStatus())
            {
                this.status = (SEAT_STATUS)buf.get();
            }

            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.hasIsWiner())
            {
                if (buf.get() == 1)
                {
                    this.isWiner = true;
                }
                else
                {
                    this.isWiner = false;
                }
            }

            if (this.hasPokerList())
            {
                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.pokerList.Add(DDZ_POCKER.decode(bytes));
                }
            }

            if (this.hasLastPlayPokerList())
            {
                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.lastPlayPokerList.Add(DDZ_POCKER.decode(bytes));
                }
            }

            if (this.hasLoopEarnings())
            {
                this.loopEarnings = buf.getInt();
            }

            if (this.hasTotalEarnings())
            {
                this.totalEarnings = buf.getInt();
            }

            if (this.hasIsBanker())
            {
                if (buf.get() == 1)
                {
                    this.isBanker = true;
                }
                else
                {
                    this.isBanker = false;
                }
            }

            if (this.hasIsSpring())
            {
                if (buf.get() == 1)
                {
                    this.isSpring = true;
                }
                else
                {
                    this.isSpring = false;
                }
            }
        }
Esempio n. 10
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.hasRoomId())
            {
                this.roomId = buf.getInt();
            }

            if (this.hasLoop())
            {
                this.loop = buf.getInt();
            }

            if (this.hasBaseScore())
            {
                this.baseScore = buf.getInt();
            }

            if (this.hasScores())
            {
                this.scores = buf.getInt();
            }

            if (this.hasStatus())
            {
                this.status = (ROOM_STATUS)buf.get();
            }

            if (this.hasMaxLoop())
            {
                this.maxLoop = buf.getInt();
            }

            if (this.hasTimes())
            {
                this.times = buf.getInt();
            }

            if (this.hasDizhu())
            {
                this.dizhu = buf.getInt();
            }

            if (this.hasSeatList())
            {
                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.seatList.Add(DDZ_SEAT.decode(bytes));
                }
            }

            if (this.hasSettingId())
            {
                int size = buf.getShort();
                for (int i = 0; i < size; i++)
                {
                    this.settingId.Add(buf.getInt());
                }
            }

            if (this.hasCurrentPlayPokerPos())
            {
                this.currentPlayPokerPos = buf.getInt();
            }

            if (this.hasBasePokerList())
            {
                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.basePokerList.Add(DDZ_POCKER.decode(bytes));
                }
            }

            if (this.hasOwnerId())
            {
                this.ownerId = buf.getInt();
            }

            if (this.hasCurrentQiangPlayerId())
            {
                this.currentQiangPlayerId = buf.getInt();
            }

            if (this.hasUnixtime())
            {
                this.unixtime = buf.getLong();
            }
        }