summaryrefslogtreecommitdiff
path: root/sw-server/src/main/kotlin
diff options
context:
space:
mode:
Diffstat (limited to 'sw-server/src/main/kotlin')
-rw-r--r--sw-server/src/main/kotlin/org/luxons/sevenwonders/server/controllers/GameController.kt2
-rw-r--r--sw-server/src/main/kotlin/org/luxons/sevenwonders/server/controllers/LobbyController.kt1
2 files changed, 3 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 60307962..bd6e300e 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
@@ -6,6 +6,7 @@ import org.luxons.sevenwonders.model.api.actions.PrepareMoveAction
import org.luxons.sevenwonders.model.api.wrap
import org.luxons.sevenwonders.model.cards.PreparedCard
import org.luxons.sevenwonders.model.hideHandsAndWaitForReadiness
+import org.luxons.sevenwonders.server.api.toDTO
import org.luxons.sevenwonders.server.lobby.Player
import org.luxons.sevenwonders.server.repositories.LobbyRepository
import org.luxons.sevenwonders.server.repositories.PlayerRepository
@@ -100,6 +101,7 @@ class GameController(
if (game.endOfGameReached()) {
logger.info("Game {}: end of game, displaying score board", game.id)
player.lobby.setEndOfGame()
+ template.convertAndSend("/topic/games", GameListEvent.CreateOrUpdate(lobby.toDTO()).wrap())
}
} else {
template.convertAndSendToUser(player.username, "/queue/game/preparedMove", action.move)
diff --git a/sw-server/src/main/kotlin/org/luxons/sevenwonders/server/controllers/LobbyController.kt b/sw-server/src/main/kotlin/org/luxons/sevenwonders/server/controllers/LobbyController.kt
index f2124009..5c2d4dd6 100644
--- a/sw-server/src/main/kotlin/org/luxons/sevenwonders/server/controllers/LobbyController.kt
+++ b/sw-server/src/main/kotlin/org/luxons/sevenwonders/server/controllers/LobbyController.kt
@@ -191,6 +191,7 @@ class LobbyController(
val player = lobby.getPlayers()[it.playerIndex]
template.convertAndSendToUser(player.username, "/queue/lobby/started", it)
}
+ template.convertAndSend("/topic/games", GameListEvent.CreateOrUpdate(lobby.toDTO()).wrap())
}
private fun Lobby.initializePlayersReadyState() {
bgstack15