summaryrefslogtreecommitdiff
path: root/indra/newview/llviewerregion.cpp
diff options
context:
space:
mode:
authorOz Linden <oz@lindenlab.com>2013-11-19 17:59:55 -0500
committerOz Linden <oz@lindenlab.com>2013-11-19 17:59:55 -0500
commit0031e9a97be1bf6e9fe773c23506494d09ce91ae (patch)
tree220f195c82174b7cc8e94dceb2553e59fe5837a5 /indra/newview/llviewerregion.cpp
parentb7edc965bc77ab21e9a1e3f6b424299a50053529 (diff)
parentebc9bcbf69f7a519677a6522979a6bf6cbb04bb8 (diff)
merge up to 3.6.10-release; some of the storm-68 changes lost
Diffstat (limited to 'indra/newview/llviewerregion.cpp')
-rwxr-xr-x[-rw-r--r--]indra/newview/llviewerregion.cpp254
1 files changed, 209 insertions, 45 deletions
diff --git a/indra/newview/llviewerregion.cpp b/indra/newview/llviewerregion.cpp
index 21e0db46c9..c6e67355c3 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"
@@ -143,6 +144,7 @@ public:
LLUUID mCacheID;
CapabilityMap mCapabilities;
+ CapabilityMap mSecondCapabilitiesTracker;
LLEventPoll* mEventPoll;
@@ -210,9 +212,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)
{
@@ -231,6 +233,7 @@ public:
if( mID != regionp->getHttpResponderID() ) // region is no longer referring to this responder
{
LL_WARNS2("AppInit", "Capabilities") << "Received results for a stale http responder!" << LL_ENDL;
+ regionp->failedSeedCapability();
return ;
}
@@ -238,6 +241,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;
@@ -256,10 +260,9 @@ public:
}
}
- static boost::intrusive_ptr<BaseCapabilitiesComplete> build( U64 region_handle, S32 id )
+ static BaseCapabilitiesComplete* build( U64 region_handle, S32 id )
{
- return boost::intrusive_ptr<BaseCapabilitiesComplete>(
- new BaseCapabilitiesComplete(region_handle, id) );
+ return new BaseCapabilitiesComplete(region_handle, id);
}
private:
@@ -267,6 +270,62 @@ 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 sent duplicate seed caps that differs in size - most likely content."<<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,
@@ -280,9 +339,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"),
@@ -455,18 +516,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);
@@ -479,10 +528,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;
}
@@ -575,7 +624,7 @@ std::string LLViewerRegion::getLocalizedSimProductName() const
}
// static
-std::string LLViewerRegion::regionFlagsToString(U32 flags)
+std::string LLViewerRegion::regionFlagsToString(U64 flags)
{
std::string result;
@@ -656,6 +705,31 @@ std::string LLViewerRegion::accessToShortString(U8 sim_access)
}
// static
+U8 LLViewerRegion::shortStringToAccess(const std::string &sim_access)
+{
+ U8 accessValue;
+
+ if (LLStringUtil::compareStrings(sim_access, "PG") == 0)
+ {
+ accessValue = SIM_ACCESS_PG;
+ }
+ else if (LLStringUtil::compareStrings(sim_access, "M") == 0)
+ {
+ accessValue = SIM_ACCESS_MATURE;
+ }
+ else if (LLStringUtil::compareStrings(sim_access, "A") == 0)
+ {
+ accessValue = SIM_ACCESS_ADULT;
+ }
+ else
+ {
+ accessValue = SIM_ACCESS_MIN;
+ }
+
+ return accessValue;
+}
+
+// static
void LLViewerRegion::processRegionInfo(LLMessageSystem* msg, void**)
{
// send it to 'observers'
@@ -696,7 +770,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);
@@ -1149,9 +1222,10 @@ 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;
+
}
void LLViewerRegion::setSimulatorFeatures(const LLSD& sim_features)
@@ -1318,11 +1392,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()
@@ -1368,7 +1439,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;
@@ -1377,7 +1449,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);
@@ -1386,7 +1457,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);
@@ -1425,6 +1509,8 @@ void LLViewerRegion::unpackRegionHandshake()
mProductName = productName;
}
+
+ mCentralBakeVersion = region_protocols & 1; // was (S32)gSavedSettings.getBOOL("UseServerTextureBaking");
LLVLComposition *compp = getComposition();
if (compp)
{
@@ -1462,7 +1548,8 @@ void LLViewerRegion::unpackRegionHandshake()
// all of our terrain stuff, by
if (compp->getParamsReady())
{
- getLand().dirtyAllPatches();
+ //this line creates frame stalls on region crossing and removing it appears to have no effect
+ //getLand().dirtyAllPatches();
}
else
{
@@ -1494,18 +1581,20 @@ void LLViewerRegion::unpackRegionHandshake()
void LLViewerRegionImpl::buildCapabilityNames(LLSD& capabilityNames)
{
+ capabilityNames.append("AgentState");
capabilityNames.append("AttachmentResources");
capabilityNames.append("AvatarPickerSearch");
+ capabilityNames.append("CharacterProperties");
capabilityNames.append("ChatSessionRequest");
capabilityNames.append("CopyInventoryFromNotecard");
capabilityNames.append("CreateInventoryCategory");
capabilityNames.append("DefaultObjectPermissions");
capabilityNames.append("DispatchRegionInfo");
+ capabilityNames.append("EnvironmentSettings");
capabilityNames.append("EstateChangeInfo");
capabilityNames.append("EventQueueGet");
- capabilityNames.append("EnvironmentSettings");
- capabilityNames.append("ObjectMedia");
- capabilityNames.append("ObjectMediaNavigate");
+ capabilityNames.append("FacebookConnect");
+ //capabilityNames.append("FacebookRedirect");
if (gSavedSettings.getBOOL("UseHTTPInventory"))
{
@@ -1513,49 +1602,56 @@ void LLViewerRegionImpl::buildCapabilityNames(LLSD& capabilityNames)
capabilityNames.append("FetchLibDescendents2");
capabilityNames.append("FetchInventory2");
capabilityNames.append("FetchInventoryDescendents2");
+ capabilityNames.append("IncrementCOFVersion");
}
capabilityNames.append("GetDisplayNames");
- capabilityNames.append("GetTexture");
capabilityNames.append("GetMesh");
capabilityNames.append("GetObjectCost");
capabilityNames.append("GetObjectPhysicsData");
+ capabilityNames.append("GetTexture");
+ capabilityNames.append("GroupMemberData");
capabilityNames.append("GroupProposalBallot");
capabilityNames.append("HomeLocation");
capabilityNames.append("LandResources");
capabilityNames.append("MapLayer");
capabilityNames.append("MapLayerGod");
capabilityNames.append("MeshUploadFlag");
+ capabilityNames.append("NavMeshGenerationStatus");
capabilityNames.append("NewFileAgentInventory");
+ capabilityNames.append("ObjectMedia");
+ capabilityNames.append("ObjectMediaNavigate");
+ capabilityNames.append("ObjectNavMeshProperties");
capabilityNames.append("ParcelPropertiesUpdate");
- capabilityNames.append("ParcelMediaURLFilterList");
- capabilityNames.append("ParcelNavigateMedia");
capabilityNames.append("ParcelVoiceInfoRequest");
capabilityNames.append("ProductInfoRequest");
capabilityNames.append("ProvisionVoiceAccountRequest");
capabilityNames.append("RemoteParcelRequest");
+ capabilityNames.append("RenderMaterials");
capabilityNames.append("RequestTextureDownload");
capabilityNames.append("ResourceCostSelected");
+ capabilityNames.append("RetrieveNavMeshSrc");
capabilityNames.append("SearchStatRequest");
capabilityNames.append("SearchStatTracking");
capabilityNames.append("SendPostcard");
capabilityNames.append("SendUserReport");
capabilityNames.append("SendUserReportWithScreenshot");
capabilityNames.append("ServerReleaseNotes");
- capabilityNames.append("SimConsole");
- capabilityNames.append("SimulatorFeatures");
capabilityNames.append("SetDisplayName");
capabilityNames.append("SimConsoleAsync");
+ capabilityNames.append("SimulatorFeatures");
capabilityNames.append("StartGroupProposal");
+ capabilityNames.append("TerrainNavMeshProperties");
capabilityNames.append("TextureStats");
capabilityNames.append("UntrustedSimulatorMessage");
capabilityNames.append("UpdateAgentInformation");
capabilityNames.append("UpdateAgentLanguage");
+ capabilityNames.append("UpdateAvatarAppearance");
capabilityNames.append("UpdateGestureAgentInventory");
- capabilityNames.append("UpdateNotecardAgentInventory");
- capabilityNames.append("UpdateScriptAgent");
capabilityNames.append("UpdateGestureTaskInventory");
+ capabilityNames.append("UpdateNotecardAgentInventory");
capabilityNames.append("UpdateNotecardTaskInventory");
+ capabilityNames.append("UpdateScriptAgent");
capabilityNames.append("UpdateScriptTask");
capabilityNames.append("UploadBakedTexture");
capabilityNames.append("ViewerMetrics");
@@ -1571,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;
}
@@ -1643,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();
}
@@ -1706,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";
@@ -1713,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())
{
@@ -1772,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
@@ -1780,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)) );
}
@@ -1800,7 +1912,10 @@ void LLViewerRegion::getNeighboringRegions( std::vector<LLViewerRegion*>& unique
{
mImpl->mLandp->getNeighboringRegions( uniqueRegions );
}
-
+void LLViewerRegion::getNeighboringRegionsStatus( std::vector<S32>& regions )
+{
+ mImpl->mLandp->getNeighboringRegionsStatus( regions );
+}
void LLViewerRegion::showReleaseNotes()
{
std::string url = this->getCapability("ServerReleaseNotes");
@@ -1833,4 +1948,53 @@ bool LLViewerRegion::meshRezEnabled() const
mSimulatorFeatures["MeshRezEnabled"].asBoolean());
}
+bool LLViewerRegion::dynamicPathfindingEnabled() const
+{
+ return ( mSimulatorFeatures.has("DynamicPathfindingEnabled") &&
+ 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;
+}
+