mirror of
https://git.ngram.ca/OpenJam/rc-servers
synced 2026-08-23 23:08:52 +00:00
Make garage slot limit configurable
This commit is contained in:
@@ -12,6 +12,7 @@ pub struct GameplaySettings {
|
||||
pub critical_ratio: f32,
|
||||
pub cross_promo_image: String, // url
|
||||
pub cross_promo_link: String, // url
|
||||
pub garages_limit: i32,
|
||||
}
|
||||
|
||||
impl std::convert::From<GameplaySettings> for crate::data::client_config::GameplaySettings {
|
||||
|
||||
@@ -565,4 +565,8 @@ impl <C: Clone + Send> super::ConfigProvider<C> for CubeConfig {
|
||||
.collect(),
|
||||
}
|
||||
}
|
||||
|
||||
fn garage_slot_limit(&self) -> i32 {
|
||||
self.settings.gameplay.garages_limit
|
||||
}
|
||||
}
|
||||
|
||||
@@ -41,6 +41,7 @@ pub trait ConfigProvider<C: Clone> {
|
||||
fn shop_entries(&self) -> ShopEntriesResolver;
|
||||
fn promo_codes(&self) -> std::collections::HashMap<String, PromoCode>;
|
||||
fn vehicle_validation(&self) -> VehicleValidators;
|
||||
fn garage_slot_limit(&self) -> i32;
|
||||
}
|
||||
|
||||
pub struct DevMessageProvider<C: Clone> {
|
||||
|
||||
@@ -22,7 +22,7 @@ impl super::config::SelfValidator for Settings {
|
||||
|
||||
fn default_gameplay_settings() -> super::GameplaySettings {
|
||||
super::GameplaySettings {
|
||||
show_tutorial_after_date: "2030-01-01".to_owned(),
|
||||
show_tutorial_after_date: "2077-01-01".to_owned(),
|
||||
health_threshold: 0.20,
|
||||
microbot_sphere: 0.5,
|
||||
misfire_angle: 10.0,
|
||||
@@ -30,8 +30,9 @@ fn default_gameplay_settings() -> super::GameplaySettings {
|
||||
shield_hps: 10_000_000,
|
||||
request_review_level: 10_000,
|
||||
critical_ratio: 5.0,
|
||||
cross_promo_image: "https://git.ngram.ca/OpenJam/servers/raw/branch/main/assets/robocraft/default.png".to_owned(),
|
||||
cross_promo_link: "https://git.ngram.ca/OpenJam/servers".to_owned(),
|
||||
cross_promo_image: "https://git.ngram.ca/OpenJam/rc-servers/raw/branch/main/assets/robocraft/default.png".to_owned(),
|
||||
cross_promo_link: "https://git.ngram.ca/OpenJam/rc-servers".to_owned(),
|
||||
garages_limit: 100,
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -4,11 +4,11 @@ use polariton_server::operations::Immediate;
|
||||
|
||||
const PARAM_KEY: u8 = 68;
|
||||
|
||||
pub(super) fn garage_slots_limit(_conf: &oj_rc_core::ConfigImpl) -> Immediate<60, crate::UserTy> {
|
||||
//let limit = conf.game_mode_config();
|
||||
pub(super) fn garage_slots_limit(conf: &oj_rc_core::ConfigImpl) -> Immediate<60, crate::UserTy> {
|
||||
let limit = <oj_rc_core::ConfigImpl as oj_rc_core::ConfigProvider<()>>::garage_slot_limit(conf);
|
||||
Immediate::new(move || {
|
||||
let mut params = std::collections::HashMap::with_capacity(1);
|
||||
params.insert(PARAM_KEY, polariton::operation::Typed::Int(100));
|
||||
let mut params = std::collections::HashMap::with_capacity(2);
|
||||
params.insert(PARAM_KEY, polariton::operation::Typed::Int(limit));
|
||||
params.into()
|
||||
})
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user