feat(server): finish updating for 6.2

This commit is contained in:
Anna 2022-08-25 17:09:30 -04:00
parent 170f5f7b20
commit 5d92a6140f
3 changed files with 44 additions and 9 deletions

View File

@ -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)) Cow::from(format!("{:?}", category))
} }
@ -196,6 +197,16 @@ mod old {
high_end: false, high_end: false,
content_kind: ContentKind::Trials, 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 { 143 => DutyInfo {
name: LocalisedText { name: LocalisedText {
en: "The Feast (4 on 4 - Training)", en: "The Feast (4 on 4 - Training)",
@ -316,6 +327,16 @@ mod old {
high_end: true, high_end: true,
content_kind: ContentKind::Trials, 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<u32, RouletteInfo> = maplit::hashmap! { pub static ref OLD_ROULETTES: HashMap<u32, RouletteInfo> = maplit::hashmap! {

View File

@ -36,7 +36,7 @@ pub enum ContentKind {
CustomDeliveries = 25, CustomDeliveries = 25,
Eureka = 26, Eureka = 26,
UltimateRaids = 28, UltimateRaids = 28,
V&CDungeonFinder = 30, VCDungeonFinder = 30,
Other(u32), Other(u32),
} }
@ -67,7 +67,7 @@ impl ContentKind {
25 => Self::CustomDeliveries, 25 => Self::CustomDeliveries,
26 => Self::Eureka, 26 => Self::Eureka,
28 => Self::UltimateRaids, 28 => Self::UltimateRaids,
30 => Self::V&CDungeonFinder, 30 => Self::VCDungeonFinder,
x => Self::Other(x), x => Self::Other(x),
} }
} }
@ -98,7 +98,7 @@ impl ContentKind {
Self::CustomDeliveries => 25, Self::CustomDeliveries => 25,
Self::Eureka => 26, Self::Eureka => 26,
Self::UltimateRaids => 28, Self::UltimateRaids => 28,
Self::V&CDungeonFinder => 30, Self::VCDungeonFinder => 30,
Self::Other(x) => x, Self::Other(x) => x,
} }
} }

View File

@ -1,18 +1,17 @@
mod stats;
use std::{ use std::{
cmp::Ordering, cmp::Ordering,
convert::Infallible, convert::Infallible,
sync::Arc, sync::Arc,
time::Duration, time::Duration,
}; };
use anyhow::{Result, Context};
use anyhow::{Context, Result};
use chrono::Utc; use chrono::Utc;
use mongodb::{ use mongodb::{
bson::doc,
Client as MongoClient, Client as MongoClient,
Collection, Collection,
IndexModel, IndexModel,
bson::doc,
options::{IndexOptions, UpdateOptions}, options::{IndexOptions, UpdateOptions},
results::UpdateResult, results::UpdateResult,
}; };
@ -20,10 +19,11 @@ use tokio::sync::RwLock;
use tokio_stream::StreamExt; use tokio_stream::StreamExt;
use warp::{ use warp::{
Filter, Filter,
Reply,
filters::BoxedFilter, filters::BoxedFilter,
http::Uri, http::Uri,
Reply,
}; };
use crate::{ use crate::{
config::Config, config::Config,
ffxiv::Language, ffxiv::Language,
@ -34,6 +34,8 @@ use crate::{
template::stats::StatsTemplate, template::stats::StatsTemplate,
}; };
mod stats;
pub async fn start(config: Arc<Config>) -> Result<()> { pub async fn start(config: Arc<Config>) -> Result<()> {
let state = State::new(Arc::clone(&config)).await?; let state = State::new(Arc::clone(&config)).await?;
@ -448,7 +450,19 @@ fn contribute_multiple(state: Arc<State>) -> BoxedFilter<(impl Reply, )> {
warp::post().and(route).boxed() warp::post().and(route).boxed()
} }
async fn insert_listing(state: &State, listing: PartyFinderListing) -> mongodb::error::Result<UpdateResult> { async fn insert_listing(state: &State, mut listing: PartyFinderListing) -> mongodb::error::Result<UpdateResult> {
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() let opts = UpdateOptions::builder()
.upsert(true) .upsert(true)
.build(); .build();