From b4cb5e9ed50d1c94b78cd29485f37c5cd184bc9e Mon Sep 17 00:00:00 2001 From: joffrey-bion Date: Sat, 12 Dec 2020 02:41:33 +0100 Subject: Delete game at the end of a game --- .../src/main/kotlin/org/luxons/sevenwonders/bot/SevenWondersBot.kt | 5 ++++- 1 file changed, 4 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 01106d21..87ba7983 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 @@ -44,7 +44,10 @@ class SevenWondersBot( session.watchTurns() .onStart { emit(firstTurn) } .takeWhile { it.action != Action.WATCH_SCORE } - .onCompletion { session.disconnect() } + .onCompletion { + session.leaveGame() + session.disconnect() + } .collect { turn -> botDelay() session.playTurn(turn) -- cgit