Search in sources :

Example 1 with Lz4FrameEncoder

use of io.netty.handler.codec.compression.Lz4FrameEncoder in project Terasology by MovingBlocks.

the class TerasologyClientPipelineFactory method initChannel.

@Override
protected void initChannel(Channel ch) throws Exception {
    JoinStatusImpl joinStatus = new JoinStatusImpl();
    ChannelPipeline p = ch.pipeline();
    p.addLast(MetricRecordingHandler.NAME, new MetricRecordingHandler());
    p.addLast("inflateDecoder", new Lz4FrameDecoder());
    p.addLast("lengthFrameDecoder", new LengthFieldBasedFrameDecoder(8388608, 0, 3, 0, 3));
    p.addLast("protobufDecoder", new ProtobufDecoder(NetData.NetMessage.getDefaultInstance()));
    p.addLast("deflateEncoder", new Lz4FrameEncoder(true));
    p.addLast("frameLengthEncoder", new LengthFieldPrepender(3));
    p.addLast("protobufEncoder", new ProtobufEncoder());
    p.addLast("authenticationHandler", new ClientHandshakeHandler(joinStatus));
    p.addLast("connectionHandler", new ClientConnectionHandler(joinStatus, networkSystem));
    p.addLast("handler", new ClientHandler(networkSystem));
}
Also used : Lz4FrameEncoder(io.netty.handler.codec.compression.Lz4FrameEncoder) ProtobufEncoder(io.netty.handler.codec.protobuf.ProtobufEncoder) ClientHandshakeHandler(org.terasology.engine.network.internal.ClientHandshakeHandler) MetricRecordingHandler(org.terasology.engine.network.internal.MetricRecordingHandler) ProtobufDecoder(io.netty.handler.codec.protobuf.ProtobufDecoder) ClientHandler(org.terasology.engine.network.internal.ClientHandler) ClientConnectionHandler(org.terasology.engine.network.internal.ClientConnectionHandler) LengthFieldPrepender(io.netty.handler.codec.LengthFieldPrepender) LengthFieldBasedFrameDecoder(io.netty.handler.codec.LengthFieldBasedFrameDecoder) JoinStatusImpl(org.terasology.engine.network.internal.JoinStatusImpl) ChannelPipeline(io.netty.channel.ChannelPipeline) Lz4FrameDecoder(io.netty.handler.codec.compression.Lz4FrameDecoder)

Example 2 with Lz4FrameEncoder

use of io.netty.handler.codec.compression.Lz4FrameEncoder in project Terasology by MovingBlocks.

the class InfoRequestPipelineFactory method initChannel.

@Override
protected void initChannel(Channel ch) throws Exception {
    JoinStatusImpl joinStatus = new JoinStatusImpl();
    ChannelPipeline p = ch.pipeline();
    p.addLast(MetricRecordingHandler.NAME, new MetricRecordingHandler());
    p.addLast("inflateDecoder", new Lz4FrameDecoder());
    p.addLast("lengthFrameDecoder", new LengthFieldBasedFrameDecoder(8388608, 0, 3, 0, 3));
    p.addLast("protobufDecoder", new ProtobufDecoder(NetData.NetMessage.getDefaultInstance()));
    p.addLast("deflateEncoder", new Lz4FrameEncoder(true));
    p.addLast("frameLengthEncoder", new LengthFieldPrepender(3));
    p.addLast("protobufEncoder", new ProtobufEncoder());
    p.addLast("authenticationHandler", new ClientHandshakeHandler(joinStatus));
    p.addLast("connectionHandler", new ServerInfoRequestHandler());
}
Also used : Lz4FrameEncoder(io.netty.handler.codec.compression.Lz4FrameEncoder) ProtobufEncoder(io.netty.handler.codec.protobuf.ProtobufEncoder) ClientHandshakeHandler(org.terasology.engine.network.internal.ClientHandshakeHandler) MetricRecordingHandler(org.terasology.engine.network.internal.MetricRecordingHandler) ProtobufDecoder(io.netty.handler.codec.protobuf.ProtobufDecoder) LengthFieldPrepender(io.netty.handler.codec.LengthFieldPrepender) LengthFieldBasedFrameDecoder(io.netty.handler.codec.LengthFieldBasedFrameDecoder) JoinStatusImpl(org.terasology.engine.network.internal.JoinStatusImpl) ChannelPipeline(io.netty.channel.ChannelPipeline) Lz4FrameDecoder(io.netty.handler.codec.compression.Lz4FrameDecoder) ServerInfoRequestHandler(org.terasology.engine.network.internal.ServerInfoRequestHandler)

Example 3 with Lz4FrameEncoder

use of io.netty.handler.codec.compression.Lz4FrameEncoder in project Terasology by MovingBlocks.

the class TerasologyServerPipelineFactory method initChannel.

@Override
protected void initChannel(Channel ch) throws Exception {
    ChannelPipeline p = ch.pipeline();
    p.addLast(MetricRecordingHandler.NAME, new MetricRecordingHandler());
    p.addLast("inflateDecoder", new Lz4FrameDecoder());
    p.addLast("lengthFrameDecoder", new LengthFieldBasedFrameDecoder(8388608, 0, 3, 0, 3));
    p.addLast("protobufDecoder", new ProtobufDecoder(NetData.NetMessage.getDefaultInstance()));
    p.addLast("deflateEncoder", new Lz4FrameEncoder(true));
    p.addLast("frameLengthEncoder", new LengthFieldPrepender(3));
    p.addLast("protobufEncoder", new ProtobufEncoder());
    p.addLast("authenticationHandler", new ServerHandshakeHandler());
    p.addLast("connectionHandler", new ServerConnectionHandler(networkSystem));
    p.addLast("handler", new ServerHandler(networkSystem));
}
Also used : Lz4FrameEncoder(io.netty.handler.codec.compression.Lz4FrameEncoder) ProtobufEncoder(io.netty.handler.codec.protobuf.ProtobufEncoder) ServerConnectionHandler(org.terasology.engine.network.internal.ServerConnectionHandler) ServerHandshakeHandler(org.terasology.engine.network.internal.ServerHandshakeHandler) MetricRecordingHandler(org.terasology.engine.network.internal.MetricRecordingHandler) ProtobufDecoder(io.netty.handler.codec.protobuf.ProtobufDecoder) ServerHandler(org.terasology.engine.network.internal.ServerHandler) LengthFieldPrepender(io.netty.handler.codec.LengthFieldPrepender) LengthFieldBasedFrameDecoder(io.netty.handler.codec.LengthFieldBasedFrameDecoder) ChannelPipeline(io.netty.channel.ChannelPipeline) Lz4FrameDecoder(io.netty.handler.codec.compression.Lz4FrameDecoder)

Aggregations

ChannelPipeline (io.netty.channel.ChannelPipeline)3 LengthFieldBasedFrameDecoder (io.netty.handler.codec.LengthFieldBasedFrameDecoder)3 LengthFieldPrepender (io.netty.handler.codec.LengthFieldPrepender)3 Lz4FrameDecoder (io.netty.handler.codec.compression.Lz4FrameDecoder)3 Lz4FrameEncoder (io.netty.handler.codec.compression.Lz4FrameEncoder)3 ProtobufDecoder (io.netty.handler.codec.protobuf.ProtobufDecoder)3 ProtobufEncoder (io.netty.handler.codec.protobuf.ProtobufEncoder)3 MetricRecordingHandler (org.terasology.engine.network.internal.MetricRecordingHandler)3 ClientHandshakeHandler (org.terasology.engine.network.internal.ClientHandshakeHandler)2 JoinStatusImpl (org.terasology.engine.network.internal.JoinStatusImpl)2 ClientConnectionHandler (org.terasology.engine.network.internal.ClientConnectionHandler)1 ClientHandler (org.terasology.engine.network.internal.ClientHandler)1 ServerConnectionHandler (org.terasology.engine.network.internal.ServerConnectionHandler)1 ServerHandler (org.terasology.engine.network.internal.ServerHandler)1 ServerHandshakeHandler (org.terasology.engine.network.internal.ServerHandshakeHandler)1 ServerInfoRequestHandler (org.terasology.engine.network.internal.ServerInfoRequestHandler)1