Search in sources :

Example 1 with ServerConnectionHandler

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

the class TerasologyServerPipelineFactory method getPipeline.

@Override
public ChannelPipeline getPipeline() throws Exception {
    ChannelPipeline p = pipeline();
    p.addLast(MetricRecordingHandler.NAME, new MetricRecordingHandler());
    p.addLast("frameDecoder", new ProtobufVarint32FrameDecoder());
    p.addLast("protobufDecoder", new ProtobufDecoder(NetData.NetMessage.getDefaultInstance()));
    p.addLast("frameLengthEncoder", new LengthFieldPrepender(3));
    p.addLast("deflateEncoder", new ZlibEncoder());
    p.addLast("frameEncoder", new ProtobufVarint32LengthFieldPrepender());
    p.addLast("protobufEncoder", new ProtobufEncoder());
    p.addLast("authenticationHandler", new ServerHandshakeHandler());
    p.addLast("connectionHandler", new ServerConnectionHandler(networkSystem));
    p.addLast("handler", new ServerHandler(networkSystem));
    return p;
}
Also used : ZlibEncoder(org.jboss.netty.handler.codec.compression.ZlibEncoder) ProtobufEncoder(org.jboss.netty.handler.codec.protobuf.ProtobufEncoder) ServerConnectionHandler(org.terasology.network.internal.ServerConnectionHandler) ServerHandshakeHandler(org.terasology.network.internal.ServerHandshakeHandler) MetricRecordingHandler(org.terasology.network.internal.MetricRecordingHandler) ProtobufDecoder(org.jboss.netty.handler.codec.protobuf.ProtobufDecoder) ProtobufVarint32LengthFieldPrepender(org.jboss.netty.handler.codec.protobuf.ProtobufVarint32LengthFieldPrepender) ServerHandler(org.terasology.network.internal.ServerHandler) ProtobufVarint32LengthFieldPrepender(org.jboss.netty.handler.codec.protobuf.ProtobufVarint32LengthFieldPrepender) LengthFieldPrepender(org.jboss.netty.handler.codec.frame.LengthFieldPrepender) ProtobufVarint32FrameDecoder(org.jboss.netty.handler.codec.protobuf.ProtobufVarint32FrameDecoder) ChannelPipeline(org.jboss.netty.channel.ChannelPipeline)

Aggregations

ChannelPipeline (org.jboss.netty.channel.ChannelPipeline)1 ZlibEncoder (org.jboss.netty.handler.codec.compression.ZlibEncoder)1 LengthFieldPrepender (org.jboss.netty.handler.codec.frame.LengthFieldPrepender)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 MetricRecordingHandler (org.terasology.network.internal.MetricRecordingHandler)1 ServerConnectionHandler (org.terasology.network.internal.ServerConnectionHandler)1 ServerHandler (org.terasology.network.internal.ServerHandler)1 ServerHandshakeHandler (org.terasology.network.internal.ServerHandshakeHandler)1