mirror of
https://git.ngram.ca/OpenJam/rc-servers
synced 2026-08-23 23:08:52 +00:00
Add configurable team selection for #44
This commit is contained in:
1 parent
0a93432783
commit
56e4239c08
19 files changed
+214
-26
No files matched your search
@@ -241,7 +241,7 @@ impl <C: Clone + Send> super::ConfigProvider<C> for CubeConfig {
|
||||
}
|
||||
|
||||
fn game_mode_config(&self) -> Typed<C> {
|
||||
let game_mode_data: crate::data::game_mode::GameModeConfigs = self.battle.games.into();
|
||||
let game_mode_data: crate::data::game_mode::GameModeConfigs = self.battle.games.clone().into();
|
||||
game_mode_data.as_transmissible()
|
||||
}
|
||||
|
||||
@@ -347,7 +347,7 @@ impl <C: Clone + Send> super::ConfigProvider<C> for CubeConfig {
|
||||
}
|
||||
|
||||
fn gamemodes(&self) -> crate::data::game_mode::GameModeConfigs {
|
||||
self.battle.games.into()
|
||||
self.battle.games.clone().into()
|
||||
}
|
||||
|
||||
fn singleplayer_details(&self) -> super::SingleplayerConfig {
|
||||
@@ -569,4 +569,13 @@ impl <C: Clone + Send> super::ConfigProvider<C> for CubeConfig {
|
||||
fn garage_slot_limit(&self) -> i32 {
|
||||
self.settings.gameplay.garages_limit
|
||||
}
|
||||
|
||||
fn team_choosers(&self) -> super::TeamChoosers {
|
||||
super::TeamChoosers {
|
||||
battle_arena: self.battle.games.battle_arena.team_chooser.clone(),
|
||||
elimination: self.battle.games.elimination.team_chooser.clone(),
|
||||
pit: self.battle.games.pit.team_chooser.clone(),
|
||||
team_deathmatch: self.battle.games.team_deathmatch.team_chooser.clone(),
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -2,7 +2,7 @@ mod cubes_json;
|
||||
pub use cubes_json::CubeConfig;
|
||||
|
||||
mod traits;
|
||||
pub use traits::{ConfigProvider, DevMessageProvider, ServerConfig, GarageUpgrades, GarageUpgradeIncrement, ChatSystemConfig, GameEventSequence, GameEvents, GameRotationStrategy, GameEvent, GameMap, GameVisibility, GameType, SingleplayerConfig, VehicleInfo, VehicleDescriptor, QueueChangeMode, Point, Sphere, MapConfig, LinksConfig, FakePlayer, ClientEmulator, EnergyConfig, BattleArenaResolver, PitSettings, PitWinCondition, TeamDeathMatchSettings, ShopEntriesResolver, ShopAction, ShopGain, PromoCode, MultiplayerSettings, BattleArenaCrystalParams, VehicleValidators};
|
||||
pub use traits::{ConfigProvider, DevMessageProvider, ServerConfig, GarageUpgrades, GarageUpgradeIncrement, ChatSystemConfig, GameEventSequence, GameEvents, GameRotationStrategy, GameEvent, GameMap, GameVisibility, GameType, SingleplayerConfig, VehicleInfo, VehicleDescriptor, QueueChangeMode, Point, Sphere, MapConfig, LinksConfig, FakePlayer, ClientEmulator, EnergyConfig, BattleArenaResolver, PitSettings, PitWinCondition, TeamDeathMatchSettings, ShopEntriesResolver, ShopAction, ShopGain, PromoCode, MultiplayerSettings, BattleArenaCrystalParams, VehicleValidators, TeamChoosers};
|
||||
|
||||
mod validation;
|
||||
pub use validation::{SelfValidator, ValidationInfo, ValidationMessage};
|
||||
|
||||
@@ -42,6 +42,7 @@ pub trait ConfigProvider<C: Clone> {
|
||||
fn promo_codes(&self) -> std::collections::HashMap<String, PromoCode>;
|
||||
fn vehicle_validation(&self) -> VehicleValidators;
|
||||
fn garage_slot_limit(&self) -> i32;
|
||||
fn team_choosers(&self) -> TeamChoosers;
|
||||
}
|
||||
|
||||
pub struct DevMessageProvider<C: Clone> {
|
||||
@@ -547,3 +548,10 @@ pub struct VehicleValidators {
|
||||
pub singleplayer: crate::persist::VehicleValidator,
|
||||
pub campaigns: std::collections::HashMap<String, crate::persist::VehicleValidator>,
|
||||
}
|
||||
|
||||
pub struct TeamChoosers {
|
||||
pub battle_arena: crate::persist::TeamChooser,
|
||||
pub elimination: crate::persist::TeamChooser,
|
||||
pub pit: crate::persist::TeamChooser,
|
||||
pub team_deathmatch: crate::persist::TeamChooser,
|
||||
}
|
||||
Reference in new issue
Block a user