Update to Netty CR3 but include workaround for (bug?) present in it. Feedback is welcome, #448 is related.

This commit is contained in:
md_5 2013-06-23 10:40:27 +10:00
parent 13f1fa7443
commit 9a173968f1
3 changed files with 20 additions and 13 deletions

View File

@ -59,7 +59,7 @@
<properties> <properties>
<build.number>unknown</build.number> <build.number>unknown</build.number>
<netty.version>4.0.0.CR1</netty.version> <netty.version>4.0.0.CR3</netty.version>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding> <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
</properties> </properties>

View File

@ -251,8 +251,13 @@ public class InitialHandler extends PacketHandler implements PendingConnection
{ {
return; return;
} }
thisState = InitialHandler.State.LOGIN; thisState = InitialHandler.State.LOGIN;
ch.getHandle().eventLoop().execute( new Runnable()
{
@Override
public void run()
{
unsafe().sendPacket( new PacketFCEncryptionResponse( new byte[ 0 ], new byte[ 0 ] ) ); unsafe().sendPacket( new PacketFCEncryptionResponse( new byte[ 0 ], new byte[ 0 ] ) );
try try
{ {
@ -263,6 +268,8 @@ public class InitialHandler extends PacketHandler implements PendingConnection
disconnect( "Cipher error: " + Util.exception( ex ) ); disconnect( "Cipher error: " + Util.exception( ex ) );
} }
} }
} );
}
}; };
// fire login event // fire login event

View File

@ -28,7 +28,7 @@ public class PacketDecoder extends ReplayingDecoder<Void>
private Protocol protocol; private Protocol protocol;
@Override @Override
protected Object decode(ChannelHandlerContext ctx, ByteBuf in) throws Exception protected void decode(ChannelHandlerContext ctx, ByteBuf in, MessageBuf<Object> out) throws Exception
{ {
// While we have enough data // While we have enough data
while ( true ) while ( true )
@ -53,10 +53,10 @@ public class PacketDecoder extends ReplayingDecoder<Void>
// Store our decoded message // Store our decoded message
if ( packet != null ) if ( packet != null )
{ {
return( new PacketWrapper( packet, buf ) ); out.add( new PacketWrapper( packet, buf ) );
} else } else
{ {
return( buf ); out.add( buf );
} }
} }
} }