fix player disconnecting cancelling protocol detection

This commit is contained in:
creeper123123321 2022-07-01 09:56:01 -03:00
parent fe95bd2090
commit fa3d59c5b0

View File

@ -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<InetSocketAddress, CompletableFuture<ProtocolVersion>> { address ->
val future = CompletableFuture<ProtocolVersion>()
CoroutineScope(Job()).launch {
coroutineScope.launch {
try {
val proxyUri = VIAaaSConfig.backendProxy
val proxySocket = if (proxyUri == null) null else {