mirror of
https://git.ngram.ca/OpenJam/rc-servers
synced 2026-08-23 23:08:52 +00:00
Create RC database layer
This commit is contained in:
1 parent
69c6c54650
commit
77ddeb7891
55 files changed
+2689
-395
No files matched your search
@@ -255,4 +255,10 @@ impl <C: Clone> super::ConfigProvider<C> for CubeConfig {
|
||||
items: self.chat.public_channels.iter().map(|s| Typed::Str(s.into())).collect(),
|
||||
})
|
||||
}
|
||||
|
||||
fn server_config(&self) -> super::ServerConfig {
|
||||
super::ServerConfig {
|
||||
database: self.settings.server.database.clone(),
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -2,7 +2,7 @@ mod cubes_json;
|
||||
pub use cubes_json::CubeConfig;
|
||||
|
||||
mod traits;
|
||||
pub use traits::{ConfigProvider, CompleteCampaignProvider, DevMessageProvider};
|
||||
pub use traits::{ConfigProvider, CompleteCampaignProvider, DevMessageProvider, ServerConfig};
|
||||
|
||||
pub type ConfigImpl = CubeConfig;
|
||||
|
||||
|
||||
@@ -18,6 +18,7 @@ pub trait ConfigProvider<C: Clone> {
|
||||
fn client_config(&self) -> Typed<C>;
|
||||
fn login_messages(&self) -> DevMessageProvider<C>;
|
||||
fn public_channels(&self) -> Typed<C>;
|
||||
fn server_config(&self) -> ServerConfig;
|
||||
}
|
||||
|
||||
pub struct CompleteCampaignProvider {
|
||||
@@ -83,3 +84,7 @@ pub struct TypedDevMessage<C> {
|
||||
pub message: Typed<C>,
|
||||
pub display_time: Typed<C>,
|
||||
}
|
||||
|
||||
pub struct ServerConfig {
|
||||
pub database: String,
|
||||
}
|
||||
Reference in new issue
Block a user