Search in sources :

Example 1 with ClientConnectionHandler

use of org.terasology.network.internal.ClientConnectionHandler in project Terasology by MovingBlocks.

the class TerasologyClientPipelineFactory method getPipeline.

@Override
public ChannelPipeline getPipeline() throws Exception {
    JoinStatusImpl joinStatus = new JoinStatusImpl();
    ChannelPipeline p = pipeline();
    p.addLast(MetricRecordingHandler.NAME, new MetricRecordingHandler());
    p.addLast("lengthFrameDecoder", new LengthFieldBasedFrameDecoder(8388608, 0, 3, 0, 3));
    p.addLast("inflateDecoder", new ZlibDecoder());
    p.addLast("frameDecoder", new ProtobufVarint32FrameDecoder());
    p.addLast("protobufDecoder", new ProtobufDecoder(NetData.NetMessage.getDefaultInstance()));
    p.addLast("frameEncoder", new ProtobufVarint32LengthFieldPrepender());
    p.addLast("protobufEncoder", new ProtobufEncoder());
    p.addLast("authenticationHandler", new ClientHandshakeHandler(joinStatus));
    p.addLast("connectionHandler", new ClientConnectionHandler(joinStatus, networkSystem));
    p.addLast("handler", new ClientHandler(networkSystem));
    return p;
}
Also used : ProtobufEncoder(org.jboss.netty.handler.codec.protobuf.ProtobufEncoder) ClientHandshakeHandler(org.terasology.network.internal.ClientHandshakeHandler) ZlibDecoder(org.jboss.netty.handler.codec.compression.ZlibDecoder) MetricRecordingHandler(org.terasology.network.internal.MetricRecordingHandler) ProtobufDecoder(org.jboss.netty.handler.codec.protobuf.ProtobufDecoder) ProtobufVarint32LengthFieldPrepender(org.jboss.netty.handler.codec.protobuf.ProtobufVarint32LengthFieldPrepender) ClientHandler(org.terasology.network.internal.ClientHandler) ClientConnectionHandler(org.terasology.network.internal.ClientConnectionHandler) LengthFieldBasedFrameDecoder(org.jboss.netty.handler.codec.frame.LengthFieldBasedFrameDecoder) ProtobufVarint32FrameDecoder(org.jboss.netty.handler.codec.protobuf.ProtobufVarint32FrameDecoder) JoinStatusImpl(org.terasology.network.internal.JoinStatusImpl) ChannelPipeline(org.jboss.netty.channel.ChannelPipeline)

Aggregations

ChannelPipeline (org.jboss.netty.channel.ChannelPipeline)1 ZlibDecoder (org.jboss.netty.handler.codec.compression.ZlibDecoder)1 LengthFieldBasedFrameDecoder (org.jboss.netty.handler.codec.frame.LengthFieldBasedFrameDecoder)1 ProtobufDecoder (org.jboss.netty.handler.codec.protobuf.ProtobufDecoder)1 ProtobufEncoder (org.jboss.netty.handler.codec.protobuf.ProtobufEncoder)1 ProtobufVarint32FrameDecoder (org.jboss.netty.handler.codec.protobuf.ProtobufVarint32FrameDecoder)1 ProtobufVarint32LengthFieldPrepender (org.jboss.netty.handler.codec.protobuf.ProtobufVarint32LengthFieldPrepender)1 ClientConnectionHandler (org.terasology.network.internal.ClientConnectionHandler)1 ClientHandler (org.terasology.network.internal.ClientHandler)1 ClientHandshakeHandler (org.terasology.network.internal.ClientHandshakeHandler)1 JoinStatusImpl (org.terasology.network.internal.JoinStatusImpl)1 MetricRecordingHandler (org.terasology.network.internal.MetricRecordingHandler)1