mirror of
https://git.ngram.ca/OpenJam/rc-servers
synced 2026-08-23 23:08:52 +00:00
Implement vehicle validation before match
This commit is contained in:
1 parent
5d4123026d
commit
3d2b7078e4
27 files changed
+468
-54
No files matched your search
@@ -553,4 +553,15 @@ impl <C: Clone + Send> super::ConfigProvider<C> for CubeConfig {
|
||||
}
|
||||
map
|
||||
}
|
||||
|
||||
fn vehicle_validation(&self) -> super::VehicleValidators {
|
||||
super::VehicleValidators {
|
||||
multiplayer: self.battle.multiplayer.vehicle_validator.clone(),
|
||||
custom_game: crate::persist::VehicleValidator::None, // TODO
|
||||
singleplayer: self.battle.singleplayer.vehicle_validator.clone(),
|
||||
campaigns: self.battle.singleplayer.campaigns.iter()
|
||||
.map(|campaign| (campaign.id.clone(), campaign.vehicle_validator.clone()))
|
||||
.collect(),
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -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};
|
||||
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};
|
||||
|
||||
mod validation;
|
||||
pub use validation::{SelfValidator, ValidationInfo, ValidationMessage};
|
||||
|
||||
@@ -40,6 +40,7 @@ pub trait ConfigProvider<C: Clone> {
|
||||
fn tdm_settings(&self) -> TeamDeathMatchSettings;
|
||||
fn shop_entries(&self) -> ShopEntriesResolver;
|
||||
fn promo_codes(&self) -> std::collections::HashMap<String, PromoCode>;
|
||||
fn vehicle_validation(&self) -> VehicleValidators;
|
||||
}
|
||||
|
||||
pub struct DevMessageProvider<C: Clone> {
|
||||
@@ -536,3 +537,11 @@ pub struct MultiplayerSettings {
|
||||
pub lobby_autostart_after: Option<std::time::Duration>,
|
||||
pub loading_autostart_after: Option<std::time::Duration>,
|
||||
}
|
||||
|
||||
pub struct VehicleValidators {
|
||||
// FIXME don't use serializable types in traits
|
||||
pub multiplayer: crate::persist::VehicleValidator,
|
||||
pub custom_game: crate::persist::VehicleValidator,
|
||||
pub singleplayer: crate::persist::VehicleValidator,
|
||||
pub campaigns: std::collections::HashMap<String, crate::persist::VehicleValidator>,
|
||||
}
|
||||
Reference in new issue
Block a user