1
0
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:
NGnius (Graham)
2025-05-07 20:23:22 -04:00
parent 69c6c54650
commit 77ddeb7891
55 changed files with 2689 additions and 395 deletions

View File

@@ -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(),
}
}
}

View File

@@ -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;

View File

@@ -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,
}