Show
Ignore:
Timestamp:
11/19/08 13:32:21 (17 years ago)
Author:
yumileroy
Message:

[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

Original author: KingPin?
Date: 2008-10-20 12:59:45-05:00

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • trunk/src/game/AccountMgr.cpp

    r44 r79  
    1919 */ 
    2020 
    21 #include "AccountMgr.h" 
     21#include "AccountAccessor.h" 
    2222#include "Database/DatabaseEnv.h" 
    2323#include "ObjectMgr.h" 
     
    8282 
    8383            // kick if player currently 
    84             if(Player* p = objmgr.GetPlayer(guid)) 
     84            if(Player* p = ObjectAccessor::FindPlayer(guid)) 
    8585            { 
    8686                WorldSession* s = p->GetSession(); 
     
    169169} 
    170170 
     171uint32 AccountMgr::GetSecurity(uint32 acc_id) 
     172{ 
     173    QueryResult *result = loginDatabase.PQuery("SELECT gmlevel FROM account WHERE id = '%u'", acc_id); 
     174    if(result) 
     175    { 
     176        uint32 sec = (*result)[0].GetUInt32(); 
     177        delete result; 
     178        return sec; 
     179    } 
     180 
     181    return 0; 
     182} 
     183 
     184bool AccountMgr::GetName(uint32 acc_id, std::string &name) 
     185{ 
     186    QueryResult *result = loginDatabase.PQuery("SELECT username FROM account WHERE id = '%u'", acc_id); 
     187    if(result) 
     188    { 
     189        name = (*result)[0].GetCppString(); 
     190        delete result; 
     191        return true; 
     192    } 
     193 
     194    return false; 
     195} 
     196 
    171197bool AccountMgr::CheckPassword(uint32 accid, std::string passwd) 
    172198{