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

@@ -6,6 +6,8 @@ pub struct Settings {
pub gameplay: super::GameplaySettings,
#[serde(default = "default_dev_messages")]
pub banners: Vec<BannerMessage>,
#[serde(default = "default_server_conf")]
pub server: ServerSettings,
}
fn default_gameplay_settings() -> super::GameplaySettings {
@@ -32,3 +34,19 @@ pub struct BannerMessage {
fn default_dev_messages() -> Vec<BannerMessage> {
Vec::default()
}
#[derive(Serialize, Deserialize, Clone, Debug)]
pub struct ServerSettings {
#[serde(default = "default_db_conn")]
pub database: String,
}
fn default_db_conn() -> String {
"sqlite:../data/robocraft/accounts.sqlite.db?mode=rwc".to_owned()
}
fn default_server_conf() -> ServerSettings {
ServerSettings {
database: default_db_conn(),
}
}