diff --git a/pom.xml b/pom.xml
index e944a4aa..1623896c 100644
--- a/pom.xml
+++ b/pom.xml
@@ -59,7 +59,7 @@
unknown
- 4.0.0.CR5
+ 4.0.0.CR1
UTF-8
diff --git a/proxy/src/main/java/net/md_5/bungee/BungeeCord.java b/proxy/src/main/java/net/md_5/bungee/BungeeCord.java
index 609e6674..bab6868e 100644
--- a/proxy/src/main/java/net/md_5/bungee/BungeeCord.java
+++ b/proxy/src/main/java/net/md_5/bungee/BungeeCord.java
@@ -88,7 +88,7 @@ public class BungeeCord extends ProxyServer
* Thread pools.
*/
public final ScheduledThreadPoolExecutor executors = new BungeeThreadPool( new ThreadFactoryBuilder().setNameFormat( "Bungee Pool Thread #%1$d" ).build() );
- public final MultithreadEventLoopGroup eventLoops = new NioEventLoopGroup( Runtime.getRuntime().availableProcessors(), new ThreadFactoryBuilder().setNameFormat( "Netty IO Thread #%1$d" ).build() );
+ public final MultithreadEventLoopGroup eventLoops = new NioEventLoopGroup( 0, new ThreadFactoryBuilder().setNameFormat( "Netty IO Thread #%1$d" ).build() );
/**
* locations.yml save thread.
*/
diff --git a/proxy/src/main/java/net/md_5/bungee/connection/InitialHandler.java b/proxy/src/main/java/net/md_5/bungee/connection/InitialHandler.java
index 44bc56df..a2d00532 100644
--- a/proxy/src/main/java/net/md_5/bungee/connection/InitialHandler.java
+++ b/proxy/src/main/java/net/md_5/bungee/connection/InitialHandler.java
@@ -37,7 +37,6 @@ import net.md_5.bungee.netty.CipherDecoder;
import net.md_5.bungee.netty.CipherEncoder;
import net.md_5.bungee.netty.PacketDecoder;
import net.md_5.bungee.netty.PacketHandler;
-import net.md_5.bungee.netty.PipelineUtils;
import net.md_5.bungee.protocol.Forge;
import net.md_5.bungee.protocol.packet.DefinedPacket;
import net.md_5.bungee.protocol.packet.Packet1Login;
@@ -175,7 +174,7 @@ public class InitialHandler extends PacketHandler implements PendingConnection
sharedKey = EncryptionUtil.getSecret( encryptResponse, request );
Cipher decrypt = EncryptionUtil.getCipher( Cipher.DECRYPT_MODE, sharedKey );
- ch.getHandle().pipeline().addBefore( PipelineUtils.PACKET_DECODE_HANDLER, PipelineUtils.DECRYPT_HANDLER, new CipherDecoder( decrypt ) );
+ ch.getHandle().pipeline().addBefore( "decoder", "decrypt", new CipherDecoder( decrypt ) );
if ( BungeeCord.getInstance().config.isOnlineMode() )
{
@@ -248,7 +247,7 @@ public class InitialHandler extends PacketHandler implements PendingConnection
try
{
Cipher encrypt = EncryptionUtil.getCipher( Cipher.ENCRYPT_MODE, sharedKey );
- ch.getHandle().pipeline().addBefore( PipelineUtils.DECRYPT_HANDLER, PipelineUtils.ENCRYPT_HANDLER, new CipherEncoder( encrypt ) );
+ ch.getHandle().pipeline().addBefore( "decoder", "encrypt", new CipherEncoder( encrypt ) );
} catch ( GeneralSecurityException ex )
{
disconnect( "Cipher error: " + Util.exception( ex ) );
diff --git a/proxy/src/main/java/net/md_5/bungee/netty/CipherBase.java b/proxy/src/main/java/net/md_5/bungee/netty/CipherBase.java
index e571d1b3..f5999cdc 100644
--- a/proxy/src/main/java/net/md_5/bungee/netty/CipherBase.java
+++ b/proxy/src/main/java/net/md_5/bungee/netty/CipherBase.java
@@ -1,7 +1,6 @@
package net.md_5.bungee.netty;
import io.netty.buffer.ByteBuf;
-import io.netty.channel.ChannelHandlerContext;
import javax.crypto.Cipher;
import javax.crypto.ShortBufferException;
import lombok.AccessLevel;
@@ -52,21 +51,4 @@ public class CipherBase
}
out.writeBytes( heapOut, 0, cipher.update( heapIn, 0, readableBytes, heapOut ) );
}
-
- protected ByteBuf cipher(ChannelHandlerContext ctx, ByteBuf in) throws ShortBufferException
- {
- byte[] heapIn = heapInLocal.get();
- int readableBytes = in.readableBytes();
- if ( heapIn.length < readableBytes )
- {
- heapIn = new byte[ readableBytes ];
- heapInLocal.set( heapIn );
- }
- in.readBytes( heapIn, 0, readableBytes );
-
- ByteBuf out = ctx.alloc().heapBuffer( cipher.getOutputSize( readableBytes ) );
- out.writerIndex( cipher.update( heapIn, 0, readableBytes, out.array(), out.arrayOffset() ) );
-
- return out;
- }
}
diff --git a/proxy/src/main/java/net/md_5/bungee/netty/CipherDecoder.java b/proxy/src/main/java/net/md_5/bungee/netty/CipherDecoder.java
index 37b629a1..cc4055b3 100644
--- a/proxy/src/main/java/net/md_5/bungee/netty/CipherDecoder.java
+++ b/proxy/src/main/java/net/md_5/bungee/netty/CipherDecoder.java
@@ -2,11 +2,10 @@ package net.md_5.bungee.netty;
import io.netty.buffer.ByteBuf;
import io.netty.channel.ChannelHandlerContext;
-import io.netty.channel.MessageList;
-import io.netty.handler.codec.ByteToMessageDecoder;
+import io.netty.handler.codec.ByteToByteDecoder;
import javax.crypto.Cipher;
-public class CipherDecoder extends ByteToMessageDecoder
+public class CipherDecoder extends ByteToByteDecoder
{
private final CipherBase cipher;
@@ -17,8 +16,8 @@ public class CipherDecoder extends ByteToMessageDecoder
}
@Override
- protected void decode(ChannelHandlerContext ctx, ByteBuf in, MessageList