Reject more invalid usernames from clients.

Specifically this should cover people connecting with a username of
"\u200C"
This commit is contained in:
Daenyth
2012-07-25 00:08:28 -04:00
parent ba5669652c
commit af09d0d294
8 changed files with 33 additions and 7 deletions

View File

@@ -114,7 +114,7 @@ AuthenticationResult Server::loginUser(Server_ProtocolHandler *session, QString
QWriteLocker locker(&clientsLock);
AuthenticationResult authState = databaseInterface->checkUserPassword(session, name, password, reasonStr, secondsLeft);
if ((authState == NotLoggedIn) || (authState == UserIsBanned))
if ((authState == NotLoggedIn) || (authState == UserIsBanned || authState == UsernameInvalid))
return authState;
ServerInfo_User data = databaseInterface->getUserData(name, true);