Thread: [525] Opcode 6?

Results 1 to 5 of 5
  1. #1 [525] Opcode 6? 
    Java Developer

    Anezka's Avatar
    Join Date
    Aug 2013
    Age
    30
    Posts
    373
    Thanks given
    96
    Thanks received
    95
    Rep Power
    174
    I'm not sure if I'm doing something wrong but after I decode the revision and encode the response the client sends me the operation code 6 with a length of 7

    Log
    Code:
    [main] INFO com.openlinx.game.net.NetworkService - Initializing network service...
    [multithreadEventLoopGroup-1-2] INFO com.openlinx.net.proto.codec.ProtocolFrameDecoder - Decoding Packet
    [multithreadEventLoopGroup-1-2] INFO com.openlinx.net.proto.codec.ProtocolFrameDecoder - Decoding Packet: Opcode - 15
    [multithreadEventLoopGroup-1-2] INFO com.openlinx.net.proto.codec.ProtocolFrameDecoder - DEBUG: opcode - 15 readable - 4
    [multithreadEventLoopGroup-1-2] INFO com.openlinx.net.proto.codec.ProtocolFrameDecoder - Decoding Packet: Opcode - 15 length - 4
    [multithreadEventLoopGroup-1-2] INFO com.openlinx.net.proto.codec.Js5.Js5ServiceProtocolFrameCodec - Decoded: opcode - 15 revision - 525
    [multithreadEventLoopGroup-1-2] INFO com.openlinx.net.proto.codec.ProtocolFrameDecoder - Decoding Packet: Opcode - 15 length - 4 payload - 0
    [multithreadEventLoopGroup-1-2] INFO com.openlinx.net.proto.codec.Js5.Js5ServiceProtocolFrameCodec - Encoding: response - 0
    [multithreadEventLoopGroup-1-2] INFO com.openlinx.net.proto.codec.ProtocolFrameDecoder - Decoding Packet
    [multithreadEventLoopGroup-1-2] INFO com.openlinx.net.proto.codec.ProtocolFrameDecoder - Decoding Packet: Opcode - 6
    [multithreadEventLoopGroup-1-2] INFO com.openlinx.net.proto.codec.ProtocolFrameDecoder - DEBUG: opcode - 6 readable - 7
    Code:
        @Override
        protected void decode(ChannelHandlerContext context, Buffer input) {
            logger.info("Decoding Packet");
    
            if (input.readableBytes() == 0) return;
    
            var opcode = (input.readUnsignedByte() - cipher.nextInt()) & 0xFF;
            var codec = publisher.codecOf(opcode);
    
            logger.info("Decoding Packet: Opcode - {}", opcode);
    
            debugIncoming(input, opcode);
    
            if (input.readableBytes() == 0) return;
    
            var length = codec.protocolFrame().length();
    
            logger.info("Decoding Packet: Opcode - {} length - {}", opcode, length);
    
            if (input.readableBytes() < length) return;
    
            var payload = input.readSplit(length);
            codec.decode(payload);
            logger.info("Decoding Packet: Opcode - {} length - {} payload - {}", opcode, length, input.readableBytes());
    
            context.fireChannelRead(codec.protocolFrame());
        }
    
        private void debugIncoming(Buffer input, int opcode) {
            logger.info("DEBUG: opcode - {} readable - {}", opcode, input.readableBytes());
        }
    Code:
        @Override
        public Buffer encode(BufferAllocator allocator) {
            logger.info("Encoding: response - {}", (revision == 525 ? 0 : 6));
            return allocator.allocate(1).writeByte((byte) (revision == 525 ? 0 : 6));
        }
    
        @Override
        public void decode(Buffer payload) {
            revision = payload.readInt();
            logger.info("Decoded: opcode - {} revision - {}", protocolFrame().opcode(), revision);
        }
    Reply With Quote  
     

  2. #2  
    Contributor

    clem585's Avatar
    Join Date
    Sep 2013
    Posts
    3,788
    Thanks given
    706
    Thanks received
    702
    Rep Power
    570
    What are you trying to do? I see opcode 15 so I'm assuming you're trying to handle login?
    Project thread
    Reply With Quote  
     

  3. #3  
    Java Developer

    Anezka's Avatar
    Join Date
    Aug 2013
    Age
    30
    Posts
    373
    Thanks given
    96
    Thanks received
    95
    Rep Power
    174
    Quote Originally Posted by clem585 View Post
    What are you trying to do? I see opcode 15 so I'm assuming you're trying to handle login?
    Im trying to get the first js5 request
    Reply With Quote  
     

  4. #4  
    Contributor

    clem585's Avatar
    Join Date
    Sep 2013
    Posts
    3,788
    Thanks given
    706
    Thanks received
    702
    Rep Power
    570
    Quote Originally Posted by Anezka View Post
    Im trying to get the first js5 request
    I'm assuming you're writing your own server from scratch since you did not specify a base. After receiving the 1st JS5 service packet, you need to write this answer to the client:

    Code:
        override fun encode(): OutputStream {
            val stream = OutputStream(1 + Cache.get().serverKeys.size * 4)
            stream.writeByte(0)
            for (key in Cache.get().serverKeys) {
                stream.writeInt(key)
            }
            return stream
        }
    Byte 0 followed by the length of some of the archives in the cache. This might be different for 525 (there's rarely threads for that revision nowadays), but it's the expected response for 6XX+

    Have you tried doing that? You seem to only be sending byte 0:

    Code:
        @Override
        public Buffer encode(BufferAllocator allocator) {
            logger.info("Encoding: response - {}", (revision == 525 ? 0 : 6));
            return allocator.allocate(1).writeByte((byte) (revision == 525 ? 0 : 6));
        }
    Project thread
    Reply With Quote  
     

  5. Thankful user:


  6. #5  
    Java Developer

    Anezka's Avatar
    Join Date
    Aug 2013
    Age
    30
    Posts
    373
    Thanks given
    96
    Thanks received
    95
    Rep Power
    174
    Quote Originally Posted by clem585 View Post
    I'm assuming you're writing your own server from scratch since you did not specify a base. After receiving the 1st JS5 service packet, you need to write this answer to the client:

    Code:
        override fun encode(): OutputStream {
            val stream = OutputStream(1 + Cache.get().serverKeys.size * 4)
            stream.writeByte(0)
            for (key in Cache.get().serverKeys) {
                stream.writeInt(key)
            }
            return stream
        }
    Byte 0 followed by the length of some of the archives in the cache. This might be different for 525 (there's rarely threads for that revision nowadays), but it's the expected response for 6XX+

    Have you tried doing that? You seem to only be sending byte 0:

    Code:
        @Override
        public Buffer encode(BufferAllocator allocator) {
            logger.info("Encoding: response - {}", (revision == 525 ? 0 : 6));
            return allocator.allocate(1).writeByte((byte) (revision == 525 ? 0 : 6));
        }
    Code:
     [multithreadEventLoopGroup-1-8] INFO com.openlinx.net.proto.codec.Js5.Js5ServiceProtocolFrameCodec - Decoded: opcode - 1 archive - 255 group - 255
    I just figured it out Opcode 6 is a connection initialization packet and isnt required so I just skipped and and it returned that packet i was expecting thanks for responding : )
    Reply With Quote  
     


Thread Information
Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)


User Tag List

Similar Threads

  1. [525 Update Server] What does opcode 6 do?
    By Discardedx2 in forum Help
    Replies: 3
    Last Post: 06-08-2010, 01:59 PM
  2. 525 mapdata Deob/also connects to localhost
    By Richard1992 in forum Downloads
    Replies: 39
    Last Post: 01-07-2009, 09:27 PM
  3. [REQ]525 Server![REQ]
    By wc99wc in forum Requests
    Replies: 1
    Last Post: 12-23-2008, 06:43 PM
  4. 525 mapdata dumper
    By Richard1992 in forum Downloads
    Replies: 17
    Last Post: 12-19-2008, 06:11 AM
  5. ChrisScape Client V2 - ReRelease [ 525 DLS + ]
    By ChrisScapeFtww in forum Downloads
    Replies: 25
    Last Post: 07-05-2008, 10:50 PM
Posting Permissions
  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •