diff --git a/.gitignore b/.gitignore index a1157c1..6b63123 100644 --- a/.gitignore +++ b/.gitignore @@ -4,9 +4,12 @@ # These are backup files generated by rustfmt **/*.rs.bk + .devenv* devenv.local.nix +# generated by samply rust profiler +profile.json # Added by cargo diff --git a/client_cli/src/main.rs b/client_cli/src/main.rs index 9b163eb..0e1bcb9 100644 --- a/client_cli/src/main.rs +++ b/client_cli/src/main.rs @@ -37,9 +37,6 @@ fn main() -> Result<()> { // Create an application. let mut app = App::new(args); - if app.should_quit { - println!("{}", app.display()); - } // Start the main loop. while !app.should_quit { @@ -49,6 +46,9 @@ fn main() -> Result<()> { app.input(input.trim()); } + // display app final state + println!("{}", app.display()); + Ok(()) } diff --git a/devenv.nix b/devenv.nix index 75f70f9..93db791 100644 --- a/devenv.nix +++ b/devenv.nix @@ -5,6 +5,10 @@ # env.GREET = "devenv"; packages = [ + + # dev tools + pkgs.samply # code profiler + # for bevy pkgs.alsaLib pkgs.udev diff --git a/justfile b/justfile index 5ca8d5c..8fe5fb7 100644 --- a/justfile +++ b/justfile @@ -10,3 +10,7 @@ runcli: RUST_LOG=info cargo run --bin=client_cli runclibots: RUST_LOG=info cargo run --bin=client_cli -- --bot dummy,dummy +profile: + echo '1' | sudo tee /proc/sys/kernel/perf_event_paranoid + cargo build --profile profiling + samply record ./target/profiling/client_cli --bot dummy,dummy diff --git a/store/src/game.rs b/store/src/game.rs index 43bda3e..0c42e1a 100644 --- a/store/src/game.rs +++ b/store/src/game.rs @@ -582,8 +582,6 @@ impl GameState { /// The reasons why a game could end #[derive(Debug, Clone, Copy, Serialize, PartialEq, Deserialize)] pub enum EndGameReason { - // In tic tac toe it doesn't make sense to keep playing when one of the players disconnect. - // Note that it might make sense to keep playing in some other game (like Team Fight Tactics for instance). PlayerLeft { player_id: PlayerId }, PlayerWon { winner: PlayerId }, }