mirror of
https://github.com/Cockatrice/Cockatrice.git
synced 2026-04-27 07:48:01 -07:00
publish username rules in registration failure
This commit is contained in:
parent
9947af7be9
commit
4c27304047
5 changed files with 57 additions and 12 deletions
|
|
@ -788,8 +788,14 @@ Response::ResponseCode ServerSocketInterface::cmdRegisterAccount(const Command_R
|
|||
}
|
||||
|
||||
// TODO: Move this method outside of the db interface
|
||||
if (!sqlInterface->usernameIsValid(userName))
|
||||
QString errorString;
|
||||
if (!sqlInterface->usernameIsValid(userName, errorString))
|
||||
{
|
||||
Response_Register *re = new Response_Register;
|
||||
re->set_denied_reason_str(errorString.toStdString());
|
||||
rc.setResponseExtension(re);
|
||||
return Response::RespUsernameInvalid;
|
||||
}
|
||||
|
||||
if(sqlInterface->userExists(userName))
|
||||
return Response::RespUserAlreadyExists;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue