1
0
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:
NG (Graham)
2026-03-18 17:59:14 -04:00
parent 5ce1611cc5
commit 18e3f1f6f7
5 changed files with 14 additions and 7 deletions

View File

@@ -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 {

View File

@@ -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
}
}

View File

@@ -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> {

View File

@@ -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,
}
}