add player config section and move starting_location there with the other new player related configs

master
rasul 5 years ago
parent b7bfda95e9
commit f4134b1911

@ -21,8 +21,8 @@ pub struct Config {
/// Logging configuration /// Logging configuration
pub logging: Logging, pub logging: Logging,
/// Default starting location /// Player configuration
pub starting_location: Id, pub player: Player,
} }
impl Config { impl Config {

@ -4,9 +4,11 @@
mod config; mod config;
mod logging; mod logging;
mod loglevel; mod loglevel;
mod player;
mod server; mod server;
pub use config::Config; pub use config::Config;
pub use logging::Logging; pub use logging::Logging;
pub use loglevel::LogLevel; pub use loglevel::LogLevel;
pub use player::Player;
pub use server::Server; pub use server::Server;

@ -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,
}
Loading…
Cancel
Save