mirror of
https://github.com/ViaVersion/VIAaaS.git
synced 2024-11-15 10:55:27 +01:00
fix autoread calls
This commit is contained in:
parent
96774c621e
commit
71ce3675c6
@ -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)
|
||||
}
|
||||
|
@ -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) {
|
||||
|
@ -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))
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user