rust/hedgewars-server/src/server/handlers/loggingin.rs
changeset 14875 ce98c37826a7
parent 14786 01f8ab45f806
equal deleted inserted replaced
14874:9078d787d491 14875:ce98c37826a7
    70             response.add(Bye("User quit".to_string()).send_self());
    70             response.add(Bye("User quit".to_string()).send_self());
    71             LoginResult::Exit
    71             LoginResult::Exit
    72         }
    72         }
    73         HWProtocolMessage::Nick(nick) => {
    73         HWProtocolMessage::Nick(nick) => {
    74             let client = &mut server.anteroom.clients[client_id];
    74             let client = &mut server.anteroom.clients[client_id];
    75             debug!("{} {}", nick, is_name_illegal(&nick));
    75 
    76             if client.nick.is_some() {
    76             if client.nick.is_some() {
    77                 response.add(Error("Nickname already provided.".to_string()).send_self());
    77                 response.add(Error("Nickname already provided.".to_string()).send_self());
    78                 LoginResult::Unchanged
    78                 LoginResult::Unchanged
    79             } else if is_name_illegal(&nick) {
    79             } else if is_name_illegal(&nick) {
    80                 response.add(Bye("Illegal nickname! Nicknames must be between 1-40 characters long, must not have a trailing or leading space and must not have any of these characters: $()*+?[]^{|}".to_string()).send_self());
    80                 response.add(Bye("Illegal nickname! Nicknames must be between 1-40 characters long, must not have a trailing or leading space and must not have any of these characters: $()*+?[]^{|}".to_string()).send_self());