summaryrefslogtreecommitdiff
path: root/sw-server/src
diff options
context:
space:
mode:
Diffstat (limited to 'sw-server/src')
-rw-r--r--sw-server/src/main/kotlin/org/luxons/sevenwonders/server/config/WebSocketConfig.kt1
-rw-r--r--sw-server/src/test/kotlin/org/luxons/sevenwonders/server/SevenWondersTest.kt16
2 files changed, 8 insertions, 9 deletions
diff --git a/sw-server/src/main/kotlin/org/luxons/sevenwonders/server/config/WebSocketConfig.kt b/sw-server/src/main/kotlin/org/luxons/sevenwonders/server/config/WebSocketConfig.kt
index 72312b70..8bff83da 100644
--- a/sw-server/src/main/kotlin/org/luxons/sevenwonders/server/config/WebSocketConfig.kt
+++ b/sw-server/src/main/kotlin/org/luxons/sevenwonders/server/config/WebSocketConfig.kt
@@ -30,7 +30,6 @@ class WebSocketConfig @Autowired constructor(private val topicSubscriptionInterc
registry.addEndpoint(SEVEN_WONDERS_WS_ENDPOINT)
.setHandshakeHandler(handshakeHandler())
.setAllowedOrigins("*") // to allow any client to use the API
- .withSockJS()
}
@Bean
diff --git a/sw-server/src/test/kotlin/org/luxons/sevenwonders/server/SevenWondersTest.kt b/sw-server/src/test/kotlin/org/luxons/sevenwonders/server/SevenWondersTest.kt
index 7b996680..ab947609 100644
--- a/sw-server/src/test/kotlin/org/luxons/sevenwonders/server/SevenWondersTest.kt
+++ b/sw-server/src/test/kotlin/org/luxons/sevenwonders/server/SevenWondersTest.kt
@@ -67,7 +67,7 @@ class SevenWondersTest {
session2.joinGame(lobby.id)
val outsiderSession = newPlayer("Outsider")
- val (started) = outsiderSession.watchGameStart(lobby.id)
+ val started = outsiderSession.watchGameStart(lobby.id).messages
ownerSession.startGame()
val nothing = withTimeoutOrNull(30) { started.receive() }
@@ -94,7 +94,7 @@ class SevenWondersTest {
fun createGame_seenByConnectedPlayers() {
runBlocking {
val otherSession = newPlayer("OtherPlayer")
- val (games) = otherSession.watchGames()
+ val games = otherSession.watchGames().messages
var receivedLobbies = withTimeout(500) { games.receive() }
assertNotNull(receivedLobbies)
@@ -126,18 +126,18 @@ class SevenWondersTest {
val session3 = newPlayer("Player3")
session3.joinGame(lobby.id)
- val (gameStart1) = session1.watchGameStart(lobby.id)
- val (gameStart2) = session2.watchGameStart(lobby.id)
- val (gameStart3) = session3.watchGameStart(lobby.id)
+ val gameStart1 = session1.watchGameStart(lobby.id).messages
+ val gameStart2 = session2.watchGameStart(lobby.id).messages
+ val gameStart3 = session3.watchGameStart(lobby.id).messages
session1.startGame()
withTimeout(500) { gameStart1.receive() }
withTimeout(500) { gameStart2.receive() }
withTimeout(500) { gameStart3.receive() }
- val (turns1) = session1.watchTurns()
- val (turns2) = session2.watchTurns()
- val (turns3) = session3.watchTurns()
+ val turns1 = session1.watchTurns().messages
+ val turns2 = session2.watchTurns().messages
+ val turns3 = session3.watchTurns().messages
session1.sayReady()
session2.sayReady()
session3.sayReady()
bgstack15