Skip to content

Commit

Permalink
Merge pull request #17 from MikChanNoPlugins/dev/dev
Browse files Browse the repository at this point in the history
Next Release
  • Loading branch information
wtlgo authored Jun 12, 2024
2 parents b055c71 + 15fb9e8 commit cc4cc90
Show file tree
Hide file tree
Showing 5 changed files with 29 additions and 29 deletions.
12 changes: 6 additions & 6 deletions build.gradle
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
plugins {
id "java"
id "org.jetbrains.kotlin.jvm" version "1.8.20"
id "org.jetbrains.kotlin.jvm" version "2.0.0"
id "org.jetbrains.dokka" version "1.7.20"
id "maven-publish"
id "com.github.johnrengelman.shadow" version "7.1.2"
Expand All @@ -24,7 +24,7 @@ static def determineVersion(String defaultVersion) {
}

group = "dev.mikchan.mcnp"
version = determineVersion("1.3.2")
version = determineVersion("1.3.3")

def localProperties = new Properties()
def propertiesFile = rootProject.file("local.properties")
Expand Down Expand Up @@ -67,11 +67,11 @@ dependencies {
compileOnly "com.github.NuVotifier.NuVotifier:nuvotifier-api:2.7.2"
compileOnly "com.github.NuVotifier.NuVotifier:nuvotifier-common:2.7.2"

implementation "org.jetbrains.kotlin:kotlin-stdlib:1.8.20"
implementation "org.jetbrains.kotlin:kotlin-stdlib:2.0.0"

implementation "io.ktor:ktor-server-core:2.2.4"
implementation "io.ktor:ktor-server-netty:2.2.4"
implementation "dev.dejvokep:boosted-yaml:1.3"
implementation "io.ktor:ktor-server-core:2.3.11"
implementation "io.ktor:ktor-server-netty:2.3.11"
implementation "dev.dejvokep:boosted-yaml:1.3.5"
implementation "com.xk72:pherialize:1.2.4"
implementation "dev.jeka:jeka-core:0.10.12"

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,13 +31,14 @@ internal fun Route.createTMonitoringComRoute(plugin: IPlugin) {
val address = call.request.origin.remoteHost

plugin.threadPool.submit {
var result: String? = null
try {
val client = HttpClient.newBuilder().followRedirects(HttpClient.Redirect.ALWAYS).build()
val request =
HttpRequest.newBuilder().uri(URI.create("https://tmonitoring.com/api/check/$hash?id=$id")).build()

val response = client.send(request, HttpResponse.BodyHandlers.ofString())
val result = response.body() ?: return@submit
result = response.body() ?: return@submit

val data = Pherialize.unserialize(result).toArray() ?: return@submit

Expand All @@ -49,9 +50,8 @@ internal fun Route.createTMonitoringComRoute(plugin: IPlugin) {

val vote = Vote("tmonitoring.com", username, address, System.currentTimeMillis().toString(10))
plugin.voteHandler?.onVoteReceived(vote, VotifierSession.ProtocolVersion.UNKNOWN, address)

} catch (ex: Exception) {
plugin.log.warning(ex.message, ex)
plugin.log.warning("${ex.message}; Body: $result", ex)
}
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ void onProxyShutdownEvent(ProxyShutdownEvent event) {
}

private void download(URL url, File location) throws IOException {
if (logger != null) logger.info("Downloading " + url + "...");
if (logger != null) logger.info("Downloading {}...", url);

//noinspection ResultOfMethodCallIgnored
location.getParentFile().mkdirs();
Expand All @@ -108,7 +108,7 @@ private void download(URL url, File location) throws IOException {
}
} catch (IOException e) {
if (logger != null)
logger.error("Failed to download " + url + "...");
logger.error("Failed to download {}...", url);
throw e;
}
}
Expand All @@ -129,12 +129,12 @@ private void registerDependencies() throws IOException {

withJekaPath(new File(libsPath, "cache"), () -> {
final JkDependencySet deps = JkDependencySet.of()
.and("org.jetbrains.kotlin:kotlin-stdlib:1.8.20")
.and("io.ktor:ktor-server-core:2.2.4")
.and("io.ktor:ktor-server-core-jvm:2.2.4")
.and("io.ktor:ktor-server-netty:2.2.4")
.and("io.ktor:ktor-server-netty-jvm:2.2.4")
.and("dev.dejvokep:boosted-yaml:1.3")
.and("org.jetbrains.kotlin:kotlin-stdlib:2.0.0")
.and("io.ktor:ktor-server-core:2.3.11")
.and("io.ktor:ktor-server-core-jvm:2.3.11")
.and("io.ktor:ktor-server-netty:2.3.11")
.and("io.ktor:ktor-server-netty-jvm:2.3.11")
.and("dev.dejvokep:boosted-yaml:1.3.5")
.and("com.xk72:pherialize:1.2.4");
final JkDependencyResolver resolver = JkDependencyResolver.of()
.setRepos(JkRepo.ofMavenCentral().toSet());
Expand Down
12 changes: 6 additions & 6 deletions src/main/resources/bungee.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,10 @@ depend:
load: STARTUP

libraries:
- org.jetbrains.kotlin:kotlin-stdlib:1.8.20
- io.ktor:ktor-server-core:2.2.4
- io.ktor:ktor-server-core-jvm:2.2.4
- io.ktor:ktor-server-netty:2.2.4
- io.ktor:ktor-server-netty-jvm:2.2.4
- dev.dejvokep:boosted-yaml:1.3
- org.jetbrains.kotlin:kotlin-stdlib:2.0.0
- io.ktor:ktor-server-core:2.3.11
- io.ktor:ktor-server-core-jvm:2.3.11
- io.ktor:ktor-server-netty:2.3.11
- io.ktor:ktor-server-netty-jvm:2.3.11
- dev.dejvokep:boosted-yaml:1.3.5
- com.xk72:pherialize:1.2.4
12 changes: 6 additions & 6 deletions src/main/resources/plugin.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,10 @@ depend:
load: STARTUP

libraries:
- org.jetbrains.kotlin:kotlin-stdlib:1.8.20
- io.ktor:ktor-server-core:2.2.4
- io.ktor:ktor-server-core-jvm:2.2.4
- io.ktor:ktor-server-netty:2.2.4
- io.ktor:ktor-server-netty-jvm:2.2.4
- dev.dejvokep:boosted-yaml:1.3
- org.jetbrains.kotlin:kotlin-stdlib:2.0.0
- io.ktor:ktor-server-core:2.3.11
- io.ktor:ktor-server-core-jvm:2.3.11
- io.ktor:ktor-server-netty:2.3.11
- io.ktor:ktor-server-netty-jvm:2.3.11
- dev.dejvokep:boosted-yaml:1.3.5
- com.xk72:pherialize:1.2.4

0 comments on commit cc4cc90

Please sign in to comment.