aboutsummaryrefslogtreecommitdiff
path: root/src/server
diff options
context:
space:
mode:
authorShauren <shauren.trinity@gmail.com>2018-06-23 21:31:09 +0200
committerShauren <shauren.trinity@gmail.com>2019-01-09 17:35:18 +0100
commit50cfeb9aa406b9f81a6aa51dcd87201e5f3bae1e (patch)
tree5f47b715128418cc91091711f0358e5c2dea961f /src/server
parent61532e9816f750ae1690f8d5fca92525d6297ab6 (diff)
Core/Misc: Improved ip2location code and set it to disabled by default
(cherry picked from commit 0ead73516adfeaff96292685592085e20737d535)
Diffstat (limited to 'src/server')
-rw-r--r--src/server/bnetserver/Server/Session.cpp4
-rw-r--r--src/server/bnetserver/bnetserver.conf.dist9
-rw-r--r--src/server/game/Server/WorldSocket.cpp4
-rw-r--r--src/server/scripts/Commands/cs_account.cpp4
-rw-r--r--src/server/scripts/Commands/cs_misc.cpp4
-rw-r--r--src/server/worldserver/worldserver.conf.dist9
6 files changed, 16 insertions, 18 deletions
diff --git a/src/server/bnetserver/Server/Session.cpp b/src/server/bnetserver/Server/Session.cpp
index 56c71a3eeb6..7ebb7abb58b 100644
--- a/src/server/bnetserver/Server/Session.cpp
+++ b/src/server/bnetserver/Server/Session.cpp
@@ -336,8 +336,8 @@ uint32 Battlenet::Session::VerifyWebCredentials(std::string const& webCredential
}
else
{
- if (IpLocationRecord* location = sIPLocation->GetData(ip_address))
- _ipCountry = location->country_code;
+ if (IpLocationRecord const* location = sIPLocation->GetLocationRecord(ip_address))
+ _ipCountry = location->CountryCode;
TC_LOG_DEBUG("session", "[Session::HandleVerifyWebCredentials] Account '%s' is not locked to ip", _accountInfo->Login.c_str());
if (_accountInfo->LockCountry.empty() || _accountInfo->LockCountry == "00")
diff --git a/src/server/bnetserver/bnetserver.conf.dist b/src/server/bnetserver/bnetserver.conf.dist
index 0e5ccc18a53..f6fcb5764b4 100644
--- a/src/server/bnetserver/bnetserver.conf.dist
+++ b/src/server/bnetserver/bnetserver.conf.dist
@@ -200,12 +200,11 @@ MySQLExecutable = ""
#
# IPLocationFile
# Description: The path to your IP2Location database CSV file.
-# Example: "C:/Trinity/IP2Location.csv"
-# "/home/trinity/IP2Location.csv"
-# Default: "." - (Current core directory)
-# "" - (Disabled)
+# Example: "C:/Trinity/IP2LOCATION-LITE-DB1.CSV"
+# "/home/trinity/IP2LOCATION-LITE-DB1.CSV"
+# Default: "" - (Disabled)
-IPLocationFile = "."
+IPLocationFile = ""
#
###################################################################################################
diff --git a/src/server/game/Server/WorldSocket.cpp b/src/server/game/Server/WorldSocket.cpp
index 3f45e40a62a..36608a4a075 100644
--- a/src/server/game/Server/WorldSocket.cpp
+++ b/src/server/game/Server/WorldSocket.cpp
@@ -743,8 +743,8 @@ void WorldSocket::HandleAuthSessionCallback(std::shared_ptr<WorldPackets::Auth::
return;
}
- if (IpLocationRecord* location = sIPLocation->GetData(address))
- _ipCountry = location->country_code;
+ if (IpLocationRecord const* location = sIPLocation->GetLocationRecord(address))
+ _ipCountry = location->CountryCode;
///- Re-check ip locking (same check as in auth).
if (account.BattleNet.IsLockedToIP)
diff --git a/src/server/scripts/Commands/cs_account.cpp b/src/server/scripts/Commands/cs_account.cpp
index 2cb4ef8f0a3..f162b6465be 100644
--- a/src/server/scripts/Commands/cs_account.cpp
+++ b/src/server/scripts/Commands/cs_account.cpp
@@ -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);
diff --git a/src/server/scripts/Commands/cs_misc.cpp b/src/server/scripts/Commands/cs_misc.cpp
index 417153bfeff..56b7071a8a8 100644
--- a/src/server/scripts/Commands/cs_misc.cpp
+++ b/src/server/scripts/Commands/cs_misc.cpp
@@ -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(")");
}
}
diff --git a/src/server/worldserver/worldserver.conf.dist b/src/server/worldserver/worldserver.conf.dist
index 79005a69d3e..cfcde52c061 100644
--- a/src/server/worldserver/worldserver.conf.dist
+++ b/src/server/worldserver/worldserver.conf.dist
@@ -229,12 +229,11 @@ MySQLExecutable = ""
#
# IPLocationFile
# Description: The path to your IP2Location database CSV file.
-# Example: "C:/Trinity/IP2Location.csv"
-# "/home/trinity/IP2Location.csv"
-# Default: "." - (Current core directory)
-# "" - (Disabled)
+# Example: "C:/Trinity/IP2LOCATION-LITE-DB1.CSV"
+# "/home/trinity/IP2LOCATION-LITE-DB1.CSV"
+# Default: "" - (Disabled)
-IPLocationFile = "."
+IPLocationFile = ""
#
###################################################################################################