From 71f2fc4f25bdfdeac7db9b8e62144c3110e3bf6a Mon Sep 17 00:00:00 2001 From: joffrey-bion Date: Sat, 12 Dec 2020 16:18:28 +0100 Subject: Fix race conditions for game start and tests Resolves: https://github.com/joffrey-bion/seven-wonders/issues/70 --- .../kotlin/org/luxons/sevenwonders/client/SevenWondersClient.kt | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) (limited to 'sw-client/src/commonMain/kotlin/org/luxons') 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 6cc50f44..02f7f2da 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 @@ -122,10 +122,8 @@ class SevenWondersSession(private val stompSession: StompSessionWithKxSerializat suspend fun watchLobbyUpdates(): Flow = stompSession.subscribe("/user/queue/lobby/updated", LobbyDTO.serializer()) - suspend fun awaitGameStart(gameId: Long): PlayerTurnInfo { - val startEvents = stompSession.subscribe("/user/queue/lobby/$gameId/started", PlayerTurnInfo.serializer()) - return startEvents.first() - } + suspend fun watchGameStarted(): Flow = + stompSession.subscribe("/user/queue/lobby/started", PlayerTurnInfo.serializer()) suspend fun startGame() { stompSession.sendEmptyMsg("/app/lobby/startGame") -- cgit