EvEmu  0.8.4
11 September 2021
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages
MarketDB.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: Positron96, Allan
25 */
26 
27 #include "eve-server.h"
28 
29 #include "EVEServerConfig.h"
30 #include "StaticDataMgr.h"
31 #include "market/MarketDB.h"
32 
33 /*
34  * MARKET__ERROR
35  * MARKET__WARNING
36  * MARKET__MESSAGE
37  * MARKET__DEBUG
38  * MARKET__TRACE
39  * MARKET__DB_ERROR
40  * MARKET__DB_TRACE
41  */
42 
44  DBQueryResult res;
45  if (!sDatabase.RunQuery(res,
46  "SELECT"
47  " typeID, MIN(price) AS price, volRemaining, stationID "
48  " FROM mktOrders "
49  " WHERE stationID=%u"
50  " GROUP BY typeID",
51  //" LIMIT %u", sConfig.market.StationOrderLimit
52  stationID))
53  {
54  codelog(MARKET__DB_ERROR, "Error in query: %s", res.error.c_str());
55  return nullptr;
56  }
57 
58  //NOTE: this SHOULD return a crazy dbutil.RowDict object which is
59  //made up of packed blue.DBRow objects, but we do not understand
60  //the marshalling of those well enough right now, and this object
61  //provides the same interface. It is significantly bigger on the wire though.
62  return DBResultToIndexRowset(res, "typeID");
63 }
64 
66  DBQueryResult res;
67  if (!sDatabase.RunQuery(res,
68  "SELECT"
69  " typeID, MIN(price) AS price, volRemaining, stationID "
70  " FROM mktOrders "
71  " WHERE solarSystemID=%u"
72  " GROUP BY typeID",
73  //" LIMIT %u",sConfig.market.SystemOrderLimit
74  solarSystemID))
75  {
76  codelog(MARKET__DB_ERROR, "Error in query: %s", res.error.c_str());
77  return nullptr;
78  }
79 
80  //NOTE: this SHOULD return a crazy dbutil.RowDict object which is
81  //made up of packed blue.DBRow objects, but we do not understand
82  //the marshalling of those well enough right now, and this object
83  //provides the same interface. It is significantly bigger on the wire though.
84  return DBResultToIndexRowset(res, "typeID");
85 }
86 
88  DBQueryResult res;
89  if (!sDatabase.RunQuery(res,
90  "SELECT"
91  " typeID, MIN(price) AS price, volRemaining, stationID "
92  " FROM mktOrders "
93  " WHERE regionID=%u AND bid=%u"
94  " GROUP BY typeID",
95  //" LIMIT %u",sConfig.market.RegionOrderLimit
96  regionID, Market::Type::Sell))
97  {
98  codelog(MARKET__DB_ERROR, "Error in query: %s", res.error.c_str());
99  return nullptr;
100  }
101 
102  //NOTE: this SHOULD return a crazy dbutil.RowDict object which is
103  //made up of packed blue.DBRow objects, but we do not understand
104  //the marshalling of those well enough right now, and this object
105  //provides the same interface. It is significantly bigger on the wire though.
106  return DBResultToIndexRowset(res, "typeID");
107 }
108 
110 {
111  // returns a tuple (sell, buy) of PyObjectEx with data in PyPackedRows
112 
113  PyTuple* tup = new PyTuple(2);
114  DBQueryResult res;
115  //query sell orders
116  if (!sDatabase.RunQuery(res,
117  "SELECT"
118  " price, volRemaining, typeID, orderRange AS `range`, orderID,"
119  " volEntered, minVolume, bid, issued as issueDate, duration,"
120  " stationID, regionID, solarSystemID, jumps"
121  " FROM mktOrders "
122  " WHERE regionID=%u AND typeID=%u AND bid=%u", regionID, typeID, Market::Type::Sell))
123  {
124  codelog( MARKET__DB_ERROR, "Error in query: %s", res.error.c_str() );
125  return nullptr;
126  }
127  _log(MARKET__DB_TRACE, "GetOrders() - Fetched %u sell orders for type %u", res.GetRowCount(), typeID);
128  tup->SetItem(0, DBResultToCRowset( res ) );
129 
130  //query buy orders
131  if (!sDatabase.RunQuery(res,
132  "SELECT"
133  " price, volRemaining, typeID, orderRange AS `range`, orderID,"
134  " volEntered, minVolume, bid, issued as issueDate, duration,"
135  " stationID, regionID, solarSystemID, jumps"
136  " FROM mktOrders "
137  " WHERE regionID=%u AND typeID=%u AND bid=%u", regionID, typeID, Market::Type::Buy))
138  {
139  codelog( MARKET__DB_ERROR, "Error in query: %s", res.error.c_str() );
140  PyDecRef( tup );
141  return nullptr;
142  }
143  _log(MARKET__DB_TRACE, "GetOrders() - Fetched %u buy orders for type %u", res.GetRowCount(), typeID);
144  tup->SetItem(1, DBResultToCRowset( res ) );
145 
146  if (is_log_enabled(MARKET__DUMP))
147  tup->Dump(MARKET__DUMP, " ");
148  return tup;
149 }
150 
152 {
153  DBQueryResult res;
154  if (!sDatabase.RunQuery(res,
155  "SELECT"
156  " orderID, typeID, ownerID AS charID, regionID, stationID,"
157  " orderRange AS `range`, bid, price, volEntered, volRemaining,"
158  " issued as issueDate, minVolume, contraband,"
159  " duration, isCorp, solarSystemID, escrow"
160  " FROM mktOrders"
161  " WHERE ownerID=%u", ownerID))
162  {
163  codelog(MARKET__DB_ERROR, "Error in query: %s", res.error.c_str());
164  return nullptr;
165  }
166 
167  _log(MARKET__DB_TRACE, "GetOrdersForOwner() - Fetched %u buy orders for %u", res.GetRowCount(), ownerID);
168 
169  return DBResultToRowset(res);
170 }
171 
173  DBQueryResult res;
174  if (!sDatabase.RunQuery(res,
175  "SELECT"
176  " price, volRemaining, typeID, orderRange AS `range`, orderID,"
177  " volEntered, minVolume, bid, issued as issueDate, duration,"
178  " stationID, regionID, solarSystemID, jumps"
179  " FROM mktOrders"
180  " WHERE orderID=%u", orderID))
181  {
182  codelog(MARKET__DB_ERROR, "Error in query: %s", res.error.c_str());
183  return nullptr;
184  }
185 
186  DBResultRow row;
187  if (!res.GetRow(row)) {
188  codelog(MARKET__ERROR, "Order %u not found.", orderID);
189  return nullptr;
190  }
191 
192  return DBRowToPackedRow(row);
193 }
194 
195 //NOTE: needs a lot of work to implement orderRange
196 uint32 MarketDB::FindBuyOrder(Call_PlaceCharOrder &call) {
197  DBQueryResult res;
198  if (!sDatabase.RunQuery(res,
199  "SELECT orderID"
200  " FROM mktOrders"
201  " WHERE bid=1"
202  " AND typeID=%u"
203  " AND stationID=%u"
204  " AND volRemaining >= %u"
205  " AND price > %.2f"
206  " ORDER BY price DESC"
207  " LIMIT 1;",
208  call.typeID,
209  call.stationID,
210  call.quantity,
211  call.price - 0.1/*, sConfig.market.FindBuyOrder*/))
212  {
213  codelog(MARKET__DB_ERROR, "Error in query: %s", res.error.c_str());
214  return 0;
215  }
216 
217  DBResultRow row;
218  if (res.GetRow(row))
219  return row.GetUInt(0);
220 
221  return 0; //no order found.
222 }
223 
224 uint32 MarketDB::FindSellOrder(Call_PlaceCharOrder &call)
225 {
226  DBQueryResult res;
227  if (!sDatabase.RunQuery(res,
228  "SELECT orderID"
229  " FROM mktOrders"
230  " WHERE bid=0"
231  " AND typeID=%u"
232  " AND stationID=%u"
233  " AND volRemaining >= %u"
234  " AND price < %.2f"
235  " ORDER BY price ASC"
236  " LIMIT 1;",
237  call.typeID,
238  call.stationID,
239  call.quantity,
240  call.price + 0.1/*, sConfig.market.FindSellOrder*/))
241  {
242  codelog(MARKET__DB_ERROR, "Error in query: %s", res.error.c_str());
243  return 0;
244  }
245 
246  DBResultRow row;
247  if (res.GetRow(row))
248  return row.GetUInt(0);
249 
250  return 0;
251 }
252 
254  //orderID, typeID, ownerID, regionID, stationID, orderRange, bid, price, escrow,
255  // minVolume, volEntered, volRemaining, issued, contraband, duration, jumps, isCorp, accountKey, memberID
256  DBQueryResult res;
257  if (!sDatabase.RunQuery(res,
258  "SELECT"
259  " volRemaining,"
260  " price,"
261  " typeID,"
262  " stationID,"
263  " regionID,"
264  " ownerID,"
265  " bid,"
266  " isCorp,"
267  " memberID,"
268  " accountKey"
269  " FROM mktOrders"
270  " WHERE orderID=%u",
271  orderID))
272  {
273  _log(MARKET__DB_ERROR, "Error in query: %s.", res.error.c_str());
274  return false;
275  }
276 
277  DBResultRow row;
278  if (!res.GetRow(row)) {
279  _log(MARKET__WARNING, "Order %u not found.", orderID);
280  return false;
281  }
282 
283  oInfo.quantity = row.GetUInt(0);
284  oInfo.price = row.GetFloat(1);
285  oInfo.typeID = row.GetUInt(2);
286  oInfo.stationID = row.GetUInt(3);
287  oInfo.regionID = row.GetUInt(4);
288  oInfo.ownerID = row.GetUInt(5);
289  oInfo.isBuy = row.GetBool(6);
290  oInfo.isCorp = row.GetBool(7);
291  oInfo.memberID = row.GetUInt(8);
292  oInfo.accountKey = row.GetUInt(9);
293 
294  return true;
295 }
296 
297 //NOTE: this logic needs some work if there are multiple concurrent market services running at once. there wont be.
299  DBerror err;
300  if (!sDatabase.RunQuery(err, "UPDATE mktOrders SET volRemaining = %u WHERE orderID = %u", new_qty, orderID)) {
301  _log(MARKET__DB_ERROR, "Error in query: %s.", err.c_str());
302  return false;
303  }
304  return true;
305 }
306 
307 bool MarketDB::AlterOrderPrice(uint32 orderID, double new_price) {
308  DBerror err;
309  if (!sDatabase.RunQuery(err, "UPDATE mktOrders SET price = %.2f WHERE orderID = %u", new_price, orderID)) {
310  _log(MARKET__DB_ERROR, "Error in query: %s.", err.c_str());
311  return false;
312  }
313  return true;
314 }
315 
317  DBerror err;
318  if (!sDatabase.RunQuery(err, "DELETE FROM mktOrders WHERE orderID = %u", orderID)) {
319  _log(MARKET__DB_ERROR, "Error in query: %s.", err.c_str());
320  return false;
321  }
322  return true;
323 }
324 
326  DBerror err;
327  uint32 orderID(0);
328  if (!sDatabase.RunQueryLID(err, orderID,
329  "INSERT INTO mktOrders ("
330  " typeID, ownerID, regionID, stationID, solarSystemID, orderRange,"
331  " bid, price, escrow, minVolume, volEntered, volRemaining,"
332  " issued, contraband, duration, jumps, isCorp, accountKey, memberID"
333  " ) VALUES ("
334  " %u, %u, %u, %u, %u, %u,"
335  " %u, %.2f, %.2f, %u, %u, %u,"
336  " %li, %u, %u, %u, %u, %u, %u"
337  " )",
338  data.typeID, data.ownerID, data.regionID, data.stationID, data.solarSystemID, data.orderRange,
339  data.bid?1:0, data.price, data.escrow, data.minVolume, data.volEntered, data.volRemaining,
340  data.issued, data.contraband?1:0, data.duration, data.jumps, data.isCorp?1:0, data.accountKey, data.memberID))
341  {
342  codelog(MARKET__DB_ERROR, "Error in query: %s", err.c_str());
343  return 0;
344  }
345 
346  return orderID;
347 }
348 
350  //transactionID, transactionDate, typeID, keyID, quantity, price,
351  // transactionType, clientID, regionID, stationID, corpTransaction, characterID
352  std::string typeID = "";
353  if (data.typeID) {
354  typeID = "AND typeID=";
355  typeID += std::to_string(data.typeID);
356  }
357  std::string buy = "";
358  if (data.isBuy > -1) {
359  buy = "AND transactionType=";
360  buy += std::to_string(data.isBuy);
361  }
362  DBQueryResult res;
363  if (!sDatabase.RunQuery(res,
364  "SELECT"
365  " transactionID, transactionDate, typeID, keyID, quantity, price,"
366  " transactionType, clientID, regionID, stationID, corpTransaction, characterID"
367  " FROM mktTransactions "
368  " WHERE clientID=%u %s AND quantity>=%u AND price>=%.2f AND "
369  " transactionDate>=%li %s AND keyID=%u AND characterID=%u",
370  clientID, typeID.c_str(), data.quantity, data.price,
371  data.time, buy.c_str(), data.accountKey, data.memberID))
372  {
373  codelog(MARKET__DB_ERROR, "Error in query: %s", res.error.c_str());
374  return nullptr;
375  }
376 
377  return DBResultToRowset(res);
378 }
379 
381  //transactionID, transactionDate, typeID, keyID, quantity, price,
382  // transactionType, clientID, regionID, stationID, corpTransaction, characterID
383  DBerror err;
384  if (!sDatabase.RunQuery(err,
385  "INSERT INTO"
386  " mktTransactions ("
387  " transactionDate, typeID, keyID, quantity, price,"
388  " transactionType, clientID, regionID, stationID, corpTransaction, characterID"
389  " ) VALUES ("
390  " %f, %u, %u, %u, %f,"
391  " %u, %u, %u, %u, %u, %u)",
392  GetFileTimeNow(), data.typeID, data.accountKey, data.quantity, data.price,
393  data.isBuy > 0?1:0, data.clientID, data.regionID, data.stationID, data.isCorp?1:0, data.memberID))
394  {
395  codelog(MARKET__DB_ERROR, "Error in query: %s", err.c_str());
396  return false;
397  }
398  return true;
399 }
400 
402 
403  DBQueryResult res;
404  if (!sDatabase.RunQuery(res, "SELECT parentGroupID, marketGroupID, marketGroupName,"
405  " description, graphicID, hasTypes, iconID, dataID, marketGroupNameID, descriptionID"
406  " FROM invMarketGroups")) {
407  codelog(MARKET__DB_ERROR, "Error in query: %s", res.error.c_str());
408  return nullptr;
409  }
410 
411  DBRowDescriptor *header = new DBRowDescriptor(res);
412 
413  _log(MARKET__DB_TRACE, "GetMarketGroups header has %u columns.", header->ColumnCount());
414 
415  CFilterRowSet *filterRowset = new CFilterRowSet(&header);
416  PyDict *keywords = filterRowset->GetKeywords();
417  keywords->SetItemString("allowDuplicateCompoundKeys", PyStatic.NewFalse());
418  keywords->SetItemString("indexName", PyStatic.NewNone());
419  keywords->SetItemString("columnName", new PyString("parentGroupID"));
420 
421  DBResultRow row;
422  std::map< int, PyRep* > tt;
423  while( res.GetRow(row) ) {
424  int parentGroupID(row.IsNull(0) ? -1 : row.GetUInt(0));
425  PyRep* pid(nullptr);
426  CRowSet*rowset(nullptr);
427  if (tt.count(parentGroupID)) {
428  pid = tt[parentGroupID];
429  rowset = filterRowset->GetRowset(pid);
430  } else {
431  pid = parentGroupID != -1 ? (PyRep*)new PyInt(parentGroupID) : PyStatic.NewNone();
432  tt[parentGroupID] = pid;
433  rowset = filterRowset->NewRowset(pid);
434  }
435 
436  PyPackedRow* pyrow = rowset->NewRow();
437  pyrow->SetField((uint32)0, pid); //parentGroupID
438  pyrow->SetField(1, new PyInt(row.GetUInt(1))); //marketGroupID
439  pyrow->SetField(2, new PyString(row.GetText(2))); //marketGroupName
440  pyrow->SetField(3, new PyString(row.GetText(3))); //description
441  pyrow->SetField(4, row.IsNull(4) ? PyStatic.NewNone() : new PyInt(row.GetUInt(4))); //graphicID
442  pyrow->SetField(5, new PyBool(row.GetBool(5))); //hasTypes
443  pyrow->SetField(6, row.IsNull(6) ? PyStatic.NewNone() : new PyInt(row.GetUInt(6))); // iconID
444  pyrow->SetField(7, new PyInt(row.GetUInt(7))); //dataID
445  pyrow->SetField(8, new PyInt(row.GetUInt(8))); //marketGroupNameID
446  pyrow->SetField(9, new PyInt(row.GetUInt(9))); //descriptionID
447  }
448 
449  _log(MARKET__DB_TRACE, "GetMarketGroups returned %u keys.", filterRowset->GetKeyCount());
450  if (is_log_enabled(MARKET__DB_TRACE))
451  filterRowset->Dump(MARKET__DB_TRACE, " ");
452 
453  return filterRowset;
454 }
455 
457 {
458  DBQueryResult res;
459  if (!sDatabase.RunQuery(res, "SELECT timeStamp FROM mktUpdates WHERE server = 1")) {
460  codelog(MARKET__DB_ERROR, "Error in query: %s", res.error.c_str());
461  return 0;
462  }
463  DBResultRow row;
464  if (res.GetRow(row))
465  return row.GetInt64(0);
466 
467  return 0;
468 }
469 
471 {
472  DBerror err;
473  sDatabase.RunQuery(err, "UPDATE mktUpdates SET timeStamp = %li WHERE server = 1", setTime);
474 }
475 
478 {
479  // 'date' needs to be an actual column to pull data from....
480  DBerror err;
481  sDatabase.RunQuery(err,
482  "INSERT INTO"
483  " mktHistory"
484  " (regionID, typeID, historyDate, lowPrice, highPrice, avgPrice, volume, orders)"
485  " SELECT"
486  " regionID,"
487  " typeID,"
488  " ((UNIX_TIMESTAMP(date) + 11644473600) * 10000000),"
489  " price,"
490  " price,"
491  " price,"
492  " amtEntered,"
493  " COUNT(DISTINCT typeID)"
494  " FROM mktData");
495 }
496 
497 
498 /* data retrieval for updating base pricing */
499 
500 void MarketDB::GetShipIDs(std::map< uint16, Inv::TypeData >& data)
501 {
502  DBQueryResult res;
503  DBResultRow row;
504  // 178 ships using this query
505  sDatabase.RunQuery(res,
506  "SELECT t.typeID "
507  " FROM invTypes AS t "
508  " LEFT JOIN invGroups AS g USING (groupID)"
509  " WHERE g.categoryID = %u",
510  //" AND g.useBasePrice = 1"
511  //" AND t.published = 1",
513 
514  //sDatabase.RunQuery(res, "SELECT typeID FROM invTypes WHERE groupID = %u AND published = 1", EVEDB::invGroups::Frigate);
515  while (res.GetRow(row))
516  data[row.GetInt(0)] = Inv::TypeData();
517 }
518 
519 void MarketDB::GetManufacturedItems(std::map< uint16, Inv::TypeData >& data)
520 {
521  DBQueryResult res;
522  DBResultRow row;
523  //6602 items in this query
524  if (!sDatabase.RunQuery(res, "SELECT DISTINCT typeID FROM invTypeMaterials"))
525  codelog(DATABASE__ERROR, "Error in GetRAMMaterials query: %s", res.error.c_str());
526 
527  while (res.GetRow(row))
528  data[row.GetInt(0)] = Inv::TypeData();
529 }
530 
531 void MarketDB::GetMaterialPrices(std::map< uint16, Market::matlData >& data)
532 {
533  DBQueryResult res;
534  DBResultRow row;
535  std::map< uint16, Market::matlData >::iterator itr;
536  for (itr = data.begin(); itr != data.end(); ++itr) {
537  sDatabase.RunQuery(res, "SELECT basePrice FROM invTypes WHERE typeID = %u", itr->first);
538  if (res.GetRow(row))
539  itr->second.price = (row.GetFloat(0) * 1.05);
540  }
541 }
542 
543 void MarketDB::GetMineralPrices(std::map< uint16, Market::matlData >& data)
544 {
545  DBQueryResult res;
546  DBResultRow row;
547  std::map< uint16, Market::matlData >::iterator itr;
548  for (itr = data.begin(); itr != data.end(); ++itr) {
549  sDatabase.RunQuery(res, "SELECT basePrice FROM invTypes WHERE typeID = %u", itr->first);
550  if (res.GetRow(row))
551  itr->second.price = (row.GetFloat(0) * 1.15);
552  }
553 
554  /* mineral prices in first column from rens 31/5/2010 @ 17:30 logged by me from IGB
555  * second price column is from Grismar 16/2/07
556  * third price column is from ccp market dump, filtered and averaged for Crucible era from all regions
557  * typeID Name 2010 2007 2012
558  * 34 Tritanium 2.70 2.37 2.72315
559  * 35 Pyerite 5.80 4.00 4.90957
560  * 36 Mexallon 26.90 21.93 29.7163
561  * 37 Isogen 49.16 64.06 59.1943
562  * 38 Nocxium 99.02 93.76 94.227
563  * 39 Zydrine 1315.03 2347.36 1290.39
564  * 40 Megacyte 2650.00 3989.06 2707.67
565  * 11399 Morphite 5407.68 14291.00 4943.2
566  *
567  */
568 }
569 
570 void MarketDB::UpdateInvPrice(std::map< uint16, Inv::TypeData >& data)
571 {
572  DBerror err;
573  for (auto cur : data) {
574  if (cur.second.basePrice < 0.01) {
575  sLog.Error(" SetBasePrice", "Calculated price for %s(%u) is 0", \
576  cur.second.name.c_str(), cur.first);
577  } else {
578  sDatabase.RunQuery(err, "UPDATE invTypes SET basePrice=%f WHERE typeID= %u", cur.second.basePrice, cur.first);
579  }
580  }
581 }
582 
583 void MarketDB::UpdateMktPrice(std::map< uint16, Market::matlData >& data)
584 {
585  DBerror err;
586  for (auto cur : data)
587  sDatabase.RunQuery(err, "UPDATE invTypes SET basePrice=%f WHERE typeID= %u", cur.second.price, cur.first);
588 }
589 
590 void MarketDB::GetCruPriceAvg(std::map< uint16, Inv::TypeData >& data)
591 {
592  DBQueryResult res;
593  DBResultRow row;
594  std::map< uint16, Inv::TypeData>::iterator itr;
595  for (itr = data.begin(); itr != data.end(); ++itr) {
596  sDatabase.RunQuery(res, "SELECT AVG(avgPrice) FROM CruciblePriceHistory WHERE typeID = %u", itr->first);
597  if (res.GetRow(row))
598  itr->second.basePrice = (row.IsNull(0) ? 0 : row.GetFloat(0));
599  }
600 }
Base Python wire object.
Definition: PyRep.h:66
uint32 regionID
Definition: EVE_Market.h:80
PyRep * GetRegionBest(uint32 regionID)
Definition: MarketDB.cpp:87
bool GetOrderInfo(uint32 orderID, Market::OrderInfo &oInfo)
Definition: MarketDB.cpp:253
#define sDatabase
Definition: dbcore.h:199
const char * GetText(uint32 index) const
Definition: dbcore.h:104
#define _log(type, fmt,...)
Definition: logsys.h:124
float GetFloat(uint32 index) const
Definition: dbcore.cpp:682
PyObjectEx * DBResultToCRowset(DBQueryResult &result)
Definition: EVEDBUtils.cpp:402
Python string.
Definition: PyRep.h:430
int32 GetInt(uint32 index) const
Definition: dbcore.cpp:635
uint32 stationID
Definition: EVE_Market.h:79
uint32 quantity
Definition: EVE_Market.h:81
Python object "dbutil.CFilterRowset".
Definition: PyDatabase.h:216
PyRep * GetOrdersForOwner(uint32 ownerID)
Definition: MarketDB.cpp:151
Python's dictionary.
Definition: PyRep.h:719
PyRep * GetStationAsks(uint32 stationID)
Definition: MarketDB.cpp:43
PyRep * GetTransactions(uint32 ownerID, Market::TxData &data)
Definition: MarketDB.cpp:349
uint32 solarSystemID
Definition: EVE_Market.h:106
PyRep * GetMarketGroups()
Definition: MarketDB.cpp:401
uint32 GetUInt(uint32 index) const
Definition: dbcore.cpp:658
PyRep * GetOrders(uint32 regionID, uint16 typeID)
Definition: MarketDB.cpp:109
static void GetMineralPrices(std::map< uint16, Market::matlData > &data)
Definition: MarketDB.cpp:543
static void UpdateInvPrice(std::map< uint16, Inv::TypeData > &data)
Definition: MarketDB.cpp:570
bool AlterOrderPrice(uint32 orderID, double new_price)
Definition: MarketDB.cpp:307
Python tuple.
Definition: PyRep.h:567
void Dump(FILE *into, const char *pfx) const
Dumps object to file.
Definition: PyRep.cpp:84
bool GetRow(DBResultRow &into)
Definition: dbcore.cpp:552
bool GetBool(uint32 index) const
Definition: dbcore.cpp:647
Python boolean.
Definition: PyRep.h:323
#define is_log_enabled(type)
Definition: logsys.h:78
#define sLog
Evaluates to a NewLog instance.
Definition: LogNew.h:250
const char * c_str() const
Definition: dbcore.h:48
Python object "blue.DBRowDescriptor".
Definition: PyDatabase.h:41
uint32 ColumnCount() const
Definition: PyDatabase.cpp:60
PyRep * GetOrderRow(uint32 orderID)
Definition: MarketDB.cpp:172
#define codelog(type, fmt,...)
Definition: logsys.h:128
void SetItem(size_t index, PyRep *object)
Stores Python object.
Definition: PyRep.h:610
uint16 typeID
Definition: EVE_Market.h:77
Python object "dbutil.CRowset".
Definition: PyDatabase.h:124
PyObject * DBResultToRowset(DBQueryResult &result)
Definition: EVEDBUtils.cpp:81
Python integer.
Definition: PyRep.h:231
uint32 accountKey
Definition: EVE_Market.h:82
#define PyStatic
Definition: PyRep.h:1209
bool IsNull(uint32 index) const
Definition: dbcore.h:102
static void GetShipIDs(std::map< uint16, Inv::TypeData > &data)
Definition: MarketDB.cpp:500
static void GetCruPriceAvg(std::map< uint16, Inv::TypeData > &data)
Definition: MarketDB.cpp:590
bool RecordTransaction(Market::TxData &data)
Definition: MarketDB.cpp:380
static void SetUpdateTime(int64 setTime)
Definition: MarketDB.cpp:470
uint32 memberID
Definition: EVE_Market.h:83
#define PyDecRef(op)
Definition: PyRep.h:57
uint32 FindBuyOrder(Call_PlaceCharOrder &call)
Definition: MarketDB.cpp:196
unsigned __int32 uint32
Definition: eve-compat.h:50
uint32 clientID
Definition: EVE_Market.h:78
PyObject * DBResultToIndexRowset(DBQueryResult &result, const char *key)
Definition: EVEDBUtils.cpp:144
double GetFileTimeNow()
Definition: utils_time.cpp:84
static void GetMaterialPrices(std::map< uint16, Market::matlData > &data)
Definition: MarketDB.cpp:531
DBerror error
Definition: dbcore.h:69
signed __int64 int64
Definition: eve-compat.h:51
static void GetManufacturedItems(std::map< uint16, Inv::TypeData > &data)
Definition: MarketDB.cpp:519
bool SetField(uint32 index, PyRep *value)
Definition: PyRep.cpp:1031
PyPackedRow * NewRow()
Definition: PyDatabase.cpp:132
size_t GetRowCount()
Definition: dbcore.h:72
bool AlterOrderQuantity(uint32 orderID, uint32 new_qty)
Definition: MarketDB.cpp:298
PyPackedRow * DBRowToPackedRow(DBResultRow &row)
Definition: EVEDBUtils.cpp:453
Packed row.
Definition: PyRep.h:961
bool DeleteOrder(uint32 orderID)
Definition: MarketDB.cpp:316
uint32 StoreOrder(Market::SaveData &data)
Definition: MarketDB.cpp:325
int64 GetInt64(uint32 index) const
Definition: dbcore.cpp:670
unsigned __int16 uint16
Definition: eve-compat.h:48
uint32 volRemaining
Definition: EVE_Market.h:109
Definition: dbcore.h:39
PyRep * GetSystemAsks(uint32 solarSystemID)
Definition: MarketDB.cpp:65
static void UpdateMktPrice(std::map< uint16, Market::matlData > &data)
Definition: MarketDB.cpp:583
void SetItemString(const char *key, PyRep *value)
SetItemString adds or sets a database entry.
Definition: PyRep.h:812
static void UpdateHistory()
Definition: MarketDB.cpp:477
uint32 FindSellOrder(Call_PlaceCharOrder &call)
Definition: MarketDB.cpp:224
static int64 GetUpdateTime()
Definition: MarketDB.cpp:456