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

#include "FactionWarMgrDB.h"

Inheritance diagram for FactionWarMgrDB:
Collaboration diagram for FactionWarMgrDB:

Public Member Functions

PyRepGetWarFactions ()
 
PyRepGetFacWarSystems ()
 
uint32 GetFactionMilitiaCorporation (const uint32 factionID)
 
- Public Member Functions inherited from ServiceDB
uint32 GetStationOwner (uint32 stationID)
 

Additional Inherited Members

- Static Public Member Functions inherited from ServiceDB
static bool GetAccountInformation (CryptoChallengePacket &ccp, AccountData &aData, std::string &failMsg)
 
static bool UpdateAccountHash (const char *username, std::string &hash)
 
static bool IncrementLoginCount (uint32 accountID)
 
static void UpdatePassword (uint32 accountID, const char *pass)
 
static void SaveKillOrLoss (CharKillData &data)
 
static bool GetConstant (const char *name, uint32 &into)
 
static void SetServerOnlineStatus (bool online=false)
 
static void SetCharacterOnlineStatus (uint32 char_id, bool online=false)
 
static void SetAccountOnlineStatus (uint32 accountID, bool online=false)
 
static void SetAccountBanStatus (uint32 accountID, bool banned=false)
 
static void SaveServerStats (double threads, float rss, float vm, float user, float kernel, uint32 items, uint32 bubbles)
 
static uint32 SetClientSeed ()
 
static PyRepLookupChars (const char *match, bool exact=false)
 
static PyRepLookupOwners (const char *match, bool exact=false)
 
static PyRepLookupCorporations (const std::string &)
 
static PyRepLookupFactions (const std::string &)
 
static PyRepLookupCorporationTickers (const std::string &)
 
static PyRepLookupStations (const std::string &)
 
static PyRepLookupKnownLocationsByGroup (const std::string &, uint32)
 
static PyRepPrimeOwners (std::vector< int32 > &itemIDs)
 
static bool ValidateAccountName (CryptoChallengePacket &ccp, std::string &failMsg)
 
static void GetCorpHangarNames (uint32 corpID, std::map< uint8, std::string > &hangarNames)
 
- Protected Member Functions inherited from ServiceDB
void ProcessStringChange (const char *key, const std::string &oldValue, std::string newValue, PyDict *notif, std::vector< std::string > &dbQ)
 
void ProcessRealChange (const char *key, double oldValue, double newValue, PyDict *notif, std::vector< std::string > &dbQ)
 
void ProcessIntChange (const char *key, uint32 oldValue, uint32 newValue, PyDict *notif, std::vector< std::string > &dbQ)
 
void ProcessLongChange (const char *key, int64 oldValue, int64 newValue, PyDict *notif, std::vector< std::string > &dbQ)
 
- Static Protected Member Functions inherited from ServiceDB
static uint32 CreateNewAccount (const char *login, const char *pass, const char *passHash, int64 role)
 

Detailed Description

Definition at line 33 of file FactionWarMgrDB.h.

Member Function Documentation

uint32 FactionWarMgrDB::GetFactionMilitiaCorporation ( const uint32  factionID)

Definition at line 73 of file FactionWarMgrDB.cpp.

References _log, DBerror::c_str(), DBQueryResult::error, DBQueryResult::GetRow(), DBResultRow::GetUInt(), and sDatabase.

73  {
74  DBQueryResult res;
75 
76  if (!sDatabase.RunQuery(res,
77  "SELECT militiaCorporationID"
78  " FROM facFactions"
79  " WHERE factionID=%u",
80  factionID))
81  {
82  _log(DATABASE__ERROR, "Failed to query militia corporation for faction %u: %s.", factionID, res.error.c_str());
83  return 0;
84  }
85 
86  DBResultRow row;
87  if (!res.GetRow(row)) {
88  _log(FACWAR__DB_WARNING, "Faction %u not found.", factionID);
89  return 0;
90  }
91 
92  return row.GetUInt(0);
93 }
#define sDatabase
Definition: dbcore.h:199
#define _log(type, fmt,...)
Definition: logsys.h:124
uint32 GetUInt(uint32 index) const
Definition: dbcore.cpp:658
bool GetRow(DBResultRow &into)
Definition: dbcore.cpp:552
const char * c_str() const
Definition: dbcore.h:48
DBerror error
Definition: dbcore.h:69

Here is the call graph for this function:

PyRep * FactionWarMgrDB::GetFacWarSystems ( )

Definition at line 51 of file FactionWarMgrDB.cpp.

References _log, DBerror::c_str(), DBQueryResult::error, DBResultRow::GetInt(), DBQueryResult::GetRow(), sDatabase, PyDict::SetItem(), and PyDict::SetItemString().

52 { /* done -allan 03May16 */
53  DBQueryResult res;
54  if (!sDatabase.RunQuery(res,
55  "SELECT systemID, occupierID, factionID FROM facWarSystems"))
56  {
57  _log(DATABASE__ERROR, "Failed to query war factions: %s.", res.error.c_str());
58  return nullptr;
59  }
60 
61  PyDict* result = new PyDict();
62  PyDict* dict;
63  DBResultRow row;
64  while (res.GetRow(row)) {
65  dict = new PyDict();
66  dict->SetItemString("occupierID", new PyInt(row.GetInt(1)));
67  dict->SetItemString("factionID", new PyInt(row.GetInt(2)));
68  result->SetItem(new PyInt(row.GetInt(0)), dict );
69  }
70  return result;
71 }
#define sDatabase
Definition: dbcore.h:199
#define _log(type, fmt,...)
Definition: logsys.h:124
int32 GetInt(uint32 index) const
Definition: dbcore.cpp:635
Python's dictionary.
Definition: PyRep.h:719
bool GetRow(DBResultRow &into)
Definition: dbcore.cpp:552
const char * c_str() const
Definition: dbcore.h:48
Python integer.
Definition: PyRep.h:231
DBerror error
Definition: dbcore.h:69
void SetItem(PyRep *key, PyRep *value)
SetItem adds or sets a database entry.
Definition: PyRep.cpp:713
void SetItemString(const char *key, PyRep *value)
SetItemString adds or sets a database entry.
Definition: PyRep.h:812

Here is the call graph for this function:

PyRep * FactionWarMgrDB::GetWarFactions ( )

Definition at line 36 of file FactionWarMgrDB.cpp.

References _log, DBerror::c_str(), DBResultToIntIntDict(), DBQueryResult::error, and sDatabase.

36  {
37  DBQueryResult res;
38 
39  if (!sDatabase.RunQuery(res,
40  "SELECT factionID, militiaCorporationID"
41  " FROM facFactions"
42  " WHERE militiaCorporationID IS NOT NULL"))
43  {
44  _log(DATABASE__ERROR, "Failed to query war factions: %s.", res.error.c_str());
45  return nullptr;
46  }
47 
48  return DBResultToIntIntDict(res);
49 }
#define sDatabase
Definition: dbcore.h:199
#define _log(type, fmt,...)
Definition: logsys.h:124
PyDict * DBResultToIntIntDict(DBQueryResult &result)
Definition: EVEDBUtils.cpp:273
const char * c_str() const
Definition: dbcore.h:48
DBerror error
Definition: dbcore.h:69

Here is the call graph for this function:


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