mirror of
https://github.com/ViaVersion/ViaProxy.git
synced 2025-02-16 19:59:58 -05:00
Fixed legacy passthrough
This commit is contained in:
parent
e461ef165e
commit
58b4819677
2 changed files with 8 additions and 4 deletions
|
@ -40,6 +40,7 @@ public class PassthroughClient2ProxyChannelInitializer extends Client2ProxyChann
|
|||
return;
|
||||
}
|
||||
|
||||
channel.pipeline().addLast(MCPipeline.FLOW_CONTROL_HANDLER_NAME, MCPipeline.FLOW_CONTROL_HANDLER.get());
|
||||
channel.pipeline().addLast(MCPipeline.HANDLER_HANDLER_NAME, this.handlerSupplier.get());
|
||||
|
||||
if (PluginManager.EVENT_MANAGER.call(new Client2ProxyChannelInitializeEvent(ITyped.Type.POST, channel, true)).isCancelled()) {
|
||||
|
|
|
@ -38,6 +38,13 @@ public class PassthroughClient2ProxyHandler extends SimpleChannelInboundHandler<
|
|||
|
||||
private LegacyProxyConnection proxyConnection;
|
||||
|
||||
@Override
|
||||
public void channelActive(ChannelHandlerContext ctx) throws Exception {
|
||||
super.channelActive(ctx);
|
||||
|
||||
this.connectToServer(ctx.channel());
|
||||
}
|
||||
|
||||
@Override
|
||||
public void channelInactive(ChannelHandlerContext ctx) throws Exception {
|
||||
super.channelInactive(ctx);
|
||||
|
@ -55,10 +62,6 @@ public class PassthroughClient2ProxyHandler extends SimpleChannelInboundHandler<
|
|||
if (!ctx.channel().isOpen()) return;
|
||||
if (!msg.isReadable()) return;
|
||||
|
||||
if (this.proxyConnection == null) {
|
||||
this.connectToServer(ctx.channel());
|
||||
}
|
||||
|
||||
this.proxyConnection.getChannel().writeAndFlush(msg.retain()).addListener(ChannelFutureListener.FIRE_EXCEPTION_ON_FAILURE);
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue