Close #450 - errors from our backport
This commit is contained in:
parent
a6ba661a32
commit
0f7da279ef
@ -88,7 +88,7 @@ public class BungeeCord extends ProxyServer
|
|||||||
* Thread pools.
|
* Thread pools.
|
||||||
*/
|
*/
|
||||||
public final ScheduledThreadPoolExecutor executors = new BungeeThreadPool( new ThreadFactoryBuilder().setNameFormat( "Bungee Pool Thread #%1$d" ).build() );
|
public final ScheduledThreadPoolExecutor executors = new BungeeThreadPool( new ThreadFactoryBuilder().setNameFormat( "Bungee Pool Thread #%1$d" ).build() );
|
||||||
public final MultithreadEventLoopGroup eventLoops = new NioEventLoopGroup( 0, new ThreadFactoryBuilder().setNameFormat( "Netty IO Thread #%1$d" ).build() );
|
public final MultithreadEventLoopGroup eventLoops = new NioEventLoopGroup( Runtime.getRuntime().availableProcessors(), new ThreadFactoryBuilder().setNameFormat( "Netty IO Thread #%1$d" ).build() );
|
||||||
/**
|
/**
|
||||||
* locations.yml save thread.
|
* locations.yml save thread.
|
||||||
*/
|
*/
|
||||||
|
@ -37,6 +37,7 @@ import net.md_5.bungee.netty.CipherDecoder;
|
|||||||
import net.md_5.bungee.netty.CipherEncoder;
|
import net.md_5.bungee.netty.CipherEncoder;
|
||||||
import net.md_5.bungee.netty.PacketDecoder;
|
import net.md_5.bungee.netty.PacketDecoder;
|
||||||
import net.md_5.bungee.netty.PacketHandler;
|
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.Forge;
|
||||||
import net.md_5.bungee.protocol.packet.DefinedPacket;
|
import net.md_5.bungee.protocol.packet.DefinedPacket;
|
||||||
import net.md_5.bungee.protocol.packet.Packet1Login;
|
import net.md_5.bungee.protocol.packet.Packet1Login;
|
||||||
@ -174,7 +175,7 @@ public class InitialHandler extends PacketHandler implements PendingConnection
|
|||||||
|
|
||||||
sharedKey = EncryptionUtil.getSecret( encryptResponse, request );
|
sharedKey = EncryptionUtil.getSecret( encryptResponse, request );
|
||||||
Cipher decrypt = EncryptionUtil.getCipher( Cipher.DECRYPT_MODE, sharedKey );
|
Cipher decrypt = EncryptionUtil.getCipher( Cipher.DECRYPT_MODE, sharedKey );
|
||||||
ch.getHandle().pipeline().addBefore( "decoder", "decrypt", new CipherDecoder( decrypt ) );
|
ch.getHandle().pipeline().addBefore( PipelineUtils.PACKET_DECODE_HANDLER, PipelineUtils.DECRYPT_HANDLER, new CipherDecoder( decrypt ) );
|
||||||
|
|
||||||
if ( BungeeCord.getInstance().config.isOnlineMode() )
|
if ( BungeeCord.getInstance().config.isOnlineMode() )
|
||||||
{
|
{
|
||||||
@ -247,7 +248,7 @@ public class InitialHandler extends PacketHandler implements PendingConnection
|
|||||||
try
|
try
|
||||||
{
|
{
|
||||||
Cipher encrypt = EncryptionUtil.getCipher( Cipher.ENCRYPT_MODE, sharedKey );
|
Cipher encrypt = EncryptionUtil.getCipher( Cipher.ENCRYPT_MODE, sharedKey );
|
||||||
ch.getHandle().pipeline().addBefore( "decoder", "encrypt", new CipherEncoder( encrypt ) );
|
ch.getHandle().pipeline().addBefore( PipelineUtils.DECRYPT_HANDLER, PipelineUtils.ENCRYPT_HANDLER, new CipherEncoder( encrypt ) );
|
||||||
} catch ( GeneralSecurityException ex )
|
} catch ( GeneralSecurityException ex )
|
||||||
{
|
{
|
||||||
disconnect( "Cipher error: " + Util.exception( ex ) );
|
disconnect( "Cipher error: " + Util.exception( ex ) );
|
||||||
|
Loading…
Reference in New Issue
Block a user