diff --git a/server/src/ffxiv.rs b/server/src/ffxiv.rs index 4945223..851e2c8 100644 --- a/server/src/ffxiv.rs +++ b/server/src/ffxiv.rs @@ -172,6 +172,7 @@ pub fn duty_name<'a>(duty_type: DutyType, category: DutyCategory, duty: u16, lan _ => {} } + eprintln!("unknown type/category/duty: {:?}/{:?}/{}", duty_type, category, duty); Cow::from(format!("{:?}", category)) } @@ -196,6 +197,16 @@ mod old { high_end: false, content_kind: ContentKind::Trials, }, + 83 => DutyInfo { + name: LocalisedText { + en: "The Steps of Faith", + ja: "皇都イシュガルド防衛戦", + de: "Der Schicksalsweg", + fr: "Le Siège de la sainte Cité d'Ishgard", + }, + high_end: false, + content_kind: ContentKind::Trials, + }, 143 => DutyInfo { name: LocalisedText { en: "The Feast (4 on 4 - Training)", @@ -316,6 +327,16 @@ mod old { high_end: true, content_kind: ContentKind::Trials, }, + 821 => DutyInfo { + name: LocalisedText { + en: "Ultima's Bane (Unreal)", + ja: "幻アルテマウェポン破壊作戦", + de: "Traumprüfung - Ultima", + fr: "Le fléau d'Ultima (irréel)", + }, + high_end: true, + content_kind: ContentKind::Trials, + }, }; pub static ref OLD_ROULETTES: HashMap = maplit::hashmap! { diff --git a/server/src/ffxiv/duties.rs b/server/src/ffxiv/duties.rs index 17ddb95..59e403a 100644 --- a/server/src/ffxiv/duties.rs +++ b/server/src/ffxiv/duties.rs @@ -36,7 +36,7 @@ pub enum ContentKind { CustomDeliveries = 25, Eureka = 26, UltimateRaids = 28, - V&CDungeonFinder = 30, + VCDungeonFinder = 30, Other(u32), } @@ -67,7 +67,7 @@ impl ContentKind { 25 => Self::CustomDeliveries, 26 => Self::Eureka, 28 => Self::UltimateRaids, - 30 => Self::V&CDungeonFinder, + 30 => Self::VCDungeonFinder, x => Self::Other(x), } } @@ -98,7 +98,7 @@ impl ContentKind { Self::CustomDeliveries => 25, Self::Eureka => 26, Self::UltimateRaids => 28, - Self::V&CDungeonFinder => 30, + Self::VCDungeonFinder => 30, Self::Other(x) => x, } } diff --git a/server/src/web.rs b/server/src/web.rs index 29c6fa0..d55ab7a 100644 --- a/server/src/web.rs +++ b/server/src/web.rs @@ -1,18 +1,17 @@ -mod stats; - use std::{ cmp::Ordering, convert::Infallible, sync::Arc, time::Duration, }; -use anyhow::{Result, Context}; + +use anyhow::{Context, Result}; use chrono::Utc; use mongodb::{ + bson::doc, Client as MongoClient, Collection, IndexModel, - bson::doc, options::{IndexOptions, UpdateOptions}, results::UpdateResult, }; @@ -20,10 +19,11 @@ use tokio::sync::RwLock; use tokio_stream::StreamExt; use warp::{ Filter, - Reply, filters::BoxedFilter, http::Uri, + Reply, }; + use crate::{ config::Config, ffxiv::Language, @@ -34,6 +34,8 @@ use crate::{ template::stats::StatsTemplate, }; +mod stats; + pub async fn start(config: Arc) -> Result<()> { let state = State::new(Arc::clone(&config)).await?; @@ -448,7 +450,19 @@ fn contribute_multiple(state: Arc) -> BoxedFilter<(impl Reply, )> { warp::post().and(route).boxed() } -async fn insert_listing(state: &State, listing: PartyFinderListing) -> mongodb::error::Result { +async fn insert_listing(state: &State, mut listing: PartyFinderListing) -> mongodb::error::Result { + if listing.created_world >= 144 && listing.created_world <= 147 { + listing.created_world += 256; + } + + if listing.home_world >= 144 && listing.home_world <= 147 { + listing.home_world += 256; + } + + if listing.current_world >= 144 && listing.current_world <= 147 { + listing.current_world += 256; + } + let opts = UpdateOptions::builder() .upsert(true) .build();