From a1d81ac774c0ae52f155cd764fd74fd1ba928a5f Mon Sep 17 00:00:00 2001 From: Ilion Beyst Date: Fri, 23 Sep 2022 21:34:57 +0200 Subject: ensure bots cleanly stop before a match completes --- planetwars-matchrunner/src/pw_match.rs | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'planetwars-matchrunner/src/pw_match.rs') diff --git a/planetwars-matchrunner/src/pw_match.rs b/planetwars-matchrunner/src/pw_match.rs index 4af215e..c5650f7 100644 --- a/planetwars-matchrunner/src/pw_match.rs +++ b/planetwars-matchrunner/src/pw_match.rs @@ -39,7 +39,7 @@ impl PwMatch { } } - pub async fn run(&mut self) { + pub async fn run(mut self) -> PlanetWars { // log initial state self.log_game_state(); @@ -53,6 +53,9 @@ impl PwMatch { self.match_state.step(); self.log_game_state(); } + + self.match_ctx.shutdown().await; + self.match_state } async fn prompt_players(&mut self) -> Vec<(usize, RequestResult>)> { -- cgit v1.2.3