From fd684a858c877fca1f248a1affab8a9c014254c9 Mon Sep 17 00:00:00 2001 From: Nefertumm Date: Sun, 20 Aug 2017 01:00:00 -0300 Subject: Implement ip2nation and ip2nationCountries (#518) * Implement ip2nation and ip2nationCountries * fix account.sql * Tabs * Codestyle * More codestyle * Maybe not. Fk travis. * Missing field on LOGIN_SEL_ACCOUNT_INFO_BY_NAME * Update WorldSocket.cpp --- src/scripts/Commands/cs_misc.cpp | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'src/scripts/Commands/cs_misc.cpp') diff --git a/src/scripts/Commands/cs_misc.cpp b/src/scripts/Commands/cs_misc.cpp index 3ad187cac5..1af226c38e 100644 --- a/src/scripts/Commands/cs_misc.cpp +++ b/src/scripts/Commands/cs_misc.cpp @@ -1887,7 +1887,19 @@ public: #if TRINITY_ENDIAN == BIGENDIAN EndianConvertReverse(ip); #endif + PreparedStatement* stmt = LoginDatabase.GetPreparedStatement(LOGIN_SEL_IP2NATION_COUNTRY); + stmt->setUInt32(0, ip); + + PreparedQueryResult result2 = WorldDatabase.Query(stmt); + + if (result2) + { + Field* fields2 = result2->Fetch(); + lastIp.append(" ("); + lastIp.append(fields2[0].GetString()); + lastIp.append(")"); + } } else { -- cgit v1.2.3