EvEmu  0.8.4
11 September 2021
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages
RamMethods.cpp
Go to the documentation of this file.
1 
10 #include "PyCallable.h"
11 
12 #include "../eve-common/EVE_Character.h"
13 #include "Client.h"
16 #include "station/StationDataMgr.h"
17 
18 static const uint32 RAM_PRODUCTION_TIME_LIMIT = 60*60*24*30; //30 days
19 
20 /*
21  * # Manufacturing Logging:
22  * MANUF__ERROR
23  * MANUF__WARNING
24  * MANUF__MESSAGE
25  * MANUF__INFO
26  * MANUF__DEBUG
27  * MANUF__TRACE
28  * MANUF__DUMP
29  */
30 
31 /*
32  * NOT IMPLEMENTED EXCEPTIONS:
33  ************************************
34  * RamRemoteInstalledItemImpounded - impound of installedItem
35  * RamInstallJob_InstalledItemChanged - some cache expiration??
36  */
37 
38 
39 void RamMethods::ActivityCheck(Client* const pClient, const Call_InstallJob& args, BlueprintRef bpRef)
40 {
41  if (bpRef.get() == nullptr)
42  throw UserError ("RamInventionNoOutput");
43 
44  // check validity of activity
45  if ((args.activityID < EvERam::Activity::Manufacturing)
46  or (args.activityID > EvERam::Activity::Invention))
47  throw UserError ("RamAssemblyLineHasNoActivity");
48 
49  const ItemType* pType(nullptr);
50  switch(args.activityID) {
52  if (!bpRef->infinite()
53  and ((bpRef->runs() - args.runs) < 0))
54  throw UserError ("RamTooManyProductionRuns");
55 
56  pType = &bpRef->productType();
57  } break;
60  if (bpRef->copy())
61  throw UserError ("RamCannotResearchABlueprintCopy");
62  pType = &bpRef->type();
63  } break;
65  if (bpRef->copy())
66  throw UserError ("RamCannotCopyABlueprintCopy");
67  pType = &bpRef->type();
68  } break;
70  if (!bpRef->copy() or bpRef->infinite())
71  throw UserError ("RamCannotInventABlueprintOriginal");
72 
73  uint32 pTypeID = FactoryDB::GetTech2Blueprint(bpRef->typeID());
74  if (pTypeID == 0)
75  throw UserError ("RamInventionNoOutput");
76  if (bpRef->runs() < 1)
77  throw UserError ("RamTooManyProductionsRuns");
78 
79  pType = &bpRef->productType();
80  } break;
81  case EvERam::Activity::ReverseEngineering: // RE is ONLY at experimental POS module...cannot do RE in stations. right now, this will never hit.
82  case EvERam::Activity::ResearchTech: // cannot find any reference to this. not used?
83  case EvERam::Activity::Duplicating: // ancient pre-apoc 'copy' activity. no longer used.
84  default: {
85  // not supported
86  sLog.Error("RAM::InstallJob()", "Unsupported Activity %u sent by %s(%u).", args.activityID, pClient->GetName(), pClient->GetCharacterID());
87  throw UserError ("RamActivityInvalid");
88  }
89  }
90 
91  if (pType == nullptr)
92  throw UserError ("RamNoKnownOutputType");
93 
94  if (!FactoryDB::IsProducableBy(args.AssemblyLineID, pType))
95  throw UserError ("RamBadEndProductForActivity");
96 }
97 
98 void RamMethods::JobsCheck(Character* pChar, const Call_InstallJob& args)
99 {
100  if (args.activityID == EvERam::Activity::Manufacturing) {
101  uint32 jobCount = FactoryDB::CountManufacturingJobs(pChar->itemID());
102  uint charMaxJobs = pChar->GetAttribute(AttrManufactureSlotLimit).get_int()
105 
106  if (charMaxJobs <= jobCount)
107  throw UserError ("MaxFactorySlotUsageReached")
108  .AddAmount ("current", jobCount)
109  .AddAmount ("max", charMaxJobs);
110  } else {
111  uint charMaxJobs = pChar->GetAttribute(AttrMaxLaborotorySlots).get_int()
114 
115  uint32 jobCount = FactoryDB::CountResearchJobs(pChar->itemID());
116  if (charMaxJobs <= jobCount)
117  throw UserError ("MaxResearchFacilitySlotUsageReached")
118  .AddAmount ("current", jobCount)
119  .AddAmount ("max", charMaxJobs);
120  }
121 }
122 
123 void RamMethods::InstallationCheck(Client*const pClient, int32 lineLocationID)
124 {
125  if (sDataMgr.IsStation(lineLocationID)) {
126  uint32 regionID = sDataMgr.GetStationRegion(lineLocationID);
127  if (!IsRegionID(regionID))
128  throw UserError ("RamIsNotAnInstallation");
129  if (pClient->GetRegionID() != regionID)
130  throw UserError ("RamRangeLimitationRegion");
131  } else {
132  // get structure data and run tests
133  // RamStructureNotInSpace
134  // RamStructureNotIsSolarsystem
135  }
136 
137  // check player skill for limits
138  // RamRangeLimitation
139  // RamRangeLimitationJumps
140  // RamRangeLimitationJumpsNoSkill
141 
142  /*
143  * jumpsPerSkillLevel =
144  * {0: -1, // station/structure
145  * 1: 0, // system
146  * 2: 5,
147  * 3: 10,
148  * 4: 20,
149  * 5: 50}
150  */
151 }
152 
153 void RamMethods::LinePermissionCheck(Client*const pClient, const Call_InstallJob& args)
154 {
155  // get properties
157  if (!FactoryDB::GetAssemblyLineRestrictions(args.AssemblyLineID, data))
158  throw UserError ("RamInstallationHasNoDefaultContent");
159 
160  // check validity of activity
163  throw UserError ("RamAssemblyLineHasNoActivity");
164 
165  // verify corp roles
166  if (args.isCorpJob) {
167  int64 roles(pClient->GetCorpRole());
168  // check slot rental permissions first
169  if (args.activityID == EvERam::Activity::Manufacturing) {
171  throw UserError ("RamCannotInstallWithoutRentFactorySlot");
172  } else {
174  throw UserError ("RamCannotInstallWithoutRentResearchSlot");
175  }
177  throw UserError ("RamCannotInstallForCorpByRoleFactoryManager");
179  throw UserError ("RamCannotInstallForCorpByRole");
180  }
181 
182  // check usage restriction
184  if (data.ownerID != pClient->GetAllianceID())
185  throw UserError ("RamAccessDeniedWrongAlliance");
186  }
188  if (data.ownerID != pClient->GetCorporationID())
189  throw UserError ("RamAccessDeniedWrongCorp");
190  }
191 
192  // check standing
194  // get standings
195  if (args.isCorpJob) {
196  if (data.minStanding > StandingDB::GetStanding(data.ownerID, pClient->GetCorporationID()))
197  throw UserError ("RamAccessDeniedCorpStandingTooLow");
198  } else {
199  if (data.minStanding > pClient->GetChar()->GetStandingModified(data.ownerID))
200  throw UserError ("RamAccessDeniedStandingTooLow");
201  }
202  }
203 
204  // check security rating
206  if (args.isCorpJob) {
208  if (data.minCorpSec > pClient->GetChar()->corpSecRating())
209  throw UserError ("RamAccessDeniedCorpSecStatusTooLow");
210  if (data.maxCorpSec < pClient->GetChar()->corpSecRating())
211  throw UserError ("RamAccessDeniedCorpSecStatusTooHigh");
212  } else {
213  if (data.minCharSec > pClient->GetSecurityRating())
214  throw UserError ("RamAccessDeniedSecStatusTooLow");
215  if (data.maxCharSec < pClient->GetSecurityRating())
216  throw UserError ("RamAccessDeniedSecStatusTooHigh");
217  }
218  }
219 }
220 
221 void RamMethods::ItemOwnerCheck(Client*const pClient, const Call_InstallJob& args, BlueprintRef bpRef)
222 {
223  // ownership
224  if (args.isCorpJob) {
225  if (bpRef->ownerID() != pClient->GetCorporationID())
226  throw UserError ("RamCannotInstallItemForAnotherCorp");
227  } else {
228  // this one is checked in client
229  if (bpRef->ownerID() != pClient->GetCharacterID())
230  throw UserError ("RamCannotInstallItemForAnother");
231  }
232 }
233 
234 void RamMethods::ItemLocationCheck(Client*const pClient, const Call_InstallJob& args, InventoryItemRef installedItem)
235 {
236  // a lot of this is checked in client. need to verify
237  if (sDataMgr.IsStation(args.lineContainerID)) {
238  if (installedItem->locationID() != args.lineContainerID) {
239  if (args.lineContainerID == pClient->GetLocationID()) {
240  throw UserError (
241  (args.isCorpJob)
242  ? "RamCorpInstalledItemWrongLocation"
243  : "RamInstalledItemWrongLocation")
244  .AddLocationName ("location", args.lineContainerID);
245  } else {
246  throw UserError ("RamRemoteInstalledItemNotInStation");
247  }
248  } else {
249  if (args.isCorpJob) {
250  if (!IsHangarFlag(installedItem->flag())) {
251  if (args.lineContainerID == pClient->GetLocationID()) {
252  throw UserError(
253  (args.isCorpJob)
254  ? "RamCorpInstalledItemWrongLocation"
255  : "RamInstalledItemWrongLocation")
256  .AddLocationName("location", args.lineContainerID);
257  }
258  }
259  } else {
260  if (installedItem->flag() != flagHangar) {
261  if (args.lineLocationID == pClient->GetLocationID()) {
262  throw UserError ("RamInstalledItemWrongLocation")
263  .AddLocationName ("location", args.lineContainerID);
264  } else {
265  throw UserError ("RamRemoteInstalledItemInStationNotHangar");
266  }
267  }
268  }
269  }
270  } else if (args.lineContainerID == pClient->GetShipID()) {
271  if (pClient->GetChar()->flag() != flagPilot)
272  throw UserError ("RamAccessDeniedNotPilot");
273 
274  if (args.isCorpJob and (installedItem->flag() == flagCargoHold))
275  throw UserError ("RamCorpInstalledItemNotInCargo");
276 
277  if (installedItem->locationID() != args.lineContainerID)
278  throw UserError ("RamInstalledItemMustBeInShip");
279  } else {
280  /* this will be POS assembly modules and Outpost checks
281  * RamStationIsNotConstructed
282  * RamInstalledItemMustBeInInstallation
283  * RamInstalledItemBadLocationStructure
284  * RamInstalledItemInStructureNotInContainer
285  * RamInstalledItemInStructureUnknownLocation
286  */
287  throw CustomError ("R.A.M. at POS/Outpost not supported yet");
288  }
289 }
290 
291 void RamMethods::HangarRolesCheck(Client* const pClient, int16 flagID)
292 {
293  int64 roles(pClient->GetCorpRole());
294  switch (flagID) {
295  case flagHangar: {
297  throw UserError ("RamAccessDeniedToBOMHangar");
298  } break;
299  case flagCorpHangar2: {
301  throw UserError ("RamAccessDeniedToBOMHangar");
302  } break;
303  case flagCorpHangar3: {
305  throw UserError ("RamAccessDeniedToBOMHangar");
306  } break;
307  case flagCorpHangar4: {
309  throw UserError ("RamAccessDeniedToBOMHangar");
310  } break;
311  case flagCorpHangar5: {
313  throw UserError ("RamAccessDeniedToBOMHangar");
314  } break;
315  case flagCorpHangar6: {
317  throw UserError ("RamAccessDeniedToBOMHangar");
318  } break;
319  case flagCorpHangar7: {
321  throw UserError ("RamAccessDeniedToBOMHangar");
322  } break;
323  }
324 }
325 
326 void RamMethods::LocationRolesCheck(Client*const pClient, const CorpPathElement &data)
327 {
328  int64 roles(0);
329  // this will verify corp roles at location
330  uint32 stationID(data.officeFolderID - STATION_OFFICE_OFFSET);
331  if (stationID == pClient->GetCorpHQ()) {
332  roles = pClient->GetRolesAtHQ();
334  } else {
335  // not hq is this a base?
337  }
338 
339 }
340 
341 void RamMethods::MaterialSkillsCheck(Client* const pClient, uint32 runs, const PathElement& bomLocation, const Rsp_InstallJob& rsp, const std::vector< EvERam::RequiredItem >& reqItems)
342 {
343  std::map<uint16, InventoryItemRef> items; // typeID, itemRef
344  GetBOMItemsMap( bomLocation, items );
345 
346  for (auto cur : reqItems) {
347  if (cur.isSkill) { // check skill (quantity is required level)
348  if (pClient->GetChar()->GetSkillLevel(cur.typeID) < cur.quantity) {
349  throw UserError ("RamNeedSkillForJob")
350  .AddFormatValue ("skillID", new PyInt (cur.typeID))
351  .AddFormatValue ("skillLevel", new PyInt (cur.quantity));
352  }
353  } else {
354  uint32 qtyNeeded = round(cur.quantity * rsp.materialMultiplier) * runs;
355  if (cur.damagePerJob == 1)
356  qtyNeeded += round(cur.quantity * rsp.charMaterialMultiplier - cur.quantity) * runs;
357  std::map<uint16, InventoryItemRef>::iterator itr = items.find(cur.typeID);
358  if (itr != items.end())
359  if (itr->second->typeID() == cur.typeID) {
360  if (itr->second->quantity() < qtyNeeded)
361  qtyNeeded -= itr->second->quantity();
362  else
363  qtyNeeded = 0;
364  }
365 
366  if (qtyNeeded)
367  throw UserError ("RamNeedMoreForJob")
368  .AddFormatValue ("item", new PyInt (cur.typeID));
369  }
370  }
371 }
372 
374 {
375  if (productionTime > RAM_PRODUCTION_TIME_LIMIT)
376  throw UserError ("RamProductionTimeExceedsLimits")
377  .AddFormatValue ("productionTime", new PyInt (productionTime))
379 }
380 
381 void RamMethods::VerifyCompleteJob(const Call_CompleteJob &args, EvERam::JobProperties &data, Client* const pClient)
382 {
383  // this isnt entirely right....if job is installed in ship, receiver must be pilot in active ship to complete job.
384  if (args.containerID == pClient->GetShipID())
385  if (pClient->GetChar()->flag() != flagPilot)
386  throw UserError ("RamCompletionMustBeInShip");
387 
388  if (IsCorp(data.ownerID)) {
389  if (data.ownerID == pClient->GetCorporationID()) {
391  throw UserError ("RamCompletionAccessDeniedByCorpRole");
392  } else // alliances not implemented
393  throw UserError ("RamCompletionAccessDenied");
394  }
395 
397  throw UserError ("RamCompletionJobCompleted");
398 
399  if (!args.cancel and (data.endTime > GetFileTimeNow()))
400  throw UserError ("RamCompletionJobCompleted");
401 }
402 
403 bool RamMethods::Calculate(const Call_InstallJob &args, BlueprintRef bpRef, Character* pChar, Rsp_InstallJob &into)
404 {
405  // get line data
406  if (!FactoryDB::GetAssemblyLineProperties(args.AssemblyLineID, pChar, into, args.isCorpJob))
407  return false;
408 
409  // set char defaults
410  into.charTimeMultiplier = 1.0;
411  into.charMaterialMultiplier = EvE::max(1.0f, pChar->GetAttribute (AttrManufactureCostMultiplier).get_float ());
412 
413  const ItemType* pType(nullptr);
414  switch(args.activityID) {
416  pType = &bpRef->productType();
417  FactoryDB::GetMultipliers(args.AssemblyLineID, pType, into);
418  into.materialMultiplier += bpRef->GetME();
419  into.materialMultiplier *= sConfig.ram.MatMod;
420  into.charTimeMultiplier *= (1.0f - (0.04f * pChar->GetSkillLevel(EvESkill::Industry)));
421  into.productionTime = EvEMath::RAM::ProductionTime(bpRef->type().productionTime(), bpRef->type().productivityModifier(),
422  bpRef->pLevel(), into.timeMultiplier);
423  // modify base time by char multiplier
424  into.productionTime *= into.charTimeMultiplier;
425  // if time modifier is set in config, apply that now
426  into.productionTime *= sConfig.ram.ProdTime;
427  } break;
429  pType = &bpRef->type();
430  FactoryDB::GetMultipliers(args.AssemblyLineID, pType, into);
431  into.productionTime = EvEMath::RAM::ME_ResearchTime(bpRef->type().researchMaterialTime(),
432  pChar->GetSkillLevel(EvESkill::Metallurgy), into.timeMultiplier
433  /*implant modifier here*/);
434  into.productionTime *= sConfig.ram.ResME;
435  into.charTimeMultiplier *= pChar->GetAttribute(AttrMineralNeedResearchSpeed).get_float();
436  } break;
438  pType = &bpRef->type();
439  FactoryDB::GetMultipliers(args.AssemblyLineID, pType, into);
440  //ch->GetAttribute(AttrResearchCostPercent).get_int(); << this is not used
441 
442  into.productionTime = EvEMath::RAM::PE_ResearchTime(bpRef->type().researchProductivityTime(),
443  pChar->GetSkillLevel(EvESkill::Research), into.timeMultiplier
444  /*implant modifier here*/);
445  into.productionTime *= sConfig.ram.ResPE;
446  into.charTimeMultiplier *= pChar->GetAttribute(AttrManufacturingTimeResearchSpeed).get_float();
447  } break;
449  pType = &bpRef->type();
450  FactoryDB::GetMultipliers(args.AssemblyLineID, pType, into);
451  into.productionTime = EvEMath::RAM::CopyTime(bpRef->type().researchCopyTime(),
452  pChar->GetSkillLevel(EvESkill::Science), into.timeMultiplier
453  /*implant modifier here*/);
454  into.productionTime *= sConfig.ram.CopyTime;
455  into.charTimeMultiplier *= pChar->GetAttribute(AttrCopySpeedPercent).get_float();
456  //bpRef->type().chanceOfDuplicating();
457  } break;
459  pType = &bpRef->type();
460  FactoryDB::GetMultipliers(args.AssemblyLineID, pType, into);
461  into.productionTime = EvEMath::RAM::InventionTime(bpRef->type().researchTechTime(),
463  into.timeMultiplier
464  /*implant modifier here*/);
465  into.productionTime *= sConfig.ram.InventTime;
466  } break;
468  pType = &bpRef->type();
469  FactoryDB::GetMultipliers(args.AssemblyLineID, pType, into);
470  // base research time for RE is one hour
471  into.productionTime = 3600; // in seconds
472  into.productionTime *= sConfig.ram.ReTime;
473  //bpRef->type().chanceOfRE();
474  } break;
475  }
476 
477  // calculate cost
478  into.usageCost *= ceil(into.productionTime / 3600.0f);
479  into.cost = into.installCost + into.usageCost;
480  // multiply single run time by run count for total time
481  into.productionTime *= args.runs;
482 
483  into.maxJobStartTime = FactoryDB::GetNextFreeTime(args.AssemblyLineID);
484 
485  return true;
486 }
487 
488 void RamMethods::EncodeBillOfMaterials(const std::vector<EvERam::RequiredItem> &reqItems, float materialMultiplier, float charMaterialMultiplier, uint32 runs, BillOfMaterials &into)
489 {
490  PySafeDecRef( into.extras.lines );
491  into.extras.lines = new PyList();
492  PySafeDecRef( into.wasteMaterials.lines );
493  into.wasteMaterials.lines = new PyList();
494  PySafeDecRef( into.rawMaterials.lines );
495  into.rawMaterials.lines = new PyList();
496 
497  for (auto cur : reqItems) {
498  if (cur.isSkill) {
499  into.skills[cur.typeID] = new PyInt(cur.quantity);
500  continue;
501  }
502 
503  int qtyNeeded = (uint32)round(cur.quantity * materialMultiplier + (cur.quantity * charMaterialMultiplier - cur.quantity)) * runs;
504 
505  // otherwise, make line for material list
506  MaterialList_Line line;
507  line.requiredTypeID = cur.typeID;
508  line.quantity = (int32) round (cur.quantity * materialMultiplier) * runs;
509  line.damagePerJob = cur.damagePerJob;
510  line.isSkillCheck = false; // no idea what is this for
511  line.requiresHP = false; // no idea what is this for
512 
514  // "Extra material" is not affected by skills, and return upon completion
515  // "Raw material" is fully consumed and affected by skills/efficiency
516  // "Waste Material" is amount of material wasted ...
517  if (cur.extra) {
518  into.extras.lines->AddItem( line.Encode() );
519  } else {
520  // if there are losses, make line for waste material list
521  if (charMaterialMultiplier > 1.0) {
522  MaterialList_Line wastage( line ); // simply copy original line ...
523  wastage.quantity = qtyNeeded - line.quantity;
524  into.wasteMaterials.lines->AddItem( wastage.Encode() );
525  }
526  into.rawMaterials.lines->AddItem( line.Encode() );
527  }
528  }
529 }
530 
531 void RamMethods::EncodeMissingMaterials(const std::vector<EvERam::RequiredItem> &reqItems, const PathElement &bomLocation, Client *const pClient, float materialMultiplier, float charMaterialMultiplier, int32 runs, std::map<int32, PyRep *> &into) {
532  //
533  std::vector<InventoryItemRef> skills, items;
534 
535  //get the skills
536  pClient->GetChar()->GetMyInventory()->GetItemsByFlag(flagSkill, skills);
537 
538  //get the items
539  GetBOMItems( bomLocation, items );
540 
541  //now do the check
542  uint32 qtyReq(0);
543  for (auto cur : reqItems) {
544  qtyReq = cur.quantity;
545  if (!cur.isSkill) {
546  qtyReq = (uint32)round(qtyReq * materialMultiplier + (cur.quantity * charMaterialMultiplier - cur.quantity)) * runs;
547  }
548 
549  std::vector<InventoryItemRef>::iterator curi, endi;
550  if (cur.isSkill) {
551  curi = skills.begin();
552  endi = skills.end();
553  } else {
554  curi = items.begin();
555  endi = items.end();
556  }
557 
558  for (; curi != endi and qtyReq > 0; ++curi) {
559  if (((*curi)->typeID() == cur.typeID)
560  and (((*curi)->ownerID() == pClient->GetCharacterID())
561  or ((*curi)->ownerID() == pClient->GetCorporationID()))) {
562  if (cur.isSkill) {
563  qtyReq -= std::min(qtyReq, (*curi)->GetAttribute(AttrSkillLevel).get_uint32() );
564  } else {
565  qtyReq -= std::min(qtyReq, (uint32)(*curi)->quantity() );
566  }
567  }
568  }
569 
570  if (qtyReq > 0)
571  into[cur.typeID] = new PyInt(qtyReq);
572  }
573 }
574 void RamMethods::GetBOMItems(const PathElement& bomLocation, std::vector< InventoryItemRef >& into)
575 {
576  Inventory *inventory = sItemFactory.GetInventoryFromId( bomLocation.locationID );
577  if (inventory != nullptr )
578  inventory->GetItemsByFlag((EVEItemFlags)bomLocation.flagID, into );
579 }
580 
581 void RamMethods::GetBOMItemsMap(const PathElement& bomLocation, std::map< uint16, InventoryItemRef >& into)
582 {
583  Inventory *inventory = sItemFactory.GetInventoryFromId( bomLocation.locationID );
584  if (inventory != nullptr )
585  inventory->GetTypesByFlag( (EVEItemFlags)bomLocation.flagID, into );
586 }
587 
588 /* For each material required for a blueprint (from invTypeMaterials), the quantity is affected by ME research and skills.
589  * Then there’s the extra materials, which come from the ramTypeRequirements table for that BP.
590  * Next, any materials in ramTypeRequirements which are marked as recyclable, have their recycled materials (from invTypeMaterials) subtracted from the list of materials required for the produced item.
591  * The remaining materials from invTypeMaterials are then modified by skills and ME research as follows:
592  * xmatls = ramTypeRequirements.extra
593  * reqMatls = (invTypeMaterials.reqMatls - xmatls)
594  * waste = reqMatls * charSkills (which is wastage multiplier based on skills)
595  * totalReqMatls = (reqMatls * skill mods) + xmatls + waste
596  */
598 {
599  // will need to update this using above formula for correct material list
600 
601 }
602 
603 const char* RamMethods::GetActivityName(int8 activityID)
604 {
605  switch (activityID) {
606  case EvERam::Activity::Copying: return "Copying";
607  case EvERam::Activity::Manufacturing: return "Manufacturing";
608  case EvERam::Activity::Invention: return "Invention";
609  case EvERam::Activity::ResearchMaterial: return "Research ME";
610  case EvERam::Activity::ResearchTime: return "Research PE";
611  case EvERam::Activity::ReverseEngineering: return "Reverse Engineering";
612  // these last 2 should never hit
615  codelog(MANUF__ERROR, "RamMethods::GetActivityName - invalid activity sent: %u", activityID);
616  } break;
617  }
618  return "Undefined";
619 }
620 
static float GetStanding(uint32 fromID, uint32 toID)
Definition: StandingDB.cpp:142
uint32 GetShipID() const
Definition: Client.h:150
#define sConfig
A macro for easier access to the singleton.
uint32 GetLocationID() const
Definition: Client.h:151
void InstallationCheck(Client *const pClient, int32 lineLocationID)
Definition: RamMethods.cpp:123
bool GetTypesByFlag(EVEItemFlags flag, std::map< uint16, InventoryItemRef > &items)
Definition: Inventory.cpp:465
static bool GetMultipliers(const uint32 assemblyLineID, const ItemType *pType, Rsp_InstallJob &into)
Definition: FactoryDB.cpp:678
float GetSecurityRating() const
Definition: Client.h:172
int64 GetCorpRole() const
Definition: Client.h:129
int32 GetCorpHQ() const
Definition: Client.h:124
static uint32 CountManufacturingJobs(const uint32 installerID)
Definition: FactoryDB.cpp:554
void VerifyCompleteJob(const Call_CompleteJob &args, EvERam::JobProperties &data, Client *const pClient)
Definition: RamMethods.cpp:381
static bool IsProducableBy(const uint32 assemblyLineID, const ItemType *pType)
Definition: FactoryDB.cpp:29
double min(double x, double y)
Definition: misc.h:95
bool Calculate(const Call_InstallJob &args, BlueprintRef bpRef, Character *pChar, Rsp_InstallJob &into)
Definition: RamMethods.cpp:403
void LocationRolesCheck(Client *const pClient, const CorpPathElement &data)
Definition: RamMethods.cpp:326
uint32 GetRegionID() const
Definition: Client.h:154
EVEItemFlags
Definition: EVE_Flags.h:13
static uint32 GetTech2Blueprint(const uint32 blueprintTypeID)
Definition: FactoryDB.cpp:647
int32 GetCharacterID() const
Definition: Client.h:113
int32 GetCorporationID() const
Definition: Client.h:123
float corpSecRating() const
Definition: Character.h:306
UserError & AddFormatValue(const char *name, PyRep *value)
Fluent version of the protected AddKeyword, allows for adding a keyword to the exception.
CharacterRef GetChar() const
Definition: Client.h:164
Advanced version of UserError that allows to send a full custom message.
Definition: PyExceptions.h:453
int64 GetRolesAtHQ() const
Definition: Client.h:135
signed __int8 int8
Definition: eve-compat.h:45
int32 GetAllianceID() const
Definition: Client.h:125
int32 InventionTime(uint32 BaseTime, uint8 AdvLabLevel, float SlotModifier=1, float ImplantModifier=1)
Definition: EvEMath.cpp:89
void JobsCheck(Character *pChar, const Call_InstallJob &args)
Definition: RamMethods.cpp:98
signed __int32 int32
Definition: eve-compat.h:49
void EncodeMissingMaterials(const std::vector< EvERam::RequiredItem > &reqItems, const PathElement &bomLocation, Client *const pClient, float materialMultiplier, float charMaterialMultiplier, int32 runs, std::map< int32, PyRep * > &into)
Definition: RamMethods.cpp:531
* args
uint32 GetItemsByFlag(EVEItemFlags flag, std::vector< InventoryItemRef > &items) const
Definition: Inventory.cpp:458
#define sLog
Evaluates to a NewLog instance.
Definition: LogNew.h:250
void MaterialSkillsCheck(Client *const pClient, uint32 runs, const PathElement &bomLocation, const Rsp_InstallJob &rsp, const std::vector< EvERam::RequiredItem > &reqItems)
Definition: RamMethods.cpp:341
int32 ME_ResearchTime(uint32 BaseTime, uint8 MetallurgyLevel, float SlotModifier=1, float ImplantModifier=1)
Definition: EvEMath.cpp:68
UserError & AddAmount(const char *name, int quantity)
Shorthand method for adding a quantity value.
void EncodeBillOfMaterials(const std::vector< EvERam::RequiredItem > &reqItems, float materialMultiplier, float charMaterialMultiplier, uint32 runs, BillOfMaterials &into)
Definition: RamMethods.cpp:488
static uint32 CountResearchJobs(const uint32 installerID)
Definition: FactoryDB.cpp:579
int32 PE_ResearchTime(uint32 BaseTime, uint8 ResearchLevel, float SlotModifier=1, float ImplantModifier=1)
Definition: EvEMath.cpp:73
static int64 GetNextFreeTime(const uint32 assemblyLineID)
Definition: FactoryDB.cpp:662
int64 get_int()
Definition: EvilNumber.cpp:166
#define codelog(type, fmt,...)
Definition: logsys.h:128
float GetStandingModified(uint32 fromID, uint32 toID=0)
Definition: Character.cpp:1363
uint32 locationID() const
Python integer.
Definition: PyRep.h:231
void ItemOwnerCheck(Client *const pClient, const Call_InstallJob &args, BlueprintRef bpRef)
Definition: RamMethods.cpp:221
X * get() const
Definition: RefPtr.h:213
const char * GetName() const
Definition: Client.h:94
int32 ProductionTime(uint32 BaseTime, float bpProductivityModifier, float ProductionLevel, float TimeModifier=1)
Definition: EvEMath.cpp:55
Python object "ccp_exceptions.UserError".
Definition: PyExceptions.h:121
Definition: Client.h:66
unsigned __int32 uint32
Definition: eve-compat.h:50
EVEItemFlags flag() const
static const uint32 RAM_PRODUCTION_TIME_LIMIT
Definition: RamMethods.cpp:18
#define IsCorp(itemID)
Definition: EVE_Defines.h:234
int32 CopyTime(uint16 BaseTime, uint8 ScienceLevel, float SlotModifier=1, float ImplantModifier=1)
Definition: EvEMath.cpp:84
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 kick all and halt server immediate command list all items in current location s inventory(either station or solsystem)." ) COMMAND( cargo
double GetFileTimeNow()
Definition: utils_time.cpp:84
signed __int64 int64
Definition: eve-compat.h:51
int64 max(int64 x, int64 y=0)
Definition: misc.h:103
void LinePermissionCheck(Client *const pClient, const Call_InstallJob &args)
Definition: RamMethods.cpp:153
#define STATION_OFFICE_OFFSET
Definition: EVE_Defines.h:177
void ActivityCheck(Client *const pClient, const Call_InstallJob &args, BlueprintRef bpRef)
Definition: RamMethods.cpp:39
EvilNumber GetAttribute(const uint16 attrID) const
static bool GetAssemblyLineProperties(const uint32 assemblyLineID, Character *pChar, Rsp_InstallJob &into, bool isCorpJob=false)
Definition: FactoryDB.cpp:400
static bool GetAssemblyLineRestrictions(const int32 assemblyLineID, EvERam::LineRestrictions &data)
Definition: FactoryDB.cpp:481
signed __int16 int16
Definition: eve-compat.h:47
void GetAdjustedRamRequiredMaterials()
Definition: RamMethods.cpp:597
void ItemLocationCheck(Client *const pClient, const Call_InstallJob &args, InventoryItemRef installedItem)
Definition: RamMethods.cpp:234
int8 GetSkillLevel(uint16 skillTypeID, bool zeroForNotInjected=true) const
Definition: Character.cpp:575
#define IsHangarFlag(flag)
Definition: EVE_Defines.h:344
const char * GetActivityName(int8 activityID)
Definition: RamMethods.cpp:603
#define PySafeDecRef(op)
Definition: PyRep.h:61
#define sItemFactory
Definition: ItemFactory.h:165
float get_float()
Definition: EvilNumber.cpp:184
void GetBOMItemsMap(const PathElement &bomLocation, std::map< uint16, InventoryItemRef > &into)
Definition: RamMethods.cpp:581
#define IsRegionID(itemID)
Definition: EVE_Defines.h:273
void HangarRolesCheck(Client *const pClient, int16 flagID)
Definition: RamMethods.cpp:291
Inventory * GetMyInventory()
Definition: InventoryItem.h:91
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
Python list.
Definition: PyRep.h:639
void ProductionTimeCheck(uint32 productionTime)
Definition: RamMethods.cpp:373
uint32 itemID() const
Definition: InventoryItem.h:98
UserError & AddLocationName(const char *name, uint32 locationID)
Shorthand method for adding a location's name.
Reference-counting-based smart pointer.
Definition: RefPtr.h:133
#define sDataMgr
void GetBOMItems(const PathElement &bomLocation, std::vector< InventoryItemRef > &into)
Definition: RamMethods.cpp:574