Fix disconnects during LoginEvent when using online mode clients

This commit is contained in:
md_5 2013-11-03 17:04:59 +11:00
parent 04b52aa4f4
commit 155e274e72

View File

@ -274,9 +274,9 @@ public class InitialHandler extends PacketHandler implements PendingConnection
sharedKey = EncryptionUtil.getSecret( encryptResponse, request );
Cipher decrypt = EncryptionUtil.getCipher( Cipher.DECRYPT_MODE, sharedKey );
ch.addBefore( PipelineUtils.FRAME_DECODER, PipelineUtils.DECRYPT_HANDLER, new CipherDecoder( decrypt ) );
Cipher encrypt = EncryptionUtil.getCipher( Cipher.ENCRYPT_MODE, sharedKey );
ch.addBefore( PipelineUtils.FRAME_PREPENDER, PipelineUtils.ENCRYPT_HANDLER, new CipherEncoder( encrypt ) );
if ( this.onlineMode )
{
String encName = URLEncoder.encode( InitialHandler.this.getName(), "UTF-8" );
MessageDigest sha = MessageDigest.getInstance( "SHA-1" );
@ -289,7 +289,7 @@ public class InitialHandler extends PacketHandler implements PendingConnection
}
String encodedHash = URLEncoder.encode( new BigInteger( sha.digest() ).toString( 16 ), "UTF-8" );
String authURL = "https://sessionserver.mojang.com/session/minecraft/hasJoined?username=" + encName + "&serverId=" + encodedHash;
String authURL = "https://sessionserver.mojang.com/session/minecraft/hasJoined?usernamea=" + encName + "&serverId=" + encodedHash;
Callback<String> handler = new Callback<String>()
{
@ -315,10 +315,6 @@ public class InitialHandler extends PacketHandler implements PendingConnection
};
HttpClient.get( authURL, ch.getHandle().eventLoop(), handler );
} else
{
finish();
}
}
private void finish()