Core/Misc: Improved ip2location code and set it to disabled by default

(cherry picked from commit 0ead73516a)
This commit is contained in:
Shauren
2018-06-23 21:31:09 +02:00
parent 61532e9816
commit 50cfeb9aa4
8 changed files with 67 additions and 75 deletions

View File

@@ -291,10 +291,10 @@ public:
{
if (param == "on")
{
if (IpLocationRecord* location = sIPLocation->GetData(handler->GetSession()->GetRemoteAddress()))
if (IpLocationRecord const* location = sIPLocation->GetLocationRecord(handler->GetSession()->GetRemoteAddress()))
{
PreparedStatement* stmt = LoginDatabase.GetPreparedStatement(LOGIN_UPD_ACCOUNT_LOCK_COUNTRY);
stmt->setString(0, location->country_code);
stmt->setString(0, location->CountryCode);
stmt->setUInt32(1, handler->GetSession()->GetAccountId());
LoginDatabase.Execute(stmt);
handler->PSendSysMessage(LANG_COMMAND_ACCLOCKLOCKED);

View File

@@ -1769,10 +1769,10 @@ public:
lastIp = fields[4].GetString();
lastLogin = fields[5].GetString();
if (IpLocationRecord* location = sIPLocation->GetData(lastIp))
if (IpLocationRecord const* location = sIPLocation->GetLocationRecord(lastIp))
{
lastIp.append(" (");
lastIp.append(location->country_name);
lastIp.append(location->CountryName);
lastIp.append(")");
}
}