aboutsummaryrefslogtreecommitdiff
path: root/src/game/AccountMgr.cpp
diff options
context:
space:
mode:
authormaanuel <none@none>2009-12-22 15:35:44 -0300
committermaanuel <none@none>2009-12-22 15:35:44 -0300
commitfafad0a3a4b53c58dadfb2d2003f763ebea331ae (patch)
tree094ed65b6c00c01ba87e9132f71a29b72e442883 /src/game/AccountMgr.cpp
parentce3073111e4365b7502efc4443038a437419e239 (diff)
Added new function "GetSecurity(targetAccountId, gmRealmID);" by ogeraisi.
Fixed command .account set gmlevel Fixed command .ticket assing by Sundark/ogeraisi. Improvements in .modify scale by ogeraisi. Repaired Remote Access by Sundark. The original patch of the access by realms was from ogeraisi/Kudlaty, not ilixiumemu like commit 6710 say. --HG-- branch : trunk
Diffstat (limited to 'src/game/AccountMgr.cpp')
-rw-r--r--src/game/AccountMgr.cpp15
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);