use of com.viaversion.fabric.common.handler.FabricEncodeHandler in project ViaFabric by ViaVersion.
the class MixinClientConnectionChInit method onInitChannel.
@Inject(method = "initChannel", at = @At(value = "TAIL"), remap = false)
private void onInitChannel(Channel channel, CallbackInfo ci) {
if (channel instanceof SocketChannel) {
UserConnection user = new UserConnectionImpl(channel, true);
new ProtocolPipelineImpl(user).add(HostnameParserProtocol.INSTANCE);
channel.pipeline().addBefore("encoder", CommonTransformer.HANDLER_ENCODER_NAME, new FabricEncodeHandler(user)).addBefore("decoder", CommonTransformer.HANDLER_DECODER_NAME, new FabricDecodeHandler(user));
}
}
use of com.viaversion.fabric.common.handler.FabricEncodeHandler in project ViaFabric by ViaVersion.
the class MixinServerNetworkIoChInit method onInitChannel.
@Inject(method = "initChannel", at = @At(value = "TAIL"), remap = false)
private void onInitChannel(Channel channel, CallbackInfo ci) {
if (channel instanceof SocketChannel) {
UserConnection user = new UserConnectionImpl(channel);
new ProtocolPipelineImpl(user);
channel.pipeline().addBefore("encoder", CommonTransformer.HANDLER_ENCODER_NAME, new FabricEncodeHandler(user));
channel.pipeline().addBefore("decoder", CommonTransformer.HANDLER_DECODER_NAME, new FabricDecodeHandler(user));
}
}
use of com.viaversion.fabric.common.handler.FabricEncodeHandler in project ViaFabric by ViaVersion.
the class MixinClientConnectionChInit method onInitChannel.
@Inject(method = "initChannel", at = @At(value = "TAIL"), remap = false)
private void onInitChannel(Channel channel, CallbackInfo ci) {
if (channel instanceof SocketChannel) {
UserConnection user = new UserConnectionImpl(channel, true);
new ProtocolPipelineImpl(user).add(HostnameParserProtocol.INSTANCE);
channel.pipeline().addBefore("encoder", CommonTransformer.HANDLER_ENCODER_NAME, new FabricEncodeHandler(user)).addBefore("decoder", CommonTransformer.HANDLER_DECODER_NAME, new FabricDecodeHandler(user));
}
}
use of com.viaversion.fabric.common.handler.FabricEncodeHandler in project ViaFabric by ViaVersion.
the class MixinClientConnectionChInit method onInitChannel.
@Inject(method = "initChannel", at = @At(value = "TAIL"), remap = false)
private void onInitChannel(Channel channel, CallbackInfo ci) {
if (channel instanceof SocketChannel) {
UserConnection user = new UserConnectionImpl(channel, true);
new ProtocolPipelineImpl(user).add(HostnameParserProtocol.INSTANCE);
channel.pipeline().addBefore("encoder", CommonTransformer.HANDLER_ENCODER_NAME, new FabricEncodeHandler(user)).addBefore("decoder", CommonTransformer.HANDLER_DECODER_NAME, new FabricDecodeHandler(user));
}
}
Aggregations