mirror of
https://github.com/Minestom/Minestom.git
synced 2024-11-07 11:20:09 +01:00
Fixed mojang authentication
This commit is contained in:
parent
48b637cbc8
commit
8330abbc4b
@ -80,9 +80,9 @@ public class NettyPlayerConnection extends PlayerConnection {
|
|||||||
public void setEncryptionKey(@NotNull SecretKey secretKey) {
|
public void setEncryptionKey(@NotNull SecretKey secretKey) {
|
||||||
Check.stateCondition(encrypted, "Encryption is already enabled!");
|
Check.stateCondition(encrypted, "Encryption is already enabled!");
|
||||||
this.encrypted = true;
|
this.encrypted = true;
|
||||||
channel.pipeline().addBefore(NettyServer.FRAMER_HANDLER_NAME, NettyServer.DECRYPT_HANDLER_NAME,
|
channel.pipeline().addBefore(NettyServer.GROUPED_PACKET_HANDLER_NAME, NettyServer.DECRYPT_HANDLER_NAME,
|
||||||
new Decrypter(MojangCrypt.getCipher(2, secretKey)));
|
new Decrypter(MojangCrypt.getCipher(2, secretKey)));
|
||||||
channel.pipeline().addBefore(NettyServer.FRAMER_HANDLER_NAME, NettyServer.ENCRYPT_HANDLER_NAME,
|
channel.pipeline().addBefore(NettyServer.GROUPED_PACKET_HANDLER_NAME, NettyServer.ENCRYPT_HANDLER_NAME,
|
||||||
new Encrypter(MojangCrypt.getCipher(1, secretKey)));
|
new Encrypter(MojangCrypt.getCipher(1, secretKey)));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user