mirror of
https://github.com/ViaVersion/VIAaaS.git
synced 2025-01-08 19:38:36 +01:00
fix player disconnecting cancelling protocol detection
This commit is contained in:
parent
fe95bd2090
commit
fa3d59c5b0
@ -24,16 +24,17 @@ import io.netty.channel.ChannelOption
|
|||||||
import io.netty.handler.timeout.ReadTimeoutHandler
|
import io.netty.handler.timeout.ReadTimeoutHandler
|
||||||
import io.netty.resolver.NoopAddressResolverGroup
|
import io.netty.resolver.NoopAddressResolverGroup
|
||||||
import kotlinx.coroutines.CoroutineScope
|
import kotlinx.coroutines.CoroutineScope
|
||||||
import kotlinx.coroutines.Job
|
import kotlinx.coroutines.SupervisorJob
|
||||||
import kotlinx.coroutines.launch
|
import kotlinx.coroutines.launch
|
||||||
import java.net.InetSocketAddress
|
import java.net.InetSocketAddress
|
||||||
import java.util.concurrent.CompletableFuture
|
import java.util.concurrent.CompletableFuture
|
||||||
import java.util.concurrent.TimeUnit
|
import java.util.concurrent.TimeUnit
|
||||||
|
|
||||||
object ProtocolDetector {
|
object ProtocolDetector {
|
||||||
|
val coroutineScope = CoroutineScope(SupervisorJob())
|
||||||
private val loader = CacheLoader.from<InetSocketAddress, CompletableFuture<ProtocolVersion>> { address ->
|
private val loader = CacheLoader.from<InetSocketAddress, CompletableFuture<ProtocolVersion>> { address ->
|
||||||
val future = CompletableFuture<ProtocolVersion>()
|
val future = CompletableFuture<ProtocolVersion>()
|
||||||
CoroutineScope(Job()).launch {
|
coroutineScope.launch {
|
||||||
try {
|
try {
|
||||||
val proxyUri = VIAaaSConfig.backendProxy
|
val proxyUri = VIAaaSConfig.backendProxy
|
||||||
val proxySocket = if (proxyUri == null) null else {
|
val proxySocket = if (proxyUri == null) null else {
|
||||||
|
Loading…
Reference in New Issue
Block a user