summaryrefslogtreecommitdiff
path: root/sw-server
diff options
context:
space:
mode:
authorJoffrey Bion <joffrey.bion@booking.com>2020-04-04 19:11:01 +0200
committerJoffrey Bion <joffrey.bion@booking.com>2020-04-04 19:11:49 +0200
commit134199b98baf70e4b014f92ff5c082b247aa407c (patch)
treed811dd41d91291be061751f8f59bb64db5a91d03 /sw-server
parentAdd blueprintjs Overlay component (diff)
downloadseven-wonders-134199b98baf70e4b014f92ff5c082b247aa407c.tar.gz
seven-wonders-134199b98baf70e4b014f92ff5c082b247aa407c.tar.bz2
seven-wonders-134199b98baf70e4b014f92ff5c082b247aa407c.zip
Add a way to "unprepare" a move
Diffstat (limited to 'sw-server')
-rw-r--r--sw-server/src/main/kotlin/org/luxons/sevenwonders/server/controllers/GameController.kt10
1 files changed, 10 insertions, 0 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 5fd5f2e4..32359d58 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
@@ -80,6 +80,16 @@ class GameController @Autowired constructor(
return action.move
}
+ @MessageMapping("/game/unprepareMove")
+ fun unprepareMove(principal: Principal) {
+ val player = principal.player
+ val game = player.game
+ game.unprepareMove(player.index)
+ val preparedCard = PreparedCard(player.toDTO(), null)
+ logger.info("Game {}: player {} unprepared his move", game.id, principal.name)
+ sendPreparedCard(game.id, preparedCard)
+ }
+
private fun sendPlayerReady(gameId: Long, player: Player) =
template.convertAndSend("/topic/game/$gameId/playerReady", "\"${player.username}\"")
bgstack15