diff options
author | Joffrey Bion <joffrey.bion@gmail.com> | 2022-07-02 20:53:44 +0200 |
---|---|---|
committer | Joffrey Bion <joffrey.bion@gmail.com> | 2022-07-03 23:56:26 +0200 |
commit | 0d1760c2d79ab421d5c2659ae9576d43859c4c4d (patch) | |
tree | b5e61d067a2d5b7aec42416471a7081fb5828ea2 | |
parent | Remove feature flag for the now stable versions catalog (diff) | |
download | seven-wonders-0d1760c2d79ab421d5c2659ae9576d43859c4c4d.tar.gz seven-wonders-0d1760c2d79ab421d5c2659ae9576d43859c4c4d.tar.bz2 seven-wonders-0d1760c2d79ab421d5c2659ae9576d43859c4c4d.zip |
Upgrade Krossbow to 4.0.2
-rw-r--r-- | gradle/libs.versions.toml | 5 | ||||
-rw-r--r-- | sw-client/build.gradle.kts | 4 | ||||
-rw-r--r-- | sw-client/src/commonMain/kotlin/org/luxons/sevenwonders/client/SevenWondersClient.kt | 7 |
3 files changed, 9 insertions, 7 deletions
diff --git a/gradle/libs.versions.toml b/gradle/libs.versions.toml index d63e2d38..993a03ff 100644 --- a/gradle/libs.versions.toml +++ b/gradle/libs.versions.toml @@ -1,7 +1,7 @@ [versions] kotlinx-coroutines = "1.6.3" kotlinx-serialization = "1.3.2" -krossbow = "3.0.0" +krossbow = "4.0.2" logback-classic = "1.2.10" loki-logback-appender = "1.3.1" micrometer-registry-prometheus = "1.8.1" @@ -21,7 +21,8 @@ kotlinx-coroutines-core = { module = "org.jetbrains.kotlinx:kotlinx-coroutines-c kotlinx-coroutines-reactor = { module = "org.jetbrains.kotlinx:kotlinx-coroutines-reactor", version.ref = "kotlinx-coroutines" } kotlinx-serialization-core = { module = "org.jetbrains.kotlinx:kotlinx-serialization-core", version.ref = "kotlinx-serialization" } kotlinx-serialization-json = { module = "org.jetbrains.kotlinx:kotlinx-serialization-json", version.ref = "kotlinx-serialization" } -krossbow-stomp-kxserialization = { module = "org.hildan.krossbow:krossbow-stomp-kxserialization", version.ref = "krossbow" } +krossbow-stomp-kxserialization-json = { module = "org.hildan.krossbow:krossbow-stomp-kxserialization-json", version.ref = "krossbow" } +krossbow-websocket-builtin = { module = "org.hildan.krossbow:krossbow-websocket-builtin", version.ref = "krossbow" } logback-classic = { module = "ch.qos.logback:logback-classic", version.ref = "logback-classic" } loki-logback-appender = { module = "com.github.loki4j:loki-logback-appender", version.ref = "loki-logback-appender" } micrometer-registry-prometheus = { module = "io.micrometer:micrometer-registry-prometheus", version.ref = "micrometer-registry-prometheus" } diff --git a/sw-client/build.gradle.kts b/sw-client/build.gradle.kts index 3b260cd0..3ca5c93e 100644 --- a/sw-client/build.gradle.kts +++ b/sw-client/build.gradle.kts @@ -11,8 +11,8 @@ kotlin { val commonMain by getting { dependencies { api(projects.swCommonModel) - api(libs.krossbow.stomp.kxserialization) - implementation(libs.kotlinx.serialization.json) + api(libs.krossbow.stomp.kxserialization.json) + api(libs.krossbow.websocket.builtin) implementation(libs.kotlinx.coroutines.core) } } diff --git a/sw-client/src/commonMain/kotlin/org/luxons/sevenwonders/client/SevenWondersClient.kt b/sw-client/src/commonMain/kotlin/org/luxons/sevenwonders/client/SevenWondersClient.kt index 065635dd..e0c336ce 100644 --- a/sw-client/src/commonMain/kotlin/org/luxons/sevenwonders/client/SevenWondersClient.kt +++ b/sw-client/src/commonMain/kotlin/org/luxons/sevenwonders/client/SevenWondersClient.kt @@ -1,7 +1,6 @@ package org.luxons.sevenwonders.client import kotlinx.coroutines.CoroutineStart -import kotlinx.coroutines.ExperimentalCoroutinesApi import kotlinx.coroutines.async import kotlinx.coroutines.coroutineScope import kotlinx.coroutines.flow.Flow @@ -14,8 +13,10 @@ import org.hildan.krossbow.stomp.config.HeartBeatTolerance import org.hildan.krossbow.stomp.conversions.kxserialization.StompSessionWithKxSerialization import org.hildan.krossbow.stomp.conversions.kxserialization.convertAndSend import org.hildan.krossbow.stomp.conversions.kxserialization.subscribe -import org.hildan.krossbow.stomp.conversions.kxserialization.withJsonConversions +import org.hildan.krossbow.stomp.conversions.kxserialization.json.withJsonConversions import org.hildan.krossbow.stomp.sendEmptyMsg +import org.hildan.krossbow.websocket.WebSocketClient +import org.hildan.krossbow.websocket.default import org.luxons.sevenwonders.model.PlayerMove import org.luxons.sevenwonders.model.Settings import org.luxons.sevenwonders.model.api.* @@ -28,7 +29,7 @@ import kotlin.time.Duration.Companion.seconds class SevenWondersClient { - private val stompClient = StompClient { + private val stompClient = StompClient(WebSocketClient.default()) { heartBeat = HeartBeat(10.seconds, 10.seconds) heartBeatTolerance = HeartBeatTolerance(Duration.ZERO, 10.seconds) // wide margin to account for heroku cold start } |