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

#include "ReprocessingDB.h"

Inheritance diagram for ReprocessingDB:
Collaboration diagram for ReprocessingDB:

Public Member Functions

bool GetRecoverables (const uint32 typeID, std::vector< Recoverable > &into)
 
- 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 37 of file ReprocessingDB.h.

Member Function Documentation

bool ReprocessingDB::GetRecoverables ( const uint32  typeID,
std::vector< Recoverable > &  into 
)

Definition at line 30 of file ReprocessingDB.cpp.

References _log, Recoverable::amountPerBatch, DBerror::c_str(), DBQueryResult::error, DBResultRow::GetInt(), DBQueryResult::GetRow(), sDatabase, and Recoverable::typeID.

Referenced by ReprocessingServiceBound::GetQuote().

30  {
31  DBQueryResult res;
32  DBResultRow row;
33 
34  if (!sDatabase.RunQuery(res,
35  "SELECT requiredTypeID, MIN(quantity) FROM ramTypeRequirements"
36  " LEFT JOIN invBlueprintTypes ON typeID = blueprintTypeID"
37  " WHERE damagePerJob = 1 AND ("
38  " (activityID = 6 AND typeID = %u)"
39  " OR"
40  " (activityID = 1 AND productTypeID = %u))"
41  " GROUP BY requiredTypeID",
42  typeID, typeID, typeID))
43  {
44  _log(DATABASE__ERROR, "Unable to get recoverables for type ID %u: '%s'", typeID, res.error.c_str());
45  return false;
46  }
47 
48 
49  while (res.GetRow(row)) {
50  Recoverable rec = Recoverable();
51  rec.typeID = row.GetInt(0);
52  rec.amountPerBatch = row.GetInt(1);
53  into.push_back(rec);
54  }
55 
56  //eve-dev says tech 2 items contain both basic materials and advanced materials
57  //if(gotFromRamTable) return true;
58 
59  if (!sDatabase.RunQuery(res,
60  "SELECT materialTypeID, quantity"
61  " FROM invTypeMaterials"
62  " WHERE typeID=%u",
63  typeID))
64  {
65  _log(DATABASE__ERROR, "Unable to get recoverables for ore ID %u: '%s'", typeID, res.error.c_str());
66  return false;
67  }
68 
69  while (res.GetRow(row)) {
70  Recoverable rec = Recoverable();
71  rec.typeID = row.GetInt(0);
72  rec.amountPerBatch = row.GetInt(1);
73  into.push_back(rec);
74  }
75 
76  return true;
77 }
#define sDatabase
Definition: dbcore.h:199
#define _log(type, fmt,...)
Definition: logsys.h:124
int32 GetInt(uint32 index) const
Definition: dbcore.cpp:635
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:

Here is the caller graph for this function:


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