aboutsummaryrefslogtreecommitdiff
path: root/planetwars-matchrunner/src/pw_match.rs
diff options
context:
space:
mode:
authorIlion Beyst <ilion.beyst@gmail.com>2022-09-23 21:34:57 +0200
committerIlion Beyst <ilion.beyst@gmail.com>2022-09-23 21:34:57 +0200
commita1d81ac774c0ae52f155cd764fd74fd1ba928a5f (patch)
treef0d4c7fda3f09fcc824795100b045d456baeecec /planetwars-matchrunner/src/pw_match.rs
parent8f3621813e44df2dace49a6400cfe870bc3778ea (diff)
downloadplanetwars.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.rs5
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>>)> {