EvEmu  0.8.4
11 September 2021
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages
APIAccountDB Class Reference

#include "APIAccountDB.h"

Public Member Functions

 APIAccountDB ()
 
bool GetCharactersList (uint32 accountID, std::vector< std::string > &charIDList, std::vector< std::string > &charNameList, std::vector< std::string > &charCorpIDList, std::vector< std::string > &charCorpNameList)
 ? More...
 
bool GetAccountInfo (uint32 accountID, std::vector< std::string > &accountInfoList)
 ? More...
 

Detailed Description

Definition at line 31 of file APIAccountDB.h.

Constructor & Destructor Documentation

APIAccountDB::APIAccountDB ( )

Definition at line 30 of file APIAccountDB.cpp.

31 {
32 }

Member Function Documentation

bool APIAccountDB::GetAccountInfo ( uint32  accountID,
std::vector< std::string > &  accountInfoList 
)

?

?

Parameters
[in]?
[in]?
Return values
?

Definition at line 69 of file APIAccountDB.cpp.

References DBQueryResult::GetRow(), DBResultRow::GetText(), sDatabase, and sLog.

Referenced by APIAccountManager::_AccountStatus().

70 {
71  DBQueryResult res;
72 
73  // Get account table info using the accountID:
74  if( !sDatabase.RunQuery(res,
75  " SELECT "
76  " online, "
77  " banned, "
78  " logonCount, "
79  " lastLogin "
80  " FROM account "
81  " WHERE `accountID` = %u ", accountID ))
82  {
83  sLog.Error( "APIAccountDB::GetAccountInfo()", "Cannot find accountID %u", accountID );
84  return false;
85  }
86 
87  DBResultRow row;
88  if( !res.GetRow(row) )
89  {
90  sLog.Error( "APIServiceDB::GetAccountInfo()", "res.GetRow(row) failed for unknown reason." );
91  return false;
92  }
93 
94  accountInfoList.push_back( std::string(row.GetText(0)) );
95  accountInfoList.push_back( std::string(row.GetText(1)) );
96  accountInfoList.push_back( std::string(row.GetText(2)) );
97  accountInfoList.push_back( std::string(row.GetText(3)) );
98 
99  return true;
100 }
#define sDatabase
Definition: dbcore.h:199
const char * GetText(uint32 index) const
Definition: dbcore.h:104
bool GetRow(DBResultRow &into)
Definition: dbcore.cpp:552
#define sLog
Evaluates to a NewLog instance.
Definition: LogNew.h:250

Here is the call graph for this function:

Here is the caller graph for this function:

bool APIAccountDB::GetCharactersList ( uint32  accountID,
std::vector< std::string > &  charIDList,
std::vector< std::string > &  charNameList,
std::vector< std::string > &  charCorpIDList,
std::vector< std::string > &  charCorpNameList 
)

?

?

Parameters
[in]?
[in]?
Return values
?

Definition at line 34 of file APIAccountDB.cpp.

References DBQueryResult::GetRow(), DBResultRow::GetText(), sDatabase, and sLog.

Referenced by APIAccountManager::_Characters().

36 {
37  DBQueryResult res;
38 
39  // Get list of characters and their corporation info from the accountID:
40  if( !sDatabase.RunQuery(res,
41  " SELECT "
42  " character_.characterID, "
43  " character_.corporationID, "
44  " corporation.corporationName, "
45  " entity.itemName AS name "
46  " FROM `character_` "
47  " LEFT JOIN corporation ON corporation.corporationID = character_.corporationID "
48  " LEFT JOIN entity ON entity.itemID = character_.characterID "
49  " WHERE `accountID` = %u ", accountID ))
50  {
51  sLog.Error( "APIAccountDB::GetCharactersList()", "Cannot find accountID %u", accountID );
52  return false;
53  }
54 
55  DBResultRow row;
56  std::map<std::string, std::string> charInfo;
57  while( res.GetRow( row ) )
58  {
59  charIDList.push_back( std::string(row.GetText(0)) );
60  charCorpIDList.push_back( std::string(row.GetText(1)) );
61  charCorpNameList.push_back( std::string(row.GetText(2)) );
62  charNameList.push_back( std::string(row.GetText(3)) );
63  }
64 
65  return true;
66 }
#define sDatabase
Definition: dbcore.h:199
const char * GetText(uint32 index) const
Definition: dbcore.h:104
bool GetRow(DBResultRow &into)
Definition: dbcore.cpp:552
#define sLog
Evaluates to a NewLog instance.
Definition: LogNew.h:250

Here is the call graph for this function:

Here is the caller graph for this function:


The documentation for this class was generated from the following files: