From 24d15bc170c1e40d051d8a12b0f8066b3bd63ac4 Mon Sep 17 00:00:00 2001 From: zawedcvg Date: Fri, 27 Dec 2024 07:01:59 +0400 Subject: [PATCH] add PolarisOutpost map --- ranked/parser/Cargo.toml | 2 +- ranked/parser/src/inserting_info.rs | 2 ++ ranked/parser/src/parser.rs | 6 +++++- 3 files changed, 8 insertions(+), 2 deletions(-) diff --git a/ranked/parser/Cargo.toml b/ranked/parser/Cargo.toml index b3e3391..feb3c06 100644 --- a/ranked/parser/Cargo.toml +++ b/ranked/parser/Cargo.toml @@ -7,7 +7,7 @@ edition = "2021" chrono = "0.4.38" regex = "1.10.5" tokio = { version = "1.38.0", features = ["full"] } -sqlx = { version = "0.7", features = [ "runtime-tokio", "tls-rustls", "postgres"] } +sqlx = { version = "0.7", features = ["runtime-tokio", "tls-rustls", "postgres"] } dotenv = "0.15.0" futures = "0.3.30" rev_lines = "0.3.0" diff --git a/ranked/parser/src/inserting_info.rs b/ranked/parser/src/inserting_info.rs index 0b6fe32..5ffe5f0 100644 --- a/ranked/parser/src/inserting_info.rs +++ b/ranked/parser/src/inserting_info.rs @@ -409,6 +409,7 @@ fn get_faction_id(faction: &Factions) -> i32 { async fn insert_into_match(game: &Game, pool: Pool) -> i32 { debug!("Something started for insert into match"); + //TODO make it so trhat this part is automatically generated let maps_id = HashMap::from([ (Maps::NarakaCity, 1), (Maps::MonumentValley, 2), @@ -417,6 +418,7 @@ async fn insert_into_match(game: &Game, pool: Pool) -> i32 { (Maps::GreatErg, 5), (Maps::TheMaw, 6), (Maps::CrimsonPeak, 7), + (Maps::NorthPolarCap, 7), ]); let modes_id = HashMap::from([ (Modes::SolVsAlien, 0), diff --git a/ranked/parser/src/parser.rs b/ranked/parser/src/parser.rs index a669e43..e175370 100644 --- a/ranked/parser/src/parser.rs +++ b/ranked/parser/src/parser.rs @@ -168,7 +168,8 @@ pub enum Maps { Badlands, GreatErg, TheMaw, - CrimsonPeak + CrimsonPeak, + NorthPolarCap } const TIER_ONE_UNITS: &[&str] = &[ @@ -912,6 +913,8 @@ impl Game { self.map = Maps::TheMaw; } else if map_str == "CrimsonPeak" { self.map = Maps::CrimsonPeak; + } else if map_str == "NorthPolarCap" { + self.map = Maps::NorthPolarCap; } else { error!("Map {map_str} not found. Exiting parsing."); panic!(); @@ -1047,6 +1050,7 @@ mod tests { #[test] fn human_vs_human_single_file() { let game = checking_file(Path::new("./test_stuff/some.log")); + println!("{:#?}", game.players); assert_eq!(game.match_type, Modes::CentauriVsSol); assert_eq!(game.winning_team, Factions::Centauri); assert_eq!(game.get_player_vec().len(), 20);