summaryrefslogtreecommitdiff
path: root/indra/newview/llviewerregion.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'indra/newview/llviewerregion.cpp')
-rwxr-xr-x[-rw-r--r--]indra/newview/llviewerregion.cpp196
1 files changed, 164 insertions, 32 deletions
diff --git a/indra/newview/llviewerregion.cpp b/indra/newview/llviewerregion.cpp
index b607afbd9d..678f24fb3c 100644..100755
--- a/indra/newview/llviewerregion.cpp
+++ b/indra/newview/llviewerregion.cpp
@@ -44,6 +44,7 @@
#include "llagent.h"
#include "llagentcamera.h"
+#include "llavatarrenderinfoaccountant.h"
#include "llcallingcard.h"
#include "llcaphttpsender.h"
#include "llcapabilitylistener.h"
@@ -142,6 +143,7 @@ public:
LLUUID mCacheID;
CapabilityMap mCapabilities;
+ CapabilityMap mSecondCapabilitiesTracker;
LLEventPoll* mEventPoll;
@@ -209,9 +211,9 @@ public:
virtual ~BaseCapabilitiesComplete()
{ }
- void error(U32 statusNum, const std::string& reason)
+ void errorWithContent(U32 statusNum, const std::string& reason, const LLSD& content)
{
- LL_WARNS2("AppInit", "Capabilities") << statusNum << ": " << reason << LL_ENDL;
+ LL_WARNS2("AppInit", "Capabilities") << "[status:" << statusNum << ":] " << content << LL_ENDL;
LLViewerRegion *regionp = LLWorld::getInstance()->getRegionFromHandle(mRegionHandle);
if (regionp)
{
@@ -237,6 +239,7 @@ public:
for(iter = content.beginMap(); iter != content.endMap(); ++iter)
{
regionp->setCapability(iter->first, iter->second);
+
LL_DEBUGS2("AppInit", "Capabilities") << "got capability for "
<< iter->first << LL_ENDL;
@@ -265,6 +268,67 @@ private:
S32 mID;
};
+class BaseCapabilitiesCompleteTracker : public LLHTTPClient::Responder
+{
+ LOG_CLASS(BaseCapabilitiesCompleteTracker);
+public:
+ BaseCapabilitiesCompleteTracker( U64 region_handle)
+ : mRegionHandle(region_handle)
+ { }
+
+ virtual ~BaseCapabilitiesCompleteTracker()
+ { }
+
+ void errorWithContent(U32 statusNum, const std::string& reason, const LLSD& content)
+ {
+ llwarns << "BaseCapabilitiesCompleteTracker error [status:"
+ << statusNum << "]: " << content << llendl;
+ }
+
+ void result(const LLSD& content)
+ {
+ LLViewerRegion *regionp = LLWorld::getInstance()->getRegionFromHandle(mRegionHandle);
+ if( !regionp )
+ {
+ return ;
+ }
+ LLSD::map_const_iterator iter;
+ for(iter = content.beginMap(); iter != content.endMap(); ++iter)
+ {
+ regionp->setCapabilityDebug(iter->first, iter->second);
+ //llinfos<<"BaseCapabilitiesCompleteTracker New Caps "<<iter->first<<" "<< iter->second<<llendl;
+ }
+
+ if ( regionp->getRegionImpl()->mCapabilities.size() != regionp->getRegionImpl()->mSecondCapabilitiesTracker.size() )
+ {
+ llinfos << "BaseCapabilitiesCompleteTracker " << "sim " << regionp->getName()
+ << " sent duplicate seed caps that differs in size - most likely content. "
+ << (S32) regionp->getRegionImpl()->mCapabilities.size() << " vs " << regionp->getRegionImpl()->mSecondCapabilitiesTracker.size()
+ << llendl;
+
+ //todo#add cap debug versus original check?
+ /*
+ CapabilityMap::const_iterator iter = regionp->getRegionImpl()->mCapabilities.begin();
+ while (iter!=regionp->getRegionImpl()->mCapabilities.end() )
+ {
+ llinfos << "BaseCapabilitiesCompleteTracker Original " << iter->first << " " << iter->second<<llendl;
+ ++iter;
+ }
+ */
+ regionp->getRegionImplNC()->mSecondCapabilitiesTracker.clear();
+ }
+
+ }
+
+ static BaseCapabilitiesCompleteTracker* build( U64 region_handle )
+ {
+ return new BaseCapabilitiesCompleteTracker( region_handle );
+ }
+
+private:
+ U64 mRegionHandle;
+};
+
LLViewerRegion::LLViewerRegion(const U64 &handle,
const LLHost &host,
@@ -278,9 +342,11 @@ LLViewerRegion::LLViewerRegion(const U64 &handle,
mZoning(""),
mIsEstateManager(FALSE),
mRegionFlags( REGION_FLAGS_DEFAULT ),
+ mRegionProtocols( 0 ),
mSimAccess( SIM_ACCESS_MIN ),
mBillableFactor(1.0),
mMaxTasks(DEFAULT_MAX_REGION_WIDE_PRIM_COUNT),
+ mCentralBakeVersion(0),
mClassID(0),
mCPURatio(0),
mColoName("unknown"),
@@ -333,6 +399,9 @@ LLViewerRegion::LLViewerRegion(const U64 &handle,
mImpl->mObjectPartition.push_back(new LLBridgePartition()); //PARTITION_BRIDGE
mImpl->mObjectPartition.push_back(new LLHUDParticlePartition());//PARTITION_HUD_PARTICLE
mImpl->mObjectPartition.push_back(NULL); //PARTITION_NONE
+
+ mRenderInfoRequestTimer.resetWithExpiry(0.f); // Set timer to be expired
+ setCapabilitiesReceivedCallback(boost::bind(&LLAvatarRenderInfoAccountant::expireRenderInfoReportTimer, _1));
}
@@ -453,18 +522,6 @@ void LLViewerRegion::sendReliableMessage()
gMessageSystem->sendReliable(mImpl->mHost);
}
-void LLViewerRegion::setFlags(BOOL b, U32 flags)
-{
- if (b)
- {
- mRegionFlags |= flags;
- }
- else
- {
- mRegionFlags &= ~flags;
- }
-}
-
void LLViewerRegion::setWaterHeight(F32 water_level)
{
mImpl->mLandp->setWaterHeight(water_level);
@@ -477,10 +534,10 @@ F32 LLViewerRegion::getWaterHeight() const
BOOL LLViewerRegion::isVoiceEnabled() const
{
- return (getRegionFlags() & REGION_FLAGS_ALLOW_VOICE);
+ return getRegionFlag(REGION_FLAGS_ALLOW_VOICE);
}
-void LLViewerRegion::setRegionFlags(U32 flags)
+void LLViewerRegion::setRegionFlags(U64 flags)
{
mRegionFlags = flags;
}
@@ -573,7 +630,7 @@ std::string LLViewerRegion::getLocalizedSimProductName() const
}
// static
-std::string LLViewerRegion::regionFlagsToString(U32 flags)
+std::string LLViewerRegion::regionFlagsToString(U64 flags)
{
std::string result;
@@ -719,7 +776,6 @@ void LLViewerRegion::dirtyHeights()
BOOL LLViewerRegion::idleUpdate(F32 max_update_time)
{
- LLMemType mt_ivr(LLMemType::MTYPE_IDLE_UPDATE_VIEWER_REGION);
// did_update returns TRUE if we did at least one significant update
BOOL did_update = mImpl->mLandp->idleUpdate(max_update_time);
@@ -1172,7 +1228,7 @@ void LLViewerRegion::getInfo(LLSD& info)
info["Region"]["Handle"]["y"] = (LLSD::Integer)y;
}
-void LLViewerRegion::getSimulatorFeatures(LLSD& sim_features)
+void LLViewerRegion::getSimulatorFeatures(LLSD& sim_features) const
{
sim_features = mSimulatorFeatures;
@@ -1342,11 +1398,8 @@ void LLViewerRegion::requestCacheMisses()
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
+ LLViewerStatsRecorder::instance().requestCacheMissesEvent(full_count + crc_count);
+ LLViewerStatsRecorder::instance().log(0.2f);
}
void LLViewerRegion::dumpCache()
@@ -1392,7 +1445,8 @@ void LLViewerRegion::unpackRegionHandshake()
{
LLMessageSystem *msg = gMessageSystem;
- U32 region_flags;
+ U64 region_flags = 0;
+ U64 region_protocols = 0;
U8 sim_access;
std::string sim_name;
LLUUID sim_owner;
@@ -1401,7 +1455,6 @@ void LLViewerRegion::unpackRegionHandshake()
F32 billable_factor;
LLUUID cache_id;
- msg->getU32 ("RegionInfo", "RegionFlags", region_flags);
msg->getU8 ("RegionInfo", "SimAccess", sim_access);
msg->getString ("RegionInfo", "SimName", sim_name);
msg->getUUID ("RegionInfo", "SimOwner", sim_owner);
@@ -1410,7 +1463,20 @@ void LLViewerRegion::unpackRegionHandshake()
msg->getF32 ("RegionInfo", "BillableFactor", billable_factor);
msg->getUUID ("RegionInfo", "CacheID", cache_id );
+ if (msg->has(_PREHASH_RegionInfo4))
+ {
+ msg->getU64Fast(_PREHASH_RegionInfo4, _PREHASH_RegionFlagsExtended, region_flags);
+ msg->getU64Fast(_PREHASH_RegionInfo4, _PREHASH_RegionProtocols, region_protocols);
+ }
+ else
+ {
+ U32 flags = 0;
+ msg->getU32Fast(_PREHASH_RegionInfo, _PREHASH_RegionFlags, flags);
+ region_flags = flags;
+ }
+
setRegionFlags(region_flags);
+ setRegionProtocols(region_protocols);
setSimAccess(sim_access);
setRegionNameAndZone(sim_name);
setOwner(sim_owner);
@@ -1449,6 +1515,8 @@ void LLViewerRegion::unpackRegionHandshake()
mProductName = productName;
}
+
+ mCentralBakeVersion = region_protocols & 1; // was (S32)gSavedSettings.getBOOL("UseServerTextureBaking");
LLVLComposition *compp = getComposition();
if (compp)
{
@@ -1518,6 +1586,7 @@ void LLViewerRegionImpl::buildCapabilityNames(LLSD& capabilityNames)
capabilityNames.append("AgentState");
capabilityNames.append("AttachmentResources");
capabilityNames.append("AvatarPickerSearch");
+ capabilityNames.append("AvatarRenderInfo");
capabilityNames.append("CharacterProperties");
capabilityNames.append("ChatSessionRequest");
capabilityNames.append("CopyInventoryFromNotecard");
@@ -1533,6 +1602,7 @@ void LLViewerRegionImpl::buildCapabilityNames(LLSD& capabilityNames)
capabilityNames.append("FetchLibDescendents2");
capabilityNames.append("FetchInventory2");
capabilityNames.append("FetchInventoryDescendents2");
+ capabilityNames.append("IncrementCOFVersion");
}
capabilityNames.append("GetDisplayNames");
@@ -1546,7 +1616,7 @@ void LLViewerRegionImpl::buildCapabilityNames(LLSD& capabilityNames)
capabilityNames.append("LandResources");
capabilityNames.append("MapLayer");
capabilityNames.append("MapLayerGod");
- capabilityNames.append("MeshUploadFlag");
+ capabilityNames.append("MeshUploadFlag");
capabilityNames.append("NavMeshGenerationStatus");
capabilityNames.append("NewFileAgentInventory");
capabilityNames.append("ObjectMedia");
@@ -1557,6 +1627,7 @@ void LLViewerRegionImpl::buildCapabilityNames(LLSD& capabilityNames)
capabilityNames.append("ProductInfoRequest");
capabilityNames.append("ProvisionVoiceAccountRequest");
capabilityNames.append("RemoteParcelRequest");
+ capabilityNames.append("RenderMaterials");
capabilityNames.append("RequestTextureDownload");
capabilityNames.append("ResourceCostSelected");
capabilityNames.append("RetrieveNavMeshSrc");
@@ -1575,6 +1646,7 @@ void LLViewerRegionImpl::buildCapabilityNames(LLSD& capabilityNames)
capabilityNames.append("UntrustedSimulatorMessage");
capabilityNames.append("UpdateAgentInformation");
capabilityNames.append("UpdateAgentLanguage");
+ capabilityNames.append("UpdateAvatarAppearance");
capabilityNames.append("UpdateGestureAgentInventory");
capabilityNames.append("UpdateGestureTaskInventory");
capabilityNames.append("UpdateNotecardAgentInventory");
@@ -1585,7 +1657,7 @@ void LLViewerRegionImpl::buildCapabilityNames(LLSD& capabilityNames)
capabilityNames.append("ViewerMetrics");
capabilityNames.append("ViewerStartAuction");
capabilityNames.append("ViewerStats");
-
+
// Please add new capabilities alphabetically to reduce
// merge conflicts.
}
@@ -1595,6 +1667,12 @@ void LLViewerRegion::setSeedCapability(const std::string& url)
if (getCapability("Seed") == url)
{
// llwarns << "Ignoring duplicate seed capability" << llendl;
+ //Instead of just returning we build up a second set of seed caps and compare them
+ //to the "original" seed cap received and determine why there is problem!
+ LLSD capabilityNames = LLSD::emptyArray();
+ mImpl->buildCapabilityNames( capabilityNames );
+ LLHTTPClient::post( url, capabilityNames, BaseCapabilitiesCompleteTracker::build(getHandle() ),
+ LLSD(), CAP_REQUEST_TIMEOUT );
return;
}
@@ -1667,9 +1745,9 @@ public:
{ }
- void error(U32 statusNum, const std::string& reason)
+ void errorWithContent(U32 statusNum, const std::string& reason, const LLSD& content)
{
- LL_WARNS2("AppInit", "SimulatorFeatures") << statusNum << ": " << reason << LL_ENDL;
+ LL_WARNS2("AppInit", "SimulatorFeatures") << "[status:" << statusNum << "]: " << content << LL_ENDL;
retry();
}
@@ -1730,6 +1808,11 @@ void LLViewerRegion::setCapability(const std::string& name, const std::string& u
}
}
+void LLViewerRegion::setCapabilityDebug(const std::string& name, const std::string& url)
+{
+ mImpl->mSecondCapabilitiesTracker[name] = url;
+}
+
bool LLViewerRegion::isSpecialCapabilityName(const std::string &name)
{
return name == "EventQueueGet" || name == "UntrustedSimulatorMessage";
@@ -1737,6 +1820,11 @@ bool LLViewerRegion::isSpecialCapabilityName(const std::string &name)
std::string LLViewerRegion::getCapability(const std::string& name) const
{
+ if (!capabilitiesReceived() && (name!=std::string("Seed")) && (name!=std::string("ObjectMedia")))
+ {
+ llwarns << "getCapability called before caps received" << llendl;
+ }
+
CapabilityMap::const_iterator iter = mImpl->mCapabilities.find(name);
if(iter == mImpl->mCapabilities.end())
{
@@ -1796,7 +1884,7 @@ LLSpatialPartition* LLViewerRegion::getSpatialPartition(U32 type)
// the viewer can not yet distinquish between normal- and estate-owned objects
// so we collapse these two bits and enable the UI if either are set
-const U32 ALLOW_RETURN_ENCROACHING_OBJECT = REGION_FLAGS_ALLOW_RETURN_ENCROACHING_OBJECT
+const U64 ALLOW_RETURN_ENCROACHING_OBJECT = REGION_FLAGS_ALLOW_RETURN_ENCROACHING_OBJECT
| REGION_FLAGS_ALLOW_RETURN_ENCROACHING_ESTATE_OBJECT;
bool LLViewerRegion::objectIsReturnable(const LLVector3& pos, const std::vector<LLBBox>& boxes) const
@@ -1804,7 +1892,7 @@ bool LLViewerRegion::objectIsReturnable(const LLVector3& pos, const std::vector<
return (mParcelOverlay != NULL)
&& (mParcelOverlay->isOwnedSelf(pos)
|| mParcelOverlay->isOwnedGroup(pos)
- || ((mRegionFlags & ALLOW_RETURN_ENCROACHING_OBJECT)
+ || (getRegionFlag(ALLOW_RETURN_ENCROACHING_OBJECT)
&& mParcelOverlay->encroachesOwned(boxes)) );
}
@@ -1866,3 +1954,47 @@ bool LLViewerRegion::dynamicPathfindingEnabled() const
mSimulatorFeatures["DynamicPathfindingEnabled"].asBoolean());
}
+void LLViewerRegion::resetMaterialsCapThrottle()
+{
+ F32 requests_per_sec = 1.0f; // original default;
+ if ( mSimulatorFeatures.has("RenderMaterialsCapability")
+ && mSimulatorFeatures["RenderMaterialsCapability"].isReal() )
+ {
+ requests_per_sec = mSimulatorFeatures["RenderMaterialsCapability"].asReal();
+ if ( requests_per_sec == 0.0f )
+ {
+ requests_per_sec = 1.0f;
+ LL_WARNS("Materials")
+ << "region '" << getName()
+ << "' returned zero for RenderMaterialsCapability; using default "
+ << requests_per_sec << " per second"
+ << LL_ENDL;
+ }
+ LL_DEBUGS("Materials") << "region '" << getName()
+ << "' RenderMaterialsCapability " << requests_per_sec
+ << LL_ENDL;
+ }
+ else
+ {
+ LL_DEBUGS("Materials")
+ << "region '" << getName()
+ << "' did not return RenderMaterialsCapability, using default "
+ << requests_per_sec << " per second"
+ << LL_ENDL;
+ }
+
+ mMaterialsCapThrottleTimer.resetWithExpiry( 1.0f / requests_per_sec );
+}
+
+U32 LLViewerRegion::getMaxMaterialsPerTransaction() const
+{
+ U32 max_entries = 50; // original hard coded default
+ if ( mSimulatorFeatures.has( "MaxMaterialsPerTransaction" )
+ && mSimulatorFeatures[ "MaxMaterialsPerTransaction" ].isInteger())
+ {
+ max_entries = mSimulatorFeatures[ "MaxMaterialsPerTransaction" ].asInteger();
+ }
+ return max_entries;
+}
+
+