summaryrefslogtreecommitdiff
path: root/sw-server/src/main/kotlin/org
diff options
context:
space:
mode:
authorJoffrey Bion <joffrey.bion@gmail.com>2021-09-07 00:30:02 +0200
committerJoffrey Bion <joffrey.bion@gmail.com>2021-09-07 02:41:42 +0200
commit0ab3594568c36f64df480cfaccd9e7f7692bfb10 (patch)
treece9ca956a51c768a18f3ab1c4053fe15ac359d86 /sw-server/src/main/kotlin/org
parentUse JDK 15 because of Gradle issue on 16 (diff)
downloadseven-wonders-0ab3594568c36f64df480cfaccd9e7f7692bfb10.tar.gz
seven-wonders-0ab3594568c36f64df480cfaccd9e7f7692bfb10.tar.bz2
seven-wonders-0ab3594568c36f64df480cfaccd9e7f7692bfb10.zip
Upgrade Kotlin, Kotlin/React, and Krossbow versions
Diffstat (limited to 'sw-server/src/main/kotlin/org')
-rw-r--r--sw-server/src/main/kotlin/org/luxons/sevenwonders/server/controllers/AutoGameController.kt3
-rw-r--r--sw-server/src/main/kotlin/org/luxons/sevenwonders/server/controllers/LobbyController.kt3
2 files changed, 4 insertions, 2 deletions
diff --git a/sw-server/src/main/kotlin/org/luxons/sevenwonders/server/controllers/AutoGameController.kt b/sw-server/src/main/kotlin/org/luxons/sevenwonders/server/controllers/AutoGameController.kt
index b6d66e4b..c94d49da 100644
--- a/sw-server/src/main/kotlin/org/luxons/sevenwonders/server/controllers/AutoGameController.kt
+++ b/sw-server/src/main/kotlin/org/luxons/sevenwonders/server/controllers/AutoGameController.kt
@@ -14,6 +14,7 @@ import org.springframework.web.bind.annotation.PostMapping
import org.springframework.web.bind.annotation.RequestBody
import org.springframework.web.bind.annotation.RestController
import java.security.Principal
+import kotlin.time.Duration
import kotlin.time.measureTimedValue
import kotlin.time.minutes
import kotlin.time.toJavaDuration
@@ -32,7 +33,7 @@ class AutoGameController(
val client = SevenWondersClient()
val serverUrl = "ws://localhost:$serverPort"
- val lastTurn = withTimeout(5.minutes) {
+ val lastTurn = withTimeout(Duration.minutes(5)) {
val (lastTurn, duration) = measureTimedValue {
val otherBotNames = List(action.nbPlayers - 1) { "JoinerBot${it + 1}" }
val owner = client.connectBot(serverUrl, "OwnerBot", action.config)
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 9fb1603a..10a94579 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
@@ -27,6 +27,7 @@ import org.springframework.messaging.simp.SimpMessageSendingOperations
import org.springframework.stereotype.Controller
import org.springframework.validation.annotation.Validated
import java.security.Principal
+import kotlin.time.Duration
import kotlin.time.milliseconds
/**
@@ -165,7 +166,7 @@ class LobbyController(
}
if (result == null) {
meterRegistry.counter("bot.timeout", lobby.playerCountsTags()).increment()
- val timeoutDuration = action.globalBotTimeoutMillis.milliseconds
+ val timeoutDuration = Duration.milliseconds(action.globalBotTimeoutMillis)
logger.error("Bot {} timed out after {}", action.botDisplayName, timeoutDuration)
bot.disconnect()
}
bgstack15