示例#1
0
        public static OP_SEAT_FULL decode(byte[] data)
        {
            OP_SEAT_FULL proto = newBuilder();

            proto.build(data);
            return(proto);
        }
示例#2
0
 public void addSeat(OP_SEAT_FULL value)
 {
     if (!this.hasSeat())
     {
         this.__flag[0] = (byte)(this.__flag[0] | 16);
     }
     this.seat.Add(value);
 }
示例#3
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.hasSeat())
            {
                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.seat.Add(OP_SEAT_FULL.decode(bytes));
                }
            }

            if (this.hasProbPoker())
            {
                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.probPoker.Add(OP_POKER.decode(bytes));
                }
            }

            if (this.hasLuckPoker())
            {
                byte[] bytes = new byte[buf.getInt()];
                buf.get(ref bytes, 0, bytes.Length);
                this.luckPoker = OP_POKER.decode(bytes);
            }

            if (this.hasIsResult())
            {
                if (buf.get() == 1)
                {
                    this.isResult = true;
                }
                else
                {
                    this.isResult = false;
                }
            }
        }
示例#4
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.hasAskPokerGroup())
            {
                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.askPokerGroup.Add(OP_POKER_GROUP.decode(bytes));
                }
            }

            if (this.hasLuckPoker())
            {
                byte[] bytes = new byte[buf.getInt()];
                buf.get(ref bytes, 0, bytes.Length);
                this.luckPoker = OP_POKER.decode(bytes);
            }

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

            if (this.hasMatchId())
            {
                this.matchId = buf.getInt();
            }

            if (this.hasSeat())
            {
                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.seat.Add(OP_SEAT_FULL.decode(bytes));
                }
            }

            if (this.hasDiceSecond())
            {
                this.diceSecond = buf.getInt();
            }

            if (this.hasDiceFirst())
            {
                this.diceFirst = buf.getInt();
            }

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

            if (this.hasPokerTotal())
            {
                this.pokerTotal = buf.getInt();
            }

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

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

            if (this.hasPokerAmount())
            {
                this.pokerAmount = buf.getInt();
            }

            if (this.hasBeginTime())
            {
                this.beginTime = buf.getLong();
            }

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

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

            if (this.hasDiceFirstA())
            {
                this.diceFirstA = buf.getInt();
            }

            if (this.hasDiceFirstB())
            {
                this.diceFirstB = buf.getInt();
            }

            if (this.hasDiceSecondA())
            {
                this.diceSecondA = buf.getInt();
            }

            if (this.hasDiceSecondB())
            {
                this.diceSecondB = buf.getInt();
            }

            if (this.hasDismissTime())
            {
                this.dismissTime = buf.getLong();
            }

            if (this.hasDismissMaxTime())
            {
                this.dismissMaxTime = buf.getLong();
            }
        }