From 3be0cfa0ea61a3c56e0efc7169be5f3e0d7009d3 Mon Sep 17 00:00:00 2001 From: Ilion Beyst Date: Sun, 18 Sep 2022 13:00:32 +0200 Subject: log dispatches and timeouts --- planetwars-matchrunner/src/match_log.rs | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'planetwars-matchrunner/src/match_log.rs') diff --git a/planetwars-matchrunner/src/match_log.rs b/planetwars-matchrunner/src/match_log.rs index 087f2a9..27443df 100644 --- a/planetwars-matchrunner/src/match_log.rs +++ b/planetwars-matchrunner/src/match_log.rs @@ -6,6 +6,8 @@ use tokio::{fs::File, io::AsyncWriteExt}; use planetwars_rules::protocol::State; use tokio::sync::mpsc; +use crate::pw_match::PlayerCommand; + #[derive(Serialize, Deserialize, Debug)] #[serde(tag = "type")] pub enum MatchLogMessage { @@ -13,12 +15,19 @@ pub enum MatchLogMessage { GameState(State), #[serde(rename = "stderr")] StdErr(StdErrMessage), + #[serde(rename = "timeout")] + Timeout { player_id: u32 }, #[serde(rename = "bad_command")] BadCommand { player_id: u32, command: String, error: String, }, + #[serde(rename = "dispatches")] + Dispatches { + player_id: u32, + dispatches: Vec, + }, } #[derive(Serialize, Deserialize, Debug)] -- cgit v1.2.3