diff --git a/README.md b/README.md index 509ff14..1b46b53 100644 --- a/README.md +++ b/README.md @@ -17,7 +17,7 @@ For a full user guide go to the [Usage for Players](#usage-for-players-gui) sect ## Supported Client versions - Release (1.7.2 - 1.19.4) - Classic, Alpha, Beta, Release 1.0 - 1.6.4 (Only passthrough) -- Eaglercraft 1.8 +- Eaglercraft (1.5.2 / 1.8) ViaProxy supports joining to any of the listed server version from any of the listed client versions. diff --git a/src/main/java/net/raphimc/viaproxy/proxy/client2proxy/eaglercraft/EaglercraftHandler.java b/src/main/java/net/raphimc/viaproxy/proxy/client2proxy/eaglercraft/EaglercraftHandler.java index 10f839a..8a1a0e8 100644 --- a/src/main/java/net/raphimc/viaproxy/proxy/client2proxy/eaglercraft/EaglercraftHandler.java +++ b/src/main/java/net/raphimc/viaproxy/proxy/client2proxy/eaglercraft/EaglercraftHandler.java @@ -29,7 +29,11 @@ import net.raphimc.netminecraft.constants.ConnectionState; import net.raphimc.netminecraft.constants.MCPackets; import net.raphimc.netminecraft.constants.MCPipeline; import net.raphimc.netminecraft.packet.PacketTypes; +import net.raphimc.vialegacy.protocols.release.protocol1_6_1to1_5_2.ServerboundPackets1_5_2; +import net.raphimc.vialegacy.protocols.release.protocol1_7_2_5to1_6_4.types.Types1_6_4; +import net.raphimc.viaprotocolhack.util.VersionEnum; import net.raphimc.viaproxy.ViaProxy; +import net.raphimc.viaproxy.proxy.client2proxy.Client2ProxyChannelInitializer; import net.raphimc.viaproxy.util.logging.Logger; import java.nio.charset.StandardCharsets; @@ -53,7 +57,8 @@ public class EaglercraftHandler extends MessageToMessageCodec out) { + protected void decode(ChannelHandlerContext ctx, WebSocketFrame in, List out) throws Exception { if (in instanceof BinaryWebSocketFrame) { final ByteBuf data = in.content(); @@ -81,7 +86,11 @@ public class EaglercraftHandler extends MessageToMessageCodec= 2) { // Check for legacy client if (data.getByte(0) == (byte) 2 && data.getByte(1) == (byte) 69) { - throw new IllegalStateException("Your client is not yet supported"); + data.setByte(1, 61); // 1.5.2 protocol id + this.state = State.LOGIN_COMPLETE; + this.version = VersionEnum.r1_5_2; + out.add(data.retain()); + break; } } this.state = State.HANDSHAKE; @@ -132,11 +141,16 @@ public class EaglercraftHandler extends MessageToMessageCodec