summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--sw-server/src/main/kotlin/org/luxons/sevenwonders/server/controllers/GameController.kt6
-rw-r--r--sw-ui/src/main/kotlin/org/luxons/sevenwonders/ui/redux/Reducers.kt3
2 files changed, 5 insertions, 4 deletions
diff --git a/sw-server/src/main/kotlin/org/luxons/sevenwonders/server/controllers/GameController.kt b/sw-server/src/main/kotlin/org/luxons/sevenwonders/server/controllers/GameController.kt
index dc5dffdb..e86e7b54 100644
--- a/sw-server/src/main/kotlin/org/luxons/sevenwonders/server/controllers/GameController.kt
+++ b/sw-server/src/main/kotlin/org/luxons/sevenwonders/server/controllers/GameController.kt
@@ -62,8 +62,7 @@ class GameController(
* the connected user's information
*/
@MessageMapping("/game/prepareMove")
- @SendToUser("/queue/game/preparedMove")
- fun prepareMove(action: PrepareMoveAction, principal: Principal): PlayerMove {
+ fun prepareMove(action: PrepareMoveAction, principal: Principal) {
val player = principal.player
val game = player.game
val preparedCardBack = game.prepareMove(player.index, action.move)
@@ -78,8 +77,9 @@ class GameController(
if (game.endOfGameReached()) {
player.lobby.setEndOfGame()
}
+ } else {
+ template.convertAndSendToUser(player.username, "/queue/game/preparedMove", action.move)
}
- return action.move
}
@MessageMapping("/game/unprepareMove")
diff --git a/sw-ui/src/main/kotlin/org/luxons/sevenwonders/ui/redux/Reducers.kt b/sw-ui/src/main/kotlin/org/luxons/sevenwonders/ui/redux/Reducers.kt
index c21f6deb..1ff0d0ec 100644
--- a/sw-ui/src/main/kotlin/org/luxons/sevenwonders/ui/redux/Reducers.kt
+++ b/sw-ui/src/main/kotlin/org/luxons/sevenwonders/ui/redux/Reducers.kt
@@ -78,7 +78,8 @@ private fun gameStateReducer(gameState: GameState?, action: RAction): GameState?
})
is TurnInfoEvent -> gameState?.copy(
players = gameState.players.map { p -> p.copy(isReady = false) },
- turnInfo = action.turnInfo
+ turnInfo = action.turnInfo,
+ currentPreparedMove = null
)
else -> gameState
}
bgstack15