summaryrefslogtreecommitdiff
path: root/src/scripts/Commands/cs_misc.cpp
diff options
context:
space:
mode:
authorNefertumm <nefertumtg@gmail.com>2017-06-30 01:54:22 -0300
committerNefertumm <nefertumtg@gmail.com>2017-06-30 01:54:22 -0300
commit9d2484bfc7298473083306d24f278d7bf5730697 (patch)
tree24ee87ed72da98b324ad3d1ac5a589c4da7b3b8d /src/scripts/Commands/cs_misc.cpp
parentef57d9ba69d4ee1485730e8ebb1374dbf5466f05 (diff)
Implement ip2nation and ip2nationCountries
Diffstat (limited to 'src/scripts/Commands/cs_misc.cpp')
-rw-r--r--src/scripts/Commands/cs_misc.cpp12
1 files changed, 12 insertions, 0 deletions
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
{