diff --git a/server/src/lib.rs b/server/src/lib.rs index b43a19999c..3b52937a57 100644 --- a/server/src/lib.rs +++ b/server/src/lib.rs @@ -120,8 +120,9 @@ impl Server { info!("Authentication is disabled"); } - // persistence_db_dir is relative to data_dir - let persistence_db_dir = data_dir.join(&settings.persistence_db_dir); + // Relative to data_dir + const PERSISTENCE_DB_DIR: &str = "saves"; + let persistence_db_dir = data_dir.join(PERSISTENCE_DB_DIR); // Run pending DB migrations (if any) debug!("Running DB migrations..."); diff --git a/server/src/settings.rs b/server/src/settings.rs index c2d18f7179..379ca1d15e 100644 --- a/server/src/settings.rs +++ b/server/src/settings.rs @@ -38,8 +38,6 @@ pub struct Settings { /// When set to None, loads the default map file (if available); otherwise, /// uses the value of the file options to decide how to proceed. pub map_file: Option, - /// Relative paths are relative to the server data dir - pub persistence_db_dir: PathBuf, pub max_view_distance: Option, pub banned_words_files: Vec, pub max_player_group_size: u32, @@ -57,7 +55,6 @@ impl Default for Settings { max_players: 100, start_time: 9.0 * 3600.0, map_file: None, - persistence_db_dir: "saves".into(), max_view_distance: Some(30), banned_words_files: Vec::new(), max_player_group_size: 6, @@ -96,7 +93,6 @@ impl Settings { } default_settings } - .apply_saves_dir_override() } fn save_to_file(&self, path: &Path) -> std::io::Result<()> { @@ -147,18 +143,6 @@ impl Settings { path.push(SETTINGS_FILENAME); path } - - fn apply_saves_dir_override(mut self) -> Self { - if let Some(saves_dir) = std::env::var_os("VELOREN_SAVES_DIR") { - let path = PathBuf::from(&saves_dir); - if path.exists() || path.parent().map(|x| x.exists()).unwrap_or(false) { - self.persistence_db_dir = path; - } else { - warn!(?saves_dir, "VELOREN_SAVES_DIR points to an invalid path."); - } - } - self - } } fn with_config_dir(path: &Path) -> PathBuf {