summaryrefslogtreecommitdiff
path: root/backend
diff options
context:
space:
mode:
authorJoffrey BION <joffrey.bion@gmail.com>2017-01-22 17:26:24 +0100
committerJoffrey BION <joffrey.bion@gmail.com>2017-01-22 17:26:35 +0100
commit97f847e1e534b9c57a4d39c4137f7cacd3e7e62c (patch)
treef86b422e9a41aaaeeb725ed96b52a1fe21a894a0 /backend
parentRemove handRotationDirection in PlayerTurnInfo (diff)
downloadseven-wonders-97f847e1e534b9c57a4d39c4137f7cacd3e7e62c.tar.gz
seven-wonders-97f847e1e534b9c57a4d39c4137f7cacd3e7e62c.tar.bz2
seven-wonders-97f847e1e534b9c57a4d39c4137f7cacd3e7e62c.zip
Fix subscription path for prepared cards and turns
Diffstat (limited to 'backend')
-rw-r--r--backend/src/main/java/org/luxons/sevenwonders/controllers/GameController.java8
1 files changed, 2 insertions, 6 deletions
diff --git a/backend/src/main/java/org/luxons/sevenwonders/controllers/GameController.java b/backend/src/main/java/org/luxons/sevenwonders/controllers/GameController.java
index 52da8e0c..3f3a02db 100644
--- a/backend/src/main/java/org/luxons/sevenwonders/controllers/GameController.java
+++ b/backend/src/main/java/org/luxons/sevenwonders/controllers/GameController.java
@@ -4,7 +4,6 @@ import java.security.Principal;
import org.luxons.sevenwonders.actions.PrepareCardAction;
import org.luxons.sevenwonders.game.Game;
-import org.luxons.sevenwonders.game.Player;
import org.luxons.sevenwonders.game.api.PlayerTurnInfo;
import org.luxons.sevenwonders.game.api.PreparedCard;
import org.luxons.sevenwonders.repositories.GameRepository;
@@ -46,16 +45,13 @@ public class GameController {
}
private void sendPreparedCard(PreparedCard preparedCard, Game game) {
- for (Player player : game.getPlayers()) {
- String username = player.getUsername();
- template.convertAndSendToUser(username, "/topic/game/" + game.getId() + "/prepared", preparedCard);
- }
+ template.convertAndSend("/topic/game/" + game.getId() + "/prepared", preparedCard);
}
private void sendTurnInfo(Game game) {
for (PlayerTurnInfo turnInfo : game.getCurrentTurnInfo()) {
String username = turnInfo.getPlayer().getUsername();
- template.convertAndSendToUser(username, "/topic/game/" + game.getId() + "/turn", turnInfo);
+ template.convertAndSendToUser(username, "/queue/game/" + game.getId() + "/turn", turnInfo);
}
}
}
bgstack15