Exemple #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.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.hasCountdown())
            {
                this.countdown = buf.getLong();
            }
        }
Exemple #2
0
        public static OP_POKER_GROUP decode(byte[] data)
        {
            OP_POKER_GROUP proto = newBuilder();

            proto.build(data);
            return(proto);
        }
Exemple #3
0
 public void addAskPokerGroup(OP_POKER_GROUP value)
 {
     if (!this.hasAskPokerGroup())
     {
         this.__flag[0] = (byte)(this.__flag[0] | 1);
     }
     this.askPokerGroup.Add(value);
 }
Exemple #4
0
 public void addDingPokerGroup(OP_POKER_GROUP value)
 {
     if (!this.hasDingPokerGroup())
     {
         this.__flag[4] = (byte)(this.__flag[4] | 8);
     }
     this.dingPokerGroup.Add(value);
 }
Exemple #5
0
 public void addKeepPokerGroup(OP_POKER_GROUP value)
 {
     if (!this.hasKeepPokerGroup())
     {
         this.__flag[3] = (byte)(this.__flag[3] | 16);
     }
     this.keepPokerGroup.Add(value);
 }
Exemple #6
0
 public void addUsePokerGroup(OP_POKER_GROUP value)
 {
     if (!this.hasUsePokerGroup())
     {
         this.__flag[1] = (byte)(this.__flag[1] | 4);
     }
     this.usePokerGroup.Add(value);
 }
Exemple #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.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();
            }
        }
Exemple #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.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();
            }
        }