diff options
Diffstat (limited to 'indra')
-rw-r--r-- | indra/newview/llviewerobjectlist.cpp | 28 | ||||
-rw-r--r-- | indra/newview/llviewerobjectlist.h | 1 |
2 files changed, 26 insertions, 3 deletions
diff --git a/indra/newview/llviewerobjectlist.cpp b/indra/newview/llviewerobjectlist.cpp index 047241fffb..422ac4e84f 100644 --- a/indra/newview/llviewerobjectlist.cpp +++ b/indra/newview/llviewerobjectlist.cpp @@ -60,6 +60,7 @@ #include "llviewercamera.h" #include "llselectmgr.h" #include "llresmgr.h" +#include "llsdutil.h" #include "llviewerregion.h" #include "llviewerstats.h" #include "llvoavatarself.h" @@ -661,7 +662,14 @@ class LLObjectCostResponder : public LLCurl::Responder public: void result(const LLSD& content) { - llinfos << content << llendl; + for (LLSD::map_const_iterator iter = content.beginMap(); iter != content.endMap(); ++iter) + { + LLUUID object_id = LLUUID(iter->first); + S32 link_cost = iter->second["LinkResourceCost"].asInteger(); + S32 prim_cost = iter->second["PrimResourceCost"].asInteger(); + + gObjectList.updateObjectCost(object_id, prim_cost, link_cost); + } } }; @@ -768,7 +776,7 @@ void LLViewerObjectList::update(LLAgent &agent, LLWorld &world) if (regionp) { - std::string url; // = regionp->getCapability("GetObjectCost"); + std::string url = regionp->getCapability("GetObjectCost"); if (!url.empty()) { @@ -785,7 +793,10 @@ void LLViewerObjectList::update(LLAgent &agent, LLWorld &world) mPendingObjectCost = mStaleObjectCost; mStaleObjectCost.clear(); - LLHTTPClient::post(url, id_list, new LLObjectCostResponder()); + if (id_list.size() > 0) + { + LLHTTPClient::post(url, id_list, new LLObjectCostResponder()); + } } else { @@ -1088,6 +1099,17 @@ void LLViewerObjectList::updateObjectCost(LLViewerObject* object) mStaleObjectCost.insert(object->getID()); } +void LLViewerObjectList::updateObjectCost(LLUUID object_id, S32 prim_cost, S32 link_cost) +{ + mPendingObjectCost.erase(object_id); + + LLViewerObject* object = findObject(object_id); + if (object) + { + object->setObjectCost(prim_cost); + } +} + void LLViewerObjectList::shiftObjects(const LLVector3 &offset) { // This is called when we shift our origin when we cross region boundaries... diff --git a/indra/newview/llviewerobjectlist.h b/indra/newview/llviewerobjectlist.h index ca228a6462..db9324bdbd 100644 --- a/indra/newview/llviewerobjectlist.h +++ b/indra/newview/llviewerobjectlist.h @@ -92,6 +92,7 @@ public: void update(LLAgent &agent, LLWorld &world); void updateObjectCost(LLViewerObject* object); + void updateObjectCost(LLUUID object_id, S32 prim_cost, S32 link_cost); void shiftObjects(const LLVector3 &offset); |