mirror of
https://github.com/mangosfour/server.git
synced 2025-12-13 04:37:00 +00:00
Use ObjectMgr/AccountMgr functions instead explici DB quaries.
This commit is contained in:
parent
42b077df0c
commit
911dbe0b29
4 changed files with 34 additions and 37 deletions
|
|
@ -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");
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue