TrinityCore
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages
AccountInfo Struct Reference

Public Member Functions

bool IsBanned () const
 
 AccountInfo (Field *fields)
 

Public Attributes

struct {
   uint32   Id
 
   bool   IsLockedToIP
 
   std::string   LastIP
 
   std::string   LockCountry
 
   LocaleConstant   Locale
 
   bool   IsBanned
 
BattleNet
 
struct {
   uint32   Id
 
   BigNumber   SessionKey
 
   uint8   Expansion
 
   int64   MuteTime
 
   uint32   Recruiter
 
   std::string   OS
 
   bool   IsRectuiter
 
   AccountTypes   Security
 
   bool   IsBanned
 
Game
 

Constructor & Destructor Documentation

AccountInfo::AccountInfo ( Field fields)
inlineexplicit
622  {
623  // 0 1 2 3 4 5 6 7 8 9 10 11
624  // SELECT a.id, a.sessionkey, ba.last_ip, ba.locked, ba.lock_country, a.expansion, a.mutetime, ba.locale, a.recruiter, a.os, ba.id, aa.gmLevel,
625  // 12 13 14
626  // bab.unbandate > UNIX_TIMESTAMP() OR bab.unbandate = bab.bandate, ab.unbandate > UNIX_TIMESTAMP() OR ab.unbandate = ab.bandate, r.id
627  // FROM account a LEFT JOIN battlenet_accounts ba ON a.battlenet_account = ba.id LEFT JOIN account_access aa ON a.id = aa.id AND aa.RealmID IN (-1, ?)
628  // LEFT JOIN battlenet_account_bans bab ON ba.id = bab.id LEFT JOIN account_banned ab ON a.id = ab.id LEFT JOIN account r ON a.id = r.recruiter
629  // WHERE a.username = ? ORDER BY aa.RealmID DESC LIMIT 1
630  Game.Id = fields[0].GetUInt32();
631  Game.SessionKey.SetHexStr(fields[1].GetCString());
632  BattleNet.LastIP = fields[2].GetString();
633  BattleNet.IsLockedToIP = fields[3].GetBool();
634  BattleNet.LockCountry = fields[4].GetString();
635  Game.Expansion = fields[5].GetUInt8();
636  Game.MuteTime = fields[6].GetInt64();
637  BattleNet.Locale = LocaleConstant(fields[7].GetUInt8());
638  Game.Recruiter = fields[8].GetUInt32();
639  Game.OS = fields[9].GetString();
640  BattleNet.Id = fields[10].GetUInt32();
641  Game.Security = AccountTypes(fields[11].GetUInt8());
642  BattleNet.IsBanned = fields[12].GetUInt64() != 0;
643  Game.IsBanned = fields[13].GetUInt64() != 0;
644  Game.IsRectuiter = fields[14].GetUInt32() != 0;
645 
646  uint32 world_expansion = sWorld->getIntConfig(CONFIG_EXPANSION);
647  if (Game.Expansion > world_expansion)
648  Game.Expansion = world_expansion;
649 
650  if (BattleNet.Locale >= TOTAL_LOCALES)
651  BattleNet.Locale = LOCALE_enUS;
652  }
struct AccountInfo::@323 Game
uint64 GetUInt64() const
Definition: Field.h:184
int64 GetInt64() const
Definition: Field.h:203
#define sWorld
Definition: World.h:887
uint8 GetUInt8() const
Definition: Field.h:70
LocaleConstant
Definition: Common.h:115
uint32_t uint32
Definition: Define.h:150
AccountTypes
Definition: Common.h:106
Definition: World.h:278
Definition: Common.h:117
uint32 GetUInt32() const
Definition: Field.h:146
struct AccountInfo::@322 BattleNet
bool GetBool() const
Definition: Field.h:65
std::string GetString() const
Definition: Field.h:276
Definition: Common.h:130

+ Here is the call graph for this function:

Member Function Documentation

bool AccountInfo::IsBanned ( ) const
inline
619 { return BattleNet.IsBanned || Game.IsBanned; }
struct AccountInfo::@323 Game
struct AccountInfo::@322 BattleNet

Member Data Documentation

struct { ... } AccountInfo::BattleNet
uint8 AccountInfo::Expansion
struct { ... } AccountInfo::Game
uint32 AccountInfo::Id
bool AccountInfo::IsBanned
bool AccountInfo::IsLockedToIP
bool AccountInfo::IsRectuiter
std::string AccountInfo::LastIP
LocaleConstant AccountInfo::Locale
std::string AccountInfo::LockCountry
int64 AccountInfo::MuteTime
std::string AccountInfo::OS
uint32 AccountInfo::Recruiter
AccountTypes AccountInfo::Security
BigNumber AccountInfo::SessionKey

The documentation for this struct was generated from the following file: