Implement ip2nation and ip2nationCountries

This commit is contained in:
Nefertumm
2017-06-30 01:54:22 -03:00
parent ef57d9ba69
commit 9d2484bfc7
8 changed files with 143 additions and 7 deletions

View File

@@ -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
{