mirror of
https://github.com/mod-playerbots/azerothcore-wotlk.git
synced 2026-01-13 09:17:18 +00:00
feat: Added logs_ip_action + more (#1157)
This commit is contained in:
committed by
Francesco Borzì
parent
6750fd5a73
commit
2a71b2a666
@@ -760,14 +760,26 @@ bool AuthSocket::_HandleLogonProof()
|
||||
socket().send(data, sizeof(data));
|
||||
|
||||
#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS)
|
||||
sLog->outDebug(LOG_FILTER_NETWORKIO, "'%s:%d' [AuthChallenge] account %s tried to login with invalid password!", socket().getRemoteAddress().c_str(), socket().getRemotePort(), _login.c_str ());
|
||||
sLog->outDebug(LOG_FILTER_NETWORKIO, "'%s:%d' [AuthChallenge] account %s tried to login with invalid password!", socket().getRemoteAddress().c_str(), socket().getRemotePort(), _login.c_str());
|
||||
#endif
|
||||
|
||||
uint32 MaxWrongPassCount = sConfigMgr->GetIntDefault("WrongPass.MaxCount", 0);
|
||||
|
||||
// We can not include the failed account login hook. However, this is a workaround to still log this.
|
||||
if (sConfigMgr->GetBoolDefault("WrongPass.Logging", false))
|
||||
{
|
||||
PreparedStatement* logstmt = LoginDatabase.GetPreparedStatement(LOGIN_INS_FALP_IP_LOGGING);
|
||||
logstmt->setString(0, _login);
|
||||
logstmt->setString(1, socket().getRemoteAddress());
|
||||
logstmt->setString(2, "Logged on failed AccountLogin due wrong password");
|
||||
|
||||
LoginDatabase.Execute(logstmt);
|
||||
}
|
||||
|
||||
if (MaxWrongPassCount > 0)
|
||||
{
|
||||
//Increment number of failed logins by one and if it reaches the limit temporarily ban that account or IP
|
||||
PreparedStatement *stmt = LoginDatabase.GetPreparedStatement(LOGIN_UPD_FAILEDLOGINS);
|
||||
PreparedStatement* stmt = LoginDatabase.GetPreparedStatement(LOGIN_UPD_FAILEDLOGINS);
|
||||
stmt->setString(0, _login);
|
||||
LoginDatabase.Execute(stmt);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user