MCPcopy Create free account
hub / github.com/BohemiaInteractive/CWR / resolve_mods_path

Function resolve_mods_path

mserver/MasterService/src/main.rs:303–314  ·  view source on GitHub ↗
(mods_dir: Option<&str>, db_path: &Path, dev: bool)

Source from the content-addressed store, hash-verified

301 let duration = std::time::SystemTime::now()
302 .duration_since(std::time::UNIX_EPOCH)
303 .context("reading current time for dev seed")?;
304 i64::try_from(duration.as_millis()).context("converting current time to milliseconds")
305}
306
307fn resolve_mods_path(mods_dir: Option<&str>, db_path: &Path, dev: bool) -> Result<Option<PathBuf>> {
308 if let Some(mods_dir) = mods_dir {
309 return resolve_user_path(mods_dir).map(Some);
310 }
311
312 if dev {
313 let parent = db_path.parent().unwrap_or_else(|| Path::new("."));
314 return Ok(Some(parent.join("papa-bear-master-service-dev-mods")));
315 }
316
317 Ok(None)

Callers 2

run_serverFunction · 0.85

Calls 1

resolve_user_pathFunction · 0.85

Tested by 1