Disable unused item cache, ref kaetemi/ryzomclassic#203

ryzomclassic-develop
kaetemi 4 years ago
parent 817ca5bf2b
commit cf16ec5c44

@ -4487,12 +4487,14 @@ NLMISC_COMMAND(debugItemInfoWaiters, "log ItemInfoWaiters", "")
return true; return true;
} }
#ifdef RYZOM_FORGE
NLMISC_COMMAND(debugItemInfoCache, "log ItemInfoCache", "") NLMISC_COMMAND(debugItemInfoCache, "log ItemInfoCache", "")
{ {
getInventory().debugItemInfoCache(); getInventory().debugItemInfoCache();
return true; return true;
} }
#endif
NLMISC_COMMAND(debugInfoWindows, "log info windows sheetId", "") NLMISC_COMMAND(debugInfoWindows, "log info windows sheetId", "")
{ {

@ -4628,6 +4628,8 @@ public:
}; };
REGISTER_ACTION_HANDLER( CHandlerSortTribeFame, "sort_tribefame"); REGISTER_ACTION_HANDLER( CHandlerSortTribeFame, "sort_tribefame");
#ifdef RYZOM_FORGE
// *************************************************************************** // ***************************************************************************
class CHandlerTriggerIconBuffs : public IActionHandler class CHandlerTriggerIconBuffs : public IActionHandler
{ {
@ -4642,3 +4644,4 @@ public:
}; };
REGISTER_ACTION_HANDLER(CHandlerTriggerIconBuffs, "trigger_show_icon_buffs"); REGISTER_ACTION_HANDLER(CHandlerTriggerIconBuffs, "trigger_show_icon_buffs");
#endif

@ -78,6 +78,8 @@ REGISTER_UI_CLASS(CDBCtrlSheet)
const uint64 NOTIFY_ANIM_MS_DURATION = 1000; const uint64 NOTIFY_ANIM_MS_DURATION = 1000;
#ifdef RYZOM_FORGE
// state kept and changed by UI:SAVE:SHOW_ICON_BUFFS // state kept and changed by UI:SAVE:SHOW_ICON_BUFFS
bool CDBCtrlSheet::_ShowIconBuffs = true; bool CDBCtrlSheet::_ShowIconBuffs = true;
@ -147,6 +149,8 @@ string CControlSheetInfoWaiter::infoValidated() const
#endif #endif
} }
#endif
// *************************************************************************** // ***************************************************************************
int CDBCtrlSheet::luaGetDraggedSheet(CLuaState &ls) int CDBCtrlSheet::luaGetDraggedSheet(CLuaState &ls)
{ {
@ -154,6 +158,8 @@ int CDBCtrlSheet::luaGetDraggedSheet(CLuaState &ls)
return 1; return 1;
} }
#ifdef RYZOM_FORGE
// *************************************************************************** // ***************************************************************************
int CDBCtrlSheet::luaGetItemInfo(CLuaState &ls) int CDBCtrlSheet::luaGetItemInfo(CLuaState &ls)
{ {
@ -189,6 +195,8 @@ int CDBCtrlSheet::luaGetItemInfo(CLuaState &ls)
return 1; return 1;
} }
#endif
// *************************************************************************** // ***************************************************************************
int CDBCtrlSheet::luaGetName(CLuaState &ls) int CDBCtrlSheet::luaGetName(CLuaState &ls)
{ {
@ -533,7 +541,9 @@ CCtrlDraggable(param)
_Useable= true; _Useable= true;
_GrayedLink= NULL; _GrayedLink= NULL;
_NeedSetup= true; _NeedSetup= true;
#ifdef RYZOM_FORGE
_ItemInfoChanged = true; _ItemInfoChanged = true;
#endif
_IconW = 0; _IconW = 0;
_IconH = 0; _IconH = 0;
_SetupInit= false; _SetupInit= false;
@ -572,10 +582,12 @@ CDBCtrlSheet::~CDBCtrlSheet()
{ {
NL3D::UDriver *Driver = CViewRenderer::getInstance()->getDriver(); NL3D::UDriver *Driver = CViewRenderer::getInstance()->getDriver();
#ifdef RYZOM_FORGE
if (_ItemInfoWaiter.Requesting) if (_ItemInfoWaiter.Requesting)
{ {
getInventory().removeItemInfoWaiter(&_ItemInfoWaiter); getInventory().removeItemInfoWaiter(&_ItemInfoWaiter);
} }
#endif
if (_GuildBack) if (_GuildBack)
{ {
@ -1097,6 +1109,7 @@ void CDBCtrlSheet::updateIconSize()
} }
} }
#ifdef RYZOM_FORGE
// *************************************************************************** // ***************************************************************************
void CDBCtrlSheet::clearIconBuffs() void CDBCtrlSheet::clearIconBuffs()
{ {
@ -1163,6 +1176,7 @@ void CDBCtrlSheet::infoReceived()
} }
} }
} }
#endif
// *************************************************************************** // ***************************************************************************
void CDBCtrlSheet::setupPact() void CDBCtrlSheet::setupPact()
@ -1205,6 +1219,8 @@ void CDBCtrlSheet::setupPact()
} }
} }
#ifdef RYZOM_FORGE
// *************************************************************************** // ***************************************************************************
bool CDBCtrlSheet::useItemInfoForFamily(ITEMFAMILY::EItemFamily family) const bool CDBCtrlSheet::useItemInfoForFamily(ITEMFAMILY::EItemFamily family) const
{ {
@ -1220,6 +1236,8 @@ bool CDBCtrlSheet::useItemInfoForFamily(ITEMFAMILY::EItemFamily family) const
|| family == ITEMFAMILY::TRAINING_TOOL; || family == ITEMFAMILY::TRAINING_TOOL;
} }
#endif
// *************************************************************************** // ***************************************************************************
void CDBCtrlSheet::setupItem () void CDBCtrlSheet::setupItem ()
{ {
@ -1328,8 +1346,10 @@ void CDBCtrlSheet::setupItem ()
// Special Item requirement // Special Item requirement
updateItemCharacRequirement(_LastSheetId); updateItemCharacRequirement(_LastSheetId);
#ifdef RYZOM_FORGE
// update item info markers // update item info markers
_ItemInfoChanged = true; _ItemInfoChanged = true;
#endif
} }
else else
{ {
@ -1405,12 +1425,14 @@ void CDBCtrlSheet::setupItem ()
} }
*/ */
#ifdef RYZOM_FORGE
// at each frame, update item info icon if changed // at each frame, update item info icon if changed
if (_ItemInfoChanged) if (_ItemInfoChanged)
{ {
_ItemInfoChanged = false; _ItemInfoChanged = false;
setupItemInfoWaiter(); setupItemInfoWaiter();
} }
#endif
} }
@ -2390,7 +2412,12 @@ void CDBCtrlSheet::drawSheet (sint32 x, sint32 y, bool draging, bool showSelecti
rVR.draw11RotFlipBitmap (_RenderLayer+1, x, y, 0, false, _DispOver2BmpId, fastMulRGB(curSheetColor, _IconOver2Color)); rVR.draw11RotFlipBitmap (_RenderLayer+1, x, y, 0, false, _DispOver2BmpId, fastMulRGB(curSheetColor, _IconOver2Color));
} }
if (_ShowIconBuffs && !_BuffIcons.empty()) #ifdef RYZOM_FORGE
if (_ShowIconBuffs &&
#else
if (
#endif
!_BuffIcons.empty())
{ {
// there is max 4 icons // there is max 4 icons
sint32 hArea = (hSheet / 4); sint32 hArea = (hSheet / 4);
@ -2425,7 +2452,12 @@ void CDBCtrlSheet::drawSheet (sint32 x, sint32 y, bool draging, bool showSelecti
drawNumber(x+1, y-2+hSheet-rVR.getFigurTextureH(), wSheet, hSheet, numberColor, enchant, false); drawNumber(x+1, y-2+hSheet-rVR.getFigurTextureH(), wSheet, hSheet, numberColor, enchant, false);
} }
if (_ShowIconBuffs && !_EnchantIcons.empty()) #ifdef RYZOM_FORGE
if (_ShowIconBuffs &&
#else
if (
#endif
!_EnchantIcons.empty())
{ {
// should only only 2 icons at most // should only only 2 icons at most
// draw them in single line, top-right // draw them in single line, top-right
@ -3225,8 +3257,10 @@ void CDBCtrlSheet::swapSheet(CDBCtrlSheet *other)
swapDBProps(getItemRMClassTypePtr(), other->getItemRMClassTypePtr()); swapDBProps(getItemRMClassTypePtr(), other->getItemRMClassTypePtr());
swapDBProps(getItemRMFaberStatTypePtr(), other->getItemRMFaberStatTypePtr()); swapDBProps(getItemRMFaberStatTypePtr(), other->getItemRMFaberStatTypePtr());
swapDBProps(getItemPrerequisitValidPtr(), other->getItemPrerequisitValidPtr()); swapDBProps(getItemPrerequisitValidPtr(), other->getItemPrerequisitValidPtr());
#ifdef RYZOM_FORGE
swapDBProps(getItemSerialPtr(), other->getItemSerialPtr()); swapDBProps(getItemSerialPtr(), other->getItemSerialPtr());
swapDBProps(getItemCreateTimePtr(), other->getItemCreateTimePtr()); swapDBProps(getItemCreateTimePtr(), other->getItemCreateTimePtr());
#endif
} }
} }
@ -3338,6 +3372,7 @@ const COutpostBuildingSheet *CDBCtrlSheet::asOutpostBuildingSheet() const
return NULL; return NULL;
} }
#ifdef RYZOM_FORGE
// *************************************************************************** // ***************************************************************************
void CDBCtrlSheet::setupItemInfoWaiter() void CDBCtrlSheet::setupItemInfoWaiter()
{ {
@ -3393,6 +3428,7 @@ void CDBCtrlSheet::setupItemInfoWaiter()
} }
} }
} }
#endif
// *************************************************************************** // ***************************************************************************
void CDBCtrlSheet::getContextHelp(std::string &help) const void CDBCtrlSheet::getContextHelp(std::string &help) const
@ -3455,6 +3491,7 @@ void CDBCtrlSheet::getContextHelp(std::string &help) const
const CItemSheet *item= asItemSheet(); const CItemSheet *item= asItemSheet();
if(item) if(item)
{ {
#ifdef RYZOM_FORGE
if (useItemInfoForFamily(item->Family)) if (useItemInfoForFamily(item->Family))
{ {
// call lua function to update tooltip window // call lua function to update tooltip window
@ -3464,7 +3501,9 @@ void CDBCtrlSheet::getContextHelp(std::string &help) const
if (help.empty()) if (help.empty())
help = getItemActualName(); help = getItemActualName();
} }
else if (!_ContextHelp.empty()) else
#endif
if (!_ContextHelp.empty())
{ {
help = _ContextHelp; help = _ContextHelp;
} }
@ -3587,6 +3626,7 @@ void CDBCtrlSheet::getContextHelp(std::string &help) const
// *************************************************************************** // ***************************************************************************
void CDBCtrlSheet::getContextHelpToolTip(std::string &help) const void CDBCtrlSheet::getContextHelpToolTip(std::string &help) const
{ {
#ifdef RYZOM_FORGE
// Special case for buff items and spell crystals, only for tooltips // Special case for buff items and spell crystals, only for tooltips
if (getType() == CCtrlSheetInfo::SheetType_Item) if (getType() == CCtrlSheetInfo::SheetType_Item)
{ {
@ -3601,6 +3641,7 @@ void CDBCtrlSheet::getContextHelpToolTip(std::string &help) const
} }
} }
} }
#endif
// Default // Default
getContextHelp(help); getContextHelp(help);
@ -3812,7 +3853,9 @@ void CDBCtrlSheet::resetAllTexIDs()
_IconW = 0; _IconW = 0;
_IconH = 0; _IconH = 0;
#ifdef RYZOM_FORGE
_ItemInfoChanged = true; _ItemInfoChanged = true;
#endif
_EnchantIcons.clear(); _EnchantIcons.clear();
_BuffIcons.clear(); _BuffIcons.clear();
} }
@ -3895,10 +3938,12 @@ void CDBCtrlSheet::copyAspect(CDBCtrlSheet *dest)
dest->setItemRMFaberStatType(getItemRMFaberStatType()); dest->setItemRMFaberStatType(getItemRMFaberStatType());
// copy prerequisit valid flag // copy prerequisit valid flag
dest->setItemPrerequisitValid(getItemPrerequisitValid()); dest->setItemPrerequisitValid(getItemPrerequisitValid());
#ifdef RYZOM_FORGE
// copy item serial // copy item serial
dest->setItemSerial(getItemSerial()); dest->setItemSerial(getItemSerial());
// copy item create time // copy item create time
dest->setItemCreateTime(getItemCreateTime()); dest->setItemCreateTime(getItemCreateTime());
#endif
} }
// if brick, sphrase or sphraseId // if brick, sphrase or sphraseId
if(isSBrick() || isSPhrase() || isSPhraseId()) if(isSBrick() || isSPhrase() || isSPhraseId())
@ -4430,6 +4475,8 @@ void CDBCtrlSheet::setItemResaleFlag(sint32 rf)
node->setValue32(rf); node->setValue32(rf);
} }
#ifdef RYZOM_FORGE
// *************************************************************************** // ***************************************************************************
sint32 CDBCtrlSheet::getItemCreateTime() const sint32 CDBCtrlSheet::getItemCreateTime() const
{ {
@ -4478,6 +4525,8 @@ void CDBCtrlSheet::setItemSerial(sint32 rf)
node->setValue32(rf); node->setValue32(rf);
} }
#endif
// *************************************************************************** // ***************************************************************************
bool CDBCtrlSheet::getLockedByOwner() const bool CDBCtrlSheet::getLockedByOwner() const
{ {
@ -4736,6 +4785,7 @@ std::string CDBCtrlSheet::getContextHelpWindowName() const
{ {
return "action_context_help"; return "action_context_help";
} }
#ifdef RYZOM_FORGE
if (getType() == CCtrlSheetInfo::SheetType_Item) if (getType() == CCtrlSheetInfo::SheetType_Item)
{ {
const CItemSheet *item= asItemSheet(); const CItemSheet *item= asItemSheet();
@ -4751,6 +4801,7 @@ std::string CDBCtrlSheet::getContextHelpWindowName() const
} }
} }
} }
#endif
return CCtrlBase::getContextHelpWindowName(); return CCtrlBase::getContextHelpWindowName();
} }

@ -61,6 +61,8 @@ namespace NLGUI
class CDBCtrlSheet; class CDBCtrlSheet;
#ifdef RYZOM_FORGE
// *************************************************************************** // ***************************************************************************
// Item info request from server // Item info request from server
class CControlSheetInfoWaiter : public IItemInfoWaiter class CControlSheetInfoWaiter : public IItemInfoWaiter
@ -78,6 +80,7 @@ public:
virtual void infoReceived(); virtual void infoReceived();
}; };
#endif
// *************************************************************************** // ***************************************************************************
/** Common info for CDBCtrlSheet and CDBGroupListSheet /** Common info for CDBCtrlSheet and CDBGroupListSheet
@ -306,7 +309,9 @@ public:
REFLECT_STRING_REF ("on_can_drop", getActionOnCanDrop, setActionOnCanDrop); REFLECT_STRING_REF ("on_can_drop", getActionOnCanDrop, setActionOnCanDrop);
REFLECT_STRING_REF ("on_can_drop_params", getParamsOnCanDrop, setParamsOnCanDrop); REFLECT_STRING_REF ("on_can_drop_params", getParamsOnCanDrop, setParamsOnCanDrop);
REFLECT_LUA_METHOD("getDraggedSheet", luaGetDraggedSheet); REFLECT_LUA_METHOD("getDraggedSheet", luaGetDraggedSheet);
#ifdef RYZOM_FORGE
REFLECT_LUA_METHOD("getItemInfo", luaGetItemInfo); REFLECT_LUA_METHOD("getItemInfo", luaGetItemInfo);
#endif
REFLECT_LUA_METHOD("getName", luaGetName); REFLECT_LUA_METHOD("getName", luaGetName);
REFLECT_LUA_METHOD("getCreatorName", luaGetCreatorName); REFLECT_LUA_METHOD("getCreatorName", luaGetCreatorName);
REFLECT_LUA_METHOD("waitInfo", luaWaitInfo); REFLECT_LUA_METHOD("waitInfo", luaWaitInfo);
@ -314,7 +319,9 @@ public:
REFLECT_EXPORT_END REFLECT_EXPORT_END
int luaGetDraggedSheet(CLuaState &ls); int luaGetDraggedSheet(CLuaState &ls);
#ifdef RYZOM_FORGE
int luaGetItemInfo(CLuaState &ls); int luaGetItemInfo(CLuaState &ls);
#endif
int luaGetName(CLuaState &ls); int luaGetName(CLuaState &ls);
int luaGetCreatorName(CLuaState &ls); int luaGetCreatorName(CLuaState &ls);
int luaWaitInfo(CLuaState &ls); int luaWaitInfo(CLuaState &ls);
@ -534,6 +541,8 @@ public:
// set item RESALE_FLAG // set item RESALE_FLAG
void setItemResaleFlag(sint32 rf); void setItemResaleFlag(sint32 rf);
#ifdef RYZOM_FORGE
//get item CREATE_TIME. 0 if no DB //get item CREATE_TIME. 0 if no DB
sint32 getItemCreateTime() const; sint32 getItemCreateTime() const;
NLMISC::CCDBNodeLeaf *getItemCreateTimePtr() const; NLMISC::CCDBNodeLeaf *getItemCreateTimePtr() const;
@ -546,6 +555,8 @@ public:
// set item CREATE_TIME // set item CREATE_TIME
void setItemSerial(sint32 serial); void setItemSerial(sint32 serial);
#endif
// get item locked by owner // get item locked by owner
bool getLockedByOwner() const; bool getLockedByOwner() const;
@ -605,14 +616,20 @@ public:
// start notify anim (at the end of regen usually) // start notify anim (at the end of regen usually)
void startNotifyAnim(); void startNotifyAnim();
#ifdef RYZOM_FORGE
// callback from info waiter // callback from info waiter
void infoReceived(); void infoReceived();
#endif
// set enchant/buff marker visiblility // set enchant/buff marker visiblility
#ifdef RYZOM_FORGE
static void setShowIconBuffs(bool b) { _ShowIconBuffs = b; } static void setShowIconBuffs(bool b) { _ShowIconBuffs = b; }
#endif
protected: protected:
#ifdef RYZOM_FORGE
inline bool useItemInfoForFamily(ITEMFAMILY::EItemFamily family) const; inline bool useItemInfoForFamily(ITEMFAMILY::EItemFamily family) const;
#endif
void setupItem(); void setupItem();
void setupPact(); void setupPact();
@ -652,7 +669,9 @@ protected:
NLMISC::CCDBNodeLeaf *_ItemRMFaberStatType; NLMISC::CCDBNodeLeaf *_ItemRMFaberStatType;
mutable sint32 _LastSheetId; mutable sint32 _LastSheetId;
#ifdef RYZOM_FORGE
bool _ItemInfoChanged; bool _ItemInfoChanged;
#endif
/// Display /// Display
sint32 _DispSlotBmpId; // Display slot bitmap id sint32 _DispSlotBmpId; // Display slot bitmap id
@ -803,22 +822,28 @@ protected:
static NLMISC::CSmartPtr<CSPhraseComAdpater> _PhraseAdapter; static NLMISC::CSmartPtr<CSPhraseComAdpater> _PhraseAdapter;
sint64 _NotifyAnimEndTime; sint64 _NotifyAnimEndTime;
#ifdef RYZOM_FORGE
mutable CControlSheetInfoWaiter _ItemInfoWaiter; mutable CControlSheetInfoWaiter _ItemInfoWaiter;
#endif
private: private:
mutable TSheetType _ActualType; mutable TSheetType _ActualType;
static CDBCtrlSheet *_CurrSelection; static CDBCtrlSheet *_CurrSelection;
static CDBCtrlSheet *_CurrMenuSheet; static CDBCtrlSheet *_CurrMenuSheet;
#ifdef RYZOM_FORGE
static bool _ShowIconBuffs; static bool _ShowIconBuffs;
#endif
private: private:
void updateActualType() const; void updateActualType() const;
void updateIconSize(); void updateIconSize();
void resetAllTexIDs(); void resetAllTexIDs();
void setupInit(); void setupInit();
#ifdef RYZOM_FORGE
// remove enchant and buff markers from item icon // remove enchant and buff markers from item icon
void clearIconBuffs(); void clearIconBuffs();
#endif
void setupCharBitmaps(sint32 maxW, sint32 maxLine, sint32 maxWChar= 1000, bool topDown= false); void setupCharBitmaps(sint32 maxW, sint32 maxLine, sint32 maxWChar= 1000, bool topDown= false);
void resetCharBitmaps(); void resetCharBitmaps();
@ -827,8 +852,10 @@ private:
// special for items // special for items
void updateItemCharacRequirement(sint32 sheetId); void updateItemCharacRequirement(sint32 sheetId);
#ifdef RYZOM_FORGE
// Send ITEM_INFO:GET request to server to fetch Buffs, Enchant info // Send ITEM_INFO:GET request to server to fetch Buffs, Enchant info
void setupItemInfoWaiter(); void setupItemInfoWaiter();
#endif
// update armour color, and cache // update armour color, and cache
void updateArmourColor(sint8 col); void updateArmourColor(sint8 col);

@ -150,6 +150,8 @@ void CItemImage::build(CCDBNodeBranch *branch)
nlassert(Sheet && Quality && Quantity && UserColor && Weight && NameId && InfoVersion); nlassert(Sheet && Quality && Quantity && UserColor && Weight && NameId && InfoVersion);
} }
#ifdef RYZOM_FORGE
// ************************************************************************************************* // *************************************************************************************************
void CItemInfoCache::load(const std::string &filename) void CItemInfoCache::load(const std::string &filename)
{ {
@ -283,6 +285,8 @@ void CItemInfoCache::debugItemInfoCache() const
pIM->displaySystemInfo(toString("ItemInfoCache: %d entries written to client.log", _ItemInfoCacheMap.size())); pIM->displaySystemInfo(toString("ItemInfoCache: %d entries written to client.log", _ItemInfoCacheMap.size()));
} }
#endif
// ************************************************************************************************* // *************************************************************************************************
// CInventoryManager // CInventoryManager
// ************************************************************************************************* // *************************************************************************************************
@ -311,16 +315,22 @@ CInventoryManager::CInventoryManager()
BagItemEquipped[i]= false; BagItemEquipped[i]= false;
} }
#ifdef RYZOM_FORGE
_ItemInfoCacheFilename = toString("save/item_infos_%d.cache", CharacterHomeSessionId.asInt()); _ItemInfoCacheFilename = toString("save/item_infos_%d.cache", CharacterHomeSessionId.asInt());
_ItemInfoCache.load(_ItemInfoCacheFilename); _ItemInfoCache.load(_ItemInfoCacheFilename);
#endif
nlctassert(NumInventories== sizeof(InventoryIndexes)/sizeof(InventoryIndexes[0])); nlctassert(NumInventories== sizeof(InventoryIndexes)/sizeof(InventoryIndexes[0]));
} }
// *************************************************************************** // ***************************************************************************
CInventoryManager::~CInventoryManager() CInventoryManager::~CInventoryManager()
{ {
#ifdef RYZOM_FORGE
_ItemInfoCache.save(_ItemInfoCacheFilename); _ItemInfoCache.save(_ItemInfoCacheFilename);
#endif
} }
// ************************************************************************************************* // *************************************************************************************************
@ -3385,11 +3395,13 @@ uint CInventoryManager::getItemSheetForSlotId(uint slotId) const
return 0; return 0;
} }
#ifdef RYZOM_FORGE
// *************************************************************************** // ***************************************************************************
const CClientItemInfo *CInventoryManager::getItemInfoCache(uint32 serial, uint32 createTime) const const CClientItemInfo *CInventoryManager::getItemInfoCache(uint32 serial, uint32 createTime) const
{ {
return _ItemInfoCache.getItemInfo(serial, createTime); return _ItemInfoCache.getItemInfo(serial, createTime);
} }
#endif
// *************************************************************************** // ***************************************************************************
const CClientItemInfo &CInventoryManager::getItemInfo(uint slotId) const const CClientItemInfo &CInventoryManager::getItemInfo(uint slotId) const
@ -3674,10 +3686,12 @@ void CInventoryManager::debugItemInfoWaiters()
} }
// *************************************************************************** // ***************************************************************************
#ifdef RYZOM_FORGE
void CInventoryManager::debugItemInfoCache() const void CInventoryManager::debugItemInfoCache() const
{ {
_ItemInfoCache.debugItemInfoCache(); _ItemInfoCache.debugItemInfoCache();
} }
#endif
// *************************************************************************** // ***************************************************************************
void CInventoryManager::sortBag() void CInventoryManager::sortBag()

@ -129,6 +129,8 @@ public:
void refreshInfoVersion(uint8 infoVersion) { InfoVersionFromMsg= infoVersion; } void refreshInfoVersion(uint8 infoVersion) { InfoVersionFromMsg= infoVersion; }
}; };
#ifdef RYZOM_FORGE
class CItemInfoCache class CItemInfoCache
{ {
public: public:
@ -149,6 +151,8 @@ private:
TItemInfoCacheMap _ItemInfoCacheMap; TItemInfoCacheMap _ItemInfoCacheMap;
}; };
#endif
// *************************************************************************** // ***************************************************************************
/** This manager gives direct access to inventory slots (bag, temporary inventory, hands, and equip inventory) /** This manager gives direct access to inventory slots (bag, temporary inventory, hands, and equip inventory)
* This also give access to player money * This also give access to player money
@ -283,8 +287,10 @@ public:
uint16 getItemSlotId(CDBCtrlSheet *ctrl); uint16 getItemSlotId(CDBCtrlSheet *ctrl);
uint16 getItemSlotId(const std::string &itemDb, uint slotIndex); uint16 getItemSlotId(const std::string &itemDb, uint slotIndex);
const CClientItemInfo &getItemInfo(uint slotId) const; const CClientItemInfo &getItemInfo(uint slotId) const;
#ifdef RYZOM_FORGE
// get item info from cache // get item info from cache
const CClientItemInfo *getItemInfoCache(uint32 serial, uint32 createTime) const; const CClientItemInfo *getItemInfoCache(uint32 serial, uint32 createTime) const;
#endif
uint getItemSheetForSlotId(uint slotId) const; uint getItemSheetForSlotId(uint slotId) const;
// Returns true if the item info is already in slot cache // Returns true if the item info is already in slot cache
bool isItemInfoAvailable(uint slotId) const; bool isItemInfoAvailable(uint slotId) const;
@ -299,7 +305,9 @@ public:
void onRefreshItemInfoVersion(uint16 slotId, uint8 infoVersion); void onRefreshItemInfoVersion(uint16 slotId, uint8 infoVersion);
// Log for debug // Log for debug
void debugItemInfoWaiters(); void debugItemInfoWaiters();
#ifdef RYZOM_FORGE
void debugItemInfoCache() const; void debugItemInfoCache() const;
#endif
void sortBag(); void sortBag();
@ -342,8 +350,10 @@ private:
CDBCtrlSheet *DNDCurrentItem; CDBCtrlSheet *DNDCurrentItem;
// ItemExtraInfo management. // ItemExtraInfo management.
#ifdef RYZOM_FORGE
std::string _ItemInfoCacheFilename; std::string _ItemInfoCacheFilename;
CItemInfoCache _ItemInfoCache; CItemInfoCache _ItemInfoCache;
#endif
typedef std::map<uint, CClientItemInfo> TItemInfoMap; typedef std::map<uint, CClientItemInfo> TItemInfoMap;
TItemInfoMap _ItemInfoMap; TItemInfoMap _ItemInfoMap;
typedef std::list<IItemInfoWaiter*> TItemInfoWaiters; typedef std::list<IItemInfoWaiter*> TItemInfoWaiters;

Loading…
Cancel
Save