Howdy pardner!

These here forums are read-only. Click here to go to the new forums, where you can actually post and stuff!

Sorry for the inconvenience

-Andrew

I am now in the process of implementing basic CPE onto my server, but I don't even know what I am doing I read the documentation on http://wiki.vg/Classic_Protocol_Extension#ExtInfo_Packet, but the server always halts Classicube's loading, or just crashes MCR... I only have this packet get sent I don't know how to do a handshake... i dont know what a ExtEntry Packet is...

How am i supposed to do the handshake? How do I know if the software permits CPE? How do I know anything?

public static final PacketType CPE_EXTINFO = new PacketType(new Class[]{Byte.TYPE, String.class, Short.TYPE});

I know I may sound like a total noob, but that is because I am Please help me

UnknownShadow200 🔧 Tue Apr 18 at 8:14:34 (2017)

For the client to server Handshake/Player identification packet, the 'unused' byte is set to 0x42.

If the server supports CPE, it will echo back with an ExtInfo packet followed by a bunch of ExtEntry packets for each extension supported. The client then replies with its own ExtInfo packet followed by a bunch of ExtEntry packets.

The server then replies back with a Handshake packet. Some examples:


  • C to S Handshake('hello world', 'mppass', 0x42)
  • S to C ExtInfo('MyAwesomeServer 4.0', 2)
  • S to C ExtEntry('ExtPlayerList', 2)
  • S to C ExtEntry('CustomBlocks', 1)
  • C to S ExtInfo('AClient 0.1', 2)
  • C to S ExtEntry('EnvColors', 1)
  • C to S ExtEntry('CustomBlocks,1)
  • S to C Handshake('Unknown Dev Server', '+hax')

Would mean that the CPE extension 'CustomBlocks' is enabled, since both client and server support it. EnvColors and ExtPlayerList are only supported by one side, so are therefore not enabled for this player's session.


  • C to S Handshake('hello world', 'mppass', 0x42)
  • S to C Handshake('Unknown Dev Server', '+hax')

In this case, the server does not support CPE so no extensions are enabled.


  • C to S Handshake('hello world', 'mppass', 0x00)
  • S to C Handshake('Unknown Dev Server', '+hax')

In this case, the client does not support CPE so ExtInfo is not sent back and no extensions are enabled.

++UnknownShadow200 posted:++

For the client to server Handshake/Player identification packet, the 'unused' byte is set to 0x42.

If the server supports CPE, it will echo back with an ExtInfo packet followed by a bunch of ExtEntry packets for each extension supported. The client then replies with its own ExtInfo packet followed by a bunch of ExtEntry packets.

The server then replies back with a Handshake packet. Some examples:


  • C to S Handshake('hello world', 'mppass', 0x42)
  • S to C ExtInfo('MyAwesomeServer 4.0', 2)
  • S to C ExtEntry('ExtPlayerList', 2)
  • S to C ExtEntry('CustomBlocks', 1)
  • C to S ExtInfo('AClient 0.1', 2)
  • C to S ExtEntry('EnvColors', 1)
  • C to S ExtEntry('CustomBlocks,1)
  • S to C Handshake('Unknown Dev Server', '+hax')

Would mean that the CPE extension 'CustomBlocks' is enabled, since both client and server support it. EnvColors and ExtPlayerList are only supported by one side, so are therefore not enabled for this player's session.


  • C to S Handshake('hello world', 'mppass', 0x42)
  • S to C Handshake('Unknown Dev Server', '+hax')

In this case, the server does not support CPE so no extensions are enabled.


  • C to S Handshake('hello world', 'mppass', 0x00)
  • S to C Handshake('Unknown Dev Server', '+hax')

In this case, the client does not support CPE so ExtInfo is not sent back and no extensions are enabled.

Most of this worked, but sending back the EXTENTRY packet with "CustomBlocks" did not enable custom blocks from the classicalsharp client... am i doing something wrong? I probably am, I'm not really sure what to do... Server name works though

        if(cp.trim().equalsIgnoreCase("66")){
            this.CPE = true;
            }
        if(this.CPE){
        this.networkHandler.send(PacketType.CPE_EXTINFO, new Object[]{Integer.valueOf(16), "MCR CPE Test", Short.valueOf((short) 1)});
            this.networkHandler.send(PacketType.CPE_EXTENTRY, new Object[]{Integer.valueOf(17), "CustomBlocks", 1});}
        }
UnknownShadow200 🔧 Tue Apr 18 at 21:29:25 (2017)

++andreja6 posted:++

Most of this worked, but sending back the EXTENTRY packet with "CustomBlocks" did not enable custom blocks from the classicalsharp client... am i doing something wrong? I probably am, I'm not really sure what to do... Server name works though

        if(cp.trim().equalsIgnoreCase("66")){
         this.CPE = true;
             }
        if(this.CPE){
        this.networkHandler.send(PacketType.CPE_EXTINFO, new Object[]{Integer.valueOf(16), "MCR CPE Test", Short.valueOf((short) 1)});
             this.networkHandler.send(PacketType.CPE_EXTENTRY, new Object[]{Integer.valueOf(17), "CustomBlocks", 1});}
        }

Well, I'm not sure how that send function works, but some things:

  • Why do you specify PacketType.CPE_EXTENTRY and an Integer.valueOf(17), since isn't 17 the opcode? And wouldn't it be a byte anyways?

  • You use Integer.valueOf(17) for one integer constant, but then provide a raw 1 for another constant, not sure if that matters though.

  • Have you checked the packet writer supports 32 bit integers? They've not been used in the protocol before.

++UnknownShadow200 posted:++

Well, I'm not sure how that send function works, but some things:

  • Why do you specify PacketType.CPE_EXTENTRY and an Integer.valueOf(17), since isn't 17 the opcode? And wouldn't it be a byte anyways?

  • You use Integer.valueOf(17) for one integer constant, but then provide a raw 1 for another constant, not sure if that matters though.

  • Have you checked the packet writer supports 32 bit integers? They've not been used in the protocol before.

*Why do you specify PacketType.CPE_EXTENTRY and an Integer.valueOf(17), since isn't 17 the opcode? And wouldn't it be a byte anyways? -The PacketType does not actually matter, all it does is the size of the class, you have to specify practically the entire packet

*You use Integer.valueOf(17) for one integer constant, but then provide a raw 1 for another constant, not sure if that matters though. -I'm not sure, so I removed it anyways

*Have you checked the packet writer supports 32 bit integers? They've not been used in the protocol before. The packets were always integers on the server. IDK about CPE

AndrewPH time for dominate Wed Apr 19 at 20:06:42 (2017)

CPE uses the same packet types as the rest of the protocol.

++AndrewPH posted:++

CPE uses the same packet types as the rest of the protocol.

I figured it out a while back and not on my server just for ease of use

🛑 This thread has been set to read-only due to inactivity. 🛑