summaryrefslogtreecommitdiff
path: root/sw-client
diff options
context:
space:
mode:
Diffstat (limited to 'sw-client')
-rw-r--r--sw-client/src/commonMain/kotlin/org/luxons/sevenwonders/client/SevenWondersClient.kt7
1 files changed, 5 insertions, 2 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 4acbccd9..c4293c2a 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
@@ -88,8 +88,11 @@ class SevenWondersSession(private val stompSession: StompSessionWithKxSerializat
suspend fun watchLobbyUpdates(gameId: Long): StompSubscription<LobbyDTO> =
stompSession.subscribe("/topic/lobby/$gameId/updated", LobbyDTO.serializer())
- suspend fun watchGameStart(gameId: Long): StompSubscription<Unit> =
- stompSession.subscribeEmptyMsg("/topic/lobby/$gameId/started")
+ suspend fun awaitGameStart(gameId: Long) {
+ val gameStartSubscription = stompSession.subscribeEmptyMsg("/topic/lobby/$gameId/started")
+ gameStartSubscription.messages.receive()
+ gameStartSubscription.unsubscribe()
+ }
suspend fun startGame() {
stompSession.sendEmptyMsg("/app/lobby/startGame")
bgstack15