Core/Commands: Add support for ip2nation database lookups when using .pinfo command.
This will (when a full database exists) allow for seeing (approximately) which country a player might be from when doing .pinfo <player> Note: External data required for this patch to work correctly can be found at http://www.ip2nation.com/ip2nation/Download Signed-off-by: click <[email protected]>
This commit is contained in:
@@ -1625,6 +1625,9 @@ void World::SetInitialWorldSettings()
|
||||
sLog->outString("Loading Autobroadcasts...");
|
||||
LoadAutobroadcasts();
|
||||
|
||||
sLog->outString("Loading Ip2nation...");
|
||||
LoadIp2nation();
|
||||
|
||||
///- Load and initialize scripts
|
||||
sObjectMgr->LoadQuestStartScripts(); // must be after load Creature/Gameobject(Template/Data) and QuestTemplate
|
||||
sObjectMgr->LoadQuestEndScripts(); // must be after load Creature/Gameobject(Template/Data) and QuestTemplate
|
||||
@@ -1881,6 +1884,23 @@ void World::LoadAutobroadcasts()
|
||||
sLog->outString();
|
||||
}
|
||||
|
||||
void World::LoadIp2nation()
|
||||
{
|
||||
uint32 oldMSTime = getMSTime();
|
||||
|
||||
QueryResult result = WorldDatabase.Query("SELECT count(c.code) FROM ip2nationCountries c, ip2nation i WHERE c.code = i.country");
|
||||
uint32 count = 0;
|
||||
|
||||
if (result)
|
||||
{
|
||||
Field* fields = result->Fetch();
|
||||
count = fields[0].GetUInt32();
|
||||
}
|
||||
|
||||
sLog->outString(">> Loaded %u ip2nation definitions in %u ms", count, GetMSTimeDiffToNow(oldMSTime));
|
||||
sLog->outString();
|
||||
}
|
||||
|
||||
/// Update the World !
|
||||
void World::Update(uint32 diff)
|
||||
{
|
||||
|
||||
@@ -740,6 +740,8 @@ class World
|
||||
|
||||
void LoadAutobroadcasts();
|
||||
|
||||
void LoadIp2nation();
|
||||
|
||||
void UpdateAreaDependentAuras();
|
||||
|
||||
void ProcessStartEvent();
|
||||
|
||||
Reference in New Issue
Block a user