summaryrefslogtreecommitdiff
path: root/sw-ui/src/main/kotlin/org
diff options
context:
space:
mode:
authorjoffrey-bion <joffrey.bion@gmail.com>2021-02-17 02:34:18 +0100
committerjoffrey-bion <joffrey.bion@gmail.com>2021-02-17 02:34:18 +0100
commite48dc809a95a3ac813c4da8798c9e57cbb6a32b6 (patch)
treeaa5219552150be13cb0d2fcbc340313260ba928d /sw-ui/src/main/kotlin/org
parentAdd prepared card indicator (diff)
downloadseven-wonders-e48dc809a95a3ac813c4da8798c9e57cbb6a32b6.tar.gz
seven-wonders-e48dc809a95a3ac813c4da8798c9e57cbb6a32b6.tar.bz2
seven-wonders-e48dc809a95a3ac813c4da8798c9e57cbb6a32b6.zip
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.
Diffstat (limited to 'sw-ui/src/main/kotlin/org')
-rw-r--r--sw-ui/src/main/kotlin/org/luxons/sevenwonders/ui/redux/sagas/RouteBasedSagas.kt1
1 files changed, 1 insertions, 0 deletions
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")
}
bgstack15