EvEmu  0.8.4
11 September 2021
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages
ServiceDB.cpp
Go to the documentation of this file.
1 /*
2  ------------------------------------------------------------------------------------
3  LICENSE:
4  ------------------------------------------------------------------------------------
5  This file is part of EVEmu: EVE Online Server Emulator
6  Copyright 2006 - 2021 The EVEmu Team
7  For the latest information visit https://evemu.dev
8  ------------------------------------------------------------------------------------
9  This program is free software; you can redistribute it and/or modify it under
10  the terms of the GNU Lesser General Public License as published by the Free Software
11  Foundation; either version 2 of the License, or (at your option) any later
12  version.
13 
14  This program is distributed in the hope that it will be useful, but WITHOUT
15  ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
16  FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.
17 
18  You should have received a copy of the GNU Lesser General Public License along with
19  this program; if not, write to the Free Software Foundation, Inc., 59 Temple
20  Place - Suite 330, Boston, MA 02111-1307, USA, or go to
21  http://www.gnu.org/copyleft/lesser.txt.
22  ------------------------------------------------------------------------------------
23  Author: Zhur
24  Updates: Allan
25 */
26 
27 #include <boost/algorithm/string.hpp>
28 #include "eve-server.h"
29 
30 #include "EntityList.h"
31 #include "EVEServerConfig.h"
32 #include "ServiceDB.h"
33 
35 {
36  DBQueryResult res;
37  sDatabase.RunQuery(res, "SELECT ClientSeed FROM srvStatus WHERE AI = 1");
38  DBResultRow row;
39  res.GetRow(row);
40  return row.GetInt(0);
41 }
42 
43 bool ServiceDB::ValidateAccountName(CryptoChallengePacket& ccp, std::string& failMsg)
44 {
45 
46  if (ccp.user_name.empty()) {
47  failMsg = "Account Name is empty.";
48  return false;
49  }
50  if (ccp.user_name.length() < 3) {
51  failMsg = "Account Name is too short.";
52  return false;
53  }
54  //if (name.length() < 4)
55  // throw UserError ("CharNameInvalidMinLength");
56  if (ccp.user_name.length() > 20) { //client caps at 24
57  failMsg = "Account Name is too long.";
58  return false;
59  }
60 
61  for (const auto cur : badChars)
62  if (EvE::icontains(ccp.user_name, cur)) {
63  failMsg = "Account Name contains invalid characters.";
64  return false;
65  }
66 
67  return true;
68 }
69 
70 bool ServiceDB::GetAccountInformation( CryptoChallengePacket& ccp, AccountData& aData, std::string& failMsg )
71 {
72  //added auto account -allan 18Jan14 -UD 16Jan18 -ud 15Dec18 -ud failMsgs 15Jun19 -ud type 4Nov20
73  std::string eLogin;
74  sDatabase.DoEscapeString(eLogin, ccp.user_name);
75 
76  DBQueryResult res;
77  if ( !sDatabase.RunQuery( res,
78  "SELECT accountID, clientID, password, hash, role, type, online, banned, logonCount, lastLogin"
79  " FROM account WHERE accountName = '%s'", eLogin.c_str() ) )
80  {
81  sLog.Error( "ServiceDB", "Error in query: %s.", res.error.c_str() );
82  failMsg = "Error in DB Query";
83  failMsg += ": Account not found for ";
84  failMsg += eLogin;
85  //failMsg += res.error.c_str(); // do we wanna sent the db error msg to client?
86  return false;
87  }
88 
89  DBResultRow row;
90  if (!res.GetRow( row )) {
91  // account not found, create new one if autoAccountRole is not zero (0)
92  if (sConfig.account.autoAccountRole > 0) {
93  std::string ePass, ePassHash;
94  sDatabase.DoEscapeString(ePass, ccp.user_password);
95  sDatabase.DoEscapeString(ePassHash, ccp.user_password_hash);
96  uint32 accountID = CreateNewAccount( eLogin.c_str(), ePass.c_str(), ePassHash.c_str(), sConfig.account.autoAccountRole);
97  if ( accountID > 0 ) {
98  // add new account successful, get account info
99  return GetAccountInformation(ccp, aData, failMsg);
100  } else {
101  failMsg = "Failed to create a new account.";
102  return false;
103  }
104  } else {
105  failMsg = "That account doesn't exist and AutoAccount is disabled.";
106  return false;
107  }
108  }
109 
110  aData.name = eLogin;
111  aData.id = row.GetInt(0);
112  aData.clientID = row.GetInt(1);
113  aData.password = (row.IsNull(2) ? "" : row.GetText(2));
114  aData.hash = (row.IsNull(3) ? "" : row.GetText(3));
115  aData.role = row.GetInt64(4);
116  aData.type = row.GetUInt(5);
117  aData.online = row.GetInt(6) ? true : false;
118  aData.banned = row.GetInt(7) ? true : false;
119  aData.visits = row.GetInt(8);
120  aData.last_login = (row.IsNull(9) ? "" : row.GetText(9));
121 
122  return true;
123 }
124 
125 bool ServiceDB::UpdateAccountHash( const char* username, std::string & hash )
126 {
127  std::string eLogin, eHash;
128  sDatabase.DoEscapeString(eLogin, username);
129  sDatabase.DoEscapeString(eHash, hash);
130 
131  DBerror err;
132  if (!sDatabase.RunQuery(err, "UPDATE account SET hash='%s' WHERE accountName='%s'", eHash.c_str(), eLogin.c_str())) {
133  sLog.Error( "AccountDB", "Unable to update account information for: %s.", username );
134  return false;
135  }
136 
137  return true;
138 }
139 
141 {
142  DBerror err;
143  if (!sDatabase.RunQuery(err, "UPDATE account SET lastLogin=now(), logonCount=logonCount+1 WHERE accountID=%u", accountID)) {
144  sLog.Error( "AccountDB", "Unable to update account information for accountID %u.", accountID);
145  return false;
146  }
147 
148  return true;
149 }
150 
151 uint32 ServiceDB::CreateNewAccount( const char* login, const char* pass, const char* passHash, int64 role )
152 {
153  uint32 accountID = 0;
154  uint32 clientID = sEntityList.GetClientSeed();
155 
156  DBerror err;
157  if ( !sDatabase.RunQueryLID( err, accountID,
158  "INSERT INTO account ( accountName, password, hash, role, clientID )"
159  " VALUES ( '%s', '%s', '%s', %li, %u )",
160  login, pass, passHash, role, clientID ) )
161  {
162  sLog.Error( "ServiceDB", "Failed to create a new account '%s':'%s': %s.", login, pass, err.c_str() );
163  return 0;
164  }
165 
166  sDatabase.RunQuery(err, "UPDATE srvStatus SET ClientSeed = ClientSeed + 1 WHERE AI = 1");
167  return accountID;
168 }
169 
170 void ServiceDB::UpdatePassword(uint32 accountID, const char* pass)
171 {
172  DBerror err;
173  sDatabase.RunQuery(err, "UPDATE account SET password = '%s' WHERE accountID=%u", pass, accountID);
174 }
175 
176 
177 void ServiceDB::SetCharacterOnlineStatus(uint32 char_id, bool online) {
178  _log(CLIENT__TRACE, "ServiceDB: Setting character %u %s.", char_id, online ? "Online" : "Offline");
179  DBerror err;
180  sDatabase.RunQuery(err, "UPDATE chrCharacters SET online = %u WHERE characterID = %u", (online?1:0), char_id);
181 
182  if ( online )
183  sDatabase.RunQuery(err, "UPDATE srvStatus SET Connections = Connections + 1");
184 }
185 
187  DBerror err;
188  sDatabase.RunQuery(err,
189  "UPDATE srvStatus SET Online = %u, Connections = 0, startTime = %s WHERE AI = 1",
190  (online ? 1 : 0), (online ? "UNIX_TIMESTAMP(CURRENT_TIMESTAMP)" : "0"));
191 
192  //this is only called on startup/shutdown. reset all char online counts/status'
193  sDatabase.RunQuery(err, "UPDATE chrCharacters SET online = 0 WHERE 1");
194  sDatabase.RunQuery(err, "UPDATE account SET online = 0 WHERE 1");
195  sDatabase.RunQuery( err, "DELETE FROM chrPausedSkillQueue WHERE 1");
196 }
197 
198 void ServiceDB::SetAccountOnlineStatus(uint32 accountID, bool online) {
199  DBerror err;
200  if (!sDatabase.RunQuery(err, "UPDATE account SET online = %u WHERE accountID= %u ", (online?1:0), accountID)) {
201  codelog(DATABASE__ERROR, "Error in query: %s", err.c_str());
202  }
203 }
204 
205 void ServiceDB::SetAccountBanStatus(uint32 accountID, bool banned) {
206  DBerror err;
207  if (!sDatabase.RunQuery(err, "UPDATE account SET banned = %u WHERE accountID = %u", (banned?1:0), accountID)) {
208  codelog(DATABASE__ERROR, "Error in query: %s", err.c_str());
209  }
210 }
211 
213  DBerror err;
214  sDatabase.RunQuery(err,
215  " INSERT INTO chrKillTable (solarSystemID, victimCharacterID, victimCorporationID, victimAllianceID, victimFactionID,"
216  "victimShipTypeID, victimDamageTaken, finalCharacterID, finalCorporationID, finalAllianceID, finalFactionID, finalShipTypeID,"
217  "finalWeaponTypeID, finalSecurityStatus, finalDamageDone, killBlob, killTime, moonID)"
218  " VALUES (%u,%u,%u,%u,%u,%u,%u,%u,%u,%u,%u,%u,%u,%f,%u,'%s',%li,%u)",
223  data.killBlob.c_str(), data.killTime, data.moonID);
224 }
225 
227 {
228  DBQueryResult res;
229  if (!sDatabase.RunQuery(res, "SELECT corporationID FROM staStations WHERE stationID = %u", stationID)) {
230  codelog(DATABASE__ERROR, "Failed to query info for station %u: %s.", stationID, res.error.c_str());
231  return false;
232  }
233 
234  DBResultRow row;
235  if (res.GetRow(row)) {
236  return row.GetInt(0);
237  } else {
238  return 1;
239  }
240 }
241 
242 bool ServiceDB::GetConstant(const char *name, uint32 &into)
243 {
244  DBQueryResult res;
245 
246  std::string escaped;
247  sDatabase.DoEscapeString(escaped, name);
248 
249  if (!sDatabase.RunQuery(res, "SELECT constantValue FROM eveConstants WHERE constantID='%s'", escaped.c_str() ))
250  {
251  codelog(DATABASE__ERROR, "Error in query: %s", res.error.c_str());
252  return false;
253  }
254 
255  DBResultRow row;
256  if (!res.GetRow(row)) {
257  _log(DATABASE__MESSAGE, "Unable to find constant %s", name);
258  return false;
259  }
260 
261  into = row.GetUInt(0);
262 
263  return true;
264 }
265 
266 void ServiceDB::ProcessStringChange(const char* key, const std::string& oldValue, std::string newValue, PyDict* notif, std::vector< std::string >& dbQ)
267 {
268  if (oldValue.compare(newValue) == 0)
269  return;
270  // add to notification
271  PyTuple* val = new PyTuple(2);
272  val->items[0] = new PyString(oldValue);
273  val->items[1] = new PyString(newValue);
274  notif->SetItemString(key, val);
275 
276  std::string newEscValue;
277  sDatabase.DoEscapeString(newEscValue, newValue);
278 
279  std::string qValue = " ";
280  qValue += key;
281  qValue += " = '";
282  qValue += newEscValue.c_str();
283  qValue += "' ";
284  dbQ.push_back(qValue);
285 }
286 
287 void ServiceDB::ProcessRealChange(const char * key, double oldValue, double newValue, PyDict* notif, std::vector<std::string> & dbQ)
288 {
289  if (oldValue == newValue)
290  return;
291  // add to notification
292  PyTuple* val = new PyTuple(2);
293  val->items[0] = new PyFloat(oldValue);
294  val->items[1] = new PyFloat(newValue);
295  notif->SetItemString(key, val);
296 
297  int* nullInt(nullptr);
298  std::string qValue(key);
299  qValue += " = ";
300  qValue += fcvt(newValue, 2, nullInt, nullInt);
301  dbQ.push_back(qValue);
302 }
303 
304 void ServiceDB::ProcessIntChange(const char * key, uint32 oldValue, uint32 newValue, PyDict* notif, std::vector<std::string> & dbQ)
305 {
306  if (oldValue == newValue)
307  return;
308  // add to notification
309  PyTuple* val = new PyTuple(2);
310  val->items[0] = new PyInt(oldValue);
311  val->items[1] = new PyInt(newValue);
312  notif->SetItemString(key, val);
313 
314  std::string qValue(key);
315  qValue += " = ";
316  qValue += std::to_string(newValue);
317  dbQ.push_back(qValue);
318 }
319 
320 void ServiceDB::ProcessLongChange(const char* key, int64 oldValue, int64 newValue, PyDict* notif, std::vector< std::string >& dbQ)
321 {
322  if (oldValue == newValue)
323  return;
324  // add to notification
325  PyTuple* val = new PyTuple(2);
326  val->items[0] = new PyLong(oldValue);
327  val->items[1] = new PyLong(newValue);
328  notif->SetItemString(key, val);
329 
330  std::string qValue(key);
331  qValue += " = ";
332  qValue += std::to_string(newValue);
333  dbQ.push_back(qValue);
334 }
335 
336 void ServiceDB::SaveServerStats(double threads, float rss, float vm, float user, float kernel, uint32 items, uint32 bubbles) {
337  DBerror err;
338  sDatabase.RunQuery(err,
339  "UPDATE srvStatus"
340  " SET threads = %f,"
341  " rss = %f,"
342  " vm = %f,"
343  " user = %f,"
344  " kernel = %f,"
345  " items = %u,"
346  " bubbles = %u,"
347  " systems = %u,"
348  " npcs = %u,"
349  //" Connections = %u,"
350  " updateTime = UNIX_TIMESTAMP(CURRENT_TIMESTAMP)"
351  " WHERE AI = 1",
352  threads, rss, vm, user, kernel, items, bubbles, sEntityList.GetSystemCount(), sEntityList.GetNPCCount()/*, sEntityList.GetConnections()*/);
353 
354  _log(DATABASE__INFO, "Server Stats Saved");
355 }
356 
357 // lookupService db calls moved here...made no sense in LSCDB file.
358 PyRep* ServiceDB::LookupChars(const char *match, bool exact) {
359  DBQueryResult res;
360 
361  std::string matchEsc;
362  sDatabase.DoEscapeString(matchEsc, match);
363  if (matchEsc == "__ALL__") {
364  if(!sDatabase.RunQuery(res,
365  "SELECT "
366  " characterID AS ownerID"
367  " FROM chrCharacters"
368  " WHERE characterID > %u", maxNPCItem))
369  {
370  _log(DATABASE__ERROR, "Error in LookupChars query: %s", res.error.c_str());
371  return nullptr;
372  }
373  } else {
374  if(!sDatabase.RunQuery(res,
375  "SELECT "
376  " itemID AS ownerID"
377  " FROM entity"
378  " WHERE itemName %s '%s'",
379  exact?"=":"LIKE", matchEsc.c_str()
380  ))
381  {
382  _log(DATABASE__ERROR, "Error in LookupChars query: %s", res.error.c_str());
383  return nullptr;
384  }
385  }
386 
387  return DBResultToRowset(res);
388 }
389 
390 
391 PyRep* ServiceDB::LookupOwners(const char *match, bool exact) {
392  DBQueryResult res;
393 
394  std::string matchEsc;
395  sDatabase.DoEscapeString(matchEsc, match);
396 
397  // so each row needs "ownerID", "ownerName", and "groupID"
398  // ownerID = itemID
399  // ownerName = name
400  // groupID = 1 for character, 2 for corporation, 32 for alliance
401 
402  sDatabase.RunQuery(res,
403  "SELECT"
404  " characterID AS ownerID,"
405  " characterName AS ownerName,"
406  " 1 AS groupID"
407  " FROM chrCharacters"
408  " WHERE characterName %s '%s'", (exact?"=":"LIKE"), matchEsc.c_str());
409 
410  sDatabase.RunQuery(res,
411  "SELECT"
412  " corporationID AS ownerID,"
413  " corporationName AS ownerName,"
414  " 2 AS groupID"
415  " FROM crpCorporation"
416  " WHERE corporationName %s '%s'", (exact?"=":"LIKE"), matchEsc.c_str());
417 
418  sDatabase.RunQuery(res,
419  "SELECT"
420  " corporationID AS ownerID,"
421  " corporationName AS ownerName,"
422  " 2 AS groupID"
423  " FROM crpCorporation"
424  " WHERE tickerName %s '%s'", (exact?"=":"LIKE"), matchEsc.c_str());
425 
426  sDatabase.RunQuery(res,
427  "SELECT"
428  " allianceID AS ownerID,"
429  " allianceName AS ownerName,"
430  " 32 AS groupID"
431  " FROM alnAlliance"
432  " WHERE allianceName %s '%s'", (exact?"=":"LIKE"), matchEsc.c_str());
433 
434  sDatabase.RunQuery(res,
435  "SELECT"
436  " allianceID AS ownerID,"
437  " shortName AS ownerName,"
438  " 32 AS groupID"
439  " FROM alnAlliance"
440  " WHERE shortName %s '%s'", (exact?"=":"LIKE"), matchEsc.c_str());
441 
442  return DBResultToRowset(res);
443 }
444 
445 PyRep* ServiceDB::LookupCorporations(const std::string & search) {
446  DBQueryResult res;
447  std::string secure;
448  sDatabase.DoEscapeString(secure, search);
449 
450  if (!sDatabase.RunQuery(res,
451  "SELECT"
452  " corporationID, corporationName, corporationType "
453  " FROM crpCorporation "
454  " WHERE corporationName LIKE '%s'", secure.c_str()))
455  {
456  _log(DATABASE__ERROR, "Error in query: %s", res.error.c_str());
457  return 0;
458  }
459 
460  return DBResultToRowset(res);
461 }
462 
463 
464 PyRep* ServiceDB::LookupFactions(const std::string & search) {
465  DBQueryResult res;
466  std::string secure;
467  sDatabase.DoEscapeString(secure, search);
468 
469  if (!sDatabase.RunQuery(res,
470  "SELECT"
471  " factionID, factionName "
472  " FROM facFactions "
473  " WHERE factionName LIKE '%s'", secure.c_str()))
474  {
475  _log(DATABASE__ERROR, "Error in query: %s", res.error.c_str());
476  return 0;
477  }
478 
479  return DBResultToRowset(res);
480 }
481 
482 
483 PyRep* ServiceDB::LookupCorporationTickers(const std::string & search) {
484  DBQueryResult res;
485  std::string secure;
486  sDatabase.DoEscapeString(secure, search);
487 
488  if (!sDatabase.RunQuery(res,
489  "SELECT"
490  " corporationID, corporationName, tickerName "
491  " FROM crpCorporation "
492  " WHERE tickerName LIKE '%s'", secure.c_str()))
493  {
494  _log(DATABASE__ERROR, "Error in query: %s", res.error.c_str());
495  return 0;
496  }
497 
498  return DBResultToRowset(res);
499 }
500 
501 
502 PyRep* ServiceDB::LookupStations(const std::string & search) {
503  DBQueryResult res;
504  std::string secure;
505  sDatabase.DoEscapeString(secure, search);
506 
507  if (!sDatabase.RunQuery(res,
508  "SELECT"
509  " stationID, stationName, stationTypeID "
510  " FROM staStations "
511  " WHERE stationName LIKE '%s'", secure.c_str()))
512  {
513  _log(DATABASE__ERROR, "Error in query: %s", res.error.c_str());
514  return 0;
515  }
516 
517  return DBResultToRowset(res);
518 }
519 
520 // wtf is this shit?
521 PyRep* ServiceDB::LookupKnownLocationsByGroup(const std::string & search, uint32 typeID) {
522  DBQueryResult res;
523  std::string secure;
524  sDatabase.DoEscapeString(secure, search);
525 
526  if (!sDatabase.RunQuery(res,
527  "SELECT"
528  " itemID, itemName, typeID "
529  " FROM entity "
530  " WHERE itemName LIKE '%s' AND typeID = %u", secure.c_str(), typeID))
531  {
532  _log(DATABASE__ERROR, "Error in query: %s", res.error.c_str());
533  return 0;
534  }
535 
536  return DBResultToRowset(res);
537 }
538 
540 PyRep* ServiceDB::PrimeOwners(std::vector< int32 >& itemIDs)
541 {
542  DBQueryResult res;
543  DBResultRow row;
544  PyDict* dict = new PyDict();
545  for (auto cur : itemIDs) {
546  if (IsCharacterID(cur)) {
547  sDatabase.RunQuery(res, "SELECT characterID, characterName, typeID FROM chrCharacters WHERE characterID = %u", cur);
548  } else if (IsPlayerCorp(cur)) {
549  sDatabase.RunQuery(res, "SELECT corporationID, corporationName, typeID FROM crpCorporation WHERE corporationID = %u", cur);
550  } else if (IsAlliance(cur)) {
551  sDatabase.RunQuery(res, "SELECT allianceID, allianceName, typeID FROM alnAlliance WHERE allianceID = %u", cur);
552  } else {
553  ; // make error
554  }
555  if (res.GetRow(row)) {
556  PyList* list = new PyList();
557  list->AddItem(new PyInt(row.GetInt(0)));
558  list->AddItem(new PyString(row.GetText(1)));
559  list->AddItem(new PyInt(row.GetInt(2)));
560  dict->SetItem(new PyInt(row.GetInt(0)), list);
561  }
562  }
563 
564  return dict;
565 }
566 
567 void ServiceDB::GetCorpHangarNames(uint32 corpID, std::map<uint8, std::string> &hangarNames) {
568 
569  std::string table = "crpWalletDivisons";
570  if (IsNPCCorp(corpID))
571  table = "crpNPCWalletDivisons";
572  DBQueryResult res;
573  if (!sDatabase.RunQuery(res,
574  " SELECT division1,division2,division3,division4,division5,division6,division7"
575  " FROM %s"
576  " WHERE corporationID = %u", table.c_str(), corpID))
577  {
578  codelog(CORP__DB_ERROR, "Error in retrieving corporation's data (%u)", corpID);
579  return;
580  }
581 
582  DBResultRow row;
583  if (res.GetRow(row)) {
584  hangarNames.emplace(flagHangar, row.GetText(0));
585  hangarNames.emplace(flagCorpHangar2, row.GetText(1));
586  hangarNames.emplace(flagCorpHangar3, row.GetText(2));
587  hangarNames.emplace(flagCorpHangar4, row.GetText(3));
588  hangarNames.emplace(flagCorpHangar5, row.GetText(4));
589  hangarNames.emplace(flagCorpHangar6, row.GetText(5));
590  hangarNames.emplace(flagCorpHangar7, row.GetText(6));
591  } else {
592  _log(CORP__DB_ERROR, "CorpID %u has no division data.", corpID);
593  }
594 }
std::string name
Base Python wire object.
Definition: PyRep.h:66
static bool IncrementLoginCount(uint32 accountID)
Definition: ServiceDB.cpp:140
#define sConfig
A macro for easier access to the singleton.
static void SetCharacterOnlineStatus(uint32 char_id, bool online=false)
Definition: ServiceDB.cpp:177
#define IsNPCCorp(itemID)
Definition: EVE_Defines.h:238
uint32 finalDamageDone
#define sDatabase
Definition: dbcore.h:199
uint32 GetStationOwner(uint32 stationID)
Definition: ServiceDB.cpp:226
uint32 finalCorporationID
uint32 victimDamageTaken
void ProcessRealChange(const char *key, double oldValue, double newValue, PyDict *notif, std::vector< std::string > &dbQ)
Definition: ServiceDB.cpp:287
const char * GetText(uint32 index) const
Definition: dbcore.h:104
#define _log(type, fmt,...)
Definition: logsys.h:124
#define maxNPCItem
Definition: EVE_Defines.h:139
Python string.
Definition: PyRep.h:430
int32 GetInt(uint32 index) const
Definition: dbcore.cpp:635
uint32 finalCharacterID
void ProcessIntChange(const char *key, uint32 oldValue, uint32 newValue, PyDict *notif, std::vector< std::string > &dbQ)
Definition: ServiceDB.cpp:304
Python's dictionary.
Definition: PyRep.h:719
static PyRep * LookupCorporationTickers(const std::string &)
Definition: ServiceDB.cpp:483
uint32 GetUInt(uint32 index) const
Definition: dbcore.cpp:658
static const std::array< std::string, 18 > badChars
Definition: EVE_Consts.h:87
static PyRep * LookupOwners(const char *match, bool exact=false)
Definition: ServiceDB.cpp:391
Python floating point number.
Definition: PyRep.h:292
std::string hash
#define sEntityList
Definition: EntityList.h:208
static void SaveKillOrLoss(CharKillData &data)
Definition: ServiceDB.cpp:212
static uint32 CreateNewAccount(const char *login, const char *pass, const char *passHash, int64 role)
Definition: ServiceDB.cpp:151
static void SetAccountBanStatus(uint32 accountID, bool banned=false)
Definition: ServiceDB.cpp:205
int32 victimFactionID
static uint32 SetClientSeed()
Definition: ServiceDB.cpp:34
Python tuple.
Definition: PyRep.h:567
static void SaveServerStats(double threads, float rss, float vm, float user, float kernel, uint32 items, uint32 bubbles)
Definition: ServiceDB.cpp:336
static void GetCorpHangarNames(uint32 corpID, std::map< uint8, std::string > &hangarNames)
Definition: ServiceDB.cpp:567
static bool GetConstant(const char *name, uint32 &into)
Definition: ServiceDB.cpp:242
void AddItem(PyRep *i)
Definition: PyRep.h:701
void ProcessStringChange(const char *key, const std::string &oldValue, std::string newValue, PyDict *notif, std::vector< std::string > &dbQ)
Definition: ServiceDB.cpp:266
bool GetRow(DBResultRow &into)
Definition: dbcore.cpp:552
static PyRep * LookupKnownLocationsByGroup(const std::string &, uint32)
Definition: ServiceDB.cpp:521
#define sLog
Evaluates to a NewLog instance.
Definition: LogNew.h:250
uint32 clientID
static PyRep * LookupCorporations(const std::string &)
Definition: ServiceDB.cpp:445
const char * c_str() const
Definition: dbcore.h:48
static void UpdatePassword(uint32 accountID, const char *pass)
Definition: ServiceDB.cpp:170
uint32 solarSystemID
#define codelog(type, fmt,...)
Definition: logsys.h:128
static void SetAccountOnlineStatus(uint32 accountID, bool online=false)
Definition: ServiceDB.cpp:198
uint32 victimCorporationID
PyObject * DBResultToRowset(DBQueryResult &result)
Definition: EVEDBUtils.cpp:81
Python integer.
Definition: PyRep.h:231
uint16 finalShipTypeID
std::string password
bool IsNull(uint32 index) const
Definition: dbcore.h:102
#define IsPlayerCorp(itemID)
Definition: EVE_Defines.h:241
uint32 victimCharacterID
int32 finalFactionID
#define IsCharacterID(itemID)
Definition: EVE_Defines.h:206
void ProcessLongChange(const char *key, int64 oldValue, int64 newValue, PyDict *notif, std::vector< std::string > &dbQ)
Definition: ServiceDB.cpp:320
double finalSecurityStatus
unsigned __int32 uint32
Definition: eve-compat.h:50
static bool UpdateAccountHash(const char *username, std::string &hash)
Definition: ServiceDB.cpp:125
static PyRep * PrimeOwners(std::vector< int32 > &itemIDs)
Definition: ServiceDB.cpp:540
static PyRep * LookupChars(const char *match, bool exact=false)
Definition: ServiceDB.cpp:358
DBerror error
Definition: dbcore.h:69
signed __int64 int64
Definition: eve-compat.h:51
static bool GetAccountInformation(CryptoChallengePacket &ccp, AccountData &aData, std::string &failMsg)
Definition: ServiceDB.cpp:70
std::string last_login
static void SetServerOnlineStatus(bool online=false)
Definition: ServiceDB.cpp:186
uint16 finalWeaponTypeID
uint16 victimShipTypeID
static PyRep * LookupStations(const std::string &)
Definition: ServiceDB.cpp:502
static bool ValidateAccountName(CryptoChallengePacket &ccp, std::string &failMsg)
Definition: ServiceDB.cpp:43
#define IsAlliance(itemID)
Definition: EVE_Defines.h:244
storage_type items
Definition: PyRep.h:628
typeID Spawn an NPC with the specified type text Search for items matching the specified query() type() key(value)-Send an OnRemoteMessage" ) COMMAND( setbpattr
static PyRep * LookupFactions(const std::string &)
Definition: ServiceDB.cpp:464
int64 GetInt64(uint32 index) const
Definition: dbcore.cpp:670
int32 finalAllianceID
entityID heal the character with the entityID note giving you detailed ship status information gives a list of all dynamic entities and players and their destinyState in this bubble shows some current destiny variables save all items
int32 victimAllianceID
std::string killBlob
void SetItem(PyRep *key, PyRep *value)
SetItem adds or sets a database entry.
Definition: PyRep.cpp:713
Definition: dbcore.h:39
Python list.
Definition: PyRep.h:639
void SetItemString(const char *key, PyRep *value)
SetItemString adds or sets a database entry.
Definition: PyRep.h:812
bool icontains(std::string data, std::string toSearch, size_t pos=0)
Definition: misc.cpp:194
Python long integer.
Definition: PyRep.h:261