示例#1
0
        public static OP_CLUB_PLAYER decode(byte[] data)
        {
            OP_CLUB_PLAYER proto = newBuilder();

            proto.build(data);
            return(proto);
        }
示例#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.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();
            }
        }
示例#3
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();
            }
        }
示例#4
0
 public void addPlayer(OP_CLUB_PLAYER value)
 {
     if (!this.hasPlayer())
     {
         this.__flag[0] = (byte)(this.__flag[0] | 1);
     }
     this.player.Add(value);
 }