summaryrefslogtreecommitdiff
path: root/sw-server/src/main
diff options
context:
space:
mode:
Diffstat (limited to 'sw-server/src/main')
-rw-r--r--sw-server/src/main/kotlin/org/luxons/sevenwonders/server/controllers/AutoGameController.kt5
-rw-r--r--sw-server/src/main/kotlin/org/luxons/sevenwonders/server/controllers/LobbyController.kt4
2 files changed, 4 insertions, 5 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 c94d49da..bfdef6e9 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,9 +14,8 @@ 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.Duration.Companion.minutes
import kotlin.time.measureTimedValue
-import kotlin.time.minutes
import kotlin.time.toJavaDuration
/**
@@ -33,7 +32,7 @@ class AutoGameController(
val client = SevenWondersClient()
val serverUrl = "ws://localhost:$serverPort"
- val lastTurn = withTimeout(Duration.minutes(5)) {
+ val lastTurn = withTimeout(5.minutes) {
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 788430c8..41b38d72 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,7 +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.Duration.Companion.milliseconds
/**
* Handles actions in the game's lobby. The lobby is the place where players gather before a game.
@@ -165,7 +165,7 @@ class LobbyController(
}
if (result == null) {
meterRegistry.counter("bot.timeout", lobby.playerCountsTags()).increment()
- val timeoutDuration = Duration.milliseconds(action.globalBotTimeoutMillis)
+ val timeoutDuration = action.globalBotTimeoutMillis.milliseconds
logger.error("Bot {} timed out after {}", action.botDisplayName, timeoutDuration)
bot.disconnect()
}
bgstack15