EvEmu
0.8.4
11 September 2021
|
#include "MarketMgr.h"
Public Member Functions | |
bool | NeedsUpdate () |
PyRep * | GetMarketGroups () |
![]() | |
Singleton () | |
Primary constructor. More... | |
Private Attributes | |
MarketDB | m_db |
PyServiceMgr * | m_manager |
PyRep * | m_marketGroups |
int64 | m_timeStamp |
MarketMgr.cpp | |
singleton object for storing, manipulating and managing in-game market data this mgr keeps track of market data without abusing the db on every call. (vs old system) this mgr will also track mineral pricing, taking monthly averages, then updating base prices accordingly : Allan
| |
MarketMgr () | |
~MarketMgr () | |
int | Initialize (PyServiceMgr *pManager) |
void | Close () |
void | GetInfo () |
void | Process () |
void | SystemStartup (SystemData &data) |
void | SystemShutdown (SystemData &data) |
void | UpdatePriceHistory () |
bool | ExecuteBuyOrder (Client *seller, uint32 orderID, InventoryItemRef iRef, Call_PlaceCharOrder &args, uint16 accountKey=Account::KeyType::Cash) |
void | ExecuteSellOrder (Client *buyer, uint32 orderID, Call_PlaceCharOrder &args) |
void | SendOnOwnOrderChanged (Client *pClient, uint32 orderID, uint8 action, bool isCorp=false, PyRep *order=nullptr) |
void | InvalidateOrdersCache (uint32 regionID, uint32 typeID) |
PyRep * | GetNewPriceHistory (uint32 regionID, uint32 typeID) |
PyRep * | GetOldPriceHistory (uint32 regionID, uint32 typeID) |
void | SetBasePrice () |
void | UpdateMineralPrice () |
void | GetCruPrices () |
void | Populate () |
Additional Inherited Members | |
![]() | |
static MarketMgr & | get () |
![]() | |
static std::shared_ptr< MarketMgr > | mInstance |
Definition at line 23 of file MarketMgr.h.
MarketMgr::MarketMgr | ( | ) |
MarketMgr::~MarketMgr | ( | ) |
Definition at line 41 of file MarketMgr.cpp.
void MarketMgr::Close | ( | ) |
Definition at line 46 of file MarketMgr.cpp.
References m_marketGroups, PyDecRef, and sLog.
bool MarketMgr::ExecuteBuyOrder | ( | Client * | seller, |
uint32 | orderID, | ||
InventoryItemRef | iRef, | ||
Call_PlaceCharOrder & | args, | ||
uint16 | accountKey = Account::KeyType::Cash |
||
) |
Definition at line 303 of file MarketMgr.cpp.
References _log, Corp::Role::AccountCanTake1, Corp::Role::AccountCanTake2, Corp::Role::AccountCanTake3, Corp::Role::AccountCanTake4, Corp::Role::AccountCanTake5, Corp::Role::AccountCanTake6, Corp::Role::AccountCanTake7, EvESkill::Accounting, Market::TxData::accountKey, UserError::AddFormatValue(), MarketDB::AlterOrderQuantity(), InventoryItem::AlterQuantity(), Market::Type::Buy, Account::KeyType::Cash, Market::TxData::clientID, Market::QtyStatus::Complete, corpSCC, InventoryItem::Delete(), MarketDB::DeleteOrder(), InventoryItem::Donate(), Account::KeyType::Escrow, Market::Action::Expiry, flagCorpMarket, flagHangar, RefPtr< X >::get(), Client::GetChar(), Client::GetCharacterID(), Client::GetCorporationID(), Client::GetCorpRole(), MarketDB::GetOrderInfo(), MarketDB::GetOrderRow(), Character::GetSkillLevel(), Market::QtyStatus::Invalid, InvalidateOrdersCache(), Market::TxData::isBuy, IsCharacterID, Market::TxData::isCorp, Stat::iskMarket, IsPlayerCorp, IsTraderJoe, InventoryItem::itemID(), m_db, Journal::EntryType::MarketTransaction, Market::TxData::memberID, Market::OrderInfo::memberID, Market::Action::Modify, InventoryItem::name(), Market::QtyStatus::Over, Market::OrderInfo::ownerID, Market::TxData::price, Market::TxData::quantity, InventoryItem::quantity(), Market::OrderInfo::quantity, MarketDB::RecordTransaction(), Market::TxData::regionID, Market::OrderInfo::regionID, EvEMath::Market::SalesTax(), sConfig, sDataMgr, Market::Type::Sell, Client::SendNotifyMsg(), SendOnOwnOrderChanged(), InventoryItem::Split(), sStatMgr, Market::TxData::stationID, stDataMgr, Journal::EntryType::TransactionTax, AccountService::TranserFunds(), Market::TxData::typeID, and Market::QtyStatus::Under.
Definition at line 497 of file MarketMgr.cpp.
References _log, EvESkill::Accounting, Market::TxData::accountKey, Market::OrderInfo::accountKey, MarketDB::AlterOrderQuantity(), Market::Type::Buy, Account::KeyType::Cash, Market::TxData::clientID, corpSCC, MarketDB::DeleteOrder(), InventoryItem::Donate(), Market::Action::Expiry, flagHangar, flagNone, RefPtr< X >::get(), Client::GetChar(), Client::GetCharacterID(), Client::GetCorporationID(), MarketDB::GetOrderInfo(), MarketDB::GetOrderRow(), CharacterDB::GetSkillLevel(), Character::GetSkillLevel(), InvalidateOrdersCache(), Market::TxData::isBuy, IsCharacterID, Market::TxData::isCorp, Market::OrderInfo::isCorp, Stat::iskMarket, locTemp, m_db, Journal::EntryType::MarketTransaction, Market::TxData::memberID, Market::OrderInfo::memberID, Market::Action::Modify, Market::OrderInfo::ownerID, ownerStation, Market::TxData::price, Market::TxData::quantity, Market::OrderInfo::quantity, MarketDB::RecordTransaction(), Market::TxData::regionID, Market::OrderInfo::regionID, EvEMath::Market::SalesTax(), sConfig, sDataMgr, Market::Type::Sell, SendOnOwnOrderChanged(), sEntityList, sItemFactory, sStatMgr, Market::TxData::stationID, stDataMgr, EvESkill::TaxEvasion, Journal::EntryType::TransactionTax, AccountService::TranserFunds(), and Market::TxData::typeID.
void MarketMgr::GetCruPrices | ( | ) |
Definition at line 916 of file MarketMgr.cpp.
References MarketDB::GetCruPriceAvg(), sDataMgr, sLog, and MarketDB::UpdateInvPrice().
void MarketMgr::GetInfo | ( | ) |
Definition at line 78 of file MarketMgr.cpp.
|
inline |
Definition at line 148 of file MarketMgr.cpp.
References _log, DBerror::c_str(), PyServiceMgr::cache_service, EvE::Time::Day, DBResultToCRowset(), PyRep::Dump(), DBQueryResult::error, DBQueryResult::GetRowCount(), ObjCacheService::GiveCache(), is_log_enabled, ObjCacheService::IsCacheLoaded(), m_manager, m_timeStamp, ObjCacheService::MakeObjectCachedMethodCallResult(), PyStatic, sConfig, and sDatabase.
Definition at line 190 of file MarketMgr.cpp.
References _log, DBerror::c_str(), PyServiceMgr::cache_service, EvE::Time::Day, DBResultToCRowset(), PyRep::Dump(), DBQueryResult::error, DBQueryResult::GetRowCount(), ObjCacheService::GiveCache(), is_log_enabled, ObjCacheService::IsCacheLoaded(), m_manager, m_timeStamp, ObjCacheService::MakeObjectCachedMethodCallResult(), PyStatic, sConfig, and sDatabase.
int MarketMgr::Initialize | ( | PyServiceMgr * | pManager | ) |
Definition at line 53 of file MarketMgr.cpp.
References MarketDB::GetUpdateTime(), m_manager, m_timeStamp, Populate(), and sLog.
Definition at line 264 of file MarketMgr.cpp.
References PyServiceMgr::cache_service, ObjCacheService::InvalidateCache(), and m_manager.
Referenced by ExecuteBuyOrder(), and ExecuteSellOrder().
|
inline |
Definition at line 51 of file MarketMgr.h.
References GetFileTimeNow(), and m_timeStamp.
|
protected |
Definition at line 64 of file MarketMgr.cpp.
References MarketDB::GetMarketGroups(), GetTimeMSeconds(), m_db, m_marketGroups, Process(), sConfig, and sLog.
Referenced by Initialize().
void MarketMgr::Process | ( | ) |
Definition at line 83 of file MarketMgr.cpp.
Referenced by Populate().
void MarketMgr::SendOnOwnOrderChanged | ( | Client * | pClient, |
uint32 | orderID, | ||
uint8 | action, | ||
bool | isCorp = false , |
||
PyRep * | order = nullptr |
||
) |
Definition at line 231 of file MarketMgr.cpp.
References Market::Action::Add, Market::Action::Expiry, Client::GetCorporationID(), MarketDB::GetOrderRow(), m_db, Market::Action::Modify, Client::SendNotification(), and sEntityList.
Referenced by ExecuteBuyOrder(), and ExecuteSellOrder().
void MarketMgr::SetBasePrice | ( | ) |
Definition at line 610 of file MarketMgr.cpp.
References EVEDB::invGroups::AssaultShip, EVEDB::invCategories::Asteroid, EVEDB::invGroups::Battlecruiser, EVEDB::invGroups::Battleship, EVEDB::invGroups::BlackOps, EVEDB::invGroups::CapitalIndustrialShip, EVEDB::invGroups::Capsule, EVEDB::invGroups::Carrier, Inv::GrpData::catID, EVEDB::invCategories::Celestial, EVEDB::invCategories::Charge, EVEDB::invGroups::CombatRecon, EVEDB::invGroups::CommandShip, EVEDB::invCategories::Commodity, EVEDB::invGroups::CovertOps, EVEDB::invGroups::Cruiser, EVEDB::invGroups::Destroyer, EVEDB::invGroups::Dreadnought, EVEDB::invCategories::Drone, EVEDB::invGroups::ElecAttackShip, EVEDB::invGroups::EliteBattleship, EVEDB::invCategories::Entity, EVEDB::invGroups::Exhumer, EVEDB::invGroups::Freighter, EVEDB::invGroups::Frigate, MarketDB::GetCruPriceAvg(), MarketDB::GetManufacturedItems(), MarketDB::GetMaterialPrices(), MarketDB::GetMineralPrices(), EVEDB::invGroups::HeavyAssaultShip, EVEDB::invGroups::HeavyInterdictors, Inv::GrpData::id, EVEDB::invGroups::Industrial, EVEDB::invGroups::IndustrialCommandShip, EVEDB::invGroups::Interceptor, EVEDB::invGroups::Interdictor, EVEDB::invGroups::JumpFreighter, EVEDB::invGroups::Logistics, EVEDB::invGroups::Marauder, EVEDB::invCategories::Material, EVEDB::invGroups::MiningBarge, EVEDB::invCategories::Module, Market::matlData::name, EvERam::bpTypeData::productionTime, EVEDB::invGroups::Prototype_Exploration_Ship, EVEDB::invGroups::Rig_Armor, EVEDB::invGroups::Rig_Astronautic, EVEDB::invGroups::Rig_Drones, EVEDB::invGroups::Rig_Electronics, EVEDB::invGroups::Rig_Electronics_Superiority, EVEDB::invGroups::Rig_Energy_Grid, EVEDB::invGroups::Rig_Energy_Weapon, EVEDB::invGroups::Rig_Hybrid_Weapon, EVEDB::invGroups::Rig_Launcher, EVEDB::invGroups::Rig_Mining, EVEDB::invGroups::Rig_Projectile_Weapon, EVEDB::invGroups::Rig_Security_Transponder, EVEDB::invGroups::Rig_Shield, EVEDB::invGroups::Rookieship, sDataMgr, EVEDB::invCategories::Ship, EVEDB::invGroups::Shuttle, sLog, EVEDB::invCategories::Station, EVEDB::invGroups::StealthBomber, EVEDB::invGroups::StrategicCruiser, EVEDB::invGroups::Supercarrier, EVEDB::invGroups::Titan, EVEDB::invGroups::TransportShip, Market::matlData::typeID, and MarketDB::UpdateInvPrice().
void MarketMgr::SystemShutdown | ( | SystemData & | data | ) |
Definition at line 96 of file MarketMgr.cpp.
void MarketMgr::SystemStartup | ( | SystemData & | data | ) |
Definition at line 91 of file MarketMgr.cpp.
void MarketMgr::UpdateMineralPrice | ( | ) |
Definition at line 903 of file MarketMgr.cpp.
References sDataMgr, and MarketDB::UpdateMktPrice().
void MarketMgr::UpdatePriceHistory | ( | ) |
Definition at line 101 of file MarketMgr.cpp.
References EvE::Time::Day, GetFileTimeNow(), EvE::Time::Hour, m_timeStamp, sConfig, sDatabase, Market::Type::Sell, MarketDB::SetUpdateTime(), and EvE::Time::Year.
|
private |
Definition at line 70 of file MarketMgr.h.
Referenced by ExecuteBuyOrder(), ExecuteSellOrder(), Populate(), and SendOnOwnOrderChanged().
|
private |
Definition at line 71 of file MarketMgr.h.
Referenced by GetNewPriceHistory(), GetOldPriceHistory(), Initialize(), and InvalidateOrdersCache().
|
private |
Definition at line 73 of file MarketMgr.h.
Referenced by Close(), GetMarketGroups(), and Populate().
|
private |
Definition at line 75 of file MarketMgr.h.
Referenced by GetNewPriceHistory(), GetOldPriceHistory(), Initialize(), MarketMgr(), NeedsUpdate(), and UpdatePriceHistory().