diff options
author | KingPin <none@none> | 2008-10-20 12:59:45 -0500 |
---|---|---|
committer | KingPin <none@none> | 2008-10-20 12:59:45 -0500 |
commit | cdb7fd43eef1a4577da1af9012d302b0cd2de5bb (patch) | |
tree | 9ae1be3f5958265703d9701ac4b796c70c29ec99 /src/game/AccountMgr.cpp | |
parent | 35f378aef9e2da3b24b2adb182f165d52da6a09b (diff) |
[svn] * Minor code fixes
* Move account related functions from ObjectMgr to AccountMgr and drop duplicate functions - source mangos
* recognize the dummy spells 38637, 38638 and 38639 as negative - source mangos
* added new command ".reload all_locales". Now all locales_* tables can be reloaded - source mangos
--HG--
branch : trunk
Diffstat (limited to 'src/game/AccountMgr.cpp')
-rw-r--r-- | src/game/AccountMgr.cpp | 30 |
1 files changed, 28 insertions, 2 deletions
diff --git a/src/game/AccountMgr.cpp b/src/game/AccountMgr.cpp index b9bd00bb2cb..5deae7a75f9 100644 --- a/src/game/AccountMgr.cpp +++ b/src/game/AccountMgr.cpp @@ -18,7 +18,7 @@ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ -#include "AccountMgr.h" +#include "AccountAccessor.h" #include "Database/DatabaseEnv.h" #include "ObjectMgr.h" #include "Player.h" @@ -81,7 +81,7 @@ AccountOpResult AccountMgr::DeleteAccount(uint32 accid) uint64 guid = MAKE_NEW_GUID(guidlo, 0, HIGHGUID_PLAYER); // kick if player currently - if(Player* p = objmgr.GetPlayer(guid)) + if(Player* p = ObjectAccessor::FindPlayer(guid)) { WorldSession* s = p->GetSession(); s->KickPlayer(); // mark session to remove at next session list update @@ -168,6 +168,32 @@ uint32 AccountMgr::GetId(std::string username) } } +uint32 AccountMgr::GetSecurity(uint32 acc_id) +{ + QueryResult *result = loginDatabase.PQuery("SELECT gmlevel FROM account WHERE id = '%u'", acc_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); + if(result) + { + name = (*result)[0].GetCppString(); + delete result; + return true; + } + + return false; +} + bool AccountMgr::CheckPassword(uint32 accid, std::string passwd) { normilizeString(passwd); |