Advancing further in the login process.
This commit is contained in:
@@ -179,8 +179,8 @@ public class InitialHandler extends PacketHandler implements PendingConnection
|
||||
|
||||
ch.write( new PacketFCEncryptionResponse() );
|
||||
|
||||
Cipher decrypt = EncryptionUtil.getCipher( Cipher.DECRYPT_MODE, shared );
|
||||
Cipher encrypt = EncryptionUtil.getCipher( Cipher.ENCRYPT_MODE, shared );
|
||||
Cipher decrypt = EncryptionUtil.getCipher( Cipher.DECRYPT_MODE, shared );
|
||||
ch.pipeline().addBefore( "decoder", "cipher", new CipherCodec( encrypt, decrypt ) );
|
||||
|
||||
thisState = InitialHandler.State.LOGIN;
|
||||
|
@@ -60,7 +60,7 @@ public class HandlerBoss extends ChannelInboundMessageHandlerAdapter<ByteBuf>
|
||||
@Override
|
||||
public void exceptionCaught(ChannelHandlerContext ctx, Throwable cause) throws Exception
|
||||
{
|
||||
super.exceptionCaught( ctx, cause );
|
||||
cause.printStackTrace();
|
||||
if ( ctx.channel().isActive() )
|
||||
{
|
||||
ctx.close();
|
||||
|
@@ -3,9 +3,11 @@ package net.md_5.bungee.netty;
|
||||
import io.netty.buffer.ByteBuf;
|
||||
import io.netty.channel.ChannelHandlerContext;
|
||||
import io.netty.handler.codec.ReplayingDecoder;
|
||||
import java.io.IOException;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Getter;
|
||||
import lombok.Setter;
|
||||
import net.md_5.bungee.Util;
|
||||
import net.md_5.bungee.protocol.netty.PacketReader;
|
||||
|
||||
/**
|
||||
@@ -28,9 +30,10 @@ public class PacketDecoder extends ReplayingDecoder<ByteBuf>
|
||||
protected ByteBuf decode(ChannelHandlerContext ctx, ByteBuf in) throws Exception
|
||||
{
|
||||
int startIndex = in.readerIndex();
|
||||
|
||||
PacketReader.readPacket( in, protocol );
|
||||
ByteBuf readPacket = in.copy( startIndex, in.readerIndex() - startIndex );
|
||||
System.out.println( readPacket );
|
||||
return readPacket;
|
||||
|
||||
System.out.println( Util.hex( in.getUnsignedByte( 0 ) ) );
|
||||
return in.copy( startIndex, in.readerIndex() - startIndex );
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user