diff options
Diffstat (limited to 'src/server/authserver/Server/AuthSession.cpp')
-rw-r--r-- | src/server/authserver/Server/AuthSession.cpp | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/src/server/authserver/Server/AuthSession.cpp b/src/server/authserver/Server/AuthSession.cpp index 8cfe4c50c1a..648296b620b 100644 --- a/src/server/authserver/Server/AuthSession.cpp +++ b/src/server/authserver/Server/AuthSession.cpp @@ -20,6 +20,7 @@ #include "AuthCodes.h" #include "Config.h" #include "Errors.h" +#include "IPLocation.h" #include "Log.h" #include "DatabaseEnv.h" #include "RealmList.h" @@ -169,7 +170,6 @@ void AuthSession::Start() PreparedStatement* stmt = LoginDatabase.GetPreparedStatement(LOGIN_SEL_IP_INFO); stmt->setString(0, ip_address); - stmt->setUInt32(1, inet_addr(ip_address.c_str())); _queryProcessor.AddQuery(LoginDatabase.AsyncQuery(stmt).WithPreparedCallback(std::bind(&AuthSession::CheckIpCallback, this, std::placeholders::_1))); } @@ -195,9 +195,6 @@ void AuthSession::CheckIpCallback(PreparedQueryResult result) if (fields[0].GetUInt64() != 0) banned = true; - if (!fields[1].GetString().empty()) - _ipCountry = fields[1].GetString(); - } while (result->NextRow()); if (banned) @@ -344,6 +341,9 @@ void AuthSession::LogonChallengeCallback(PreparedQueryResult result) } else { + if (IpLocationRecord* location = sIPLocation->GetData(ipAddress)) + _ipCountry = location->country_code; + TC_LOG_DEBUG("server.authserver", "[AuthChallenge] Account '%s' is not locked to ip", _accountInfo.Login.c_str()); if (_accountInfo.LockCountry.empty() || _accountInfo.LockCountry == "00") TC_LOG_DEBUG("server.authserver", "[AuthChallenge] Account '%s' is not locked to country", _accountInfo.Login.c_str()); |