summaryrefslogtreecommitdiff
path: root/indra/newview/llviewerregion.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'indra/newview/llviewerregion.cpp')
-rw-r--r--indra/newview/llviewerregion.cpp61
1 files changed, 50 insertions, 11 deletions
diff --git a/indra/newview/llviewerregion.cpp b/indra/newview/llviewerregion.cpp
index c6fe78eb74..f292d6b619 100644
--- a/indra/newview/llviewerregion.cpp
+++ b/indra/newview/llviewerregion.cpp
@@ -79,6 +79,8 @@
// format changes. JC
const U32 INDRA_OBJECT_CACHE_VERSION = 14;
+// Format string used to construct filename for the object cache
+static const char OBJECT_CACHE_FILENAME[] = "objects_%d_%d.slc";
extern BOOL gNoRender;
@@ -174,7 +176,7 @@ public:
mRegion->showReleaseNotes();
}
}
-
+
if (STATE_SEED_GRANTED_WAIT == LLStartUp::getStartupState())
{
LLStartUp::setStartupState( STATE_SEED_CAP_GRANTED );
@@ -216,6 +218,7 @@ LLViewerRegion::LLViewerRegion(const U64 &handle,
mColoName("unknown"),
mProductSKU("unknown"),
mProductName("unknown"),
+ mHttpUrl(""),
mCacheLoaded(FALSE),
mCacheEntriesCount(0),
mCacheID(),
@@ -322,13 +325,25 @@ LLViewerRegion::~LLViewerRegion()
delete mEventPoll;
LLHTTPSender::clearSender(mHost);
- saveCache();
+ saveObjectCache();
std::for_each(mObjectPartition.begin(), mObjectPartition.end(), DeletePointer());
}
-void LLViewerRegion::loadCache()
+const std::string LLViewerRegion::getObjectCacheFilename(U64 mHandle) const
+{
+ std::string filename;
+ U32 region_x, region_y;
+
+ grid_from_region_handle(mHandle, &region_x, &region_y);
+ filename = gDirUtilp->getExpandedFilename(LL_PATH_CACHE,
+ llformat(OBJECT_CACHE_FILENAME, region_x, region_y));
+
+ return filename;
+}
+
+void LLViewerRegion::loadObjectCache()
{
if (mCacheLoaded)
{
@@ -340,9 +355,8 @@ void LLViewerRegion::loadCache()
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 );
+ std::string filename = getObjectCacheFilename(mHandle);
+ LL_DEBUGS("ObjectCache") << filename << LL_ENDL;
LLFILE* fp = LLFile::fopen(filename, "rb"); /* Flawfinder: ignore */
if (!fp)
@@ -413,7 +427,7 @@ void LLViewerRegion::loadCache()
}
-void LLViewerRegion::saveCache()
+void LLViewerRegion::saveObjectCache()
{
if (!mCacheLoaded)
{
@@ -426,9 +440,8 @@ void LLViewerRegion::saveCache()
return;
}
- std::string filename;
- filename = gDirUtilp->getExpandedFilename(LL_PATH_CACHE,"") + gDirUtilp->getDirDelimiter() +
- llformat("sobjects_%d_%d.slc", U32(mHandle>>32)/REGION_WIDTH_UNITS, U32(mHandle)/REGION_WIDTH_UNITS );
+ std::string filename = getObjectCacheFilename(mHandle);
+ LL_DEBUGS("ObjectCache") << filename << LL_ENDL;
LLFILE* fp = LLFile::fopen(filename, "wb"); /* Flawfinder: ignore */
if (!fp)
@@ -627,6 +640,26 @@ std::string LLViewerRegion::accessToString(U8 sim_access)
}
// static
+std::string LLViewerRegion::getAccessIcon(U8 sim_access)
+{
+ switch(sim_access)
+ {
+ case SIM_ACCESS_MATURE:
+ return "Parcel_M_Dark";
+
+ case SIM_ACCESS_ADULT:
+ return "Parcel_R_Light";
+
+ case SIM_ACCESS_PG:
+ return "Parcel_PG_Light";
+
+ case SIM_ACCESS_MIN:
+ default:
+ return "";
+ }
+}
+
+// static
std::string LLViewerRegion::accessToShortString(U8 sim_access)
{
switch(sim_access) /* Flawfinder: ignore */
@@ -1433,7 +1466,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.
@@ -1477,6 +1510,7 @@ void LLViewerRegion::setSeedCapability(const std::string& url)
capabilityNames.append("FetchLibDescendents");
capabilityNames.append("GetTexture");
capabilityNames.append("GetMesh");
+ capabilityNames.append("GetObjectCost");
capabilityNames.append("GroupProposalBallot");
capabilityNames.append("HomeLocation");
capabilityNames.append("LandResources");
@@ -1499,6 +1533,7 @@ void LLViewerRegion::setSeedCapability(const std::string& url)
capabilityNames.append("SendUserReport");
capabilityNames.append("SendUserReportWithScreenshot");
capabilityNames.append("ServerReleaseNotes");
+ capabilityNames.append("SimulatorFeatures");
capabilityNames.append("StartGroupProposal");
capabilityNames.append("TextureStats");
capabilityNames.append("UntrustedSimulatorMessage");
@@ -1539,6 +1574,10 @@ void LLViewerRegion::setCapability(const std::string& name, const std::string& u
else
{
mCapabilities[name] = url;
+ if(name == "GetTexture")
+ {
+ mHttpUrl = url ;
+ }
}
}