Skip to content

Commit

Permalink
fix: close websocket connection when server stops
Browse files Browse the repository at this point in the history
  • Loading branch information
Itsusinn committed Dec 30, 2022
1 parent d2b40f1 commit c79dac8
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 6 deletions.
4 changes: 4 additions & 0 deletions build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -10,4 +10,8 @@ plugins {
allprojects {
group = "org.mesagisto"
version = "1.2.2"
repositories {
mavenLocal()
mavenCentral()
}
}
7 changes: 2 additions & 5 deletions common/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -10,21 +10,18 @@ tasks.compileKotlin {
sourceCompatibility = "1.8"
}
repositories {
mavenCentral()
mavenLocal()
mavenCentral()
}
dependencies {

implementation("org.mesagisto:mesagisto-client:1.6.0-rc.6")
compileOnly("org.apache.logging.log4j:log4j-api:2.17.2")

implementation("org.fusesource.leveldbjni:leveldbjni-all:1.8")

implementation("org.jetbrains.kotlinx:kotlinx-coroutines-core:1.6.2")
implementation("org.jetbrains.kotlinx:kotlinx-coroutines-jdk8:1.6.2")

implementation("com.fasterxml.jackson.dataformat:jackson-dataformat-yaml:2.13.3")
implementation("com.fasterxml.jackson.dataformat:jackson-dataformat-cbor:2.13.3")

implementation("org.bouncycastle:bcprov-jdk15on:1.70")
implementation("org.mesagisto:mesagisto-client:1.6.0-rc.1")
}
2 changes: 2 additions & 0 deletions common/src/main/java/org/mesagisto/mcmod/ModEntry.kt
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import kotlinx.coroutines.launch
import kotlinx.coroutines.runBlocking
import org.mesagisto.client.Logger
import org.mesagisto.client.MesagistoConfig
import org.mesagisto.client.Server
import org.mesagisto.client.utils.ConfigKeeper
import org.mesagisto.mcmod.api.ChatImpl
import org.mesagisto.mcmod.api.CompatImpl
Expand Down Expand Up @@ -49,6 +50,7 @@ object ModEntry : CoroutineScope {
}
}
fun onDisable() {
Server.close()
dataKeeper.save()
}

Expand Down
2 changes: 1 addition & 1 deletion common/src/main/java/org/mesagisto/mcmod/RootConfig.kt
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ data class RootConfig(
val enable: Boolean = false,
val channel: String = "your-channel",
val target: String = "target-name",
val centers: ConcurrentHashMap<String, String> = ConcurrentHashMap<String, String>(1).apply { put("mesagisto", "wss://center.mesagisto.org") },
val centers: ConcurrentHashMap<String, String> = ConcurrentHashMap<String, String>(1).apply { put("mesagisto", "wss://builtin") },
val cipher: CipherConfig = CipherConfig()
) {
fun roomId(): UUID {
Expand Down

0 comments on commit c79dac8

Please sign in to comment.