diff --git a/rc_services_room/src/data/player_rank.rs b/rc_services_room/src/data/player_rank.rs index c44e397..fba3e71 100644 --- a/rc_services_room/src/data/player_rank.rs +++ b/rc_services_room/src/data/player_rank.rs @@ -2,6 +2,7 @@ use polariton::operation::{Typed, Dict, Arr}; use polariton::serdes::TypePrefix; pub struct PlayerRankStaticInfo { + pub sub_rank_count: i32, pub sub_rank_thresholds: Vec, } @@ -11,7 +12,7 @@ impl PlayerRankStaticInfo { key_ty: TypePrefix::Str, val_ty: TypePrefix::Any, items: vec![ - (Typed::Str("subRankCount".into()), Typed::Int(self.sub_rank_thresholds.len() as i32)), + (Typed::Str("subRankCount".into()), Typed::Int(self.sub_rank_count)), (Typed::Str("subRankThresholds".into()), Typed::Arr(Arr { ty: TypePrefix::Int, // int items: self.sub_rank_thresholds.iter().map(|x| Typed::Int(*x)).collect(), diff --git a/rc_services_room/src/operations/player_level.rs b/rc_services_room/src/operations/player_level.rs index 6ffa62a..83bdd61 100644 --- a/rc_services_room/src/operations/player_level.rs +++ b/rc_services_room/src/operations/player_level.rs @@ -13,8 +13,7 @@ pub(super) fn player_level_info_provider() -> SimpleFunc<3, crate::UserTy, impl // FIXME load this from config // these are interpolated by the client (Typed::Int(0), Typed::Int(0)), - // this should interpolate to display a level of 1337 - (Typed::Int(2674), Typed::Int(1)), + (Typed::Int(10), Typed::Int(10_000)), (Typed::Int(10_000), Typed::Int(i32::MAX / 2)), ] })); Ok(params.into()) diff --git a/rc_services_room/src/operations/player_rank.rs b/rc_services_room/src/operations/player_rank.rs index 2ee775c..da221f8 100644 --- a/rc_services_room/src/operations/player_rank.rs +++ b/rc_services_room/src/operations/player_rank.rs @@ -8,7 +8,7 @@ const PARAM_KEY: u8 = 80; pub(super) fn rank_provider() -> SimpleFunc<80, crate::UserTy, impl (Fn(ParameterTable, &crate::UserTy) -> Result) + Sync + Sync> { SimpleFunc::new(|params, _| { let mut params = params.to_dict(); - params.insert(PARAM_KEY, Typed::Int(3)); + params.insert(PARAM_KEY, Typed::Int(0)); Ok(params.into()) }) } @@ -19,7 +19,14 @@ pub(super) fn rank_static_provider() -> SimpleFunc<126, crate::UserTy, impl (Fn( SimpleFunc::new(|params, _| { let mut params = params.to_dict(); params.insert(STATIC_PARAM_KEY, PlayerRankStaticInfo { - sub_rank_thresholds: vec![1, 2, 3, 4, 5], + sub_rank_count: 5, + sub_rank_thresholds: vec![ + 0, 200, 500, 800, 1200, + 1600, 2000, 2500, 3000, 3500, + 4000, 6000, 8000, 10_000, 12_000, + 16_000, 20_000, 25_000, 30_000, 35_000, + 40_000, 50_000, 60_000, 70_000, 80_000, + ], }.as_transmissible()); Ok(params.into()) }) diff --git a/rc_services_room/src/operations/weapon_rating_static.rs b/rc_services_room/src/operations/weapon_rating_static.rs index 3080d1b..8e49b22 100644 --- a/rc_services_room/src/operations/weapon_rating_static.rs +++ b/rc_services_room/src/operations/weapon_rating_static.rs @@ -7,9 +7,33 @@ pub(super) fn weapon_rating_provider() -> SimpleFunc<127, crate::UserTy, impl (F SimpleFunc::new(|params, _| { let mut params = params.to_dict(); params.insert(PARAM_KEY, Typed::HashMap(vec![ - (Typed::Str("subRankCount".into()), Typed::Int(2)), + (Typed::Str("subRankCount".into()), Typed::Int(5)), (Typed::Str("subRankInterval".into()), Typed::Int(10)), (Typed::Str("gainsPerRank".into()), Typed::ObjArr(vec![ + Typed::Dict(Dict { + key_ty: TypePrefix::Str, + val_ty: TypePrefix::Any, + items: vec![ + (Typed::Str("win".into()), Typed::Int(1)), + (Typed::Str("loss".into()), Typed::Int(5)), + ], + }), + Typed::Dict(Dict { + key_ty: TypePrefix::Str, + val_ty: TypePrefix::Any, + items: vec![ + (Typed::Str("win".into()), Typed::Int(3)), + (Typed::Str("loss".into()), Typed::Int(5)), + ], + }), + Typed::Dict(Dict { + key_ty: TypePrefix::Str, + val_ty: TypePrefix::Any, + items: vec![ + (Typed::Str("win".into()), Typed::Int(5)), + (Typed::Str("loss".into()), Typed::Int(5)), + ], + }), Typed::Dict(Dict { key_ty: TypePrefix::Str, val_ty: TypePrefix::Any, diff --git a/rc_services_room/src/operations/weapon_xp_static.rs b/rc_services_room/src/operations/weapon_xp_static.rs index 8f7236f..d96e763 100644 --- a/rc_services_room/src/operations/weapon_xp_static.rs +++ b/rc_services_room/src/operations/weapon_xp_static.rs @@ -14,6 +14,7 @@ pub(super) fn weapon_xp_provider() -> SimpleFunc<129, crate::UserTy, impl (Fn(Pa key_ty: TypePrefix::Int, // int val_ty: TypePrefix::ObjArr, // obj arr items: vec![ + // TODO load from config (Typed::Int(ItemTier::T0 as _), Typed::ObjArr(vec![ Typed::Dict(Dict { key_ty: TypePrefix::Str,