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.hasPlayer())
            {
                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.player.Add(OP_CLUB_PLAYER.decode(bytes));
                }
            }

            if (this.hasClubId())
            {
                this.clubId = buf.getInt();
            }
        }
Example #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.hasGameId())
            {
                this.gameId = buf.getInt();
            }

            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.hasLoop())
            {
                this.loop = buf.getInt();
            }

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

            if (this.hasPlayer())
            {
                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.player.Add(OP_CLUB_PLAYER.decode(bytes));
                }
            }

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

            if (this.hasClubId())
            {
                this.clubId = buf.getInt();
            }
        }