summaryrefslogtreecommitdiff
path: root/sw-server
diff options
context:
space:
mode:
authorJoffrey Bion <joffrey.bion@booking.com>2020-03-19 20:08:42 +0100
committerJoffrey Bion <joffrey.bion@booking.com>2020-03-19 20:09:37 +0100
commita0455f9d04465720653c1a0fe137326468acc578 (patch)
tree69883855286494e6a84faf627f27b63a6a57e9ac /sw-server
parentChange deprecated gradle configuration compile() to implementation() (diff)
downloadseven-wonders-a0455f9d04465720653c1a0fe137326468acc578.tar.gz
seven-wonders-a0455f9d04465720653c1a0fe137326468acc578.tar.bz2
seven-wonders-a0455f9d04465720653c1a0fe137326468acc578.zip
Upgrade to Krossbow 0.10.2 and use standard WS (not SockJS)
Diffstat (limited to 'sw-server')
-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