mirror of
https://github.com/ViaVersion/VIAaaS.git
synced 2025-01-24 22:01:49 +01:00
only send reauth message when encrypted
This commit is contained in:
parent
3682a0f011
commit
30d7d584c4
@ -1,5 +1,6 @@
|
||||
package com.viaversion.aas.handler
|
||||
|
||||
import com.viaversion.aas.codec.CryptoCodec
|
||||
import com.viaversion.aas.handler.state.HandshakeState
|
||||
import com.viaversion.aas.handler.state.ConnectionState
|
||||
import io.netty.channel.Channel
|
||||
@ -13,4 +14,5 @@ class ConnectionData(
|
||||
) {
|
||||
val frontHandler get() = frontChannel.pipeline().get(MinecraftHandler::class.java)
|
||||
val backHandler get() = backChannel?.pipeline()?.get(MinecraftHandler::class.java)
|
||||
val frontEncrypted get() = frontChannel.pipeline().get(CryptoCodec::class.java) != null
|
||||
}
|
@ -106,9 +106,13 @@ class LoginState : ConnectionState {
|
||||
}
|
||||
|
||||
fun reauthMessage(handler: MinecraftHandler, backName: String, backHash: String): CompletableFuture<Boolean> {
|
||||
if (handler.data.frontVer!! < ProtocolVersion.v1_13.version) {
|
||||
if (!handler.data.frontEncrypted
|
||||
|| handler.data.frontVer!! < ProtocolVersion.v1_13.version
|
||||
) {
|
||||
callbackPluginReauth.complete(false)
|
||||
} else {
|
||||
return callbackPluginReauth
|
||||
}
|
||||
|
||||
val buf = ByteBufAllocator.DEFAULT.buffer()
|
||||
try {
|
||||
Type.STRING.write(buf, backName)
|
||||
@ -123,7 +127,6 @@ class LoginState : ConnectionState {
|
||||
} finally {
|
||||
buf.release()
|
||||
}
|
||||
}
|
||||
return callbackPluginReauth
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user