diff options
Diffstat (limited to 'src/server/authserver/Server')
-rw-r--r-- | src/server/authserver/Server/AuthSession.cpp | 44 |
1 files changed, 22 insertions, 22 deletions
diff --git a/src/server/authserver/Server/AuthSession.cpp b/src/server/authserver/Server/AuthSession.cpp index dd7390da085..d9058b3392a 100644 --- a/src/server/authserver/Server/AuthSession.cpp +++ b/src/server/authserver/Server/AuthSession.cpp @@ -166,7 +166,7 @@ _status(STATUS_CHALLENGE), _build(0), _expversion(0) { } void AuthSession::Start() { std::string ip_address = GetRemoteIpAddress().to_string(); - TC_LOG_TRACE("session", "Accepted connection from %s", ip_address.c_str()); + TC_LOG_TRACE("session", "Accepted connection from {}", ip_address); LoginDatabasePreparedStatement* stmt = LoginDatabase.GetPreparedStatement(LOGIN_SEL_IP_INFO); stmt->setString(0, ip_address); @@ -204,7 +204,7 @@ void AuthSession::CheckIpCallback(PreparedQueryResult result) pkt << uint8(0x00); pkt << uint8(WOW_FAIL_BANNED); SendPacket(pkt); - TC_LOG_DEBUG("session", "[AuthSession::CheckIpCallback] Banned ip '%s:%d' tries to login!", GetRemoteIpAddress().to_string().c_str(), GetRemotePort()); + TC_LOG_DEBUG("session", "[AuthSession::CheckIpCallback] Banned ip '{}:{}' tries to login!", GetRemoteIpAddress().to_string(), GetRemotePort()); return; } } @@ -284,7 +284,7 @@ bool AuthSession::HandleLogonChallenge() return false; std::string login((char const*)challenge->I, challenge->I_len); - TC_LOG_DEBUG("server.authserver", "[AuthChallenge] '%s'", login.c_str()); + TC_LOG_DEBUG("server.authserver", "[AuthChallenge] '{}'", login); _build = challenge->build; _expversion = uint8(AuthHelper::IsPostBCAcceptedClientBuild(_build) ? POST_BC_EXP_FLAG : (AuthHelper::IsPreBCAcceptedClientBuild(_build) ? PRE_BC_EXP_FLAG : NO_VALID_EXP_FLAG)); @@ -331,7 +331,7 @@ void AuthSession::LogonChallengeCallback(PreparedQueryResult result) // If the IP is 'locked', check that the player comes indeed from the correct IP address if (_accountInfo.IsLockedToIP) { - TC_LOG_DEBUG("server.authserver", "[AuthChallenge] Account '%s' is locked to IP - '%s' is logging in from '%s'", _accountInfo.Login.c_str(), _accountInfo.LastIP.c_str(), ipAddress.c_str()); + TC_LOG_DEBUG("server.authserver", "[AuthChallenge] Account '{}' is locked to IP - '{}' is logging in from '{}'", _accountInfo.Login, _accountInfo.LastIP, ipAddress); if (_accountInfo.LastIP != ipAddress) { pkt << uint8(WOW_FAIL_LOCKED_ENFORCED); @@ -344,12 +344,12 @@ void AuthSession::LogonChallengeCallback(PreparedQueryResult result) if (IpLocationRecord const* location = sIPLocation->GetLocationRecord(ipAddress)) _ipCountry = location->CountryCode; - TC_LOG_DEBUG("server.authserver", "[AuthChallenge] Account '%s' is not locked to ip", _accountInfo.Login.c_str()); + TC_LOG_DEBUG("server.authserver", "[AuthChallenge] Account '{}' is not locked to ip", _accountInfo.Login); if (_accountInfo.LockCountry.empty() || _accountInfo.LockCountry == "00") - TC_LOG_DEBUG("server.authserver", "[AuthChallenge] Account '%s' is not locked to country", _accountInfo.Login.c_str()); + TC_LOG_DEBUG("server.authserver", "[AuthChallenge] Account '{}' is not locked to country", _accountInfo.Login); else if (!_ipCountry.empty()) { - TC_LOG_DEBUG("server.authserver", "[AuthChallenge] Account '%s' is locked to country: '%s' Player country is '%s'", _accountInfo.Login.c_str(), _accountInfo.LockCountry.c_str(), _ipCountry.c_str()); + TC_LOG_DEBUG("server.authserver", "[AuthChallenge] Account '{}' is locked to country: '{}' Player country is '{}'", _accountInfo.Login, _accountInfo.LockCountry, _ipCountry); if (_ipCountry != _accountInfo.LockCountry) { pkt << uint8(WOW_FAIL_UNLOCKABLE_LOCK); @@ -366,14 +366,14 @@ void AuthSession::LogonChallengeCallback(PreparedQueryResult result) { pkt << uint8(WOW_FAIL_BANNED); SendPacket(pkt); - TC_LOG_INFO("server.authserver.banned", "'%s:%d' [AuthChallenge] Banned account %s tried to login!", ipAddress.c_str(), port, _accountInfo.Login.c_str()); + TC_LOG_INFO("server.authserver.banned", "'{}:{}' [AuthChallenge] Banned account {} tried to login!", ipAddress, port, _accountInfo.Login); return; } else { pkt << uint8(WOW_FAIL_SUSPENDED); SendPacket(pkt); - TC_LOG_INFO("server.authserver.banned", "'%s:%d' [AuthChallenge] Temporarily banned account %s tried to login!", ipAddress.c_str(), port, _accountInfo.Login.c_str()); + TC_LOG_INFO("server.authserver.banned", "'{}:{}' [AuthChallenge] Temporarily banned account {} tried to login!", ipAddress, port, _accountInfo.Login); return; } } @@ -390,7 +390,7 @@ void AuthSession::LogonChallengeCallback(PreparedQueryResult result) if (!success) { pkt << uint8(WOW_FAIL_DB_BUSY); - TC_LOG_ERROR("server.authserver", "[AuthChallenge] Account '%s' has invalid ciphertext for TOTP token key stored", _accountInfo.Login.c_str()); + TC_LOG_ERROR("server.authserver", "[AuthChallenge] Account '{}' has invalid ciphertext for TOTP token key stored", _accountInfo.Login); SendPacket(pkt); return; } @@ -435,8 +435,8 @@ void AuthSession::LogonChallengeCallback(PreparedQueryResult result) if (securityFlags & 0x04) // Security token input pkt << uint8(1); - TC_LOG_DEBUG("server.authserver", "'%s:%d' [AuthChallenge] account %s is using '%s' locale (%u)", - ipAddress.c_str(), port, _accountInfo.Login.c_str(), _localizationName.c_str(), GetLocaleByName(_localizationName)); + TC_LOG_DEBUG("server.authserver", "'{}:{}' [AuthChallenge] account {} is using '{}' locale ({})", + ipAddress, port, _accountInfo.Login, _localizationName, GetLocaleByName(_localizationName)); _status = STATUS_LOGON_PROOF; } @@ -502,7 +502,7 @@ bool AuthSession::HandleLogonProof() return true; } - TC_LOG_DEBUG("server.authserver", "'%s:%d' User '%s' successfully authenticated", GetRemoteIpAddress().to_string().c_str(), GetRemotePort(), _accountInfo.Login.c_str()); + TC_LOG_DEBUG("server.authserver", "'{}:{}' User '{}' successfully authenticated", GetRemoteIpAddress().to_string(), GetRemotePort(), _accountInfo.Login); // Update the sessionkey, last_ip, last login time and reset number of failed logins in the account table for this account // No SQL injection (escaped user name) and IP address as received by socket @@ -556,8 +556,8 @@ bool AuthSession::HandleLogonProof() packet << uint16(0); // LoginFlags, 1 has account message SendPacket(packet); - TC_LOG_INFO("server.authserver.hack", "'%s:%d' [AuthChallenge] account %s tried to login with invalid password!", - GetRemoteIpAddress().to_string().c_str(), GetRemotePort(), _accountInfo.Login.c_str()); + TC_LOG_INFO("server.authserver.hack", "'{}:{}' [AuthChallenge] account {} tried to login with invalid password!", + GetRemoteIpAddress().to_string(), GetRemotePort(), _accountInfo.Login); uint32 MaxWrongPassCount = sConfigMgr->GetIntDefault("WrongPass.MaxCount", 0); @@ -591,8 +591,8 @@ bool AuthSession::HandleLogonProof() stmt->setUInt32(1, WrongPassBanTime); LoginDatabase.Execute(stmt); - TC_LOG_DEBUG("server.authserver", "'%s:%d' [AuthChallenge] account %s got banned for '%u' seconds because it failed to authenticate '%u' times", - GetRemoteIpAddress().to_string().c_str(), GetRemotePort(), _accountInfo.Login.c_str(), WrongPassBanTime, _accountInfo.FailedLogins); + TC_LOG_DEBUG("server.authserver", "'{}:{}' [AuthChallenge] account {} got banned for '{}' seconds because it failed to authenticate '{}' times", + GetRemoteIpAddress().to_string(), GetRemotePort(), _accountInfo.Login, WrongPassBanTime, _accountInfo.FailedLogins); } else { @@ -601,8 +601,8 @@ bool AuthSession::HandleLogonProof() stmt->setUInt32(1, WrongPassBanTime); LoginDatabase.Execute(stmt); - TC_LOG_DEBUG("server.authserver", "'%s:%d' [AuthChallenge] IP got banned for '%u' seconds because account %s failed to authenticate '%u' times", - GetRemoteIpAddress().to_string().c_str(), GetRemotePort(), WrongPassBanTime, _accountInfo.Login.c_str(), _accountInfo.FailedLogins); + TC_LOG_DEBUG("server.authserver", "'{}:{}' [AuthChallenge] IP got banned for '{}' seconds because account {} failed to authenticate '{}' times", + GetRemoteIpAddress().to_string(), GetRemotePort(), WrongPassBanTime, _accountInfo.Login, _accountInfo.FailedLogins); } } } @@ -620,7 +620,7 @@ bool AuthSession::HandleReconnectChallenge() return false; std::string login((char const*)challenge->I, challenge->I_len); - TC_LOG_DEBUG("server.authserver", "[ReconnectChallenge] '%s'", login.c_str()); + TC_LOG_DEBUG("server.authserver", "[ReconnectChallenge] '{}'", login); _build = challenge->build; _expversion = uint8(AuthHelper::IsPostBCAcceptedClientBuild(_build) ? POST_BC_EXP_FLAG : (AuthHelper::IsPreBCAcceptedClientBuild(_build) ? PRE_BC_EXP_FLAG : NO_VALID_EXP_FLAG)); @@ -709,8 +709,8 @@ bool AuthSession::HandleReconnectProof() } else { - TC_LOG_ERROR("server.authserver.hack", "'%s:%d' [ERROR] user %s tried to login, but session is invalid.", GetRemoteIpAddress().to_string().c_str(), - GetRemotePort(), _accountInfo.Login.c_str()); + TC_LOG_ERROR("server.authserver.hack", "'{}:{}' [ERROR] user {} tried to login, but session is invalid.", GetRemoteIpAddress().to_string(), + GetRemotePort(), _accountInfo.Login); return false; } } |