1
0
mirror of https://git.ngram.ca/OpenJam/rc-servers synced 2026-08-23 23:08:52 +00:00

Add upgrade and dismantle vehicle slot functionality for #14

This commit is contained in:
NG (Graham)
2025-05-11 12:09:23 -04:00
parent 221a5d5ca9
commit b04a8902e2
11 changed files with 222 additions and 22 deletions

View File

@@ -6,6 +6,8 @@ pub struct Settings {
pub gameplay: super::GameplaySettings,
#[serde(default = "default_dev_messages")]
pub banners: Vec<BannerMessage>,
#[serde(default = "default_slot_upgrades")]
pub garage_upgrades: Vec<GarageSlotUpgrade>,
#[serde(default = "default_server_conf")]
pub server: ServerSettings,
}
@@ -35,6 +37,37 @@ fn default_dev_messages() -> Vec<BannerMessage> {
Vec::default()
}
#[derive(Serialize, Deserialize, Clone, Debug)]
pub struct GarageSlotUpgrade {
pub cpu: u32,
pub cost: u32,
}
fn default_slot_upgrades() -> Vec<GarageSlotUpgrade> {
vec![
GarageSlotUpgrade {
cpu: 100,
cost: 100,
},
GarageSlotUpgrade {
cpu: 200,
cost: 200,
},
GarageSlotUpgrade {
cpu: 1_000,
cost: 1_000,
},
GarageSlotUpgrade {
cpu: 2_000,
cost: 2_000,
},
GarageSlotUpgrade {
cpu: 10_000,
cost: 10_000,
},
]
}
#[derive(Serialize, Deserialize, Clone, Debug)]
pub struct ServerSettings {
#[serde(default = "default_db_conn")]