mirror of
https://github.com/ViaVersion/VIAaaS.git
synced 2024-11-15 10:55:27 +01:00
tcp dns, java 11 http engine, shorter msg
This commit is contained in:
parent
c3178d8531
commit
2b6d2b02e7
@ -37,7 +37,7 @@ compileKotlin.kotlinOptions.jvmTarget = "11"
|
||||
val gitVersion: groovy.lang.Closure<String> by extra
|
||||
|
||||
group = "com.github.creeper123123321.viaaas"
|
||||
version = "0.4.2+" + try {
|
||||
version = "0.4.3+" + try {
|
||||
gitVersion()
|
||||
} catch (e: Exception) {
|
||||
"unknown"
|
||||
@ -62,9 +62,10 @@ dependencies {
|
||||
implementation("com.viaversion:viabackwards:4.0.1-SNAPSHOT") { isTransitive = false }
|
||||
implementation("com.github.ViaVersion.ViaRewind:viarewind-all:master-SNAPSHOT") { isTransitive = false }
|
||||
|
||||
implementation("com.google.guava:guava:30.1.1-jre")
|
||||
implementation("io.netty:netty-all:4.1.65.Final")
|
||||
implementation("io.netty:netty-tcnative-boringssl-static:2.0.39.Final")
|
||||
|
||||
implementation("com.google.guava:guava:30.1.1-jre")
|
||||
implementation("org.powernukkit.fastutil:fastutil-lite:8.1.1")
|
||||
implementation("org.yaml:snakeyaml:1.28")
|
||||
|
||||
@ -78,18 +79,16 @@ dependencies {
|
||||
implementation("org.slf4j:slf4j-api:1.7.30")
|
||||
|
||||
val ktorVersion = "1.6.0"
|
||||
implementation("com.auth0:java-jwt:3.16.0")
|
||||
implementation("io.ktor:ktor-network-tls-certificates:$ktorVersion")
|
||||
implementation("io.ktor:ktor-server-netty:$ktorVersion")
|
||||
implementation("io.ktor:ktor-client-core:$ktorVersion")
|
||||
implementation("io.ktor:ktor-client-core-jvm:$ktorVersion")
|
||||
implementation("io.ktor:ktor-client-cio:$ktorVersion")
|
||||
implementation("io.ktor:ktor-client-logging-jvm:$ktorVersion")
|
||||
implementation("io.ktor:ktor-server-core:$ktorVersion")
|
||||
implementation("io.ktor:ktor-client-gson:$ktorVersion")
|
||||
implementation("io.ktor:ktor-server-host-common:$ktorVersion")
|
||||
implementation("io.ktor:ktor-websockets:$ktorVersion")
|
||||
implementation("io.ktor:ktor-server-netty:$ktorVersion")
|
||||
implementation("io.ktor:ktor-client-java:$ktorVersion")
|
||||
implementation("io.ktor:ktor-client-logging-jvm:$ktorVersion")
|
||||
implementation("io.ktor:ktor-client-gson:$ktorVersion")
|
||||
implementation("io.ktor:ktor-server-core:$ktorVersion")
|
||||
testImplementation("io.ktor:ktor-server-test-host:$ktorVersion")
|
||||
|
||||
implementation("com.auth0:java-jwt:3.16.0")
|
||||
implementation("io.ipinfo:ipinfo-api:1.1")
|
||||
}
|
||||
|
||||
|
@ -17,6 +17,7 @@ import com.viaversion.viaversion.api.protocol.version.ProtocolVersion
|
||||
import de.gerrygames.viarewind.api.ViaRewindConfigImpl
|
||||
import io.ktor.application.*
|
||||
import io.ktor.client.*
|
||||
import io.ktor.client.engine.java.*
|
||||
import io.ktor.client.features.*
|
||||
import io.ktor.client.features.json.*
|
||||
import io.ktor.network.tls.certificates.*
|
||||
@ -41,9 +42,9 @@ val viaaasVer = JsonParser.parseString(
|
||||
var viaWebServer = WebDashboardServer()
|
||||
var serverFinishing = CompletableFuture<Unit>()
|
||||
var finishedFuture = CompletableFuture<Unit>()
|
||||
val httpClient = HttpClient {
|
||||
val httpClient = HttpClient(Java) {
|
||||
install(UserAgent) {
|
||||
agent = "VIAaaS/$viaaasVer"
|
||||
agent = "VIAaaS/${viaaasVer.substringBefore("+")}"
|
||||
}
|
||||
install(JsonFeature) {
|
||||
serializer = GsonSerializer()
|
||||
@ -63,6 +64,7 @@ val childLoop = eventLoopGroup()
|
||||
var chFuture: ChannelFuture? = null
|
||||
var ktorServer: NettyApplicationEngine? = null
|
||||
val dnsResolver = DnsNameResolverBuilder(childLoop.next())
|
||||
.socketChannelFactory(channelSocketFactory(childLoop))
|
||||
.channelFactory(channelDatagramFactory(childLoop))
|
||||
.build()
|
||||
|
||||
|
@ -52,7 +52,7 @@ class MinecraftHandler(
|
||||
if (cause is CancelCodecException) return
|
||||
if (cause is ClosedChannelException) return
|
||||
mcLogger.debug("Exception: ", cause)
|
||||
disconnect("Exception: $cause")
|
||||
disconnect("$cause")
|
||||
}
|
||||
|
||||
fun disconnect(s: String) {
|
||||
|
@ -132,6 +132,6 @@ suspend fun connectBack(
|
||||
|
||||
tryBackAddresses(handler, addresses, state, extraData)
|
||||
} catch (e: Exception) {
|
||||
throw StacklessException("Couldn't connect: $e", e)
|
||||
throw StacklessException("Connect: $e", e)
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user