diff --git a/src/config/config.rs b/src/config/config.rs index 12e21ba..e73574b 100644 --- a/src/config/config.rs +++ b/src/config/config.rs @@ -21,8 +21,8 @@ pub struct Config { /// Logging configuration pub logging: Logging, - /// Default starting location - pub starting_location: Id, + /// Player configuration + pub player: Player, } impl Config { diff --git a/src/config/mod.rs b/src/config/mod.rs index 72808cb..7c32e2b 100644 --- a/src/config/mod.rs +++ b/src/config/mod.rs @@ -4,9 +4,11 @@ mod config; mod logging; mod loglevel; +mod player; mod server; pub use config::Config; pub use logging::Logging; pub use loglevel::LogLevel; +pub use player::Player; pub use server::Server; diff --git a/src/config/player.rs b/src/config/player.rs new file mode 100644 index 0000000..c934824 --- /dev/null +++ b/src/config/player.rs @@ -0,0 +1,28 @@ +use serde_derive::Deserialize; + +use crate::id::Id; + +/// Player configuration +#[derive(Clone, Debug, Deserialize)] +pub struct Player { + /// Default starting location + pub starting_location: Id, + + /// Minimum length of player name + pub name_min: usize, + + /// Maximum length of player name + pub name_max: usize, + + /// Allowed characters in player name + pub name_chars: String, + + /// Minimum length of password + pub pass_min: usize, + + /// Maximum length of password + pub pass_max: usize, + + /// Allowed characters in password + pub pass_chars: String, +}