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

#include "StandingDB.h"

Inheritance diagram for StandingDB:
Collaboration diagram for StandingDB:

Public Member Functions

PyRepGetCorpStandings (Client *pClient)
 
PyRepGetCharStandings (Client *pClient)
 
PyRepPrimeCharStandings (uint32 charID)
 
PyRepGetCharNPCStandings (uint32 charID)
 
PyRepGetStandingTransactions (Call_GetStandingTransactions &args)
 
PyRepGetStandingCompositions (uint32 fromID, uint32 toID)
 
- Public Member Functions inherited from ServiceDB
uint32 GetStationOwner (uint32 stationID)
 

Static Public Member Functions

static PyObjectExGetFactionStandings ()
 
static float GetStanding (uint32 fromID, uint32 toID)
 
static void SetStanding (uint32 fromID, uint32 toID, float standing)
 
static void UpdateStanding (uint32 fromID, uint32 toID, float standing)
 
static void SaveStandingChanges (uint32 fromID, uint32 toID, uint16 eventType, float amount, std::string msg)
 
static PyRepGetMyStandings (uint32 charID)
 
- 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)
 

Additional Inherited Members

- 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 StandingDB.h.

Member Function Documentation

PyRep * StandingDB::GetCharNPCStandings ( uint32  charID)

Definition at line 86 of file StandingDB.cpp.

References DBResultToCRowset(), and sDatabase.

87 {
88  DBQueryResult res;
89  sDatabase.RunQuery(res, "SELECT fromID, toID, standing FROM chrNPCStandings WHERE toID = %u", charID);
90  return DBResultToCRowset(res);
91 }
#define sDatabase
Definition: dbcore.h:199
PyObjectEx * DBResultToCRowset(DBQueryResult &result)
Definition: EVEDBUtils.cpp:402

Here is the call graph for this function:

PyRep * StandingDB::GetCharStandings ( Client pClient)

Definition at line 71 of file StandingDB.cpp.

References DBResultToCRowset(), Client::GetCharacterID(), and sDatabase.

72 {
73  DBQueryResult res;
74  sDatabase.RunQuery(res, "SELECT fromID, toID, standing FROM repStandings WHERE toID = %u OR fromID = %u",
75  pClient->GetCharacterID(), pClient->GetCharacterID());
76  return DBResultToCRowset(res);
77 }
#define sDatabase
Definition: dbcore.h:199
PyObjectEx * DBResultToCRowset(DBQueryResult &result)
Definition: EVEDBUtils.cpp:402
int32 GetCharacterID() const
Definition: Client.h:113

Here is the call graph for this function:

PyRep * StandingDB::GetCorpStandings ( Client pClient)

Definition at line 79 of file StandingDB.cpp.

References DBResultToCRowset(), Client::GetCorporationID(), and sDatabase.

80 {
81  DBQueryResult res;
82  sDatabase.RunQuery(res, "SELECT fromID, toID, standing FROM repStandings WHERE toID = %u OR fromID = %u", pClient->GetCorporationID(), pClient->GetCorporationID());
83  return DBResultToCRowset(res);
84 }
#define sDatabase
Definition: dbcore.h:199
PyObjectEx * DBResultToCRowset(DBQueryResult &result)
Definition: EVEDBUtils.cpp:402
int32 GetCorporationID() const
Definition: Client.h:123

Here is the call graph for this function:

PyObjectEx * StandingDB::GetFactionStandings ( )
static

Definition at line 56 of file StandingDB.cpp.

References DBResultToCRowset(), and sDatabase.

Referenced by StandingMgr::Populate().

57 {
58  // repFactions table is ONLY faction standings
59  DBQueryResult res;
60  sDatabase.RunQuery(res, "SELECT fromID,toID,standing FROM repFactions");
61  return DBResultToCRowset(res);
62 }
#define sDatabase
Definition: dbcore.h:199
PyObjectEx * DBResultToCRowset(DBQueryResult &result)
Definition: EVEDBUtils.cpp:402

Here is the call graph for this function:

Here is the caller graph for this function:

PyRep * StandingDB::GetMyStandings ( uint32  charID)
static

Definition at line 64 of file StandingDB.cpp.

References DBResultToCRowset(), and sDatabase.

65 {
66  DBQueryResult res;
67  sDatabase.RunQuery(res, "SELECT fromID, standing AS rank FROM repStandings WHERE toID = %u", charID);
68  return DBResultToCRowset(res);
69 }
#define sDatabase
Definition: dbcore.h:199
PyObjectEx * DBResultToCRowset(DBQueryResult &result)
Definition: EVEDBUtils.cpp:402

Here is the call graph for this function:

float StandingDB::GetStanding ( uint32  fromID,
uint32  toID 
)
static

Definition at line 142 of file StandingDB.cpp.

References DBResultRow::GetFloat(), DBQueryResult::GetRow(), and sDatabase.

Referenced by Agent::CanUseAgent(), FactoryDB::GetAssemblyLineProperties(), Character::GetNPCCorpStanding(), ReprocessingServiceBound::GetStanding(), Character::GetStandingModified(), RamMethods::LinePermissionCheck(), and Agent::UpdateStandings().

143 {
144  DBQueryResult res;
145  sDatabase.RunQuery(res, "SELECT standing FROM repStandings WHERE fromID=%u AND toID=%u", fromID, toID);
146  DBResultRow row;
147  if (res.GetRow(row))
148  {
149  return row.GetFloat(0);
150  }
151  else
152  {
153  return 0.0f;
154  }
155 }
#define sDatabase
Definition: dbcore.h:199
float GetFloat(uint32 index) const
Definition: dbcore.cpp:682
bool GetRow(DBResultRow &into)
Definition: dbcore.cpp:552

Here is the call graph for this function:

Here is the caller graph for this function:

PyRep * StandingDB::GetStandingCompositions ( uint32  fromID,
uint32  toID 
)

Definition at line 184 of file StandingDB.cpp.

References PyStatic.

185 {
186  // ownerID, standing ...
187 
188  return PyStatic.NewNone();
189 }
#define PyStatic
Definition: PyRep.h:1209
PyRep * StandingDB::GetStandingTransactions ( Call_GetStandingTransactions &  args)
Todo:
update this for direction

Definition at line 112 of file StandingDB.cpp.

References DBerror::c_str(), codelog, DBResultToRowset(), DBQueryResult::error, and sDatabase.

113 {
114  //GetStandingTransactions(fromID, toID, direction, eventID, eventType, eventDateTime)
117  DBQueryResult res;
118  if (!sDatabase.RunQuery(res,
119  "SELECT"
120  " eventID,"
121  " eventTypeID,"
122  " eventDateTime,"
123  " fromID,"
124  " toID,"
125  " modification,"
126  " originalFromID,"
127  " originalToID,"
128  " int_1,"
129  " int_2,"
130  " int_3,"
131  " msg"
132  " FROM repStandingChanges"
133  " WHERE toID = %u AND fromID = %u",
134  args.toID, args.fromID))
135  {
136  codelog(SERVICE__ERROR, "Error in query: %s", res.error.c_str());
137  return nullptr;
138  }
139  return DBResultToRowset(res);
140 }
#define sDatabase
Definition: dbcore.h:199
* args
const char * c_str() const
Definition: dbcore.h:48
#define codelog(type, fmt,...)
Definition: logsys.h:128
PyObject * DBResultToRowset(DBQueryResult &result)
Definition: EVEDBUtils.cpp:81
DBerror error
Definition: dbcore.h:69

Here is the call graph for this function:

PyRep * StandingDB::PrimeCharStandings ( uint32  charID)
Todo:
not sure about this yet.... wip ....not used?

Definition at line 94 of file StandingDB.cpp.

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

95 {
96  DBQueryResult res;
97  if (!sDatabase.RunQuery(res,
98  "SELECT "
99  " itemID AS ownerID,"
100  " itemName AS ownerName,"
101  " typeID"
102  " FROM entity"
103  " WHERE itemID < 0"))
104  {
105  _log(DATABASE__ERROR, "Error in PrimeCharStandings query: %s", res.error.c_str());
106  return nullptr;
107  }
108 
109  return DBResultToRowset(res);
110 }
#define sDatabase
Definition: dbcore.h:199
#define _log(type, fmt,...)
Definition: logsys.h:124
const char * c_str() const
Definition: dbcore.h:48
PyObject * DBResultToRowset(DBQueryResult &result)
Definition: EVEDBUtils.cpp:81
DBerror error
Definition: dbcore.h:69

Here is the call graph for this function:

void StandingDB::SaveStandingChanges ( uint32  fromID,
uint32  toID,
uint16  eventType,
float  amount,
std::string  msg 
)
static
Todo:
implement repStandingChanges after standing system is working

Definition at line 174 of file StandingDB.cpp.

References GetFileTimeNow(), and sDatabase.

Referenced by StandingMgr::UpdateStandings().

175 {
176  /* eventTypeID,eventDateTime,fromID,toID,modification,originalFromID,originalToID,int_1,int_2,int_3,msg */
177  DBerror err;
178  sDatabase.RunQuery(err,
179  "INSERT INTO repStandingChanges (eventTypeID, eventDateTime, fromID, toID, modification, msg)"
180  " VALUES (%u, %f, %u, %u, %f, '%s' )",
181  eventType, GetFileTimeNow(), fromID, toID, amount, msg.c_str());
182 }
#define sDatabase
Definition: dbcore.h:199
double GetFileTimeNow()
Definition: utils_time.cpp:84
Definition: dbcore.h:39

Here is the call graph for this function:

Here is the caller graph for this function:

void StandingDB::SetStanding ( uint32  fromID,
uint32  toID,
float  standing 
)
static

Definition at line 157 of file StandingDB.cpp.

References sDatabase.

Referenced by Character::SetStanding().

158 {
159  DBerror err;
160  sDatabase.RunQuery(err, "INSERT INTO repStandings (fromID, toID, standing) VALUES (%u,%u,%f)", fromID, toID, standing);
161 }
#define sDatabase
Definition: dbcore.h:199
Definition: dbcore.h:39

Here is the caller graph for this function:

void StandingDB::UpdateStanding ( uint32  fromID,
uint32  toID,
float  standing 
)
static

Definition at line 163 of file StandingDB.cpp.

References sDatabase.

Referenced by StandingMgr::UpdateStandings().

164 {
165  DBerror err;
166  sDatabase.RunQuery(err,
167  "INSERT INTO repStandings (fromID, toID, standing)"
168  " VALUES (%u,%u,%f)"
169  " ON DUPLICATE KEY UPDATE standing = standing + %f",
170  fromID, toID, standing, standing);
171 }
#define sDatabase
Definition: dbcore.h:199
Definition: dbcore.h:39

Here is the caller graph for this function:


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