summaryrefslogtreecommitdiff
path: root/indra/newview/llviewerparcelmgr.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'indra/newview/llviewerparcelmgr.cpp')
-rw-r--r--indra/newview/llviewerparcelmgr.cpp77
1 files changed, 71 insertions, 6 deletions
diff --git a/indra/newview/llviewerparcelmgr.cpp b/indra/newview/llviewerparcelmgr.cpp
index 416d5d8e2e..d4937db6db 100644
--- a/indra/newview/llviewerparcelmgr.cpp
+++ b/indra/newview/llviewerparcelmgr.cpp
@@ -69,6 +69,8 @@
#include "llvieweraudio.h"
#include "llcorehttputil.h"
+#include "llenvironment.h"
+
const F32 PARCEL_COLLISION_DRAW_SECS = 1.f;
@@ -645,6 +647,31 @@ LLParcel *LLViewerParcelMgr::getAgentParcel() const
return mAgentParcel;
}
+
+LLParcel * LLViewerParcelMgr::getAgentOrSelectedParcel() const
+{
+ LLParcel *parcel(nullptr);
+
+ LLParcelSelectionHandle sel_handle(getFloatingParcelSelection());
+ if (sel_handle)
+ {
+ LLParcelSelection *selection(sel_handle.get());
+ if (selection)
+ {
+ parcel = selection->getParcel();
+ if (parcel && (parcel->getLocalID() == INVALID_PARCEL_ID))
+ {
+ parcel = NULL;
+ }
+ }
+ }
+
+ if (!parcel)
+ parcel = LLViewerParcelMgr::instance().getAgentParcel();
+
+ return parcel;
+}
+
// Return whether the agent can build on the land they are on
bool LLViewerParcelMgr::allowAgentBuild() const
{
@@ -1285,6 +1312,13 @@ const std::string& LLViewerParcelMgr::getAgentParcelName() const
}
+const S32 LLViewerParcelMgr::getAgentParcelId() const
+{
+ if (mAgentParcel)
+ return mAgentParcel->getLocalID();
+ return INVALID_PARCEL_ID;
+}
+
void LLViewerParcelMgr::sendParcelPropertiesUpdate(LLParcel* parcel, bool use_agent_region)
{
if(!parcel)
@@ -1515,6 +1549,8 @@ void LLViewerParcelMgr::processParcelProperties(LLMessageSystem *msg, void **use
BOOL region_deny_transacted_override = false; // Deprecated
BOOL region_deny_age_unverified_override = false;
BOOL region_allow_access_override = true;
+ BOOL region_allow_environment_override = true;
+ S32 parcel_environment_version = 0;
BOOL agent_parcel_update = false; // updating previous(existing) agent parcel
S32 other_clean_time = 0;
@@ -1605,6 +1641,12 @@ void LLViewerParcelMgr::processParcelProperties(LLMessageSystem *msg, void **use
msg->getBOOLFast(_PREHASH_RegionAllowAccessBlock, _PREHASH_RegionAllowAccessOverride, region_allow_access_override);
}
+ if (msg->getNumberOfBlocks(_PREHASH_ParcelEnvironmentBlock))
+ {
+ msg->getS32Fast(_PREHASH_ParcelEnvironmentBlock, _PREHASH_ParcelEnvironmentVersion, parcel_environment_version);
+ msg->getBOOLFast(_PREHASH_ParcelEnvironmentBlock, _PREHASH_RegionAllowEnvironmentOverride, region_allow_environment_override);
+ }
+
msg->getS32("ParcelData", "OtherCleanTime", other_clean_time );
LL_DEBUGS("ParcelMgr") << "Processing parcel " << local_id << " update, target(sequence): " << sequence_id << LL_ENDL;
@@ -1624,6 +1666,9 @@ void LLViewerParcelMgr::processParcelProperties(LLMessageSystem *msg, void **use
}
}
+ S32 cur_parcel_environment_version = parcel->getParcelEnvironmentVersion();
+ bool environment_changed = (cur_parcel_environment_version != parcel_environment_version);
+
parcel->init(owner_id,
FALSE, FALSE, FALSE,
claim_date, claim_price_per_meter, rent_price_per_meter,
@@ -1649,6 +1694,9 @@ void LLViewerParcelMgr::processParcelProperties(LLMessageSystem *msg, void **use
parcel->setRegionDenyAnonymousOverride(region_deny_anonymous_override);
parcel->setRegionDenyAgeUnverifiedOverride(region_deny_age_unverified_override);
parcel->setRegionAllowAccessOverride(region_allow_access_override);
+ parcel->setParcelEnvironmentVersion(cur_parcel_environment_version);
+ parcel->setRegionAllowEnvironmentOverride(region_allow_environment_override);
+
parcel->unpackMessage(msg);
if (parcel == parcel_mgr.mAgentParcel)
@@ -1682,12 +1730,23 @@ void LLViewerParcelMgr::processParcelProperties(LLMessageSystem *msg, void **use
instance->mTeleportFinishedSignal(instance->mTeleportInProgressPosition, false);
}
}
- }
- else if (agent_parcel_update)
- {
- // updated agent parcel
- parcel_mgr.mAgentParcel->unpackMessage(msg);
- }
+ parcel->setParcelEnvironmentVersion(parcel_environment_version);
+ LL_DEBUGS("ENVIRONMENT") << "Parcel environment version is " << parcel->getParcelEnvironmentVersion() << LL_ENDL;
+ // Notify anything that wants to know when the agent changes parcels
+ gAgent.changeParcels();
+ instance->mTeleportInProgress = FALSE;
+ }
+ else if (agent_parcel_update)
+ {
+ parcel->setParcelEnvironmentVersion(parcel_environment_version);
+ // updated agent parcel
+ parcel_mgr.mAgentParcel->unpackMessage(msg);
+ if ((LLEnvironment::instance().isExtendedEnvironmentEnabled() && environment_changed))
+ {
+ LL_DEBUGS("ENVIRONMENT") << "Parcel environment version is " << parcel->getParcelEnvironmentVersion() << LL_ENDL;
+ LLEnvironment::instance().requestParcel(local_id);
+ }
+ }
}
// Handle updating selections, if necessary.
@@ -2577,3 +2636,9 @@ void LLViewerParcelMgr::onTeleportFailed()
{
mTeleportFailedSignal();
}
+
+bool LLViewerParcelMgr::getTeleportInProgress()
+{
+ return mTeleportInProgress // case where parcel data arrives after teleport
+ || gAgent.getTeleportState() > LLAgent::TELEPORT_NONE; // For LOCAL, no mTeleportInProgress
+}