From 2e7faf1ac9e7010735eaff9f257b013734c6c33d Mon Sep 17 00:00:00 2001 From: creeper123123321 <7974274+creeper123123321@users.noreply.github.com> Date: Mon, 9 Oct 2023 16:01:56 -0300 Subject: [PATCH] updated some deps, still not updated to 1.20.2 --- build.gradle.kts | 22 +++++++++---------- .../aas/config/AspirinViaConfig.java | 2 +- .../aas/platform/AspirinBackwards.java | 2 +- .../aas/platform/AspirinInjector.java | 5 +---- .../aas/platform/AspirinRewind.java | 5 ++--- .../viaversion/aas/platform/FutureTask.java | 1 + .../com/viaversion/aas/AspirinServer.kt | 2 +- src/main/kotlin/com/viaversion/aas/VIAaaS.kt | 3 +++ .../viaversion/aas/command/ReloadCommand.kt | 4 ++-- .../aas/command/ViaAspirinCommand.kt | 2 -- .../command/sub/AspirinReloadSubCommand.kt | 16 -------------- .../com/viaversion/aas/config/VIAaaSConfig.kt | 8 +++---- .../com/viaversion/aas/handler/BackEndInit.kt | 3 +-- .../aas/platform/AspirinPlatform.kt | 1 - 14 files changed, 28 insertions(+), 48 deletions(-) delete mode 100644 src/main/kotlin/com/viaversion/aas/command/sub/AspirinReloadSubCommand.kt diff --git a/build.gradle.kts b/build.gradle.kts index 1dd6cda..dabdb61 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -15,7 +15,7 @@ buildscript { plugins { `java-library` application - kotlin("jvm") version "1.8.10" + kotlin("jvm") version "1.9.10" id("maven-publish") id("com.github.ben-manes.versions") version "0.47.0" id("com.github.johnrengelman.shadow") version "8.1.1" @@ -60,24 +60,24 @@ dependencies { implementation(kotlin("stdlib-jdk8")) implementation(kotlin("reflect")) - val vvVer = "4.7.1-SNAPSHOT" - val vbVer = "4.7.1-SNAPSHOT" - val vrVer = "4937bab" + val vvVer = "4.9.0-23w40a-SNAPSHOT" + val vbVer = "4.9.0-23w40a-SNAPSHOT" + val vrVer = "3.0.3-SNAPSHOT" implementation("com.viaversion:viaversion:$vvVer") { isTransitive = false } implementation("com.viaversion:viabackwards:$vbVer") { isTransitive = false } - implementation("com.github.ViaVersion.ViaRewind:viarewind-all:$vrVer") { isTransitive = false } - implementation("net.raphimc:ViaAprilFools:2.0.8-SNAPSHOT") - implementation("net.raphimc:ViaLegacy:2.2.18-SNAPSHOT") + implementation("com.viaversion:viarewind-universal:$vrVer") { isTransitive = false } + implementation("net.raphimc:ViaAprilFools:2.0.10-SNAPSHOT") + implementation("net.raphimc:ViaLegacy:2.2.21-SNAPSHOT") - val nettyVer = "4.1.93.Final" + val nettyVer = "4.1.99.Final" implementation("io.netty:netty-handler-proxy:$nettyVer") implementation("io.netty:netty-resolver-dns:$nettyVer") implementation("io.netty:netty-transport-native-epoll:$nettyVer:linux-aarch_64") implementation("io.netty:netty-transport-native-epoll:$nettyVer:linux-x86_64") implementation("io.netty:netty-tcnative-boringssl-static:2.0.61.Final:linux-aarch_64") implementation("io.netty:netty-tcnative-boringssl-static:2.0.61.Final:linux-x86_64") - implementation("io.netty.incubator:netty-incubator-transport-native-io_uring:0.0.21.Final:linux-aarch_64") - implementation("io.netty.incubator:netty-incubator-transport-native-io_uring:0.0.21.Final:linux-x86_64") + implementation("io.netty.incubator:netty-incubator-transport-native-io_uring:0.0.23.Final:linux-aarch_64") + implementation("io.netty.incubator:netty-incubator-transport-native-io_uring:0.0.23.Final:linux-x86_64") implementation("com.google.guava:guava:32.0.1-jre") implementation("com.velocitypowered:velocity-native:3.2.0-SNAPSHOT") @@ -96,7 +96,7 @@ dependencies { implementation("org.jline:jline-terminal-jansi:3.23.0") implementation("org.slf4j:slf4j-api:$slf4jVer") - val ktorVersion = "2.3.2" + val ktorVersion = "2.3.5" implementation("io.ktor:ktor-network-tls-certificates-jvm:$ktorVersion") implementation("io.ktor:ktor-server-websockets:$ktorVersion") implementation("io.ktor:ktor-server-netty-jvm:$ktorVersion") diff --git a/src/main/java/com/viaversion/aas/config/AspirinViaConfig.java b/src/main/java/com/viaversion/aas/config/AspirinViaConfig.java index 4bdb978..bff57ed 100644 --- a/src/main/java/com/viaversion/aas/config/AspirinViaConfig.java +++ b/src/main/java/com/viaversion/aas/config/AspirinViaConfig.java @@ -9,7 +9,7 @@ import java.util.Map; public class AspirinViaConfig extends AbstractViaConfig { { - reloadConfig(); + reload(); } public AspirinViaConfig() { diff --git a/src/main/java/com/viaversion/aas/platform/AspirinBackwards.java b/src/main/java/com/viaversion/aas/platform/AspirinBackwards.java index 2937fa7..af6e3e6 100644 --- a/src/main/java/com/viaversion/aas/platform/AspirinBackwards.java +++ b/src/main/java/com/viaversion/aas/platform/AspirinBackwards.java @@ -13,7 +13,7 @@ public class AspirinBackwards implements ViaBackwardsPlatform { } public void init() { - init(getDataFolder()); + init(getDataFolder().toPath().resolve("config.yml").toFile()); } @Override diff --git a/src/main/java/com/viaversion/aas/platform/AspirinInjector.java b/src/main/java/com/viaversion/aas/platform/AspirinInjector.java index 018eafb..f3ce0b0 100644 --- a/src/main/java/com/viaversion/aas/platform/AspirinInjector.java +++ b/src/main/java/com/viaversion/aas/platform/AspirinInjector.java @@ -5,7 +5,6 @@ import com.viaversion.viaversion.api.protocol.version.ProtocolVersion; import com.viaversion.viaversion.libs.fastutil.ints.IntLinkedOpenHashSet; import com.viaversion.viaversion.libs.fastutil.ints.IntSortedSet; import com.viaversion.viaversion.libs.gson.JsonObject; -import de.gerrygames.viarewind.velocity.VersionInfo; public class AspirinInjector implements ViaInjector { @Override @@ -33,9 +32,7 @@ public class AspirinInjector implements ViaInjector { @Override public JsonObject getDump() { - var obj = new JsonObject(); - obj.addProperty("ViaRewind version", VersionInfo.VERSION); - return obj; + return new JsonObject(); } @Override diff --git a/src/main/java/com/viaversion/aas/platform/AspirinRewind.java b/src/main/java/com/viaversion/aas/platform/AspirinRewind.java index d4dbb7e..b2e05b7 100644 --- a/src/main/java/com/viaversion/aas/platform/AspirinRewind.java +++ b/src/main/java/com/viaversion/aas/platform/AspirinRewind.java @@ -1,7 +1,6 @@ package com.viaversion.aas.platform; -import de.gerrygames.viarewind.api.ViaRewindConfigImpl; -import de.gerrygames.viarewind.api.ViaRewindPlatform; +import com.viaversion.viarewind.api.ViaRewindPlatform; import java.io.File; import java.util.logging.Logger; @@ -14,6 +13,6 @@ public class AspirinRewind implements ViaRewindPlatform { } public void init() { - init(new ViaRewindConfigImpl(new File("config/viarewind.yml"))); + init(new File("config/viarewind.yml")); } } diff --git a/src/main/java/com/viaversion/aas/platform/FutureTask.java b/src/main/java/com/viaversion/aas/platform/FutureTask.java index cf2a63a..b52e250 100644 --- a/src/main/java/com/viaversion/aas/platform/FutureTask.java +++ b/src/main/java/com/viaversion/aas/platform/FutureTask.java @@ -14,6 +14,7 @@ public class FutureTask implements PlatformTask> { } @Override + @Deprecated public @Nullable Future getObject() { return object; } diff --git a/src/main/kotlin/com/viaversion/aas/AspirinServer.kt b/src/main/kotlin/com/viaversion/aas/AspirinServer.kt index 98bdff8..cf4e6a8 100644 --- a/src/main/kotlin/com/viaversion/aas/AspirinServer.kt +++ b/src/main/kotlin/com/viaversion/aas/AspirinServer.kt @@ -156,7 +156,7 @@ object AspirinServer { } fun currentPlayers(): Int { - return Via.getManager().connectionManager.connections.filter { it.protocolInfo.state == State.PLAY }.count() + return Via.getManager().connectionManager.connections.filter { it.protocolInfo.serverState == State.PLAY }.count() } suspend fun updaterCheckMessage(): String { diff --git a/src/main/kotlin/com/viaversion/aas/VIAaaS.kt b/src/main/kotlin/com/viaversion/aas/VIAaaS.kt index b2094b9..64e380b 100644 --- a/src/main/kotlin/com/viaversion/aas/VIAaaS.kt +++ b/src/main/kotlin/com/viaversion/aas/VIAaaS.kt @@ -1,6 +1,7 @@ package com.viaversion.aas import com.viaversion.aas.command.VIAaaSConsole +import com.viaversion.aas.config.VIAaaSConfig import com.viaversion.aas.platform.AspirinAprilFools import com.viaversion.aas.platform.AspirinBackwards import com.viaversion.aas.platform.AspirinLegacy @@ -8,6 +9,7 @@ import com.viaversion.aas.platform.AspirinPlatform import com.viaversion.aas.platform.AspirinRewind import com.viaversion.aas.protocol.registerAspirinProtocols import com.viaversion.aas.web.ViaWebApp +import com.viaversion.viaversion.api.Via import com.viaversion.viaversion.api.protocol.version.ProtocolVersion import io.ktor.server.application.* import kotlinx.coroutines.CoroutineScope @@ -61,6 +63,7 @@ private fun initVia() { AspirinBackwards().init() AspirinAprilFools().init() AspirinLegacy().init() + Via.getManager().configurationProvider.register(VIAaaSConfig) } ProtocolVersion.register(autoProtocolId, "AUTO") diff --git a/src/main/kotlin/com/viaversion/aas/command/ReloadCommand.kt b/src/main/kotlin/com/viaversion/aas/command/ReloadCommand.kt index da67dac..5403428 100644 --- a/src/main/kotlin/com/viaversion/aas/command/ReloadCommand.kt +++ b/src/main/kotlin/com/viaversion/aas/command/ReloadCommand.kt @@ -3,13 +3,13 @@ package com.viaversion.aas.command import com.viaversion.viaversion.api.command.ViaCommandSender object ReloadCommand : Command { - override val info = "Alias for 'viaversion aasreload'" + override val info = "Alias for 'viaversion reload'" override fun suggest(sender: ViaCommandSender, alias: String, args: List): List { return emptyList() } override fun execute(sender: ViaCommandSender, alias: String, args: List) { - ViaAspirinCommand.execute(sender, alias, listOf("aasreload")) + ViaAspirinCommand.execute(sender, alias, listOf("reload")) } } \ No newline at end of file diff --git a/src/main/kotlin/com/viaversion/aas/command/ViaAspirinCommand.kt b/src/main/kotlin/com/viaversion/aas/command/ViaAspirinCommand.kt index addfdb6..4a39241 100644 --- a/src/main/kotlin/com/viaversion/aas/command/ViaAspirinCommand.kt +++ b/src/main/kotlin/com/viaversion/aas/command/ViaAspirinCommand.kt @@ -1,6 +1,5 @@ package com.viaversion.aas.command -import com.viaversion.aas.command.sub.AspirinReloadSubCommand import com.viaversion.aas.command.sub.ConnectionsSubCommand import com.viaversion.aas.command.sub.StopSubCommand import com.viaversion.aas.command.sub.VIAaaSSubCommand @@ -14,7 +13,6 @@ object ViaAspirinCommand : ViaCommandHandler(), Command { registerSubCommand(StopSubCommand) registerSubCommand(VIAaaSSubCommand) registerSubCommand(ConnectionsSubCommand) - registerSubCommand(AspirinReloadSubCommand) } override fun suggest(sender: ViaCommandSender, alias: String, args: List): List { diff --git a/src/main/kotlin/com/viaversion/aas/command/sub/AspirinReloadSubCommand.kt b/src/main/kotlin/com/viaversion/aas/command/sub/AspirinReloadSubCommand.kt deleted file mode 100644 index c827457..0000000 --- a/src/main/kotlin/com/viaversion/aas/command/sub/AspirinReloadSubCommand.kt +++ /dev/null @@ -1,16 +0,0 @@ -package com.viaversion.aas.command.sub - -import com.viaversion.aas.config.VIAaaSConfig -import com.viaversion.viaversion.api.command.ViaCommandSender -import com.viaversion.viaversion.api.command.ViaSubCommand - -object AspirinReloadSubCommand : ViaSubCommand() { - override fun name() = "aasreload" - override fun description() = "Reloads VIAaaS config" - - override fun execute(sender: ViaCommandSender, args: Array): Boolean { - VIAaaSConfig.reloadConfig() - sender.sendMessage("Reloaded VIAaaS config. Some configurations may need a restart.") - return true - } -} \ No newline at end of file diff --git a/src/main/kotlin/com/viaversion/aas/config/VIAaaSConfig.kt b/src/main/kotlin/com/viaversion/aas/config/VIAaaSConfig.kt index 492c95c..7f47fc3 100644 --- a/src/main/kotlin/com/viaversion/aas/config/VIAaaSConfig.kt +++ b/src/main/kotlin/com/viaversion/aas/config/VIAaaSConfig.kt @@ -13,7 +13,7 @@ import java.net.URI import java.net.URL import java.util.* -object VIAaaSConfig : Config(File("config/viaaas.yml")) { +object VIAaaSConfig : Config(File("config/viaaas.yml")), com.viaversion.viaversion.api.configuration.Config { var defaultParameters: Map = emptyMap() var bindAddresses = emptyList() var hostName: List = emptyList() @@ -37,11 +37,11 @@ object VIAaaSConfig : Config(File("config/viaaas.yml")) { var compressionLevel: Int = 6 init { - reloadConfig() + reload() } - override fun reloadConfig() { - super.reloadConfig() + override fun reload() { + super.reload() reloadFields() } diff --git a/src/main/kotlin/com/viaversion/aas/handler/BackEndInit.kt b/src/main/kotlin/com/viaversion/aas/handler/BackEndInit.kt index d58da31..a0a3e73 100644 --- a/src/main/kotlin/com/viaversion/aas/handler/BackEndInit.kt +++ b/src/main/kotlin/com/viaversion/aas/handler/BackEndInit.kt @@ -2,15 +2,14 @@ package com.viaversion.aas.handler import com.viaversion.aas.codec.FrameCodec import com.viaversion.aas.codec.MinecraftCodec -import com.viaversion.viaversion.api.protocol.version.ProtocolVersion import com.viaversion.viaversion.connection.UserConnectionImpl import com.viaversion.viaversion.protocol.ProtocolPipelineImpl import io.netty.channel.Channel import io.netty.channel.ChannelInitializer import io.netty.handler.timeout.ReadTimeoutHandler import net.raphimc.vialegacy.api.LegacyProtocolVersion +import net.raphimc.vialegacy.api.protocol.PreNettyBaseProtocol import net.raphimc.vialegacy.netty.PreNettyLengthCodec -import net.raphimc.vialegacy.protocols.release.protocol1_7_2_5to1_6_4.baseprotocols.PreNettyBaseProtocol import java.net.InetSocketAddress import java.net.URI import java.util.concurrent.TimeUnit diff --git a/src/main/kotlin/com/viaversion/aas/platform/AspirinPlatform.kt b/src/main/kotlin/com/viaversion/aas/platform/AspirinPlatform.kt index 8c1bd3a..a81a47e 100644 --- a/src/main/kotlin/com/viaversion/aas/platform/AspirinPlatform.kt +++ b/src/main/kotlin/com/viaversion/aas/platform/AspirinPlatform.kt @@ -70,7 +70,6 @@ object AspirinPlatform : ViaPlatform { override fun getLogger() = logger override fun getOnlinePlayers(): Array = emptyArray() override fun isPluginEnabled() = true - override fun getConfigurationProvider() = conf override fun getPlatformName() = "VIAaaS" override fun getPlatformVersion() = AspirinServer.version override fun getPluginVersion() = VersionInfo.VERSION