EvEmu  0.8.4
11 September 2021
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages
MarketBotMgr.cpp
Go to the documentation of this file.
1 
11 #include "eve-server.h"
12 #include "EVEServerConfig.h"
13 #include "market/MarketBotConf.h"
14 #include "market/MarketBotMgr.h"
15 #include "market/MarketMgr.h"
17 
18 
19 static const char* const BOT_CONFIG_FILE = EVEMU_ROOT "/etc/MarketBot.xml";
20 
21 
23 {
24  m_initalized = false;
25 }
26 
28 {
29  m_initalized = true;
30 
31  /* load current data */
32 
33  sLog.Blue(" MarketBotDataMgr", "Market Bot Data Manager Initialized.");
34  return 1;
35 }
36 
37 
38 
40 : m_updateTimer(20 *60 *1000) // arbitrary 20m default
41 {
42  m_initalized = false;
43 }
44 
46 {
47  if (!sMBotConf.ParseFile(BOT_CONFIG_FILE)) {
48  sLog.Error(" ServerInit", "Loading Market Bot Config file '%s' failed.", BOT_CONFIG_FILE);
49  return 0;
50  }
51 
52  m_initalized = true;
53  sMktBotDataMgr.Initialize();
54 
55  /* start timers, process current data, and create new orders, if needed */
56 
57  sLog.Blue(" MarketBotMgr", "Market Bot Manager Initialized.");
58  return 1;
59 }
60 
61 // this is called on a minute timer from EntityList
63 {
64  if (!m_initalized)
65  return;
66 
67  if (m_updateTimer.Check()) {
68  /* process current data, process orders, xfer funds, reset timers, create new orders */
69 
70  }
71 }
72 
73 
75 {
76 
77 }
78 
80 {
81 
82 }
83 
void RemoveSystem()
#define sMBotConf
Definition: MarketBotConf.h:73
void AddSystem()
#define sLog
Evaluates to a NewLog instance.
Definition: LogNew.h:250
bool Check(bool reset=true)
Definition: timer.cpp:62
#define sMktBotDataMgr
Definition: MarketBotMgr.h:34
static const char *const BOT_CONFIG_FILE
Timer m_updateTimer
Definition: MarketBotMgr.h:52
bool m_initalized
Definition: MarketBotMgr.h:54