From fa3d59c5b00f03e294b86ab81968174244b54b31 Mon Sep 17 00:00:00 2001 From: creeper123123321 <7974274+creeper123123321@users.noreply.github.com> Date: Fri, 1 Jul 2022 09:56:01 -0300 Subject: [PATCH] fix player disconnecting cancelling protocol detection --- .../viaversion/aas/handler/autoprotocol/ProtocolDetector.kt | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/main/kotlin/com/viaversion/aas/handler/autoprotocol/ProtocolDetector.kt b/src/main/kotlin/com/viaversion/aas/handler/autoprotocol/ProtocolDetector.kt index 3f3d262..ec12ce5 100644 --- a/src/main/kotlin/com/viaversion/aas/handler/autoprotocol/ProtocolDetector.kt +++ b/src/main/kotlin/com/viaversion/aas/handler/autoprotocol/ProtocolDetector.kt @@ -24,16 +24,17 @@ import io.netty.channel.ChannelOption import io.netty.handler.timeout.ReadTimeoutHandler import io.netty.resolver.NoopAddressResolverGroup import kotlinx.coroutines.CoroutineScope -import kotlinx.coroutines.Job +import kotlinx.coroutines.SupervisorJob import kotlinx.coroutines.launch import java.net.InetSocketAddress import java.util.concurrent.CompletableFuture import java.util.concurrent.TimeUnit object ProtocolDetector { + val coroutineScope = CoroutineScope(SupervisorJob()) private val loader = CacheLoader.from> { address -> val future = CompletableFuture() - CoroutineScope(Job()).launch { + coroutineScope.launch { try { val proxyUri = VIAaaSConfig.backendProxy val proxySocket = if (proxyUri == null) null else {