feat(Common/IPLocation): replace ip2nation by ip2location (#5653)
This commit is contained in:
parent
8ba1ddb033
commit
3da83cc0e6
17 changed files with 306 additions and 167 deletions
|
|
@ -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
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue