Skip to content

Commit

Permalink
add PolarisOutpost map
Browse files Browse the repository at this point in the history
  • Loading branch information
zawedcvg committed Dec 27, 2024
1 parent 58604d6 commit 24d15bc
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 2 deletions.
2 changes: 1 addition & 1 deletion ranked/parser/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
2 changes: 2 additions & 0 deletions ranked/parser/src/inserting_info.rs
Original file line number Diff line number Diff line change
Expand Up @@ -409,6 +409,7 @@ fn get_faction_id(faction: &Factions) -> i32 {

async fn insert_into_match(game: &Game, pool: Pool<Postgres>) -> 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),
Expand All @@ -417,6 +418,7 @@ async fn insert_into_match(game: &Game, pool: Pool<Postgres>) -> i32 {
(Maps::GreatErg, 5),
(Maps::TheMaw, 6),
(Maps::CrimsonPeak, 7),
(Maps::NorthPolarCap, 7),
]);
let modes_id = HashMap::from([
(Modes::SolVsAlien, 0),
Expand Down
6 changes: 5 additions & 1 deletion ranked/parser/src/parser.rs
Original file line number Diff line number Diff line change
Expand Up @@ -168,7 +168,8 @@ pub enum Maps {
Badlands,
GreatErg,
TheMaw,
CrimsonPeak
CrimsonPeak,
NorthPolarCap
}

const TIER_ONE_UNITS: &[&str] = &[
Expand Down Expand Up @@ -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!();
Expand Down Expand Up @@ -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);
Expand Down

0 comments on commit 24d15bc

Please sign in to comment.