From c3ccdeed1d248921ea7011eca5ac21bdb777d66a Mon Sep 17 00:00:00 2001 From: Shyotl Date: Thu, 30 Jun 2011 10:02:37 -0500 Subject: [PATCH 01/33] Unused globals removed. --- indra/newview/llviewertexturelist.cpp | 3 --- 1 file changed, 3 deletions(-) diff --git a/indra/newview/llviewertexturelist.cpp b/indra/newview/llviewertexturelist.cpp index 89e316e59..c2cb0c5a4 100644 --- a/indra/newview/llviewertexturelist.cpp +++ b/indra/newview/llviewertexturelist.cpp @@ -1087,9 +1087,6 @@ LLPointer LLViewerTextureList::convertToUploadFile(LLPointer Date: Sun, 10 Jul 2011 19:38:43 -0500 Subject: [PATCH 02/33] Hack hackity hack... I mean fixed water-fog sign-error when cam approaches 0 z when using shaders. --- .../app_settings/shaders/class2/environment/waterFogF.glsl | 2 +- indra/newview/llwaterparammanager.cpp | 5 +++++ 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/indra/newview/app_settings/shaders/class2/environment/waterFogF.glsl b/indra/newview/app_settings/shaders/class2/environment/waterFogF.glsl index 25d65b571..dd1c8ee64 100644 --- a/indra/newview/app_settings/shaders/class2/environment/waterFogF.glsl +++ b/indra/newview/app_settings/shaders/class2/environment/waterFogF.glsl @@ -32,7 +32,7 @@ vec4 applyWaterFog(vec4 color) float depth = length(getPositionEye() - int_v); //get "thickness" of water - float l = max(depth, 0.1); + float l = min(max(depth, 0.1),50.0); float kd = waterFogDensity; float ks = waterFogKS; diff --git a/indra/newview/llwaterparammanager.cpp b/indra/newview/llwaterparammanager.cpp index 6028f4d80..bf8956960 100644 --- a/indra/newview/llwaterparammanager.cpp +++ b/indra/newview/llwaterparammanager.cpp @@ -298,6 +298,11 @@ void LLWaterParamManager::update(LLViewerCamera * cam) mWaterPlane = LLVector4(enorm.v[0], enorm.v[1], enorm.v[2], -ep.dot(enorm)); + if((mWaterPlane.mV[3] >= 0.f) == LLViewerCamera::getInstance()->cameraUnderWater()) //Sign borkage.. + { + mWaterPlane.scaleVec(LLVector4(-1.f,-1.f,-1.f,-1.f)); + } + LLVector3 sunMoonDir; if (gSky.getSunDirection().mV[2] > LLSky::NIGHTTIME_ELEVATION_COS) { From cae99f6cc8b000b57deaba8e7d68270d829e2e53 Mon Sep 17 00:00:00 2001 From: Shyotl Date: Tue, 12 Jul 2011 03:38:23 -0500 Subject: [PATCH 03/33] Datapacker potentially leaking buffers? --- indra/llmessage/lldatapacker.h | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/indra/llmessage/lldatapacker.h b/indra/llmessage/lldatapacker.h index b8d9fcbdd..fcd2add22 100644 --- a/indra/llmessage/lldatapacker.h +++ b/indra/llmessage/lldatapacker.h @@ -174,10 +174,15 @@ public: S32 getCurrentSize() const { return (S32)(mCurBufferp - mBufferp); } S32 getBufferSize() const { return mBufferSize; } + const U8* getBuffer() const { return mBufferp; } void reset() { mCurBufferp = mBufferp; mWriteEnabled = (mCurBufferp != NULL); } void freeBuffer() { delete [] mBufferp; mBufferp = mCurBufferp = NULL; mBufferSize = 0; mWriteEnabled = FALSE; } void assignBuffer(U8 *bufferp, S32 size) { + if(mBufferp && mBufferp != bufferp) + { + freeBuffer() ; + } mBufferp = bufferp; mCurBufferp = bufferp; mBufferSize = size; From 8fde48bcb2b12bc595986fe7acea95a8b9adc0a9 Mon Sep 17 00:00:00 2001 From: Shyotl Date: Tue, 12 Jul 2011 03:39:41 -0500 Subject: [PATCH 04/33] Abort fetch of null folders. --- indra/newview/llinventorymodel.cpp | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/indra/newview/llinventorymodel.cpp b/indra/newview/llinventorymodel.cpp index 6028cefb1..be94cfd3a 100644 --- a/indra/newview/llinventorymodel.cpp +++ b/indra/newview/llinventorymodel.cpp @@ -1366,6 +1366,11 @@ void LLInventoryModel::fetchInventoryResponder::error(U32 status, const std::str bool LLInventoryModel::fetchDescendentsOf(const LLUUID& folder_id) const { + if(folder_id.isNull()) + { + llwarns << "Calling fetch descendents on NULL folder id!" << llendl; + return false; + } LLViewerInventoryCategory* cat = getCategory(folder_id); if(!cat) { From f93bcae65b01b1abcb06bed1c30d690535f350bd Mon Sep 17 00:00:00 2001 From: Shyotl Date: Tue, 12 Jul 2011 03:44:26 -0500 Subject: [PATCH 05/33] Removed some frequent llinfos/llwarns spam. --- indra/newview/llinventorybridge.cpp | 4 +++- indra/newview/llviewerinventory.cpp | 2 +- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/indra/newview/llinventorybridge.cpp b/indra/newview/llinventorybridge.cpp index 36149cb84..8282bf8ff 100644 --- a/indra/newview/llinventorybridge.cpp +++ b/indra/newview/llinventorybridge.cpp @@ -1051,7 +1051,9 @@ LLInvFVBridge* LLInvFVBridge::createBridge(LLAssetType::EType asset_type, break; case LLAssetType::AT_OBJECT: - if(!(inv_type == LLInventoryType::IT_OBJECT || inv_type == LLInventoryType::IT_ATTACHMENT)) + if(!(inv_type == LLInventoryType::IT_OBJECT || inv_type == LLInventoryType::IT_ATTACHMENT) + || inv_type == LLInventoryType::IT_TEXTURE ) //There's an abundance of objects in inv that have texture (0) as their inv type, right out of unpack. + //May have been bug either in an old client, or server version. Either way... it causes a lot of spam over something ultimately harmless. { llwarns << LLAssetType::lookup(asset_type) << " asset has inventory type " << LLInventoryType::lookupHumanReadable(inv_type) << " on uuid " << uuid << llendl; } diff --git a/indra/newview/llviewerinventory.cpp b/indra/newview/llviewerinventory.cpp index 4d3ac5dba..63d3a4440 100644 --- a/indra/newview/llviewerinventory.cpp +++ b/indra/newview/llviewerinventory.cpp @@ -524,7 +524,7 @@ bool LLViewerInventoryCategory::fetchDescendents() } else { //Deprecated, but if we don't have a capability, use the old system. - llinfos << "FetchInventoryDescendents capability not found. Using deprecated UDP message." << llendl; + //llinfos << "FetchInventoryDescendents capability not found. Using deprecated UDP message." << llendl; LLMessageSystem* msg = gMessageSystem; msg->newMessage("FetchInventoryDescendents"); msg->nextBlock("AgentData"); From 4f8f24921f5068f8f6c7bcc898eff5be18d943e5 Mon Sep 17 00:00:00 2001 From: Shyotl Date: Tue, 12 Jul 2011 15:35:35 -0500 Subject: [PATCH 06/33] Aleric is right. This makes no sense. Don't bring this from v2, cuz it's wrong. --- indra/llmessage/lldatapacker.h | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/indra/llmessage/lldatapacker.h b/indra/llmessage/lldatapacker.h index fcd2add22..1aadf3d75 100644 --- a/indra/llmessage/lldatapacker.h +++ b/indra/llmessage/lldatapacker.h @@ -179,10 +179,12 @@ public: void freeBuffer() { delete [] mBufferp; mBufferp = mCurBufferp = NULL; mBufferSize = 0; mWriteEnabled = FALSE; } void assignBuffer(U8 *bufferp, S32 size) { - if(mBufferp && mBufferp != bufferp) + //No no no no no! This breaks the paradigm of callers handling buffer allocation/deallocation + //Also, buffers can be on stack! Calling delete[] on such a buffer would be VERY bad. + /*if(mBufferp && mBufferp != bufferp) { freeBuffer() ; - } + }*/ mBufferp = bufferp; mCurBufferp = bufferp; mBufferSize = size; From 4753d65076f1cee50644bf45bc76e255c3beb7e3 Mon Sep 17 00:00:00 2001 From: Shyotl Date: Wed, 13 Jul 2011 03:53:12 -0500 Subject: [PATCH 07/33] V2 llvfs merge --- indra/llvfs/lldiriterator.cpp | 21 +++++++++++++++++---- 1 file changed, 17 insertions(+), 4 deletions(-) diff --git a/indra/llvfs/lldiriterator.cpp b/indra/llvfs/lldiriterator.cpp index 9434efd40..59c1d6fd2 100644 --- a/indra/llvfs/lldiriterator.cpp +++ b/indra/llvfs/lldiriterator.cpp @@ -128,6 +128,14 @@ bool LLDirIterator::Impl::next(std::string &fname) return found; } +/** +Converts the incoming glob into a regex. This involves +converting incoming glob expressions to regex equivilents and +at the same time, escaping any regex meaningful characters which +do not have glob meaning, i.e. + .()+|^$ +in the input. +*/ std::string glob_to_regex(const std::string& glob) { std::string regex; @@ -142,9 +150,6 @@ std::string glob_to_regex(const std::string& glob) switch (c) { - case '.': - regex+="\\."; - break; case '*': if (glob.begin() == i) { @@ -177,8 +182,16 @@ std::string glob_to_regex(const std::string& glob) case '!': regex+= square_brace_open ? '^' : c; break; + case '.': // This collection have different regex meaning + case '^': // and so need escaping. + case '(': + case ')': + case '+': + case '|': + case '$': + regex += '\\'; default: - regex+=c; + regex += c; break; } From e2112fa8d5c9c10c7f969d3081a987b3d8013630 Mon Sep 17 00:00:00 2001 From: Shyotl Date: Wed, 13 Jul 2011 03:56:05 -0500 Subject: [PATCH 08/33] No change, just comments for stuff to avoid merging in, for now. --- indra/newview/llagentcamera.cpp | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/indra/newview/llagentcamera.cpp b/indra/newview/llagentcamera.cpp index a53c23897..77baa02e5 100644 --- a/indra/newview/llagentcamera.cpp +++ b/indra/newview/llagentcamera.cpp @@ -407,10 +407,13 @@ LLVector3 LLAgentCamera::calcFocusOffset(LLViewerObject *object, LLVector3 origi { return original_focus_point - obj_pos; } - LLQuaternion inv_obj_rot = ~obj_rot; // get inverse of rotation - LLVector3 object_extents = object->getScale(); + LLVector3 object_extents = object->getScale(); + //this stuff just seems to make camera snapping worse... + //const LLVector3* oe3 = object->mDrawable->getSpatialExtents(); + //object_extents.set( oe3[1][0], oe3[1][1], oe3[1][2] ); + // make sure they object extents are non-zero object_extents.clamp(0.001f, F32_MAX); From 7fa2a621039da49c3b6dffce02735c0755a61d2f Mon Sep 17 00:00:00 2001 From: Shyotl Date: Wed, 13 Jul 2011 03:59:37 -0500 Subject: [PATCH 09/33] Renamed vivox icons from nonsensical uuids to something readable, as per v2. --- indra/newview/llvoicevisualizer.cpp | 16 ++++++++-------- ...e49-41e9320507d5.j2c => voice_meter_dot.j2c} | Bin ...b-f9e686d31e83.j2c => voice_meter_rings.j2c} | Bin 3 files changed, 8 insertions(+), 8 deletions(-) rename indra/newview/skins/default/textures/{041ee5a0-cb6a-9ac5-6e49-41e9320507d5.j2c => voice_meter_dot.j2c} (100%) rename indra/newview/skins/default/textures/{29de489d-0491-fb00-7dab-f9e686d31e83.j2c => voice_meter_rings.j2c} (100%) diff --git a/indra/newview/llvoicevisualizer.cpp b/indra/newview/llvoicevisualizer.cpp index 1a899db7f..00f75df00 100644 --- a/indra/newview/llvoicevisualizer.cpp +++ b/indra/newview/llvoicevisualizer.cpp @@ -42,7 +42,7 @@ #include "llvoicevisualizer.h" #include "llviewercamera.h" #include "llviewerobject.h" -#include "llimagegl.h" +#include "llviewertexture.h" #include "llviewertexturelist.h" #include "llvoiceclient.h" #include "llrender.h" @@ -130,13 +130,13 @@ LLVoiceVisualizer::LLVoiceVisualizer( const U8 type ) const char* sound_level_img[] = { - "041ee5a0-cb6a-9ac5-6e49-41e9320507d5.j2c", - "29de489d-0491-fb00-7dab-f9e686d31e83.j2c", - "29de489d-0491-fb00-7dab-f9e686d31e83.j2c", - "29de489d-0491-fb00-7dab-f9e686d31e83.j2c", - "29de489d-0491-fb00-7dab-f9e686d31e83.j2c", - "29de489d-0491-fb00-7dab-f9e686d31e83.j2c", - "29de489d-0491-fb00-7dab-f9e686d31e83.j2c" + "voice_meter_dot.j2c", + "voice_meter_rings.j2c", + "voice_meter_rings.j2c", + "voice_meter_rings.j2c", + "voice_meter_rings.j2c", + "voice_meter_rings.j2c", + "voice_meter_rings.j2c" }; for (int i=0; i Date: Wed, 13 Jul 2011 04:01:12 -0500 Subject: [PATCH 10/33] Added some missing settings and removed a bajillion old unused settings. --- indra/newview/app_settings/settings.xml | 990 ++---------------------- 1 file changed, 55 insertions(+), 935 deletions(-) diff --git a/indra/newview/app_settings/settings.xml b/indra/newview/app_settings/settings.xml index dc4aeef4a..2eaf6c580 100644 --- a/indra/newview/app_settings/settings.xml +++ b/indra/newview/app_settings/settings.xml @@ -2588,6 +2588,17 @@ Value + CacheNumberOfRegionsForObjects + + Comment + Controls number of regions to be cached for objects. + Persist + 1 + Type + U32 + Value + 128 + CacheSize Comment @@ -6775,6 +6786,17 @@ Value 0 + HideSelectedObjects + + Comment + Hide Selected Objects + Persist + 1 + Type + Boolean + Value + 0 + HtmlFindRect Comment @@ -8284,6 +8306,17 @@ Value 0 + ObjectCacheEnabled + + Comment + Enable the object cache. + Persist + 1 + Type + Boolean + Value + 1 + OpenDebugStatAdvanced Comment @@ -12382,6 +12415,28 @@ Value 20.0 + TextureDecodeDisabled + + Comment + If TRUE, do not fetch and decode any textures + Persist + 1 + Type + Boolean + Value + 0 + + TextureLoadFullRes + + Comment + If TRUE, always load textures at full resolution (discard = 0) + Persist + 1 + Type + Boolean + Value + 0 + TextureMemory Comment @@ -12594,721 +12649,6 @@ Value 0 - UIImgBtnCloseActiveUUID - - Comment - - Persist - 0 - Type - String - Value - 47a8c844-cd2a-4b1a-be01-df8b1612fe5d - - UIImgBtnCloseInactiveUUID - - Comment - - Persist - 0 - Type - String - Value - 779e4fa3-9b13-f74a-fba9-3886fe9c86ba - - UIImgBtnClosePressedUUID - - Comment - - Persist - 0 - Type - String - Value - e5821134-23c0-4bd0-af06-7fa95b9fb01a - - UIImgBtnForwardInUUID - - Comment - - Persist - 0 - Type - String - Value - 54197a61-f5d1-4c29-95d2-c071d08849cb - - UIImgBtnForwardOutUUID - - Comment - - Persist - 0 - Type - String - Value - a0eb4021-1b20-4a53-892d-8faa9265a6f5 - - UIImgBtnJumpLeftInUUID - - Comment - - Persist - 0 - Type - String - Value - 9cad3e6d-2d6d-107d-f8ab-5ba272b5bfe1 - - UIImgBtnJumpLeftOutUUID - - Comment - - Persist - 0 - Type - String - Value - 3c18c87e-5f50-14e2-e744-f44734aa365f - - UIImgBtnJumpRightInUUID - - Comment - - Persist - 0 - Type - String - Value - 7dabc040-ec13-2309-ddf7-4f161f6de2f4 - - UIImgBtnJumpRightOutUUID - - Comment - - Persist - 0 - Type - String - Value - ff9a71eb-7414-4cf8-866e-a701deb7c3cf - - UIImgBtnLeftInUUID - - Comment - - Persist - 0 - Type - String - Value - 95463c78-aaa6-464d-892d-3a805b6bb7bf - - UIImgBtnLeftOutUUID - - Comment - - Persist - 0 - Type - String - Value - 13a93910-6b44-45eb-ad3a-4d1324c59bac - - UIImgBtnMinimizeActiveUUID - - Comment - - Persist - 0 - Type - String - Value - 34c9398d-bb78-4643-9633-46a2fa3e9637 - - UIImgBtnMinimizeInactiveUUID - - Comment - - Persist - 0 - Type - String - Value - 6e72abba-1378-437f-bf7a-f0c15f3e99a3 - - UIImgBtnMinimizePressedUUID - - Comment - - Persist - 0 - Type - String - Value - 39801651-26cb-4926-af57-7af9352c273c - - UIImgBtnMoveDownInUUID - - Comment - - Persist - 0 - Type - String - Value - b92a70b9-c841-4c94-b4b3-cee9eb460d48 - - UIImgBtnMoveDownOutUUID - - Comment - - Persist - 0 - Type - String - Value - b5abc9fa-9e62-4e03-bc33-82c4c1b6b689 - - UIImgBtnMoveUpInUUID - - Comment - - Persist - 0 - Type - String - Value - 49b4b357-e430-4b56-b9e0-05b8759c3c82 - - UIImgBtnMoveUpOutUUID - - Comment - - Persist - 0 - Type - String - Value - f887146d-829f-4e39-9211-cf872b78f97c - - UIImgBtnPanDownInUUID - - Comment - - Persist - 0 - Type - String - Value - e5821134-23c0-4bd0-af06-7fa95b9fb01a - - UIImgBtnPanDownOutUUID - - Comment - - Persist - 0 - Type - String - Value - 47a8c844-cd2a-4b1a-be01-df8b1612fe5d - - UIImgBtnPanLeftInUUID - - Comment - - Persist - 0 - Type - String - Value - e5821134-23c0-4bd0-af06-7fa95b9fb01a - - UIImgBtnPanLeftOutUUID - - Comment - - Persist - 0 - Type - String - Value - 47a8c844-cd2a-4b1a-be01-df8b1612fe5d - - UIImgBtnPanRightInUUID - - Comment - - Persist - 0 - Type - String - Value - e5821134-23c0-4bd0-af06-7fa95b9fb01a - - UIImgBtnPanRightOutUUID - - Comment - - Persist - 0 - Type - String - Value - 47a8c844-cd2a-4b1a-be01-df8b1612fe5d - - UIImgBtnPanUpInUUID - - Comment - - Persist - 0 - Type - String - Value - e5821134-23c0-4bd0-af06-7fa95b9fb01a - - UIImgBtnPanUpOutUUID - - Comment - - Persist - 0 - Type - String - Value - 47a8c844-cd2a-4b1a-be01-df8b1612fe5d - - UIImgBtnRestoreActiveUUID - - Comment - - Persist - 0 - Type - String - Value - 111b39de-8928-4690-b7b2-e17d5c960277 - - UIImgBtnRestoreInactiveUUID - - Comment - - Persist - 0 - Type - String - Value - 0eafa471-70af-4882-b8c1-40a310929744 - - UIImgBtnRestorePressedUUID - - Comment - - Persist - 0 - Type - String - Value - 90a0ed5c-2e7b-4845-9958-a64a1b30f312 - - UIImgBtnRightInUUID - - Comment - - Persist - 0 - Type - String - Value - 5e616d0d-4335-476f-9977-560bccd009da - - UIImgBtnRightOutUUID - - Comment - - Persist - 0 - Type - String - Value - 5a44fd04-f52b-4c30-8b00-4a31e27614bd - - UIImgBtnScrollDownInUUID - - Comment - - Persist - 0 - Type - String - Value - d2421bab-2eaf-4863-b8f6-5e4c52519247 - - UIImgBtnScrollDownOutUUID - - Comment - - Persist - 0 - Type - String - Value - b4ecdecf-5c8d-44e7-b882-17a77e88ed55 - - UIImgBtnScrollLeftInUUID - - Comment - - Persist - 0 - Type - String - Value - ea137a32-6718-4d05-9c22-7d570d27b2cd - - UIImgBtnScrollLeftOutUUID - - Comment - - Persist - 0 - Type - String - Value - 43773e8d-49aa-48e0-80f3-a04715f4677a - - UIImgBtnScrollRightInUUID - - Comment - - Persist - 0 - Type - String - Value - b749de64-e903-4c3c-ac0b-25fb6fa39cb5 - - UIImgBtnScrollRightOutUUID - - Comment - - Persist - 0 - Type - String - Value - 3d700d19-e708-465d-87f2-46c8c0ee7938 - - UIImgBtnScrollUpInUUID - - Comment - - Persist - 0 - Type - String - Value - a93abdf3-27b5-4e22-a8fa-c48216cd2e3a - - UIImgBtnScrollUpOutUUID - - Comment - - Persist - 0 - Type - String - Value - dad084d7-9a46-452a-b0ff-4b9f1cefdde9 - - UIImgBtnSlideLeftInUUID - - Comment - - Persist - 0 - Type - String - Value - 724996f5-b956-46f6-9844-4fcfce1d5e83 - - UIImgBtnSlideLeftOutUUID - - Comment - - Persist - 0 - Type - String - Value - 82476321-0374-4c26-9567-521535ab4cd7 - - UIImgBtnSlideRightInUUID - - Comment - - Persist - 0 - Type - String - Value - 7eeb57d2-3f37-454d-a729-8b217b8be443 - - UIImgBtnSlideRightOutUUID - - Comment - - Persist - 0 - Type - String - Value - 1fbe4e60-0607-44d1-a50a-032eff56ae75 - - UIImgBtnSpinDownInUUID - - Comment - - Persist - 0 - Type - String - Value - a985ac71-052f-48e6-9c33-d931c813ac92 - - UIImgBtnSpinDownOutUUID - - Comment - - Persist - 0 - Type - String - Value - b6d240dd-5602-426f-b606-bbb49a30726d - - UIImgBtnSpinUpInUUID - - Comment - - Persist - 0 - Type - String - Value - c8450082-96a0-4319-8090-d3ff900b4954 - - UIImgBtnSpinUpOutUUID - - Comment - - Persist - 0 - Type - String - Value - 56576e6e-6710-4e66-89f9-471b59122794 - - UIImgBtnTabBottomInUUID - - Comment - - Persist - 0 - Type - String - Value - c001d8fd-a869-4b6f-86a1-fdcb106df9c7 - - UIImgBtnTabBottomOutUUID - - Comment - - Persist - 0 - Type - String - Value - bf0a8779-689b-48c3-bb9a-6af546366ef4 - - UIImgBtnTabBottomPartialInUUID - - Comment - - Persist - 0 - Type - String - Value - eb0b0904-8c91-4f24-b500-1180b91140de - - UIImgBtnTabBottomPartialOutUUID - - Comment - - Persist - 0 - Type - String - Value - 8dca716c-b29c-403a-9886-91c028357d6e - - UIImgBtnTabTopInUUID - - Comment - - Persist - 0 - Type - String - Value - 16d032e8-817b-4368-8a4e-b7b947ae3889 - - UIImgBtnTabTopOutUUID - - Comment - - Persist - 0 - Type - String - Value - 1ed83f57-41cf-4052-a3b4-2e8bb78d8191 - - UIImgBtnTabTopPartialInUUID - - Comment - - Persist - 0 - Type - String - Value - 7c6c6c26-0e25-4438-89bd-30d8b8e9d704 - - UIImgBtnTabTopPartialOutUUID - - Comment - - Persist - 0 - Type - String - Value - 932ad585-0e45-4a57-aa23-4cf81beeb7b0 - - UIImgBtnTearOffActiveUUID - - Comment - - Persist - 0 - Type - String - Value - 74e1a96f-4833-a24d-a1bb-1bce1468b0e7 - - UIImgBtnTearOffInactiveUUID - - Comment - - Persist - 0 - Type - String - Value - 74e1a96f-4833-a24d-a1bb-1bce1468b0e7 - - UIImgBtnTearOffPressedUUID - - Comment - - Persist - 0 - Type - String - Value - d2524c13-4ba6-af7c-e305-8ac6cc18d86a - - UIImgCheckboxActiveSelectedUUID - - Comment - - Persist - 0 - Type - String - Value - cf4a2ed7-1533-4686-9dde-df9a37ddca55 - - UIImgCheckboxActiveUUID - - Comment - - Persist - 0 - Type - String - Value - 05bb64ee-96fd-4243-b74e-f40a41bc53ba - - UIImgCheckboxInactiveSelectedUUID - - Comment - - Persist - 0 - Type - String - Value - c817c642-9abd-4236-9287-ae0513fe7d2b - - UIImgCheckboxInactiveUUID - - Comment - - Persist - 0 - Type - String - Value - 7d94cb59-32a2-49bf-a516-9e5a2045f9d9 - - UIImgCreateSelectedUUID - - Comment - - Persist - 0 - Type - String - Value - 0098b015-3daf-4cfe-a72f-915369ea97c2 - - UIImgCreateUUID - - Comment - - Persist - 0 - Type - String - Value - 7a0b1bdb-b5d9-4df5-bac2-ba230da93b5b - - UIImgCrosshairsUUID - - Comment - Image to use for crosshair display (UUID texture reference) - Persist - 1 - Type - String - Value - 6e1a3980-bf2d-4274-8970-91e60d85fb52 - UIImgDefaultEyesUUID Comment @@ -13419,28 +12759,6 @@ Value 5748decc-f629-461c-9a36-a35a221fe21f - UIImgDefaultAlphaUUID - - Comment - - Persist - 0 - Type - String - Value - 5748decc-f629-461c-9a36-a35a221fe21f - - UIImgDefaultAlphaUUID - - Comment - - Persist - 0 - Type - String - Value - 5748decc-f629-461c-9a36-a35a221fe21f - UIImgDefaultUnderwearUUID Comment @@ -13452,204 +12770,6 @@ Value 5748decc-f629-461c-9a36-a35a221fe21f - UIImgDirectionArrowUUID - - Comment - - Persist - 0 - Type - String - Value - 586383e8-4d9b-4fba-9196-2b5938e79c2c - - UIImgFaceSelectedUUID - - Comment - - Persist - 0 - Type - String - Value - b4870163-6208-42a9-9801-93133bf9a6cd - - UIImgFaceUUID - - Comment - - Persist - 0 - Type - String - Value - ce15fd63-b0b6-463c-a37d-ea6393208b3e - - UIImgFocusSelectedUUID - - Comment - - Persist - 0 - Type - String - Value - ab6a730e-ddfd-4982-9a32-c6de3de6d31d - - UIImgFocusUUID - - Comment - - Persist - 0 - Type - String - Value - 57bc39d1-288c-4519-aea6-6d1786a5c274 - - UIImgGrabSelectedUUID - - Comment - - Persist - 0 - Type - String - Value - c1e21504-f136-451d-b8e9-929037812f1d - - UIImgGrabUUID - - Comment - - Persist - 0 - Type - String - Value - c63f124c-6340-4fbf-b59e-0869a44adb64 - - UIImgMoveSelectedUUID - - Comment - - Persist - 0 - Type - String - Value - 46f17c7b-8381-48c3-b628-6a406e060dd6 - - UIImgMoveUUID - - Comment - - Persist - 0 - Type - String - Value - 2fa5dc06-bcdd-4e09-a426-f9f262d4fa65 - - UIImgRadioActiveSelectedUUID - - Comment - - Persist - 0 - Type - String - Value - 52f09e07-5816-4052-953c-94c6c10479b7 - - UIImgRadioActiveUUID - - Comment - - Persist - 0 - Type - String - Value - 7a1ba9b8-1047-4d1e-9cfc-bc478c80b63f - - UIImgRadioInactiveSelectedUUID - - Comment - - Persist - 0 - Type - String - Value - 1975db39-aa29-4251-aea0-409ac09d414d - - UIImgRadioInactiveUUID - - Comment - - Persist - 0 - Type - String - Value - 90688481-67ff-4af0-be69-4aa084bcad1e - - UIImgResizeBottomRightUUID - - Comment - - Persist - 0 - Type - String - Value - e3690e25-9690-4f6c-a745-e7dcd885285a - - UIImgRotateSelectedUUID - - Comment - - Persist - 0 - Type - String - Value - cdfb7fde-0d13-418a-9d89-2bd91019fc95 - - UIImgRotateUUID - - Comment - - Persist - 0 - Type - String - Value - c34b1eaa-aae3-4351-b082-e26c0b636779 - - UIImgScaleSelectedUUID - - Comment - - Persist - 0 - Type - String - Value - 55aa57ef-508a-47f7-8867-85d21c5a810d - - UIImgScaleUUID - - Comment - - Persist - 0 - Type - String - Value - 88a90fef-b448-4883-9344-ecf378a60433 - UIImgWhiteUUID Comment From aa526e031408163e94e3d7ba53c984e45cd735a3 Mon Sep 17 00:00:00 2001 From: Shyotl Date: Wed, 13 Jul 2011 04:27:01 -0500 Subject: [PATCH 11/33] Texture cache update. World-texures moved to local_assets directory. Removed many old unused ui textures. --- indra/newview/lltexturecache.cpp | 36 +++++++++++++----- .../0187babf-6c0d-5891-ebed-4ecab1426683.j2c | Bin .../058c75c0-a0d5-f2f8-43f3-e9699a89c2fc.j2c | Bin .../073c9723-540c-5449-cdd4-0e87fdc159e3.j2c | Bin .../0b444c3a-75c2-4891-9d1e-ac35c8d13d62.j2c | Bin .../0bc58228-74a0-7e83-89bc-5c23464bcec5.j2c | Bin .../0ff70ead-4562-45f9-9e8a-52b1a3286868.j2c | Bin .../10d2a01a-0818-84b9-4b96-c2eb63256519.j2c | Bin .../179cdabd-398a-9b6b-1391-4dc333ba321f.j2c | Bin .../18fb888b-e8f1-dce7-7da7-321d651ea6b0.j2c | Bin .../19c76b49-c5f4-aeca-7cd8-17010f2969c3.j2c | Bin .../1e63e323-5fe0-452e-92f8-b98bd0f764e3.j2c | Bin .../2660b114-1d66-3cde-e148-ebc2d1f963d5.j2c | Bin .../28f0f9ca-0423-4d1b-9e76-616ffce99544.j2c | Bin .../2a4880b6-b7a3-690a-2049-bfbe38eafb9f.j2c | Bin .../2caf1179-7861-6ff3-4b7d-46e17780bdfa.j2c | Bin .../2d784476-d0db-9979-0cff-9408745a7cf3.j2c | Bin .../30047cec-269d-408e-0c30-b2603b887268.j2c | Bin .../303cd381-8560-7579-23f1-f0a880799740.j2c | Bin .../335f8f14-f2db-db7c-1c04-734dc7657439.j2c | Bin .../35f217a3-f618-49cf-bbca-c86d486551a9.j2c | Bin .../3c59f7fe-9dc8-47f9-8aaf-a9dd1fbc3bef.j2c | Bin .../3cddf591-a726-4702-87b3-70c1daf88f90.j2c | Bin .../402f8b24-5f9d-4905-b5f8-37baff603e88.j2c | Bin .../4726f13e-bd07-f2fb-feb0-bfa2ac58ab61.j2c | Bin .../48766d75-6e58-de84-68fe-1980c64feaee.j2c | Bin .../53a2f406-4895-1d13-d541-d2e3b86bc19c.j2c | Bin .../5894e2e7-ab8d-edfa-e61c-18cf16854ba3.j2c | Bin .../5ab48dd5-05d0-4f1a-ace6-efd4e2fb3508.j2c | Bin .../5bc11cd6-2f40-071e-a8da-0903394204f9.j2c | Bin .../63338ede-0037-c4fd-855b-015d77112fc8.j2c | Bin .../64367bd1-697e-b3e6-0b65-3f862a577366.j2c | Bin .../6522e74d-1660-4e7f-b601-6f48c1659a77.j2c | Bin .../67931331-0c02-4876-1255-28770896c6a2.j2c | Bin .../6c4727b8-ac79-ba44-3b81-f9aa887b47eb.j2c | Bin .../6c9fa78a-1c69-2168-325b-3e03ffa348ce.j2c | Bin .../6de37e4e-7029-61f5-54b8-f5e63f983f58.j2c | Bin .../735198cf-6ea0-2550-e222-21d3c6a341ae.j2c | Bin .../7581f2f4-d0d2-481a-bc75-69a13d9caeaa.j2c | Bin .../78af921a-3c49-47a1-9c4e-2608951164ae.j2c | Bin .../79504bf5-c3ec-0763-6563-d843de66d0a1.j2c | Bin .../7a2b3a4a-53c2-53ac-5716-aac7d743c020.j2c | Bin .../7c0cf89b-44b1-1ce2-dd74-07102a98ac2a.j2c | Bin .../7ca39b4c-bd19-4699-aff7-f93fd03d3e7b.j2c | Bin .../7cb070bc-fc00-4527-9c4d-7f7e0c4191be.j2c | Bin .../822ded49-9a6c-f61c-cb89-6df54f42cdf4.j2c | Bin .../83b77fc6-10b4-63ec-4de7-f40629f238c5.j2c | Bin .../8872f2b8-31db-42d8-580a-b3e4a91262de.j2c | Bin .../8a515889-eac9-fb55-8eba-d2dc09eb32c8.j2c | Bin .../8f458549-173b-23ff-d4ff-bfaa5ea2371b.j2c | Bin .../92e66e00-f56f-598a-7997-048aa64cde18.j2c | Bin .../96b4de31-f4fa-337d-ec78-451e3609769e.j2c | Bin .../99bd60a2-3250-efc9-2e39-2fbcadefbecc.j2c | Bin .../9c88539c-fd04-46b8-bea2-ddf1bcffe3bd.j2c | Bin .../9deab416-9c63-78d6-d558-9a156f12044c.j2c | Bin .../a6162133-724b-54df-a12f-51cd070ad6f3.j2c | Bin .../a85ac674-cb75-4af6-9499-df7c5aaf7a28.j2c | Bin .../abb783e6-3e93-26c0-248a-247666855da3.j2c | Bin .../ae874d1a-93ef-54fb-5fd3-eb0cb156afc0.j2c | Bin .../b4ba225c-373f-446d-9f7e-6cb7b5cf9b3d.j2c | Bin .../b8d3965a-ad78-bf43-699b-bff8eca6c975.j2c | Bin .../b8eed5f0-64b7-6e12-b67f-43fa8e773440.j2c | Bin .../b9e1cf8a-9660-c020-0c69-18f1ea27268a.j2c | Bin .../b9f1a3b8-933e-b7c8-e6f5-dba1bc666bed.j2c | Bin .../beb169c7-11ea-fff2-efe5-0f24dc881df2.j2c | Bin .../c7d8bbf3-21ee-4f6e-9b20-3cf18425af1d.j2c | Bin .../ca4e8c27-473c-eb1c-2f5d-50ee3f07d85c.j2c | Bin .../cce0f112-878f-4586-a2e2-a8f104bba271.j2c | Bin .../cdd9a9fc-6d0b-f90d-8416-c72b6019bca8.j2c | Bin .../d07f6eed-b96a-47cd-b51d-400ad4a1c428.j2c | Bin .../d2114404-dd59-4a4d-8e6c-49359e91bbf0.j2c | Bin .../d21e44ca-ff1c-a96e-b2ef-c0753426b7d9.j2c | Bin .../d319ce44-0821-932a-cd18-cd1afb9d3ead.j2c | Bin .../d691a01c-13b7-578d-57c0-5caef0b4e7e1.j2c | Bin .../d7d99e40-10e2-5739-d063-91dcbdefc492.j2c | Bin .../d9258671-868f-7511-c321-7baef9e948a4.j2c | Bin .../db9d39ec-a896-c287-1ced-64566217021e.j2c | Bin .../e121e2fc-7573-740f-edfd-0d45a9ba486e.j2c | Bin .../e38248f9-f2ee-2c9f-aa49-4860857e3b08.j2c | Bin .../e569711a-27c2-aad4-9246-0c910239a179.j2c | Bin .../f2d7b6f6-4200-1e9a-fd5b-96459e950f94.j2c | Bin .../f4b6b161-6530-6679-1a84-adfcb71a8b12.j2c | Bin .../fb1fecba-9585-415b-ad15-6e6e3d6c5479.j2c | Bin .../fb2ae204-3fd1-df33-594f-c9f882830e66.j2c | Bin .../fc987bf9-b8cb-f8e5-45f2-d664ca6bd3eb.j2c | Bin .../0498c309-5306-43cd-82a2-ae31d096cdef.tga | Bin 1068 -> 0 bytes .../07d0ea4c-af0c-aad1-dbbf-c24020ff2b80.tga | Bin 1068 -> 0 bytes .../09a324a8-acc1-d9cd-2cbd-7465d90d3a98.tga | Bin 4140 -> 0 bytes .../0a94b42f-ec84-5f9c-14b7-1ef8505ceead.j2c | Bin 169 -> 0 bytes .../0e82d24e-ed45-41bc-b090-94c97c1caab2.tga | Bin 1068 -> 0 bytes .../111b39de-8928-4690-b7b2-e17d5c960277.tga | Bin 1068 -> 0 bytes .../11ee27f5-43c0-414e-afd5-d7f5688c351f.j2c | Bin 184 -> 0 bytes .../13dd1d96-6836-461e-8a4c-36003065c59b.tga | Bin 1068 -> 0 bytes .../34c9398d-bb78-4643-9633-46a2fa3e9637.tga | Bin 1068 -> 0 bytes .../37c8e000-6aa2-41ef-8f86-e0c2e60bfa42.tga | Bin 1042 -> 0 bytes .../39801651-26cb-4926-af57-7af9352c273c.tga | Bin 1068 -> 0 bytes .../43f0a590-f3d3-48b5-b460-f5b3e6e03626.tga | Bin 1042 -> 0 bytes .../47a8c844-cd2a-4b1a-be01-df8b1612fe5d.tga | Bin 1068 -> 0 bytes .../5abfabc2-5d6d-4912-acd8-d7e38ae93d02.j2c | Bin 172 -> 0 bytes .../6002a571-549c-472c-9443-9ab35b1a55ed.tga | Bin 6162 -> 0 bytes .../64eed6af-f575-35c7-baa4-b140bdcdb00f.j2c | Bin 172 -> 0 bytes .../73577b7b-19c3-4050-a19d-36bc2408aa79.tga | Bin 1068 -> 0 bytes .../74ba3584-58ea-9984-5b76-62d37942ab77.tga | Bin 4140 -> 0 bytes .../74e1a96f-4833-a24d-a1bb-1bce1468b0e7.tga | Bin 1068 -> 0 bytes .../827ff765-8c1d-a8b1-23f7-fdcba560effc.j2c | Bin 212 -> 0 bytes .../89e9fc7c-0b16-457d-be4f-136270759c4d.tga | Bin 4140 -> 0 bytes .../8dcd4a48-2d37-4909-9f78-f7a9eb4ef903.j2c | Bin 172 -> 0 bytes .../8f761ce3-5939-4d3a-8991-00064fdfacf9.tga | Bin 1068 -> 0 bytes .../95281d5c-d27a-ee13-e067-08295b67b58a.j2c | Bin 169 -> 0 bytes .../978380f0-aaf7-c459-14e3-9808833fd372.j2c | Bin 172 -> 0 bytes .../988dd995-1769-bdc9-8842-51f8f2b03884.j2c | Bin 169 -> 0 bytes .../9beb8cdd-3dce-53c2-b28e-e1f3bc2ec0a4.tga | Bin 1068 -> 0 bytes .../b2ef2d31-9714-a07b-6ca7-31638166364b.tga | Bin 4140 -> 0 bytes .../ca7609c6-6ec6-32d9-332e-0d8f437ef644.tga | Bin 1068 -> 0 bytes .../de651394-f926-48db-b666-e49d83af1bbc.j2c | Bin 1063 -> 0 bytes .../e3369e02-93e1-43dc-b9c0-4533db0963d0.tga | Bin 1068 -> 0 bytes .../e674ca0c-a387-4dae-a0b4-db6bd073faa5.j2c | Bin 524 -> 0 bytes .../e97cf410-8e61-7005-ec06-629eba4cd1fb.tga | Bin 300 -> 0 bytes .../ebf2aa19-6c34-c5d8-4f14-853da1241f91.j2c | Bin 339 -> 0 bytes .../f54a0c32-3cd1-d49a-5b4f-7b792bebc204.j2c | Bin 169 -> 0 bytes .../f9bbb2fe-584b-4c01-86fc-599c69534c1b.tga | Bin 1068 -> 0 bytes 121 files changed, 26 insertions(+), 10 deletions(-) rename indra/newview/{skins/default/textures => local_assets}/0187babf-6c0d-5891-ebed-4ecab1426683.j2c (100%) rename indra/newview/{skins/default/textures => local_assets}/058c75c0-a0d5-f2f8-43f3-e9699a89c2fc.j2c (100%) rename indra/newview/{skins/default/textures => local_assets}/073c9723-540c-5449-cdd4-0e87fdc159e3.j2c (100%) rename indra/newview/{skins/default/textures => local_assets}/0b444c3a-75c2-4891-9d1e-ac35c8d13d62.j2c (100%) rename indra/newview/{skins/default/textures => local_assets}/0bc58228-74a0-7e83-89bc-5c23464bcec5.j2c (100%) rename indra/newview/{skins/default/textures => local_assets}/0ff70ead-4562-45f9-9e8a-52b1a3286868.j2c (100%) rename indra/newview/{skins/default/textures => local_assets}/10d2a01a-0818-84b9-4b96-c2eb63256519.j2c (100%) rename indra/newview/{skins/default/textures => local_assets}/179cdabd-398a-9b6b-1391-4dc333ba321f.j2c (100%) rename indra/newview/{skins/default/textures => local_assets}/18fb888b-e8f1-dce7-7da7-321d651ea6b0.j2c (100%) rename indra/newview/{skins/default/textures => local_assets}/19c76b49-c5f4-aeca-7cd8-17010f2969c3.j2c (100%) rename indra/newview/{skins/default/textures => local_assets}/1e63e323-5fe0-452e-92f8-b98bd0f764e3.j2c (100%) rename indra/newview/{skins/default/textures => local_assets}/2660b114-1d66-3cde-e148-ebc2d1f963d5.j2c (100%) rename indra/newview/{skins/default/textures => local_assets}/28f0f9ca-0423-4d1b-9e76-616ffce99544.j2c (100%) rename indra/newview/{skins/default/textures => local_assets}/2a4880b6-b7a3-690a-2049-bfbe38eafb9f.j2c (100%) rename indra/newview/{skins/default/textures => local_assets}/2caf1179-7861-6ff3-4b7d-46e17780bdfa.j2c (100%) rename indra/newview/{skins/default/textures => local_assets}/2d784476-d0db-9979-0cff-9408745a7cf3.j2c (100%) rename indra/newview/{skins/default/textures => local_assets}/30047cec-269d-408e-0c30-b2603b887268.j2c (100%) rename indra/newview/{skins/default/textures => local_assets}/303cd381-8560-7579-23f1-f0a880799740.j2c (100%) rename indra/newview/{skins/default/textures => local_assets}/335f8f14-f2db-db7c-1c04-734dc7657439.j2c (100%) rename indra/newview/{skins/default/textures => local_assets}/35f217a3-f618-49cf-bbca-c86d486551a9.j2c (100%) rename indra/newview/{skins/default/textures => local_assets}/3c59f7fe-9dc8-47f9-8aaf-a9dd1fbc3bef.j2c (100%) rename indra/newview/{skins/default/textures => local_assets}/3cddf591-a726-4702-87b3-70c1daf88f90.j2c (100%) rename indra/newview/{skins/default/textures => local_assets}/402f8b24-5f9d-4905-b5f8-37baff603e88.j2c (100%) rename indra/newview/{skins/default/textures => local_assets}/4726f13e-bd07-f2fb-feb0-bfa2ac58ab61.j2c (100%) rename indra/newview/{skins/default/textures => local_assets}/48766d75-6e58-de84-68fe-1980c64feaee.j2c (100%) rename indra/newview/{skins/default/textures => local_assets}/53a2f406-4895-1d13-d541-d2e3b86bc19c.j2c (100%) rename indra/newview/{skins/default/textures => local_assets}/5894e2e7-ab8d-edfa-e61c-18cf16854ba3.j2c (100%) rename indra/newview/{skins/default/textures => local_assets}/5ab48dd5-05d0-4f1a-ace6-efd4e2fb3508.j2c (100%) rename indra/newview/{skins/default/textures => local_assets}/5bc11cd6-2f40-071e-a8da-0903394204f9.j2c (100%) rename indra/newview/{skins/default/textures => local_assets}/63338ede-0037-c4fd-855b-015d77112fc8.j2c (100%) rename indra/newview/{skins/default/textures => local_assets}/64367bd1-697e-b3e6-0b65-3f862a577366.j2c (100%) rename indra/newview/{skins/default/textures => local_assets}/6522e74d-1660-4e7f-b601-6f48c1659a77.j2c (100%) rename indra/newview/{skins/default/textures => local_assets}/67931331-0c02-4876-1255-28770896c6a2.j2c (100%) rename indra/newview/{skins/default/textures => local_assets}/6c4727b8-ac79-ba44-3b81-f9aa887b47eb.j2c (100%) rename indra/newview/{skins/default/textures => local_assets}/6c9fa78a-1c69-2168-325b-3e03ffa348ce.j2c (100%) rename indra/newview/{skins/default/textures => local_assets}/6de37e4e-7029-61f5-54b8-f5e63f983f58.j2c (100%) rename indra/newview/{skins/default/textures => local_assets}/735198cf-6ea0-2550-e222-21d3c6a341ae.j2c (100%) rename indra/newview/{skins/default/textures => local_assets}/7581f2f4-d0d2-481a-bc75-69a13d9caeaa.j2c (100%) rename indra/newview/{skins/default/textures => local_assets}/78af921a-3c49-47a1-9c4e-2608951164ae.j2c (100%) rename indra/newview/{skins/default/textures => local_assets}/79504bf5-c3ec-0763-6563-d843de66d0a1.j2c (100%) rename indra/newview/{skins/default/textures => local_assets}/7a2b3a4a-53c2-53ac-5716-aac7d743c020.j2c (100%) rename indra/newview/{skins/default/textures => local_assets}/7c0cf89b-44b1-1ce2-dd74-07102a98ac2a.j2c (100%) rename indra/newview/{skins/default/textures => local_assets}/7ca39b4c-bd19-4699-aff7-f93fd03d3e7b.j2c (100%) rename indra/newview/{skins/default/textures => local_assets}/7cb070bc-fc00-4527-9c4d-7f7e0c4191be.j2c (100%) rename indra/newview/{skins/default/textures => local_assets}/822ded49-9a6c-f61c-cb89-6df54f42cdf4.j2c (100%) rename indra/newview/{skins/default/textures => local_assets}/83b77fc6-10b4-63ec-4de7-f40629f238c5.j2c (100%) rename indra/newview/{skins/default/textures => local_assets}/8872f2b8-31db-42d8-580a-b3e4a91262de.j2c (100%) rename indra/newview/{skins/default/textures => local_assets}/8a515889-eac9-fb55-8eba-d2dc09eb32c8.j2c (100%) rename indra/newview/{skins/default/textures => local_assets}/8f458549-173b-23ff-d4ff-bfaa5ea2371b.j2c (100%) rename indra/newview/{skins/default/textures => local_assets}/92e66e00-f56f-598a-7997-048aa64cde18.j2c (100%) rename indra/newview/{skins/default/textures => local_assets}/96b4de31-f4fa-337d-ec78-451e3609769e.j2c (100%) rename indra/newview/{skins/default/textures => local_assets}/99bd60a2-3250-efc9-2e39-2fbcadefbecc.j2c (100%) rename indra/newview/{skins/default/textures => local_assets}/9c88539c-fd04-46b8-bea2-ddf1bcffe3bd.j2c (100%) rename indra/newview/{skins/default/textures => local_assets}/9deab416-9c63-78d6-d558-9a156f12044c.j2c (100%) rename indra/newview/{skins/default/textures => local_assets}/a6162133-724b-54df-a12f-51cd070ad6f3.j2c (100%) rename indra/newview/{skins/default/textures => local_assets}/a85ac674-cb75-4af6-9499-df7c5aaf7a28.j2c (100%) rename indra/newview/{skins/default/textures => local_assets}/abb783e6-3e93-26c0-248a-247666855da3.j2c (100%) rename indra/newview/{skins/default/textures => local_assets}/ae874d1a-93ef-54fb-5fd3-eb0cb156afc0.j2c (100%) rename indra/newview/{skins/default/textures => local_assets}/b4ba225c-373f-446d-9f7e-6cb7b5cf9b3d.j2c (100%) rename indra/newview/{skins/default/textures => local_assets}/b8d3965a-ad78-bf43-699b-bff8eca6c975.j2c (100%) rename indra/newview/{skins/default/textures => local_assets}/b8eed5f0-64b7-6e12-b67f-43fa8e773440.j2c (100%) rename indra/newview/{skins/default/textures => local_assets}/b9e1cf8a-9660-c020-0c69-18f1ea27268a.j2c (100%) rename indra/newview/{skins/default/textures => local_assets}/b9f1a3b8-933e-b7c8-e6f5-dba1bc666bed.j2c (100%) rename indra/newview/{skins/default/textures => local_assets}/beb169c7-11ea-fff2-efe5-0f24dc881df2.j2c (100%) rename indra/newview/{skins/default/textures => local_assets}/c7d8bbf3-21ee-4f6e-9b20-3cf18425af1d.j2c (100%) rename indra/newview/{skins/default/textures => local_assets}/ca4e8c27-473c-eb1c-2f5d-50ee3f07d85c.j2c (100%) rename indra/newview/{skins/default/textures => local_assets}/cce0f112-878f-4586-a2e2-a8f104bba271.j2c (100%) rename indra/newview/{skins/default/textures => local_assets}/cdd9a9fc-6d0b-f90d-8416-c72b6019bca8.j2c (100%) rename indra/newview/{skins/default/textures => local_assets}/d07f6eed-b96a-47cd-b51d-400ad4a1c428.j2c (100%) rename indra/newview/{skins/default/textures => local_assets}/d2114404-dd59-4a4d-8e6c-49359e91bbf0.j2c (100%) rename indra/newview/{skins/default/textures => local_assets}/d21e44ca-ff1c-a96e-b2ef-c0753426b7d9.j2c (100%) rename indra/newview/{skins/default/textures => local_assets}/d319ce44-0821-932a-cd18-cd1afb9d3ead.j2c (100%) rename indra/newview/{skins/default/textures => local_assets}/d691a01c-13b7-578d-57c0-5caef0b4e7e1.j2c (100%) rename indra/newview/{skins/default/textures => local_assets}/d7d99e40-10e2-5739-d063-91dcbdefc492.j2c (100%) rename indra/newview/{skins/default/textures => local_assets}/d9258671-868f-7511-c321-7baef9e948a4.j2c (100%) rename indra/newview/{skins/default/textures => local_assets}/db9d39ec-a896-c287-1ced-64566217021e.j2c (100%) rename indra/newview/{skins/default/textures => local_assets}/e121e2fc-7573-740f-edfd-0d45a9ba486e.j2c (100%) rename indra/newview/{skins/default/textures => local_assets}/e38248f9-f2ee-2c9f-aa49-4860857e3b08.j2c (100%) rename indra/newview/{skins/default/textures => local_assets}/e569711a-27c2-aad4-9246-0c910239a179.j2c (100%) rename indra/newview/{skins/default/textures => local_assets}/f2d7b6f6-4200-1e9a-fd5b-96459e950f94.j2c (100%) rename indra/newview/{skins/default/textures => local_assets}/f4b6b161-6530-6679-1a84-adfcb71a8b12.j2c (100%) rename indra/newview/{skins/default/textures => local_assets}/fb1fecba-9585-415b-ad15-6e6e3d6c5479.j2c (100%) rename indra/newview/{skins/default/textures => local_assets}/fb2ae204-3fd1-df33-594f-c9f882830e66.j2c (100%) rename indra/newview/{skins/default/textures => local_assets}/fc987bf9-b8cb-f8e5-45f2-d664ca6bd3eb.j2c (100%) delete mode 100644 indra/newview/skins/default/textures/0498c309-5306-43cd-82a2-ae31d096cdef.tga delete mode 100644 indra/newview/skins/default/textures/07d0ea4c-af0c-aad1-dbbf-c24020ff2b80.tga delete mode 100644 indra/newview/skins/default/textures/09a324a8-acc1-d9cd-2cbd-7465d90d3a98.tga delete mode 100644 indra/newview/skins/default/textures/0a94b42f-ec84-5f9c-14b7-1ef8505ceead.j2c delete mode 100644 indra/newview/skins/default/textures/0e82d24e-ed45-41bc-b090-94c97c1caab2.tga delete mode 100644 indra/newview/skins/default/textures/111b39de-8928-4690-b7b2-e17d5c960277.tga delete mode 100644 indra/newview/skins/default/textures/11ee27f5-43c0-414e-afd5-d7f5688c351f.j2c delete mode 100644 indra/newview/skins/default/textures/13dd1d96-6836-461e-8a4c-36003065c59b.tga delete mode 100644 indra/newview/skins/default/textures/34c9398d-bb78-4643-9633-46a2fa3e9637.tga delete mode 100644 indra/newview/skins/default/textures/37c8e000-6aa2-41ef-8f86-e0c2e60bfa42.tga delete mode 100644 indra/newview/skins/default/textures/39801651-26cb-4926-af57-7af9352c273c.tga delete mode 100644 indra/newview/skins/default/textures/43f0a590-f3d3-48b5-b460-f5b3e6e03626.tga delete mode 100644 indra/newview/skins/default/textures/47a8c844-cd2a-4b1a-be01-df8b1612fe5d.tga delete mode 100644 indra/newview/skins/default/textures/5abfabc2-5d6d-4912-acd8-d7e38ae93d02.j2c delete mode 100644 indra/newview/skins/default/textures/6002a571-549c-472c-9443-9ab35b1a55ed.tga delete mode 100644 indra/newview/skins/default/textures/64eed6af-f575-35c7-baa4-b140bdcdb00f.j2c delete mode 100644 indra/newview/skins/default/textures/73577b7b-19c3-4050-a19d-36bc2408aa79.tga delete mode 100644 indra/newview/skins/default/textures/74ba3584-58ea-9984-5b76-62d37942ab77.tga delete mode 100644 indra/newview/skins/default/textures/74e1a96f-4833-a24d-a1bb-1bce1468b0e7.tga delete mode 100644 indra/newview/skins/default/textures/827ff765-8c1d-a8b1-23f7-fdcba560effc.j2c delete mode 100644 indra/newview/skins/default/textures/89e9fc7c-0b16-457d-be4f-136270759c4d.tga delete mode 100644 indra/newview/skins/default/textures/8dcd4a48-2d37-4909-9f78-f7a9eb4ef903.j2c delete mode 100644 indra/newview/skins/default/textures/8f761ce3-5939-4d3a-8991-00064fdfacf9.tga delete mode 100644 indra/newview/skins/default/textures/95281d5c-d27a-ee13-e067-08295b67b58a.j2c delete mode 100644 indra/newview/skins/default/textures/978380f0-aaf7-c459-14e3-9808833fd372.j2c delete mode 100644 indra/newview/skins/default/textures/988dd995-1769-bdc9-8842-51f8f2b03884.j2c delete mode 100644 indra/newview/skins/default/textures/9beb8cdd-3dce-53c2-b28e-e1f3bc2ec0a4.tga delete mode 100644 indra/newview/skins/default/textures/b2ef2d31-9714-a07b-6ca7-31638166364b.tga delete mode 100644 indra/newview/skins/default/textures/ca7609c6-6ec6-32d9-332e-0d8f437ef644.tga delete mode 100644 indra/newview/skins/default/textures/de651394-f926-48db-b666-e49d83af1bbc.j2c delete mode 100644 indra/newview/skins/default/textures/e3369e02-93e1-43dc-b9c0-4533db0963d0.tga delete mode 100644 indra/newview/skins/default/textures/e674ca0c-a387-4dae-a0b4-db6bd073faa5.j2c delete mode 100644 indra/newview/skins/default/textures/e97cf410-8e61-7005-ec06-629eba4cd1fb.tga delete mode 100644 indra/newview/skins/default/textures/ebf2aa19-6c34-c5d8-4f14-853da1241f91.j2c delete mode 100644 indra/newview/skins/default/textures/f54a0c32-3cd1-d49a-5b4f-7b792bebc204.j2c delete mode 100644 indra/newview/skins/default/textures/f9bbb2fe-584b-4c01-86fc-599c69534c1b.tga diff --git a/indra/newview/lltexturecache.cpp b/indra/newview/lltexturecache.cpp index e10880ecc..73583c769 100644 --- a/indra/newview/lltexturecache.cpp +++ b/indra/newview/lltexturecache.cpp @@ -53,7 +53,7 @@ //note: there is no good to define 1024 for TEXTURE_CACHE_ENTRY_SIZE while FIRST_PACKET_SIZE is 600 on sim side. const S32 TEXTURE_CACHE_ENTRY_SIZE = FIRST_PACKET_SIZE;//1024; -const S64 TEXTURE_PURGED_CACHE_SIZE = 80; // % amount of cache left after a purge. +const F32 TEXTURE_CACHE_PURGE_AMOUNT = .20f; // % amount to reduce the cache by when it exceeds its limit const F32 TEXTURE_CACHE_LRU_SIZE = .10f; // % amount for LRU list (low overhead to regenerate) class LLTextureCacheWorker : public LLWorkerClass @@ -250,9 +250,9 @@ bool LLTextureCacheLocalFileWorker::doRead() } } #else - if (!mDataSize || mDataSize > local_size - mOffset) + if (!mDataSize || mDataSize > local_size/* - mOffset*/) { - mDataSize = local_size - mOffset; + mDataSize = local_size/* - mOffset*/; } mReadData = new U8[mDataSize]; @@ -372,9 +372,9 @@ bool LLTextureCacheRemoteWorker::doRead() if (!done && (mState == LOCAL)) { llassert(local_size != 0); // we're assuming there is a non empty local file here... - if (!mDataSize || mDataSize > local_size - mOffset) + if (!mDataSize || mDataSize > local_size/* - mOffset*/) { - mDataSize = local_size - mOffset; + mDataSize = local_size/* - mOffset*/; } // Allocate read buffer mReadData = new U8[mDataSize]; @@ -817,7 +817,7 @@ std::string LLTextureCache::getLocalFileName(const LLUUID& id) // Does not include extension std::string idstr = id.asString(); // TODO: should we be storing cached textures in skin directory? - std::string filename = gDirUtilp->getExpandedFilename(LL_PATH_SKINS, "default", "textures", idstr); + std::string filename = gDirUtilp->getExpandedFilename(LL_PATH_LOCAL_ASSETS, idstr); return filename; } @@ -833,7 +833,9 @@ std::string LLTextureCache::getTextureFileName(const LLUUID& id) BOOL LLTextureCache::isInCache(const LLUUID& id) { LLMutexLock lock(&mHeaderMutex); - return (mHeaderIDMap.find(id) != mHeaderIDMap.end()); + id_map_t::const_iterator iter = mHeaderIDMap.find(id); + + return (iter != mHeaderIDMap.end()) ; } //debug @@ -1614,7 +1616,7 @@ void LLTextureCache::purgeTextures(bool validate) } S64 cache_size = mTexturesSizeTotal; - S64 purged_cache_size = (TEXTURE_PURGED_CACHE_SIZE * sCacheMaxTexturesSize) / (S64)100; + S64 purged_cache_size = (sCacheMaxTexturesSize * (S64)((1.f-TEXTURE_CACHE_PURGE_AMOUNT)*100)) / 100; S32 purge_count = 0; for (time_idx_set_t::iterator iter = time_idx_set.begin(); iter != time_idx_set.end(); ++iter) @@ -1952,8 +1954,22 @@ void LLTextureCache::removeCachedTexture(const LLUUID& id) //called after mHeaderMutex is locked. void LLTextureCache::removeEntry(S32 idx, Entry& entry, std::string& filename, bool remove_file) { - if (idx >= 0) //valid entry + bool file_maybe_exists = true; // Always attempt to remove when idx is invalid. + + if(idx >= 0) //valid entry + { + if (entry.mBodySize == 0) // Always attempt to remove when mBodySize > 0. { + if (LLAPRFile::isExist(filename)) // Sanity check. Shouldn't exist when body size is 0. + { + LL_WARNS("TextureCache") << "Entry has body size of zero but file " << filename << " exists. Deleting this file, too." << LL_ENDL; + } + else + { + file_maybe_exists = false; + } + } + entry.mImageSize = -1; entry.mBodySize = 0; mHeaderIDMap.erase(entry.mID); @@ -1963,7 +1979,7 @@ void LLTextureCache::removeEntry(S32 idx, Entry& entry, std::string& filename, b mFreeList.insert(idx); } - if (remove_file && LLAPRFile::isExist(filename)) + if (remove_file && file_maybe_exists) { LLAPRFile::remove(filename); } diff --git a/indra/newview/skins/default/textures/0187babf-6c0d-5891-ebed-4ecab1426683.j2c b/indra/newview/local_assets/0187babf-6c0d-5891-ebed-4ecab1426683.j2c similarity index 100% rename from indra/newview/skins/default/textures/0187babf-6c0d-5891-ebed-4ecab1426683.j2c rename to indra/newview/local_assets/0187babf-6c0d-5891-ebed-4ecab1426683.j2c diff --git a/indra/newview/skins/default/textures/058c75c0-a0d5-f2f8-43f3-e9699a89c2fc.j2c b/indra/newview/local_assets/058c75c0-a0d5-f2f8-43f3-e9699a89c2fc.j2c similarity index 100% rename from indra/newview/skins/default/textures/058c75c0-a0d5-f2f8-43f3-e9699a89c2fc.j2c rename to indra/newview/local_assets/058c75c0-a0d5-f2f8-43f3-e9699a89c2fc.j2c diff --git a/indra/newview/skins/default/textures/073c9723-540c-5449-cdd4-0e87fdc159e3.j2c b/indra/newview/local_assets/073c9723-540c-5449-cdd4-0e87fdc159e3.j2c similarity index 100% rename from indra/newview/skins/default/textures/073c9723-540c-5449-cdd4-0e87fdc159e3.j2c rename to indra/newview/local_assets/073c9723-540c-5449-cdd4-0e87fdc159e3.j2c diff --git a/indra/newview/skins/default/textures/0b444c3a-75c2-4891-9d1e-ac35c8d13d62.j2c b/indra/newview/local_assets/0b444c3a-75c2-4891-9d1e-ac35c8d13d62.j2c similarity index 100% rename from indra/newview/skins/default/textures/0b444c3a-75c2-4891-9d1e-ac35c8d13d62.j2c rename to indra/newview/local_assets/0b444c3a-75c2-4891-9d1e-ac35c8d13d62.j2c diff --git a/indra/newview/skins/default/textures/0bc58228-74a0-7e83-89bc-5c23464bcec5.j2c b/indra/newview/local_assets/0bc58228-74a0-7e83-89bc-5c23464bcec5.j2c similarity index 100% rename from indra/newview/skins/default/textures/0bc58228-74a0-7e83-89bc-5c23464bcec5.j2c rename to indra/newview/local_assets/0bc58228-74a0-7e83-89bc-5c23464bcec5.j2c diff --git a/indra/newview/skins/default/textures/0ff70ead-4562-45f9-9e8a-52b1a3286868.j2c b/indra/newview/local_assets/0ff70ead-4562-45f9-9e8a-52b1a3286868.j2c similarity index 100% rename from indra/newview/skins/default/textures/0ff70ead-4562-45f9-9e8a-52b1a3286868.j2c rename to indra/newview/local_assets/0ff70ead-4562-45f9-9e8a-52b1a3286868.j2c diff --git a/indra/newview/skins/default/textures/10d2a01a-0818-84b9-4b96-c2eb63256519.j2c b/indra/newview/local_assets/10d2a01a-0818-84b9-4b96-c2eb63256519.j2c similarity index 100% rename from indra/newview/skins/default/textures/10d2a01a-0818-84b9-4b96-c2eb63256519.j2c rename to indra/newview/local_assets/10d2a01a-0818-84b9-4b96-c2eb63256519.j2c diff --git a/indra/newview/skins/default/textures/179cdabd-398a-9b6b-1391-4dc333ba321f.j2c b/indra/newview/local_assets/179cdabd-398a-9b6b-1391-4dc333ba321f.j2c similarity index 100% rename from indra/newview/skins/default/textures/179cdabd-398a-9b6b-1391-4dc333ba321f.j2c rename to indra/newview/local_assets/179cdabd-398a-9b6b-1391-4dc333ba321f.j2c diff --git a/indra/newview/skins/default/textures/18fb888b-e8f1-dce7-7da7-321d651ea6b0.j2c b/indra/newview/local_assets/18fb888b-e8f1-dce7-7da7-321d651ea6b0.j2c similarity index 100% rename from indra/newview/skins/default/textures/18fb888b-e8f1-dce7-7da7-321d651ea6b0.j2c rename to indra/newview/local_assets/18fb888b-e8f1-dce7-7da7-321d651ea6b0.j2c diff --git a/indra/newview/skins/default/textures/19c76b49-c5f4-aeca-7cd8-17010f2969c3.j2c b/indra/newview/local_assets/19c76b49-c5f4-aeca-7cd8-17010f2969c3.j2c similarity index 100% rename from indra/newview/skins/default/textures/19c76b49-c5f4-aeca-7cd8-17010f2969c3.j2c rename to indra/newview/local_assets/19c76b49-c5f4-aeca-7cd8-17010f2969c3.j2c diff --git a/indra/newview/skins/default/textures/1e63e323-5fe0-452e-92f8-b98bd0f764e3.j2c b/indra/newview/local_assets/1e63e323-5fe0-452e-92f8-b98bd0f764e3.j2c similarity index 100% rename from indra/newview/skins/default/textures/1e63e323-5fe0-452e-92f8-b98bd0f764e3.j2c rename to indra/newview/local_assets/1e63e323-5fe0-452e-92f8-b98bd0f764e3.j2c diff --git a/indra/newview/skins/default/textures/2660b114-1d66-3cde-e148-ebc2d1f963d5.j2c b/indra/newview/local_assets/2660b114-1d66-3cde-e148-ebc2d1f963d5.j2c similarity index 100% rename from indra/newview/skins/default/textures/2660b114-1d66-3cde-e148-ebc2d1f963d5.j2c rename to indra/newview/local_assets/2660b114-1d66-3cde-e148-ebc2d1f963d5.j2c diff --git a/indra/newview/skins/default/textures/28f0f9ca-0423-4d1b-9e76-616ffce99544.j2c b/indra/newview/local_assets/28f0f9ca-0423-4d1b-9e76-616ffce99544.j2c similarity index 100% rename from indra/newview/skins/default/textures/28f0f9ca-0423-4d1b-9e76-616ffce99544.j2c rename to indra/newview/local_assets/28f0f9ca-0423-4d1b-9e76-616ffce99544.j2c diff --git a/indra/newview/skins/default/textures/2a4880b6-b7a3-690a-2049-bfbe38eafb9f.j2c b/indra/newview/local_assets/2a4880b6-b7a3-690a-2049-bfbe38eafb9f.j2c similarity index 100% rename from indra/newview/skins/default/textures/2a4880b6-b7a3-690a-2049-bfbe38eafb9f.j2c rename to indra/newview/local_assets/2a4880b6-b7a3-690a-2049-bfbe38eafb9f.j2c diff --git a/indra/newview/skins/default/textures/2caf1179-7861-6ff3-4b7d-46e17780bdfa.j2c b/indra/newview/local_assets/2caf1179-7861-6ff3-4b7d-46e17780bdfa.j2c similarity index 100% rename from indra/newview/skins/default/textures/2caf1179-7861-6ff3-4b7d-46e17780bdfa.j2c rename to indra/newview/local_assets/2caf1179-7861-6ff3-4b7d-46e17780bdfa.j2c diff --git a/indra/newview/skins/default/textures/2d784476-d0db-9979-0cff-9408745a7cf3.j2c b/indra/newview/local_assets/2d784476-d0db-9979-0cff-9408745a7cf3.j2c similarity index 100% rename from indra/newview/skins/default/textures/2d784476-d0db-9979-0cff-9408745a7cf3.j2c rename to indra/newview/local_assets/2d784476-d0db-9979-0cff-9408745a7cf3.j2c diff --git a/indra/newview/skins/default/textures/30047cec-269d-408e-0c30-b2603b887268.j2c b/indra/newview/local_assets/30047cec-269d-408e-0c30-b2603b887268.j2c similarity index 100% rename from indra/newview/skins/default/textures/30047cec-269d-408e-0c30-b2603b887268.j2c rename to indra/newview/local_assets/30047cec-269d-408e-0c30-b2603b887268.j2c diff --git a/indra/newview/skins/default/textures/303cd381-8560-7579-23f1-f0a880799740.j2c b/indra/newview/local_assets/303cd381-8560-7579-23f1-f0a880799740.j2c similarity index 100% rename from indra/newview/skins/default/textures/303cd381-8560-7579-23f1-f0a880799740.j2c rename to indra/newview/local_assets/303cd381-8560-7579-23f1-f0a880799740.j2c diff --git a/indra/newview/skins/default/textures/335f8f14-f2db-db7c-1c04-734dc7657439.j2c b/indra/newview/local_assets/335f8f14-f2db-db7c-1c04-734dc7657439.j2c similarity index 100% rename from indra/newview/skins/default/textures/335f8f14-f2db-db7c-1c04-734dc7657439.j2c rename to indra/newview/local_assets/335f8f14-f2db-db7c-1c04-734dc7657439.j2c diff --git a/indra/newview/skins/default/textures/35f217a3-f618-49cf-bbca-c86d486551a9.j2c b/indra/newview/local_assets/35f217a3-f618-49cf-bbca-c86d486551a9.j2c similarity index 100% rename from indra/newview/skins/default/textures/35f217a3-f618-49cf-bbca-c86d486551a9.j2c rename to indra/newview/local_assets/35f217a3-f618-49cf-bbca-c86d486551a9.j2c diff --git a/indra/newview/skins/default/textures/3c59f7fe-9dc8-47f9-8aaf-a9dd1fbc3bef.j2c b/indra/newview/local_assets/3c59f7fe-9dc8-47f9-8aaf-a9dd1fbc3bef.j2c similarity index 100% rename from indra/newview/skins/default/textures/3c59f7fe-9dc8-47f9-8aaf-a9dd1fbc3bef.j2c rename to indra/newview/local_assets/3c59f7fe-9dc8-47f9-8aaf-a9dd1fbc3bef.j2c diff --git a/indra/newview/skins/default/textures/3cddf591-a726-4702-87b3-70c1daf88f90.j2c b/indra/newview/local_assets/3cddf591-a726-4702-87b3-70c1daf88f90.j2c similarity index 100% rename from indra/newview/skins/default/textures/3cddf591-a726-4702-87b3-70c1daf88f90.j2c rename to indra/newview/local_assets/3cddf591-a726-4702-87b3-70c1daf88f90.j2c diff --git a/indra/newview/skins/default/textures/402f8b24-5f9d-4905-b5f8-37baff603e88.j2c b/indra/newview/local_assets/402f8b24-5f9d-4905-b5f8-37baff603e88.j2c similarity index 100% rename from indra/newview/skins/default/textures/402f8b24-5f9d-4905-b5f8-37baff603e88.j2c rename to indra/newview/local_assets/402f8b24-5f9d-4905-b5f8-37baff603e88.j2c diff --git a/indra/newview/skins/default/textures/4726f13e-bd07-f2fb-feb0-bfa2ac58ab61.j2c b/indra/newview/local_assets/4726f13e-bd07-f2fb-feb0-bfa2ac58ab61.j2c similarity index 100% rename from indra/newview/skins/default/textures/4726f13e-bd07-f2fb-feb0-bfa2ac58ab61.j2c rename to indra/newview/local_assets/4726f13e-bd07-f2fb-feb0-bfa2ac58ab61.j2c diff --git a/indra/newview/skins/default/textures/48766d75-6e58-de84-68fe-1980c64feaee.j2c b/indra/newview/local_assets/48766d75-6e58-de84-68fe-1980c64feaee.j2c similarity index 100% rename from indra/newview/skins/default/textures/48766d75-6e58-de84-68fe-1980c64feaee.j2c rename to indra/newview/local_assets/48766d75-6e58-de84-68fe-1980c64feaee.j2c diff --git a/indra/newview/skins/default/textures/53a2f406-4895-1d13-d541-d2e3b86bc19c.j2c b/indra/newview/local_assets/53a2f406-4895-1d13-d541-d2e3b86bc19c.j2c similarity index 100% rename from indra/newview/skins/default/textures/53a2f406-4895-1d13-d541-d2e3b86bc19c.j2c rename to indra/newview/local_assets/53a2f406-4895-1d13-d541-d2e3b86bc19c.j2c diff --git a/indra/newview/skins/default/textures/5894e2e7-ab8d-edfa-e61c-18cf16854ba3.j2c b/indra/newview/local_assets/5894e2e7-ab8d-edfa-e61c-18cf16854ba3.j2c similarity index 100% rename from indra/newview/skins/default/textures/5894e2e7-ab8d-edfa-e61c-18cf16854ba3.j2c rename to indra/newview/local_assets/5894e2e7-ab8d-edfa-e61c-18cf16854ba3.j2c diff --git a/indra/newview/skins/default/textures/5ab48dd5-05d0-4f1a-ace6-efd4e2fb3508.j2c b/indra/newview/local_assets/5ab48dd5-05d0-4f1a-ace6-efd4e2fb3508.j2c similarity index 100% rename from indra/newview/skins/default/textures/5ab48dd5-05d0-4f1a-ace6-efd4e2fb3508.j2c rename to indra/newview/local_assets/5ab48dd5-05d0-4f1a-ace6-efd4e2fb3508.j2c diff --git a/indra/newview/skins/default/textures/5bc11cd6-2f40-071e-a8da-0903394204f9.j2c b/indra/newview/local_assets/5bc11cd6-2f40-071e-a8da-0903394204f9.j2c similarity index 100% rename from indra/newview/skins/default/textures/5bc11cd6-2f40-071e-a8da-0903394204f9.j2c rename to indra/newview/local_assets/5bc11cd6-2f40-071e-a8da-0903394204f9.j2c diff --git a/indra/newview/skins/default/textures/63338ede-0037-c4fd-855b-015d77112fc8.j2c b/indra/newview/local_assets/63338ede-0037-c4fd-855b-015d77112fc8.j2c similarity index 100% rename from indra/newview/skins/default/textures/63338ede-0037-c4fd-855b-015d77112fc8.j2c rename to indra/newview/local_assets/63338ede-0037-c4fd-855b-015d77112fc8.j2c diff --git a/indra/newview/skins/default/textures/64367bd1-697e-b3e6-0b65-3f862a577366.j2c b/indra/newview/local_assets/64367bd1-697e-b3e6-0b65-3f862a577366.j2c similarity index 100% rename from indra/newview/skins/default/textures/64367bd1-697e-b3e6-0b65-3f862a577366.j2c rename to indra/newview/local_assets/64367bd1-697e-b3e6-0b65-3f862a577366.j2c diff --git a/indra/newview/skins/default/textures/6522e74d-1660-4e7f-b601-6f48c1659a77.j2c b/indra/newview/local_assets/6522e74d-1660-4e7f-b601-6f48c1659a77.j2c similarity index 100% rename from indra/newview/skins/default/textures/6522e74d-1660-4e7f-b601-6f48c1659a77.j2c rename to indra/newview/local_assets/6522e74d-1660-4e7f-b601-6f48c1659a77.j2c diff --git a/indra/newview/skins/default/textures/67931331-0c02-4876-1255-28770896c6a2.j2c b/indra/newview/local_assets/67931331-0c02-4876-1255-28770896c6a2.j2c similarity index 100% rename from indra/newview/skins/default/textures/67931331-0c02-4876-1255-28770896c6a2.j2c rename to indra/newview/local_assets/67931331-0c02-4876-1255-28770896c6a2.j2c diff --git a/indra/newview/skins/default/textures/6c4727b8-ac79-ba44-3b81-f9aa887b47eb.j2c b/indra/newview/local_assets/6c4727b8-ac79-ba44-3b81-f9aa887b47eb.j2c similarity index 100% rename from indra/newview/skins/default/textures/6c4727b8-ac79-ba44-3b81-f9aa887b47eb.j2c rename to indra/newview/local_assets/6c4727b8-ac79-ba44-3b81-f9aa887b47eb.j2c diff --git a/indra/newview/skins/default/textures/6c9fa78a-1c69-2168-325b-3e03ffa348ce.j2c b/indra/newview/local_assets/6c9fa78a-1c69-2168-325b-3e03ffa348ce.j2c similarity index 100% rename from indra/newview/skins/default/textures/6c9fa78a-1c69-2168-325b-3e03ffa348ce.j2c rename to indra/newview/local_assets/6c9fa78a-1c69-2168-325b-3e03ffa348ce.j2c diff --git a/indra/newview/skins/default/textures/6de37e4e-7029-61f5-54b8-f5e63f983f58.j2c b/indra/newview/local_assets/6de37e4e-7029-61f5-54b8-f5e63f983f58.j2c similarity index 100% rename from indra/newview/skins/default/textures/6de37e4e-7029-61f5-54b8-f5e63f983f58.j2c rename to indra/newview/local_assets/6de37e4e-7029-61f5-54b8-f5e63f983f58.j2c diff --git a/indra/newview/skins/default/textures/735198cf-6ea0-2550-e222-21d3c6a341ae.j2c b/indra/newview/local_assets/735198cf-6ea0-2550-e222-21d3c6a341ae.j2c similarity index 100% rename from indra/newview/skins/default/textures/735198cf-6ea0-2550-e222-21d3c6a341ae.j2c rename to indra/newview/local_assets/735198cf-6ea0-2550-e222-21d3c6a341ae.j2c diff --git a/indra/newview/skins/default/textures/7581f2f4-d0d2-481a-bc75-69a13d9caeaa.j2c b/indra/newview/local_assets/7581f2f4-d0d2-481a-bc75-69a13d9caeaa.j2c similarity index 100% rename from indra/newview/skins/default/textures/7581f2f4-d0d2-481a-bc75-69a13d9caeaa.j2c rename to indra/newview/local_assets/7581f2f4-d0d2-481a-bc75-69a13d9caeaa.j2c diff --git a/indra/newview/skins/default/textures/78af921a-3c49-47a1-9c4e-2608951164ae.j2c b/indra/newview/local_assets/78af921a-3c49-47a1-9c4e-2608951164ae.j2c similarity index 100% rename from indra/newview/skins/default/textures/78af921a-3c49-47a1-9c4e-2608951164ae.j2c rename to indra/newview/local_assets/78af921a-3c49-47a1-9c4e-2608951164ae.j2c diff --git a/indra/newview/skins/default/textures/79504bf5-c3ec-0763-6563-d843de66d0a1.j2c b/indra/newview/local_assets/79504bf5-c3ec-0763-6563-d843de66d0a1.j2c similarity index 100% rename from indra/newview/skins/default/textures/79504bf5-c3ec-0763-6563-d843de66d0a1.j2c rename to indra/newview/local_assets/79504bf5-c3ec-0763-6563-d843de66d0a1.j2c diff --git a/indra/newview/skins/default/textures/7a2b3a4a-53c2-53ac-5716-aac7d743c020.j2c b/indra/newview/local_assets/7a2b3a4a-53c2-53ac-5716-aac7d743c020.j2c similarity index 100% rename from indra/newview/skins/default/textures/7a2b3a4a-53c2-53ac-5716-aac7d743c020.j2c rename to indra/newview/local_assets/7a2b3a4a-53c2-53ac-5716-aac7d743c020.j2c diff --git a/indra/newview/skins/default/textures/7c0cf89b-44b1-1ce2-dd74-07102a98ac2a.j2c b/indra/newview/local_assets/7c0cf89b-44b1-1ce2-dd74-07102a98ac2a.j2c similarity index 100% rename from indra/newview/skins/default/textures/7c0cf89b-44b1-1ce2-dd74-07102a98ac2a.j2c rename to indra/newview/local_assets/7c0cf89b-44b1-1ce2-dd74-07102a98ac2a.j2c diff --git a/indra/newview/skins/default/textures/7ca39b4c-bd19-4699-aff7-f93fd03d3e7b.j2c b/indra/newview/local_assets/7ca39b4c-bd19-4699-aff7-f93fd03d3e7b.j2c similarity index 100% rename from indra/newview/skins/default/textures/7ca39b4c-bd19-4699-aff7-f93fd03d3e7b.j2c rename to indra/newview/local_assets/7ca39b4c-bd19-4699-aff7-f93fd03d3e7b.j2c diff --git a/indra/newview/skins/default/textures/7cb070bc-fc00-4527-9c4d-7f7e0c4191be.j2c b/indra/newview/local_assets/7cb070bc-fc00-4527-9c4d-7f7e0c4191be.j2c similarity index 100% rename from indra/newview/skins/default/textures/7cb070bc-fc00-4527-9c4d-7f7e0c4191be.j2c rename to indra/newview/local_assets/7cb070bc-fc00-4527-9c4d-7f7e0c4191be.j2c diff --git a/indra/newview/skins/default/textures/822ded49-9a6c-f61c-cb89-6df54f42cdf4.j2c b/indra/newview/local_assets/822ded49-9a6c-f61c-cb89-6df54f42cdf4.j2c similarity index 100% rename from indra/newview/skins/default/textures/822ded49-9a6c-f61c-cb89-6df54f42cdf4.j2c rename to indra/newview/local_assets/822ded49-9a6c-f61c-cb89-6df54f42cdf4.j2c diff --git a/indra/newview/skins/default/textures/83b77fc6-10b4-63ec-4de7-f40629f238c5.j2c b/indra/newview/local_assets/83b77fc6-10b4-63ec-4de7-f40629f238c5.j2c similarity index 100% rename from indra/newview/skins/default/textures/83b77fc6-10b4-63ec-4de7-f40629f238c5.j2c rename to indra/newview/local_assets/83b77fc6-10b4-63ec-4de7-f40629f238c5.j2c diff --git a/indra/newview/skins/default/textures/8872f2b8-31db-42d8-580a-b3e4a91262de.j2c b/indra/newview/local_assets/8872f2b8-31db-42d8-580a-b3e4a91262de.j2c similarity index 100% rename from indra/newview/skins/default/textures/8872f2b8-31db-42d8-580a-b3e4a91262de.j2c rename to indra/newview/local_assets/8872f2b8-31db-42d8-580a-b3e4a91262de.j2c diff --git a/indra/newview/skins/default/textures/8a515889-eac9-fb55-8eba-d2dc09eb32c8.j2c b/indra/newview/local_assets/8a515889-eac9-fb55-8eba-d2dc09eb32c8.j2c similarity index 100% rename from indra/newview/skins/default/textures/8a515889-eac9-fb55-8eba-d2dc09eb32c8.j2c rename to indra/newview/local_assets/8a515889-eac9-fb55-8eba-d2dc09eb32c8.j2c diff --git a/indra/newview/skins/default/textures/8f458549-173b-23ff-d4ff-bfaa5ea2371b.j2c b/indra/newview/local_assets/8f458549-173b-23ff-d4ff-bfaa5ea2371b.j2c similarity index 100% rename from indra/newview/skins/default/textures/8f458549-173b-23ff-d4ff-bfaa5ea2371b.j2c rename to indra/newview/local_assets/8f458549-173b-23ff-d4ff-bfaa5ea2371b.j2c diff --git a/indra/newview/skins/default/textures/92e66e00-f56f-598a-7997-048aa64cde18.j2c b/indra/newview/local_assets/92e66e00-f56f-598a-7997-048aa64cde18.j2c similarity index 100% rename from indra/newview/skins/default/textures/92e66e00-f56f-598a-7997-048aa64cde18.j2c rename to indra/newview/local_assets/92e66e00-f56f-598a-7997-048aa64cde18.j2c diff --git a/indra/newview/skins/default/textures/96b4de31-f4fa-337d-ec78-451e3609769e.j2c b/indra/newview/local_assets/96b4de31-f4fa-337d-ec78-451e3609769e.j2c similarity index 100% rename from indra/newview/skins/default/textures/96b4de31-f4fa-337d-ec78-451e3609769e.j2c rename to indra/newview/local_assets/96b4de31-f4fa-337d-ec78-451e3609769e.j2c diff --git a/indra/newview/skins/default/textures/99bd60a2-3250-efc9-2e39-2fbcadefbecc.j2c b/indra/newview/local_assets/99bd60a2-3250-efc9-2e39-2fbcadefbecc.j2c similarity index 100% rename from indra/newview/skins/default/textures/99bd60a2-3250-efc9-2e39-2fbcadefbecc.j2c rename to indra/newview/local_assets/99bd60a2-3250-efc9-2e39-2fbcadefbecc.j2c diff --git a/indra/newview/skins/default/textures/9c88539c-fd04-46b8-bea2-ddf1bcffe3bd.j2c b/indra/newview/local_assets/9c88539c-fd04-46b8-bea2-ddf1bcffe3bd.j2c similarity index 100% rename from indra/newview/skins/default/textures/9c88539c-fd04-46b8-bea2-ddf1bcffe3bd.j2c rename to indra/newview/local_assets/9c88539c-fd04-46b8-bea2-ddf1bcffe3bd.j2c diff --git a/indra/newview/skins/default/textures/9deab416-9c63-78d6-d558-9a156f12044c.j2c b/indra/newview/local_assets/9deab416-9c63-78d6-d558-9a156f12044c.j2c similarity index 100% rename from indra/newview/skins/default/textures/9deab416-9c63-78d6-d558-9a156f12044c.j2c rename to indra/newview/local_assets/9deab416-9c63-78d6-d558-9a156f12044c.j2c diff --git a/indra/newview/skins/default/textures/a6162133-724b-54df-a12f-51cd070ad6f3.j2c b/indra/newview/local_assets/a6162133-724b-54df-a12f-51cd070ad6f3.j2c similarity index 100% rename from indra/newview/skins/default/textures/a6162133-724b-54df-a12f-51cd070ad6f3.j2c rename to indra/newview/local_assets/a6162133-724b-54df-a12f-51cd070ad6f3.j2c diff --git a/indra/newview/skins/default/textures/a85ac674-cb75-4af6-9499-df7c5aaf7a28.j2c b/indra/newview/local_assets/a85ac674-cb75-4af6-9499-df7c5aaf7a28.j2c similarity index 100% rename from indra/newview/skins/default/textures/a85ac674-cb75-4af6-9499-df7c5aaf7a28.j2c rename to indra/newview/local_assets/a85ac674-cb75-4af6-9499-df7c5aaf7a28.j2c diff --git a/indra/newview/skins/default/textures/abb783e6-3e93-26c0-248a-247666855da3.j2c b/indra/newview/local_assets/abb783e6-3e93-26c0-248a-247666855da3.j2c similarity index 100% rename from indra/newview/skins/default/textures/abb783e6-3e93-26c0-248a-247666855da3.j2c rename to indra/newview/local_assets/abb783e6-3e93-26c0-248a-247666855da3.j2c diff --git a/indra/newview/skins/default/textures/ae874d1a-93ef-54fb-5fd3-eb0cb156afc0.j2c b/indra/newview/local_assets/ae874d1a-93ef-54fb-5fd3-eb0cb156afc0.j2c similarity index 100% rename from indra/newview/skins/default/textures/ae874d1a-93ef-54fb-5fd3-eb0cb156afc0.j2c rename to indra/newview/local_assets/ae874d1a-93ef-54fb-5fd3-eb0cb156afc0.j2c diff --git a/indra/newview/skins/default/textures/b4ba225c-373f-446d-9f7e-6cb7b5cf9b3d.j2c b/indra/newview/local_assets/b4ba225c-373f-446d-9f7e-6cb7b5cf9b3d.j2c similarity index 100% rename from indra/newview/skins/default/textures/b4ba225c-373f-446d-9f7e-6cb7b5cf9b3d.j2c rename to indra/newview/local_assets/b4ba225c-373f-446d-9f7e-6cb7b5cf9b3d.j2c diff --git a/indra/newview/skins/default/textures/b8d3965a-ad78-bf43-699b-bff8eca6c975.j2c b/indra/newview/local_assets/b8d3965a-ad78-bf43-699b-bff8eca6c975.j2c similarity index 100% rename from indra/newview/skins/default/textures/b8d3965a-ad78-bf43-699b-bff8eca6c975.j2c rename to indra/newview/local_assets/b8d3965a-ad78-bf43-699b-bff8eca6c975.j2c diff --git a/indra/newview/skins/default/textures/b8eed5f0-64b7-6e12-b67f-43fa8e773440.j2c b/indra/newview/local_assets/b8eed5f0-64b7-6e12-b67f-43fa8e773440.j2c similarity index 100% rename from indra/newview/skins/default/textures/b8eed5f0-64b7-6e12-b67f-43fa8e773440.j2c rename to indra/newview/local_assets/b8eed5f0-64b7-6e12-b67f-43fa8e773440.j2c diff --git a/indra/newview/skins/default/textures/b9e1cf8a-9660-c020-0c69-18f1ea27268a.j2c b/indra/newview/local_assets/b9e1cf8a-9660-c020-0c69-18f1ea27268a.j2c similarity index 100% rename from indra/newview/skins/default/textures/b9e1cf8a-9660-c020-0c69-18f1ea27268a.j2c rename to indra/newview/local_assets/b9e1cf8a-9660-c020-0c69-18f1ea27268a.j2c diff --git a/indra/newview/skins/default/textures/b9f1a3b8-933e-b7c8-e6f5-dba1bc666bed.j2c b/indra/newview/local_assets/b9f1a3b8-933e-b7c8-e6f5-dba1bc666bed.j2c similarity index 100% rename from indra/newview/skins/default/textures/b9f1a3b8-933e-b7c8-e6f5-dba1bc666bed.j2c rename to indra/newview/local_assets/b9f1a3b8-933e-b7c8-e6f5-dba1bc666bed.j2c diff --git a/indra/newview/skins/default/textures/beb169c7-11ea-fff2-efe5-0f24dc881df2.j2c b/indra/newview/local_assets/beb169c7-11ea-fff2-efe5-0f24dc881df2.j2c similarity index 100% rename from indra/newview/skins/default/textures/beb169c7-11ea-fff2-efe5-0f24dc881df2.j2c rename to indra/newview/local_assets/beb169c7-11ea-fff2-efe5-0f24dc881df2.j2c diff --git a/indra/newview/skins/default/textures/c7d8bbf3-21ee-4f6e-9b20-3cf18425af1d.j2c b/indra/newview/local_assets/c7d8bbf3-21ee-4f6e-9b20-3cf18425af1d.j2c similarity index 100% rename from indra/newview/skins/default/textures/c7d8bbf3-21ee-4f6e-9b20-3cf18425af1d.j2c rename to indra/newview/local_assets/c7d8bbf3-21ee-4f6e-9b20-3cf18425af1d.j2c diff --git a/indra/newview/skins/default/textures/ca4e8c27-473c-eb1c-2f5d-50ee3f07d85c.j2c b/indra/newview/local_assets/ca4e8c27-473c-eb1c-2f5d-50ee3f07d85c.j2c similarity index 100% rename from indra/newview/skins/default/textures/ca4e8c27-473c-eb1c-2f5d-50ee3f07d85c.j2c rename to indra/newview/local_assets/ca4e8c27-473c-eb1c-2f5d-50ee3f07d85c.j2c diff --git a/indra/newview/skins/default/textures/cce0f112-878f-4586-a2e2-a8f104bba271.j2c b/indra/newview/local_assets/cce0f112-878f-4586-a2e2-a8f104bba271.j2c similarity index 100% rename from indra/newview/skins/default/textures/cce0f112-878f-4586-a2e2-a8f104bba271.j2c rename to indra/newview/local_assets/cce0f112-878f-4586-a2e2-a8f104bba271.j2c diff --git a/indra/newview/skins/default/textures/cdd9a9fc-6d0b-f90d-8416-c72b6019bca8.j2c b/indra/newview/local_assets/cdd9a9fc-6d0b-f90d-8416-c72b6019bca8.j2c similarity index 100% rename from indra/newview/skins/default/textures/cdd9a9fc-6d0b-f90d-8416-c72b6019bca8.j2c rename to indra/newview/local_assets/cdd9a9fc-6d0b-f90d-8416-c72b6019bca8.j2c diff --git a/indra/newview/skins/default/textures/d07f6eed-b96a-47cd-b51d-400ad4a1c428.j2c b/indra/newview/local_assets/d07f6eed-b96a-47cd-b51d-400ad4a1c428.j2c similarity index 100% rename from indra/newview/skins/default/textures/d07f6eed-b96a-47cd-b51d-400ad4a1c428.j2c rename to indra/newview/local_assets/d07f6eed-b96a-47cd-b51d-400ad4a1c428.j2c diff --git a/indra/newview/skins/default/textures/d2114404-dd59-4a4d-8e6c-49359e91bbf0.j2c b/indra/newview/local_assets/d2114404-dd59-4a4d-8e6c-49359e91bbf0.j2c similarity index 100% rename from indra/newview/skins/default/textures/d2114404-dd59-4a4d-8e6c-49359e91bbf0.j2c rename to indra/newview/local_assets/d2114404-dd59-4a4d-8e6c-49359e91bbf0.j2c diff --git a/indra/newview/skins/default/textures/d21e44ca-ff1c-a96e-b2ef-c0753426b7d9.j2c b/indra/newview/local_assets/d21e44ca-ff1c-a96e-b2ef-c0753426b7d9.j2c similarity index 100% rename from indra/newview/skins/default/textures/d21e44ca-ff1c-a96e-b2ef-c0753426b7d9.j2c rename to indra/newview/local_assets/d21e44ca-ff1c-a96e-b2ef-c0753426b7d9.j2c diff --git a/indra/newview/skins/default/textures/d319ce44-0821-932a-cd18-cd1afb9d3ead.j2c b/indra/newview/local_assets/d319ce44-0821-932a-cd18-cd1afb9d3ead.j2c similarity index 100% rename from indra/newview/skins/default/textures/d319ce44-0821-932a-cd18-cd1afb9d3ead.j2c rename to indra/newview/local_assets/d319ce44-0821-932a-cd18-cd1afb9d3ead.j2c diff --git a/indra/newview/skins/default/textures/d691a01c-13b7-578d-57c0-5caef0b4e7e1.j2c b/indra/newview/local_assets/d691a01c-13b7-578d-57c0-5caef0b4e7e1.j2c similarity index 100% rename from indra/newview/skins/default/textures/d691a01c-13b7-578d-57c0-5caef0b4e7e1.j2c rename to indra/newview/local_assets/d691a01c-13b7-578d-57c0-5caef0b4e7e1.j2c diff --git a/indra/newview/skins/default/textures/d7d99e40-10e2-5739-d063-91dcbdefc492.j2c b/indra/newview/local_assets/d7d99e40-10e2-5739-d063-91dcbdefc492.j2c similarity index 100% rename from indra/newview/skins/default/textures/d7d99e40-10e2-5739-d063-91dcbdefc492.j2c rename to indra/newview/local_assets/d7d99e40-10e2-5739-d063-91dcbdefc492.j2c diff --git a/indra/newview/skins/default/textures/d9258671-868f-7511-c321-7baef9e948a4.j2c b/indra/newview/local_assets/d9258671-868f-7511-c321-7baef9e948a4.j2c similarity index 100% rename from indra/newview/skins/default/textures/d9258671-868f-7511-c321-7baef9e948a4.j2c rename to indra/newview/local_assets/d9258671-868f-7511-c321-7baef9e948a4.j2c diff --git a/indra/newview/skins/default/textures/db9d39ec-a896-c287-1ced-64566217021e.j2c b/indra/newview/local_assets/db9d39ec-a896-c287-1ced-64566217021e.j2c similarity index 100% rename from indra/newview/skins/default/textures/db9d39ec-a896-c287-1ced-64566217021e.j2c rename to indra/newview/local_assets/db9d39ec-a896-c287-1ced-64566217021e.j2c diff --git a/indra/newview/skins/default/textures/e121e2fc-7573-740f-edfd-0d45a9ba486e.j2c b/indra/newview/local_assets/e121e2fc-7573-740f-edfd-0d45a9ba486e.j2c similarity index 100% rename from indra/newview/skins/default/textures/e121e2fc-7573-740f-edfd-0d45a9ba486e.j2c rename to indra/newview/local_assets/e121e2fc-7573-740f-edfd-0d45a9ba486e.j2c diff --git a/indra/newview/skins/default/textures/e38248f9-f2ee-2c9f-aa49-4860857e3b08.j2c b/indra/newview/local_assets/e38248f9-f2ee-2c9f-aa49-4860857e3b08.j2c similarity index 100% rename from indra/newview/skins/default/textures/e38248f9-f2ee-2c9f-aa49-4860857e3b08.j2c rename to indra/newview/local_assets/e38248f9-f2ee-2c9f-aa49-4860857e3b08.j2c diff --git a/indra/newview/skins/default/textures/e569711a-27c2-aad4-9246-0c910239a179.j2c b/indra/newview/local_assets/e569711a-27c2-aad4-9246-0c910239a179.j2c similarity index 100% rename from indra/newview/skins/default/textures/e569711a-27c2-aad4-9246-0c910239a179.j2c rename to indra/newview/local_assets/e569711a-27c2-aad4-9246-0c910239a179.j2c diff --git a/indra/newview/skins/default/textures/f2d7b6f6-4200-1e9a-fd5b-96459e950f94.j2c b/indra/newview/local_assets/f2d7b6f6-4200-1e9a-fd5b-96459e950f94.j2c similarity index 100% rename from indra/newview/skins/default/textures/f2d7b6f6-4200-1e9a-fd5b-96459e950f94.j2c rename to indra/newview/local_assets/f2d7b6f6-4200-1e9a-fd5b-96459e950f94.j2c diff --git a/indra/newview/skins/default/textures/f4b6b161-6530-6679-1a84-adfcb71a8b12.j2c b/indra/newview/local_assets/f4b6b161-6530-6679-1a84-adfcb71a8b12.j2c similarity index 100% rename from indra/newview/skins/default/textures/f4b6b161-6530-6679-1a84-adfcb71a8b12.j2c rename to indra/newview/local_assets/f4b6b161-6530-6679-1a84-adfcb71a8b12.j2c diff --git a/indra/newview/skins/default/textures/fb1fecba-9585-415b-ad15-6e6e3d6c5479.j2c b/indra/newview/local_assets/fb1fecba-9585-415b-ad15-6e6e3d6c5479.j2c similarity index 100% rename from indra/newview/skins/default/textures/fb1fecba-9585-415b-ad15-6e6e3d6c5479.j2c rename to indra/newview/local_assets/fb1fecba-9585-415b-ad15-6e6e3d6c5479.j2c diff --git a/indra/newview/skins/default/textures/fb2ae204-3fd1-df33-594f-c9f882830e66.j2c b/indra/newview/local_assets/fb2ae204-3fd1-df33-594f-c9f882830e66.j2c similarity index 100% rename from indra/newview/skins/default/textures/fb2ae204-3fd1-df33-594f-c9f882830e66.j2c rename to indra/newview/local_assets/fb2ae204-3fd1-df33-594f-c9f882830e66.j2c diff --git a/indra/newview/skins/default/textures/fc987bf9-b8cb-f8e5-45f2-d664ca6bd3eb.j2c b/indra/newview/local_assets/fc987bf9-b8cb-f8e5-45f2-d664ca6bd3eb.j2c similarity index 100% rename from indra/newview/skins/default/textures/fc987bf9-b8cb-f8e5-45f2-d664ca6bd3eb.j2c rename to indra/newview/local_assets/fc987bf9-b8cb-f8e5-45f2-d664ca6bd3eb.j2c diff --git a/indra/newview/skins/default/textures/0498c309-5306-43cd-82a2-ae31d096cdef.tga b/indra/newview/skins/default/textures/0498c309-5306-43cd-82a2-ae31d096cdef.tga deleted file mode 100644 index d7097e3a35bd45ead82ae4a0b4f5b0a6c7277f63..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 1068 zcmZQzU}As)0R{mE1&;s!|1%6y%m{Rs7!XSWF*}KFbOowk1jMI+_&gA=1L8O!W&>hE z{>=xfc@MIuLULF)lMafpVXK7#}DGN`m}`ZU)GY%kgQ1%3T1`;y{e99~4d? zzY+ppfeMU)7+t>vP>d4&ps=OH{UG;H5`HlM;ETU$Ks)foAIuC;`dJ9XCxQ4J5R;OA iU}jK~eqm_W zetiD)`@hidfB)Ht5rgU9`SMQ!NIwWqz4vYVlXp`F8?|JGvm&ee+D3NV#PpeZ+-q}4AWnJ_17*^ z#6W7VfBt8NuAf*jWVgB<`|$_e{e;Ab4J&NwKyj6N{^uo-+mYjs7%`B$iA^im)PeL9 rlUA{%X^>tJCMK_7%TqA@l+v)$AS5W%HOw>E)89`w!p+miRgVDx20#O` diff --git a/indra/newview/skins/default/textures/09a324a8-acc1-d9cd-2cbd-7465d90d3a98.tga b/indra/newview/skins/default/textures/09a324a8-acc1-d9cd-2cbd-7465d90d3a98.tga deleted file mode 100644 index 77d470731b1cf8234902560f7d7ddcc82a74dbb0..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 4140 zcmeI0O)ErE7=VwNhy_KmVL?(h6jmq;HFD*n%or^E4O#e#wVz`vA6Y3DR!U0pv9KTu zlscaGHm9y>t{HXCxv4qRbLPywxAVN`eb2o!jZ!IPTBqVwueDZH{zVQtsM91gCseOt zyvMMTkbeyC2b>mSX!0D#0KP|%b_rQ%0AKe{)Gv8BgPceIATG0hhG9FPml%B1VhGPu zX#Lrp^Kl01paxvkqtyD*>35L(Vi8=qW!^YHr^0qbpNB?p5l3A9LwTXQ;C%|xV7nHT z_&@O;g6zp!u$hNS{3yeALca{{U@L~d_$7#a7*ELmjCT!s67XN++=gzjxd+PKf9Uip zY=JxvQ(&w1GEX`G9oKAttlOs7%=Mf92Img6I&w=4ar^&;bDPitwsUUQF7LAb;_shZ zj;({MoEQ5aaG56cmYmDFqu03_%kPhSkoE?q-f70JoY8ql@qB^AunRVyEm2S0cm(Ga x>_HpEUFYg}FV0oy0$(|IwU+9<{`XJGoST0Ga`OwBe2@+1X8V>Vg6T}Z`UX--l%N0r diff --git a/indra/newview/skins/default/textures/0a94b42f-ec84-5f9c-14b7-1ef8505ceead.j2c b/indra/newview/skins/default/textures/0a94b42f-ec84-5f9c-14b7-1ef8505ceead.j2c deleted file mode 100644 index 03d4b1a9b450de68983f838aa39b965b59a2c2e5..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 169 zcmezG|38qyhyer?pcupk0R<=qu^AXx*cln&=zkCc4^WJek(Gsof#H7)gR)Y&TscEI zL)oKzhJ1#+N9jI5m=eGYgs$P2fH3iY3IiVlqjzFv( zgj_T5m_IZB%diKB@DRM3(1hJ)UDxo>pWooX8!o?iM|qX;x1Z3tntlIOmsc6x6U^XV z=~T_W*Y7Q`wcAWjkYND%I+#prj)s4uFkeBlG8qaer(HIr<@3r2-;Jh~DMq4y&M)k| zq;>a10b~^fUE}_8=o3{axk+%YVZM=x>1^NTo4sT Zu+ktTDAYB~GuYGLPdCEN)5leh0RWcSEI9xG diff --git a/indra/newview/skins/default/textures/11ee27f5-43c0-414e-afd5-d7f5688c351f.j2c b/indra/newview/skins/default/textures/11ee27f5-43c0-414e-afd5-d7f5688c351f.j2c deleted file mode 100644 index 3fb9c95aa490e5bb171d2b567f6c860e9bf1d7d6..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 184 zcmezG|38qyhyer~pcupk0S71su^AXx*cln&=zkCc4^WJek(Gsof#H7)gR)b(MA<7K z+>_6c&ye>h-3JI$0+@l&HT)6~CjL)h;A3F)PRveBDb+R7Gx$G&feUP~Ed%5K$>$%) nFy8Qv%V4Q!XgL2vfMY^@Tr<-ykA{YZ1q?16)j%2r{J#kROWQKm diff --git a/indra/newview/skins/default/textures/13dd1d96-6836-461e-8a4c-36003065c59b.tga b/indra/newview/skins/default/textures/13dd1d96-6836-461e-8a4c-36003065c59b.tga deleted file mode 100644 index 031b3ad34436e8d841c1db08c6ab88cbbfc02161..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 1068 zcmZQzU}As)0R{mE1&;s!|1&^wJdg%q7#~D~_#jM3%pRx)2JC?hka`de1NJ}$E-{d} zK1?B$O^O&uElfSg92lPzF=RcXY}7Cu4Ub_Q90 diff --git a/indra/newview/skins/default/textures/34c9398d-bb78-4643-9633-46a2fa3e9637.tga b/indra/newview/skins/default/textures/34c9398d-bb78-4643-9633-46a2fa3e9637.tga deleted file mode 100644 index 58cd2cd559b723f91fbdd68a60b2c22de8c4ac40..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 1068 zcmZQzU}As)0R{mE1&;s!|1%6D4DGpcw7`&lSyo15W#3Oh(Q#QYt3~)k#dp&C8&yXI`I*-^AEk{mjGgzR95r&AqPnp;!TzBz_e_6Q+^C@1SXOTTN zXj(DNeGrrLrL0_^x%@kgNiX@Y0d$>?J~7$G(=)j BCEEZ1 diff --git a/indra/newview/skins/default/textures/39801651-26cb-4926-af57-7af9352c273c.tga b/indra/newview/skins/default/textures/39801651-26cb-4926-af57-7af9352c273c.tga deleted file mode 100644 index f2fdd074bc52d4995d89f3bdd8dbf3537526ea8c..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 1068 zcmZQzU}As)0R{mE1&;s!|1%6C40H-n0GpdZ8nKCE6T_w!n;15|ATexep~6H{=w=hG t5vp)hKWcna8h)^NCB_`|uphE~SZNRv6zUr08SLrrryJqs>Eo)$001x7ZTA2G diff --git a/indra/newview/skins/default/textures/43f0a590-f3d3-48b5-b460-f5b3e6e03626.tga b/indra/newview/skins/default/textures/43f0a590-f3d3-48b5-b460-f5b3e6e03626.tga deleted file mode 100644 index 340f3213dc7f469d5d2d1287a8e993f2a491502d..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 1042 zcmZQzU}As)0R{mE1sG>Y(DQmb85j3-GU9P8$a@k%tOdj(AayDF#*85B<>DkVzqhj= zsQ*x?lamol9Ha&cKzfx}nVDN{6cyJ1+3p~5pt^q`oM&VIZ}XJN|M$$F`@g{62`mN@ z2PzQ&VjVtS-fW=WxuN>{{|oHw{sYB|ffx=vU7dw@tXtW)ckRl9q0UZ*a0vzm2MZOY z^>*eae-dr1{@3|>fiY0N9!U+uu0`{3`8$6_Ro?#)cc=d#8irx|LH;aCPe}&qe+aZU z7{o`$Aaxg(P5K}0@AV%e-Ma|1{{*2Bi6e)+WozK_W1t~4{w1nPz{Rzk@aj_IG3>{ zKNl7r;P3~^dvS4bF5SLv<^NAl?}Ng>5~K&&uOPOUtFt;#{~nkMtAT#8E*bIoJkR@PjU^-B{e){O{ Q$;}OmfZ-ts6CWrV0N)44761SM diff --git a/indra/newview/skins/default/textures/47a8c844-cd2a-4b1a-be01-df8b1612fe5d.tga b/indra/newview/skins/default/textures/47a8c844-cd2a-4b1a-be01-df8b1612fe5d.tga deleted file mode 100644 index 505f6ed1c0e095ef512b185f216fd2be4a9d7ba5..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 1068 zcmZQzU}As)0R{mE1&;s!|1%6D4D<>Z;PMk8d5}IBKsN)IIJ!D)W{{#6W*$rrjE0Gm zLQ_L8IcA{iLFeQ111`0=#F5P+q=t|@vRNa74J!>of5qY@QV6vYCfqV(R&(qUOy zSlGfAw)fuHz6)$;>pXn#yg8pU=bn4!ukYM@=Q|KI3i|)`5DJE-K&5~GlYcv*BCnk$)6ENw{^uv^~9{l#H`2uvaUB~EhT0ZEp|2I*c$e! zwY;+%gcmkTuKXaoyHEb~h$iKnA>*pK^ns%(#evMUqsxW~uwinuv#;IO_sNWhTd>VT z-8K65A|)(cSn!0Ieuwz{5<32OS*f5*b!cCJo0M8v6OX3)7HjjtclHE{Y&x61LezqEM2m-VE($yS3b_#!c0F|Joyhs|3zk1#vMO=u>L*LSPh7kre*VILXU@7bdCET_AveN8 z?}h{?ObU56B`kG%c-FkB1xsg^eLt^y-9p%=C3QPiRPR__`Q!SE==C*wHq`Ci*swRM z_Lu15-%b`hd{JG|0Vk_lrFMkO+DwvF*WoHJUMslss4S-%h8MQVU2uiJlVye15$c}4 zulnmk^U0r)CwHQcZ|yz034df0;Yd{9(J1E8^~~ez*{3!L&TbU{xkdWVcGci-R@1k zgn4wX>%ZR+H;y!4iK+YhK;_weMQ8Trp4pRea(8-6^t+#Tr|sSKde4rRySG1!-kun} zE8&NqAN_Fb@$M_}hdw@vEqxN3_jLcOCp+VwY`&PZ@%LxzPbRNB@oeqUq}4|f*Bp7W z=E$>Ev9G@W_1*U|S>GMXU-47X(w&71Hs#J(DE~Q*TDji<`Y8~pX7(17Gg zf$wL8WiN~@T0W~{^}L#mi(%WAS8rcc6}_Q)cNFZWsK))9;fHoK9@$rV_EdhtXZ;aW z&8L2Mr^?w%QH`iv({F`Ox*i^JDJb~z#ECb80`3L}JPZp;o*J4qGdyR(w32V$-ft>GtiC7az*Y5%pMMGvC-QGBw~uWiU)> zabrMp$LF23!oinBI8u(Tvt;g8ISr$e8T2Rc%W$oGb>EIq0~(^b-s zER}bZNRXvML=m?wpV^X4g=O|tee5m&&{O!nE$2;rdP-$#a{lwDS&0wRAKXj3^C0=! zy~IoZC7i!||Bst@&Rx6q`<1`WT|0XA_WrX8d(NcnKT;TTq$)PHJmz3Q%$}^+=ntoM ze>}VE!};wWFKqpIar1}Eo8DcGO1-l=IbmDUtL=&DTkq#>xm6lHG=8UuOxIFA@H| z(;NS&C;3fFT25tQT`>$<($QB-VAT_t)hJ3?3!z0Y@QI_tvvfkCsb681sjUpv09M+M zW(jBnrm~AP)QC3Mw+=N{4b~P}YI0n4AAR-jK=XTm$OK(E0Fw_0#h|Yg&`JTX90;m_ zxE4s7fvgS45J1)m6x~3M2GVY?2<;YPtpfC*06Qqcn*;U_n4a7CCaW$rtL9a9<@18t#}#e2YcW@w=r`e#_*UKHMpJx^ z_D;V1`g_r>6w$3D(arn(YuC6}|6>1hhJNLE-`(T5C&znIPJYTf)lzb@7Iw6tIp%Ha z{>SY*Z#Az!-S}N>!}3G5Gq%7ZH^64B%9*k319+K<>;QBtkXwMm3H&bL zbpyK_Xq{fgkWHmA4vLjFD$m)Ac4M1|yK20hW&W;G&{G01MF3X>2ql1A0ccf#Sp(QG zz^?_uIv{NZ(*F~`11P(JsuyS|KurZ|I?ytGT9(Vm_Y8EuSOT%(Z5 zrBabd#NzV$*sLBd1Ic2x&^b*sUK5Sq#N;<{c`&iKQlrZ=I`RkojTX@11V}shGz1zH zpqveAX`l)VO4>kHDR}$Q|Kf%F*<*XkgTc%@+QNS&Rkv78*YL=Tt*A4Fs9#@U_TB5+ z@<;c^Q`n71yXS3TMXn}IUxApus3Ckx>-Y)SF{9f@L$%|e(g{$}c&K9ndE zb~lmB5OeuzwPD!e^bh;M2sR(k4gwrdygp#{_%#kk|DZ{&QK^L- zBfZ;7tT*?RTTyw#$d8_mx4w=P(D@Q{z5+e3044?CQvLWeKuYtI-}xyYe6%bNJ>Nwy zcCsp6f@ZG*1yn?!rTO&?V3B%l{T`djWl=c>)z$&kkWp>Y_iNM&rBWu5ig^NFpMc&a zAhdCb^~^pPgHp$$)$?f$a(07GSZ&efI~_$Xe~ZW8-~!Dq0C#{!J*X6c77jr4f!0m{ zgMqR_koyjNO!j3z@f0LD%kLR$??_v2P>~ngQKyT#eo03CcoV(pEN0yi+{y#^IUBek z^Qpnpv0+njfx*8gc@_D$!_QE@1ZozZU=>@cDtm?^nAWa;rgU)+lv?K?Tt*M7S8Wc4Dy|o#8~L zcsi0nXOi#JBR3+!g}CqhbkEUo--%3cbR}AQo?CHgR#MIowRn(KXA^&NYY6^9Hn56; zUGA}~>^6!z{@ZBUymh?rnbe?AQb;f@U;=maDCua3 z`vt`Q66zZVk;XyvFCq45h&l$sje(G3A;idajDrYYL711ZlA~ZS%1e!g#%#p0g)R}TmbI`Viy?l z0jCeRM!Ew4Gw?`VMxI3`HH#HSmO+hm%HTF0%t|S-U^9)#*8^=&23z6>8~!uG{?*ss z(A8eo!)}2J7m@vP5oM} zM5Pia6g;VvEfUcMd4!SY1d`)#*?&Fhd8T#W-X0k%$P%*5PQ7ZjVb^;7uX|OOPKy$*bKWQQRp<2ev{INP zvWPD<8Fe0y8Gs=_&;y^?>n0D|8G1Y0>}FbhOoxx_@v^-x%J2};A*T(pghoQYs!Jz5X7tu;yxkHPlj%^Chiyc+ z4?XPfuzOo=_Qs*18k4Rh!h5O z1woi#2ps~ULLg)qgo%J;i$hF1zEkbns`z!c?DxastLFp{Z?fJ!rIqJWJ~h!sJf2j@ z9MB704vE{rbC@X>BVkC}%al>%Mw-b^vbiu02hujsVNv#&SX2#Ora_rx%~pPejZoyT-??^D^}+A+yvq$Z-#Hd}hAiA|Amv#2eO8%?g}Jh|;hTVp6@Rw@gMT5MuLL-MP%J z+>xDw%@LA{#LODLu!AC|Vq_A8RM#f4A;rT4p-aGV>1j?U!RG531V|%5==@D;ca6ec zCUWJleQ!zj7agYfO3jT7!S4z5gBNJgr&!x#Nh`KvW_*jC`VD91Qq_#P@@cb$k+a1! z=F4V%BUt!-*Q$-Id-uFD5%4;JZO~X(!HingA2CW20;$6waR@{T{0u4xB85P_uu+__ zFBEfvwOdwj_H5)H+95pllj4tK+FKV?Pvdy0NwmVuK6oR6M(C9adbLW*fSPKQQw)+m zg9Jn5W0_K%OxvqBW6VR{gIe66jH;uHRNZ<-t4&-v%*}JMv+c}GJ2hjNmgVPE05KBC zF+hd_q7J~R2h7UP=2OrNBygbY^7nVxRm1_K#OZa7h;R0PW+X6p9I7FebASVMB)=N# z?MHk2yFJQoPe017=yXXt9HRCiPLq;YF2LmR33)7hA+5KViYuby3h1~TDmJ?horl9# zqxyP~EM5nzpGq_GNCpXBug4nfD7~*k2ijDiNe1e~pi1N`H284(M!$m=n;zoMt_@%FN0hprl%;FKpBo4$_O^zE@t#dq1PV&nWSebNs~jfS3lz z8GxDtXxX1%J5h~aTIc9Tn@#*-uWh9MM~v18!@y@8HtI&4zn%hASRjS_`1QlQS_iAj z#;mkZ%Le<3&6H9by~0AP&{E4KlnNfHl7TBDb>;QK-(#9mFb%J|>QWI6x$PZrL@ymh z6brE;ZMVpXl9-V)CtT)kk$dZ9o@$A^MC8gBII=mGbha^tu1O+G?tkLmC}aMeMm!dW z+kFxnwHvd14Qbv2=B$~l$&1y(8HRbsL`JtVB-_@5eOnT(PCk|s1J(xrv=CL0g4{(nG@fDz? z0qPsT`~dg`KwRloby##1t4%fX+xXun!0qx|2JJGlf#Lfseg_cL`PpS|dZB}oYwOD$ z?9I~kyf^h`I%vf{F3iTN?I%=7d#iZpGFp2sp)QS3{)|-qytnKXsywT+wh7UK?}XDB z?R`Q7Ns6Q^kQ`+@U)d^DH_G~Jmj877_@B##W_Odijg62OiKk%moDMa)r7|AxFG3Vrmnvb5BW$2q!D z?Dz+$P2W;iL^2jn5igr5S~5*IZ<1s|q-4=d+0uFZW%IbJ7W3DC%iH*^XzLou&h_#= zn^cE(>P{WhUi?jU=d$uyygcijthz!1hl_i^mzy!$m3ZFiIWNDl@s>)YqgX)X6%_d5xLu%Ga#Y7wqyhdPP2|7LIEq;o2Ci zE;1X{%j_gFI;l(~o6#X=w8^P;ir!KgK3|56fxg~>{=1~>_|u;K z7l=RpLRlZhU$#)QWV&g=B<+Gw@ybZf@@d>fk*e7<2WKs`%=?bFY&~}8KKRiS=qp#y zr_OZm*oEJ+n!0rfbJG&>wr@onmx@*`lC1fLzjBFS%~Cgk7K5Svu}Lqa{QGzbX_bq(_j_VoADjd1hyan)l003FT_ApigX diff --git a/indra/newview/skins/default/textures/74ba3584-58ea-9984-5b76-62d37942ab77.tga b/indra/newview/skins/default/textures/74ba3584-58ea-9984-5b76-62d37942ab77.tga deleted file mode 100644 index 0fc1afb7a1049b2b14fcea83a86395e2b34f4b19..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 4140 zcmb7I2~d>h8D`8d8sj))ojrFiAFP-PEyCVv7#|3ickeDL_kpZ`+U}&W>U?f&O5*J|KImM@AtgV z`+o20;IPTT_Q%Zuf4B7Z_By=E`uh4D1_lNk2CY_yzP{eHrlzJUW2w=apI>-9D=X)> zu;0N>=I0k2tE{XvcXoCb4h{}FSOzSw^!X~RAHCmVu~=NKRx8hJHmmj;iW}wf@N>RC z{u68#cZN=9&AK?#9y$Nl9@1PHb6l>+Jpo^IB{MV2+TGo)8Xg*AA%180b^MWUd$DZ= zHVrY?j*tR~P!Si!*(RPGijyEW|Py5DcgVZ7#+Ms-!Ssi>x=s-UZ@OFlL>>J8rH8R?mam<;wTi^*N# z2MfQ(Hx=HKJZ!QP!>0cJezHy>m4<$fJg=~roOxxG>J)s$Aud)=PY)Z~;#Hff_vj*w z$1)?@zRihi9?#3p9cpOUpE^7|TOnM`qxL1#Zf471Sc!I6<+Cj8pf!SL`f1N^oi z{(r%iA|jNZK=)CDg9A)pGf@j}b+y%bdetAV?2e=6%Qe(mfpTI^7izw*ij6v3T4F34 z8yoYisjc1X>A{-v1aKOm(_Pao8NvBKuSzB9cg+dW=F(f2@ zVqfK_PqZn2q7-43i`vwjvsG19JqAN@Uu{ioQ-FWaH>lecPY>_$+S0`nKXJv#4ma5;4S3;nM54&SLi_oEzw3sM)=^dGCn@(gh~~2UK7*0 zke5!a>yoI|MD^sO=*Y555^2a)sZ{ot#Dt^|kc)Pr1L)54HSl*dH8pE^JikfcuY`w3 z{@G&b=i>}qlc~H&tJM#6b(zx|8|%w6bU&ZYPN%3GSW?{NT5|l6>HPfMr zZfvYG=yf05%|PvCXh{7%rqr=Vo(YBg>xLpjJ@$l#$>g8yeB1dUxHy6Q@qlkndn5)I z^nIg~6YVzicB8b^XhQ9~)z#JKayagHa0gD8m6=dl73JyL&+erYY{a0~%u@;KqibS` za89XIeK3pVFiE6aF)FE5JXsE)WDg#hIs#MpOC7$fyJw_#8S~mP$gu?&|K5 z<2)n>_BgQR#Sz@Ia&z-~m`v^*gTbDM{*R&#{VOYrO(_YNXP)Pt;A>Z?q=ZxJVo?ye zuV<0FuA@ia4c4S+-$Ngo5AYA3XlrlRfP;$>cHK|m%h#obcl$7#5?uvkl^2$;+_<(lrqZc&|S_e6VSD5XL zuX;LS#-L-~NkkvNi8*2&I=pBmU!Mf}@l{2~{ASx*+ou)s zh>u7;y}-A}fg^I|o|Cg{0Q!BzVsW2_hAJ*0em;D1pb2xBM02Guw_~YfZ}$VOremUL zPsgNG67m4K!o4lLftfuLeTaGBK%-6>t@=fo$y9>mv8+Q`D=n>DGH*45yz_EH_o0}R9xHoU2PS#L&lPxVR$v6WIA6ej%^iVc@ zzO@1D&ESZJ`i=1O4IBr~`g854>fQzSZUYuekUT8>0&=nnUZ6=+IXGcsk2DN(7Wi64 z|Gv9_e?tahCG!^H+E&xA(%TQ;Zz1@|wM-xsUqa7cfc~zVOcf=-VfOX(hG53~8}Qel z>lys!D#rQPLqk@t__%}`y0{P%dlM(W{pv;wborq zDfVOEwoXXi-hjOseeX`>VPrte((3ukP8`Qso-AvW$7^IzmBUQ;X0JYai0rpKGU|Nw qIMaOfv?s@^vnUT1s#)^K)IUFQf9vsY@EWHy=VyKl*Y`d5>1Hb=rb80| diff --git a/indra/newview/skins/default/textures/827ff765-8c1d-a8b1-23f7-fdcba560effc.j2c b/indra/newview/skins/default/textures/827ff765-8c1d-a8b1-23f7-fdcba560effc.j2c deleted file mode 100644 index eb13fcc88b86bb9ed61f39290102b364792a92ce..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 212 zcmezG|38pHp8*6Kpcupkfd(iBu^AYc*%=uj=zkCc4@iKKm4$_Y;eQN+vQoKRIYT)^ z*`s`he1^P7={`W162J_EuHlz}F!6s1gCGN=cVc#8N~vy{iJp<3;r|H?TwsGE85sXh hKL18dgds47!^!TciTj;pZLBL8LRe}W$N~Rv0szGTK*j(7 diff --git a/indra/newview/skins/default/textures/89e9fc7c-0b16-457d-be4f-136270759c4d.tga b/indra/newview/skins/default/textures/89e9fc7c-0b16-457d-be4f-136270759c4d.tga deleted file mode 100644 index 6cc9ea1942b858f0e77a0d8c4ff0ff6ab57c6e5d..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 4140 zcmeI0O-vI(6vr2g0>&QTLOj`o#Fmeien`99($b_BLsBIoNJCK3h!KcUqL4s5;QEj-g}G#Vx+6StbOCz_k^y73}q2eIALjnhUWv#r(Zm@LTnE|-hx z&Ks=Vbt-;{N`o(SYSNCm}<3}$?@N<*f>2z{^bwxh z?N;>T@j;xcp}u^my@J)jVXQ37g8coB*%s;(wI6w^-KUsr&d+DEGe(UN*TvIvS!tMP zXaw<(;Md$F#_JmxM{dVvFfcvOOSMQoCs8?rp2v6{t$%?Rc-wl1aYTD2i&de^%ga;r z#d*oJ=^50Avp(E4D)XvPTcBX=b?kDVk7j41W5@lIkMm{G?9UdZjT`zE(nBC7*( leM;V6zb{kg^?#g~_-{aURgLF-#kq>gGdf>+h1a9!{s9mWmB#=8 diff --git a/indra/newview/skins/default/textures/8dcd4a48-2d37-4909-9f78-f7a9eb4ef903.j2c b/indra/newview/skins/default/textures/8dcd4a48-2d37-4909-9f78-f7a9eb4ef903.j2c deleted file mode 100644 index 1068e940b9237289d148851aa5394c97afff506b..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 172 zcmezG|38qyhyer?pcupk0R<=qu^AXx*cln&=zkCc4^WJek(Gsof#H7)gR)Y&TscEI zL)oKzhJ1#+N9jI5m=eGYgs$P2fH3iY3WFd6qjzFaL`7D1$9 zR9DeWdJ#xiHx*@psKNTdyDST|FfS?=k(52XXY?a}@bI1Q{odz&-{<)bk&6B<3t7ma z3kHKugTeTS$o7EAMf&{!B9SBw}&Skj?kpdCQq$f=bf@zy-!6k^Oh`o z^&U^jJ|YoB=NMNR3C3&2GIDd5QBpF1s;c8?Xz0ekzz6j9{zPNrPZ$iLPn$Ls}OOfq48a1i=bXB-Gc3;qyIQ&Cg-~cN3{OexA|K7(z$KH#9c`p%7p)C85#uATRG8 z-+gENNb47ba`xYD^ZQG~DwV+TJQ$6|2m}s6lIl1oz%f5#J0r^2!F9H=7ki=Amb3q+ zXR_>BQ(0N5*~-gk)Xdv#Ygzks96NTD@9Bah6>af&inh318#)AmV6&NVfRjEZaWLZW}PY<%PvR?Rn zJ~0xBr1{ZkRLikxi^Yo5U8gZLG{p1L6Sv!)8w!Q&T>F91Xhcg(3xd4BCn=4)5* z$?0@nQ1jz*Kg`X|;pE8^{MPC(q9~@6x#ICSW@cv4+1ZJVjEuA4aF|$oy1%mXxj?7W zebwvr>71pdB}`0A@IN$)@$qq_QYnm#jIgh|X-SgIJad|>=vSc35(or>Jm*`kkJi>! z%+AhYad8pJWD;#{ZS22hx~QnIa5Z;j4W1+0;c#@Y#>ZT1!E83a=kI$alc}k+v~Tb+z?757r#0*}qRZTwSwgr-yz6)9Qv5 diff --git a/indra/newview/skins/default/textures/b2ef2d31-9714-a07b-6ca7-31638166364b.tga b/indra/newview/skins/default/textures/b2ef2d31-9714-a07b-6ca7-31638166364b.tga deleted file mode 100644 index 7358e86d3b35f1901711b4b2983ef7fd4600dadf..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 4140 zcmb7I2~bnl8fMyY>^7aT3M6C!5lGmQkOWD{zJP!%1_WgnF@Qm~1Vv>NlCUKpzVUTz zeRdyhZJ$qVU#G8~j)FpcReA0ewQ9wMwjfdkM1=dk)2SV&(*nYrNx1ji^Zn=hzyCY` z#l_`0mnT17F8F<+p`pQLy3yF!=+e^C66$a|6^)GziJLZUDlW(`aAam?zrA8b>c<$L zkk8D_thb7ait6j?>araUhpxG$Sv=jkv$!|6xw+ZR>2&(l*Vk*;assZg zn4bM~I&;v?m3G(lw?T9F81(e?zAfMjPbDX>aM)}%ZCh(A6Y;wNYtAh2p61~tVAHUM zDj|N^-+4U2ITq9FXLmRHsGBQ&luly~0P7ZF`5`cncRdJW(L$d-5(DBH!Tmu#Kcpwm zm}ho69e%)m=^60nAZ8loOOy)rK41FXyUG7qLGpE4!|&%)Gj)s%qty zEn8ABk~ePLn30{e$|?y9?_@GP2N1&}Pque&Vd1($#K6RQb7vXDTyW0L%geWb zg_Bt87nw}?MRj%ca@-5XdcJm>O`4axI)7zSVr%+}6nn*n4Tf#o+5^E``0}LWzcD;m z15AeJBR((Wq}6KG;<_vFpPM0u=bD)HU`$6 zNe3^qwY4$8ZzbaY5o1iDQ2z(IS2-Ll3}7=+3*N>x#x;V{mYteI_ik#t#vh08zd9Lc zX}cRHQ*`F%6%=mUw#}!^Y+kd-+wT^*8&fLPpW*pH>}|m`F_64N?+&g`r{Cv6XO6I0 zUO(j*thKa4$9Rs0`yRj#iZ&$gl)iuRR>TQvQrA6BX*)+KLBofSgQTi{VTkw$_D^b0 zE)t3_&}ob@sZ@5fv9T!x`0mr;ll#CBN+jW3$o(Ve`^M(Yn~~RT9;knUO|Pu1(h5T* z-$cFBH6GDJQHstnN`Hc)ByS&k%$LZ9yga?XhZf^7S0NCHF3{W=<5G#N6KnG^rmMv{ zh}#VuOU2^F{{#L6FIaG;wzf7AT2Co1DqgvL`}RO+ULUE|eX+{9>wb36#E{|0(B1I8 zy~EP#H~M5!*;(**oIGQ;SPB<<`G9}M2x?}x)7k2ay-mwM!AH%@LPA96X*9-!SQL7( zVnaoNpRa!>sikGh5_eQrR~1ApiT*+;4!yc8EAK#DR^DEfA@yKsnHe=%wmvu4Xg8Oc zHw6X+pGVz}`}%Nt&1Op`v`e_3&Tq;7-Jx@pKp^b(pfM*y1j37m$B>k?d@GH{>_bfV z{QU!Nb2Wfn-_KvLfOZ{vyPOa6LG624 zEae$&_QF1#fp^xfHRZLpw=Xi8OzR{Hb+@>6|48g)0T6mAc@xN44QxgLYX7c~%9S)~kNl9sk~&A&c~mj#`Ikesfgq7k+V zVJEFNdpPz(axjw)e~$y)Gt<*E>`bQDpoa%*D0OA($1y81z7yF$=$E%27!wuNPKwsm zP3U(YACHFyB5@Y!p+(uAGr&*(Y`G!nL-^3WzyRL0>YAEZQs1-0pM%^lAhoAZsBn%m z$IyrTv?eEKN4T-#=hCYbm3@PvlpUj#24`Q~d5TInO;J(Dz(3B!@Eu?G8M1Pl%Sy}2 zSS+tQ(C$z0qRkGcgAM%YJoxv$qkpBL--(8ge~&(53Oc@BQe0f6s@-wMK0-|xFHw}H zdyaI}3m6xf(=%XXU%AJP> zg-ciTEQyTV(}?pH`r&Fdx{qFY`PDnJaK%Az8VvlI&LP49@#2N4sc9|H?+|={A}mby z4dM?WUXr~k$Ei?j&xJ^p*Hvk`dzYCk*4X6KH>0ALLUWq4@a=C9s||Ju&S0`fafTnjdRz>@C6Q5k(3{*t&)uJslUs#Y zgY7n}9-h~Md_UlF1Fuz9R>t5u4SQyROX8uV{%3Oz%_SV+Jx1Zr4eEvGO+ov^cn^3T zXOLG*b8~RGRDKvac?4ei3kpny;Dmu^1X8K21AL7W|6ad-1L>6s*JLkGYWlDC`}Fk} z2tLkzsUSqu1<(Hl`nv?X&HEL{-mn-w-WlLeLf8Fx=Q3h{tkzbi4|sWR!F>1o=)tZ7 z-vE44Z_i^qz5Z;zzu45&%q}S@S*6!Sypx%pS%sMR;E;}fK#u<4BGDw9?R^t|o!QdT z%*5G6N1v8~d)-or{8P+(R=@dUTrUHU^xGT^Z{T|nUT}>klPNxZZJujCYT_93q(Y7f z&#&T>ZL?Vy!?T5$OZxq1dGGooKKc7e-hTCCvL5gm&~&`PkXT<@TAG2_Jb%L>Jd=3@ zlW2UV8virASzQCB3(jB{a6YT~h~+QmJ^63I^2Fqbl<1`Bg!tf2PTLcwFXC8 zgx{VOX3Z%+d7mFkfLV#y^Mf8bns1JW02LnmEIz;D34hNFsmoI@_w;YL->|BwFW=l? z*$v@kY)h*ArPinw`Aoj{NMqq%p*bzK@zIL;N>a-T9FNRs)07TLD_arTnD{d_cE;C< z9hOr4Eg%y=ZS3Fjj`@L%menR!eG85!+w9u6zqeoCyl+CfP~tJRtw~+iJreUCwC+6@ zm3L&1cOkzeLuL2Bhewjyt!7PpBiQ-?NIviqJ7UQRqkuH%4#xnU6{LUeO6~_P>TDx*FftJyuSE(9)tH@krlo>uYR4m zV&RsFNl)73>*Ol+Y?4+lP;O(-`)+8&1!auiBp+SusC-SH{A! zUqC|^lq7t(kyW)S;twOkmT3(Qe-aMdPq_t@_>=I@pkBftFs$=?{LZikFF-=cc82pM zE_Amqnl9}Zkd&-?DCOb7Xth)Y`zap{GTbJ|ZeE%lEO)PK`s}o+AmyfZ^$(V(=N}H^ z>xf;)I$2^S+r$-?^CIHJ0(0J8^WA>)?QcK#qP>m>52fbMN)`TmOLkN9ERB`I`Oz*t zg1@iM;Ltd4dVc$YqU=eHlN1f@*e-FOjj?CHpyfEb5^9d8# zBg)sVEV$yq2eMa6{$M&oSi{!;ECoD&FZ>covwhz+BddW)?@Vs&?^Fictt~}aJom0J zyQ^`$?CSB@CpK@%Re_5ob*Jb4wK)Aw@cJA>g=>w=t|`6eJrg&ZT{)_CsgrfVu~v?z zFDg26Ti1R2Aao??+TQT9*S+l4t;y=TlzA|^c-ubd;2F-7U4t|PWq00sGVOdy$+coB zplc3TZ>kX&;M*57X>M_Sc+AN??5j$?Uv%yGaAOJo`8_2j71xaYbhcVvJT)tSdrK(4 zW3+73JKoY-FPpxLFX_p@B!&BqOOIh(x>t)IC5>1)>=pQm1QOLf|`QeW80 zUFh$@psWnZuTwPI*L{7L^KLE_lNVCu2aAoVc4FnMfZFu740f1Hel&j<(~SZNRv6zUr08SLrrryJqs J>Eo)$000!N4od(4 diff --git a/indra/newview/skins/default/textures/e674ca0c-a387-4dae-a0b4-db6bd073faa5.j2c b/indra/newview/skins/default/textures/e674ca0c-a387-4dae-a0b4-db6bd073faa5.j2c deleted file mode 100644 index 9541c5d43209cd91e02ea28865d9dce3d520c802..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 524 zcmezG|38qyhyer?pcupk0R<=qu^AXx*cln&=zkCc4^WJWk(Gsof#H7)gR)Y&TscEI zL)oKzhJ1#+N9jI5m=eGYgs$P2fH3j@1O_gUIgAS#82?W`zlVjTq2c}k0hVP4el{Ga zZ7`4r+Q-b<&~TuJ;Xr|b-2??rMwSCV4j%m2-29A#=^6vChbFt`p$!cU$1m}*ALEmk zFyM=Q&bvs9x6%LjHAQ)k8#Rj#@SSsQ%fA@%W^sDmoO_R#9G76QHq1O9b>M%nsrGbs4MtT^Su$_{SK+~ksC@1Aw{6<-y+>ES#G%#R}=*cr0e&qJf7uoI>Z*nE<(8Yi-rvNq^ Ytz>ThqdPV|Ql9;A`g73+9N_;=0H=%70{{R3 diff --git a/indra/newview/skins/default/textures/e97cf410-8e61-7005-ec06-629eba4cd1fb.tga b/indra/newview/skins/default/textures/e97cf410-8e61-7005-ec06-629eba4cd1fb.tga deleted file mode 100644 index 6fdba25d4e080d0fa508aa7bb3a012b0d98dcf6a..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 300 zcmZQzU}k^=Mn(n>j{pDu{{8d&_wQf7e*XOa{oA*%U%q_)^zq||_wU}lee?R&s~69o zKYRM*@#9AiAKbrx_s;EGH*a3Qe)a0*%a<;kKY#Yj=~E|996xsS@S%eT_V3%fd)LmL z+qZ4qvT5Un_3PHGUcGX~@?}ewELyl=-rPB}XU&*CZR(WC6Z`vnd%C(h+S^*1n;IMH zYOAZOD$2@Aii-;J^K){tGBeWCQj(Jr6fO-)UVj12Vk^>lQ!H8s@LRaKOgl@t}^<>X{#q$MRK#KlBKMTCU}1qJx| ud3kxbxwtqvIoa9RSXo(^nVFavfgu0`Awi+8VV=RB{(iagah&n3Y-V*COEL2UHGe!fyH2fynzCX>;m><92^1*e=;*LPn>a@Uv2?^g8=ga zc?ky|_MD&vc8LzWKRveThonDvv~GbsLxNBT^8$7@5r%*TKf4)(d%Uu4Ov>N({L-Cg zEB5_j)H5l)_vQEkSqT9HhwK+~7sv#NSmegqdLGoB$-Us`4F-0Juvcs41ua(nSaj&< zcJ6mmyQiHk`SELEw&evuDaDhQ6hc{L*1j^kEw88Eng1@L2xt;e%U3(i1zZh6eQnP+ KUixwJ|4jfJd~xgm diff --git a/indra/newview/skins/default/textures/f54a0c32-3cd1-d49a-5b4f-7b792bebc204.j2c b/indra/newview/skins/default/textures/f54a0c32-3cd1-d49a-5b4f-7b792bebc204.j2c deleted file mode 100644 index 03d4b1a9b450de68983f838aa39b965b59a2c2e5..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 169 zcmezG|38qyhyer?pcupk0R<=qu^AXx*cln&=zkCc4^WJek(Gsof#H7)gR)Y&TscEI zL)oKzhJ1#+N9jI5m=eGYgs$P2fH3iY3IiVlqjzF Date: Wed, 13 Jul 2011 04:35:38 -0500 Subject: [PATCH 12/33] LLVOCache class implemented. --- indra/llcommon/stringize.h | 107 +++++ indra/newview/llappviewer.cpp | 28 +- indra/newview/llappviewer.h | 4 +- indra/newview/llviewerobjectlist.cpp | 83 +++- indra/newview/llviewerobjectlist.h | 4 +- indra/newview/llviewerregion.cpp | 535 +++++++++++---------- indra/newview/llviewerregion.h | 134 +++--- indra/newview/llvocache.cpp | 684 ++++++++++++++++++++++++--- indra/newview/llvocache.h | 92 +++- indra/newview/llvovolume.cpp | 12 +- indra/newview/llworld.cpp | 32 +- 11 files changed, 1316 insertions(+), 399 deletions(-) create mode 100644 indra/llcommon/stringize.h diff --git a/indra/llcommon/stringize.h b/indra/llcommon/stringize.h new file mode 100644 index 000000000..72f2e58ce --- /dev/null +++ b/indra/llcommon/stringize.h @@ -0,0 +1,107 @@ +/** + * @file stringize.h + * @author Nat Goodspeed + * @date 2008-12-17 + * @brief stringize(item) template function and STRINGIZE(expression) macro + * + * $LicenseInfo:firstyear=2008&license=viewerlgpl$ + * Second Life Viewer Source Code + * Copyright (C) 2010, Linden Research, Inc. + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; + * version 2.1 of the License only. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + * + * Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA + * $/LicenseInfo$ + */ + +#if ! defined(LL_STRINGIZE_H) +#define LL_STRINGIZE_H + +#include +#include + +/** + * stringize(item) encapsulates an idiom we use constantly, using + * operator<<(std::ostringstream&, TYPE) followed by std::ostringstream::str() + * to render a string expressing some item. + */ +template +std::string stringize(const T& item) +{ + std::ostringstream out; + out << item; + return out.str(); +} + +/** + * stringize_f(functor) + */ +template +std::string stringize_f(Functor const & f) +{ + std::ostringstream out; + f(out); + return out.str(); +} + +/** + * STRINGIZE(item1 << item2 << item3 ...) effectively expands to the + * following: + * @code + * std::ostringstream out; + * out << item1 << item2 << item3 ... ; + * return out.str(); + * @endcode + */ +#define STRINGIZE(EXPRESSION) (stringize_f(boost::lambda::_1 << EXPRESSION)) + + +/** + * destringize(str) + * defined for symmetry with stringize + * *NOTE - this has distinct behavior from boost::lexical_cast regarding + * leading/trailing whitespace and handling of bad_lexical_cast exceptions + */ +template +T destringize(std::string const & str) +{ + T val; + std::istringstream in(str); + in >> val; + return val; +} + +/** + * destringize_f(str, functor) + */ +template +void destringize_f(std::string const & str, Functor const & f) +{ + std::istringstream in(str); + f(in); +} + +/** + * DESTRINGIZE(str, item1 >> item2 >> item3 ...) effectively expands to the + * following: + * @code + * std::istringstream in(str); + * in >> item1 >> item2 >> item3 ... ; + * @endcode + */ +#define DESTRINGIZE(STR, EXPRESSION) (destringize_f((STR), (boost::lambda::_1 >> EXPRESSION))) + + +#endif /* ! defined(LL_STRINGIZE_H) */ diff --git a/indra/newview/llappviewer.cpp b/indra/newview/llappviewer.cpp index fe0c476d1..cc06d65be 100644 --- a/indra/newview/llappviewer.cpp +++ b/indra/newview/llappviewer.cpp @@ -80,6 +80,7 @@ #include "llrender.h" #include "llfont.h" #include "llimagej2c.h" +#include "llvocache.h" #include "llweb.h" #include "llsecondlifeurls.h" @@ -1552,6 +1553,8 @@ bool LLAppViewer::cleanup() } #endif + llinfos << "Misc Cleanup" << llendflush; + // For safety, the LLVFS has to be deleted *after* LLVFSThread. This should be cleaned up. // (LLVFS doesn't know about LLVFSThread so can't kill pending requests) -Steve delete gStaticVFS; @@ -1566,6 +1569,7 @@ bool LLAppViewer::cleanup() LLWatchdog::getInstance()->cleanup(); + llinfos << "Shutting down message system" << llendflush; end_messaging_system(); llinfos << "Message system deleted." << llendflush; @@ -3041,11 +3045,23 @@ U32 LLAppViewer::getTextureCacheVersion() return TEXTURE_CACHE_VERSION ; } + +//static +U32 LLAppViewer::getObjectCacheVersion() +{ + // Viewer object cache version, change if object update + // format changes. JC + const U32 INDRA_OBJECT_CACHE_VERSION = 14; + + return INDRA_OBJECT_CACHE_VERSION; +} + bool LLAppViewer::initCache() { mPurgeCache = false; BOOL read_only = mSecondInstance ? TRUE : FALSE; - LLAppViewer::getTextureCache()->setReadOnly(read_only); + LLAppViewer::getTextureCache()->setReadOnly(read_only) ; + LLVOCache::getInstance()->setReadOnly(read_only); bool texture_cache_mismatch = false; if (gSavedSettings.getS32("LocalCacheVersion") != LLAppViewer::getTextureCacheVersion()) @@ -3125,6 +3141,8 @@ bool LLAppViewer::initCache() S64 extra = LLAppViewer::getTextureCache()->initCache(LL_PATH_CACHE, texture_cache_size, texture_cache_mismatch); texture_cache_size -= extra; + LLVOCache::getInstance()->initCache(LL_PATH_CACHE, gSavedSettings.getU32("CacheNumberOfRegionsForObjects"), getObjectCacheVersion()) ; + LLSplashScreen::update("Initializing VFS..."); // Init the VFS @@ -3281,8 +3299,9 @@ bool LLAppViewer::initCache() void LLAppViewer::purgeCache() { - LL_INFOS("AppCache") << "Purging Cache and Texture Cache..." << LL_ENDL; + LL_INFOS("AppCache") << "Purging Cache and Texture Cache..." << llendl; LLAppViewer::getTextureCache()->purgeCache(LL_PATH_CACHE); + LLVOCache::getInstance()->removeCache(LL_PATH_CACHE); std::string mask = "*.*"; gDirUtilp->deleteFilesInDir(gDirUtilp->getExpandedFilename(LL_PATH_CACHE, ""), mask); } @@ -4245,7 +4264,10 @@ void LLAppViewer::disconnectViewer() // This is where we used to call gObjectList.destroy() and then delete gWorldp. // Now we just ask the LLWorld singleton to cleanly shut down. - LLWorld::getInstance()->destroyClass(); + if(LLWorld::instanceExists()) + { + LLWorld::getInstance()->destroyClass(); + } // call all self-registered classes LLDestroyClassList::instance().fireCallbacks(); diff --git a/indra/newview/llappviewer.h b/indra/newview/llappviewer.h index d7f99c1bd..a1dde2646 100644 --- a/indra/newview/llappviewer.h +++ b/indra/newview/llappviewer.h @@ -96,7 +96,9 @@ public: static LLImageDecodeThread* getImageDecodeThread() { return sImageDecodeThread; } static LLTextureFetch* getTextureFetch() { return sTextureFetch; } - static U32 getTextureCacheVersion(); + static U32 getTextureCacheVersion() ; + static U32 getObjectCacheVersion() ; + const std::string& getSerialNumber() { return mSerialNumber; } bool getPurgeCache() const { return mPurgeCache; } diff --git a/indra/newview/llviewerobjectlist.cpp b/indra/newview/llviewerobjectlist.cpp index 36f451f04..31e10ef22 100644 --- a/indra/newview/llviewerobjectlist.cpp +++ b/indra/newview/llviewerobjectlist.cpp @@ -167,13 +167,13 @@ U64 LLViewerObjectList::getIndex(const U32 local_id, return (((U64)index) << 32) | (U64)local_id; } -BOOL LLViewerObjectList::removeFromLocalIDTable(const LLViewerObject &object) +BOOL LLViewerObjectList::removeFromLocalIDTable(const LLViewerObject* objectp) { - if(object.getRegion()) + if(objectp && objectp->getRegion()) { - U32 local_id = object.mLocalID; - U32 ip = object.getRegion()->getHost().getAddress(); - U32 port = object.getRegion()->getHost().getPort(); + U32 local_id = objectp->mLocalID; + U32 ip = objectp->getRegion()->getHost().getAddress(); + U32 port = objectp->getRegion()->getHost().getPort(); U64 ipport = (((U64)ip) << 32) | (U64)port; U32 index = sIPAndPortToIndex[ipport]; @@ -188,7 +188,7 @@ BOOL LLViewerObjectList::removeFromLocalIDTable(const LLViewerObject &object) } // Found existing entry - if (iter->second == object.getID()) + if (iter->second == objectp->getID()) { // Full UUIDs match, so remove the entry sIndexAndLocalIDToUUID.erase(iter); return TRUE; @@ -364,9 +364,11 @@ void LLViewerObjectList::processObjectUpdate(LLMessageSystem *mesgsys, mesgsys->getU32Fast(_PREHASH_ObjectData, _PREHASH_CRC, crc, i); // Lookup data packer and add this id to cache miss lists if necessary. - cached_dpp = regionp->getDP(id, crc); + U8 cache_miss_type = LLViewerRegion::CACHE_MISS_TYPE_NONE; + cached_dpp = regionp->getDP(id, crc, cache_miss_type); if (cached_dpp) { + // Cache Hit. cached_dpp->reset(); cached_dpp->unpackUUID(fullid, "ID"); cached_dpp->unpackU32(local_id, "LocalID"); @@ -374,6 +376,11 @@ void LLViewerObjectList::processObjectUpdate(LLMessageSystem *mesgsys, } else { + // Cache Miss. + #if LL_RECORD_VIEWER_STATS + LLViewerStatsRecorder::instance()->recordCacheMissEvent(id, update_type, cache_miss_type); + #endif + continue; // no data packer, skip this object } } @@ -465,7 +472,7 @@ void LLViewerObjectList::processObjectUpdate(LLMessageSystem *mesgsys, // << ", regionp " << (U32) regionp << ", object region " << (U32) objectp->getRegion() // << llendl; //} - removeFromLocalIDTable(*objectp); + removeFromLocalIDTable(objectp); setUUIDAndLocal(fullid, local_id, gMessageSystem->getSenderIP(), @@ -530,6 +537,7 @@ void LLViewerObjectList::processObjectUpdate(LLMessageSystem *mesgsys, llwarns << "Dead object " << objectp->mID << " in UUID map 1!" << llendl; } + bool bCached = false; if (compressed) { if (update_type != OUT_TERSE_IMPROVED) @@ -539,6 +547,7 @@ void LLViewerObjectList::processObjectUpdate(LLMessageSystem *mesgsys, processUpdateCore(objectp, user_data, i, update_type, &compressed_dp, justCreated); if (update_type != OUT_TERSE_IMPROVED) { + bCached = true; objectp->mRegionp->cacheFullUpdate(objectp, compressed_dp); } } @@ -557,7 +566,7 @@ void LLViewerObjectList::processObjectUpdate(LLMessageSystem *mesgsys, } objectp->setLastUpdateType(update_type); - objectp->setLastUpdateCached(cached); + objectp->setLastUpdateCached(bCached); } LLVOAvatar::cullAvatarsByPixelArea(); @@ -858,7 +867,7 @@ void LLViewerObjectList::cleanupReferences(LLViewerObject *objectp) // << objectp->getRegion()->getHost().getPort() << llendl; //} - removeFromLocalIDTable(*objectp); + removeFromLocalIDTable(objectp); if (objectp->onActiveList()) { @@ -1108,6 +1117,60 @@ void LLViewerObjectList::shiftObjects(const LLVector3 &offset) LLWorld::getInstance()->shiftRegions(offset); } +//debug code +bool LLViewerObjectList::hasMapObjectInRegion(LLViewerRegion* regionp) +{ + for (vobj_list_t::iterator iter = mMapObjects.begin(); iter != mMapObjects.end(); ++iter) + { + LLViewerObject* objectp = *iter; + + if(objectp->isDead() || objectp->getRegion() == regionp) + { + return true ; + } + } + + return false ; +} + +//make sure the region is cleaned up. +void LLViewerObjectList::clearAllMapObjectsInRegion(LLViewerRegion* regionp) +{ + std::set dead_object_list ; + std::set region_object_list ; + for (vobj_list_t::iterator iter = mMapObjects.begin(); iter != mMapObjects.end(); ++iter) + { + LLViewerObject* objectp = *iter; + + if(objectp->isDead()) + { + dead_object_list.insert(objectp) ; + } + else if(objectp->getRegion() == regionp) + { + region_object_list.insert(objectp) ; + } + } + + if(dead_object_list.size() > 0) + { + llwarns << "There are " << dead_object_list.size() << " dead objects on the map!" << llendl ; + + for(std::set::iterator iter = dead_object_list.begin(); iter != dead_object_list.end(); ++iter) + { + cleanupReferences(*iter) ; + } + } + if(region_object_list.size() > 0) + { + llwarns << "There are " << region_object_list.size() << " objects not removed from the deleted region!" << llendl ; + + for(std::set::iterator iter = region_object_list.begin(); iter != region_object_list.end(); ++iter) + { + (*iter)->markDead() ; + } + } +} void LLViewerObjectList::renderObjectsForMap(LLNetMap &netmap) { LLColor4 above_water_color = gColors.getColor( "NetMapOtherOwnAboveWater" ); diff --git a/indra/newview/llviewerobjectlist.h b/indra/newview/llviewerobjectlist.h index f2255d22e..ff655f832 100644 --- a/indra/newview/llviewerobjectlist.h +++ b/indra/newview/llviewerobjectlist.h @@ -96,6 +96,8 @@ public: void shiftObjects(const LLVector3 &offset); + bool hasMapObjectInRegion(LLViewerRegion* regionp) ; + void clearAllMapObjectsInRegion(LLViewerRegion* regionp) ; void renderObjectsForMap(LLNetMap &netmap); void renderObjectBounds(const LLVector3 ¢er); @@ -182,7 +184,7 @@ public: const U32 ip, const U32 port); // Requires knowledge of message system info! - static BOOL removeFromLocalIDTable(const LLViewerObject &object); + static BOOL removeFromLocalIDTable(const LLViewerObject* objectp); // Used ONLY by the orphaned object code. static U64 getIndex(const U32 local_id, const U32 ip, const U32 port); diff --git a/indra/newview/llviewerregion.cpp b/indra/newview/llviewerregion.cpp index fd1e82d1d..a6cbec632 100644 --- a/indra/newview/llviewerregion.cpp +++ b/indra/newview/llviewerregion.cpp @@ -58,6 +58,7 @@ #include "llsdutil.h" #include "llstartup.h" #include "lltrans.h" +#include "llurldispatcher.h" #include "llviewerobjectlist.h" #include "llviewerparceloverlay.h" #include "llvlmanager.h" @@ -66,16 +67,82 @@ #include "llvoclouds.h" #include "llworld.h" #include "llspatialpartition.h" - -// Viewer object cache version, change if object update -// format changes. JC -const U32 INDRA_OBJECT_CACHE_VERSION = 14; +#include "stringize.h" +#include "llviewercontrol.h" extern BOOL gNoRender; +#ifdef LL_WINDOWS + #pragma warning(disable:4355) +#endif + const F32 WATER_TEXTURE_SCALE = 8.f; // Number of times to repeat the water texture across a region const S16 MAX_MAP_DIST = 10; +typedef std::map CapabilityMap; + +class LLViewerRegionImpl { +public: + LLViewerRegionImpl(LLViewerRegion * region, LLHost const & host) + : mHost(host), + mCompositionp(NULL), + mEventPoll(NULL)//, + // I'd prefer to set the LLCapabilityListener name to match the region + // name -- it's disappointing that's not available at construction time. + // We could instead store an LLCapabilityListener*, making + // setRegionNameAndZone() replace the instance. Would that pose + // consistency problems? Can we even request a capability before calling + // setRegionNameAndZone()? + // For testability -- the new Michael Feathers paradigm -- + // LLCapabilityListener binds all the globals it expects to need at + // construction time. + //mCapabilityListener(host.getString(), gMessageSystem, *region, + //gAgent.getID(), gAgent.getSessionID()) + { + } + + // The surfaces and other layers + LLSurface* mLandp; + + // Region geometry data + LLVector3d mOriginGlobal; // Location of southwest corner of region (meters) + LLVector3d mCenterGlobal; // Location of center in world space (meters) + LLHost mHost; + + // The unique ID for this region. + LLUUID mRegionID; + + // region/estate owner - usually null. + LLUUID mOwnerID; + + // Network statistics for the region's circuit... + LLTimer mLastNetUpdate; + + // Misc + LLVLComposition *mCompositionp; // Composition layer for the surface + + LLVOCacheEntry::vocache_entry_map_t mCacheMap; + // time? + // LRU info? + + // Cache ID is unique per-region, across renames, moving locations, + // etc. + LLUUID mCacheID; + + CapabilityMap mCapabilities; + + LLEventPoll* mEventPoll; + + /// Post an event to this LLCapabilityListener to invoke a capability message on + /// this LLViewerRegion's server + /// (https://wiki.lindenlab.com/wiki/Viewer:Messaging/Messaging_Notes#Capabilities) + //LLCapabilityListener mCapabilityListener; + + //spatial partitions for objects in this region + std::vector mObjectPartition; + + LLHTTPClient::ResponderPtr mHttpResponderPtr ; +}; class BaseCapabilitiesComplete : public LLHTTPClient::Responder { @@ -153,15 +220,12 @@ LLViewerRegion::LLViewerRegion(const U64 &handle, const U32 grids_per_region_edge, const U32 grids_per_patch_edge, const F32 region_width_meters) -: mCenterGlobal(), +: mImpl(new LLViewerRegionImpl(this, host)), mHandle(handle), - mHost( host ), mTimeDilation(1.0f), mName(""), mZoning(""), - mOwnerID(), mIsEstateManager(FALSE), - mCompositionp(NULL), mRegionFlags( REGION_FLAGS_DEFAULT ), mSimAccess( SIM_ACCESS_MIN ), mBillableFactor(1.0), @@ -171,28 +235,32 @@ LLViewerRegion::LLViewerRegion(const U64 &handle, mColoName("unknown"), mProductSKU("unknown"), mProductName("unknown"), + mHttpUrl(""), mCacheLoaded(FALSE), - mCacheEntriesCount(0), - mCacheID(), - mEventPoll(NULL), - mReleaseNotesRequested(FALSE) + mCacheDirty(FALSE), + mReleaseNotesRequested(FALSE), + mCapabilitiesReceived(false) { mWidth = region_width_meters; - mOriginGlobal = from_region_handle(handle); + mImpl->mOriginGlobal = from_region_handle(handle); updateRenderMatrix(); - mLandp = new LLSurface('l', NULL); + mImpl->mLandp = new LLSurface('l', NULL); + if (!gNoRender) { // Create the composition layer for the surface - mCompositionp = new LLVLComposition(mLandp, grids_per_region_edge, region_width_meters/grids_per_region_edge); - mCompositionp->setSurface(mLandp); + mImpl->mCompositionp = + new LLVLComposition(mImpl->mLandp, + grids_per_region_edge, + region_width_meters / grids_per_region_edge); + mImpl->mCompositionp->setSurface(mImpl->mLandp); // Create the surfaces - mLandp->setRegion(this); - mLandp->create(grids_per_region_edge, + mImpl->mLandp->setRegion(this); + mImpl->mLandp->create(grids_per_region_edge, grids_per_patch_edge, - mOriginGlobal, + mImpl->mOriginGlobal, mWidth); } @@ -211,29 +279,26 @@ LLViewerRegion::LLViewerRegion(const U64 &handle, // Create the object lists initStats(); - mCacheStart.append(mCacheEnd); - //create object partitions //MUST MATCH declaration of eObjectPartitions - mObjectPartition.push_back(new LLHUDPartition()); //PARTITION_HUD - mObjectPartition.push_back(new LLTerrainPartition()); //PARTITION_TERRAIN - mObjectPartition.push_back(new LLVoidWaterPartition()); //PARTITION_VOIDWATER - mObjectPartition.push_back(new LLWaterPartition()); //PARTITION_WATER - mObjectPartition.push_back(new LLTreePartition()); //PARTITION_TREE - mObjectPartition.push_back(new LLParticlePartition()); //PARTITION_PARTICLE - mObjectPartition.push_back(new LLCloudPartition()); //PARTITION_CLOUD - mObjectPartition.push_back(new LLGrassPartition()); //PARTITION_GRASS - mObjectPartition.push_back(new LLVolumePartition()); //PARTITION_VOLUME - mObjectPartition.push_back(new LLBridgePartition()); //PARTITION_BRIDGE - mObjectPartition.push_back(new LLHUDParticlePartition());//PARTITION_HUD_PARTICLE - mObjectPartition.push_back(NULL); //PARTITION_NONE - + mImpl->mObjectPartition.push_back(new LLHUDPartition()); //PARTITION_HUD + mImpl->mObjectPartition.push_back(new LLTerrainPartition()); //PARTITION_TERRAIN + mImpl->mObjectPartition.push_back(new LLVoidWaterPartition()); //PARTITION_VOIDWATER + mImpl->mObjectPartition.push_back(new LLWaterPartition()); //PARTITION_WATER + mImpl->mObjectPartition.push_back(new LLTreePartition()); //PARTITION_TREE + mImpl->mObjectPartition.push_back(new LLParticlePartition()); //PARTITION_PARTICLE + mImpl->mObjectPartition.push_back(new LLCloudPartition()); //PARTITION_CLOUD + mImpl->mObjectPartition.push_back(new LLGrassPartition()); //PARTITION_GRASS + mImpl->mObjectPartition.push_back(new LLVolumePartition()); //PARTITION_VOLUME + mImpl->mObjectPartition.push_back(new LLBridgePartition()); //PARTITION_BRIDGE + mImpl->mObjectPartition.push_back(new LLHUDParticlePartition());//PARTITION_HUD_PARTICLE + mImpl->mObjectPartition.push_back(NULL); //PARTITION_NONE } void LLViewerRegion::initStats() { - mLastNetUpdate.reset(); + mImpl->mLastNetUpdate.reset(); mPacketsIn = 0; mBitsIn = 0; mLastBitsIn = 0; @@ -248,9 +313,9 @@ void LLViewerRegion::initStats() LLViewerRegion::~LLViewerRegion() { - if(mHttpResponderPtr) + if(mImpl->mHttpResponderPtr) { - (static_cast(mHttpResponderPtr.get()))->setRegion(NULL) ; + (static_cast(mImpl->mHttpResponderPtr.get()))->setRegion(NULL) ; } gVLManager.cleanupData(this); @@ -262,19 +327,47 @@ LLViewerRegion::~LLViewerRegion() gObjectList.killObjects(this); - delete mCompositionp; + delete mImpl->mCompositionp; delete mParcelOverlay; - delete mLandp; - delete mEventPoll; - LLHTTPSender::clearSender(mHost); + delete mImpl->mLandp; + delete mImpl->mEventPoll; + LLHTTPSender::clearSender(mImpl->mHost); - saveCache(); + saveObjectCache(); - std::for_each(mObjectPartition.begin(), mObjectPartition.end(), DeletePointer()); + std::for_each(mImpl->mObjectPartition.begin(), mImpl->mObjectPartition.end(), DeletePointer()); + + delete mImpl; + mImpl = NULL; } +/*LLEventPump& LLViewerRegion::getCapAPI() const +{ + return mImpl->mCapabilityListener.getCapAPI(); +}*/ -void LLViewerRegion::loadCache() +/*virtual*/ +const LLHost& LLViewerRegion::getHost() const +{ + return mImpl->mHost; +} + +LLSurface & LLViewerRegion::getLand() const +{ + return *mImpl->mLandp; +} + +const LLUUID& LLViewerRegion::getRegionID() const +{ + return mImpl->mRegionID; +} + +void LLViewerRegion::setRegionID(const LLUUID& region_id) +{ + mImpl->mRegionID = region_id; +} + +void LLViewerRegion::loadObjectCache() { if (mCacheLoaded) { @@ -284,154 +377,46 @@ void LLViewerRegion::loadCache() // Presume success. If it fails, we don't want to try again. mCacheLoaded = TRUE; - LLVOCacheEntry *entry; - - std::string filename; - filename = gDirUtilp->getExpandedFilename(LL_PATH_CACHE,"") + gDirUtilp->getDirDelimiter() + - llformat("objects_%d_%d.slc",U32(mHandle>>32)/REGION_WIDTH_UNITS, U32(mHandle)/REGION_WIDTH_UNITS ); - - LLFILE* fp = LLFile::fopen(filename, "rb"); /* Flawfinder: ignore */ - if (!fp) + if(LLVOCache::hasInstance()) { - // might not have a file, which is normal - return; + LLVOCache::getInstance()->readFromCache(mHandle, mImpl->mCacheID, mImpl->mCacheMap) ; } - - U32 zero; - size_t nread; - nread = fread(&zero, sizeof(U32), 1, fp); - if (nread != 1 || zero) - { - // a non-zero value here means bad things! - // skip reading the cached values - llinfos << "Cache file invalid" << llendl; - fclose(fp); - return; - } - - U32 version; - nread = fread(&version, sizeof(U32), 1, fp); - if (nread != 1 || version != INDRA_OBJECT_CACHE_VERSION) - { - // a version mismatch here means we've changed the binary format! - // skip reading the cached values - llinfos << "Cache version changed, discarding" << llendl; - fclose(fp); - return; - } - - LLUUID cache_id; - nread = fread(&cache_id.mData, 1, UUID_BYTES, fp); - if (nread != (size_t)UUID_BYTES || mCacheID != cache_id) - { - llinfos << "Cache ID doesn't match for this region, discarding" - << llendl; - fclose(fp); - return; - } - - S32 num_entries; - nread = fread(&num_entries, sizeof(S32), 1, fp); - if (nread != 1) - { - llinfos << "Short read, discarding" << llendl; - fclose(fp); - return; - } - - S32 i; - for (i = 0; i < num_entries; i++) - { - entry = new LLVOCacheEntry(fp); - if (!entry->getLocalID()) - { - llwarns << "Aborting cache file load for " << filename << ", cache file corruption!" << llendl; - delete entry; - entry = NULL; - break; - } - mCacheEnd.insert(*entry); - mCacheMap[entry->getLocalID()] = entry; - mCacheEntriesCount++; - } - - fclose(fp); } -void LLViewerRegion::saveCache() +void LLViewerRegion::saveObjectCache() { if (!mCacheLoaded) { return; } - S32 num_entries = mCacheEntriesCount; - if (0 == num_entries) + if (mImpl->mCacheMap.empty()) { return; } - std::string filename; - filename = gDirUtilp->getExpandedFilename(LL_PATH_CACHE,"") + gDirUtilp->getDirDelimiter() + - llformat("objects_%d_%d.slc", U32(mHandle>>32)/REGION_WIDTH_UNITS, U32(mHandle)/REGION_WIDTH_UNITS ); - - LLFILE* fp = LLFile::fopen(filename, "wb"); /* Flawfinder: ignore */ - if (!fp) + if(LLVOCache::hasInstance()) { - llwarns << "Unable to write cache file " << filename << llendl; - return; + LLVOCache::getInstance()->writeToCache(mHandle, mImpl->mCacheID, mImpl->mCacheMap, mCacheDirty) ; + mCacheDirty = FALSE; } - // write out zero to indicate a version cache file - U32 zero = 0; - if (fwrite(&zero, sizeof(U32), 1, fp) != 1) + for(LLVOCacheEntry::vocache_entry_map_t::iterator iter = mImpl->mCacheMap.begin(); iter != mImpl->mCacheMap.end(); ++iter) { - llwarns << "Short write" << llendl; + delete iter->second; } - - // write out version number - U32 version = INDRA_OBJECT_CACHE_VERSION; - if (fwrite(&version, sizeof(U32), 1, fp) != 1) - { - llwarns << "Short write" << llendl; - } - - // write the cache id for this sim - if (fwrite(&mCacheID.mData, 1, UUID_BYTES, fp) != (size_t)UUID_BYTES) - { - llwarns << "Short write" << llendl; - } - - if (fwrite(&num_entries, sizeof(S32), 1, fp) != 1) - { - llwarns << "Short write" << llendl; - } - - LLVOCacheEntry *entry; - - for (entry = mCacheStart.getNext(); entry && (entry != &mCacheEnd); entry = entry->getNext()) - { - entry->writeToFile(fp); - } - - mCacheMap.clear(); - mCacheEnd.unlink(); - mCacheEnd.init(); - mCacheStart.deleteAll(); - mCacheStart.init(); - - fclose(fp); + mImpl->mCacheMap.clear(); } void LLViewerRegion::sendMessage() { - gMessageSystem->sendMessage(mHost); + gMessageSystem->sendMessage(mImpl->mHost); } void LLViewerRegion::sendReliableMessage() { - gMessageSystem->sendReliable(mHost); + gMessageSystem->sendReliable(mImpl->mHost); } void LLViewerRegion::setFlags(BOOL b, U32 flags) @@ -448,12 +433,12 @@ void LLViewerRegion::setFlags(BOOL b, U32 flags) void LLViewerRegion::setWaterHeight(F32 water_level) { - mLandp->setWaterHeight(water_level); + mImpl->mLandp->setWaterHeight(water_level); } F32 LLViewerRegion::getWaterHeight() const { - return mLandp->getWaterHeight(); + return mImpl->mLandp->getWaterHeight(); } BOOL LLViewerRegion::isVoiceEnabled() const @@ -469,9 +454,9 @@ void LLViewerRegion::setRegionFlags(U32 flags) void LLViewerRegion::setOriginGlobal(const LLVector3d &origin_global) { - mOriginGlobal = origin_global; + mImpl->mOriginGlobal = origin_global; updateRenderMatrix(); - mLandp->setOriginGlobal(origin_global); + mImpl->mLandp->setOriginGlobal(origin_global); mWind.setOriginGlobal(origin_global); mCloudLayer.setOriginGlobal(origin_global); calculateCenterGlobal(); @@ -487,16 +472,34 @@ void LLViewerRegion::setTimeDilation(F32 time_dilation) mTimeDilation = time_dilation; } +const LLVector3d & LLViewerRegion::getOriginGlobal() const +{ + return mImpl->mOriginGlobal; +} LLVector3 LLViewerRegion::getOriginAgent() const { - return gAgent.getPosAgentFromGlobal(mOriginGlobal); + return gAgent.getPosAgentFromGlobal(mImpl->mOriginGlobal); } +const LLVector3d & LLViewerRegion::getCenterGlobal() const +{ + return mImpl->mCenterGlobal; +} LLVector3 LLViewerRegion::getCenterAgent() const { - return gAgent.getPosAgentFromGlobal(mCenterGlobal); + return gAgent.getPosAgentFromGlobal(mImpl->mCenterGlobal); +} + +void LLViewerRegion::setOwner(const LLUUID& owner_id) +{ + mImpl->mOwnerID = owner_id; +} + +const LLUUID& LLViewerRegion::getOwner() const +{ + return mImpl->mOwnerID; } void LLViewerRegion::setRegionNameAndZone (const std::string& name_zone) @@ -646,7 +649,10 @@ void LLViewerRegion::processRegionInfo(LLMessageSystem* msg, void**) LLFloaterReporter::processRegionInfo(msg); } - +void LLViewerRegion::setCacheID(const LLUUID& id) +{ + mImpl->mCacheID = id; +} S32 LLViewerRegion::renderPropertyLines() { @@ -673,7 +679,7 @@ void LLViewerRegion::dirtyHeights() BOOL LLViewerRegion::idleUpdate(F32 max_update_time) { // did_update returns TRUE if we did at least one significant update - BOOL did_update = mLandp->idleUpdate(max_update_time); + BOOL did_update = mImpl->mLandp->idleUpdate(max_update_time); if (mParcelOverlay) { @@ -688,7 +694,7 @@ BOOL LLViewerRegion::idleUpdate(F32 max_update_time) // As above, but forcibly do the update. void LLViewerRegion::forceUpdate() { - mLandp->idleUpdate(0.f); + mImpl->mLandp->idleUpdate(0.f); if (mParcelOverlay) { @@ -698,17 +704,21 @@ void LLViewerRegion::forceUpdate() void LLViewerRegion::connectNeighbor(LLViewerRegion *neighborp, U32 direction) { - mLandp->connectNeighbor(neighborp->mLandp, direction); + mImpl->mLandp->connectNeighbor(neighborp->mImpl->mLandp, direction); mCloudLayer.connectNeighbor(&(neighborp->mCloudLayer), direction); } void LLViewerRegion::disconnectAllNeighbors() { - mLandp->disconnectAllNeighbors(); + mImpl->mLandp->disconnectAllNeighbors(); mCloudLayer.disconnectAllNeighbors(); } +LLVLComposition * LLViewerRegion::getComposition() const +{ + return mImpl->mCompositionp; +} F32 LLViewerRegion::getCompositionXY(const S32 x, const S32 y) const { @@ -802,10 +812,10 @@ F32 LLViewerRegion::getCompositionXY(const S32 x, const S32 y) const void LLViewerRegion::calculateCenterGlobal() { - mCenterGlobal = mOriginGlobal; - mCenterGlobal.mdV[VX] += 0.5 * mWidth; - mCenterGlobal.mdV[VY] += 0.5 * mWidth; - mCenterGlobal.mdV[VZ] = 0.5*mLandp->getMinZ() + mLandp->getMaxZ(); + mImpl->mCenterGlobal = mImpl->mOriginGlobal; + mImpl->mCenterGlobal.mdV[VX] += 0.5 * mWidth; + mImpl->mCenterGlobal.mdV[VY] += 0.5 * mWidth; + mImpl->mCenterGlobal.mdV[VZ] = 0.5 * mImpl->mLandp->getMinZ() + mImpl->mLandp->getMaxZ(); } void LLViewerRegion::calculateCameraDistance() @@ -821,8 +831,17 @@ U32 LLViewerRegion::getNetDetailsForLCD() std::ostream& operator<<(std::ostream &s, const LLViewerRegion ®ion) { s << "{ "; - s << region.mHost; + s << region.mImpl->mHost; s << " mOriginGlobal = " << region.getOriginGlobal()<< "\n"; + std::string name(region.getName()), zone(region.getZoning()); + if (! name.empty()) + { + s << " mName = " << name << '\n'; + } + if (! zone.empty()) + { + s << " mZoning = " << zone << '\n'; + } s << "}"; return s; } @@ -832,9 +851,9 @@ std::ostream& operator<<(std::ostream &s, const LLViewerRegion ®ion) void LLViewerRegion::updateNetStats() { - F32 dt = mLastNetUpdate.getElapsedTimeAndResetF32(); + F32 dt = mImpl->mLastNetUpdate.getElapsedTimeAndResetF32(); - LLCircuitData *cdp = gMessageSystem->mCircuitInfo.findCircuit(mHost); + LLCircuitData *cdp = gMessageSystem->mCircuitInfo.findCircuit(mImpl->mHost); if (!cdp) { mAlive = false; @@ -863,10 +882,10 @@ void LLViewerRegion::updateNetStats() U32 LLViewerRegion::getPacketsLost() const { - LLCircuitData *cdp = gMessageSystem->mCircuitInfo.findCircuit(mHost); + LLCircuitData *cdp = gMessageSystem->mCircuitInfo.findCircuit(mImpl->mHost); if (!cdp) { - llinfos << "LLViewerRegion::getPacketsLost couldn't find circuit for " << mHost << llendl; + llinfos << "LLViewerRegion::getPacketsLost couldn't find circuit for " << mImpl->mHost << llendl; return 0; } else @@ -875,6 +894,16 @@ U32 LLViewerRegion::getPacketsLost() const } } +void LLViewerRegion::setHttpResponderPtrNULL() +{ + mImpl->mHttpResponderPtr = NULL; +} + +const LLHTTPClient::ResponderPtr LLViewerRegion::getHttpResponderPtr() const +{ + return mImpl->mHttpResponderPtr; +} + BOOL LLViewerRegion::pointInRegionGlobal(const LLVector3d &point_global) const { LLVector3 pos_region = getPosRegionFromGlobal(point_global); @@ -901,7 +930,7 @@ BOOL LLViewerRegion::pointInRegionGlobal(const LLVector3d &point_global) const LLVector3 LLViewerRegion::getPosRegionFromGlobal(const LLVector3d &point_global) const { LLVector3 pos_region; - pos_region.setVec(point_global - mOriginGlobal); + pos_region.setVec(point_global - mImpl->mOriginGlobal); return pos_region; } @@ -909,7 +938,7 @@ LLVector3d LLViewerRegion::getPosGlobalFromRegion(const LLVector3 &pos_region) c { LLVector3d pos_region_d; pos_region_d.setVec(pos_region); - return pos_region_d + mOriginGlobal; + return pos_region_d + mImpl->mOriginGlobal; } LLVector3 LLViewerRegion::getPosAgentFromRegion(const LLVector3 &pos_region) const @@ -926,7 +955,7 @@ LLVector3 LLViewerRegion::getPosRegionFromAgent(const LLVector3 &pos_agent) cons F32 LLViewerRegion::getLandHeightRegion(const LLVector3& region_pos) { - return mLandp->resolveHeightRegion( region_pos ); + return mImpl->mLandp->resolveHeightRegion( region_pos ); } bool LLViewerRegion::isAlive() @@ -1078,7 +1107,7 @@ void LLViewerRegion::updateCoarseLocations(LLMessageSystem* msg) // treat the target specially for the map if(i == target_index) { - LLVector3d global_pos(mOriginGlobal); + LLVector3d global_pos(mImpl->mOriginGlobal); global_pos.mdV[VX] += (F64)(x_pos); global_pos.mdV[VY] += (F64)(y_pos); global_pos.mdV[VZ] += (F64)(z_pos) * 4.0; @@ -1113,12 +1142,12 @@ void LLViewerRegion::getInfo(LLSD& info) info["Region"]["Handle"]["y"] = (LLSD::Integer)y; } -void LLViewerRegion::cacheFullUpdate(LLViewerObject* objectp, LLDataPackerBinaryBuffer &dp) +LLViewerRegion::eCacheUpdateResult LLViewerRegion::cacheFullUpdate(LLViewerObject* objectp, LLDataPackerBinaryBuffer &dp) { U32 local_id = objectp->getLocalID(); U32 crc = objectp->getCRC(); - LLVOCacheEntry* entry = get_if_there(mCacheMap, local_id, (LLVOCacheEntry*)NULL); + LLVOCacheEntry* entry = get_if_there(mImpl->mCacheMap, local_id, (LLVOCacheEntry*)NULL); if (entry) { @@ -1127,45 +1156,40 @@ void LLViewerRegion::cacheFullUpdate(LLViewerObject* objectp, LLDataPackerBinary { // Record a hit entry->recordDupe(); + return CACHE_UPDATE_DUPE; } - else - { - // Update the cache entry - mCacheMap.erase(local_id); - delete entry; - entry = new LLVOCacheEntry(local_id, crc, dp); - mCacheEnd.insert(*entry); - mCacheMap[local_id] = entry; - } - } - else - { - // we haven't seen this object before - // Create new entry and add to map - if (mCacheEntriesCount > MAX_OBJECT_CACHE_ENTRIES) - { - entry = mCacheStart.getNext(); - mCacheMap.erase(entry->getLocalID()); - delete entry; - mCacheEntriesCount--; - } + // Update the cache entry + mImpl->mCacheMap.erase(local_id); + delete entry; entry = new LLVOCacheEntry(local_id, crc, dp); - - mCacheEnd.insert(*entry); - mCacheMap[local_id] = entry; - mCacheEntriesCount++; + mImpl->mCacheMap[local_id] = entry; + return CACHE_UPDATE_CHANGED; } - return ; + + // we haven't seen this object before + + // Create new entry and add to map + eCacheUpdateResult result = CACHE_UPDATE_ADDED; + if (mImpl->mCacheMap.size() > MAX_OBJECT_CACHE_ENTRIES) + { + mImpl->mCacheMap.erase(mImpl->mCacheMap.begin()); + result = CACHE_UPDATE_REPLACED; + + } + entry = new LLVOCacheEntry(local_id, crc, dp); + + mImpl->mCacheMap[local_id] = entry; + return result; } // Get data packer for this object, if we have cached data // AND the CRC matches. JC -LLDataPacker *LLViewerRegion::getDP(U32 local_id, U32 crc) +LLDataPacker *LLViewerRegion::getDP(U32 local_id, U32 crc, U8 &cache_miss_type) { - llassert(mCacheLoaded); + //llassert(mCacheLoaded); This assert failes often, changing to early-out -- davep, 2010/10/18 - LLVOCacheEntry* entry = get_if_there(mCacheMap, local_id, (LLVOCacheEntry*)NULL); + LLVOCacheEntry* entry = get_if_there(mImpl->mCacheMap, local_id, (LLVOCacheEntry*)NULL); if (entry) { @@ -1174,19 +1198,23 @@ LLDataPacker *LLViewerRegion::getDP(U32 local_id, U32 crc) { // Record a hit entry->recordHit(); + cache_miss_type = CACHE_MISS_TYPE_NONE; return entry->getDP(crc); } else { // llinfos << "CRC miss for " << local_id << llendl; + cache_miss_type = CACHE_MISS_TYPE_CRC; mCacheMissCRC.put(local_id); } } else { // llinfos << "Cache miss for " << local_id << llendl; + cache_miss_type = CACHE_MISS_TYPE_FULL; mCacheMissFull.put(local_id); } + return NULL; } @@ -1206,9 +1234,6 @@ void LLViewerRegion::requestCacheMisses() S32 blocks = 0; S32 i; - const U8 CACHE_MISS_TYPE_FULL = 0; - const U8 CACHE_MISS_TYPE_CRC = 1; - // Send full cache miss updates. For these, we KNOW we don't // have a viewer object. for (i = 0; i < full_count; i++) @@ -1269,7 +1294,13 @@ void LLViewerRegion::requestCacheMisses() mCacheMissFull.reset(); mCacheMissCRC.reset(); + mCacheDirty = TRUE ; // llinfos << "KILLDEBUG Sent cache miss full " << full_count << " crc " << crc_count << llendl; + #if LL_RECORD_VIEWER_STATS + LLViewerStatsRecorder::instance()->beginObjectUpdateEvents(this); + LLViewerStatsRecorder::instance()->recordRequestCacheMissesEvent(full_count + crc_count); + LLViewerStatsRecorder::instance()->endObjectUpdateEvents(); + #endif } void LLViewerRegion::dumpCache() @@ -1286,9 +1317,10 @@ void LLViewerRegion::dumpCache() } LLVOCacheEntry *entry; - - for (entry = mCacheStart.getNext(); entry && (entry != &mCacheEnd); entry = entry->getNext()) + for(LLVOCacheEntry::vocache_entry_map_t::iterator iter = mImpl->mCacheMap.begin(); iter != mImpl->mCacheMap.end(); ++iter) { + entry = iter->second ; + S32 hits = entry->getHitCount(); S32 changes = entry->getCRCChangeCount(); @@ -1299,7 +1331,7 @@ void LLViewerRegion::dumpCache() change_bin[changes]++; } - llinfos << "Count " << mCacheEntriesCount << llendl; + llinfos << "Count " << mImpl->mCacheMap.size() << llendl; for (i = 0; i < BINS; i++) { llinfos << "Hits " << i << " " << hit_bin[i] << llendl; @@ -1419,7 +1451,7 @@ void LLViewerRegion::unpackRegionHandshake() // Now that we have the name, we can load the cache file // off disk. - loadCache(); + loadObjectCache(); // After loading cache, signal that simulator can start // sending data. @@ -1436,15 +1468,16 @@ void LLViewerRegion::unpackRegionHandshake() void LLViewerRegion::setSeedCapability(const std::string& url) { - if (getCapability("Seed") == url) + if (getCapability("Seed") == url) { - llwarns << "Ignoring duplicate seed capability" << llendl; - return; + // llwarns << "Ignoring duplicate seed capability" << llendl; + return; } - delete mEventPoll; - mEventPoll = NULL; - mCapabilities.clear(); + delete mImpl->mEventPoll; + mImpl->mEventPoll = NULL; + + mImpl->mCapabilities.clear(); setCapability("Seed", url); LLSD capabilityNames = LLSD::emptyArray(); @@ -1460,9 +1493,10 @@ void LLViewerRegion::setSeedCapability(const std::string& url) capabilityNames.append("FetchInventory"); capabilityNames.append("FetchInventoryDescendents"); } + capabilityNames.append("GetDisplayNames"); capabilityNames.append("GetTexture"); capabilityNames.append("GroupProposalBallot"); - capabilityNames.append("GetDisplayNames"); + capabilityNames.append("HomeLocation"); capabilityNames.append("MapLayer"); capabilityNames.append("MapLayerGod"); @@ -1480,8 +1514,8 @@ void LLViewerRegion::setSeedCapability(const std::string& url) capabilityNames.append("SendPostcard"); capabilityNames.append("SendUserReport"); capabilityNames.append("SendUserReportWithScreenshot"); - capabilityNames.append("SetDisplayName"); capabilityNames.append("ServerReleaseNotes"); + capabilityNames.append("SetDisplayName"); capabilityNames.append("StartGroupProposal"); capabilityNames.append("TextureStats"); capabilityNames.append("UntrustedSimulatorMessage"); @@ -1501,25 +1535,29 @@ void LLViewerRegion::setSeedCapability(const std::string& url) llinfos << "posting to seed " << url << llendl; - mHttpResponderPtr = BaseCapabilitiesComplete::build(this) ; - LLHTTPClient::post(url, capabilityNames, mHttpResponderPtr); + mImpl->mHttpResponderPtr = BaseCapabilitiesComplete::build(this) ; + LLHTTPClient::post(url, capabilityNames, mImpl->mHttpResponderPtr); } void LLViewerRegion::setCapability(const std::string& name, const std::string& url) { if(name == "EventQueueGet") { - delete mEventPoll; - mEventPoll = NULL; - mEventPoll = new LLEventPoll(url, getHost()); + delete mImpl->mEventPoll; + mImpl->mEventPoll = NULL; + mImpl->mEventPoll = new LLEventPoll(url, getHost()); } else if(name == "UntrustedSimulatorMessage") { - LLHTTPSender::setSender(mHost, new LLCapHTTPSender(url)); + LLHTTPSender::setSender(mImpl->mHost, new LLCapHTTPSender(url)); } else { - mCapabilities[name] = url; + mImpl->mCapabilities[name] = url; + if(name == "GetTexture") + { + mHttpUrl = url ; + } } } @@ -1530,8 +1568,8 @@ bool LLViewerRegion::isSpecialCapabilityName(const std::string &name) std::string LLViewerRegion::getCapability(const std::string& name) const { - CapabilityMap::const_iterator iter = mCapabilities.find(name); - if(iter == mCapabilities.end()) + CapabilityMap::const_iterator iter = mImpl->mCapabilities.find(name); + if(iter == mImpl->mCapabilities.end()) { return ""; } @@ -1552,7 +1590,7 @@ void LLViewerRegion::logActiveCapabilities() const { int count = 0; CapabilityMap::const_iterator iter; - for (iter = mCapabilities.begin(); iter != mCapabilities.end(); iter++, count++) + for (iter = mImpl->mCapabilities.begin(); iter != mImpl->mCapabilities.end(); ++iter, ++count) { if (!iter->second.empty()) { @@ -1564,9 +1602,9 @@ void LLViewerRegion::logActiveCapabilities() const LLSpatialPartition* LLViewerRegion::getSpatialPartition(U32 type) { - if (type < mObjectPartition.size()) + if (type < mImpl->mObjectPartition.size()) { - return mObjectPartition[type]; + return mImpl->mObjectPartition[type]; } return NULL; } @@ -1585,3 +1623,8 @@ void LLViewerRegion::showReleaseNotes() LLWeb::loadURL(url); mReleaseNotesRequested = FALSE; } + +std::string LLViewerRegion::getDescription() const +{ + return stringize(*this); +} diff --git a/indra/newview/llviewerregion.h b/indra/newview/llviewerregion.h index 67f0ff496..645c240fc 100644 --- a/indra/newview/llviewerregion.h +++ b/indra/newview/llviewerregion.h @@ -42,18 +42,18 @@ #include "llcloud.h" #include "llstat.h" #include "v3dmath.h" -#include "llhost.h" #include "llstring.h" #include "llregionflags.h" #include "lluuid.h" -#include "lldatapacker.h" -#include "llvocache.h" #include "llweb.h" +#include "llcapabilityprovider.h" +#include "m4math.h" // LLMatrix4 +#include "llhttpclient.h" // Surface id's #define LAND 1 #define WATER 2 -const U32 MAX_OBJECT_CACHE_ENTRIES = 10000; +const U32 MAX_OBJECT_CACHE_ENTRIES = 50000; class LLEventPoll; @@ -66,8 +66,16 @@ class LLSurface; class LLVOCache; class LLVOCacheEntry; class LLSpatialPartition; +class LLEventPump; +//class LLCapabilityListener; +class LLDataPacker; +class LLDataPackerBinaryBuffer; +class LLHost; +class LLBBox; -class LLViewerRegion +class LLViewerRegionImpl; + +class LLViewerRegion: public LLCapabilityProvider // implements this interface { public: //MUST MATCH THE ORDER OF DECLARATION IN CONSTRUCTOR @@ -96,9 +104,8 @@ public: ~LLViewerRegion(); // Call this after you have the region name and handle. - void loadCache(); - - void saveCache(); + void loadObjectCache(); + void saveObjectCache(); void sendMessage(); // Send the current message to this region's simulator void sendReliableMessage(); // Send the current message to this region's simulator @@ -161,19 +168,19 @@ public: F32 getTimeDilation() const { return mTimeDilation; } // Origin height is at zero. - const LLVector3d &getOriginGlobal() const { return mOriginGlobal; } + const LLVector3d &getOriginGlobal() const; LLVector3 getOriginAgent() const; // Center is at the height of the water table. - const LLVector3d &getCenterGlobal() const { return mCenterGlobal; } + const LLVector3d &getCenterGlobal() const; LLVector3 getCenterAgent() const; void setRegionNameAndZone(const std::string& name_and_zone); const std::string& getName() const { return mName; } const std::string& getZoning() const { return mZoning; } - void setOwner(const LLUUID& owner_id) { mOwnerID = owner_id; } - const LLUUID& getOwner() const { return mOwnerID; } + void setOwner(const LLUUID& owner_id); + const LLUUID& getOwner() const; // Is the current agent on the estate manager list for this region? void setIsEstateManager(BOOL b) { mIsEstateManager = b; } @@ -205,7 +212,7 @@ public: // can process the message. static void processRegionInfo(LLMessageSystem* msg, void**); - void setCacheID(const LLUUID& id) { mCacheID = id; } + void setCacheID(const LLUUID& id); F32 getWidth() const { return mWidth; } @@ -221,27 +228,35 @@ public: U32 getPacketsLost() const; - void setHttpResponderPtrNULL() {mHttpResponderPtr = NULL ;} - const LLHTTPClient::ResponderPtr getHttpResponderPtr() const {return mHttpResponderPtr ;} + void setHttpResponderPtrNULL(); + const LLHTTPClient::ResponderPtr getHttpResponderPtr() const; // Get/set named capability URLs for this region. void setSeedCapability(const std::string& url); void setCapability(const std::string& name, const std::string& url); - std::string getCapability(const std::string& name) const; - static bool isSpecialCapabilityName(const std::string &name); - void logActiveCapabilities() const; + // implements LLCapabilityProvider + virtual std::string getCapability(const std::string& name) const; + // has region received its final (not seed) capability list? bool capabilitiesReceived() const; void setCapabilitiesReceived(bool received); - const LLHost &getHost() const { return mHost; } + static bool isSpecialCapabilityName(const std::string &name); + void logActiveCapabilities() const; + + /// Get LLEventPump on which we listen for capability requests + /// (https://wiki.lindenlab.com/wiki/Viewer:Messaging/Messaging_Notes#Capabilities) + // LLEventPump& getCapAPI() const; + + /// implements LLCapabilityProvider + /*virtual*/ const LLHost& getHost() const; const U64 &getHandle() const { return mHandle; } - LLSurface &getLand() const { return *mLandp; } + LLSurface &getLand() const; // set and get the region id - const LLUUID& getRegionID() const { return mRegionID; } - void setRegionID(const LLUUID& region_id) { mRegionID = region_id; } + const LLUUID& getRegionID() const; + void setRegionID(const LLUUID& region_id); BOOL pointInRegionGlobal(const LLVector3d &point_global) const; LLVector3 getPosRegionFromGlobal(const LLVector3d &point_global) const; @@ -249,7 +264,7 @@ public: LLVector3 getPosAgentFromRegion(const LLVector3 ®ion_pos) const; LLVector3d getPosGlobalFromRegion(const LLVector3 &offset) const; - LLVLComposition *getComposition() const { return mCompositionp; } + LLVLComposition *getComposition() const; F32 getCompositionXY(const S32 x, const S32 y) const; BOOL isOwnedSelf(const LLVector3& pos); @@ -263,10 +278,26 @@ public: F32 getLandHeightRegion(const LLVector3& region_pos); void getInfo(LLSD& info); + + + typedef enum + { + CACHE_MISS_TYPE_FULL = 0, + CACHE_MISS_TYPE_CRC, + CACHE_MISS_TYPE_NONE + } eCacheMissType; + + typedef enum + { + CACHE_UPDATE_DUPE = 0, + CACHE_UPDATE_CHANGED, + CACHE_UPDATE_ADDED, + CACHE_UPDATE_REPLACED + } eCacheUpdateResult; // handle a full update message - void cacheFullUpdate(LLViewerObject* objectp, LLDataPackerBinaryBuffer &dp); - LLDataPacker *getDP(U32 local_id, U32 crc); + eCacheUpdateResult cacheFullUpdate(LLViewerObject* objectp, LLDataPackerBinaryBuffer &dp); + LLDataPacker *getDP(U32 local_id, U32 crc, U8 &cache_miss_type); void requestCacheMisses(); void addCacheMissFull(const U32 local_id); @@ -281,8 +312,14 @@ public: // used by LCD to get details for debug screen U32 getNetDetailsForLCD(); + + /// implements LLCapabilityProvider + virtual std::string getDescription() const; + std::string getHttpUrl() const { return mHttpUrl ;} LLSpatialPartition* getSpatialPartition(U32 type); + + bool objectIsReturnable(const LLVector3& pos, const std::vector& boxes) const; public: struct CompareDistance { @@ -319,34 +356,19 @@ public: LLDynamicArray mMapAvatarIDs; private: - // The surfaces and other layers - LLSurface* mLandp; + LLViewerRegionImpl * mImpl; - // Region geometry data - LLVector3d mOriginGlobal; // Location of southwest corner of region (meters) - LLVector3d mCenterGlobal; // Location of center in world space (meters) F32 mWidth; // Width of region on a side (meters) - U64 mHandle; - LLHost mHost; - - // The unique ID for this region. - LLUUID mRegionID; - F32 mTimeDilation; // time dilation of physics simulation on simulator // simulator name std::string mName; std::string mZoning; - // region/estate owner - usually null. - LLUUID mOwnerID; - // Is this agent on the estate managers list for this region? BOOL mIsEstateManager; - // Network statistics for the region's circuit... - LLTimer mLastNetUpdate; U32 mPacketsIn; U32 mBitsIn; U32 mLastBitsIn; @@ -358,9 +380,6 @@ private: U32 mPingDelay; F32 mDeltaTime; // Time since last measurement of lastPackets, Bits, etc - // Misc - LLVLComposition *mCompositionp; // Composition layer for the surface - U32 mRegionFlags; // includes damage flags U8 mSimAccess; F32 mBillableFactor; @@ -370,43 +389,24 @@ private: // Information for Homestead / CR-53 S32 mClassID; S32 mCPURatio; + std::string mColoName; std::string mProductSKU; std::string mProductName; - + std::string mHttpUrl ; // Maps local ids to cache entries. // Regions can have order 10,000 objects, so assume // a structure of size 2^14 = 16,000 BOOL mCacheLoaded; - typedef std::map cache_map_t; - cache_map_t mCacheMap; - LLVOCacheEntry mCacheStart; - LLVOCacheEntry mCacheEnd; - U32 mCacheEntriesCount; + BOOL mCacheDirty; + LLDynamicArray mCacheMissFull; LLDynamicArray mCacheMissCRC; - // time? - // LRU info? - // Cache ID is unique per-region, across renames, moving locations, - // etc. - LLUUID mCacheID; - - typedef std::map CapabilityMap; - CapabilityMap mCapabilities; - - LLEventPoll* mEventPoll; - -private: bool mAlive; // can become false if circuit disconnects bool mCapabilitiesReceived; - //spatial partitions for objects in this region - std::vector mObjectPartition; - - LLHTTPClient::ResponderPtr mHttpResponderPtr ; - BOOL mReleaseNotesRequested; }; diff --git a/indra/newview/llvocache.cpp b/indra/newview/llvocache.cpp index 4f4330b17..10e4b869b 100644 --- a/indra/newview/llvocache.cpp +++ b/indra/newview/llvocache.cpp @@ -35,54 +35,74 @@ #include "llvocache.h" #include "llerror.h" +#include "llregionhandle.h" +#include "llviewercontrol.h" +BOOL check_read(LLAPRFile* apr_file, void* src, S32 n_bytes) +{ + return apr_file->read(src, n_bytes) == n_bytes ; +} + +BOOL check_write(LLAPRFile* apr_file, void* src, S32 n_bytes) +{ + return apr_file->write(src, n_bytes) == n_bytes ; +} //--------------------------------------------------------------------------- // LLVOCacheEntry //--------------------------------------------------------------------------- LLVOCacheEntry::LLVOCacheEntry(U32 local_id, U32 crc, LLDataPackerBinaryBuffer &dp) + : + mLocalID(local_id), + mCRC(crc), + mHitCount(0), + mDupeCount(0), + mCRCChangeCount(0) { - mLocalID = local_id; - mCRC = crc; - mHitCount = 0; - mDupeCount = 0; - mCRCChangeCount = 0; mBuffer = new U8[dp.getBufferSize()]; mDP.assignBuffer(mBuffer, dp.getBufferSize()); - mDP = dp; + mDP = dp; //memcpy } LLVOCacheEntry::LLVOCacheEntry() + : + mLocalID(0), + mCRC(0), + mHitCount(0), + mDupeCount(0), + mCRCChangeCount(0), + mBuffer(NULL) { - mLocalID = 0; - mCRC = 0; - mHitCount = 0; - mDupeCount = 0; - mCRCChangeCount = 0; - mBuffer = NULL; mDP.assignBuffer(mBuffer, 0); } - -static inline void checkedRead(LLFILE *fp, void *data, size_t nbytes) +LLVOCacheEntry::LLVOCacheEntry(LLAPRFile* apr_file) + : mBuffer(NULL) { - if (fread(data, 1, nbytes, fp) != nbytes) + S32 size = -1; + BOOL success; + + mDP.assignBuffer(mBuffer, 0); + success = check_read(apr_file, &mLocalID, sizeof(U32)); + if(success) { - llwarns << "Short read" << llendl; - memset(data, 0, nbytes); + success = check_read(apr_file, &mCRC, sizeof(U32)); } -} - -LLVOCacheEntry::LLVOCacheEntry(LLFILE *fp) -{ - S32 size; - checkedRead(fp, &mLocalID, sizeof(U32)); - checkedRead(fp, &mCRC, sizeof(U32)); - checkedRead(fp, &mHitCount, sizeof(S32)); - checkedRead(fp, &mDupeCount, sizeof(S32)); - checkedRead(fp, &mCRCChangeCount, sizeof(S32)); - - checkedRead(fp, &size, sizeof(S32)); + if(success) + { + success = check_read(apr_file, &mHitCount, sizeof(S32)); + } + if(success) + { + success = check_read(apr_file, &mDupeCount, sizeof(S32)); + } + if(success) + { + success = check_read(apr_file, &mCRCChangeCount, sizeof(S32)); + } + if(success) + { + success = check_read(apr_file, &size, sizeof(S32)); // Corruption in the cache entries if ((size > 10000) || (size < 1)) @@ -90,24 +110,40 @@ LLVOCacheEntry::LLVOCacheEntry(LLFILE *fp) // We've got a bogus size, skip reading it. // We won't bother seeking, because the rest of this file // is likely bogus, and will be tossed anyway. - llwarns << "Bogus cache entry, size " << size << ", aborting!" << llendl; - mLocalID = 0; - mCRC = 0; - mBuffer = NULL; - return; + llwarns << "Bogus cache entry, size " << size << ", aborting!" << llendl; + success = FALSE; + } + } + if(success && size > 0) + { + mBuffer = new U8[size]; + success = check_read(apr_file, mBuffer, size); + + if(success) + { + mDP.assignBuffer(mBuffer, size); + } + else + { + delete[] mBuffer ; + mBuffer = NULL ; + } } - mBuffer = new U8[size]; - checkedRead(fp, mBuffer, size); - mDP.assignBuffer(mBuffer, size); + if(!success) + { + mLocalID = 0; + mCRC = 0; + mHitCount = 0; + mDupeCount = 0; + mCRCChangeCount = 0; + mBuffer = NULL; + } } LLVOCacheEntry::~LLVOCacheEntry() { - if(mBuffer) - { - delete [] mBuffer; - } + mDP.freeBuffer(); } @@ -157,22 +193,564 @@ void LLVOCacheEntry::dump() const << llendl; } -static inline void checkedWrite(LLFILE *fp, const void *data, size_t nbytes) +BOOL LLVOCacheEntry::writeToFile(LLAPRFile* apr_file) const { - if (fwrite(data, 1, nbytes, fp) != nbytes) + BOOL success; + success = check_write(apr_file, (void*)&mLocalID, sizeof(U32)); + if(success) { - llwarns << "Short write" << llendl; + success = check_write(apr_file, (void*)&mCRC, sizeof(U32)); + } + if(success) + { + success = check_write(apr_file, (void*)&mHitCount, sizeof(S32)); + } + if(success) + { + success = check_write(apr_file, (void*)&mDupeCount, sizeof(S32)); + } + if(success) + { + success = check_write(apr_file, (void*)&mCRCChangeCount, sizeof(S32)); + } + if(success) + { + S32 size = mDP.getBufferSize(); + success = check_write(apr_file, (void*)&size, sizeof(S32)); + + if(success) + { + success = check_write(apr_file, (void*)mBuffer, size); + } + } + + return success ; +} + +//------------------------------------------------------------------- +//LLVOCache +//------------------------------------------------------------------- +// Format string used to construct filename for the object cache +static const char OBJECT_CACHE_FILENAME[] = "objects_%d_%d.slc"; + +const U32 MAX_NUM_OBJECT_ENTRIES = 128 ; +const U32 MIN_ENTRIES_TO_PURGE = 16 ; +const U32 INVALID_TIME = 0 ; +const char* object_cache_dirname = "objectcache"; +const char* header_filename = "object.cache"; + +LLVOCache* LLVOCache::sInstance = NULL; + +//static +LLVOCache* LLVOCache::getInstance() +{ + if(!sInstance) + { + sInstance = new LLVOCache() ; + } + return sInstance ; +} + +//static +BOOL LLVOCache::hasInstance() +{ + return sInstance != NULL ; +} + +//static +void LLVOCache::destroyClass() +{ + if(sInstance) + { + delete sInstance ; + sInstance = NULL ; } } -void LLVOCacheEntry::writeToFile(LLFILE *fp) const +LLVOCache::LLVOCache(): + mInitialized(FALSE), + mReadOnly(TRUE), + mNumEntries(0), + mCacheSize(1) { - checkedWrite(fp, &mLocalID, sizeof(U32)); - checkedWrite(fp, &mCRC, sizeof(U32)); - checkedWrite(fp, &mHitCount, sizeof(S32)); - checkedWrite(fp, &mDupeCount, sizeof(S32)); - checkedWrite(fp, &mCRCChangeCount, sizeof(S32)); - S32 size = mDP.getBufferSize(); - checkedWrite(fp, &size, sizeof(S32)); - checkedWrite(fp, mBuffer, size); + mEnabled = gSavedSettings.getBOOL("ObjectCacheEnabled"); } + +LLVOCache::~LLVOCache() +{ + if(mEnabled) + { + writeCacheHeader(); + clearCacheInMemory(); + } +} + +void LLVOCache::setDirNames(ELLPath location) +{ + std::string delem = gDirUtilp->getDirDelimiter(); + + mHeaderFileName = gDirUtilp->getExpandedFilename(location, object_cache_dirname, header_filename); + mObjectCacheDirName = gDirUtilp->getExpandedFilename(location, object_cache_dirname); +} + +void LLVOCache::initCache(ELLPath location, U32 size, U32 cache_version) +{ + if(!mEnabled) + { + llwarns << "Not initializing cache: Cache is currently disabled." << llendl; + return ; + } + + if(mInitialized) + { + llwarns << "Cache already initialized." << llendl; + return ; + } + mInitialized = TRUE ; + + setDirNames(location); + if (!mReadOnly) + { + LLFile::mkdir(mObjectCacheDirName); + } + mCacheSize = llclamp(size, MIN_ENTRIES_TO_PURGE, MAX_NUM_OBJECT_ENTRIES); + mMetaInfo.mVersion = cache_version; + readCacheHeader(); + + if(mMetaInfo.mVersion != cache_version) + { + mMetaInfo.mVersion = cache_version ; + if(mReadOnly) //disable cache + { + clearCacheInMemory(); + } + else //delete the current cache if the format does not match. + { + removeCache(); + } + } +} + +void LLVOCache::removeCache(ELLPath location) +{ + if(mReadOnly) + { + llwarns << "Not removing cache at " << location << ": Cache is currently in read-only mode." << llendl; + return ; + } + + llinfos << "about to remove the object cache due to settings." << llendl ; + + std::string mask = "*"; + std::string cache_dir = gDirUtilp->getExpandedFilename(location, object_cache_dirname); + llinfos << "Removing cache at " << cache_dir << llendl; + gDirUtilp->deleteFilesInDir(cache_dir, mask); //delete all files + LLFile::rmdir(cache_dir); + + clearCacheInMemory(); + mInitialized = FALSE ; +} + +void LLVOCache::removeCache() +{ + llassert_always(mInitialized) ; + if(mReadOnly) + { + llwarns << "Not clearing object cache: Cache is currently in read-only mode." << llendl; + return ; + } + + llinfos << "about to remove the object cache due to some error." << llendl ; + + std::string mask = "*"; + llinfos << "Removing cache at " << mObjectCacheDirName << llendl; + gDirUtilp->deleteFilesInDir(mObjectCacheDirName, mask); + + clearCacheInMemory() ; + writeCacheHeader(); +} + +void LLVOCache::removeEntry(HeaderEntryInfo* entry) +{ + llassert_always(mInitialized) ; + if(mReadOnly) + { + return ; + } + if(!entry) + { + return ; + } + + header_entry_queue_t::iterator iter = mHeaderEntryQueue.find(entry) ; + if(iter != mHeaderEntryQueue.end()) + { + mHandleEntryMap.erase(entry->mHandle) ; + mHeaderEntryQueue.erase(iter) ; + removeFromCache(entry) ; + delete entry ; + + mNumEntries = mHandleEntryMap.size() ; + } +} + +void LLVOCache::removeEntry(U64 handle) +{ + handle_entry_map_t::iterator iter = mHandleEntryMap.find(handle) ; + if(iter == mHandleEntryMap.end()) //no cache + { + return ; + } + HeaderEntryInfo* entry = iter->second ; + removeEntry(entry) ; +} + +void LLVOCache::clearCacheInMemory() +{ + if(!mHeaderEntryQueue.empty()) + { + for(header_entry_queue_t::iterator iter = mHeaderEntryQueue.begin(); iter != mHeaderEntryQueue.end(); ++iter) + { + delete *iter ; + } + mHeaderEntryQueue.clear(); + mHandleEntryMap.clear(); + mNumEntries = 0 ; + } + +} + +void LLVOCache::getObjectCacheFilename(U64 handle, std::string& filename) +{ + U32 region_x, region_y; + + grid_from_region_handle(handle, ®ion_x, ®ion_y); + filename = gDirUtilp->getExpandedFilename(LL_PATH_CACHE, object_cache_dirname, + llformat(OBJECT_CACHE_FILENAME, region_x, region_y)); + + return ; +} + +void LLVOCache::removeFromCache(HeaderEntryInfo* entry) +{ + if(mReadOnly) + { + llwarns << "Not removing cache for handle " << entry->mHandle << ": Cache is currently in read-only mode." << llendl; + return ; + } + + std::string filename; + getObjectCacheFilename(entry->mHandle, filename); + LLAPRFile::remove(filename); + entry->mTime = INVALID_TIME ; + updateEntry(entry) ; //update the head file. +} + +void LLVOCache::readCacheHeader() +{ + if(!mEnabled) + { + llwarns << "Not reading cache header: Cache is currently disabled." << llendl; + return; + } + + //clear stale info. + clearCacheInMemory(); + + bool success = true ; + if (LLAPRFile::isExist(mHeaderFileName)) + { + LLAPRFile apr_file(mHeaderFileName, APR_READ|APR_BINARY, LLAPRFile::local); + + //read the meta element + success = check_read(&apr_file, &mMetaInfo, sizeof(HeaderMetaInfo)) ; + + if(success) + { + HeaderEntryInfo* entry = NULL ; + mNumEntries = 0 ; + U32 num_read = 0 ; + while(num_read++ < MAX_NUM_OBJECT_ENTRIES) + { + if(!entry) + { + entry = new HeaderEntryInfo() ; + } + success = check_read(&apr_file, entry, sizeof(HeaderEntryInfo)); + + if(!success) //failed + { + llwarns << "Error reading cache header entry. (entry_index=" << mNumEntries << ")" << llendl; + delete entry ; + entry = NULL ; + break ; + } + else if(entry->mTime == INVALID_TIME) + { + continue ; //an empty entry + } + + entry->mIndex = mNumEntries++ ; + mHeaderEntryQueue.insert(entry) ; + mHandleEntryMap[entry->mHandle] = entry ; + entry = NULL ; + } + if(entry) + { + delete entry ; + } + } + + //--------- + //debug code + //---------- + //std::string name ; + //for(header_entry_queue_t::iterator iter = mHeaderEntryQueue.begin() ; success && iter != mHeaderEntryQueue.end(); ++iter) + //{ + // getObjectCacheFilename((*iter)->mHandle, name) ; + // llinfos << name << llendl ; + //} + //----------- + } + else + { + writeCacheHeader() ; + } + + if(!success) + { + removeCache() ; //failed to read header, clear the cache + } + else if(mNumEntries >= mCacheSize) + { + purgeEntries(mCacheSize) ; + } + + return ; +} + +void LLVOCache::writeCacheHeader() +{ + if (!mEnabled) + { + llwarns << "Not writing cache header: Cache is currently disabled." << llendl; + return; + } + + if(mReadOnly) + { + llwarns << "Not writing cache header: Cache is currently in read-only mode." << llendl; + return; + } + + bool success = true ; + { + LLAPRFile apr_file(mHeaderFileName, APR_CREATE|APR_WRITE|APR_BINARY, LLAPRFile::local); + + //write the meta element + success = check_write(&apr_file, &mMetaInfo, sizeof(HeaderMetaInfo)) ; + + + mNumEntries = 0 ; + for(header_entry_queue_t::iterator iter = mHeaderEntryQueue.begin() ; success && iter != mHeaderEntryQueue.end(); ++iter) + { + (*iter)->mIndex = mNumEntries++ ; + success = check_write(&apr_file, (void*)*iter, sizeof(HeaderEntryInfo)); + } + + mNumEntries = mHeaderEntryQueue.size() ; + if(success && mNumEntries < MAX_NUM_OBJECT_ENTRIES) + { + HeaderEntryInfo* entry = new HeaderEntryInfo() ; + entry->mTime = INVALID_TIME ; + for(S32 i = mNumEntries ; success && i < MAX_NUM_OBJECT_ENTRIES ; i++) + { + //fill the cache with the default entry. + success = check_write(&apr_file, entry, sizeof(HeaderEntryInfo)) ; + + } + delete entry ; + } + } + + if(!success) + { + clearCacheInMemory() ; + mReadOnly = TRUE ; //disable the cache. + } + return ; +} + +BOOL LLVOCache::updateEntry(const HeaderEntryInfo* entry) +{ + LLAPRFile apr_file(mHeaderFileName, APR_WRITE|APR_BINARY, LLAPRFile::local); + apr_file.seek(APR_SET, entry->mIndex * sizeof(HeaderEntryInfo) + sizeof(HeaderMetaInfo)) ; + + return check_write(&apr_file, (void*)entry, sizeof(HeaderEntryInfo)) ; +} + +void LLVOCache::readFromCache(U64 handle, const LLUUID& id, LLVOCacheEntry::vocache_entry_map_t& cache_entry_map) +{ + if(!mEnabled) + { + llwarns << "Not reading cache for handle " << handle << "): Cache is currently disabled." << llendl; + return ; + } + llassert_always(mInitialized); + + handle_entry_map_t::iterator iter = mHandleEntryMap.find(handle) ; + if(iter == mHandleEntryMap.end()) //no cache + { + llwarns << "No handle map entry for " << handle << llendl; + return ; + } + + bool success = true ; + { + std::string filename; + getObjectCacheFilename(handle, filename); + LLAPRFile apr_file(filename, APR_READ|APR_BINARY, LLAPRFile::local); + + LLUUID cache_id ; + success = check_read(&apr_file, cache_id.mData, UUID_BYTES) ; + + if(success) + { + if(cache_id != id) + { + llinfos << "Cache ID doesn't match for this region, discarding"<< llendl; + success = false ; + } + + if(success) + { + S32 num_entries; + success = check_read(&apr_file, &num_entries, sizeof(S32)) ; + + for (S32 i = 0; success && i < num_entries; i++) + { + LLVOCacheEntry* entry = new LLVOCacheEntry(&apr_file); + if (!entry->getLocalID()) + { + llwarns << "Aborting cache file load for " << filename << ", cache file corruption!" << llendl; + delete entry ; + success = false ; + } + cache_entry_map[entry->getLocalID()] = entry; + } + } + } + } + + if(!success) + { + if(cache_entry_map.empty()) + { + removeEntry(iter->second) ; + } + } + + return ; +} + +void LLVOCache::purgeEntries(U32 size) +{ + while(mHeaderEntryQueue.size() > size) + { + header_entry_queue_t::iterator iter = mHeaderEntryQueue.begin() ; + HeaderEntryInfo* entry = *iter ; + mHandleEntryMap.erase(entry->mHandle); + mHeaderEntryQueue.erase(iter) ; + removeFromCache(entry) ; + delete entry; + } + mNumEntries = mHandleEntryMap.size() ; +} + +void LLVOCache::writeToCache(U64 handle, const LLUUID& id, const LLVOCacheEntry::vocache_entry_map_t& cache_entry_map, BOOL dirty_cache) +{ + if(!mEnabled) + { + llwarns << "Not writing cache for handle " << handle << "): Cache is currently disabled." << llendl; + return ; + } + llassert_always(mInitialized); + + if(mReadOnly) + { + llwarns << "Not writing cache for handle " << handle << "): Cache is currently in read-only mode." << llendl; + return ; + } + + HeaderEntryInfo* entry; + handle_entry_map_t::iterator iter = mHandleEntryMap.find(handle) ; + if(iter == mHandleEntryMap.end()) //new entry + { + if(mNumEntries >= mCacheSize - 1) + { + purgeEntries(mCacheSize - 1) ; + } + + entry = new HeaderEntryInfo(); + entry->mHandle = handle ; + entry->mTime = time(NULL) ; + entry->mIndex = mNumEntries++; + mHeaderEntryQueue.insert(entry) ; + mHandleEntryMap[handle] = entry ; + } + else + { + // Update access time. + entry = iter->second ; + + //resort + mHeaderEntryQueue.erase(entry) ; + + entry->mTime = time(NULL) ; + mHeaderEntryQueue.insert(entry) ; + } + + //update cache header + if(!updateEntry(entry)) + { + llwarns << "Failed to update cache header index " << entry->mIndex << ". handle = " << handle << llendl; + return ; //update failed. + } + + if(!dirty_cache) + { + llwarns << "Skipping write to cache for handle " << handle << ": cache not dirty" << llendl; + return ; //nothing changed, no need to update. + } + + //write to cache file + bool success = true ; + { + std::string filename; + getObjectCacheFilename(handle, filename); + LLAPRFile apr_file(filename, APR_CREATE|APR_WRITE|APR_BINARY, LLAPRFile::local); + + success = check_write(&apr_file, (void*)id.mData, UUID_BYTES) ; + + + if(success) + { + S32 num_entries = cache_entry_map.size() ; + success = check_write(&apr_file, &num_entries, sizeof(S32)); + + for (LLVOCacheEntry::vocache_entry_map_t::const_iterator iter = cache_entry_map.begin(); success && iter != cache_entry_map.end(); ++iter) + { + success = iter->second->writeToFile(&apr_file) ; + } + } + } + + if(!success) + { + removeEntry(entry) ; + + } + + return ; +} + diff --git a/indra/newview/llvocache.h b/indra/newview/llvocache.h index 1970a1e72..6f2fd4571 100644 --- a/indra/newview/llvocache.h +++ b/indra/newview/llvocache.h @@ -36,17 +36,18 @@ #include "lluuid.h" #include "lldatapacker.h" #include "lldlinked.h" +#include "lldir.h" //--------------------------------------------------------------------------- // Cache entries class LLVOCacheEntry; -class LLVOCacheEntry : public LLDLinked +class LLVOCacheEntry { public: LLVOCacheEntry(U32 local_id, U32 crc, LLDataPackerBinaryBuffer &dp); - LLVOCacheEntry(LLFILE *fp); + LLVOCacheEntry(LLAPRFile* apr_file); LLVOCacheEntry(); ~LLVOCacheEntry(); @@ -56,12 +57,15 @@ public: S32 getCRCChangeCount() const { return mCRCChangeCount; } void dump() const; - void writeToFile(LLFILE *fp) const; + BOOL writeToFile(LLAPRFile* apr_file) const; void assignCRC(U32 crc, LLDataPackerBinaryBuffer &dp); LLDataPackerBinaryBuffer *getDP(U32 crc); void recordHit(); void recordDupe() { mDupeCount++; } +public: + typedef std::map vocache_entry_map_t; + protected: U32 mLocalID; U32 mCRC; @@ -72,4 +76,86 @@ protected: U8 *mBuffer; }; +// +//Note: LLVOCache is not thread-safe +// +class LLVOCache +{ +private: + struct HeaderEntryInfo + { + HeaderEntryInfo() : mIndex(0), mHandle(0), mTime(0) {} + S32 mIndex; + U64 mHandle ; + U32 mTime ; + }; + + struct HeaderMetaInfo + { + HeaderMetaInfo() : mVersion(0){} + + U32 mVersion; + }; + + struct header_entry_less + { + bool operator()(const HeaderEntryInfo* lhs, const HeaderEntryInfo* rhs) const + { + if(lhs->mTime == rhs->mTime) + { + return lhs < rhs ; + } + + return lhs->mTime < rhs->mTime ; // older entry in front of queue (set) + } + }; + typedef std::set header_entry_queue_t; + typedef std::map handle_entry_map_t; +private: + LLVOCache() ; + +public: + ~LLVOCache() ; + + void initCache(ELLPath location, U32 size, U32 cache_version) ; + void removeCache(ELLPath location) ; + + void readFromCache(U64 handle, const LLUUID& id, LLVOCacheEntry::vocache_entry_map_t& cache_entry_map) ; + void writeToCache(U64 handle, const LLUUID& id, const LLVOCacheEntry::vocache_entry_map_t& cache_entry_map, BOOL dirty_cache) ; + void removeEntry(U64 handle) ; + + void setReadOnly(BOOL read_only) {mReadOnly = read_only;} + +private: + void setDirNames(ELLPath location); + // determine the cache filename for the region from the region handle + void getObjectCacheFilename(U64 handle, std::string& filename); + void removeFromCache(HeaderEntryInfo* entry); + void readCacheHeader(); + void writeCacheHeader(); + void clearCacheInMemory(); + void removeCache() ; + void removeEntry(HeaderEntryInfo* entry) ; + void purgeEntries(U32 size); + BOOL updateEntry(const HeaderEntryInfo* entry); + +private: + BOOL mEnabled; + BOOL mInitialized ; + BOOL mReadOnly ; + HeaderMetaInfo mMetaInfo; + U32 mCacheSize; + U32 mNumEntries; + std::string mHeaderFileName ; + std::string mObjectCacheDirName; + header_entry_queue_t mHeaderEntryQueue; + handle_entry_map_t mHandleEntryMap; + + static LLVOCache* sInstance ; +public: + static LLVOCache* getInstance() ; + static BOOL hasInstance() ; + static void destroyClass() ; +}; + #endif diff --git a/indra/newview/llvovolume.cpp b/indra/newview/llvovolume.cpp index a7c797f51..00d37f823 100644 --- a/indra/newview/llvovolume.cpp +++ b/indra/newview/llvovolume.cpp @@ -63,6 +63,8 @@ #include "llworld.h" #include "llselectmgr.h" #include "pipeline.h" +#include "llvocache.h" + // [RLVa:KB] - Checked: 2010-04-04 (RLVa-1.2.0d) #include "rlvhandler.h" // [/RLVa:KB] @@ -235,10 +237,12 @@ U32 LLVOVolume::processUpdateMessage(LLMessageSystem *mesgsys, // Well, crap, there's something bogus in the data that we're unpacking. dp->dumpBufferToLog(); llwarns << "Flushing cache files" << llendl; - std::string mask; - mask = gDirUtilp->getDirDelimiter() + "*.slc"; - gDirUtilp->deleteFilesInDir(gDirUtilp->getExpandedFilename(LL_PATH_CACHE,""), mask); -// llerrs << "Bogus TE data in " << getID() << ", crashing!" << llendl; + + if(LLVOCache::hasInstance() && getRegion()) + { + LLVOCache::getInstance()->removeEntry(getRegion()->getHandle()) ; + } + llwarns << "Bogus TE data in " << getID() << llendl; } else if (res2 & (TEM_CHANGE_TEXTURE|TEM_CHANGE_COLOR)) diff --git a/indra/newview/llworld.cpp b/indra/newview/llworld.cpp index 0c445b65f..fbceaa9cc 100644 --- a/indra/newview/llworld.cpp +++ b/indra/newview/llworld.cpp @@ -54,6 +54,7 @@ #include "llviewerstats.h" #include "llvlcomposition.h" #include "llvoavatar.h" +#include "llvocache.h" #include "llvowater.h" #include "message.h" #include "pipeline.h" @@ -129,6 +130,10 @@ void LLWorld::destroyClass() LLViewerRegion* region_to_delete = *region_it++; removeRegion(region_to_delete->getHost()); } + if(LLVOCache::hasInstance()) + { + LLVOCache::getInstance()->destroyClass() ; + } LLViewerPartSim::getInstance()->destroyClass(); } @@ -265,6 +270,7 @@ void LLWorld::removeRegion(const LLHost &host) llwarns << "Disabling region " << regionp->getName() << " that agent is in!" << llendl; LLAppViewer::instance()->forceDisconnect("You have been disconnected from the region you were in."); + regionp->saveObjectCache() ; //force to save objects here in case that the object cache is about to be destroyed. return; } @@ -279,6 +285,10 @@ void LLWorld::removeRegion(const LLHost &host) delete regionp; updateWaterObjects(); + + //double check all objects of this region are removed. + gObjectList.clearAllMapObjectsInRegion(regionp) ; + //llassert_always(!gObjectList.hasMapObjectInRegion(regionp)) ; } @@ -1386,17 +1396,17 @@ void send_agent_resume() LLAppViewer::instance()->resumeMainloopTimeout(); } -static LLVector3d unpackLocalToGlobalPosition(U32 compact_local, const LLVector3d& region_origin) -{ - LLVector3d pos_global(region_origin); - LLVector3d pos_local; - - pos_local.mdV[VZ] = (compact_local & 0xFFU) * 4; - pos_local.mdV[VY] = (compact_local >> 8) & 0xFFU; - pos_local.mdV[VX] = (compact_local >> 16) & 0xFFU; - - pos_global += pos_local; - return pos_global; +static LLVector3d unpackLocalToGlobalPosition(U32 compact_local, const LLVector3d& region_origin) +{ + LLVector3d pos_global(region_origin); + LLVector3d pos_local; + + pos_local.mdV[VZ] = (compact_local & 0xFFU) * 4; + pos_local.mdV[VY] = (compact_local >> 8) & 0xFFU; + pos_local.mdV[VX] = (compact_local >> 16) & 0xFFU; + + pos_global += pos_local; + return pos_global; } void LLWorld::getAvatars(std::vector* avatar_ids, std::vector* positions, const LLVector3d& relative_to, F32 radius) const From ce064f5af2d06244c95c499350a66161abbbabec Mon Sep 17 00:00:00 2001 From: Shyotl Date: Thu, 14 Jul 2011 01:35:15 -0500 Subject: [PATCH 13/33] Some safe merging with v2. --- indra/llcharacter/llkeyframemotion.cpp | 68 +++++++++++++++++++++++--- indra/llcommon/indra_constants.h | 8 +++ indra/llcommon/llchat.h | 3 +- indra/llcommon/llclickaction.h | 3 +- indra/llimage/llimage.cpp | 28 ++--------- 5 files changed, 76 insertions(+), 34 deletions(-) diff --git a/indra/llcharacter/llkeyframemotion.cpp b/indra/llcharacter/llkeyframemotion.cpp index 29b51091e..144cbe747 100644 --- a/indra/llcharacter/llkeyframemotion.cpp +++ b/indra/llcharacter/llkeyframemotion.cpp @@ -838,7 +838,11 @@ void LLKeyframeMotion::initializeConstraint(JointConstraint* constraint) S32 joint_num; LLVector3 source_pos = mCharacter->getVolumePos(shared_data->mSourceConstraintVolume, shared_data->mSourceConstraintOffset); LLJoint* cur_joint = getJoint(shared_data->mJointStateIndices[0]); - + if ( !cur_joint ) + { + return; + } + F32 source_pos_offset = dist_vec(source_pos, cur_joint->getWorldPosition()); constraint->mTotalLength = constraint->mJointLengths[0] = dist_vec(cur_joint->getParent()->getWorldPosition(), source_pos); @@ -889,6 +893,10 @@ void LLKeyframeMotion::activateConstraint(JointConstraint* constraint) for (joint_num = 1; joint_num < shared_data->mChainLength; joint_num++) { LLJoint* cur_joint = getJoint(shared_data->mJointStateIndices[joint_num]); + if ( !cur_joint ) + { + return; + } constraint->mPositions[joint_num] = (cur_joint->getWorldPosition() - mPelvisp->getWorldPosition()) * ~mPelvisp->getWorldRotation(); } @@ -949,6 +957,10 @@ void LLKeyframeMotion::applyConstraint(JointConstraint* constraint, F32 time, U8 } LLJoint* root_joint = getJoint(shared_data->mJointStateIndices[shared_data->mChainLength]); + if (! root_joint) + { + return; + } LLVector3 root_pos = root_joint->getWorldPosition(); // LLQuaternion root_rot = root_joint->getParent()->getWorldRotation(); @@ -960,6 +972,11 @@ void LLKeyframeMotion::applyConstraint(JointConstraint* constraint, F32 time, U8 for (joint_num = 0; joint_num <= shared_data->mChainLength; joint_num++) { LLJoint* cur_joint = getJoint(shared_data->mJointStateIndices[joint_num]); + if (!cur_joint) + { + return; + } + if (joint_mask[cur_joint->getJointNum()] >= (0xff >> (7 - getPriority()))) { // skip constraint @@ -1050,7 +1067,14 @@ void LLKeyframeMotion::applyConstraint(JointConstraint* constraint, F32 time, U8 if (shared_data->mChainLength) { - LLQuaternion end_rot = getJoint(shared_data->mJointStateIndices[0])->getWorldRotation(); + LLJoint* end_joint = getJoint(shared_data->mJointStateIndices[0]); + + if (!end_joint) + { + return; + } + + LLQuaternion end_rot = end_joint->getWorldRotation(); // slam start and end of chain to the proper positions (rest of chain stays put) positions[0] = lerp(keyframe_source_pos, target_pos, weight); @@ -1059,7 +1083,14 @@ void LLKeyframeMotion::applyConstraint(JointConstraint* constraint, F32 time, U8 // grab keyframe-specified positions of joints for (joint_num = 1; joint_num < shared_data->mChainLength; joint_num++) { - LLVector3 kinematic_position = getJoint(shared_data->mJointStateIndices[joint_num])->getWorldPosition() + + LLJoint* cur_joint = getJoint(shared_data->mJointStateIndices[joint_num]); + + if (!cur_joint) + { + return; + } + + LLVector3 kinematic_position = cur_joint->getWorldPosition() + (source_to_target * constraint->mJointLengthFractions[joint_num]); // convert intermediate joint positions to world coordinates @@ -1105,7 +1136,17 @@ void LLKeyframeMotion::applyConstraint(JointConstraint* constraint, F32 time, U8 for (joint_num = shared_data->mChainLength; joint_num > 0; joint_num--) { LLJoint* cur_joint = getJoint(shared_data->mJointStateIndices[joint_num]); + + if (!cur_joint) + { + return; + } LLJoint* child_joint = getJoint(shared_data->mJointStateIndices[joint_num - 1]); + if (!child_joint) + { + return; + } + LLQuaternion parent_rot = cur_joint->getParent()->getWorldRotation(); LLQuaternion cur_rot = cur_joint->getWorldRotation(); @@ -1139,7 +1180,6 @@ void LLKeyframeMotion::applyConstraint(JointConstraint* constraint, F32 time, U8 cur_joint->setRotation(target_rot); } - LLJoint* end_joint = getJoint(shared_data->mJointStateIndices[0]); LLQuaternion end_local_rot = end_rot * ~end_joint->getParent()->getWorldRotation(); if (weight == 1.f) @@ -1162,12 +1202,18 @@ void LLKeyframeMotion::applyConstraint(JointConstraint* constraint, F32 time, U8 constraint->mPositions[joint_num] = new_pos; } constraint->mFixupDistanceRMS *= 1.f / (constraint->mTotalLength * (F32)(shared_data->mChainLength - 1)); - constraint->mFixupDistanceRMS = fsqrtf(constraint->mFixupDistanceRMS); + constraint->mFixupDistanceRMS = (F32) sqrt(constraint->mFixupDistanceRMS); //reset old joint rots for (joint_num = 0; joint_num <= shared_data->mChainLength; joint_num++) { - getJoint(shared_data->mJointStateIndices[joint_num])->setRotation(old_rots[joint_num]); + LLJoint* cur_joint = getJoint(shared_data->mJointStateIndices[joint_num]); + if (!cur_joint) + { + return; + } + + cur_joint->setRotation(old_rots[joint_num]); } } // simple positional constraint (pelvis only) @@ -1816,7 +1862,15 @@ BOOL LLKeyframeMotion::deserialize(LLDataPacker& dp) constraintp->mJointStateIndices[i] = -1; for (U32 j = 0; j < mJointMotionList->getNumJointMotions(); j++) { - if(getJoint(j) == joint) + LLJoint* constraint_joint = getJoint(j); + + if ( !constraint_joint ) + { + llwarns << "Invalid joint " << j << llendl; + return FALSE; + } + + if(constraint_joint == joint) { constraintp->mJointStateIndices[i] = (S32)j; break; diff --git a/indra/llcommon/indra_constants.h b/indra/llcommon/indra_constants.h index a95b6499d..815145ac8 100644 --- a/indra/llcommon/indra_constants.h +++ b/indra/llcommon/indra_constants.h @@ -319,6 +319,14 @@ const F32 CHAT_SHOUT_RADIUS = 100.f; const F32 CHAT_MAX_RADIUS = CHAT_SHOUT_RADIUS; const F32 CHAT_MAX_RADIUS_BY_TWO = CHAT_MAX_RADIUS / 2.f; +// squared editions of the above for distance checks +const F32 CHAT_WHISPER_RADIUS_SQUARED = CHAT_WHISPER_RADIUS * CHAT_WHISPER_RADIUS; +const F32 CHAT_NORMAL_RADIUS_SQUARED = CHAT_NORMAL_RADIUS * CHAT_NORMAL_RADIUS; +const F32 CHAT_SHOUT_RADIUS_SQUARED = CHAT_SHOUT_RADIUS * CHAT_SHOUT_RADIUS; +const F32 CHAT_MAX_RADIUS_SQUARED = CHAT_SHOUT_RADIUS_SQUARED; +const F32 CHAT_MAX_RADIUS_BY_TWO_SQUARED = CHAT_MAX_RADIUS_BY_TWO * CHAT_MAX_RADIUS_BY_TWO; + + // this times above gives barely audible radius const F32 CHAT_BARELY_AUDIBLE_FACTOR = 2.0f; diff --git a/indra/llcommon/llchat.h b/indra/llcommon/llchat.h index 323b3b3c0..620a75cdb 100644 --- a/indra/llcommon/llchat.h +++ b/indra/llcommon/llchat.h @@ -56,7 +56,8 @@ typedef enum e_chat_type CHAT_TYPE_STOP = 5, CHAT_TYPE_DEBUG_MSG = 6, CHAT_TYPE_REGION = 7, - CHAT_TYPE_OWNER = 8 + CHAT_TYPE_OWNER = 8, + CHAT_TYPE_DIRECT = 9 // From llRegionSayTo() } EChatType; typedef enum e_chat_audible_level diff --git a/indra/llcommon/llclickaction.h b/indra/llcommon/llclickaction.h index 804872457..b3bc942e8 100644 --- a/indra/llcommon/llclickaction.h +++ b/indra/llcommon/llclickaction.h @@ -42,5 +42,6 @@ const U8 CLICK_ACTION_PAY = 3; const U8 CLICK_ACTION_OPEN = 4; const U8 CLICK_ACTION_PLAY = 5; const U8 CLICK_ACTION_OPEN_MEDIA = 6; - +const U8 CLICK_ACTION_ZOOM = 7; +// DO NOT CHANGE THE SEQUENCE OF THIS LIST!! #endif diff --git a/indra/llimage/llimage.cpp b/indra/llimage/llimage.cpp index 3f3dbc87c..00ed4e469 100644 --- a/indra/llimage/llimage.cpp +++ b/indra/llimage/llimage.cpp @@ -138,8 +138,7 @@ void LLImageBase::sanityCheck() // virtual void LLImageBase::deleteData() { - if(mData) - delete[] mData; + delete[] mData; mData = NULL; mDataSize = 0; } @@ -154,7 +153,7 @@ U8* LLImageBase::allocateData(S32 size) size = mWidth * mHeight * mComponents; if (size <= 0) { - llerrs << llformat("LLImageBase::allocateData called with bad dimensions: %dx%dx%d",mWidth,mHeight,mComponents) << llendl; + llerrs << llformat("LLImageBase::allocateData called with bad dimensions: %dx%dx%d",mWidth,mHeight,(S32)mComponents) << llendl; } } else if (size <= 0 || (size > 4096*4096*16 && !mAllowOverSize)) @@ -1297,28 +1296,7 @@ bool LLImageRaw::createFromFile(const std::string &filename, bool j2c_lowest_mip return false; } - LLPointer image; - switch(codec) - { - //case IMG_CODEC_RGB: - case IMG_CODEC_BMP: - image = new LLImageBMP(); - break; - case IMG_CODEC_TGA: - image = new LLImageTGA(); - break; - case IMG_CODEC_JPEG: - image = new LLImageJPEG(); - break; - case IMG_CODEC_J2C: - image = new LLImageJ2C(); - break; - case IMG_CODEC_DXT: - image = new LLImageDXT(); - break; - default: - return false; - } + LLPointer image = LLImageFormatted::createFromType(codec); llassert(image.notNull()); U8 *buffer = image->allocateData(length); From 7e0ee6bb715ec0196ab07077dd8f13f1df4fd21b Mon Sep 17 00:00:00 2001 From: Shyotl Date: Fri, 15 Jul 2011 00:21:38 -0500 Subject: [PATCH 14/33] Shiny new name cache. --- indra/llcommon/llavatarname.cpp | 23 +- indra/llcommon/llavatarname.h | 2 +- indra/llmessage/llavatarnamecache.cpp | 324 +++++++------- indra/llmessage/llavatarnamecache.h | 5 +- indra/llmessage/llcachename.cpp | 419 ++++++++++++------ indra/llmessage/llcachename.h | 74 +++- indra/llmessage/mean_collision_data.h | 5 +- indra/newview/jcfloaterareasearch.cpp | 10 +- indra/newview/jcfloaterareasearch.h | 1 - indra/newview/llappviewer.cpp | 29 +- indra/newview/llcallingcard.cpp | 201 +++++---- indra/newview/llcallingcard.h | 38 +- indra/newview/llfloateravatarlist.cpp | 12 +- indra/newview/llfloaterbump.cpp | 5 +- indra/newview/llfloaterbuyland.cpp | 3 +- indra/newview/llfloatergroupinfo.cpp | 7 +- indra/newview/llfloatergroupinfo.h | 2 +- indra/newview/llfloaterland.cpp | 7 +- indra/newview/llfloaternewim.cpp | 9 +- indra/newview/llfloaterobjectiminfo.cpp | 18 +- indra/newview/llfloaterregioninfo.cpp | 11 +- indra/newview/llfloaterregioninfo.h | 6 +- indra/newview/llgivemoney.cpp | 26 +- indra/newview/llgivemoney.h | 8 +- indra/newview/llimview.cpp | 20 +- indra/newview/llimview.h | 2 +- indra/newview/llmutelist.cpp | 32 +- indra/newview/llmutelist.h | 10 +- indra/newview/llnamebox.cpp | 20 +- indra/newview/llnamebox.h | 5 +- indra/newview/llnameeditor.cpp | 19 +- indra/newview/llnameeditor.h | 5 +- indra/newview/llnamelistctrl.cpp | 28 +- indra/newview/llnamelistctrl.h | 5 +- indra/newview/llpanelgroupinvite.cpp | 3 - indra/newview/llpanelpermissions.cpp | 2 +- indra/newview/llstartup.cpp | 53 ++- indra/newview/llstartup.h | 6 + indra/newview/llviewermenu.cpp | 13 +- indra/newview/llviewermessage.cpp | 82 ++-- indra/newview/llviewerparcelmgr.cpp | 23 +- indra/newview/llvoavatar.cpp | 2 +- indra/newview/llvoiceclient.cpp | 7 +- indra/newview/llvoiceclient.h | 2 +- indra/newview/rlvfloaterbehaviour.cpp | 26 +- indra/newview/rlvfloaterbehaviour.h | 5 +- .../skins/default/xui/en-us/floater_bumps.xml | 20 +- .../skins/default/xui/en-us/floater_im.xml | 4 +- .../default/xui/en-us/floater_new_im.xml | 3 - .../skins/default/xui/en-us/floater_pay.xml | 2 +- .../default/xui/en-us/floater_pay_object.xml | 2 +- .../skins/default/xui/en-us/notifications.xml | 28 +- 52 files changed, 932 insertions(+), 742 deletions(-) diff --git a/indra/llcommon/llavatarname.cpp b/indra/llcommon/llavatarname.cpp index 4ff1d8090..5088e94e6 100644 --- a/indra/llcommon/llavatarname.cpp +++ b/indra/llcommon/llavatarname.cpp @@ -25,10 +25,6 @@ * Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA * $/LicenseInfo$ */ - -/* -Ported to Phoenix by Wolfspirit Magic. -*/ #include "linden_common.h" #include "llavatarname.h" @@ -52,7 +48,7 @@ LLAvatarName::LLAvatarName() mLegacyFirstName(), mLegacyLastName(), mIsDisplayNameDefault(false), - mIsDummy(false), + mIsTemporaryName(false), mExpires(F64_MAX), mNextUpdate(0.0) { } @@ -94,21 +90,16 @@ void LLAvatarName::fromLLSD(const LLSD& sd) std::string LLAvatarName::getCompleteName(bool linefeed) const { std::string name; - if (!mUsername.empty()) + if (mUsername.empty() || mIsDisplayNameDefault) + // If the display name feature is off + // OR this particular display name is defaulted (i.e. based on user name), + // then display only the easier to read instance of the person's name. { - if (linefeed) - { - name = mDisplayName + "\n(" + mUsername + ")"; - } - else - { - name = mDisplayName + " (" + mUsername + ")"; - } + name = mDisplayName; } else { - // ...display names are off, legacy name is in mDisplayName - name = mDisplayName; + name = mDisplayName + (linefeed ? "\n(" : "(") + mUsername + ")"; } return name; } diff --git a/indra/llcommon/llavatarname.h b/indra/llcommon/llavatarname.h index 7ef7f23e1..ee3a680e5 100644 --- a/indra/llcommon/llavatarname.h +++ b/indra/llcommon/llavatarname.h @@ -79,7 +79,7 @@ public: // Under error conditions, we may insert "dummy" records with // names like "???" into caches as placeholders. These can be // shown in UI, but are not serialized. - bool mIsDummy; + bool mIsTemporaryName; // Names can change, so need to keep track of when name was // last checked. diff --git a/indra/llmessage/llavatarnamecache.cpp b/indra/llmessage/llavatarnamecache.cpp index fcc01990f..4add3009f 100644 --- a/indra/llmessage/llavatarnamecache.cpp +++ b/indra/llmessage/llavatarnamecache.cpp @@ -25,10 +25,6 @@ * $/LicenseInfo$ */ -/* -Ported to Phoenix by Wolfspirit Magic. -*/ - #include "linden_common.h" #include "llavatarnamecache.h" @@ -91,8 +87,11 @@ namespace LLAvatarNameCache // only need per-frame timing resolution LLFrameTimer sRequestTimer; - // Periodically clean out expired entries from the cache - //LLFrameTimer sEraseExpiredTimer; + /// Maximum time an unrefreshed cache entry is allowed + const F64 MAX_UNREFRESHED_TIME = 20.0 * 60.0; + + /// Time when unrefreshed cached names were checked last + static F64 sLastExpireCheck; //----------------------------------------------------------------------- // Internal methods @@ -107,10 +106,11 @@ namespace LLAvatarNameCache void requestNamesViaCapability(); - - // agent_id/group_id, first_name, last_name, is_group, user_data // Legacy name system callback - void legacyNameCallback(const LLUUID& id, const std::string& first, const std::string& last, BOOL is_group, void* data); + void legacyNameCallback(const LLUUID& agent_id, + const std::string& full_name, + bool is_group + ); void requestNamesViaLegacy(); @@ -124,9 +124,10 @@ namespace LLAvatarNameCache const LLAvatarName& av_name); // Is a request in-flight over the network? + bool isRequestPending(const LLUUID& agent_id); // Erase expired names from cache - void eraseExpired(); + void eraseUnrefreshed(); bool expirationFromCacheControl(LLSD headers, F64 *expires); } @@ -196,6 +197,7 @@ public: { // Pull expiration out of headers if available F64 expires = LLAvatarNameCache::nameExpirationFromHeaders(mHeaders); + F64 now = LLFrameTimer::getTotalSeconds(); LLSD agents = content["agents"]; LLSD::array_const_iterator it = agents.beginArray(); @@ -216,118 +218,91 @@ public: av_name.mDisplayName = av_name.mUsername; } + LL_DEBUGS("AvNameCache") << "LLAvatarNameResponder::result for " << agent_id << " " + << "user '" << av_name.mUsername << "' " + << "display '" << av_name.mDisplayName << "' " + << "expires in " << expires - now << " seconds" + << LL_ENDL; + // cache it and fire signals LLAvatarNameCache::processName(agent_id, av_name, true); } // Same logic as error response case LLSD unresolved_agents = content["bad_ids"]; - if (unresolved_agents.size() > 0) + S32 num_unresolved = unresolved_agents.size(); + if (num_unresolved > 0) { - const std::string DUMMY_NAME("\?\?\?"); - LLAvatarName av_name; - av_name.mUsername = DUMMY_NAME; - av_name.mDisplayName = DUMMY_NAME; - av_name.mIsDisplayNameDefault = false; - av_name.mIsDummy = true; - av_name.mExpires = expires; - + LL_WARNS("AvNameCache") << "LLAvatarNameResponder::result " << num_unresolved << " unresolved ids; " + << "expires in " << expires - now << " seconds" + << LL_ENDL; it = unresolved_agents.beginArray(); for ( ; it != unresolved_agents.endArray(); ++it) { const LLUUID& agent_id = *it; - // cache it and fire signals - // Wolfspirit: Do not use ??? as username. Try to get a username out of the old legacy name - std::string oldname; - gCacheName->getFullName(agent_id, oldname); - LLStringUtil::toLower(oldname); - LLStringUtil::replaceString(oldname," ","."); - LLStringUtil::replaceString(oldname,".resident",""); - av_name.mUsername = oldname; + LL_WARNS("AvNameCache") << "LLAvatarNameResponder::result " + << "failed id " << agent_id + << LL_ENDL; - LLAvatarNameCache::processName(agent_id, av_name, true); + LLAvatarNameCache::handleAgentError(agent_id); } } - } + LL_DEBUGS("AvNameCache") << "LLAvatarNameResponder::result " + << LLAvatarNameCache::sCache.size() << " cached names" + << LL_ENDL; + } /*virtual*/ void error(U32 status, const std::string& reason) { - // We're going to construct a dummy record and cache it for a while, - // either briefly for a 503 Service Unavailable, or longer for other - // errors. - F64 retry_timestamp = errorRetryTimestamp(status); + // If there's an error, it might be caused by PeopleApi, + // or when loading textures on startup and using a very slow + // network, this query may time out. + // What we should do depends on whether or not we have a cached name + LL_WARNS("AvNameCache") << "LLAvatarNameResponder::error " << status << " " << reason + << LL_ENDL; - // *NOTE: "??" starts trigraphs in C/C++, escape the question marks. - const std::string DUMMY_NAME("\?\?\?"); - LLAvatarName av_name; - av_name.mUsername = DUMMY_NAME; - av_name.mDisplayName = DUMMY_NAME; - av_name.mIsDisplayNameDefault = false; - av_name.mIsDummy = true; - av_name.mExpires = retry_timestamp; - - // Add dummy records for all agent IDs in this request + // Add dummy records for any agent IDs in this request that we do not have cached already std::vector::const_iterator it = mAgentIDs.begin(); for ( ; it != mAgentIDs.end(); ++it) { const LLUUID& agent_id = *it; - // cache it and fire signals - - // Wolfspirit: Do not use ??? as username. Try to get a username out of the old legacy name - std::string oldname; - gCacheName->getFullName(agent_id, oldname); - LLStringUtil::toLower(oldname); - LLStringUtil::replaceString(oldname," ","."); - LLStringUtil::replaceString(oldname,".resident",""); - av_name.mUsername = oldname; - - LLAvatarNameCache::processName(agent_id, av_name, true); - } - } - - // Return time to retry a request that generated an error, based on - // error type and headers. Return value is seconds-since-epoch. - F64 errorRetryTimestamp(S32 status) - { - F64 now = LLFrameTimer::getTotalSeconds(); - - // Retry-After takes priority - LLSD retry_after = mHeaders["retry-after"]; - if (retry_after.isDefined()) - { - // We only support the delta-seconds type - S32 delta_seconds = retry_after.asInteger(); - if (delta_seconds > 0) - { - // ...valid delta-seconds - return now + F64(delta_seconds); - } - } - - // If no Retry-After, look for Cache-Control max-age - F64 expires = 0.0; - if (LLAvatarNameCache::expirationFromCacheControl(mHeaders, &expires)) - { - return expires; - } - - // No information in header, make a guess - if (status == 503) - { - // ...service unavailable, retry soon - const F64 SERVICE_UNAVAILABLE_DELAY = 600.0; // 10 min - return now + SERVICE_UNAVAILABLE_DELAY; - } - else - { - // ...other unexpected error - const F64 DEFAULT_DELAY = 3600.0; // 1 hour - return now + DEFAULT_DELAY; + LLAvatarNameCache::handleAgentError(agent_id); } } }; +// Provide some fallback for agents that return errors +void LLAvatarNameCache::handleAgentError(const LLUUID& agent_id) +{ + std::map::iterator existing = sCache.find(agent_id); + if (existing == sCache.end()) + { + // there is no existing cache entry, so make a temporary name from legacy + LL_WARNS("AvNameCache") << "LLAvatarNameCache get legacy for agent " + << agent_id << LL_ENDL; + gCacheName->get(agent_id, false, // legacy compatibility + boost::bind(&LLAvatarNameCache::legacyNameCallback, + _1, _2, _3)); + } + else + { + // we have a chached (but probably expired) entry - since that would have + // been returned by the get method, there is no need to signal anyone + + // Clear this agent from the pending list + LLAvatarNameCache::sPendingQueue.erase(agent_id); + + const LLAvatarName& av_name = existing->second; + LL_DEBUGS("AvNameCache") << "LLAvatarNameCache use cache for agent " + << agent_id + << "user '" << av_name.mUsername << "' " + << "display '" << av_name.mDisplayName << "' " + << "expires in " << av_name.mExpires - LLFrameTimer::getTotalSeconds() << " seconds" + << LL_ENDL; + } +} + void LLAvatarNameCache::processName(const LLUUID& agent_id, const LLAvatarName& av_name, bool add_to_cache) @@ -336,12 +311,12 @@ void LLAvatarNameCache::processName(const LLUUID& agent_id, { // sCache[agent_id] = av_name; // [SL:KB] - Patch: Agent-DisplayNames | Checked: 2010-12-28 (Catznip-2.4.0h) | Added: Catznip-2.4.0h - // Don't replace existing entries with dummies - cache_t::iterator itName = (av_name.mIsDummy) ? sCache.find(agent_id) : sCache.end(); - if (sCache.end() != itName) - itName->second.mExpires = av_name.mExpires; - else - sCache[agent_id] = av_name; + // Don't replace existing entries with dummies + cache_t::iterator itName = (av_name.mIsTemporaryName) ? sCache.find(agent_id) : sCache.end(); + if (sCache.end() != itName) + itName->second.mExpires = av_name.mExpires; + else + sCache[agent_id] = av_name; // [/SL:KB] } @@ -377,6 +352,7 @@ void LLAvatarNameCache::requestNamesViaCapability() std::vector agent_ids; agent_ids.reserve(128); + U32 ids = 0; ask_queue_t::const_iterator it = sAskQueue.begin(); for ( ; it != sAskQueue.end(); ++it) { @@ -387,11 +363,13 @@ void LLAvatarNameCache::requestNamesViaCapability() // ...starting new request url += sNameLookupURL; url += "?ids="; + ids = 1; } else { // ...continuing existing request url += "&ids="; + ids++; } url += agent_id.asString(); agent_ids.push_back(agent_id); @@ -401,7 +379,9 @@ void LLAvatarNameCache::requestNamesViaCapability() if (url.size() > NAME_URL_SEND_THRESHOLD) { - //llinfos << "requestNames " << url << llendl; + LL_DEBUGS("AvNameCache") << "LLAvatarNameCache::requestNamesViaCapability first " + << ids << " ids" + << LL_ENDL; LLHTTPClient::get(url, new LLAvatarNameResponder(agent_ids)); url.clear(); agent_ids.clear(); @@ -410,7 +390,9 @@ void LLAvatarNameCache::requestNamesViaCapability() if (!url.empty()) { - //llinfos << "requestNames " << url << llendl; + LL_DEBUGS("AvNameCache") << "LLAvatarNameCache::requestNamesViaCapability all " + << ids << " ids" + << LL_ENDL; LLHTTPClient::get(url, new LLAvatarNameResponder(agent_ids)); url.clear(); agent_ids.clear(); @@ -419,18 +401,25 @@ void LLAvatarNameCache::requestNamesViaCapability() // We've moved all asks to the pending request queue sAskQueue.clear(); } -void LLAvatarNameCache::legacyNameCallback(const LLUUID& id, const std::string& first, const std::string& last, BOOL is_group, void* data) + +void LLAvatarNameCache::legacyNameCallback(const LLUUID& agent_id, + const std::string& full_name, + bool is_group) { - std::string full_name = first + " " +last; // Construct a dummy record for this name. By convention, SLID is blank // Never expires, but not written to disk, so lasts until end of session. LLAvatarName av_name; + LL_DEBUGS("AvNameCache") << "LLAvatarNameCache::legacyNameCallback " + << "agent " << agent_id << " " + << "full name '" << full_name << "'" + << ( is_group ? " [group]" : "" ) + << LL_ENDL; buildLegacyName(full_name, &av_name); // Don't add to cache, the data already exists in the legacy name system // cache and we don't want or need duplicate storage, because keeping the // two copies in sync is complex. - processName(id, av_name, false); + processName(agent_id, av_name, false); } void LLAvatarNameCache::requestNamesViaLegacy() @@ -446,7 +435,11 @@ void LLAvatarNameCache::requestNamesViaLegacy() // invoked below. This should never happen in practice. sPendingQueue[agent_id] = now; - gCacheName->get(agent_id, false, legacyNameCallback); + LL_DEBUGS("AvNameCache") << "LLAvatarNameCache::requestNamesViaLegacy agent " << agent_id << LL_ENDL; + + gCacheName->get(agent_id, false, // legacy compatibility + boost::bind(&LLAvatarNameCache::legacyNameCallback, + _1, _2, _3)); } // We've either answered immediately or moved all asks to the @@ -482,21 +475,24 @@ void LLAvatarNameCache::importFile(std::istream& istr) av_name.fromLLSD( it->second ); sCache[agent_id] = av_name; } - // entries may have expired since we last ran the viewer, just - // clean them out now - eraseExpired(); - llinfos << "loaded " << sCache.size() << llendl; + LL_INFOS("AvNameCache") << "loaded " << sCache.size() << LL_ENDL; + + // Some entries may have expired since the cache was stored, + // but they will be flushed in the first call to eraseUnrefreshed + // from LLAvatarNameResponder::idle } void LLAvatarNameCache::exportFile(std::ostream& ostr) { LLSD agents; + F64 max_unrefreshed = LLFrameTimer::getTotalSeconds() - MAX_UNREFRESHED_TIME; cache_t::const_iterator it = sCache.begin(); for ( ; it != sCache.end(); ++it) { const LLUUID& agent_id = it->first; const LLAvatarName& av_name = it->second; - if (!av_name.mIsDummy) + // Do not write temporary or expired entries to the stored cache + if (!av_name.mIsTemporaryName && av_name.mExpires >= max_unrefreshed) { // key must be a string agents[agent_id.asString()] = av_name.asLLSD(); @@ -531,36 +527,26 @@ void LLAvatarNameCache::idle() // return; //} - // Must be large relative to above - - // No longer deleting expired entries, just re-requesting in the get - // this way first synchronous get call on an expired entry won't return - // legacy name. LF - - //const F32 ERASE_EXPIRED_TIMEOUT = 60.f; // seconds - //if (sEraseExpiredTimer.checkExpirationAndReset(ERASE_EXPIRED_TIMEOUT)) - //{ - // eraseExpired(); - //} - - if (sAskQueue.empty()) + if (!sAskQueue.empty()) { - return; + if (useDisplayNames()) + { + requestNamesViaCapability(); + } + else + { + // ...fall back to legacy name cache system + requestNamesViaLegacy(); + } } - if (useDisplayNames()) - { - requestNamesViaCapability(); - } - else - { - // ...fall back to legacy name cache system - requestNamesViaLegacy(); - } + // erase anything that has not been refreshed for more than MAX_UNREFRESHED_TIME + eraseUnrefreshed(); } bool LLAvatarNameCache::isRequestPending(const LLUUID& agent_id) { + bool isPending = false; const F64 PENDING_TIMEOUT_SECS = 5.0 * 60.0; pending_queue_t::const_iterator it = sPendingQueue.find(agent_id); @@ -568,26 +554,38 @@ bool LLAvatarNameCache::isRequestPending(const LLUUID& agent_id) { // in the list of requests in flight, retry if too old F64 expire_time = LLFrameTimer::getTotalSeconds() - PENDING_TIMEOUT_SECS; - return it->second > expire_time; + isPending = (it->second > expire_time); } - return false; + return isPending; } -void LLAvatarNameCache::eraseExpired() +void LLAvatarNameCache::eraseUnrefreshed() { F64 now = LLFrameTimer::getTotalSeconds(); - cache_t::iterator it = sCache.begin(); - for (cache_t::iterator it = sCache.begin(); it != sCache.end();) - { - const LLAvatarName& av_name = it->second; - if (av_name.mExpires < now) - { - sCache.erase(it++); - } - else - { - ++it; - } + F64 max_unrefreshed = now - MAX_UNREFRESHED_TIME; + + if (!sLastExpireCheck || sLastExpireCheck < max_unrefreshed) + { + sLastExpireCheck = now; + + for (cache_t::iterator it = sCache.begin(); it != sCache.end();) + { + const LLAvatarName& av_name = it->second; + if (av_name.mExpires < max_unrefreshed) + { + const LLUUID& agent_id = it->first; + LL_DEBUGS("AvNameCache") << agent_id + << " user '" << av_name.mUsername << "' " + << "expired " << now - av_name.mExpires << " secs ago" + << LL_ENDL; + sCache.erase(it++); + } + else + { + ++it; + } + } + LL_INFOS("AvNameCache") << sCache.size() << " cached avatar names" << LL_ENDL; } } @@ -598,8 +596,11 @@ void LLAvatarNameCache::buildLegacyName(const std::string& full_name, av_name->mUsername = ""; av_name->mDisplayName = full_name; av_name->mIsDisplayNameDefault = true; - av_name->mIsDummy = true; - av_name->mExpires = F64_MAX; + av_name->mIsTemporaryName = true; + av_name->mExpires = F64_MAX; // not used because these are not cached + LL_DEBUGS("AvNameCache") << "LLAvatarNameCache::buildLegacyName " + << full_name + << LL_ENDL; // [Ansariel/Henri] // Why ain't those set? In case of disabled display names @@ -632,6 +633,9 @@ bool LLAvatarNameCache::get(const LLUUID& agent_id, LLAvatarName *av_name) { if (!isRequestPending(agent_id)) { + LL_DEBUGS("AvNameCache") << "LLAvatarNameCache::get " + << "refresh agent " << agent_id + << LL_ENDL; sAskQueue.insert(agent_id); } } @@ -641,7 +645,6 @@ bool LLAvatarNameCache::get(const LLUUID& agent_id, LLAvatarName *av_name) } else { - // ...use legacy names cache std::string full_name; if (gCacheName->getFullName(agent_id, full_name)) @@ -654,6 +657,9 @@ bool LLAvatarNameCache::get(const LLUUID& agent_id, LLAvatarName *av_name) if (!isRequestPending(agent_id)) { + LL_DEBUGS("AvNameCache") << "LLAvatarNameCache::get " + << "queue request for agent " << agent_id + << LL_ENDL; sAskQueue.insert(agent_id); } @@ -800,6 +806,8 @@ F64 LLAvatarNameCache::nameExpirationFromHeaders(LLSD headers) bool LLAvatarNameCache::expirationFromCacheControl(LLSD headers, F64 *expires) { + bool fromCacheControl = false; + F64 now = LLFrameTimer::getTotalSeconds(); // Allow the header to override the default LLSD cache_control_header = headers["cache-control"]; if (cache_control_header.isDefined()) @@ -808,12 +816,16 @@ bool LLAvatarNameCache::expirationFromCacheControl(LLSD headers, F64 *expires) std::string cache_control = cache_control_header.asString(); if (max_age_from_cache_control(cache_control, &max_age)) { - F64 now = LLFrameTimer::getTotalSeconds(); *expires = now + (F64)max_age; - return true; + fromCacheControl = true; } } - return false; + LL_DEBUGS("AvNameCache") + << ( fromCacheControl ? "expires based on cache control " : "default expiration " ) + << "in " << *expires - now << " seconds" + << LL_ENDL; + + return fromCacheControl; } diff --git a/indra/llmessage/llavatarnamecache.h b/indra/llmessage/llavatarnamecache.h index 28a864b1e..41eb64a06 100644 --- a/indra/llmessage/llavatarnamecache.h +++ b/indra/llmessage/llavatarnamecache.h @@ -85,10 +85,11 @@ namespace LLAvatarNameCache void setForceDisplayNames(bool force); // [/RLVa:KB] - bool isRequestPending(const LLUUID& agent_id); - void erase(const LLUUID& agent_id); + /// Provide some fallback for agents that return errors + void handleAgentError(const LLUUID& agent_id); + // Force a re-fetch of the most recent data, but keep the current // data in cache void fetch(const LLUUID& agent_id); diff --git a/indra/llmessage/llcachename.cpp b/indra/llmessage/llcachename.cpp index bff30f4b6..f9036c080 100644 --- a/indra/llmessage/llcachename.cpp +++ b/indra/llmessage/llcachename.cpp @@ -43,10 +43,7 @@ #include "lluuid.h" #include "message.h" -// Constants -static const std::string CN_WAITING("(Loading...)"); // *TODO: translate -static const std::string CN_NOBODY("(nobody)"); // *TODO: translate -static const std::string CN_NONE("(none)"); // *TODO: translate +#include // llsd serialization constants static const std::string AGENTS("agents"); @@ -65,6 +62,7 @@ const S32 CN_FILE_VERSION = 2; // Globals LLCacheName* gCacheName = NULL; +std::map LLCacheName::sCacheName; /// --------------------------------------------------------------------------- /// class LLCacheNameEntry @@ -84,6 +82,8 @@ public: }; LLCacheNameEntry::LLCacheNameEntry() + : mIsGroup(false), + mCreateTime(0) { } @@ -92,17 +92,19 @@ class PendingReply { public: LLUUID mID; - LLCacheNameCallback mCallback; + LLCacheNameSignal mSignal; LLHost mHost; - void* mData; - PendingReply(const LLUUID& id, LLCacheNameCallback callback, void* data = NULL) - : mID(id), mCallback(callback), mData(data) - { } - + PendingReply(const LLUUID& id, const LLHost& host) - : mID(id), mCallback(0), mHost(host) - { } - + : mID(id), mHost(host) + { + } + + boost::signals2::connection setCallback(const LLCacheNameCallback& cb) + { + return mSignal.connect(cb); + } + void done() { mID.setNull(); } bool isDone() const { return mID.isNull() != FALSE; } }; @@ -126,7 +128,7 @@ private: }; ReplySender::ReplySender(LLMessageSystem* msg) - : mMsg(msg), mPending(false) + : mMsg(msg), mPending(false), mCurrIsGroup(false) { } ReplySender::~ReplySender() @@ -187,10 +189,10 @@ void ReplySender::flush() typedef std::set AskQueue; -typedef std::vector ReplyQueue; +typedef std::list ReplyQueue; typedef std::map PendingQueue; typedef std::map Cache; -typedef std::vector Observers; +typedef std::map ReverseCache; class LLCacheName::Impl { @@ -200,7 +202,9 @@ public: Cache mCache; // the map of UUIDs to names - + ReverseCache mReverseCache; + // map of names to UUIDs + AskQueue mAskNameQueue; AskQueue mAskGroupQueue; // UUIDs to ask our upstream host about @@ -211,13 +215,18 @@ public: ReplyQueue mReplyQueue; // requests awaiting replies from us - Observers mObservers; + LLCacheNameSignal mSignal; LLFrameTimer mProcessTimer; Impl(LLMessageSystem* msg); ~Impl(); + BOOL getName(const LLUUID& id, std::string& first, std::string& last); + + boost::signals2::connection addPending(const LLUUID& id, const LLCacheNameCallback& callback); + void addPending(const LLUUID& id, const LLHost& host); + void processPendingAsks(); void processPendingReplies(); void sendRequest(const char* msg_name, const AskQueue& queue); @@ -231,8 +240,6 @@ public: static void handleUUIDNameReply(LLMessageSystem* msg, void** userdata); static void handleUUIDGroupNameRequest(LLMessageSystem* msg, void** userdata); static void handleUUIDGroupNameReply(LLMessageSystem* msg, void** userdata); - - void notifyObservers(const LLUUID& id, const std::string& first, const std::string& last, BOOL group); }; @@ -247,6 +254,9 @@ LLCacheName::LLCacheName(LLMessageSystem* msg) LLCacheName::LLCacheName(LLMessageSystem* msg, const LLHost& upstream_host) : impl(* new Impl(msg)) { + sCacheName["waiting"] = "(Loading...)"; + sCacheName["nobody"] = "(nobody)"; + sCacheName["none"] = "(none)"; setUpstream(upstream_host); } @@ -272,54 +282,34 @@ LLCacheName::Impl::Impl(LLMessageSystem* msg) LLCacheName::Impl::~Impl() { for_each(mCache.begin(), mCache.end(), DeletePairedPointer()); + for_each(mReplyQueue.begin(), mReplyQueue.end(), DeletePointer()); } +boost::signals2::connection LLCacheName::Impl::addPending(const LLUUID& id, const LLCacheNameCallback& callback) +{ + PendingReply* reply = new PendingReply(id, LLHost()); + boost::signals2::connection res = reply->setCallback(callback); + mReplyQueue.push_back(reply); + return res; +} + +void LLCacheName::Impl::addPending(const LLUUID& id, const LLHost& host) +{ + PendingReply* reply = new PendingReply(id, host); + mReplyQueue.push_back(reply); +} void LLCacheName::setUpstream(const LLHost& upstream_host) { impl.mUpstreamHost = upstream_host; } -void LLCacheName::addObserver(LLCacheNameCallback callback) +boost::signals2::connection LLCacheName::addObserver(const LLCacheNameCallback& callback) { - impl.mObservers.push_back(callback); -} - -void LLCacheName::removeObserver(LLCacheNameCallback callback) -{ - Observers::iterator it = impl.mObservers.begin(); - Observers::iterator end = impl.mObservers.end(); - - for ( ; it != end; ++it) - { - const LLCacheNameCallback& cb = (*it); - if (cb == callback) - { - impl.mObservers.erase(it); - return; - } - } -} - -void LLCacheName::cancelCallback(const LLUUID& id, LLCacheNameCallback callback, void* user_data) -{ - ReplyQueue::iterator it = impl.mReplyQueue.begin(); - ReplyQueue::iterator end = impl.mReplyQueue.end(); - - for(; it != end; ++it) - { - const PendingReply& reply = (*it); - - if ((callback == reply.mCallback) - && (id == reply.mID) - && (user_data == reply.mData) ) - { - impl.mReplyQueue.erase(it); - return; - } - } + return impl.mSignal.connect(callback); } +#if 0 void LLCacheName::importFile(LLFILE* fp) { S32 count = 0; @@ -396,11 +386,12 @@ void LLCacheName::importFile(LLFILE* fp) llinfos << "LLCacheName loaded " << count << " names" << llendl; } +#endif bool LLCacheName::importFile(std::istream& istr) { LLSD data; - if(LLSDSerialize::fromXML(data, istr) < 1) + if(LLSDSerialize::fromXMLDocument(data, istr) < 1) return false; // We'll expire entries more than a week old @@ -426,6 +417,9 @@ bool LLCacheName::importFile(std::istream& istr) entry->mFirstName = agent[FIRST].asString(); entry->mLastName = agent[LAST].asString(); impl.mCache[id] = entry; + std::string fullname = buildFullName(entry->mFirstName, entry->mLastName); + impl.mReverseCache[fullname] = id; + ++count; } llinfos << "LLCacheName loaded " << count << " agent names" << llendl; @@ -446,6 +440,7 @@ bool LLCacheName::importFile(std::istream& istr) entry->mCreateTime = ctime; entry->mGroupName = group[NAME].asString(); impl.mCache[id] = entry; + impl.mReverseCache[entry->mGroupName] = id; ++count; } llinfos << "LLCacheName loaded " << count << " group names" << llendl; @@ -488,16 +483,16 @@ void LLCacheName::exportFile(std::ostream& ostr) } -BOOL LLCacheName::getName(const LLUUID& id, std::string& first, std::string& last) +BOOL LLCacheName::Impl::getName(const LLUUID& id, std::string& first, std::string& last) { if(id.isNull()) { - first = CN_NOBODY; + first = sCacheName["nobody"]; last.clear(); - return FALSE; + return TRUE; } - LLCacheNameEntry* entry = get_ptr_in_map(impl.mCache, id ); + LLCacheNameEntry* entry = get_ptr_in_map(mCache, id ); if (entry) { first = entry->mFirstName; @@ -506,32 +501,42 @@ BOOL LLCacheName::getName(const LLUUID& id, std::string& first, std::string& las } else { - first = CN_WAITING; + first = sCacheName["waiting"]; last.clear(); - if (!impl.isRequestPending(id)) + if (!isRequestPending(id)) { - impl.mAskNameQueue.insert(id); + mAskNameQueue.insert(id); } return FALSE; } } +// static +void LLCacheName::localizeCacheName(std::string key, std::string value) +{ + if (key!="" && value!= "" ) + sCacheName[key]=value; + else + llwarns<< " Error localizing cache key " << key << " To "<< value<second; + return TRUE; + } + else + { + return FALSE; + } +} + +//static +std::string LLCacheName::buildFullName(const std::string& first, const std::string& last) +{ + std::string fullname = first; + if (!last.empty() + && last != "Resident") + { + fullname += ' '; + fullname += last; + } + return fullname; +} + +//static +std::string LLCacheName::cleanFullName(const std::string& full_name) +{ + return full_name.substr(0, full_name.find(" Resident")); +} + +//static +std::string LLCacheName::buildUsername(const std::string& full_name) +{ + // rare, but handle hard-coded error names returned from server + if (full_name == "(\?\?\?) (\?\?\?)") + { + return "(\?\?\?)"; + } + + std::string::size_type index = full_name.find(' '); + + if (index != std::string::npos) + { + std::string username; + username = full_name.substr(0, index); + std::string lastname = full_name.substr(index+1); + + if (lastname != "Resident") + { + username = username + "." + lastname; + } + + LLStringUtil::toLower(username); + return username; + } + + // if the input wasn't a correctly formatted legacy name just return it unchanged + return full_name; +} + +//static +std::string LLCacheName::buildLegacyName(const std::string& complete_name) +{ + //boost::regexp was showing up in the crashreporter, so doing + //painfully manual parsing using substr. LF + S32 open_paren = complete_name.rfind(" ("); + S32 close_paren = complete_name.rfind(')'); + + if (open_paren != std::string::npos && + close_paren == complete_name.length()-1) + { + S32 length = close_paren - open_paren - 2; + std::string legacy_name = complete_name.substr(open_paren+2, length); + + if (legacy_name.length() > 0) + { + std::string cap_letter = legacy_name.substr(0, 1); + LLStringUtil::toUpper(cap_letter); + legacy_name = cap_letter + legacy_name.substr(1); + + S32 separator = legacy_name.find('.'); + + if (separator != std::string::npos) + { + std::string last_name = legacy_name.substr(separator+1); + legacy_name = legacy_name.substr(0, separator); + + if (last_name.length() > 0) + { + cap_letter = last_name.substr(0, 1); + LLStringUtil::toUpper(cap_letter); + legacy_name = legacy_name + " " + cap_letter + last_name.substr(1); + } + } + + return legacy_name; + } + } + + return complete_name; +} + +// This is a little bit kludgy. LLCacheNameCallback is a slot instead of a function pointer. +// The reason it is a slot is so that the legacy get() function below can bind an old callback +// and pass it as a slot. The reason it isn't a boost::function is so that trackable behavior +// doesn't get lost. As a result, we have to bind the slot to a signal to call it, even when +// we call it immediately. -Steve +// NOTE: Even though passing first and last name is a bit of extra overhead, it eliminates the +// potential need for any parsing should any code need to handle first and last name independently. +boost::signals2::connection LLCacheName::get(const LLUUID& id, bool is_group, const LLCacheNameCallback& callback) +{ + boost::signals2::connection res; + if(id.isNull()) { - callback(id, CN_NOBODY, "", is_group, user_data); - return; + LLCacheNameSignal signal; + signal.connect(callback); + signal(id, sCacheName["nobody"], is_group); + return res; } LLCacheNameEntry* entry = get_ptr_in_map(impl.mCache, id ); if (entry) { + LLCacheNameSignal signal; + signal.connect(callback); // id found in map therefore we can call the callback immediately. if (entry->mIsGroup) { - callback(id, entry->mGroupName, "", entry->mIsGroup, user_data); + signal(id, entry->mGroupName, entry->mIsGroup); } else { - callback(id, entry->mFirstName, entry->mLastName, entry->mIsGroup, user_data); + std::string fullname = + buildFullName(entry->mFirstName, entry->mLastName); + signal(id, fullname, entry->mIsGroup); } } else @@ -597,16 +726,29 @@ void LLCacheName::get(const LLUUID& id, BOOL is_group, LLCacheNameCallback callb impl.mAskNameQueue.insert(id); } } - impl.mReplyQueue.push_back(PendingReply(id, callback, user_data)); + res = impl.addPending(id, callback); } + return res; } + +boost::signals2::connection LLCacheName::getGroup(const LLUUID& group_id, + const LLCacheNameCallback& callback) +{ + return get(group_id, true, callback); +} + +boost::signals2::connection LLCacheName::get(const LLUUID& id, bool is_group, old_callback_t callback, void* user_data) +{ + return get(id, is_group, boost::bind(callback, _1, _2, _3, user_data)); +} + // -BOOL LLCacheName::getIfThere(const LLUUID& id, std::string& fullname, BOOL& is_group) +bool LLCacheName::getIfThere(const LLUUID& id, std::string& fullname, BOOL& is_group) { if(id.isNull()) { fullname = ""; - return FALSE; + return false; } LLCacheNameEntry* entry = get_ptr_in_map(impl.mCache, id ); @@ -621,10 +763,10 @@ BOOL LLCacheName::getIfThere(const LLUUID& id, std::string& fullname, BOOL& is_g fullname = entry->mFirstName + " " + entry->mLastName; } is_group = entry->mIsGroup; - return TRUE; + return true; } fullname = ""; - return FALSE; + return false; } // void LLCacheName::processPending() @@ -695,7 +837,7 @@ void LLCacheName::dump() { llinfos << iter->first << " = " - << entry->mFirstName << " " << entry->mLastName + << buildFullName(entry->mFirstName, entry->mLastName) << " @ " << entry->mCreateTime << llendl; } @@ -710,16 +852,27 @@ void LLCacheName::dumpStats() << " AskGroup=" << impl.mAskGroupQueue.size() << " Pending=" << impl.mPendingQueue.size() << " Reply=" << impl.mReplyQueue.size() - << " Observers=" << impl.mObservers.size() +// << " Observers=" << impl.mSignal.size() << llendl; } +void LLCacheName::clear() +{ + for_each(impl.mCache.begin(), impl.mCache.end(), DeletePairedPointer()); + impl.mCache.clear(); +} + //static std::string LLCacheName::getDefaultName() { - return CN_WAITING; + return sCacheName["waiting"]; } +//static +std::string LLCacheName::getDefaultLastName() +{ + return "Resident"; +} void LLCacheName::Impl::processPendingAsks() { sendRequest(_PREHASH_UUIDNameRequest, mAskNameQueue); @@ -730,50 +883,51 @@ void LLCacheName::Impl::processPendingAsks() void LLCacheName::Impl::processPendingReplies() { - ReplyQueue::iterator it = mReplyQueue.begin(); - ReplyQueue::iterator end = mReplyQueue.end(); - // First call all the callbacks, because they might send messages. - for(; it != end; ++it) + for(ReplyQueue::iterator it = mReplyQueue.begin(); it != mReplyQueue.end(); ++it) { - LLCacheNameEntry* entry = get_ptr_in_map(mCache, it->mID); + PendingReply* reply = *it; + LLCacheNameEntry* entry = get_ptr_in_map(mCache, reply->mID); if(!entry) continue; - if (it->mCallback) + if (!entry->mIsGroup) { - if (!entry->mIsGroup) - { - (it->mCallback)(it->mID, - entry->mFirstName, entry->mLastName, - FALSE, it->mData); - } - else { - (it->mCallback)(it->mID, - entry->mGroupName, "", - TRUE, it->mData); - } + std::string fullname = + LLCacheName::buildFullName(entry->mFirstName, entry->mLastName); + (reply->mSignal)(reply->mID, fullname, false); + } + else + { + (reply->mSignal)(reply->mID, entry->mGroupName, true); } } // Forward on all replies, if needed. ReplySender sender(mMsg); - for (it = mReplyQueue.begin(); it != end; ++it) + for(ReplyQueue::iterator it = mReplyQueue.begin(); it != mReplyQueue.end(); ++it) { - LLCacheNameEntry* entry = get_ptr_in_map(mCache, it->mID); + PendingReply* reply = *it; + LLCacheNameEntry* entry = get_ptr_in_map(mCache, reply->mID); if(!entry) continue; - if (it->mHost.isOk()) + if (reply->mHost.isOk()) { - sender.send(it->mID, *entry, it->mHost); + sender.send(reply->mID, *entry, reply->mHost); } - it->done(); + reply->done(); + } + + for(ReplyQueue::iterator it = mReplyQueue.begin(); it != mReplyQueue.end(); ) + { + ReplyQueue::iterator curit = it++; + PendingReply* reply = *curit; + if (reply->isDone()) + { + delete reply; + mReplyQueue.erase(curit); + } } - - mReplyQueue.erase( - remove_if(mReplyQueue.begin(), mReplyQueue.end(), - std::mem_fun_ref(&PendingReply::isDone)), - mReplyQueue.end()); } @@ -811,18 +965,6 @@ void LLCacheName::Impl::sendRequest( } } -void LLCacheName::Impl::notifyObservers(const LLUUID& id, - const std::string& first, const std::string& last, BOOL is_group) -{ - for (Observers::const_iterator i = mObservers.begin(), - end = mObservers.end(); - i != end; - ++i) - { - (**i)(id, first, last, is_group, NULL); - } -} - bool LLCacheName::Impl::isRequestPending(const LLUUID& id) { U32 now = (U32)time(NULL); @@ -889,7 +1031,7 @@ void LLCacheName::Impl::processUUIDRequest(LLMessageSystem* msg, bool isGroup) } } - mReplyQueue.push_back(PendingReply(id, fromHost)); + addPending(id, fromHost); } } } @@ -927,11 +1069,32 @@ void LLCacheName::Impl::processUUIDReply(LLMessageSystem* msg, bool isGroup) if (!isGroup) { - notifyObservers(id, entry->mFirstName, entry->mLastName, FALSE); + // NOTE: Very occasionally the server sends down a full name + // in the first name field with an empty last name, for example, + // first = "Ladanie1 Resident", last = "". + // I cannot reproduce this, nor can I find a bug in the server code. + // Ensure "Resident" does not appear via cleanFullName, because + // buildFullName only checks last name. JC + std::string full_name; + if (entry->mLastName.empty()) + { + full_name = cleanFullName(entry->mFirstName); + + //fix what we are putting in the cache + entry->mFirstName = full_name; + entry->mLastName = "Resident"; + } + else + { + full_name = LLCacheName::buildFullName(entry->mFirstName, entry->mLastName); + } + mSignal(id, full_name, false); + mReverseCache[full_name] = id; } else { - notifyObservers(id, entry->mGroupName, "", TRUE); + mSignal(id, entry->mGroupName, true); + mReverseCache[entry->mGroupName] = id; } } } diff --git a/indra/llmessage/llcachename.h b/indra/llmessage/llcachename.h index 773c23ef2..5ef562103 100644 --- a/indra/llmessage/llcachename.h +++ b/indra/llmessage/llcachename.h @@ -33,12 +33,21 @@ #ifndef LL_LLCACHENAME_H #define LL_LLCACHENAME_H +#include +#include + class LLMessageSystem; class LLHost; class LLUUID; -// agent_id/group_id, first_name, last_name, is_group, user_data -typedef void (*LLCacheNameCallback)(const LLUUID&, const std::string&, const std::string&, BOOL, void*); + +typedef boost::signals2::signal LLCacheNameSignal; +typedef LLCacheNameSignal::slot_type LLCacheNameCallback; + +// Old callback with user data for compatability +typedef void (*old_callback_t)(const LLUUID&, const std::string&, bool, void*); // Here's the theory: // If you request a name that isn't in the cache, it returns "waiting" @@ -59,25 +68,44 @@ public: // for simulators, this is the data server void setUpstream(const LLHost& upstream_host); - void addObserver(LLCacheNameCallback callback); - void removeObserver(LLCacheNameCallback callback); - - void cancelCallback(const LLUUID& id, LLCacheNameCallback callback, void* user_data = NULL); + boost::signals2::connection addObserver(const LLCacheNameCallback& callback); // janky old format. Remove after a while. Phoenix. 2008-01-30 +#if 0 void importFile(LLFILE* fp); +#endif // storing cache on disk; for viewer, in name.cache bool importFile(std::istream& istr); void exportFile(std::ostream& ostr); - // If available, copies the first and last name into the strings provided. - // first must be at least DB_FIRST_NAME_BUF_SIZE characters. - // last must be at least DB_LAST_NAME_BUF_SIZE characters. + // If available, copies name ("bobsmith123" or "James Linden") into string // If not available, copies the string "waiting". // Returns TRUE iff available. - BOOL getName(const LLUUID& id, std::string& first, std::string& last); - BOOL getFullName(const LLUUID& id, std::string& fullname); + BOOL getFullName(const LLUUID& id, std::string& full_name); + + // Reverse lookup of UUID from name + BOOL getUUID(const std::string& first, const std::string& last, LLUUID& id); + BOOL getUUID(const std::string& fullname, LLUUID& id); + + // IDEVO Temporary code + // Clean up new-style "bobsmith123 Resident" names to "bobsmith123" for display + static std::string buildFullName(const std::string& first, const std::string& last); + + // Clean up legacy "bobsmith123 Resident" to "bobsmith123" + // If name does not contain "Resident" returns it unchanged. + static std::string cleanFullName(const std::string& full_name); + + // Converts a standard legacy name to a username + // "bobsmith123 Resident" -> "bobsmith" + // "Random Linden" -> "random.linden" + static std::string buildUsername(const std::string& name); + + // Converts a complete display name to a legacy name + // if possible, otherwise returns the input + // "Alias (random.linden)" -> "Random Linden" + // "Something random" -> "Something random" + static std::string buildLegacyName(const std::string& name); // If available, this method copies the group name into the string // provided. The caller must allocate at least @@ -89,16 +117,19 @@ public: // If the data is currently available, may call the callback immediatly // otherwise, will request the data, and will call the callback when // available. There is no garuntee the callback will ever be called. - void get(const LLUUID& id, BOOL is_group, LLCacheNameCallback callback, void* user_data = NULL); + boost::signals2::connection get(const LLUUID& id, bool is_group, const LLCacheNameCallback& callback); - // - BOOL getIfThere(const LLUUID& id, std::string& fullname, BOOL& is_group); - // +// + bool getIfThere(const LLUUID& id, std::string& fullname, BOOL& is_group); +// + + // Convenience method for looking up a group name, so you can + // tell the difference between avatar lookup and group lookup + // in global searches + boost::signals2::connection getGroup(const LLUUID& group_id, const LLCacheNameCallback& callback); // LEGACY - void getName(const LLUUID& id, LLCacheNameCallback callback, void* user_data = NULL) - { get(id, FALSE, callback, user_data); } - + boost::signals2::connection get(const LLUUID& id, bool is_group, old_callback_t callback, void* user_data); // This method needs to be called from time to time to send out // requests. void processPending(); @@ -109,9 +140,16 @@ public: // Debugging void dump(); // Dumps the contents of the cache void dumpStats(); // Dumps the sizes of the cache and associated queues. + void clear(); // Deletes all entries from the cache static std::string getDefaultName(); + // Returns "Resident", the default last name for SLID-based accounts + // that have no last name. + static std::string getDefaultLastName(); + + static void localizeCacheName(std::string key, std::string value); + static std::map sCacheName; private: class Impl; diff --git a/indra/llmessage/mean_collision_data.h b/indra/llmessage/mean_collision_data.h index 03b96f9f9..a6c635e81 100644 --- a/indra/llmessage/mean_collision_data.h +++ b/indra/llmessage/mean_collision_data.h @@ -61,7 +61,7 @@ public: LLMeanCollisionData(LLMeanCollisionData *mcd) : mVictim(mcd->mVictim), mPerp(mcd->mPerp), mTime(mcd->mTime), mType(mcd->mType), mMag(mcd->mMag), - mFirstName(mcd->mFirstName), mLastName(mcd->mLastName) + mFullName(mcd->mFullName) { } @@ -95,8 +95,7 @@ public: time_t mTime; EMeanCollisionType mType; F32 mMag; - std::string mFirstName; - std::string mLastName; + std::string mFullName; }; diff --git a/indra/newview/jcfloaterareasearch.cpp b/indra/newview/jcfloaterareasearch.cpp index ed00447df..57ad0bebd 100644 --- a/indra/newview/jcfloaterareasearch.cpp +++ b/indra/newview/jcfloaterareasearch.cpp @@ -310,12 +310,6 @@ void JCFloaterAreaSearch::results() sInstance->mLastUpdateTimer.reset(); } -// static -void JCFloaterAreaSearch::callbackLoadOwnerName(const LLUUID& id, const std::string& first, const std::string& last, BOOL is_group, void* data) -{ - results(); -} - // static void JCFloaterAreaSearch::processObjectPropertiesFamily(LLMessageSystem* msg, void** user_data) { @@ -335,8 +329,8 @@ void JCFloaterAreaSearch::processObjectPropertiesFamily(LLMessageSystem* msg, vo msg->getUUIDFast(_PREHASH_ObjectData, _PREHASH_GroupID, details->group_id); msg->getStringFast(_PREHASH_ObjectData, _PREHASH_Name, details->name); msg->getStringFast(_PREHASH_ObjectData, _PREHASH_Description, details->desc); - gCacheName->get(details->owner_id, FALSE, callbackLoadOwnerName); - gCacheName->get(details->group_id, TRUE, callbackLoadOwnerName); + gCacheName->get(details->owner_id, false, boost::bind(&JCFloaterAreaSearch::results)); + gCacheName->get(details->group_id, true, boost::bind(&JCFloaterAreaSearch::results)); //llinfos << "Got info for " << (exists ? "requested" : "unknown") << " object " << object_id << llendl; } } diff --git a/indra/newview/jcfloaterareasearch.h b/indra/newview/jcfloaterareasearch.h index 9feb9aa4d..5c9233362 100644 --- a/indra/newview/jcfloaterareasearch.h +++ b/indra/newview/jcfloaterareasearch.h @@ -61,7 +61,6 @@ public: static void results(); static void toggle(); static JCFloaterAreaSearch* getInstance() { return sInstance; } - static void callbackLoadOwnerName(const LLUUID& id, const std::string& first, const std::string& last, BOOL is_group, void* data); static void processObjectPropertiesFamily(LLMessageSystem* msg, void** user_data); private: diff --git a/indra/newview/llappviewer.cpp b/indra/newview/llappviewer.cpp index cc06d65be..cf0da0c48 100644 --- a/indra/newview/llappviewer.cpp +++ b/indra/newview/llappviewer.cpp @@ -33,7 +33,6 @@ #include "llviewerprecompiledheaders.h" #include "llappviewer.h" -#include "llprimitive.h" #include "hippogridmanager.h" #include "hippolimits.h" @@ -79,12 +78,16 @@ #include "llfirstuse.h" #include "llrender.h" #include "llfont.h" -#include "llimagej2c.h" #include "llvocache.h" #include "llweb.h" #include "llsecondlifeurls.h" - + +// Linden library includes +#include "llavatarnamecache.h" +#include "lldiriterator.h" +#include "llimagej2c.h" +#include "llprimitive.h" #include #if LL_WINDOWS @@ -117,7 +120,6 @@ #include "lltoolmgr.h" #include "llassetstorage.h" #include "llpolymesh.h" -#include "llcachename.h" #include "llaudioengine.h" #include "llstreamingaudio.h" #include "llviewermenu.h" @@ -181,8 +183,6 @@ #include "llviewerthrottle.h" #include "llparcel.h" -#include "lldiriterator.h" -#include "llavatarnamecache.h" #include "llinventoryview.h" #include "llcommandlineparser.h" @@ -1257,10 +1257,7 @@ bool LLAppViewer::cleanup() LLPolyMesh::freeAllMeshes(); - LLAvatarNameCache::cleanupClass(); - - delete gCacheName; - gCacheName = NULL; + LLStartUp::cleanupNameCache(); // Note: this is where gLocalSpeakerMgr and gActiveSpeakerMgr used to be deleted. @@ -3455,12 +3452,14 @@ void LLAppViewer::loadNameCache() // Try to load from the legacy format. This should go away after a // while. Phoenix 2008-01-30 +#if 0 LLFILE* name_cache_fp = LLFile::fopen(name_cache, "r"); // Flawfinder: ignore if (name_cache_fp) { gCacheName->importFile(name_cache_fp); fclose(name_cache_fp); } +#endif } void LLAppViewer::saveNameCache() @@ -3658,9 +3657,6 @@ void LLAppViewer::idle() { LLFastTimer t(LLFastTimer::FTM_NETWORK); - // Phoenix: Wolfspirit: Prepare the namecache. - idleNameCache(); - //////////////////////////////////////////////// // // Network processing @@ -3668,6 +3664,7 @@ void LLAppViewer::idle() // NOTE: Starting at this point, we may still have pointers to "dead" objects // floating throughout the various object lists. // + idleNameCache(); gFrameStats.start(LLFrameStats::IDLE_NETWORK); stop_glerror(); @@ -4012,11 +4009,9 @@ void LLAppViewer::idleNameCache() if (had_capability != have_capability) { // name tags are persistant on screen, so make sure they refresh - //LLVOAvatar::invalidateNameTags(); + LLVOAvatar::invalidateNameTags(); //Should this be commented out? } - - // Phoenix: Wolfspirit: Check if we are using Display Names and set it. Then idle the cache. LLAvatarNameCache::idle(); } @@ -4081,8 +4076,6 @@ void LLAppViewer::idleNetwork() { LLFastTimer t(LLFastTimer::FTM_IDLE_NETWORK); // decode - // deal with any queued name requests and replies. - gCacheName->processPending(); llpushcallstacks ; LLTimer check_message_timer; // Read all available packets from network diff --git a/indra/newview/llcallingcard.cpp b/indra/newview/llcallingcard.cpp index 98aaea820..0f591c968 100644 --- a/indra/newview/llcallingcard.cpp +++ b/indra/newview/llcallingcard.cpp @@ -97,29 +97,10 @@ const F32 OFFLINE_SECONDS = FIND_FREQUENCY + 8.0f; // static LLAvatarTracker LLAvatarTracker::sInstance; -/* -class LLAvatarTrackerInventoryObserver : public LLInventoryObserver -{ -public: - LLAvatarTrackerInventoryObserver(LLAvatarTracker* at) : - mAT(at) {} - virtual ~LLAvatarTrackerInventoryObserver() {} - virtual void changed(U32 mask); -protected: - LLAvatarTracker* mAT; -}; -*/ - -/* -void LLAvatarTrackerInventoryObserver::changed(U32 mask) -{ - // if there's a calling card change, just do it. - if((mask & LLInventoryObserver::CALLING_CARD) != 0) - { - mAT->inventoryChanged(); - } -} -*/ +static void on_avatar_name_cache_notify(const LLUUID& agent_id, + const LLAvatarName& av_name, + bool online, + LLSD payload); ///---------------------------------------------------------------------------- /// Class LLAvatarTracker @@ -272,7 +253,7 @@ S32 LLAvatarTracker::addBuddyList(const LLAvatarTracker::buddy_map_t& buds) using namespace std; U32 new_buddy_count = 0; - std::string first,last; + std::string full_name; LLUUID agent_id; for(buddy_map_t::const_iterator itr = buds.begin(); itr != buds.end(); ++itr) { @@ -282,8 +263,9 @@ S32 LLAvatarTracker::addBuddyList(const LLAvatarTracker::buddy_map_t& buds) { ++new_buddy_count; mBuddyInfo[agent_id] = (*itr).second; - gCacheName->getName(agent_id, first, last); - mModifyMask |= LLFriendObserver::ADD; + // IDEVO: is this necessary? name is unused? + gCacheName->getFullName(agent_id, full_name); + addChangedMask(LLFriendObserver::ADD, agent_id); lldebugs << "Added buddy " << agent_id << ", " << (mBuddyInfo[agent_id]->isOnline() ? "Online" : "Offline") << ", TO: " << mBuddyInfo[agent_id]->getRightsGrantedTo() @@ -331,7 +313,7 @@ void LLAvatarTracker::terminateBuddy(const LLUUID& id) msg->nextBlock("ExBlock"); msg->addUUID("OtherID", id); gAgent.sendReliableMessage(); - mModifyMask |= LLFriendObserver::REMOVE; + addChangedMask(LLFriendObserver::REMOVE, id); delete buddy; } @@ -342,6 +324,12 @@ const LLRelationship* LLAvatarTracker::getBuddyInfo(const LLUUID& id) const return get_ptr_in_map(mBuddyInfo, id); } +bool LLAvatarTracker::isBuddy(const LLUUID& id) const +{ + LLRelationship* info = get_ptr_in_map(mBuddyInfo, id); + return (info != NULL); +} + // online status void LLAvatarTracker::setBuddyOnline(const LLUUID& id, bool is_online) { @@ -349,7 +337,7 @@ void LLAvatarTracker::setBuddyOnline(const LLUUID& id, bool is_online) if(info) { info->online(is_online); - mModifyMask |= LLFriendObserver::ONLINE; + addChangedMask(LLFriendObserver::ONLINE, id); lldebugs << "Set buddy " << id << (is_online ? " Online" : " Offline") << llendl; } else @@ -504,7 +492,61 @@ void LLAvatarTracker::notifyObservers() { (*it)->changed(mModifyMask); } + + for (changed_buddy_t::iterator it = mChangedBuddyIDs.begin(); it != mChangedBuddyIDs.end(); it++) + { + notifyParticularFriendObservers(*it); + } + mModifyMask = LLFriendObserver::NONE; + mChangedBuddyIDs.clear(); +} + +void LLAvatarTracker::addParticularFriendObserver(const LLUUID& buddy_id, LLFriendObserver* observer) +{ + if (buddy_id.notNull() && observer) + mParticularFriendObserverMap[buddy_id].insert(observer); +} + +void LLAvatarTracker::removeParticularFriendObserver(const LLUUID& buddy_id, LLFriendObserver* observer) +{ + if (buddy_id.isNull() || !observer) + return; + + observer_map_t::iterator obs_it = mParticularFriendObserverMap.find(buddy_id); + if(obs_it == mParticularFriendObserverMap.end()) + return; + + obs_it->second.erase(observer); + + // purge empty sets from the map + if (obs_it->second.size() == 0) + mParticularFriendObserverMap.erase(obs_it); +} + +void LLAvatarTracker::notifyParticularFriendObservers(const LLUUID& buddy_id) +{ + observer_map_t::iterator obs_it = mParticularFriendObserverMap.find(buddy_id); + if(obs_it == mParticularFriendObserverMap.end()) + return; + + // Notify observers interested in buddy_id. + observer_set_t& obs = obs_it->second; + for (observer_set_t::iterator ob_it = obs.begin(); ob_it != obs.end(); ob_it++) + { + (*ob_it)->changed(mModifyMask); + } +} + +// store flag for change +// and id of object change applies to +void LLAvatarTracker::addChangedMask(U32 mask, const LLUUID& referent) +{ + mModifyMask |= mask; + if (referent.notNull()) + { + mChangedBuddyIDs.insert(referent); + } } void LLAvatarTracker::applyFunctor(LLRelationshipFunctor& f) @@ -609,21 +651,24 @@ void LLAvatarTracker::processChange(LLMessageSystem* msg) } args["NAME"] = fullname; } + + LLSD payload; + payload["from_id"] = agent_id; if(LLRelationship::GRANT_MODIFY_OBJECTS & new_rights) { - LLNotifications::instance().add("GrantedModifyRights",args); + LLNotifications::instance().add("GrantedModifyRights",args, payload); } else { - LLNotifications::instance().add("RevokedModifyRights",args); + LLNotifications::instance().add("RevokedModifyRights",args, payload); } } (mBuddyInfo[agent_id])->setRightsFrom(new_rights); } } } - mModifyMask |= LLFriendObserver::POWERS; + addChangedMask(LLFriendObserver::POWERS, agent_id); notifyObservers(); } @@ -648,32 +693,15 @@ void LLAvatarTracker::processNotify(LLMessageSystem* msg, bool online) { tracking_id = mTrackingData->mAvatarID; } - BOOL notify = FALSE; - LLSD args; + LLSD payload; for(S32 i = 0; i < count; ++i) { msg->getUUIDFast(_PREHASH_AgentBlock, _PREHASH_AgentID, agent_id, i); + payload["FROM_ID"] = agent_id; info = getBuddyInfo(agent_id); if(info) { setBuddyOnline(agent_id,online); - if(chat_notify) - { - std::string fullname; - LLAvatarName avatar_name; - if (LLAvatarNameCache::get(agent_id, &avatar_name)) - { - switch (gSavedSettings.getS32("PhoenixNameSystem")) - { - case 0 : fullname = avatar_name.getLegacyName(); break; - case 1 : fullname = (avatar_name.mIsDisplayNameDefault ? avatar_name.mDisplayName : avatar_name.getCompleteName()); break; - case 2 : fullname = avatar_name.mDisplayName; break; - default : fullname = avatar_name.getCompleteName(); break; - } - notify = TRUE; - args["NAME"] = fullname; - } - } } else { @@ -689,20 +717,12 @@ void LLAvatarTracker::processNotify(LLMessageSystem* msg, bool online) // *TODO: get actual inventory id gInventory.addChangedMask(LLInventoryObserver::CALLING_CARD, LLUUID::null); } - if(notify) + if(chat_notify) { - // Popup a notify box with online status of this agent - LLNotificationPtr notification = LLNotifications::instance().add(online ? "FriendOnline" : "FriendOffline", args); - - // If there's an open IM session with this agent, send a notification there too. - LLUUID session_id = LLIMMgr::computeSessionID(IM_NOTHING_SPECIAL, agent_id); - LLFloaterIMPanel *floater = gIMMgr->findFloaterBySession(session_id); - if (floater) - { - std::string notifyMsg = notification->getMessage(); - if (!notifyMsg.empty()) - floater->addHistoryLine(notifyMsg,gSavedSettings.getColor4("SystemChatColor")); - } + // Look up the name of this agent for the notification + LLAvatarNameCache::get(agent_id, + boost::bind(&on_avatar_name_cache_notify, + _1, _2, online, payload)); } mModifyMask |= LLFriendObserver::ONLINE; @@ -711,6 +731,36 @@ void LLAvatarTracker::processNotify(LLMessageSystem* msg, bool online) } } +static void on_avatar_name_cache_notify(const LLUUID& agent_id, + const LLAvatarName& av_name, + bool online, + LLSD payload) +{ + // Popup a notify box with online status of this agent + // Use display name only because this user is your friend + LLSD args; + switch (gSavedSettings.getS32("PhoenixNameSystem")) + { + case 0 : args["NAME"] = av_name.getLegacyName(); break; + case 1 : args["NAME"] = (av_name.mIsDisplayNameDefault ? av_name.mDisplayName : av_name.getCompleteName()); break; + case 2 : args["NAME"] = av_name.mDisplayName; break; + default : args["NAME"] = av_name.getCompleteName(); break; + } + + // Popup a notify box with online status of this agent + LLNotificationPtr notification = LLNotifications::instance().add(online ? "FriendOnline" : "FriendOffline", args, payload); + + // If there's an open IM session with this agent, send a notification there too. + LLUUID session_id = LLIMMgr::computeSessionID(IM_NOTHING_SPECIAL, agent_id); + LLFloaterIMPanel *floater = gIMMgr->findFloaterBySession(session_id); + if (floater) + { + std::string notifyMsg = notification->getMessage(); + if (!notifyMsg.empty()) + floater->addHistoryLine(notifyMsg,gSavedSettings.getColor4("SystemChatColor")); + } +} + void LLAvatarTracker::formFriendship(const LLUUID& id) { if(id.notNull()) @@ -723,7 +773,7 @@ void LLAvatarTracker::formFriendship(const LLUUID& id) //visible online to each other. buddy_info = new LLRelationship(LLRelationship::GRANT_ONLINE_STATUS,LLRelationship::GRANT_ONLINE_STATUS, false); at.mBuddyInfo[id] = buddy_info; - at.mModifyMask |= LLFriendObserver::ADD; + at.addChangedMask(LLFriendObserver::ADD, id); at.notifyObservers(); } } @@ -739,7 +789,7 @@ void LLAvatarTracker::processTerminateFriendship(LLMessageSystem* msg, void**) LLRelationship* buddy = get_ptr_in_map(at.mBuddyInfo, id); if(!buddy) return; at.mBuddyInfo.erase(id); - at.mModifyMask |= LLFriendObserver::REMOVE; + at.addChangedMask(LLFriendObserver::REMOVE, id); delete buddy; at.notifyObservers(); } @@ -837,10 +887,9 @@ bool LLCollectProxyBuddies::operator()(const LLUUID& buddy_id, LLRelationship* b bool LLCollectMappableBuddies::operator()(const LLUUID& buddy_id, LLRelationship* buddy) { - gCacheName->getName(buddy_id, mFirst, mLast); - std::ostringstream fullname; - fullname << mFirst << " " << mLast; - buddy_map_t::value_type value(fullname.str(), buddy_id); + LLAvatarName av_name; + LLAvatarNameCache::get( buddy_id, &av_name); + buddy_map_t::value_type value(av_name.mDisplayName, buddy_id); if(buddy->isOnline() && buddy->isRightGrantedFrom(LLRelationship::GRANT_MAP_LOCATION)) { mMappable.insert(value); @@ -850,10 +899,8 @@ bool LLCollectMappableBuddies::operator()(const LLUUID& buddy_id, LLRelationship bool LLCollectOnlineBuddies::operator()(const LLUUID& buddy_id, LLRelationship* buddy) { - gCacheName->getName(buddy_id, mFirst, mLast); - std::ostringstream fullname; - fullname << mFirst << " " << mLast; - buddy_map_t::value_type value(fullname.str(), buddy_id); + gCacheName->getFullName(buddy_id, mFullName); + buddy_map_t::value_type value(mFullName, buddy_id); if(buddy->isOnline()) { mOnline.insert(value); @@ -863,10 +910,10 @@ bool LLCollectOnlineBuddies::operator()(const LLUUID& buddy_id, LLRelationship* bool LLCollectAllBuddies::operator()(const LLUUID& buddy_id, LLRelationship* buddy) { - gCacheName->getName(buddy_id, mFirst, mLast); - std::ostringstream fullname; - fullname << mFirst << " " << mLast; - buddy_map_t::value_type value(fullname.str(), buddy_id); + LLAvatarName av_name; + LLAvatarNameCache::get(buddy_id, &av_name); + mFullName = av_name.mDisplayName; + buddy_map_t::value_type value(mFullName, buddy_id); if(buddy->isOnline()) { mOnline.insert(value); diff --git a/indra/newview/llcallingcard.h b/indra/newview/llcallingcard.h index a0f9d4a28..104b5122c 100644 --- a/indra/newview/llcallingcard.h +++ b/indra/newview/llcallingcard.h @@ -125,6 +125,9 @@ public: // get full info const LLRelationship* getBuddyInfo(const LLUUID& id) const; + // Is this person a friend/buddy/calling card holder? + bool isBuddy(const LLUUID& id) const; + // online status void setBuddyOnline(const LLUUID& id, bool is_online); bool isBuddyOnline(const LLUUID& id) const; @@ -147,6 +150,23 @@ public: void removeObserver(LLFriendObserver* observer); void notifyObservers(); + // Observers interested in updates of a particular avatar. + // On destruction these observers are NOT deleted. + void addParticularFriendObserver(const LLUUID& buddy_id, LLFriendObserver* observer); + void removeParticularFriendObserver(const LLUUID& buddy_id, LLFriendObserver* observer); + void notifyParticularFriendObservers(const LLUUID& buddy_id); + + /** + * Stores flag for change and id of object change applies to + * + * This allows outsiders to tell the AvatarTracker if something has + * been changed 'under the hood', + * and next notification will have exact avatar IDs have been changed. + */ + void addChangedMask(U32 mask, const LLUUID& referent); + + const std::set& getChangedIDs() { return mChangedBuddyIDs; } + // Apply the functor to every buddy. Do not actually modify the // buddy list in the functor or bad things will happen. void applyFunctor(LLRelationshipFunctor& f); @@ -154,7 +174,7 @@ public: static void formFriendship(const LLUUID& friend_id); void updateFriends(); - + protected: void deleteTrackingData(); void agentFound(const LLUUID& prey, @@ -181,9 +201,16 @@ protected: buddy_map_t mBuddyInfo; + typedef std::set changed_buddy_t; + changed_buddy_t mChangedBuddyIDs; + typedef std::vector observer_list_t; observer_list_t mObservers; + typedef std::set observer_set_t; + typedef std::map observer_map_t; + observer_map_t mParticularFriendObserverMap; + private: // do not implement LLAvatarTracker(const LLAvatarTracker&); @@ -215,8 +242,7 @@ public: virtual bool operator()(const LLUUID& buddy_id, LLRelationship* buddy); typedef std::map buddy_map_t; buddy_map_t mMappable; - std::string mFirst; - std::string mLast; + std::string mFullName; }; // collect dictionary sorted map of name -> agent_id for every online buddy @@ -228,8 +254,7 @@ public: virtual bool operator()(const LLUUID& buddy_id, LLRelationship* buddy); typedef std::map buddy_map_t; buddy_map_t mOnline; - std::string mFirst; - std::string mLast; + std::string mFullName; }; // collect dictionary sorted map of name -> agent_id for every buddy, @@ -243,8 +268,7 @@ public: typedef std::map buddy_map_t; buddy_map_t mOnline; buddy_map_t mOffline; - std::string mFirst; - std::string mLast; + std::string mFullName; }; #endif // LL_LLCALLINGCARD_H diff --git a/indra/newview/llfloateravatarlist.cpp b/indra/newview/llfloateravatarlist.cpp index ac058cb2b..d93ac98e3 100644 --- a/indra/newview/llfloateravatarlist.cpp +++ b/indra/newview/llfloateravatarlist.cpp @@ -449,11 +449,7 @@ void LLFloaterAvatarList::updateAvatarList() //duped for lower section if (name.empty() || (name.compare(" ") == 0))// || (name.compare(gCacheName->getDefaultName()) == 0)) { - if (gCacheName->getName(avid, first, last)) - { - name = first + " " + last; - } - else + if (!gCacheName->getFullName(avid, name)) //seems redudant with LLAvatarNameCache::get above... { continue; } @@ -497,11 +493,7 @@ void LLFloaterAvatarList::updateAvatarList() continue; } - if (gCacheName->getName(avid, first, last)) - { - name = first + " " + last; - } - else + if (!gCacheName->getFullName(avid, name)) { //name = gCacheName->getDefaultName(); continue; //prevent (Loading...) diff --git a/indra/newview/llfloaterbump.cpp b/indra/newview/llfloaterbump.cpp index 96e51c2fa..60a842abc 100644 --- a/indra/newview/llfloaterbump.cpp +++ b/indra/newview/llfloaterbump.cpp @@ -111,7 +111,7 @@ void LLFloaterBump::add(LLScrollListCtrl* list, LLMeanCollisionData* mcd) new LLFloaterBump(); } - if (mcd->mFirstName.empty() || list->getItemCount() >= 20) + if (mcd->mFullName.empty() || list->getItemCount() >= 20) { return; } @@ -152,8 +152,7 @@ void LLFloaterBump::add(LLScrollListCtrl* list, LLMeanCollisionData* mcd) // All above action strings are in XML file LLUIString text = sInstance->getString(action); text.setArg("[TIME]", time); - text.setArg("[FIRST]", mcd->mFirstName); - text.setArg("[LAST]", mcd->mLastName); + text.setArg("[NAME]", mcd->mFullName); LLSD row; row["id"] = mcd->mPerp; diff --git a/indra/newview/llfloaterbuyland.cpp b/indra/newview/llfloaterbuyland.cpp index 2c74ca209..1340ad905 100644 --- a/indra/newview/llfloaterbuyland.cpp +++ b/indra/newview/llfloaterbuyland.cpp @@ -200,8 +200,7 @@ private: }; }; -static void cacheNameUpdateRefreshesBuyLand(const LLUUID&, - const std::string&, const std::string&, BOOL, void* data) +static void cacheNameUpdateRefreshesBuyLand(const LLUUID& id, const std::string& full_name, bool is_group) { LLFloaterBuyLandUI* ui = LLFloaterBuyLandUI::soleInstance(false); if (ui) diff --git a/indra/newview/llfloatergroupinfo.cpp b/indra/newview/llfloatergroupinfo.cpp index 3ae7d5a87..67e2ebe05 100644 --- a/indra/newview/llfloatergroupinfo.cpp +++ b/indra/newview/llfloatergroupinfo.cpp @@ -188,7 +188,7 @@ void LLFloaterGroupInfo::refreshGroup(const LLUUID& group_id) } // static -void LLFloaterGroupInfo::callbackLoadGroupName(const LLUUID& id, const std::string& first, const std::string& last, BOOL is_group, void* data) +void LLFloaterGroupInfo::callbackLoadGroupName(const LLUUID& id, const std::string& full_name, bool is_group) { LLFloaterGroupInfo *fgi = get_if_there(sInstances, id, (LLFloaterGroupInfo*)NULL); @@ -196,7 +196,7 @@ void LLFloaterGroupInfo::callbackLoadGroupName(const LLUUID& id, const std::stri { // Build a new title including the group name. std::ostringstream title; - title << first << " - " << FLOATER_TITLE; + title << full_name << " - " << FLOATER_TITLE; fgi->setTitle(title.str()); } } @@ -221,8 +221,7 @@ void LLFloaterGroupInfo::showFromUUID(const LLUUID& group_id, { // Look up the group name. // The callback will insert it into the title. - const BOOL is_group = TRUE; - gCacheName->get(group_id, is_group, callbackLoadGroupName, NULL); + gCacheName->get(group_id, true, boost::bind(&callbackLoadGroupName, _1, _2, _3)); } } diff --git a/indra/newview/llfloatergroupinfo.h b/indra/newview/llfloatergroupinfo.h index 260c7d81a..ac1beecd2 100644 --- a/indra/newview/llfloatergroupinfo.h +++ b/indra/newview/llfloatergroupinfo.h @@ -76,7 +76,7 @@ protected: LLFloaterGroupInfo(const std::string& name, const LLRect &rect, const std::string& title, const LLUUID& group_id = LLUUID::null, const std::string& tab_name = std::string()); private: - static void callbackLoadGroupName(const LLUUID& id, const std::string& first, const std::string& last, BOOL is_group, void* data); + static void callbackLoadGroupName(const LLUUID& id, const std::string& full_name, bool is_group); static std::map sInstances; LLUUID mGroupID; diff --git a/indra/newview/llfloaterland.cpp b/indra/newview/llfloaterland.cpp index 84715f192..b2f5ce2bc 100644 --- a/indra/newview/llfloaterland.cpp +++ b/indra/newview/llfloaterland.cpp @@ -1317,10 +1317,9 @@ bool LLPanelLandObjects::callbackReturnOwnerObjects(const LLSD& notification, co } else { - std::string first, last; - gCacheName->getName(owner_id, first, last); - args["FIRST"] = first; - args["LAST"] = last; + std::string full_name; + gCacheName->getFullName(owner_id, full_name); + args["NAME"] = full_name; LLNotifications::instance().add("OtherObjectsReturned", args); } send_return_objects_message(parcel->getLocalID(), RT_OWNER); diff --git a/indra/newview/llfloaternewim.cpp b/indra/newview/llfloaternewim.cpp index 1e53a4dc2..de1a306da 100644 --- a/indra/newview/llfloaternewim.cpp +++ b/indra/newview/llfloaternewim.cpp @@ -41,7 +41,6 @@ S32 COL_1_WIDTH = 200; static std::string sOnlineDescriptor = "*"; -static std::string sNameFormat = "[FIRST] [LAST]"; LLFloaterNewIM::LLFloaterNewIM() { @@ -69,7 +68,6 @@ BOOL LLFloaterNewIM::postBuild() llwarns << "LLUICtrlFactory::getNameListByName() returned NULL for 'user_list'" << llendl; } sOnlineDescriptor = getString("online_descriptor"); - sNameFormat = getString("name_format"); setDefaultBtn("start_btn"); return TRUE; } @@ -135,11 +133,8 @@ void LLFloaterNewIM::addGroup(const LLUUID& uuid, void* data, BOOL bold, BOOL on void LLFloaterNewIM::addAgent(const LLUUID& uuid, void* data, BOOL online) { - std::string first, last; - gCacheName->getName(uuid, first, last); - LLUIString fullname = sNameFormat; - fullname.setArg("[FIRST]", first); - fullname.setArg("[LAST]", last); + std::string fullname; + gCacheName->getFullName(uuid, fullname); LLSD row; row["id"] = uuid; diff --git a/indra/newview/llfloaterobjectiminfo.cpp b/indra/newview/llfloaterobjectiminfo.cpp index 02a98511c..3ecc140b7 100644 --- a/indra/newview/llfloaterobjectiminfo.cpp +++ b/indra/newview/llfloaterobjectiminfo.cpp @@ -68,7 +68,7 @@ public: static void onClickOwner(void* data); static void onClickMute(void* data); - static void nameCallback(const LLUUID& id, const std::string& first, const std::string& last, BOOL is_group, void* data); + void nameCallback(const LLUUID& id, const std::string& full_name, bool is_group); private: LLUUID mObjectID; @@ -127,7 +127,7 @@ void LLFloaterObjectIMInfo::update(const LLUUID& object_id, const std::string& n mOwnerID = owner_id; mOwnerIsGroup = owner_is_group; - if (gCacheName) gCacheName->get(owner_id,owner_is_group,nameCallback,this); + if (gCacheName) gCacheName->get(owner_id,owner_is_group,boost::bind(&LLFloaterObjectIMInfo::nameCallback,this,_1,_2,_3)); } //static @@ -178,23 +178,17 @@ void LLFloaterObjectIMInfo::onClickMute(void* data) } //static -void LLFloaterObjectIMInfo::nameCallback(const LLUUID& id, const std::string& first, const std::string& last, BOOL is_group, void* data) +void LLFloaterObjectIMInfo::nameCallback(const LLUUID& id, const std::string& full_name, bool is_group) { - LLFloaterObjectIMInfo* self = (LLFloaterObjectIMInfo*)data; - self->mOwnerName = first; - if (!last.empty()) - { - self->mOwnerName += " " + last; - } - + mOwnerName = full_name; // [RLVa:KB] - Version: 1.23.4 | Checked: 2009-07-08 (RLVa-1.0.0e) | Added: RLVa-0.2.0g if ( (!is_group) && (gRlvHandler.hasBehaviour(RLV_BHVR_SHOWNAMES)) && (RlvUtil::isNearbyAgent(id)) ) { - self->mOwnerName = RlvStrings::getAnonym(self->mOwnerName); + mOwnerName = RlvStrings::getAnonym(mOwnerName); } // [/RLVa:KB] - self->childSetText("OwnerName",self->mOwnerName); + childSetText("OwnerName", mOwnerName); } //////////////////////////////////////////////////////////////////////////// diff --git a/indra/newview/llfloaterregioninfo.cpp b/indra/newview/llfloaterregioninfo.cpp index d91f4067b..deae4fa92 100644 --- a/indra/newview/llfloaterregioninfo.cpp +++ b/indra/newview/llfloaterregioninfo.cpp @@ -2566,10 +2566,8 @@ void LLPanelEstateInfo::setAccessAllowedEnabled(bool enable_agent, // static void LLPanelEstateInfo::callbackCacheName( const LLUUID& id, - const std::string& first, - const std::string& last, - BOOL is_group, - void*) + const std::string& full_name, + bool is_group) { LLPanelEstateInfo* self = LLFloaterRegionInfo::getPanelEstate(); if (!self) return; @@ -2582,7 +2580,7 @@ void LLPanelEstateInfo::callbackCacheName( } else { - name = first + " " + last; + name = full_name; } self->setOwnerName(name); @@ -3081,8 +3079,7 @@ bool LLDispatchEstateUpdateInfo::operator()( LLUUID owner_id(strings[1]); regionp->setOwner(owner_id); // Update estate owner name in UI - const BOOL is_group = FALSE; - gCacheName->get(owner_id, is_group, LLPanelEstateInfo::callbackCacheName); + gCacheName->get(owner_id, false, boost::bind(&LLPanelEstateInfo::callbackCacheName,_1,_2,_3)); U32 estate_id = strtoul(strings[2].c_str(), NULL, 10); panel->setEstateID(estate_id); diff --git a/indra/newview/llfloaterregioninfo.h b/indra/newview/llfloaterregioninfo.h index 5871e3525..6289e9396 100644 --- a/indra/newview/llfloaterregioninfo.h +++ b/indra/newview/llfloaterregioninfo.h @@ -343,10 +343,8 @@ public: // llmessage/llcachename.h:LLCacheNameCallback static void callbackCacheName( const LLUUID& id, - const std::string& first, - const std::string& last, - BOOL is_group, - void*); + const std::string& full_name, + bool is_group); protected: virtual BOOL sendUpdate(); diff --git a/indra/newview/llgivemoney.cpp b/indra/newview/llgivemoney.cpp index efdaf8c79..a335129c3 100644 --- a/indra/newview/llgivemoney.cpp +++ b/indra/newview/llgivemoney.cpp @@ -188,9 +188,6 @@ LLFloaterPay::LLFloaterPay(const std::string& name, LLFloaterPay::~LLFloaterPay() { std::for_each(mCallbackData.begin(), mCallbackData.end(), DeletePointer()); - - // Clean up if we are still waiting for a name. - gCacheName->cancelCallback(mTargetUUID,onCacheOwnerName,this); } // static @@ -391,7 +388,7 @@ void LLFloaterPay::payDirectly(money_callback callback, void LLFloaterPay::finishPayUI(const LLUUID& target_id, BOOL is_group) { - gCacheName->get(target_id, is_group, onCacheOwnerName, (void*)this); + mNameConnection = gCacheName->get(target_id, is_group, boost::bind(&LLFloaterPay::onCacheOwnerName, this, _1, _2, _3)); // Make sure the amount field has focus @@ -402,29 +399,22 @@ void LLFloaterPay::finishPayUI(const LLUUID& target_id, BOOL is_group) mTargetIsGroup = is_group; } -// static void LLFloaterPay::onCacheOwnerName(const LLUUID& owner_id, - const std::string& firstname, - const std::string& lastname, - BOOL is_group, - void* userdata) + const std::string& full_name, + bool is_group) { - LLFloaterPay* self = (LLFloaterPay*)userdata; - if (!self) return; - if (is_group) { - self->childSetVisible("payee_group",true); - self->childSetVisible("payee_resident",false); + childSetVisible("payee_group",true); + childSetVisible("payee_resident",false); } else { - self->childSetVisible("payee_group",false); - self->childSetVisible("payee_resident",true); + childSetVisible("payee_group",false); + childSetVisible("payee_resident",true); } - self->childSetTextArg("payee_name", "[FIRST]", firstname); - self->childSetTextArg("payee_name", "[LAST]", lastname); + childSetTextArg("payee_name", "[NAME]", full_name); } // static diff --git a/indra/newview/llgivemoney.h b/indra/newview/llgivemoney.h index f327455d6..b598b3cd7 100644 --- a/indra/newview/llgivemoney.h +++ b/indra/newview/llgivemoney.h @@ -77,11 +77,7 @@ private: static void onGive(void* data); void give(S32 amount); static void processPayPriceReply(LLMessageSystem* msg, void **userdata); - static void onCacheOwnerName(const LLUUID& owner_id, - const std::string& firstname, - const std::string& lastname, - BOOL is_group, - void* userdata); + void onCacheOwnerName( const LLUUID& owner_id, const std::string& full_name, bool is_group); void finishPayUI(const LLUUID& target_id, BOOL is_group); protected: @@ -98,6 +94,8 @@ protected: LLSafeHandle mObjectSelection; + boost::signals2::scoped_connection mNameConnection; //will disconnect on destruction + static S32 sLastAmount; }; diff --git a/indra/newview/llimview.cpp b/indra/newview/llimview.cpp index ff542ee0e..8e484a5b1 100644 --- a/indra/newview/llimview.cpp +++ b/indra/newview/llimview.cpp @@ -980,7 +980,7 @@ void LLIMMgr::inviteToSession( { if (caller_name.empty()) { - gCacheName->getName(caller_id, onInviteNameLookup, new LLSD(payload)); + gCacheName->get(caller_id, true, boost::bind(&LLIMMgr::onInviteNameLookup,_1,_2,_3,payload)); } else { @@ -999,16 +999,13 @@ void LLIMMgr::inviteToSession( } //static -void LLIMMgr::onInviteNameLookup(const LLUUID& id, const std::string& first, const std::string& last, BOOL is_group, void* userdata) +void LLIMMgr::onInviteNameLookup(const LLUUID& id, const std::string& full_name, bool is_group, LLSD payload) { - LLSD payload = *(LLSD*)userdata; - delete (LLSD*)userdata; - - payload["caller_name"] = first + " " + last; - payload["session_name"] = payload["caller_name"].asString(); + payload["caller_name"] = full_name; + payload["session_name"] = full_name; LLSD args; - args["NAME"] = payload["caller_name"].asString(); + args["NAME"] = full_name; LLNotifications::instance().add( payload["notify_box_type"].asString(), @@ -1246,13 +1243,12 @@ void LLIMMgr::noteOfflineUsers( for(S32 i = 0; i < count; ++i) { info = at.getBuddyInfo(ids.get(i)); - std::string first, last; + std::string full_name; if(info && !info->isOnline() - && gCacheName->getName(ids.get(i), first, last)) + && gCacheName->getFullName(ids.get(i), full_name)) { LLUIString offline = sOfflineMessage; - offline.setArg("[FIRST]", first); - offline.setArg("[LAST]", last); + offline.setArg("[NAME]", full_name); floater->addHistoryLine(offline, gSavedSettings.getColor4("SystemChatColor")); } } diff --git a/indra/newview/llimview.h b/indra/newview/llimview.h index e1052c273..e8cd3404b 100644 --- a/indra/newview/llimview.h +++ b/indra/newview/llimview.h @@ -205,7 +205,7 @@ private: void processIMTypingCore(const LLIMInfo* im_info, BOOL typing); - static void onInviteNameLookup(const LLUUID& id, const std::string& first, const std::string& last, BOOL is_group, void* userdata); + static void onInviteNameLookup(const LLUUID& id, const std::string& full_name, bool is_group, LLSD payload); private: std::set > mFloaters; diff --git a/indra/newview/llmutelist.cpp b/indra/newview/llmutelist.cpp index dca58d5f4..a140c7421 100644 --- a/indra/newview/llmutelist.cpp +++ b/indra/newview/llmutelist.cpp @@ -132,9 +132,8 @@ LLMute::LLMute(const LLUUID& id, const std::string& name, EType type, U32 flags) LLNameValue* lastname = mute_object->getNVPair("LastName"); if (firstname && lastname) { - mName.assign( firstname->getString() ); - mName.append(" "); - mName.append( lastname->getString() ); + mName = LLCacheName::buildFullName( + firstname->getString(), lastname->getString()); } mType = mute_object->isAvatar() ? AGENT : OBJECT; } @@ -501,11 +500,8 @@ void LLMuteList::updateRemove(const LLMute& mute) gAgent.sendReliableMessage(); } -void notify_automute_callback(const LLUUID& agent_id, const std::string& first_name, const std::string& last_name, BOOL is_group, void* user_data) +void notify_automute_callback(const LLUUID& agent_id, const std::string& full_name, bool is_group, LLMuteList::EAutoReason reason) { - U32 temp_data = (U32) (uintptr_t) user_data; - LLMuteList::EAutoReason reason = (LLMuteList::EAutoReason)temp_data; - std::string notif_name; switch (reason) { @@ -522,8 +518,7 @@ void notify_automute_callback(const LLUUID& agent_id, const std::string& first_n } LLSD args; - args["FIRST"] = first_name; - args["LAST"] = last_name; + args["NAME"] = full_name; LLNotificationPtr notif_ptr = LLNotifications::instance().add(notif_name, args); if (notif_ptr) @@ -545,7 +540,7 @@ void notify_automute_callback(const LLUUID& agent_id, const std::string& first_n } -BOOL LLMuteList::autoRemove(const LLUUID& agent_id, const EAutoReason reason, const std::string& first_name, const std::string& last_name) +BOOL LLMuteList::autoRemove(const LLUUID& agent_id, const EAutoReason reason) { BOOL removed = FALSE; @@ -555,24 +550,17 @@ BOOL LLMuteList::autoRemove(const LLUUID& agent_id, const EAutoReason reason, co removed = TRUE; remove(automute); - if (first_name.empty() && last_name.empty()) - { - std::string cache_first, cache_last; - if (gCacheName->getName(agent_id, cache_first, cache_last)) + std::string full_name; + if (gCacheName->getFullName(agent_id, full_name)) { // name in cache, call callback directly - notify_automute_callback(agent_id, cache_first, cache_last, FALSE, (void *)reason); + notify_automute_callback(agent_id, full_name, false, reason); } else { // not in cache, lookup name from cache - gCacheName->get(agent_id, FALSE, notify_automute_callback, (void *)reason); - } - } - else - { - // call callback directly - notify_automute_callback(agent_id, first_name, last_name, FALSE, (void *)reason); + gCacheName->get(agent_id, false, + boost::bind(¬ify_automute_callback, _1, _2, _3, reason)); } } diff --git a/indra/newview/llmutelist.h b/indra/newview/llmutelist.h index dec8d7576..11a20e015 100644 --- a/indra/newview/llmutelist.h +++ b/indra/newview/llmutelist.h @@ -107,7 +107,7 @@ public: // Remove both normal and legacy mutes, for any or all properties. BOOL remove(const LLMute& mute, U32 flags = 0); - BOOL autoRemove(const LLUUID& agent_id, const EAutoReason reason, const std::string& first_name = LLStringUtil::null, const std::string& last_name = LLStringUtil::null); + BOOL autoRemove(const LLUUID& agent_id, const EAutoReason reason); // Name is required to test against legacy text-only mutes. BOOL isMuted(const LLUUID& id, const std::string& name = LLStringUtil::null, U32 flags = 0) const; @@ -153,7 +153,13 @@ private: { bool operator()(const LLMute& a, const LLMute& b) const { - return a.mName < b.mName; + std::string name1 = a.mName; + std::string name2 = b.mName; + + LLStringUtil::toUpper(name1); + LLStringUtil::toUpper(name2); + + return name1 < name2; } }; struct compare_by_id diff --git a/indra/newview/llnamebox.cpp b/indra/newview/llnamebox.cpp index 98c7a4b63..449bf9329 100644 --- a/indra/newview/llnamebox.cpp +++ b/indra/newview/llnamebox.cpp @@ -85,26 +85,16 @@ void LLNameBox::setNameID(const LLUUID& name_id, BOOL is_group) setText(name); } -void LLNameBox::refresh(const LLUUID& id, const std::string& firstname, - const std::string& lastname, BOOL is_group) +void LLNameBox::refresh(const LLUUID& id, const std::string& full_name, bool is_group) + { if (id == mNameID) { - std::string name; - if (!is_group) - { - name = firstname + " " + lastname; - } - else - { - name = firstname; - } - setText(name); + setText(full_name); } } -void LLNameBox::refreshAll(const LLUUID& id, const std::string& firstname, - const std::string& lastname, BOOL is_group) +void LLNameBox::refreshAll(const LLUUID& id, const std::string& full_name, bool is_group) { std::set::iterator it; for (it = LLNameBox::sInstances.begin(); @@ -112,6 +102,6 @@ void LLNameBox::refreshAll(const LLUUID& id, const std::string& firstname, ++it) { LLNameBox* box = *it; - box->refresh(id, firstname, lastname, is_group); + box->refresh(id, full_name, is_group); } } diff --git a/indra/newview/llnamebox.h b/indra/newview/llnamebox.h index f76850bd3..cb968e78d 100644 --- a/indra/newview/llnamebox.h +++ b/indra/newview/llnamebox.h @@ -52,10 +52,9 @@ public: void setNameID(const LLUUID& name_id, BOOL is_group); - void refresh(const LLUUID& id, const std::string& first, const std::string& last, BOOL is_group); + void refresh(const LLUUID& id, const std::string& full_name, bool is_group); - static void refreshAll(const LLUUID& id, const std::string& firstname, - const std::string& lastname, BOOL is_group); + static void refreshAll(const LLUUID& id, const std::string& full_name, bool is_group); private: static std::set sInstances; diff --git a/indra/newview/llnameeditor.cpp b/indra/newview/llnameeditor.cpp index 59973692d..ef93e2602 100644 --- a/indra/newview/llnameeditor.cpp +++ b/indra/newview/llnameeditor.cpp @@ -100,26 +100,15 @@ void LLNameEditor::setNameID(const LLUUID& name_id, BOOL is_group) setText(name); } -void LLNameEditor::refresh(const LLUUID& id, const std::string& firstname, - const std::string& lastname, BOOL is_group) +void LLNameEditor::refresh(const LLUUID& id, const std::string& full_name, bool is_group) { if (id == mNameID) { - std::string name; - if (!is_group) - { - name = firstname + " " + lastname; - } - else - { - name = firstname; - } - setText(name); + setText(full_name); } } -void LLNameEditor::refreshAll(const LLUUID& id, const std::string& firstname, - const std::string& lastname, BOOL is_group) +void LLNameEditor::refreshAll(const LLUUID& id, const std::string& full_name, bool is_group) { std::set::iterator it; for (it = LLNameEditor::sInstances.begin(); @@ -127,7 +116,7 @@ void LLNameEditor::refreshAll(const LLUUID& id, const std::string& firstname, ++it) { LLNameEditor* box = *it; - box->refresh(id, firstname, lastname, is_group); + box->refresh(id, full_name, is_group); } } diff --git a/indra/newview/llnameeditor.h b/indra/newview/llnameeditor.h index 964682cee..ca36cf7a0 100644 --- a/indra/newview/llnameeditor.h +++ b/indra/newview/llnameeditor.h @@ -67,10 +67,9 @@ public: void setNameID(const LLUUID& name_id, BOOL is_group); - void refresh(const LLUUID& id, const std::string& first, const std::string& last, BOOL is_group); + void refresh(const LLUUID& id, const std::string& full_name, bool is_group); - static void refreshAll(const LLUUID& id, const std::string& firstname, - const std::string& lastname, BOOL is_group); + static void refreshAll(const LLUUID& id, const std::string& full_name, bool is_group); // Take/return agent UUIDs diff --git a/indra/newview/llnamelistctrl.cpp b/indra/newview/llnamelistctrl.cpp index 364fb1c44..60eafcd4a 100644 --- a/indra/newview/llnamelistctrl.cpp +++ b/indra/newview/llnamelistctrl.cpp @@ -235,33 +235,24 @@ void LLNameListCtrl::removeNameItem(const LLUUID& agent_id) } // public -void LLNameListCtrl::refresh(const LLUUID& id, const std::string& first, - const std::string& last, BOOL is_group) +void LLNameListCtrl::refresh(const LLUUID& agent_id, const std::string& full_name) { //llinfos << "LLNameListCtrl::refresh " << id << " '" << first << " " // << last << "'" << llendl; - std::string fullname; - if (!is_group) - { - fullname = first + " " + last; - } - else - { - fullname = first; - } // TODO: scan items for that ID, fix if necessary item_list::iterator iter; for (iter = getItemList().begin(); iter != getItemList().end(); iter++) { LLScrollListItem* item = *iter; - if (item->getUUID() == id) + if (item->getUUID() == agent_id) { - LLScrollListCell* cell = (LLScrollListCell*)item->getColumn(0); - cell = (LLScrollListCell*)item->getColumn(mNameColumnIndex); - - ((LLScrollListText*)cell)->setText( fullname ); + LLScrollListCell* cell = (LLScrollListCell*)item->getColumn(mNameColumnIndex); + if (cell) + { + ((LLScrollListText*)cell)->setText( full_name ); + } } } @@ -270,8 +261,7 @@ void LLNameListCtrl::refresh(const LLUUID& id, const std::string& first, // static -void LLNameListCtrl::refreshAll(const LLUUID& id, const std::string& first, - const std::string& last, BOOL is_group) +void LLNameListCtrl::refreshAll(const LLUUID& id, const std::string& full_name) { std::set::iterator it; for (it = LLNameListCtrl::sInstances.begin(); @@ -279,7 +269,7 @@ void LLNameListCtrl::refreshAll(const LLUUID& id, const std::string& first, ++it) { LLNameListCtrl* ctrl = *it; - ctrl->refresh(id, first, last, is_group); + ctrl->refresh(id, full_name); } } diff --git a/indra/newview/llnamelistctrl.h b/indra/newview/llnamelistctrl.h index 4485faedf..0ff74423d 100644 --- a/indra/newview/llnamelistctrl.h +++ b/indra/newview/llnamelistctrl.h @@ -72,10 +72,9 @@ public: void removeNameItem(const LLUUID& agent_id); - void refresh(const LLUUID& id, const std::string& first, const std::string& last, BOOL is_group); + void refresh(const LLUUID& agent_id, const std::string& full_name); - static void refreshAll(const LLUUID& id, const std::string& firstname, - const std::string& lastname, BOOL is_group); + static void refreshAll(const LLUUID& id, const std::string& full_name); virtual BOOL handleDragAndDrop(S32 x, S32 y, MASK mask, BOOL drop, EDragAndDropType cargo_type, void *cargo_data, diff --git a/indra/newview/llpanelgroupinvite.cpp b/indra/newview/llpanelgroupinvite.cpp index 04c3849c3..f95a27aad 100644 --- a/indra/newview/llpanelgroupinvite.cpp +++ b/indra/newview/llpanelgroupinvite.cpp @@ -396,13 +396,10 @@ void LLPanelGroupInvite::addUsers(std::vector& agent_ids) if(avatarp) { std::string fullname; - LLSD args; LLNameValue* nvfirst = avatarp->getNVPair("FirstName"); LLNameValue* nvlast = avatarp->getNVPair("LastName"); if(nvfirst && nvlast) { - args["FIRST"] = std::string(nvfirst->getString()); - args["LAST"] = std::string(nvlast->getString()); fullname = std::string(nvfirst->getString()) + " " + std::string(nvlast->getString()); } if (!fullname.empty()) diff --git a/indra/newview/llpanelpermissions.cpp b/indra/newview/llpanelpermissions.cpp index 50a48db57..d1819733f 100644 --- a/indra/newview/llpanelpermissions.cpp +++ b/indra/newview/llpanelpermissions.cpp @@ -387,7 +387,7 @@ void LLPanelPermissions::refresh() if(mLabelGroupName) { mLabelGroupName->setNameID(LLUUID::null, TRUE); - mLabelGroupName->refresh(LLUUID::null, LLStringUtil::null, LLStringUtil::null, TRUE); + mLabelGroupName->refresh(LLUUID::null, LLStringUtil::null, true); mLabelGroupName->setEnabled(FALSE); } } diff --git a/indra/newview/llstartup.cpp b/indra/newview/llstartup.cpp index 561a8edeb..b854358c9 100644 --- a/indra/newview/llstartup.cpp +++ b/indra/newview/llstartup.cpp @@ -279,11 +279,11 @@ void release_start_screen(); void reset_login(); void apply_udp_blacklist(const std::string& csv); -void callback_cache_name(const LLUUID& id, const std::string& firstname, const std::string& lastname, BOOL is_group, void* data) +void callback_cache_name(const LLUUID& id, const std::string& full_name, bool is_group) { - LLNameListCtrl::refreshAll(id, firstname, lastname, is_group); - LLNameBox::refreshAll(id, firstname, lastname, is_group); - LLNameEditor::refreshAll(id, firstname, lastname, is_group); + LLNameListCtrl::refreshAll(id, full_name); + LLNameBox::refreshAll(id, full_name, is_group); + LLNameEditor::refreshAll(id, full_name, is_group); // TODO: Actually be intelligent about the refresh. // For now, just brute force refresh the dialogs. @@ -2076,21 +2076,7 @@ bool idle_startup() gXferManager->registerCallbacks(gMessageSystem); - if ( gCacheName == NULL ) - { - gCacheName = new LLCacheName(gMessageSystem); - gCacheName->addObserver(callback_cache_name); - - // Load stored cache if possible - LLAppViewer::instance()->loadNameCache(); - } - - // Start cache in not-running state until we figure out if we have - // capabilities for display name lookup - LLAvatarNameCache::initClass(false); - S32 phoenix_name_system = gSavedSettings.getS32("PhoenixNameSystem"); - if(phoenix_name_system <= 0 || phoenix_name_system > 2) LLAvatarNameCache::setUseDisplayNames(false); - else LLAvatarNameCache::setUseDisplayNames(true); + LLStartUp::initNameCache(); // *Note: this is where gWorldMap used to be initialized. @@ -3838,6 +3824,35 @@ void LLStartUp::multimediaInit() LLViewerParcelMedia::initClass(); } + +void LLStartUp::initNameCache() +{ + // Can be called multiple times + if ( gCacheName ) return; + + gCacheName = new LLCacheName(gMessageSystem); + gCacheName->addObserver(&callback_cache_name); + gCacheName->localizeCacheName("waiting", LLTrans::getString("AvatarNameWaiting")); + gCacheName->localizeCacheName("nobody", LLTrans::getString("AvatarNameNobody")); + gCacheName->localizeCacheName("none", LLTrans::getString("GroupNameNone")); + // Load stored cache if possible + LLAppViewer::instance()->loadNameCache(); + + // Start cache in not-running state until we figure out if we have + // capabilities for display name lookup + LLAvatarNameCache::initClass(false); + S32 phoenix_name_system = gSavedSettings.getS32("PhoenixNameSystem"); + if(phoenix_name_system <= 0 || phoenix_name_system > 2) LLAvatarNameCache::setUseDisplayNames(false); + else LLAvatarNameCache::setUseDisplayNames(true); +} + +void LLStartUp::cleanupNameCache() +{ + LLAvatarNameCache::cleanupClass(); + + delete gCacheName; + gCacheName = NULL; +} bool LLStartUp::dispatchURL() { // ok, if we've gotten this far and have a startup URL diff --git a/indra/newview/llstartup.h b/indra/newview/llstartup.h index de0646caa..40e79b0bb 100644 --- a/indra/newview/llstartup.h +++ b/indra/newview/llstartup.h @@ -95,6 +95,12 @@ public: static void multimediaInit(); // Initialize LLViewerMedia multimedia engine. + + static void initNameCache(); + + + static void cleanupNameCache(); + // outfit_folder_name can be a folder anywhere in your inventory, // but the name must be a case-sensitive exact match. // gender_name is either "male" or "female" diff --git a/indra/newview/llviewermenu.cpp b/indra/newview/llviewermenu.cpp index 4ad6b2f2b..09e1abff2 100644 --- a/indra/newview/llviewermenu.cpp +++ b/indra/newview/llviewermenu.cpp @@ -3273,10 +3273,8 @@ class LLAvatarGiveCard : public view_listener_t LLNameValue* nvlast = dest->getNVPair("LastName"); if(nvfirst && nvlast) { - args["FIRST"] = nvfirst->getString(); - args["LAST"] = nvlast->getString(); - old_args["FIRST"] = nvfirst->getString(); - old_args["LAST"] = nvlast->getString(); + args["NAME"] = std::string(nvfirst->getString()) + " " + nvlast->getString(); + old_args["NAME"] = std::string(nvfirst->getString()) + " " + nvlast->getString(); found_name = true; } LLViewerRegion* region = dest->getRegion(); @@ -3878,16 +3876,11 @@ void request_friendship(const LLUUID& dest_id) if(dest && dest->isAvatar()) { std::string fullname; - LLSD args; LLNameValue* nvfirst = dest->getNVPair("FirstName"); LLNameValue* nvlast = dest->getNVPair("LastName"); if(nvfirst && nvlast) { - args["FIRST"] = nvfirst->getString(); - args["LAST"] = nvlast->getString(); - fullname = nvfirst->getString(); - fullname += " "; - fullname += nvlast->getString(); + fullname = std::string(nvfirst->getString()) + " " + nvlast->getString(); } if (!fullname.empty()) { diff --git a/indra/newview/llviewermessage.cpp b/indra/newview/llviewermessage.cpp index a6cc29c78..f1529ef58 100644 --- a/indra/newview/llviewermessage.cpp +++ b/indra/newview/llviewermessage.cpp @@ -193,9 +193,7 @@ extern BOOL gDebugClicks; void open_offer(const std::vector& items, const std::string& from_name); bool highlight_offered_object(const LLUUID& obj_id); bool check_offer_throttle(const std::string& from_name, bool check_only); -void callbackCacheEstateOwnerName(const LLUUID& id, - const std::string& first, const std::string& last, - BOOL is_group, void*); +void callbackCacheEstateOwnerName(const LLUUID& id, const std::string& full_name, bool is_group); //inventory offer throttle globals LLFrameTimer gThrottleTimer; @@ -1090,23 +1088,18 @@ bool highlight_offered_object(const LLUUID& obj_id) } void inventory_offer_mute_callback(const LLUUID& blocked_id, - const std::string& first_name, - const std::string& last_name, - BOOL is_group, - void* user_data) + const std::string& full_name, + bool is_group ) { - std::string from_name; + std::string from_name = full_name; LLMute::EType type; - if (is_group) { type = LLMute::GROUP; - from_name = first_name; } else { type = LLMute::AGENT; - from_name = first_name + " " + last_name; } LLMute mute(blocked_id, from_name, type); @@ -1182,7 +1175,7 @@ bool LLOfferInfo::inventory_offer_callback(const LLSD& notification, const LLSD& // * we can't build two messages at once. if (2 == button) { - gCacheName->get(mFromID, mFromGroup, inventory_offer_mute_callback, this); + gCacheName->get(mFromID, mFromGroup, boost::bind(&inventory_offer_mute_callback,_1,_2,_3)); } LLMessageSystem* msg = gMessageSystem; @@ -1233,11 +1226,10 @@ bool LLOfferInfo::inventory_offer_callback(const LLSD& notification, const LLSD& } else { - std::string first_name, last_name; - if (gCacheName->getName(mFromID, first_name, last_name)) + std::string full_name; + if (gCacheName->getFullName(mFromID, full_name)) { // [RLVa:KB] - Version: 1.23.4 | Checked: 2009-07-08 (RLVa-1.0.0e) - std::string full_name = first_name + " " + last_name; if ( (gRlvHandler.hasBehaviour(RLV_BHVR_SHOWNAMES)) && (RlvUtil::isNearbyAgent(mFromID)) ) { full_name = RlvStrings::getAnonym(full_name); @@ -1521,37 +1513,35 @@ void inventory_offer_handler(LLOfferInfo* info, BOOL from_task) // Name cache callbacks don't store userdata, so can't save // off the LLOfferInfo. Argh. BOOL name_found = FALSE; + payload["from_id"] = info->mFromID; + args["OBJECTFROMNAME"] = info->mFromName; + args["NAME"] = info->mFromName; + if (info->mFromGroup) { std::string group_name; if (gCacheName->getGroupName(info->mFromID, group_name)) { - args["FIRST"] = group_name; - args["LAST"] = ""; + args["NAME"] = group_name; name_found = TRUE; } } else { - std::string first_name, last_name; - if (gCacheName->getName(info->mFromID, first_name, last_name)) + std::string full_name; + if (gCacheName->getFullName(info->mFromID, full_name)) { // [RLVa:KB] - Version: 1.23.4 | Checked: 2009-07-08 (RLVa-1.0.0e) if ( (gRlvHandler.hasBehaviour(RLV_BHVR_SHOWNAMES)) && (RlvUtil::isNearbyAgent(info->mFromID)) ) { - first_name = RlvStrings::getAnonym(first_name.append(" ").append(last_name)); - last_name.clear(); + full_name = RlvStrings::getAnonym(full_name); } // [/RLVa:KB] - args["FIRST"] = first_name; - args["LAST"] = last_name; + args["NAME"] = full_name; name_found = TRUE; } } - payload["from_id"] = info->mFromID; - args["OBJECTFROMNAME"] = info->mFromName; - args["NAME"] = info->mFromName; LLNotification::Params p("ObjectGiveItem"); p.substitutions(args).payload(payload).functor(boost::bind(&LLOfferInfo::inventory_offer_callback, info, _1, _2)); @@ -1705,7 +1695,7 @@ void process_improved_im(LLMessageSystem *msg, void **user_data) if(chat.mSourceType == CHAT_SOURCE_AGENT) { LLSD args; - args["FULL_NAME"] = name; + args["NAME"] = name; static SH_SpamHandler avatar_spam_check("SGBlockGeneralSpam","SGSpamTime","SGSpamCount"); static SH_SpamHandler object_spam_check("SGBlockGeneralSpam","SGSpamTime","SGSpamCount"); if(d==IM_FROM_TASK||d==IM_GOTO_URL||d==IM_FROM_TASK_AS_ALERT||d==IM_TASK_INVENTORY_OFFERED||d==IM_TASK_INVENTORY_ACCEPTED||d==IM_TASK_INVENTORY_DECLINED) @@ -2881,9 +2871,8 @@ void process_offer_callingcard(LLMessageSystem* msg, void**) LLNameValue* nvlast = source->getNVPair("LastName"); if (nvfirst && nvlast) { - args["FIRST"] = nvfirst->getString(); - args["LAST"] = nvlast->getString(); source_name = std::string(nvfirst->getString()) + " " + nvlast->getString(); + args["NAME"] = source_name; } } @@ -3078,7 +3067,7 @@ void process_chat_from_simulator(LLMessageSystem *msg, void **user_data) if (chatter) { LLSD args; - args["FULL_NAME"] = from_name; + args["NAME"] = from_name; static SH_SpamHandler avatar_spam_check("SGBlockChatSpam","SGChatSpamTime","SGChatSpamCount"); static SH_SpamHandler object_spam_check("SGBlockChatSpam","SGChatSpamTime","SGChatSpamCount"); if( (chatter->isAvatar() && avatar_spam_check.isBlocked(from_id,from_id,"BlockedChatterAvatar",args)) || @@ -5504,7 +5493,7 @@ void handle_show_mean_events(void *) LLFloaterBump::show(NULL); } -void mean_name_callback(const LLUUID &id, const std::string& first, const std::string& last, BOOL always_false, void* data) +void mean_name_callback(const LLUUID &id, const std::string& full_name, bool is_group) { if (gNoRender) { @@ -5526,8 +5515,7 @@ void mean_name_callback(const LLUUID &id, const std::string& first, const std::s LLMeanCollisionData *mcd = *iter; if (mcd->mPerp == id) { - mcd->mFirstName = first; - mcd->mLastName = last; + mcd->mFullName = full_name; } } } @@ -5581,8 +5569,7 @@ void process_mean_collision_alert_message(LLMessageSystem *msgsystem, void **use { LLMeanCollisionData *mcd = new LLMeanCollisionData(gAgentID, perp, time, type, mag); gMeanCollisionList.push_front(mcd); - const BOOL is_group = FALSE; - gCacheName->get(perp, is_group, mean_name_callback); + gCacheName->get(perp, false, boost::bind(&mean_name_callback, _1, _2, _3)); } } } @@ -6277,8 +6264,10 @@ bool handle_lure_callback(const LLSD& notification, const LLSD& response) it != notification["payload"]["ids"].endArray(); ++it) { + LLUUID target_id = it->asUUID(); + msg->nextBlockFast(_PREHASH_TargetData); - msg->addUUIDFast(_PREHASH_TargetID, it->asUUID()); + msg->addUUIDFast(_PREHASH_TargetID, target_id); } gAgent.sendReliableMessage(); } @@ -6529,8 +6518,7 @@ void process_script_dialog(LLMessageSystem* msg, void**) LLNotificationPtr notification; if (!first_name.empty()) { - args["FIRST"] = first_name; - args["LAST"] = last_name; + args["NAME"] = LLCacheName::buildFullName(first_name, last_name); static SH_SpamHandler spam_check("SGBlockDialogSpam","SGSpamTime","SGSpamCount"); if(spam_check.isBlocked(first_name + " " + last_name,object_id,"BlockedDialogs",args)) @@ -6577,7 +6565,7 @@ static LLNotificationFunctorRegistration callback_load_url_reg("LoadWebPage", ca // We've got the name of the person who owns the object hurling the url. // Display confirmation dialog. -void callback_load_url_name(const LLUUID& id, const std::string& first, const std::string& last, BOOL is_group, void* data) +void callback_load_url_name(const LLUUID& id, const std::string& full_name, bool is_group) { std::vector::iterator it; for (it = gLoadUrlList.begin(); it != gLoadUrlList.end(); ) @@ -6590,11 +6578,11 @@ void callback_load_url_name(const LLUUID& id, const std::string& first, const st std::string owner_name; if (is_group) { - owner_name = first + " (group)"; + owner_name = full_name + " (group)"; } else { - owner_name = first + " " + last; + owner_name = full_name; } // For legacy name-only mutes. @@ -6654,7 +6642,8 @@ void process_load_url(LLMessageSystem* msg, void**) // Add to list of pending name lookups gLoadUrlList.push_back(payload); - gCacheName->get(owner_id, owner_is_group, callback_load_url_name); + gCacheName->get(owner_id, owner_is_group, + boost::bind(&callback_load_url_name, _1, _2, _3)); } @@ -6750,7 +6739,8 @@ void process_covenant_reply(LLMessageSystem* msg, void**) LLPanelLandCovenant::updateLastModified(last_modified); LLFloaterBuyLand::updateLastModified(last_modified); - gCacheName->getName(estate_owner_id, callbackCacheEstateOwnerName); + gCacheName->get(estate_owner_id, false, + boost::bind(&callbackCacheEstateOwnerName, _1, _2, _3)); // load the actual covenant asset data const BOOL high_priority = TRUE; @@ -6785,8 +6775,8 @@ void process_covenant_reply(LLMessageSystem* msg, void**) } void callbackCacheEstateOwnerName(const LLUUID& id, - const std::string& first, const std::string& last, - BOOL is_group, void*) + const std::string& full_name, + bool is_group) { std::string name; @@ -6796,7 +6786,7 @@ void callbackCacheEstateOwnerName(const LLUUID& id, } else { - name = first + " " + last; + name = full_name; } LLPanelEstateCovenant::updateEstateOwnerName(name); LLPanelLandCovenant::updateEstateOwnerName(name); diff --git a/indra/newview/llviewerparcelmgr.cpp b/indra/newview/llviewerparcelmgr.cpp index 25edaa82a..b84e00b10 100644 --- a/indra/newview/llviewerparcelmgr.cpp +++ b/indra/newview/llviewerparcelmgr.cpp @@ -1290,6 +1290,22 @@ void LLViewerParcelMgr::sendParcelPropertiesUpdate(LLParcel* parcel, bool use_ag void LLViewerParcelMgr::requestHoverParcelProperties(const LLVector3d& pos) { + static U32 last_west, last_south; + // only request parcel info if position has changed outside of the + // last parcel grid step + U32 west_parcel_step = (U32) floor( pos.mdV[VX] / PARCEL_GRID_STEP_METERS ); + U32 south_parcel_step = (U32) floor( pos.mdV[VY] / PARCEL_GRID_STEP_METERS ); + + if ((west_parcel_step == last_west) && (south_parcel_step == last_south)) + { + return; + } + else + { + last_west = west_parcel_step; + last_south = south_parcel_step; + } + LLViewerRegion* region = LLWorld::getInstance()->getRegionFromPosGlobal( pos ); if (!region) { @@ -2002,10 +2018,9 @@ void LLViewerParcelMgr::deedLandToGroup() args["GROUP_NAME"] = group_name; if(mCurrentParcel->getContributeWithDeed()) { - std::string first_name, last_name; - gCacheName->getName(mCurrentParcel->getOwnerID(), first_name, last_name); - args["FIRST_NAME"] = first_name; - args["LAST_NAME"] = last_name; + std::string full_name; + gCacheName->getFullName(mCurrentParcel->getOwnerID(),full_name); + args["NAME"] = full_name; LLNotifications::instance().add("DeedLandToGroupWithContribution",args, LLSD(), deedAlertCB); } else diff --git a/indra/newview/llvoavatar.cpp b/indra/newview/llvoavatar.cpp index 0623d51e9..5fe13daf3 100644 --- a/indra/newview/llvoavatar.cpp +++ b/indra/newview/llvoavatar.cpp @@ -3782,7 +3782,7 @@ void LLVOAvatar::idleUpdateNameTag(const LLVector3& root_pos_last) if(LLAvatarNameCache::useDisplayNames() && LLAvatarNameCache::get(getID(), &av_name)) dnhasloaded=true; std::string usedname; - if(dnhasloaded && !av_name.mIsDisplayNameDefault && !av_name.mIsDummy + if(dnhasloaded && !av_name.mIsDisplayNameDefault && !av_name.mIsTemporaryName && av_name.mDisplayName != av_name.getLegacyName()) { usedname = av_name.mDisplayName; diff --git a/indra/newview/llvoiceclient.cpp b/indra/newview/llvoiceclient.cpp index 79e8fc535..7c3022f06 100644 --- a/indra/newview/llvoiceclient.cpp +++ b/indra/newview/llvoiceclient.cpp @@ -6902,16 +6902,15 @@ void LLVoiceClient::notifyFriendObservers() void LLVoiceClient::lookupName(const LLUUID &id) { - gCacheName->getName(id, onAvatarNameLookup); + gCacheName->get(id, false, boost::bind(&LLVoiceClient::onAvatarNameLookup,_1,_2)); } //static -void LLVoiceClient::onAvatarNameLookup(const LLUUID& id, const std::string& first, const std::string& last, BOOL is_group, void* user_data) +void LLVoiceClient::onAvatarNameLookup(const LLUUID& id, const std::string& full_name) { if(gVoiceClient) { - std::string name = llformat("%s %s", first.c_str(), last.c_str()); - gVoiceClient->avatarNameResolved(id, name); + gVoiceClient->avatarNameResolved(id, full_name); } } diff --git a/indra/newview/llvoiceclient.h b/indra/newview/llvoiceclient.h index cfc336b27..e5c4af6a3 100644 --- a/indra/newview/llvoiceclient.h +++ b/indra/newview/llvoiceclient.h @@ -461,7 +461,7 @@ static void updatePosition(void); void removeObserver(LLFriendObserver* observer); void lookupName(const LLUUID &id); - static void onAvatarNameLookup(const LLUUID& id, const std::string& first, const std::string& last, BOOL is_group, void* user_data); + static void onAvatarNameLookup(const LLUUID& id, const std::string& full_name); void avatarNameResolved(const LLUUID &id, const std::string &name); typedef std::vector deviceList; diff --git a/indra/newview/rlvfloaterbehaviour.cpp b/indra/newview/rlvfloaterbehaviour.cpp index 0f630d01f..808f35408 100644 --- a/indra/newview/rlvfloaterbehaviour.cpp +++ b/indra/newview/rlvfloaterbehaviour.cpp @@ -103,10 +103,9 @@ void RlvFloaterBehaviour::refreshAll() if (strLookup.find("???") == std::string::npos) strBhvr.assign(itCmd->getBehaviour()).append(":").append(strLookup); } - else if (m_PendingLookup.end() == std::find(m_PendingLookup.begin(), m_PendingLookup.end(), idOption)) + else if (m_PendingLookup.end() == m_PendingLookup.find(idOption)) { - gCacheName->get(idOption, FALSE, onAvatarNameLookup, this); - m_PendingLookup.push_back(idOption); + m_PendingLookup[idOption] = gCacheName->get(idOption, false, boost::bind(&RlvFloaterBehaviour::onAvatarNameLookup,this,_1)); } } @@ -139,10 +138,10 @@ void RlvFloaterBehaviour::onClose(bool fQuitting) LLFloater::setVisible(FALSE); gRlvHandler.removeBehaviourObserver(this); - - for (std::list::const_iterator itLookup = m_PendingLookup.begin(); itLookup != m_PendingLookup.end(); ++itLookup) + + for (std::map::const_iterator itLookup = m_PendingLookup.begin(); itLookup != m_PendingLookup.end(); ++itLookup) { - gCacheName->cancelCallback(*itLookup, onAvatarNameLookup, this); + itLookup->second.disconnect(); } m_PendingLookup.clear(); } @@ -164,15 +163,16 @@ void RlvFloaterBehaviour::changed(const RlvCommand& /*rlvCmd*/, bool /*fInternal // ============================================================================ -void RlvFloaterBehaviour::onAvatarNameLookup(const LLUUID& uuid, const std::string& strFirst, const std::string& strLast, BOOL fGroup, void* pParam) +void RlvFloaterBehaviour::onAvatarNameLookup(const LLUUID& uuid) { - RlvFloaterBehaviour* pSelf = (RlvFloaterBehaviour*)pParam; + std::map::const_iterator itLookup = m_PendingLookup.find(uuid); + if (itLookup != m_PendingLookup.end()) + { + itLookup->second.disconnect(); + m_PendingLookup.erase(itLookup); + } - std::list::iterator itLookup = std::find(pSelf->m_PendingLookup.begin(), pSelf->m_PendingLookup.end(), uuid); - if (itLookup != pSelf->m_PendingLookup.end()) - pSelf->m_PendingLookup.erase(itLookup); - - pSelf->refreshAll(); + refreshAll(); } // ============================================================================ diff --git a/indra/newview/rlvfloaterbehaviour.h b/indra/newview/rlvfloaterbehaviour.h index 06d9156cb..25265e59c 100644 --- a/indra/newview/rlvfloaterbehaviour.h +++ b/indra/newview/rlvfloaterbehaviour.h @@ -51,13 +51,14 @@ public: */ public: static void show(void*); - static void onAvatarNameLookup(const LLUUID& uuid, const std::string& strFirst, const std::string& strLast, BOOL fGroup, void* pParam); + void onAvatarNameLookup(const LLUUID& uuid); protected: void refreshAll(); private: RlvFloaterBehaviour(const LLSD& key = LLSD()); - std::list m_PendingLookup; +public: + std::map m_PendingLookup; //Have to hold a signal so we can remove it later. }; // ============================================================================ diff --git a/indra/newview/skins/default/xui/en-us/floater_bumps.xml b/indra/newview/skins/default/xui/en-us/floater_bumps.xml index a704fe0de..d4bdc5806 100644 --- a/indra/newview/skins/default/xui/en-us/floater_bumps.xml +++ b/indra/newview/skins/default/xui/en-us/floater_bumps.xml @@ -11,18 +11,18 @@ None detected - [TIME] [FIRST] [LAST] bumped you - + [TIME] [NAME] bumped you + - [TIME] [FIRST] [LAST] pushed you with a script - + [TIME] [NAME] pushed you with a script + - [TIME] [FIRST] [LAST] hit you with an object - + [TIME] [NAME] hit you with an object + - [TIME] [FIRST] [LAST] hit you with a scripted object - + [TIME] [NAME] hit you with a scripted object + - [TIME] [FIRST] [LAST] hit you with a physical object - + [TIME] [NAME] hit you with a physical object + diff --git a/indra/newview/skins/default/xui/en-us/floater_im.xml b/indra/newview/skins/default/xui/en-us/floater_im.xml index 2ec94b6a1..6b8cc2557 100644 --- a/indra/newview/skins/default/xui/en-us/floater_im.xml +++ b/indra/newview/skins/default/xui/en-us/floater_im.xml @@ -11,8 +11,8 @@ You are the only user in this session. - [FIRST] [LAST] is offline. - + [NAME] is offline. + Click the [BUTTON NAME] button to accept/connect to this voice chat. diff --git a/indra/newview/skins/default/xui/en-us/floater_new_im.xml b/indra/newview/skins/default/xui/en-us/floater_new_im.xml index c93b89036..bde670d7d 100644 --- a/indra/newview/skins/default/xui/en-us/floater_new_im.xml +++ b/indra/newview/skins/default/xui/en-us/floater_new_im.xml @@ -17,9 +17,6 @@ halign="center" height="20" label="Close" label_selected="Close" left="435" mouse_opaque="true" name="close_btn" scale_image="true" sound_flags="0" width="60" /> - - [FIRST] [LAST] - (online) diff --git a/indra/newview/skins/default/xui/en-us/floater_pay.xml b/indra/newview/skins/default/xui/en-us/floater_pay.xml index d9646885b..d733bea20 100644 --- a/indra/newview/skins/default/xui/en-us/floater_pay.xml +++ b/indra/newview/skins/default/xui/en-us/floater_pay.xml @@ -31,7 +31,7 @@ bottom="-25" drop_shadow_visible="true" enabled="true" follows="left|top" font="SansSerif" h_pad="0" halign="left" height="18" left="85" mouse_opaque="true" name="payee_name" v_pad="0" width="210"> - [FIRST] [LAST] + [NAME] - [FIRST] [LAST] + [NAME] By deeding this parcel, the group will be required to have and maintain sufficient land use credits. -The deed will include a simultaneous land contribution to the group from '[FIRST_NAME] [LAST_NAME]'. +The deed will include a simultaneous land contribution to the group from '[NAME]'. The purchase price of the land is not refunded to the owner. If a deeded parcel is sold, the sale price will be divided evenly among group members. Deed this [AREA] m² of land to the group '[GROUP_NAME]'? @@ -5475,7 +5475,7 @@ You cannot remove protected categories. icon="notifytip.tga" name="OfferedCard" type="notifytip"> -You have offered a calling card to [FIRST] [LAST] +You have offered a calling card to [NAME] -The objects on the selected parcel of land that is owned by [FIRST] [LAST] have been returned to his or her inventory. +The objects on the selected parcel of land that is owned by [NAME] have been returned to his or her inventory. -An object named [OBJECTFROMNAME] owned by [FIRST] [LAST] has given you a [OBJECTTYPE] named [OBJECTNAME]. +An object named [OBJECTFROMNAME] owned by [NAME] has given you a [OBJECTTYPE] named [OBJECTNAME].