From e48dc809a95a3ac813c4da8798c9e57cbb6a32b6 Mon Sep 17 00:00:00 2001 From: joffrey-bion Date: Wed, 17 Feb 2021 02:34:18 +0100 Subject: Use automatic sayReady call to synchronize STOMP subscriptions before first turn We currently miss the preparedCard event from bots if they are too fast, because the server sends the first turn to everyone without knowing if all clients have properly subscribed to events. We now use sayReady to indicate to the server that all subscriptions have been made. --- .../kotlin/org/luxons/sevenwonders/ui/redux/sagas/RouteBasedSagas.kt | 1 + 1 file changed, 1 insertion(+) (limited to 'sw-ui/src/main/kotlin') diff --git a/sw-ui/src/main/kotlin/org/luxons/sevenwonders/ui/redux/sagas/RouteBasedSagas.kt b/sw-ui/src/main/kotlin/org/luxons/sevenwonders/ui/redux/sagas/RouteBasedSagas.kt index 1970bc08..06b33e13 100644 --- a/sw-ui/src/main/kotlin/org/luxons/sevenwonders/ui/redux/sagas/RouteBasedSagas.kt +++ b/sw-ui/src/main/kotlin/org/luxons/sevenwonders/ui/redux/sagas/RouteBasedSagas.kt @@ -53,6 +53,7 @@ suspend fun SwSagaContext.gameSaga(session: SevenWondersSession) { session.watchPreparedCards(game.id).map { PreparedCardEvent(it) }.dispatchAllIn(this) session.watchOwnMoves().map { PreparedMoveEvent(it) }.dispatchAllIn(this) session.watchTurns().map { TurnInfoEvent(it) }.dispatchAllIn(this) + session.sayReady() } console.log("End of game saga") } -- cgit