diff options
author | Joffrey Bion <joffrey.bion@booking.com> | 2020-03-29 18:02:47 +0200 |
---|---|---|
committer | Joffrey Bion <joffrey.bion@booking.com> | 2020-03-29 18:07:31 +0200 |
commit | 57a6e5135ee554079c6064bd770d51545800969d (patch) | |
tree | 9c688d1fc261cf6740c63a604695f9301220830f /sw-client | |
parent | Ensure error saga starts first (diff) | |
download | seven-wonders-57a6e5135ee554079c6064bd770d51545800969d.tar.gz seven-wonders-57a6e5135ee554079c6064bd770d51545800969d.tar.bz2 seven-wonders-57a6e5135ee554079c6064bd770d51545800969d.zip |
Fix duplicated inconsistent state
Diffstat (limited to 'sw-client')
-rw-r--r-- | sw-client/src/commonMain/kotlin/org/luxons/sevenwonders/client/SevenWondersClient.kt | 9 |
1 files changed, 4 insertions, 5 deletions
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 d95c32f5..b97413c3 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 @@ -2,8 +2,8 @@ package org.luxons.sevenwonders.client import kotlinx.serialization.DeserializationStrategy import kotlinx.serialization.SerializationStrategy -import kotlinx.serialization.builtins.serializer import kotlinx.serialization.builtins.list +import kotlinx.serialization.builtins.serializer import org.hildan.krossbow.stomp.StompClient import org.hildan.krossbow.stomp.StompSubscription import org.hildan.krossbow.stomp.conversions.kxserialization.StompSessionWithKxSerialization @@ -12,11 +12,10 @@ import org.hildan.krossbow.stomp.conversions.kxserialization.withJsonConversions import org.hildan.krossbow.stomp.sendEmptyMsg import org.hildan.krossbow.stomp.subscribeEmptyMsg import org.luxons.sevenwonders.model.CustomizableSettings -import org.luxons.sevenwonders.model.GameState import org.luxons.sevenwonders.model.PlayerMove import org.luxons.sevenwonders.model.PlayerTurnInfo +import org.luxons.sevenwonders.model.api.ConnectedPlayer import org.luxons.sevenwonders.model.api.LobbyDTO -import org.luxons.sevenwonders.model.api.PlayerDTO import org.luxons.sevenwonders.model.api.SEVEN_WONDERS_WS_ENDPOINT import org.luxons.sevenwonders.model.api.actions.ChooseNameAction import org.luxons.sevenwonders.model.api.actions.CreateGameAction @@ -58,12 +57,12 @@ class SevenWondersSession(private val stompSession: StompSessionWithKxSerializat suspend fun watchErrors(): StompSubscription<ErrorDTO> = stompSession.subscribe("/user/queue/errors", ErrorDTO.serializer()) - suspend fun chooseName(displayName: String): PlayerDTO = stompSession.request( + suspend fun chooseName(displayName: String): ConnectedPlayer = stompSession.request( sendDestination = "/app/chooseName", receiveDestination = "/user/queue/nameChoice", payload = ChooseNameAction(displayName), serializer = ChooseNameAction.serializer(), - deserializer = PlayerDTO.serializer() + deserializer = ConnectedPlayer.serializer() ) suspend fun watchGames(): StompSubscription<List<LobbyDTO>> = |