diff options
| author | Machiavelli <none@none> | 2009-12-22 19:40:12 +0100 |
|---|---|---|
| committer | Machiavelli <none@none> | 2009-12-22 19:40:12 +0100 |
| commit | b7ea59daf20b25f8e2690bd327ebee5db0998aa6 (patch) | |
| tree | c8108883ceb8b7293d0683a682ce7e892163a7c4 /src/game/AccountMgr.cpp | |
| parent | 749ca9ea8fb32f6add68f81fb477f07b061fa65e (diff) | |
| parent | fafad0a3a4b53c58dadfb2d2003f763ebea331ae (diff) | |
Merge
--HG--
branch : trunk
Diffstat (limited to 'src/game/AccountMgr.cpp')
| -rw-r--r-- | src/game/AccountMgr.cpp | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/src/game/AccountMgr.cpp b/src/game/AccountMgr.cpp index 12da998901b..4da2462abfa 100644 --- a/src/game/AccountMgr.cpp +++ b/src/game/AccountMgr.cpp @@ -179,6 +179,21 @@ uint32 AccountMgr::GetSecurity(uint32 acc_id) return 0; } +uint32 AccountMgr::GetSecurity(uint32 acc_id, int32 realm_id) +{ + QueryResult *result = (realm_id == -1) + ? loginDatabase.PQuery("SELECT gmlevel FROM account_access WHERE id = '%u' AND RealmID = '%d'", acc_id, realm_id) + : loginDatabase.PQuery("SELECT gmlevel FROM account_access WHERE id = '%u' AND (RealmID = '%d' OR RealmID = '-1')", acc_id, realm_id); + if(result) + { + uint32 sec = (*result)[0].GetUInt32(); + delete result; + return sec; + } + + return 0; +} + bool AccountMgr::GetName(uint32 acc_id, std::string &name) { QueryResult *result = loginDatabase.PQuery("SELECT username FROM account WHERE id = '%u'", acc_id); |
