mirror of
https://git.ngram.ca/OpenJam/rc-servers
synced 2026-08-23 23:08:52 +00:00
Make match loading forcefully advanced after a time
This commit is contained in:
1 parent
a5ebe4284b
commit
a346299de8
17 files changed
+391
-52
No files matched your search
@@ -401,12 +401,20 @@ impl <C: Clone + Send> super::ConfigProvider<C> for CubeConfig {
|
||||
self.battle.multiplayer.players_per_game
|
||||
}
|
||||
|
||||
fn is_multiplayer_enabled(&self) -> bool {
|
||||
/*fn is_multiplayer_enabled(&self) -> bool {
|
||||
self.battle.multiplayer.enabled
|
||||
}
|
||||
|
||||
fn multiplayer_autostart_after(&self) -> std::time::Duration {
|
||||
std::time::Duration::from_secs(self.battle.multiplayer.autostart_after_s)
|
||||
}*/
|
||||
|
||||
fn multiplayer_settings(&self) -> super::MultiplayerSettings {
|
||||
super::MultiplayerSettings {
|
||||
is_enabled: self.battle.multiplayer.enabled,
|
||||
lobby_autostart_after: self.battle.multiplayer.autostart_after_s.map(std::time::Duration::from_secs),
|
||||
loading_autostart_after: self.battle.multiplayer.continue_loading_after_s.map(std::time::Duration::from_secs),
|
||||
}
|
||||
}
|
||||
|
||||
fn network_config(&self) -> crate::persist::NetworkConf {
|
||||
|
||||
@@ -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};
|
||||
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};
|
||||
|
||||
mod validation;
|
||||
pub use validation::{SelfValidator, ValidationInfo, ValidationMessage};
|
||||
|
||||
@@ -27,8 +27,7 @@ pub trait ConfigProvider<C: Clone> {
|
||||
fn gamemodes(&self) -> crate::data::game_mode::GameModeConfigs; // FIXME
|
||||
fn singleplayer_details(&self) -> SingleplayerConfig;
|
||||
fn players_per_game(&self) -> usize;
|
||||
fn is_multiplayer_enabled(&self) -> bool;
|
||||
fn multiplayer_autostart_after(&self) -> std::time::Duration;
|
||||
fn multiplayer_settings(&self) -> MultiplayerSettings;
|
||||
// FIXME don't use serializable types in traits
|
||||
fn network_config(&self) -> crate::persist::NetworkConf;
|
||||
fn maps(&self) -> std::collections::HashMap<GameMap, MapConfig>;
|
||||
@@ -502,3 +501,10 @@ pub struct PromoCode {
|
||||
pub value: f32,
|
||||
pub transaction: ShopAction,
|
||||
}
|
||||
|
||||
#[derive(Debug)]
|
||||
pub struct MultiplayerSettings {
|
||||
pub is_enabled: bool,
|
||||
pub lobby_autostart_after: Option<std::time::Duration>,
|
||||
pub loading_autostart_after: Option<std::time::Duration>,
|
||||
}
|
||||
Reference in new issue
Block a user