fix autoread calls

This commit is contained in:
creeper123123321 2021-06-03 09:14:32 -03:00
parent 96774c621e
commit 71ce3675c6
3 changed files with 3 additions and 1 deletions

View File

@ -10,6 +10,7 @@ import com.viaversion.aas.codec.packet.handshake.Handshake
import com.viaversion.aas.config.VIAaaSConfig
import com.viaversion.aas.handler.MinecraftHandler
import com.viaversion.aas.mcLogger
import com.viaversion.aas.setAutoRead
import com.viaversion.aas.util.StacklessException
import com.viaversion.viaversion.api.protocol.packet.State
import io.netty.channel.ChannelHandlerContext
@ -93,6 +94,7 @@ class HandshakeState : MinecraftConnectionState {
handleVirtualHost(handler, packet)
if (packet.nextState == State.STATUS) { // see LoginState for LOGIN
handler.data.frontChannel.setAutoRead(false)
handler.coroutineScope.launch(Dispatchers.IO) {
connectBack(handler, packet.address, packet.port, packet.nextState)
}

View File

@ -165,6 +165,7 @@ class LoginState : MinecraftConnectionState {
frontName = loginStart.username
backName = backName ?: frontName
handler.data.frontChannel.setAutoRead(false)
handler.coroutineScope.launch(Dispatchers.IO) {
try {
if (frontOnline != null) {

View File

@ -134,7 +134,6 @@ suspend fun connectBack(
state: State,
extraData: String? = null
) {
handler.data.frontChannel.setAutoRead(false)
try {
val addresses = resolveBackendAddresses(HostAndPort.fromParts(address, port))