From 747911a542b5971de182e4491393a8f53eb8e9a8 Mon Sep 17 00:00:00 2001 From: joffrey-bion Date: Thu, 10 Dec 2020 01:30:51 +0100 Subject: Decouple some sagas from routes Resolves: https://github.com/joffrey-bion/seven-wonders/issues/13 --- sw-bot/src/main/kotlin/org/luxons/sevenwonders/bot/SevenWondersBot.kt | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'sw-bot') diff --git a/sw-bot/src/main/kotlin/org/luxons/sevenwonders/bot/SevenWondersBot.kt b/sw-bot/src/main/kotlin/org/luxons/sevenwonders/bot/SevenWondersBot.kt index 48a96f08..01106d21 100644 --- a/sw-bot/src/main/kotlin/org/luxons/sevenwonders/bot/SevenWondersBot.kt +++ b/sw-bot/src/main/kotlin/org/luxons/sevenwonders/bot/SevenWondersBot.kt @@ -9,6 +9,7 @@ import kotlinx.coroutines.flow.takeWhile import kotlinx.coroutines.withTimeout import org.luxons.sevenwonders.client.SevenWondersClient import org.luxons.sevenwonders.client.SevenWondersSession +import org.luxons.sevenwonders.client.joinGameAndWaitLobby import org.luxons.sevenwonders.model.Action import org.luxons.sevenwonders.model.MoveType import org.luxons.sevenwonders.model.PlayerMove @@ -37,7 +38,7 @@ class SevenWondersBot( suspend fun play(serverUrl: String, gameId: Long) = withTimeout(botConfig.globalTimeout) { val session = client.connect(serverUrl) session.chooseName(displayName, Icon("desktop")) - session.joinGame(gameId) + session.joinGameAndWaitLobby(gameId) val firstTurn = session.awaitGameStart(gameId) session.watchTurns() -- cgit