Use ObjectMgr/AccountMgr functions instead explici DB quaries.

This commit is contained in:
VladimirMangos 2008-10-21 18:09:35 +04:00
parent 42b077df0c
commit 911dbe0b29
4 changed files with 34 additions and 37 deletions

View file

@ -1296,6 +1296,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");