|
|
|
@ -23,6 +23,20 @@ pub enum PlayerCheck {
|
|
|
|
|
Err(Vec<String>),
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/// Initialize the check module from the Player part of the Config.
|
|
|
|
|
///
|
|
|
|
|
/// # Arguments
|
|
|
|
|
///
|
|
|
|
|
/// * config: the Player struct of Config
|
|
|
|
|
///
|
|
|
|
|
/// # Example
|
|
|
|
|
/// ```
|
|
|
|
|
/// use rude::config::Config;
|
|
|
|
|
/// use rude::check;
|
|
|
|
|
///
|
|
|
|
|
/// let config = Config::load("config.toml").unwrap();
|
|
|
|
|
/// check::init(&config.player);
|
|
|
|
|
/// ```
|
|
|
|
|
pub fn init(config: &Player) {
|
|
|
|
|
NAME_MIN.with(|n| *n.borrow_mut() = config.name_min);
|
|
|
|
|
NAME_MAX.with(|n| *n.borrow_mut() = config.name_max);
|
|
|
|
|