Account level changes

tied account levels to accounts instead of players. implemented account banning logic in db
This commit is contained in:
Kamil
2020-12-06 00:03:52 +01:00
committed by Gent S
parent 4dc48198ab
commit a12faac0e2
3 changed files with 42 additions and 12 deletions

View File

@@ -131,6 +131,10 @@ void CNLoginServer::login(CNSocket* sock, CNPacketData* data) {
if (!CNLoginServer::isPasswordCorrect(findUser.Password, userPassword))
return loginFail(LoginError::ID_AND_PASSWORD_DO_NOT_MATCH, userLogin, sock);
// is the account banned
if (findUser.BannedUntil > getTimestamp())
return loginFail(LoginError::LOGIN_ERROR, userLogin, sock);
/*
* calling this here to timestamp login attempt,
* in order to make duplicate exit sanity check work
@@ -166,7 +170,7 @@ void CNLoginServer::login(CNSocket* sock, CNPacketData* data) {
DEBUGLOG(
std::cout << "Login Server: Login success. Welcome " << userLogin << " [" << loginSessions[sock].userID << "]" << std::endl;
)
if (resp.iCharCount == 0)
return;