EvEmu  0.8.4
11 September 2021
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages
MissionDataMgr.cpp
Go to the documentation of this file.
1 
11 #include "../EVEServerConfig.h"
12 
13 #include "Client.h"
14 #include "EntityList.h"
15 #include "agents/Agent.h"
16 #include "agents/AgentMgrService.h"
17 #include "database/EVEDBUtils.h"
19 #include "inventory/ItemFactory.h"
20 
22 {
23  m_procCount = 0;
24  m_names.clear();
25  m_offers.clear();
26  m_mining.clear();
27  m_courier.clear();
28  m_xoffers.clear();
29  m_missions.clear();
30 }
31 
33 {
37 }
38 
40 {
41  m_names.clear();
42  m_offers.clear();
43  m_mining.clear();
44  m_courier.clear();
45  m_xoffers.clear();
46  m_missions.clear();
47 }
48 
50 {
51  Populate();
52  sLog.Blue(" MissionDataMgr", "Mission Data Manager Initialized.");
53  return 1;
54 }
55 
57 {
58 
59 }
60 
61 // called every minute from EntityList::Process()
63 {
64  // process open offers every 5m
65  if (++m_procCount > 5) {
66  m_procCount = 0;
67 
68  Agent* pAgent(nullptr);
69  Client* pClient(nullptr);
70  std::multimap<uint32, MissionOffer>::iterator itr = m_offers.begin();
71  while (itr != m_offers.end()) {
72  if (itr->second.expiryTime < GetFileTimeNow()) {
73  pAgent = sEntityList.GetAgent(itr->second.agentID);
74  pClient = sEntityList.FindClientByCharID(itr->first);
75  // notify client if they are online. eventaully we'll send mail also
76  if (itr->second.stateID == Mission::State::Accepted) {
77  pAgent->SendMissionUpdate(pClient, "failed");
78  itr->second.stateID = Mission::State::Failed;
79  if (itr->second.courierTypeID) {
80  // remove item from player's possession
81  if (pClient != nullptr) {
82  pClient->RemoveMissionItem(itr->second.courierTypeID, itr->second.courierAmount);
83  } else {
84  MissionDB::RemoveMissionItem(itr->first, itr->second.courierTypeID, itr->second.courierAmount);
85  }
86  }
87  } else if (itr->second.stateID == Mission::State::Offered) {
88  pAgent->SendMissionUpdate(pClient, "offer_expired");
89  itr->second.stateID = Mission::State::Expired;
90  }
91  std::multimap<uint32, MissionOffer>::iterator itr2 = m_aoffers.find(itr->second.agentID);
92  if (itr2 != m_aoffers.end())
93  m_aoffers.erase(itr2);
94  m_xoffers.emplace(itr->first, itr->second);
95  pAgent->RemoveOffer(itr->first);
96  MissionDB::UpdateMissionOffer(itr->second);
97  itr = m_offers.erase(itr);
98  pAgent = nullptr;
99  pClient = nullptr;
100  } else {
101  ++itr;
102  }
103  }
104  }
105 }
106 
107 
109 {
110  double start = GetTimeMSeconds();
111  double begin = GetTimeMSeconds();
112 
113  CourierPNG = new PyString("<img src='res:/UI/netres/mission_content/couriermission.png' align=center hspace=4 vspace=4>");
114  MiningPNG = new PyString("<img src='res:/UI/netres/mission_content/miningmission.png' align=center hspace=4 vspace=4>");
115  KillPNG = new PyString("<img src='res:/UI/netres/mission_content/killmission.png' align=center hspace=4 vspace=4>");
116  /* not sure if these are used/needed....
117  PNG = new PyString("<img src='res:/UI/netres/mission_content/agent_interaction.png' align=center hspace=4 vspace=4>");
118  PNG = new PyString("<img src='res:/UI/netres/mission_content/agent_talkto.png' align=center hspace=4 vspace=4>");
119  PNG = new PyString("<img src='res:/UI/netres/mission_content/arc_amarr.png' align=center hspace=4 vspace=4>");
120  PNG = new PyString("<img src='res:/UI/netres/mission_content/arc_caldari.png' align=center hspace=4 vspace=4>");
121  PNG = new PyString("<img src='res:/UI/netres/mission_content/arc_gallente.png' align=center hspace=4 vspace=4>");
122  PNG = new PyString("<img src='res:/UI/netres/mission_content/arc_minmatar.png' align=center hspace=4 vspace=4>");
123  PNG = new PyString("<img src='res:/UI/netres/mission_content/arc_npe.png' align=center hspace=4 vspace=4>");
124  PNG = new PyString("<img src='res:/UI/netres/mission_content/blood_stained.png' align=center hspace=4 vspace=4>");
125  PNG = new PyString("<img src='res:/UI/netres/mission_content/angels_and_artifacts.png' align=center hspace=4 vspace=4>");
126  PNG = new PyString("<img src='res:/UI/netres/mission_content/smash_and_grab.png' align=center hspace=4 vspace=4>");
127  */
128 
129  DBQueryResult* res = new DBQueryResult();
130  DBResultRow row;
131 
133  while (res->GetRow(row)) {
134  //SELECT id, briefingID, name, level, typeID, important, storyline, itemTypeID, itemQty, rewardISK, rewardItemID, rewardItemQty, bonusISK, bonusTime, sysRange, raceID FROM qstCourier
135  CourierData data = CourierData();
136  data.missionID = row.GetInt(0);
137  data.briefingID = row.GetInt(1);
138  data.name = row.GetText(2);
139  data.level = row.GetInt(3);
140  data.typeID = row.GetInt(4);
141  data.important = row.GetBool(5);
142  data.storyline = row.GetBool(6);
143  data.itemTypeID = row.GetInt(7);
144  data.itemQty = row.GetInt(8);
145  data.itemVolume = row.GetFloat(9);
146  data.rewardISK = row.GetInt(10);
147  data.rewardItemID = row.GetInt(11);
148  data.rewardItemQty = row.GetInt(12);
149  data.bonusISK = row.GetInt(13);
150  data.bonusTime = row.GetInt(14);
151  data.range = row.GetInt(15);
152  data.raceID = row.GetInt(16);
153  if (data.important) {
154  m_courierImp.emplace(row.GetInt(3), data);
155  } else {
156  m_courier.emplace(row.GetInt(3), data);
157  }
158  }
159  sLog.Cyan(" MissionDataMgr", "%u(%u) Courier Mission Data Sets loaded in %.3fms.", m_courier.size(), m_courierImp.size(),(GetTimeMSeconds() - start));
160 
161  //res->Reset();
162  start = GetTimeMSeconds();
164  while (res->GetRow(row)) {
165  //SELECT id, briefingID, name, level, typeID, important, storyline, itemTypeID, itemQty, rewardISK, rewardItemID, rewardItemQty, bonusISK, bonusTime, sysRange, raceID FROM qstMining
166  CourierData data = CourierData();
167  data.missionID = row.GetInt(0);
168  data.briefingID = row.GetInt(1);
169  data.name = row.GetText(2);
170  data.level = row.GetInt(3);
171  data.typeID = row.GetInt(4);
172  data.important = row.GetBool(5);
173  data.storyline = row.GetBool(6);
174  data.itemTypeID = row.GetInt(7);
175  data.itemQty = row.GetInt(8);
176  data.itemVolume = row.GetFloat(9);
177  data.rewardISK = row.GetInt(10);
178  data.rewardItemID = row.GetInt(11);
179  data.rewardItemQty = row.GetInt(12);
180  data.bonusISK = row.GetInt(13);
181  data.bonusTime = row.GetInt(14);
182  data.range = row.GetInt(15);
183  data.raceID = row.GetInt(16);
184  if (data.important) {
185  m_miningImp.emplace(row.GetInt(3), data);
186  } else {
187  m_mining.emplace(row.GetInt(3), data);
188  }
189  }
190  sLog.Cyan(" MissionDataMgr", "%u(%u) Mining Mission Data Sets loaded in %.3fms.", m_mining.size(), m_miningImp.size(), (GetTimeMSeconds() - start));
191 
192  start = GetTimeMSeconds();
193  sLog.Cyan(" MissionDataMgr", "0(0) Encounter Mission Data Sets loaded in %.3fms.", (GetTimeMSeconds() - start));
194 
195  start = GetTimeMSeconds();
196  sLog.Cyan(" MissionDataMgr", "0(0) Storyline Mission Data Sets loaded in %.3fms.", (GetTimeMSeconds() - start));
197 
198  start = GetTimeMSeconds();
199  sLog.Cyan(" MissionDataMgr", "0(0) Tutorial Mission Data Sets loaded in %.3fms.", (GetTimeMSeconds() - start));
200 
201  start = GetTimeMSeconds();
202  sLog.Cyan(" MissionDataMgr", "0(0) Research Mission Data Sets loaded in %.3fms.", (GetTimeMSeconds() - start));
203 
204  start = GetTimeMSeconds();
205  sLog.Cyan(" MissionDataMgr", "0(0) Anomic Mission Data Sets loaded in %.3fms.", (GetTimeMSeconds() - start));
206 
207  start = GetTimeMSeconds();
208  sLog.Cyan(" MissionDataMgr", "0(0) Data Mission Data Sets loaded in %.3fms.", (GetTimeMSeconds() - start));
209 
210  start = GetTimeMSeconds();
211  sLog.Cyan(" MissionDataMgr", "0(0) Trade Mission Data Sets loaded in %.3fms.", (GetTimeMSeconds() - start));
212 
213  start = GetTimeMSeconds();
214  sLog.Cyan(" MissionDataMgr", "0(0) Burner Mission Data Sets loaded in %.3fms.", (GetTimeMSeconds() - start));
215 
216  start = GetTimeMSeconds();
217  sLog.Cyan(" MissionDataMgr", "0(0) Cosmos Mission Data Sets loaded in %.3fms.", (GetTimeMSeconds() - start));
218 
219  start = GetTimeMSeconds();
220  sLog.Cyan(" MissionDataMgr", "0(0) Arc Mission Data Sets loaded in %.3fms.", (GetTimeMSeconds() - start));
221 
222  //res->Reset();
223  start = GetTimeMSeconds();
225  while (res->GetRow(row)) {
226  //SELECT id, briefingID, name, level, typeID, important, storyline, raceID, constellationID, corporationID, dungeonID,
227  // rewardISK, rewardItemID, rewardISKQty, rewardItemQty, bonusISK, bonusTime FROM agtMissions
228  MissionData data = MissionData();
229  data.missionID = row.GetInt(0);
230  data.briefingID = row.GetInt(1);
231  data.name = row.GetText(2);
232  data.level = row.GetInt(3);
233  data.typeID = row.GetInt(4);
234  data.important = row.GetBool(5);
235  data.constellationID = row.GetInt(8);
236  data.corporationID = row.GetInt(9);
237  data.dungeonID = row.GetInt(10);
238  if (data.important) {
239  m_missionsImp.emplace(row.GetInt(3), data);
240  } else {
241  m_missions.emplace(row.GetInt(3), data);
242  }
243  }
244  sLog.Cyan(" MissionDataMgr", "%u(%u) Unsorted Mission Data Sets loaded in %.3fms.", m_missions.size(), m_missionsImp.size(), (GetTimeMSeconds() - start));
245 
246  //res->Reset();
247  start = GetTimeMSeconds();
249  while (res->GetRow(row)) {
250  //SELECT acceptFee, agentID, characterID, courierAmount, courierTypeID, courierItemVolume, dateAccepted, dateIssued, destinationID, destinationTypeID, destinationOwnerID, destinationSystemID,
251  // expiryTime, important, storyline, missionID, briefingID, name, offerID, originID, originOwnerID, originSystemID, remoteCompletable, remoteOfferable,
252  // rewardISK, rewardItemID, rewardItemQty, rewardLP, bonusISK, bonusTime, stateID, typeID, dungeonLocationID, dungeonSolarSystemID FROM agtOffers
253  MissionOffer offer = MissionOffer();
254  offer.acceptFee = row.GetInt(0);
255  offer.agentID = row.GetInt(1);
256  offer.characterID = row.GetInt(2);
257  offer.courierAmount = row.GetInt(3);
258  offer.courierTypeID = row.GetInt(4);
259  offer.courierItemVolume = row.GetFloat(5);
260  offer.dateAccepted = row.GetInt64(6);
261  offer.dateIssued = row.GetInt64(7);
262  offer.destinationID = row.GetInt(8);
263  offer.destinationTypeID = row.GetInt(9);
264  offer.destinationOwnerID = row.GetInt(10);
265  offer.destinationSystemID = row.GetInt(11);
266  offer.expiryTime = row.GetInt64(12);
267  offer.important = row.GetInt(13);
268  offer.storyline = row.GetInt(14);
269  offer.missionID = row.GetInt(15);
270  offer.briefingID = row.GetInt(16);
271  offer.name = row.GetText(17);
272  offer.offerID = row.GetInt(18);
273  offer.originID = row.GetInt(19);
274  offer.originOwnerID = row.GetInt(20);
275  offer.originSystemID = row.GetInt(21);
276  offer.remoteCompletable = row.GetInt(22);
277  offer.remoteOfferable = row.GetInt(23);
278  offer.rewardISK = row.GetInt(24);
279  offer.rewardItemID = row.GetInt(25);
280  offer.rewardItemQty = row.GetInt(26);
281  offer.rewardLP = row.GetInt(27);
282  offer.bonusISK = row.GetInt(28);
283  offer.bonusTime = row.GetInt(29);
284  offer.stateID = row.GetInt(30);
285  offer.typeID = row.GetInt(31);
286  offer.dungeonLocationID = row.GetInt(32);
287  offer.dungeonSolarSystemID = row.GetInt(33);
288  offer.dateCompleted = 0;
289  // will need to determine how to store/retrieve bookmarks as a list of dicts here
290  offer.bookmarks = new PyList();
291  m_offers.emplace(row.GetInt(2), offer);
292  m_aoffers.emplace(row.GetInt(1), offer); // do we really want dupe data here? yes. need offer by char and by agent
293  }
294  sLog.Cyan(" MissionDataMgr", "%u Open Mission Offers loaded in %.3fms.", m_offers.size(), (GetTimeMSeconds() - start));
295 
296  //res->Reset();
297  start = GetTimeMSeconds();
298  // config switch to allow loading/displaying of expired/completed mission offers
299  if (sConfig.server.LoadOldMissions)
301  while (res->GetRow(row)) {
302  //SELECT agentID, characterID, courierAmount, courierTypeID, dateAccepted, dateCompleted, dateIssued, destinationID, expiryTime, important, storyline, missionID, name,
303  // offerID, originID, rewardISK, rewardItemID, rewardItemQty, rewardLP, stateID, typeID FROM agtOffers
304  MissionOffer offer = MissionOffer();
305  offer.agentID = row.GetInt(0);
306  offer.characterID = row.GetInt(1);
307  offer.courierAmount = row.GetInt(2);
308  offer.courierTypeID = row.GetInt(3);
309  offer.dateAccepted = row.GetInt64(4);
310  offer.dateCompleted = row.GetInt64(5);
311  offer.dateIssued = row.GetInt64(6);
312  offer.destinationID = row.GetInt(7);
313  offer.expiryTime = row.GetInt64(8);
314  offer.important = row.GetInt(9);
315  offer.storyline = row.GetInt(10);
316  offer.missionID = row.GetInt(11);
317  offer.name = row.GetText(12);
318  offer.offerID = row.GetInt(13);
319  offer.originID = row.GetInt(14);
320  offer.rewardISK = row.GetInt(15);
321  offer.rewardItemID = row.GetInt(16);
322  offer.rewardItemQty = row.GetInt(17);
323  offer.rewardLP = row.GetInt(18);
324  offer.stateID = row.GetInt(19);
325  offer.typeID = row.GetInt(20);
326  offer.briefingID = 0;
327  offer.acceptFee = 0;
328  offer.bonusISK = 0;
329  offer.bonusTime = 0;
330  offer.remoteCompletable = 0;
331  offer.remoteOfferable = 0;
332  offer.originOwnerID = 0;
333  offer.originSystemID = 0;
334  offer.destinationTypeID = 0;
335  offer.destinationOwnerID = 0;
336  offer.destinationSystemID = 0;
337  offer.dungeonLocationID = 0;
338  offer.dungeonSolarSystemID = 0;
339  offer.bookmarks = new PyList(); //invalid offers will not have bms
340  m_xoffers.emplace(row.GetInt(2), offer);
341  }
342  sLog.Cyan(" MissionDataMgr", "%u Closed Mission Offers loaded in %.3fms.", m_xoffers.size(), (GetTimeMSeconds() - start));
343 
344  // cleanup
345  SafeDelete(res);
346 /*
347  m_names.emplace("Arisite Envy", 45000 );
348  m_names.emplace("Asteroid Catastrophe", 1080 );
349  m_names.emplace("Better World", 6000 );
350  m_names.emplace("Beware They Live", 9000 );
351  m_names.emplace("Bountiful Bandine", 2000 );
352  m_names.emplace("Burnt Traces", 1080 );
353  m_names.emplace("Cheap Chills", 20000 );
354  m_names.emplace("Claimjumpers", 1800 );
355  m_names.emplace("Data Mining", 299 );
356  m_names.emplace("Down and Dirty", 2250 );
357  m_names.emplace("Drone Distribution", 4000 );
358  m_names.emplace("Feeding the Giant", 44800 );
359  m_names.emplace("Gas Injections", 4250 );
360  m_names.emplace("Geodite and Gemology", 44800 );
361  m_names.emplace("Ice Installation", 20000 );
362  m_names.emplace("Like Drones to a Cloud", 4250 );
363  m_names.emplace("Mercium Belt", 6000 );
364  m_names.emplace("Mercium Experiments", 1080 );
365  m_names.emplace("Mother Lode", 44800 );
366  m_names.emplace("Not Gneiss at All", 45000 );
367  m_names.emplace("Pile of Pithix", 9000 );
368  m_names.emplace("Persistent Pests", 4000 );
369  m_names.emplace("Starting Simple", 2000 );
370  m_names.emplace("Stay Frosty", 10000 );
371  m_names.emplace("Understanding Augmene", 2625 );
372  m_names.emplace("Unknown Events", 6000 );
373  */
374  sLog.Cyan(" MissionDataMgr", "Mission Data loaded in %.3fms.", (GetTimeMSeconds() - begin));
375 }
376 
378 {
379  m_offers.emplace(charID, data);
380  m_aoffers.emplace(data.agentID, data);
381 }
382 
384 {
385  auto itr = m_offers.equal_range(charID);
386  for (auto it = itr.first; it != itr.second; ++it)
387  if (it->second.agentID == data.agentID) {
388  m_offers.erase(it);
389  break;
390  }
391 
392  itr = m_aoffers.equal_range(data.agentID);
393  for (auto it = itr.first; it != itr.second; ++it)
394  if (it->second.characterID == charID) {
395  m_aoffers.erase(it);
396  break;
397  }
398 }
399 
400 void MissionDataMgr::LoadAgentOffers(const uint32 agentID, std::map< uint32, MissionOffer >& data)
401 {
402  auto itr = m_aoffers.equal_range(agentID);
403  for (auto it = itr.first; it != itr.second; ++it)
404  data[it->second.characterID] = (it->second);
405 }
406 
407 void MissionDataMgr::LoadMissionOffers(uint32 charID, std::vector<MissionOffer>& data)
408 {
409  auto itr = m_offers.equal_range(charID);
410  for (auto it = itr.first; it != itr.second; ++it)
411  data.push_back(it->second);
412 
413  // config switch to allow loading/displaying of expired/completed mission offers
414  // not completely working yet.....AgentMgrService::Handle_GetMyJournalDetails() will need work to implement this.
415  if (sConfig.server.LoadOldMissions) {
416  auto itr = m_xoffers.equal_range(charID);
417  for (auto it = itr.first; it != itr.second; ++it)
418  data.push_back(it->second);
419  }
420 }
421 
422 void MissionDataMgr::CreateMissionOffer(uint8 typeID, uint8 level, uint8 raceID, bool important, MissionOffer& data)
423 {
424  // variable mission data based on agent, init to 0 here.
426  data.dateIssued = GetFileTimeNow();
427  data.remoteOfferable = false;
428  data.remoteCompletable = false;
429  data.range = 0;
430  data.offerID = 0;
431  data.agentID = 0;
432  data.rewardLP = 0;
433  data.originID = 0;
434  data.originOwnerID = 0;
435  data.originSystemID = 0;
436  data.acceptFee = 0;
437  data.expiryTime = 0;
438  data.characterID = 0;
439  data.dateAccepted = 0;
440  data.dateCompleted = 0;
441  data.destinationID = 0;
442  data.destinationTypeID = 0;
443  data.destinationOwnerID = 0;
444  data.destinationSystemID = 0;
445  data.dungeonLocationID = 0;
446  data.dungeonSolarSystemID = 0;
447  data.bookmarks = new PyList();
448 
450  switch (typeID) {
451  case Mission::Type::Courier: {
452  CourierData cData = CourierData();
453  std::vector<CourierData> cVec;
454  if (important) {
455  auto itr = m_courierImp.equal_range(level);
456  for (auto it = itr.first; it != itr.second; ++it)
457  cVec.push_back(it->second);
458  } else {
459  auto itr = m_courier.equal_range(level);
460  for (auto it = itr.first; it != itr.second; ++it)
461  cVec.push_back(it->second);
462  }
463  cData = cVec[MakeRandomInt(0, (cVec.size() -1))];
464  // verify mission race acceptable
465  if ((cData.raceID) and ((cData.raceID & raceID) != raceID)) {
466  for (auto cur :cVec) {
467  if ((cur.raceID & raceID) == raceID)
468  cData = cur;
469  }
470  }
471 
472  data.name = cData.name;
473  data.typeID = cData.typeID;
474  data.bonusISK = cData.bonusISK;
475  data.rewardISK = cData.rewardISK;
476  data.bonusTime = cData.bonusTime;
477  data.important = cData.important;
478  data.storyline = cData.storyline;
479  data.missionID = cData.missionID;
480  data.briefingID = cData.briefingID;
481  data.rewardItemID = cData.rewardItemID;
482  data.rewardItemQty = cData.rewardItemQty;
483  data.courierTypeID = cData.itemTypeID;
484  data.courierAmount = cData.itemQty;
485  data.courierItemVolume = cData.itemVolume;
486  data.range = cData.range;
487  } break;
488  case Mission::Type::Mining: {
489  CourierData cData = CourierData();
490  std::vector<CourierData> cVec;
491  if (important) {
492  auto itr = m_miningImp.equal_range(level);
493  for (auto it = itr.first; it != itr.second; ++it)
494  cVec.push_back(it->second);
495  } else {
496  auto itr = m_mining.equal_range(level);
497  for (auto it = itr.first; it != itr.second; ++it)
498  cVec.push_back(it->second);
499  }
500  cData = cVec[MakeRandomInt(0, (cVec.size() -1))];
501 
502  data.name = cData.name;
503  data.typeID = cData.typeID;
504  data.bonusISK = cData.bonusISK;
505  data.rewardISK = cData.rewardISK;
506  data.bonusTime = cData.bonusTime;
507  data.important = cData.important;
508  data.storyline = cData.storyline;
509  data.missionID = cData.missionID;
510  data.briefingID = cData.briefingID;
511  data.rewardItemID = cData.rewardItemID;
512  data.rewardItemQty = cData.rewardItemQty;
513  data.courierTypeID = cData.itemTypeID;
514  data.courierAmount = cData.itemQty;
515  data.courierItemVolume = cData.itemVolume;
516  data.range = cData.range;
517  } break;
519  } break;
521  } break;
522  case Mission::Type::Trade: {
523  } break;
525  } break;
526  case Mission::Type::Data: {
527  } break;
529  } break;
530  case Mission::Type::Cosmos: {
531  } break;
532  case Mission::Type::Arc: {
533  } break;
534  case Mission::Type::Anomic: {
535  } break;
536  }
537 
538  _log(AGENT__DEBUG, "Created %s level %u %s offer - '%s'", (important?"an important":"a"), level, GetTypeName(data.typeID).c_str(), data.name.c_str());
539 }
540 
541 
543 {
544  using namespace Mission::Type;
545  switch (typeID) {
546  case Tutorial: return "Tutorial";
547  case Encounter: return "Encounter";
548  case Courier: return "Courier";
549  case Trade: return "Trade";
550  case Mining: return "Mining";
551  case Research: return "Research";
552  case Data: return "Data";
553  case Storyline: return "Storyline";
554  case Cosmos: return "Cosmos";
555  case Arc: return "Arc";
556  case Anomic: return "Anomic";
557  case Burner: return "Burner";
558  default: return "Invalid";
559  }
560 }
561 
563 {
564  using namespace Mission::Type;
565  switch (typeID) {
566  case Tutorial: return "UI/Agents/MissionTypes/Tutorial";
567  case Encounter: return "UI/Agents/MissionTypes/Encounter";
568  case Courier: return "UI/Agents/MissionTypes/Courier";
569  case Trade: return "UI/Agents/MissionTypes/Trade";
570  case Mining: return "UI/Agents/MissionTypes/Mining";
571  case Research: return "UI/Agents/MissionTypes/Research";
572  case Data: return "UI/Agents/MissionTypes/Data";
573  case Storyline: return "UI/Agents/MissionTypes/Storyline";
574  case Cosmos: return "UI/Agents/MissionTypes/Cosmos";
575  case Arc: return "UI/Agents/MissionTypes/EpicArc";
576  case Anomic: return "UI/Agents/MissionTypes/Anomic";
577  case Burner: return "UI/Agents/MissionTypes/Burner";
578  default: return "Invalid";
579  }
580 }
581 
583 {
584  auto itr = m_offers.equal_range(charID);
585  for (auto it = itr.first; it != itr.second; ++it)
586  if (it->second.agentID == data.agentID) {
587  it->second = data;
588  break;
589  }
590 
591  itr = m_aoffers.equal_range(data.agentID);
592  for (auto it = itr.first; it != itr.second; ++it)
593  if (it->second.characterID == charID) {
594  it->second = data;
595  break;
596  }
597 }
uint16 bonusTime
Definition: EVE_Missions.h:73
#define sConfig
A macro for easier access to the singleton.
unsigned __int8 uint8
Definition: eve-compat.h:46
double dateAccepted
Definition: EVE_Missions.h:60
std::multimap< uint32, MissionOffer > m_aoffers
std::multimap< uint32, MissionOffer > m_xoffers
uint32 corporationID
Definition: EVE_Missions.h:19
std::string GetTypeLabel(uint8 typeID)
const char * GetText(uint32 index) const
Definition: dbcore.h:104
uint16 missionID
Definition: EVE_Missions.h:34
void RemoveOffer(uint32 charID)
Definition: Agent.cpp:207
#define _log(type, fmt,...)
Definition: logsys.h:124
float GetFloat(uint32 index) const
Definition: dbcore.cpp:682
static void RemoveMissionItem(uint32 charID, uint16 typeID, uint32 qty)
Definition: MissionDB.cpp:117
Python string.
Definition: PyRep.h:430
float itemVolume
Definition: EVE_Missions.h:82
int32 GetInt(uint32 index) const
Definition: dbcore.cpp:635
uint32 agentID
Definition: EVE_Missions.h:42
double dateIssued
Definition: EVE_Missions.h:59
uint32 rewardISK
Definition: EVE_Missions.h:80
std::multimap< uint8, CourierData > m_courier
uint16 missionID
Definition: EVE_Missions.h:16
uint16 destinationTypeID
Definition: EVE_Missions.h:40
uint32 bonusISK
Definition: EVE_Missions.h:47
std::multimap< uint32, MissionOffer > m_offers
std::string name
Definition: EVE_Missions.h:83
PyString * MiningPNG
void LoadMissionOffers(uint32 charID, std::vector< MissionOffer > &data)
uint8 typeID
Definition: EVE_Missions.h:70
static void LoadMiningData(DBQueryResult &res)
Definition: MissionDB.cpp:33
float courierItemVolume
Definition: EVE_Missions.h:57
#define sEntityList
Definition: EntityList.h:208
uint32 characterID
Definition: EVE_Missions.h:45
std::string name
Definition: EVE_Missions.h:62
uint16 rewardLP
Definition: EVE_Missions.h:35
std::multimap< uint8, MissionData > m_missionsImp
void SafeDelete(T *&p)
Deletes and nullifies a pointer.
Definition: SafeMem.h:83
void RemoveMissionItem(uint16 typeID, uint32 qty)
Definition: Client.cpp:1711
uint16 rewardItemQty
Definition: EVE_Missions.h:37
bool GetRow(DBResultRow &into)
Definition: dbcore.cpp:552
bool GetBool(uint32 index) const
Definition: dbcore.cpp:647
PyString * CourierPNG
uint32 originSystemID
Definition: EVE_Missions.h:50
#define sLog
Evaluates to a NewLog instance.
Definition: LogNew.h:250
uint32 destinationSystemID
Definition: EVE_Missions.h:53
static void LoadOpenOffers(DBQueryResult &res)
Definition: MissionDB.cpp:86
uint32 briefingID
Definition: EVE_Missions.h:43
uint32 dungeonLocationID
Definition: EVE_Missions.h:54
uint16 rewardItemQty
Definition: EVE_Missions.h:78
uint16 courierTypeID
Definition: EVE_Missions.h:38
std::multimap< uint8, CourierData > m_miningImp
uint16 rewardItemID
Definition: EVE_Missions.h:77
double GetTimeMSeconds()
Definition: utils_time.cpp:104
uint32 dungeonID
Definition: EVE_Missions.h:20
Definition: Agent.h:21
std::string name
Definition: EVE_Missions.h:21
uint16 itemTypeID
Definition: EVE_Missions.h:75
void CreateMissionOffer(uint8 typeID, uint8 level, uint8 raceID, bool important, MissionOffer &data)
uint32 briefingID
Definition: EVE_Missions.h:79
std::multimap< uint8, CourierData > m_mining
static void LoadCourierData(DBQueryResult &res)
Definition: MissionDB.cpp:24
uint16 bonusTime
Definition: EVE_Missions.h:33
uint32 bonusISK
Definition: EVE_Missions.h:81
bool storyline
Definition: EVE_Missions.h:68
double expiryTime
Definition: EVE_Missions.h:58
uint32 constellationID
Definition: EVE_Missions.h:18
double dateCompleted
Definition: EVE_Missions.h:61
uint8 raceID
Definition: EVE_Missions.h:72
static void LoadClosedOffers(DBQueryResult &res)
Definition: MissionDB.cpp:97
#define PyDecRef(op)
Definition: PyRep.h:57
uint32 rewardISK
Definition: EVE_Missions.h:46
Definition: Client.h:66
uint16 rewardItemID
Definition: EVE_Missions.h:36
unsigned __int32 uint32
Definition: eve-compat.h:50
bool important
Definition: EVE_Missions.h:12
void RemoveMissionOffer(uint32 charID, MissionOffer &data)
void AddMissionOffer(uint32 charID, MissionOffer &data)
std::multimap< uint8, CourierData > m_courierImp
bool remoteOfferable
Definition: EVE_Missions.h:28
bool important
Definition: EVE_Missions.h:67
double GetFileTimeNow()
Definition: utils_time.cpp:84
uint32 destinationOwnerID
Definition: EVE_Missions.h:52
int64 MakeRandomInt(int64 low, int64 high)
Generates random integer from interval [low; high].
Definition: misc.cpp:109
uint32 briefingID
Definition: EVE_Missions.h:17
void UpdateMissionData(uint32 charID, MissionOffer &data)
PyString * KillPNG
std::multimap< uint8, MissionData > m_missions
uint16 missionID
Definition: EVE_Missions.h:74
uint32 dungeonSolarSystemID
Definition: EVE_Missions.h:55
uint16 itemQty
Definition: EVE_Missions.h:76
std::map< std::string, uint32 > m_names
void SendMissionUpdate(Client *pClient, std::string action)
Definition: Agent.cpp:696
uint16 courierAmount
Definition: EVE_Missions.h:39
bool remoteCompletable
Definition: EVE_Missions.h:29
uint32 destinationID
Definition: EVE_Missions.h:51
int64 GetInt64(uint32 index) const
Definition: dbcore.cpp:670
std::string GetTypeName(uint8 typeID)
void LoadAgentOffers(const uint32 agentID, std::map< uint32, MissionOffer > &data)
uint32 acceptFee
Definition: EVE_Missions.h:56
uint8 typeID
Definition: EVE_Missions.h:14
uint32 originID
Definition: EVE_Missions.h:48
Python list.
Definition: PyRep.h:639
static void UpdateMissionOffer(MissionOffer &data)
Definition: MissionDB.cpp:76
static void LoadMissionData(DBQueryResult &res)
Definition: MissionDB.cpp:16
PyList * bookmarks
Definition: EVE_Missions.h:63
uint32 originOwnerID
Definition: EVE_Missions.h:49
uint32 offerID
Definition: EVE_Missions.h:41