diff options
-rw-r--r-- | indra/newview/llviewerobject.cpp | 18 | ||||
-rw-r--r-- | indra/newview/llviewerobject.h | 4 |
2 files changed, 16 insertions, 6 deletions
diff --git a/indra/newview/llviewerobject.cpp b/indra/newview/llviewerobject.cpp index 13cdcd6954..56dcd30a1d 100644 --- a/indra/newview/llviewerobject.cpp +++ b/indra/newview/llviewerobject.cpp @@ -133,6 +133,7 @@ std::map<std::string, U32> LLViewerObject::sObjectDataMap; // JC 3/18/2003 const F32 PHYSICS_TIMESTEP = 1.f / 45.f; +const F64 INV_REQUEST_EXPIRE_TIME_SEC = 60.f; static LLTrace::BlockTimerStatHandle FTM_CREATE_OBJECT("Create Object"); @@ -245,7 +246,7 @@ LLViewerObject::LLViewerObject(const LLUUID &id, const LLPCode pcode, LLViewerRe mInventory(NULL), mInventorySerialNum(0), mRegionp( regionp ), - mInventoryPending(FALSE), + mInvRequestExpireTime(0.f), mInventoryDirty(FALSE), mDead(FALSE), mOrphaned(FALSE), @@ -2840,6 +2841,15 @@ void LLViewerObject::removeInventoryListener(LLVOInventoryListener* listener) } } +BOOL LLViewerObject::isInventoryPending() +{ + if (mInvRequestExpireTime == 0.f || mInvRequestExpireTime < LLFrameTimer::getTotalSeconds()) + { + return FALSE; + } + return TRUE; +} + void LLViewerObject::clearInventoryListeners() { for_each(mInventoryCallbacks.begin(), mInventoryCallbacks.end(), DeletePointer()); @@ -2878,7 +2888,7 @@ void LLViewerObject::requestInventory() void LLViewerObject::fetchInventoryFromServer() { - if (!mInventoryPending) + if (mInvRequestExpireTime == 0.f || mInvRequestExpireTime < LLFrameTimer::getTotalSeconds()) { delete mInventory; LLMessageSystem* msg = gMessageSystem; @@ -2891,7 +2901,7 @@ void LLViewerObject::fetchInventoryFromServer() msg->sendReliable(mRegionp->getHost()); // this will get reset by dirtyInventory or doInventoryCallback - mInventoryPending = TRUE; + mInvRequestExpireTime = LLFrameTimer::getTotalSeconds() + INV_REQUEST_EXPIRE_TIME_SEC; } } @@ -3107,7 +3117,7 @@ void LLViewerObject::doInventoryCallback() mInventoryCallbacks.erase(curiter); } } - mInventoryPending = FALSE; + mInvRequestExpireTime = 0.f; } void LLViewerObject::removeInventory(const LLUUID& item_id) diff --git a/indra/newview/llviewerobject.h b/indra/newview/llviewerobject.h index cb8acfdcf8..b95190c554 100644 --- a/indra/newview/llviewerobject.h +++ b/indra/newview/llviewerobject.h @@ -437,7 +437,7 @@ public: // viewer object has the inventory stored locally. void registerInventoryListener(LLVOInventoryListener* listener, void* user_data); void removeInventoryListener(LLVOInventoryListener* listener); - BOOL isInventoryPending() { return mInventoryPending; } + BOOL isInventoryPending(); void clearInventoryListeners(); bool hasInventoryListeners(); void requestInventory(); @@ -757,7 +757,7 @@ protected: S16 mInventorySerialNum; LLViewerRegion *mRegionp; // Region that this object belongs to. - BOOL mInventoryPending; + F64 mInvRequestExpireTime; BOOL mInventoryDirty; BOOL mDead; BOOL mOrphaned; // This is an orphaned child |