From 9d2484bfc7298473083306d24f278d7bf5730697 Mon Sep 17 00:00:00 2001 From: Nefertumm Date: Fri, 30 Jun 2017 01:54:22 -0300 Subject: Implement ip2nation and ip2nationCountries --- 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 6fadd18e76..6ce0175e14 100644 --- a/src/scripts/Commands/cs_misc.cpp +++ b/src/scripts/Commands/cs_misc.cpp @@ -1883,7 +1883,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