diff options
author | Ilion Beyst <ilion.beyst@gmail.com> | 2022-09-23 21:34:57 +0200 |
---|---|---|
committer | Ilion Beyst <ilion.beyst@gmail.com> | 2022-09-23 21:34:57 +0200 |
commit | a1d81ac774c0ae52f155cd764fd74fd1ba928a5f (patch) | |
tree | f0d4c7fda3f09fcc824795100b045d456baeecec /planetwars-matchrunner/src/pw_match.rs | |
parent | 8f3621813e44df2dace49a6400cfe870bc3778ea (diff) | |
download | planetwars.dev-a1d81ac774c0ae52f155cd764fd74fd1ba928a5f.tar.xz planetwars.dev-a1d81ac774c0ae52f155cd764fd74fd1ba928a5f.zip |
ensure bots cleanly stop before a match completes
Diffstat (limited to 'planetwars-matchrunner/src/pw_match.rs')
-rw-r--r-- | planetwars-matchrunner/src/pw_match.rs | 5 |
1 files changed, 4 insertions, 1 deletions
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<Vec<u8>>)> { |