aboutsummaryrefslogtreecommitdiff
path: root/src/game/ObjectMgr.cpp
diff options
context:
space:
mode:
authorKingPin <none@none>2008-10-21 19:07:16 -0500
committerKingPin <none@none>2008-10-21 19:07:16 -0500
commit389a9e3cea196275e13f4eb66ef99fb631607631 (patch)
tree1fd3f0fe6b8c6fe61a46a095fa44231cdb8441fb /src/game/ObjectMgr.cpp
parent96d1c9f4d6194bb5ebc26e12df5d2ee92a0a8032 (diff)
[svn] * Use ObjectMgr/AccountMgr functions rather than DB queries. Source mangos
--HG-- branch : trunk
Diffstat (limited to 'src/game/ObjectMgr.cpp')
-rw-r--r--src/game/ObjectMgr.cpp13
1 files changed, 13 insertions, 0 deletions
diff --git a/src/game/ObjectMgr.cpp b/src/game/ObjectMgr.cpp
index e069ed894de..6be6307a0f1 100644
--- a/src/game/ObjectMgr.cpp
+++ b/src/game/ObjectMgr.cpp
@@ -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");