allowed spaces in usernames on wesnothd

This commit is contained in:
Dave White 2004-06-27 04:00:29 +00:00
parent 4061efe1ba
commit d18a767185

View file

@ -129,9 +129,9 @@ void server::run()
continue;
}
//check the username is valid (all alpha-numeric)
//check the username is valid (all alpha-numeric or space)
const std::string& username = (*login)["username"];
if(std::count_if(username.begin(),username.end(),isalnum)
if(std::count_if(username.begin(),username.end(),isalnum) + std::count(username.begin(),username.end(),' ')
!= username.size() || username.empty()) {
network::send_data(construct_error(
"This username is not valid"),sock);