[svn] * Use ObjectMgr/AccountMgr functions rather than DB queries. Source mangos

--HG--
branch : trunk
This commit is contained in:
KingPin committed 2008-10-21 19:07:16 -05:00
1 parent 96d1c9f4d6
commit 389a9e3cea
4 files changed
+24 -28

No files matched your search

+13
View File
@@ -1365,6 +1365,19 @@ uint32 ObjectMgr::GetPlayerAccountIdByGUID(const uint64 &guid) const
return 0;
}
uint32 ObjectMgr::GetPlayerAccountIdByPlayerName(std::string name) const
{
QueryResult *result = CharacterDatabase.PQuery("SELECT account FROM characters WHERE name = '%s'", name.c_str());
if(result)
{
uint32 acc = (*result)[0].GetUInt32();
delete result;
return acc;
}
return 0;
}
void ObjectMgr::LoadAuctions()
{
QueryResult *result = CharacterDatabase.Query("SELECT COUNT(*) FROM auctionhouse");