Core/Bnet: Moved expiring bans to background task running every minute by default (configurable) - no longer executed during login.

This commit is contained in:
Shauren
2016-02-16 00:14:59 +01:00
parent 3e2b720829
commit 36a1b1ccd5
2 changed files with 26 additions and 19 deletions

View File

@@ -615,18 +615,6 @@ void Battlenet::Session::Start()
std::string ip_address = GetRemoteIpAddress().to_string();
TC_LOG_TRACE("session", "Accepted connection from %s", ip_address.c_str());
if (_queryCallback)
{
Authentication::LogonResponse* logonResponse = new Authentication::LogonResponse();
logonResponse->SetAuthResult(AUTH_LOGON_TOO_FAST);
AsyncWrite(logonResponse);
TC_LOG_DEBUG("session", "[Session::Start] %s attempted to log too quick after previous attempt!", GetClientInfo().c_str());
return;
}
// Verify that this IP is not in the ip_banned table
LoginDatabase.Execute(LoginDatabase.GetPreparedStatement(LOGIN_DEL_EXPIRED_IP_BANS));
PreparedStatement* stmt = LoginDatabase.GetPreparedStatement(LOGIN_SEL_IP_INFO);
stmt->setString(0, ip_address);
stmt->setUInt32(1, inet_addr(ip_address.c_str()));
@@ -827,9 +815,6 @@ bool Battlenet::Session::HandlePasswordModule(BitStream* dataStream, ServerPacke
return false;
}
//set expired game account bans to inactive
LoginDatabase.Execute(LoginDatabase.GetPreparedStatement(LOGIN_UPD_EXPIRED_ACCOUNT_BANS));
BigNumber M;
sha.Initialize();
sha.UpdateBigNumbers(&A, &M1, &K, NULL);