summaryrefslogtreecommitdiff
path: root/src/config.rs
blob: 9e11d27f12cd8f440dab6047f66021559d02c4e5 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36

use structopt::StructOpt;
use std::path::PathBuf;
use crate::Address;

#[derive(Debug, StructOpt)]
#[structopt(name = "Rustifarm", about = "Asciifarm server in Rust")]
pub struct Config {
	
	#[structopt(short, long, help="A server type and address. Allowed server types: 'inet', 'unix', 'abstract'. Example: \"inet:127.0.0.1:1234\" or \"abstract:rustifarm\" or \"unix:/tmp/rustifarm\" or \"inet:[::1]:1234\"")]
	pub address: Option<Vec<Address>>,
	
	#[structopt(short, long, env="ASCIIFARM_CONTENT_DIR", help="The directory in which the content specifying the world is (maps/encyclopaedia)")]
	pub content_dir: Option<PathBuf>,
	
	#[structopt(short, long, env="ASCIIFARM_SAVE_DIR", help="The directory in which the savegames are")]
	pub save_dir: Option<PathBuf>,
	
	#[structopt(short, long, env="ASCIIFARM_USER_DIR", help="The directory in which the user sign-in data lives")]
	pub user_dir: Option<PathBuf>,
	
	
	
	#[structopt(long, env="USER", help="The name(s) of the server admin(s)")]
	pub admins: String,
	
	#[structopt(long, default_value="100", help="The time (in milliseconds) between two steps")]
	pub step_duration: u64,
	
	#[structopt(long, default_value="300", help="The time (in steps) between two saves")]
	pub save_interval: i64,
	
	#[structopt(long, default_value="300", help="The time (in steps) between the last player leaving a room and the room getting unloaded. Unloading is only done when the rooms are saved, so it could actually take up to save_interval more steps")]
	pub unload_age: i64,
	
}