gameServer2/src/utils.rs
author unc0rr
Thu, 21 Jun 2018 23:09:20 +0200
changeset 13423 bb24c3414b0d
parent 13421 cdf69667593b
child 13428 87a6cad20c90
permissions -rw-r--r--
Store saved room in yaml

use mio;

pub const PROTOCOL_VERSION : u32 = 3;
pub const SERVER: mio::Token = mio::Token(1000000000 + 0);

pub fn is_name_illegal(name: &str ) -> bool{
    name.len() > 40 ||
        name.trim().is_empty() ||
        name.chars().any(|c|
            "$()*+?[]^{|}\x7F".contains(c) ||
                '\x00' <= c && c <= '\x1F')
}