Пример #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.hasTimes())
            {
                this.times = buf.getInt();
            }

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

            if (this.hasCfgId())
            {
                this.cfgId = buf.getInt();
            }

            if (this.hasPoker())
            {
                byte[] bytes = new byte[buf.getInt()];
                buf.get(ref bytes, 0, bytes.Length);
                this.poker = OP_POKER.decode(bytes);
            }
        }
Пример #2
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.hasPoker())
            {
                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.poker.Add(OP_POKER.decode(bytes));
                }
            }
        }
Пример #3
0
        public static OP_POKER decode(byte[] data)
        {
            OP_POKER proto = newBuilder();

            proto.build(data);
            return(proto);
        }
Пример #4
0
 public void addProbPoker(OP_POKER value)
 {
     if (!this.hasProbPoker())
     {
         this.__flag[0] = (byte)(this.__flag[0] | 2);
     }
     this.probPoker.Add(value);
 }
Пример #5
0
 public void addSwap(OP_POKER value)
 {
     if (!this.hasSwap())
     {
         this.__flag[4] = (byte)(this.__flag[4] | 128);
     }
     this.swap.Add(value);
 }
Пример #6
0
 public void addPoker(OP_POKER value)
 {
     if (!this.hasPoker())
     {
         this.__flag[3] = (byte)(this.__flag[3] | 1);
     }
     this.poker.Add(value);
 }
Пример #7
0
 public void addDesktop(OP_POKER value)
 {
     if (!this.hasDesktop())
     {
         this.__flag[2] = (byte)(this.__flag[2] | 128);
     }
     this.desktop.Add(value);
 }
Пример #8
0
 public void addUniversal(OP_POKER value)
 {
     if (!this.hasUniversal())
     {
         this.__flag[0] = (byte)(this.__flag[0] | 64);
     }
     this.universal.Add(value);
 }
Пример #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.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;
                }
            }
        }
Пример #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.hasSubTypeId())
            {
                this.subTypeId = (ENUM_POKER_SUBTYPE)buf.get();
            }

            if (this.hasTypeId())
            {
                this.typeId = (ENUM_POKER_TYPE)buf.get();
            }

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

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

            if (this.hasCountdown())
            {
                this.countdown = buf.getLong();
            }
        }
Пример #11
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();
            }
        }
Пример #12
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.hasIsDismiss())
            {
                if (buf.get() == 1)
                {
                    this.isDismiss = true;
                }
                else
                {
                    this.isDismiss = false;
                }
            }

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

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

            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.hasNickname())
            {
                byte[] bytes = new byte[buf.getShort()];
                buf.get(ref bytes, 0, bytes.Length);
                this.nickname = System.Text.Encoding.UTF8.GetString(bytes);
            }

            if (this.hasCountdown())
            {
                this.countdown = buf.getLong();
            }

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

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

            if (this.hasScores())
            {
                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.scores.Add(OP_POKER_SETTLE.decode(bytes));
                }
            }

            if (this.hasIncomes())
            {
                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.incomes.Add(OP_POKER_SETTLE.decode(bytes));
                }
            }

            if (this.hasUsePokerGroup())
            {
                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.usePokerGroup.Add(OP_POKER_GROUP.decode(bytes));
                }
            }

            if (this.hasProbMulti())
            {
                this.probMulti = buf.getInt();
            }

            if (this.hasSettle())
            {
                this.settle = buf.getInt();
            }

            if (this.hasIsWaiver())
            {
                if (buf.get() == 1)
                {
                    this.isWaiver = true;
                }
                else
                {
                    this.isWaiver = false;
                }
            }

            if (this.hasIsWiner())
            {
                if (buf.get() == 1)
                {
                    this.isWiner = true;
                }
                else
                {
                    this.isWiner = false;
                }
            }

            if (this.hasIsLoser())
            {
                if (buf.get() == 1)
                {
                    this.isLoser = true;
                }
                else
                {
                    this.isLoser = false;
                }
            }

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

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

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

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

            if (this.hasHandCount())
            {
                this.handCount = buf.getInt();
            }

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

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

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

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

            if (this.hasIsTrustee())
            {
                if (buf.get() == 1)
                {
                    this.isTrustee = true;
                }
                else
                {
                    this.isTrustee = false;
                }
            }

            if (this.hasIsListen())
            {
                if (buf.get() == 1)
                {
                    this.isListen = true;
                }
                else
                {
                    this.isListen = false;
                }
            }

            if (this.hasHuScore())
            {
                this.huScore = buf.getInt();
            }

            if (this.hasKeepPokerGroup())
            {
                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.keepPokerGroup.Add(OP_POKER_GROUP.decode(bytes));
                }
            }

            if (this.hasIsLockListen())
            {
                if (buf.get() == 1)
                {
                    this.isLockListen = true;
                }
                else
                {
                    this.isLockListen = false;
                }
            }

            if (this.hasWind())
            {
                this.wind = buf.getInt();
            }

            if (this.hasLongitude())
            {
                this.longitude = buf.getFloat();
            }

            if (this.hasLatitude())
            {
                this.latitude = buf.getFloat();
            }

            if (this.hasOnline())
            {
                this.online = buf.getLong();
            }

            if (this.hasIsAfk())
            {
                if (buf.get() == 1)
                {
                    this.isAfk = true;
                }
                else
                {
                    this.isAfk = false;
                }
            }

            if (this.hasDingPokerGroup())
            {
                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.dingPokerGroup.Add(OP_POKER_GROUP.decode(bytes));
                }
            }

            if (this.hasIsDouble())
            {
                if (buf.get() == 1)
                {
                    this.isDouble = true;
                }
                else
                {
                    this.isDouble = false;
                }
            }

            if (this.hasDismiss())
            {
                this.dismiss = (ENUM_DISMISS_STATUS)buf.get();
            }

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

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

            if (this.hasLackColor())
            {
                this.lackColor = buf.getInt();
            }
        }