Exemple #1
0
        public static OP_POKER_SETTLE decode(byte[] data)
        {
            OP_POKER_SETTLE proto = newBuilder();

            proto.build(data);
            return(proto);
        }
Exemple #2
0
 public void addScores(OP_POKER_SETTLE value)
 {
     if (!this.hasScores())
     {
         this.__flag[1] = (byte)(this.__flag[1] | 1);
     }
     this.scores.Add(value);
 }
Exemple #3
0
 public void addIncomes(OP_POKER_SETTLE value)
 {
     if (!this.hasIncomes())
     {
         this.__flag[1] = (byte)(this.__flag[1] | 2);
     }
     this.incomes.Add(value);
 }
Exemple #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.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();
            }
        }