mirror of
https://github.com/mod-playerbots/azerothcore-wotlk.git
synced 2026-01-15 01:59:09 +00:00
feat(Common/IPLocation): replace ip2nation by ip2location (#5653)
This commit is contained in:
@@ -16,6 +16,7 @@
|
||||
#include "GroupMgr.h"
|
||||
#include "GuildMgr.h"
|
||||
#include "InstanceSaveMgr.h"
|
||||
#include "IPLocation.h"
|
||||
#include "Language.h"
|
||||
#include "LFG.h"
|
||||
#include "MapManager.h"
|
||||
@@ -1928,29 +1929,11 @@ public:
|
||||
lastIp = fields[4].GetString();
|
||||
lastLogin = fields[5].GetString();
|
||||
|
||||
/** if (IpLocationRecord const* location = sIPLocation->GetLocationRecord(lastIp))
|
||||
if (IpLocationRecord const* location = sIPLocation->GetLocationRecord(lastIp))
|
||||
{
|
||||
lastIp.append(" (");
|
||||
lastIp.append(location->CountryName);
|
||||
lastIp.append(")");
|
||||
} **/
|
||||
|
||||
uint32 ip = inet_addr(lastIp.c_str());
|
||||
#if ACORE_ENDIAN == BIGENDIAN
|
||||
EndianConvertReverse(ip);
|
||||
#endif
|
||||
stmt = LoginDatabase.GetPreparedStatement(LOGIN_SEL_IP2NATION_COUNTRY);
|
||||
|
||||
stmt->setUInt32(0, ip);
|
||||
|
||||
PreparedQueryResult result2 = LoginDatabase.Query(stmt);
|
||||
|
||||
if (result2)
|
||||
{
|
||||
Field* fields2 = result2->Fetch();
|
||||
lastIp.append(" (");
|
||||
lastIp.append(fields2[0].GetString());
|
||||
lastIp.append(")");
|
||||
}
|
||||
}
|
||||
else
|
||||
|
||||
Reference in New Issue
Block a user