Core: Add function to find players by low guid

--HG--
branch : trunk
This commit is contained in:
Spp
2010-09-13 09:16:57 +02:00
parent 62d0d8921d
commit 6e55c22a12
2 changed files with 9 additions and 2 deletions
+8 -2
View File
@@ -312,7 +312,7 @@ Group * ObjectMgr::GetGroupByGUID(uint32 guid) const
return NULL;
}
Guild * ObjectMgr::GetGuildById(uint32 GuildId) const
Guild* ObjectMgr::GetGuildById(uint32 GuildId) const
{
GuildMap::const_iterator itr = mGuildMap.find(GuildId);
if (itr != mGuildMap.end())
@@ -321,7 +321,7 @@ Guild * ObjectMgr::GetGuildById(uint32 GuildId) const
return NULL;
}
Guild * ObjectMgr::GetGuildByName(const std::string& guildname) const
Guild* ObjectMgr::GetGuildByName(const std::string& guildname) const
{
std::string search = guildname;
std::transform(search.begin(), search.end(), search.begin(), ::toupper);
@@ -1840,6 +1840,12 @@ void ObjectMgr::LoadGameobjectRespawnTimes()
sLog.outString();
}
Player* ObjectMgr::GetPlayerByLowGUID(uint32 lowguid) const
{
uint64 guid = MAKE_NEW_GUID(lowguid, 0, HIGHGUID_PLAYER);
return ObjectAccessor::FindPlayer(guid);
}
// name must be checked to correctness (if received) before call this function
uint64 ObjectMgr::GetPlayerGUIDByName(std::string name) const
{
+1
View File
@@ -394,6 +394,7 @@ class ObjectMgr
Player* GetPlayer(const char* name) const { return sObjectAccessor.FindPlayerByName(name);}
Player* GetPlayer(uint64 guid) const { return ObjectAccessor::FindPlayer(guid); }
Player* GetPlayerByLowGUID(uint32 lowguid) const;
static GameObjectInfo const *GetGameObjectInfo(uint32 id) { return sGOStorage.LookupEntry<GameObjectInfo>(id); }
int LoadReferenceVendor(int32 vendor, int32 item_id, std::set<uint32> *skip_vendors);