mirror of
https://git.ngram.ca/OpenJam/rc-servers
synced 2026-08-23 23:08:52 +00:00
Fix auto-selecting chat channel, add some more config options
This commit is contained in:
@@ -288,6 +288,8 @@ impl <C: Clone + Send> super::ConfigProvider<C> for CubeConfig {
|
||||
super::ChatSystemConfig {
|
||||
command_channel: self.chat.command_channel.clone(),
|
||||
commands: self.chat.commands.clone(),
|
||||
default_channel: self.chat.default_channel.clone(),
|
||||
can_create_channels: self.chat.can_create_channels,
|
||||
}
|
||||
}
|
||||
|
||||
@@ -408,4 +410,12 @@ impl <C: Clone + Send> super::ConfigProvider<C> for CubeConfig {
|
||||
(map.into_conf(), map_conf)
|
||||
}).collect()
|
||||
}
|
||||
|
||||
fn url_links(&self) -> super::LinksConfig {
|
||||
super::LinksConfig {
|
||||
feedback_url: self.settings.server.feedback_url.clone(),
|
||||
support_url: self.settings.server.support_url.clone(),
|
||||
wiki_url: self.settings.server.wiki_url.clone(),
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -2,7 +2,7 @@ mod cubes_json;
|
||||
pub use cubes_json::CubeConfig;
|
||||
|
||||
mod traits;
|
||||
pub use traits::{ConfigProvider, CompleteCampaignProvider, DevMessageProvider, ServerConfig, GarageUpgrades, GarageUpgradeIncrement, ChatSystemConfig, GameEventSequence, GameEvents, GameRotationStrategy, GameEvent, GameMap, GameVisibility, GameType, SingleplayerConfig, VehicleInfo, VehicleDescriptor, QueueChangeMode, Point, Sphere, MapConfig};
|
||||
pub use traits::{ConfigProvider, CompleteCampaignProvider, DevMessageProvider, ServerConfig, GarageUpgrades, GarageUpgradeIncrement, ChatSystemConfig, GameEventSequence, GameEvents, GameRotationStrategy, GameEvent, GameMap, GameVisibility, GameType, SingleplayerConfig, VehicleInfo, VehicleDescriptor, QueueChangeMode, Point, Sphere, MapConfig, LinksConfig};
|
||||
|
||||
pub type ConfigImpl = CubeConfig;
|
||||
|
||||
|
||||
@@ -32,6 +32,7 @@ pub trait ConfigProvider<C: Clone> {
|
||||
// FIXME don't use serializable types in traits
|
||||
fn network_config(&self) -> crate::persist::NetworkConf;
|
||||
fn maps(&self) -> std::collections::HashMap<GameMap, MapConfig>;
|
||||
fn url_links(&self) -> LinksConfig;
|
||||
}
|
||||
|
||||
pub struct CompleteCampaignProvider {
|
||||
@@ -153,6 +154,8 @@ impl GarageUpgrades {
|
||||
pub struct ChatSystemConfig {
|
||||
pub command_channel: String,
|
||||
pub commands: Vec<crate::persist::ChatCommand>,
|
||||
pub default_channel: String,
|
||||
pub can_create_channels: bool,
|
||||
}
|
||||
|
||||
#[derive(Clone, Debug)]
|
||||
@@ -355,3 +358,10 @@ pub struct MapConfig {
|
||||
pub spawns: std::collections::HashMap<u8, Vec<Point>>, // team -> points
|
||||
pub bases: std::collections::HashMap<u8, (Sphere, f32)>, // team -> base
|
||||
}
|
||||
|
||||
#[derive(Clone, Debug)]
|
||||
pub struct LinksConfig {
|
||||
pub feedback_url: String,
|
||||
pub support_url: String,
|
||||
pub wiki_url: String,
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user