summaryrefslogtreecommitdiff
path: root/indra/newview
diff options
context:
space:
mode:
authorTodd Stinson <stinson@lindenlab.com>2012-02-27 16:15:16 -0800
committerTodd Stinson <stinson@lindenlab.com>2012-02-27 16:15:16 -0800
commit1503338ddcd170871815d70d328cbbd1dfd40c82 (patch)
tree18eb20ecff0b4c9f8273d7fe02404ee71f6e3cb6 /indra/newview
parent518bc51e668570beeec5f13fd2f3cc4d28f66551 (diff)
PATH-292: Ensuring that the terrain linkset is not visible and/or editable to a non-estate non-god agent.
Diffstat (limited to 'indra/newview')
-rw-r--r--indra/newview/llpathfindingmanager.cpp33
-rw-r--r--indra/newview/llpathfindingmanager.h3
2 files changed, 30 insertions, 6 deletions
diff --git a/indra/newview/llpathfindingmanager.cpp b/indra/newview/llpathfindingmanager.cpp
index 3a96ed72e5..5c9293a28a 100644
--- a/indra/newview/llpathfindingmanager.cpp
+++ b/indra/newview/llpathfindingmanager.cpp
@@ -173,6 +173,12 @@ bool LLPathfindingManager::isAllowAlterPermanent()
return (!isPathfindingEnabledForCurrentRegion() || (getAgentState() == kAgentStateUnfrozen));
}
+bool LLPathfindingManager::isAllowViewTerrainProperties() const
+{
+ LLViewerRegion* region = getCurrentRegion();
+ return (gAgent.isGodlike() || ((region != NULL) && region->canManageEstate()));
+}
+
LLPathfindingManager::agent_state_slot_t LLPathfindingManager::registerAgentStateSignal(agent_state_callback_t pAgentStateCallback)
{
return mAgentStateSignal.connect(pAgentStateCallback);
@@ -231,13 +237,18 @@ LLPathfindingManager::ELinksetsRequestStatus LLPathfindingManager::requestGetLin
}
else
{
- LinksetsResponderPtr linksetsResponderPtr(new LinksetsResponder(pLinksetsCallback, true, true));
+ bool doRequestTerrain = isAllowViewTerrainProperties();
+ LinksetsResponderPtr linksetsResponderPtr(new LinksetsResponder(pLinksetsCallback, true, doRequestTerrain));
LLHTTPClient::ResponderPtr objectLinksetsResponder = new ObjectLinksetsResponder(objectLinksetsURL, linksetsResponderPtr);
- LLHTTPClient::ResponderPtr terrainLinksetsResponder = new TerrainLinksetsResponder(terrainLinksetsURL, linksetsResponderPtr);
-
LLHTTPClient::get(objectLinksetsURL, objectLinksetsResponder);
- LLHTTPClient::get(terrainLinksetsURL, terrainLinksetsResponder);
+
+ if (doRequestTerrain)
+ {
+ LLHTTPClient::ResponderPtr terrainLinksetsResponder = new TerrainLinksetsResponder(terrainLinksetsURL, linksetsResponderPtr);
+ LLHTTPClient::get(terrainLinksetsURL, terrainLinksetsResponder);
+ }
+
status = kLinksetsRequestStarted;
}
@@ -257,7 +268,12 @@ LLPathfindingManager::ELinksetsRequestStatus LLPathfindingManager::requestSetLin
else
{
LLSD objectPostData = pLinksetList->encodeObjectFields(pLinksetUse, pA, pB, pC, pD);
- LLSD terrainPostData = pLinksetList->encodeTerrainFields(pLinksetUse, pA, pB, pC, pD);
+ LLSD terrainPostData;
+ if (isAllowViewTerrainProperties())
+ {
+ terrainPostData = pLinksetList->encodeTerrainFields(pLinksetUse, pA, pB, pC, pD);
+ }
+
if (objectPostData.isUndefined() && terrainPostData.isUndefined())
{
status = kLinksetsRequestCompleted;
@@ -362,7 +378,7 @@ std::string LLPathfindingManager::getCapabilityURLForCurrentRegion(const std::st
{
std::string capabilityURL("");
- LLViewerRegion* region = gAgent.getRegion();
+ LLViewerRegion* region = getCurrentRegion();
if (region != NULL)
{
capabilityURL = region->getCapability(pCapabilityName);
@@ -377,6 +393,11 @@ std::string LLPathfindingManager::getCapabilityURLForCurrentRegion(const std::st
return capabilityURL;
}
+LLViewerRegion *LLPathfindingManager::getCurrentRegion() const
+{
+ return gAgent.getRegion();
+}
+
//---------------------------------------------------------------------------
// AgentStateResponder
//---------------------------------------------------------------------------
diff --git a/indra/newview/llpathfindingmanager.h b/indra/newview/llpathfindingmanager.h
index 4b6fd49640..9a6bbb81b9 100644
--- a/indra/newview/llpathfindingmanager.h
+++ b/indra/newview/llpathfindingmanager.h
@@ -38,6 +38,7 @@
#include "llpathfindinglinksetlist.h"
class LLFloater;
+class LLViewerRegion;
class LLPathfindingManager : public LLSingleton<LLPathfindingManager>
{
@@ -70,6 +71,7 @@ public:
bool isPathfindingEnabledForCurrentRegion() const;
bool isAllowAlterPermanent();
+ bool isAllowViewTerrainProperties() const;
agent_state_slot_t registerAgentStateSignal(agent_state_callback_t pAgentStateCallback);
EAgentState getAgentState();
@@ -95,6 +97,7 @@ private:
std::string getTerrainLinksetsURLForCurrentRegion() const;
std::string getCapabilityURLForCurrentRegion(const std::string &pCapabilityName) const;
+ LLViewerRegion *getCurrentRegion() const;
agent_state_signal_t mAgentStateSignal;
EAgentState mAgentState;