56 m_strBoundObjectName =
"InventoryBound";
75 _log(INV__BIND,
"Created InventoryBound object %p for %s(%u) and ownerID %u with flag %s (passive: %s)", \
97 Call_SingleIntegerArg
args;
98 if (!args.Decode(&call.
tuple)){
99 codelog(SERVICE__ERROR,
"%s: Failed to decode arguments.",
GetName());
108 call.
Dump(INV__DUMP);
113 Call_SingleIntegerArg arg;
114 if (!arg.Decode(&call.
tuple)) {
115 codelog(SERVICE__ERROR,
"%s: Failed to decode arguments.",
GetName());
122 _log(INV__MESSAGE,
"Calling InventoryBound::StackAll() for %s(%u) in %s. Bound flag is %s", \
161 Call_PlanetCustomsXfer
args;
162 if (!args.Decode(&call.
tuple)) {
163 codelog(SERVICE__ERROR,
"%s: Failed to decode arguments.",
GetName());
166 args.Dump(COLONY__PKT_TRACE);
169 std::map<uint32, uint16> importItems, exportItems;
178 Colony* pColony = sRef->GetMySE()->GetCOSE()->GetPlanetSE()->GetColony(call.
client);
179 pColony->
PlanetXfer(args.spaceportPinID, importItems, exportItems, args.taxRate);
185 Call_RemoveCharge
args;
187 codelog(SERVICE__ERROR,
"%s: Failed to decode arguments.",
GetName());
203 Call_RemoveCharge
args;
205 codelog(SERVICE__ERROR,
"%s: Failed to decode arguments.",
GetName());
222 call.
Dump(INV__DUMP);
224 Call_MultiMerge
args;
225 if (!args.Decode(&call.
tuple)) {
226 codelog(SERVICE__ERROR,
"%s: Failed to decode arguments.",
GetName());
239 std::vector<PyRep *>::const_iterator itr = args.mergeData->begin(), end = args.mergeData->end();
240 for (; itr != end; ++itr) {
243 if (!data.Decode( *itr )) {
244 codelog(SERVICE__ERROR,
"%s: Failed to decode arguments.",
GetName());
249 if (srcItem.
get() ==
nullptr) {
250 _log(INV__WARNING,
"Failed to load source item %u. Skipping.", data.sourceID);
255 if (destItem.
get() ==
nullptr) {
256 _log(INV__WARNING,
"Failed to load destination item %u. Skipping.", data.destID);
262 if (pInv ==
nullptr) {
263 _log(INV__WARNING,
"Failed to get inventory for locationID %u.", destItem->
locationID());
267 if (pInv->ValidateAddItem(destItem->
flag(), srcItem))
268 destItem->
Merge( srcItem, data.qty,
true );
283 _log(INV__DUMP,
"IB::Handle_Add() size= %u", call.
tuple->
size());
284 call.
Dump(INV__DUMP);
288 _log(INV__ERROR,
"IB::Handle_Add() Unexpected number of elements in tuple: %u (should be 2).", call.
tuple->
items.size() );
293 if (!args.Decode(&call.
tuple)) {
294 codelog(SERVICE__ERROR,
"%s: Failed to decode arguments.",
GetName());
303 _log(INV__ERROR,
"IB::Handle_Add() - item %u from %u sent flagLocked. continuing but this needs to be fixed.", \
304 args.itemID, args.containerID);
310 bool moveStack =
false;
315 if (call.
byname.find(
"dividing") != call.
byname.end()) {
318 if (newItem.
get() ==
nullptr) {
319 _log(INV__ERROR,
"IB::Handle_Add() - Error splitting item %u. Skipping.", iRef->
itemID());
323 args.itemID = iRef->
itemID();
333 float capacity = 0.0f;
340 _log(INV__MESSAGE,
"IB::Handle_Add() - moving %u %s(%u) from (%u:%s) to me(%s:%u:%s).", \
341 quantity, iRef->
name(), args.itemID, args.containerID,
sDataMgr.GetFlagName(iRef->
flag()),\
344 std::vector<int32>
items;
345 items.push_back(args.itemID);
353 _log(INV__DUMP,
"IB::Handle_MultiAdd() size= %u", call.
tuple->
size());
354 call.
Dump(INV__DUMP);
358 _log(INV__ERROR,
"IB::Handle_MultiAdd() Unexpected number of elements in tuple: %u (should be 2).", call.
tuple->
items.size() );
362 Call_MultiAdd_2
args;
363 if (!args.Decode(&call.
tuple)) {
365 codelog(SERVICE__ERROR,
"%s: Failed to decode arguments.",
GetName());
378 bool moveStack =
false;
379 if (call.
byname.find(
"fromManyFlags") != call.
byname.end())
380 if (!call.
byname.find(
"fromManyFlags")->second->IsNone())
383 float capacity = 0.0f;
389 }
else if (quantity < 1) {
398 std::vector<InventoryItemRef> itemVec;
399 for (
auto cur : args.itemIDs)
404 _log(INV__MESSAGE,
"IB::Handle_MultiAdd() - moving %u items from (%u:%s) to me(%s:%u:%s).", \
413 bool donating =
false,
ship =
false, customs =
false;
421 codelog(INV__ERROR,
"IB::MoveItems() - Trading Category called.");
511 std::vector<int32>::const_iterator itr = items.begin();
512 for (; itr != items.end(); ++itr) {
518 if (iRef.
get() ==
nullptr) {
519 _log(INV__ERROR,
"IB::MoveItems() - item %i not found. continuing.", (*itr));
529 fromFlag = iRef->
flag();
538 }
else if (quantity < 1) {
539 _log(INV__ERROR,
"IB::MoveItems() - Quantity < 1. Setting quantity = 1.");
545 throw UserError (
"CannotRemoveUpgradeManually");
548 if (pShip ==
nullptr)
549 throw CustomError (
"Ship not found. The %s wasnt moved. Ref: ServerError 63290", iRef->
name());
557 throw CustomError (
"That module was not found. Chances are this is a server error, and either docking or reloging will correct it.");
558 if (pMod->IsActive())
559 throw CustomError (
"Your %s is currently active. You must wait for the cycle to complete before it can be removed.", pMod->GetSelf()->name());
563 throw CustomError (
"You cannot exchange module slots in space.");
568 Call_SingleIntegerArg result;
569 result.arg = iRef->
itemID();
570 return result.Encode();
581 if (!moveStack and (quantity < iRef->
quantity())) {
583 if (newItem.
get() ==
nullptr) {
584 _log(INV__ERROR,
"IB::MoveItems() - Error splitting item %u. Skipping.", iRef->
itemID());
588 if (iRef.
get() ==
nullptr) {
589 _log(INV__ERROR,
"IB::MoveItems() - Error getting split item. Skipping.");
593 _log(INV__ERROR,
"IB::MoveItems() - Split item %u qty(%u) > requested qty of %u. Continuing.", \
611 pClient->
SendNotifyMsg(
"Your ship has no available slots to fit this module. Putting the %s in your CargoHold.", iRef->
name());
634 if (contRef.
get() !=
nullptr) {
637 _log(INV__ERROR,
"IB::MoveItems() - previous container for item %i not found. continuing.", (*itr));
641 }
else if (customs) {
653 if (iRef.
get() ==
nullptr)
656 if (items.size() == 1) {
658 Call_SingleIntegerArg result;
659 result.arg = iRef->
itemID();
660 return result.Encode();
673 std::vector<int32>
items;
674 if (itemVec.size() < 2) {
675 items.push_back(itemVec.at(0)->itemID());
690 for (
int i = 0, i2 = 1; (i < itemVec.size()) and (i2 < itemVec.size()); ++i, ++i2) {
692 if (itemVec[i]->
categoryID() < itemVec[i2]->categoryID()) {
695 itemVec[i] = itemVec[i2];
703 for (
auto cur : itemVec)
704 items.push_back(cur->itemID());
707 sLog.Warning(
"IB::CatSortItems",
"%u items sorted in %.3fus with %u loops.", items.size(), (
GetTimeUSeconds() - start), count);
720 _log(INV__DUMP,
"IB::List() dump.");
721 call.
Dump(INV__DUMP);
736 if (!arg.Decode(&call.
tuple))
738 if (flag != arg.flag)
742 _log(INV__MESSAGE,
"IB::List() called by %s with ownerID %u for %s(%u:%s%s) - origFlag: %s", \
801 call.
Dump(BOOKMARK__CALL_DUMP);
804 throw UserError (
"CanOnlyCreateVoucherInPersonalHangar");
806 Call_CreateVouchers
args;
807 if (!args.Decode(&call.
tuple)) {
808 codelog(SERVICE__ERROR,
"%s: Failed to decode arguments.",
GetName());
820 if (
sDataMgr.IsSolarSystem(locationID)) {
825 if ( args.bmIDs->size() < 1 ) {
826 sLog.Error(
"IB::Handle_CreateBookmarkVouchers()",
"%s: args.bmIDs->size() == 0. Expected size > 0.", call.
client->
GetName() );
830 for (; itr != args.bmIDs->end(); ++itr) {
834 if (iRef.get() ==
nullptr) {
871 tuple->
Dump(BOOKMARK__RSP_DUMP,
" ");
883 call.
Dump(INV__DUMP);
889 call.
Dump(INV__DUMP);
897 call.
Dump(INV__DUMP);
903 call.
Dump(POS__DUMP);
#define sConfig
A macro for easier access to the singleton.
Dispatcher *const m_dispatch
virtual InventoryItemRef Split(int32 qty=0, bool notify=true, bool silent=false)
void Donate(uint32 new_owner=ownerSystem, uint32 new_location=locTemp, EVEItemFlags new_flag=flagNone, bool notify=true)
uint32 GetLocationID() const
void UnloadModule(uint32 itemID)
void PlanetXfer(uint32 spaceportID, std::map< uint32, uint16 > importItems, std::map< uint32, uint16 > exportItems, double taxRate)
#define _log(type, fmt,...)
PyRep * GetItem(size_t index) const
Returns Python object.
void StackAll(EVEItemFlags flag, uint32 ownerID=0)
virtual bool Merge(InventoryItemRef to_merge, int32 qty=0, bool notify=true)
std::map< std::string, PyRep * > byname
virtual void AddItem(InventoryItemRef iRef)
void VerifyHoldType(EVEItemFlags flag, InventoryItemRef iRef, Client *pClient=nullptr)
PyCallable_Make_InnerDispatcher(InventoryBound) InventoryBound
int32 GetCharacterID() const
int32 GetCorporationID() const
storage_type::const_iterator const_iterator
static uint32 IntegerValueU32(PyRep *pRep)
void SendNotifyMsg(const char *fmt,...)
Advanced version of UserError that allows to send a full custom message.
void Dump(FILE *into, const char *pfx) const
Dumps object to file.
itemID[count] Create count or of the specified item(from Insider)" ) COMMAND( goto
#define is_log_enabled(type)
#define sLog
Evaluates to a NewLog instance.
void ChangeOwner(uint32 bookmarkID, uint32 ownerID=1)
#define IsPlayerItem(itemID)
#define codelog(type, fmt,...)
void SetItem(size_t index, PyRep *object)
Stores Python object.
uint32 locationID() const
ShipItemRef GetShip() const
virtual ShipItem * GetShipItem()
const char * GetName() const
#define IsPlayerCorp(itemID)
PyRep * MoveItems(Client *pClient, std::vector< int32 > &items, EVEItemFlags toFlag, int32 quantity, bool manyFlags, float capacity)
Python object "ccp_exceptions.UserError".
#define PyCallable_REG_CALL(c, m)
itemID[count] Create count or of the specified() x() entityID Translocate to the specified entity Immediately stops ship
static RefPtr StaticCast(const RefPtr< Y > &oth)
Acts as static_cast from one RefPtr to another.
std::vector< int32 > CatSortItems(std::vector< InventoryItemRef > &itemVec)
EVEItemFlags flag() const
void TryModuleLimitChecks(EVEItemFlags flag, InventoryItemRef iRef)
const_iterator begin() const
#define IsOfficeID(itemID)
#define IsModuleSlot(flag)
GenericModule * GetModule(EVEItemFlags flag)
#define IsCargoHoldFlag(flag)
storage_type::const_iterator const_iterator
typeID Spawn an NPC with the specified type text Search for items matching the specified query() type()() itemID() copy() materialLevel()() itemID(attributeID)-Retrieves attribute value." ) COMMAND( setattr
virtual void RemoveItem(InventoryItemRef iRef)
void Dump(LogType type) const
#define IsHangarFlag(flag)
void RemoveCharge(EVEItemFlags fromFlag)
const_iterator end() const
uint32 AddItemByFlag(EVEItemFlags flag, InventoryItemRef iRef, Client *pClient=nullptr)
EVEItemFlags FindAvailableModuleSlot(InventoryItemRef iRef)
static int64 IntegerValue(PyRep *pRep)
#define IsControlBunker(itemID)
Inventory * GetMyInventory()
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
CRowSet * List(EVEItemFlags flag, uint32 ownerID=0) const
bool ValidateAddItem(EVEItemFlags flag, InventoryItemRef iRef) const
virtual bool IsShipItem()
virtual ~InventoryBound()
const char * itoa(int64 num)
Convers num to string.
void MoveModuleSlot(EVEItemFlags slot1, EVEItemFlags slot2)
void SetItemString(const char *key, PyRep *value)
SetItemString adds or sets a database entry.
const char * GetName() const
Dispatcher *const m_dispatch
void RemoveRig(InventoryItemRef iRef)