Add config option to disable automatic account creation

Also moved the acceptallcustomnames setting to the login section where
it belongs.
This commit is contained in:
2022-06-29 23:42:44 +02:00
parent abda9dc158
commit 63d4087488
4 changed files with 14 additions and 4 deletions

View File

@@ -133,8 +133,12 @@ void CNLoginServer::login(CNSocket* sock, CNPacketData* data) {
Database::findAccount(&findUser, userLogin);
// account was not found
if (findUser.AccountID == 0)
return newAccount(sock, userLogin, userPassword, login->iClientVerC);
if (findUser.AccountID == 0) {
if (settings::AUTOCREATEACCOUNTS)
return newAccount(sock, userLogin, userPassword, login->iClientVerC);
return loginFail(LoginError::ID_DOESNT_EXIST, userLogin, sock);
}
if (!CNLoginServer::isPasswordCorrect(findUser.Password, userPassword))
return loginFail(LoginError::ID_AND_PASSWORD_DO_NOT_MATCH, userLogin, sock);