Skip to content

Commit

Permalink
Updated ViaProxy API usage
Browse files Browse the repository at this point in the history
  • Loading branch information
RaphiMC committed Dec 22, 2024
1 parent 74d2b77 commit 9790230
Show file tree
Hide file tree
Showing 5 changed files with 11 additions and 11 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
public class B23R0RustRakNetBedrockProxyConnection extends BedrockProxyConnection {

public B23R0RustRakNetBedrockProxyConnection(final B23R0RustRakNetBedrockProxyConnection bedrockProxyConnection) {
super(bedrockProxyConnection.handlerSupplier, bedrockProxyConnection.channelInitializerSupplier, bedrockProxyConnection.getC2P());
super(bedrockProxyConnection.channelInitializer, bedrockProxyConnection.getC2P());
}

@Override
Expand All @@ -40,7 +40,7 @@ public void initialize(ChannelType channelType, Bootstrap bootstrap) {
.channel(B23R0RustRakNetChannel.class)
.option(ChannelOption.CONNECT_TIMEOUT_MILLIS, ViaProxy.getConfig().getConnectTimeout())
.attr(ProxyConnection.PROXY_CONNECTION_ATTRIBUTE_KEY, this)
.handler(this.channelInitializerSupplier.apply(this.handlerSupplier));
.handler(this.channelInitializer);

this.channelFuture = bootstrap.register().syncUninterruptibly();
} else {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
public class ExtremeheatFbRakNetBedrockProxyConnection extends BedrockProxyConnection {

public ExtremeheatFbRakNetBedrockProxyConnection(final ExtremeheatFbRakNetBedrockProxyConnection bedrockProxyConnection) {
super(bedrockProxyConnection.handlerSupplier, bedrockProxyConnection.channelInitializerSupplier, bedrockProxyConnection.getC2P());
super(bedrockProxyConnection.channelInitializer, bedrockProxyConnection.getC2P());
}

@Override
Expand All @@ -40,7 +40,7 @@ public void initialize(ChannelType channelType, Bootstrap bootstrap) {
.channel(ExtremeheatFbRakNetChannel.class)
.option(ChannelOption.CONNECT_TIMEOUT_MILLIS, ViaProxy.getConfig().getConnectTimeout())
.attr(ProxyConnection.PROXY_CONNECTION_ATTRIBUTE_KEY, this)
.handler(this.channelInitializerSupplier.apply(this.handlerSupplier));
.handler(this.channelInitializer);

this.channelFuture = bootstrap.register().syncUninterruptibly();
} else {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@
public class RelativityMcNettyRakNetBedrockProxyConnection extends BedrockProxyConnection {

public RelativityMcNettyRakNetBedrockProxyConnection(final RelativityMcNettyRakNetBedrockProxyConnection bedrockProxyConnection) {
super(bedrockProxyConnection.handlerSupplier, bedrockProxyConnection.channelInitializerSupplier, bedrockProxyConnection.getC2P());
super(bedrockProxyConnection.channelInitializer, bedrockProxyConnection.getC2P());
}

@Override
Expand All @@ -61,8 +61,8 @@ public void initialize(ChannelType channelType, Bootstrap bootstrap) {
@Override
protected void initChannel(Channel channel) {
final RakNetClientThreadedChannel rakChannel = (RakNetClientThreadedChannel) channel;
rakChannel.config().setprotocolVersions(new int[]{11});
channel.pipeline().addLast(channelInitializerSupplier.apply(handlerSupplier));
rakChannel.config().setprotocolVersions(new int[]{ProtocolConstants.BEDROCK_RAKNET_PROTOCOL_VERSION});
channel.pipeline().addLast(channelInitializer);

channel.pipeline().addBefore(VLPipeline.VIABEDROCK_FRAME_ENCAPSULATION_HANDLER_NAME, "viabedrock-frame-converter", new MessageToMessageCodec<FrameData, RakMessage>() {
@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
public class SanderTvGoRakNetBedrockProxyConnection extends BedrockProxyConnection {

public SanderTvGoRakNetBedrockProxyConnection(final SanderTvGoRakNetBedrockProxyConnection bedrockProxyConnection) {
super(bedrockProxyConnection.handlerSupplier, bedrockProxyConnection.channelInitializerSupplier, bedrockProxyConnection.getC2P());
super(bedrockProxyConnection.channelInitializer, bedrockProxyConnection.getC2P());
}

@Override
Expand All @@ -40,7 +40,7 @@ public void initialize(ChannelType channelType, Bootstrap bootstrap) {
.channel(SanderTvGoRakNetChannel.class)
.option(ChannelOption.CONNECT_TIMEOUT_MILLIS, ViaProxy.getConfig().getConnectTimeout())
.attr(ProxyConnection.PROXY_CONNECTION_ATTRIBUTE_KEY, this)
.handler(this.channelInitializerSupplier.apply(this.handlerSupplier));
.handler(this.channelInitializer);

this.channelFuture = bootstrap.register().syncUninterruptibly();
} else {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
public class WhirvisJRakNetBedrockProxyConnection extends BedrockProxyConnection {

public WhirvisJRakNetBedrockProxyConnection(final WhirvisJRakNetBedrockProxyConnection bedrockProxyConnection) {
super(bedrockProxyConnection.handlerSupplier, bedrockProxyConnection.channelInitializerSupplier, bedrockProxyConnection.getC2P());
super(bedrockProxyConnection.channelInitializer, bedrockProxyConnection.getC2P());
}

@Override
Expand All @@ -40,7 +40,7 @@ public void initialize(ChannelType channelType, Bootstrap bootstrap) {
.channel(WhirvisJRakNetChannel.class)
.option(ChannelOption.CONNECT_TIMEOUT_MILLIS, ViaProxy.getConfig().getConnectTimeout())
.attr(ProxyConnection.PROXY_CONNECTION_ATTRIBUTE_KEY, this)
.handler(this.channelInitializerSupplier.apply(this.handlerSupplier));
.handler(this.channelInitializer);

this.channelFuture = bootstrap.register().syncUninterruptibly();
} else {
Expand Down

0 comments on commit 9790230

Please sign in to comment.