aboutsummaryrefslogtreecommitdiff
path: root/planetwars-matchrunner/src/pw_match.rs
diff options
context:
space:
mode:
authorIlion Beyst <ilion.beyst@gmail.com>2022-02-23 21:08:56 +0100
committerIlion Beyst <ilion.beyst@gmail.com>2022-02-23 21:08:56 +0100
commit54b9694f0d0d7e853592317d60ad262ae8c13568 (patch)
treeb8842c884ee51cac97d6e39c68e3fd54f19f0bf8 /planetwars-matchrunner/src/pw_match.rs
parente15944622d3741137f443e7fa0b5d193b4ce28d9 (diff)
downloadplanetwars.dev-54b9694f0d0d7e853592317d60ad262ae8c13568.tar.xz
planetwars.dev-54b9694f0d0d7e853592317d60ad262ae8c13568.zip
implement matchlogger
Diffstat (limited to 'planetwars-matchrunner/src/pw_match.rs')
-rw-r--r--planetwars-matchrunner/src/pw_match.rs10
1 files changed, 6 insertions, 4 deletions
diff --git a/planetwars-matchrunner/src/pw_match.rs b/planetwars-matchrunner/src/pw_match.rs
index 25f849e..c114d78 100644
--- a/planetwars-matchrunner/src/pw_match.rs
+++ b/planetwars-matchrunner/src/pw_match.rs
@@ -1,3 +1,5 @@
+use crate::match_log::MatchLogMessage;
+
use super::match_context::{MatchCtx, RequestResult};
use futures::stream::futures_unordered::FuturesUnordered;
use futures::{FutureExt, StreamExt};
@@ -44,16 +46,16 @@ impl PwMatch {
for (player_id, turn) in player_messages {
let res = self.execute_action(player_id, turn);
if let Some(err) = action_errors(res) {
- let info_str = serde_json::to_string(&err).unwrap();
- println!("player {}: {}", player_id, info_str);
+ let _info_str = serde_json::to_string(&err).unwrap();
+ // TODO
+ // println!("player {}: {}", player_id, info_str);
}
}
self.match_state.step();
// Log state
let state = self.match_state.serialize_state();
- self.match_ctx
- .log_string(serde_json::to_string(&state).unwrap());
+ self.match_ctx.log(MatchLogMessage::GameState(state));
}
}