Package gwlpr.loginshard

Source Code of gwlpr.loginshard.LoginShardChannelInitializer

/**
* For copyright information see the LICENSE document.
*/

package gwlpr.loginshard;

import gwlpr.protocol.NettyGWLoggingHandler.*;
import gwlpr.protocol.handshake.EncryptionOptions;
import gwlpr.protocol.handshake.HandshakeHandler;
import gwlpr.protocol.loginserver.LoginServerCodec;
import io.netty.channel.Channel;
import io.netty.channel.ChannelInitializer;
import io.netty.handler.logging.LoggingHandler;
import realityshard.container.network.ConnectionStateHandler;
import realityshard.container.network.MessageDemuxDecoder;


/**
* Initializes a login shard channel... duh
*
* @author _rusty
*/
public class LoginShardChannelInitializer extends ChannelInitializer<Channel>
{
   
    private final EncryptionOptions encrypted;
   
   
    public LoginShardChannelInitializer(EncryptionOptions encrypted)
    {
        this.encrypted = encrypted;
    }
   
   
    @Override
    protected void initChannel(Channel ch)
    {
        // inbound handlers
        ch.pipeline().addLast(
                //new AutoFlushHandler(),
                new LoggingHandler(),
                new ConnectionStateHandler(),
                HandshakeHandler.produceLoginHandshake(encrypted),
                new LoginServerCodec(),
                new MessageDemuxDecoder());
    }
   
}
TOP

Related Classes of gwlpr.loginshard.LoginShardChannelInitializer

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.