public static PAIGOW_MAHJONG decode(byte[] data)
        {
            PAIGOW_MAHJONG proto = newBuilder();

            proto.build(data);
            return(proto);
        }
Exemple #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.hasPaigowMahjong())
            {
                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.paigow_mahjong.Add(PAIGOW_MAHJONG.decode(bytes));
                }
            }

            if (this.hasPos())
            {
                this.pos = buf.getInt();
            }
        }
Exemple #3
0
 public void addMahjongs_remain(PAIGOW_MAHJONG value)
 {
     if (!this.hasMahjongs_remain())
     {
         this.__flag[0] = (byte)(this.__flag[0] | 128);
     }
     this.mahjongs_remain.Add(value);
 }
Exemple #4
0
 public void addHistoryPoker(PAIGOW_MAHJONG value)
 {
     if (!this.hasHistoryPoker())
     {
         this.__flag[1] = (byte)(this.__flag[1] | 128);
     }
     this.historyPoker.Add(value);
 }
Exemple #5
0
 public void addPaigowMahjong(PAIGOW_MAHJONG value)
 {
     if (!this.hasPaigowMahjong())
     {
         this.__flag[0] = (byte)(this.__flag[0] | 64);
     }
     this.paigow_mahjong.Add(value);
 }
Exemple #6
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.hasUnixtime())
            {
                this.unixtime = buf.getLong();
            }

            if (this.hasPaigowSeat())
            {
                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.paigow_seat.Add(PAIGOW_SEAT.decode(bytes));
                }
            }

            if (this.hasIsOwner())
            {
                if (buf.get() == 1)
                {
                    this.isOwner = true;
                }
                else
                {
                    this.isOwner = false;
                }
            }

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

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

            if (this.hasRemainMahjong())
            {
                this.remainMahjong = buf.getInt();
            }

            if (this.hasFirstGivePos())
            {
                this.firstGivePos = buf.getInt();
            }

            if (this.hasMahjongs_remain())
            {
                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.mahjongs_remain.Add(PAIGOW_MAHJONG.decode(bytes));
                }
            }
        }
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.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.hasIsBanker())
            {
                if (buf.get() == 1)
                {
                    this.isBanker = true;
                }
                else
                {
                    this.isBanker = false;
                }
            }

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

            if (this.hasPaigowMahjong())
            {
                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.paigow_mahjong.Add(PAIGOW_MAHJONG.decode(bytes));
                }
            }

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

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

            if (this.hasEarnings())
            {
                this.earnings = buf.getInt();
            }

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

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

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

            if (this.hasSeatStatus())
            {
                this.seat_status = (SEAT_STATUS)buf.get();
            }

            if (this.hasIsDismiss())
            {
                if (buf.get() == 1)
                {
                    this.isDismiss = true;
                }
                else
                {
                    this.isDismiss = false;
                }
            }

            if (this.hasHistoryPoker())
            {
                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.historyPoker.Add(PAIGOW_MAHJONG.decode(bytes));
                }
            }

            if (this.hasIsGrabBanker())
            {
                this.isGrabBanker = buf.getInt();
            }

            if (this.hasIsCutPoker())
            {
                this.isCutPoker = buf.getInt();
            }

            if (this.hasIsCutPan())
            {
                this.isCutPan = buf.getInt();
            }
        }
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.hasSettingId())
            {
                int size = buf.getShort();
                for (int i = 0; i < size; i++)
                {
                    this.settingId.Add(buf.getInt());
                }
            }

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

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

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

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

            if (this.hasPaigowSeat())
            {
                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.paigow_seat.Add(PAIGOW_SEAT.decode(bytes));
                }
            }

            if (this.hasRoomStatus())
            {
                this.room_status = (ROOM_STATUS)buf.get();
            }

            if (this.hasRoomModel())
            {
                this.room_model = (ROOM_MODEL)buf.get();
            }

            if (this.hasRemainMahjong())
            {
                this.remainMahjong = buf.getInt();
            }

            if (this.hasLoopEnd())
            {
                if (buf.get() == 1)
                {
                    this.loopEnd = true;
                }
                else
                {
                    this.loopEnd = false;
                }
            }

            if (this.hasChooseBankerPos())
            {
                this.chooseBankerPos = buf.getInt();
            }

            if (this.hasMahJongSum())
            {
                this.mahJongSum = buf.getInt();
            }

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

            if (this.hasDealTime())
            {
                this.dealTime = buf.getInt();
            }

            if (this.hasIsCutPan())
            {
                if (buf.get() == 1)
                {
                    this.isCutPan = true;
                }
                else
                {
                    this.isCutPan = false;
                }
            }

            if (this.hasIsBombPan())
            {
                if (buf.get() == 1)
                {
                    this.isBombPan = true;
                }
                else
                {
                    this.isBombPan = false;
                }
            }

            if (this.hasMahjongs_remain())
            {
                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.mahjongs_remain.Add(PAIGOW_MAHJONG.decode(bytes));
                }
            }
        }