summaryrefslogtreecommitdiff
path: root/sw-client
diff options
context:
space:
mode:
Diffstat (limited to 'sw-client')
-rw-r--r--sw-client/build.gradle.kts4
-rw-r--r--sw-client/src/commonMain/kotlin/org/luxons/sevenwonders/client/SevenWondersClient.kt7
2 files changed, 6 insertions, 5 deletions
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
}
bgstack15