summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRider Linden <rider@lindenlab.com>2018-11-21 12:52:35 -0800
committerRider Linden <rider@lindenlab.com>2018-11-21 12:52:35 -0800
commit8d3e5a3eac51170946e6f32a28f26fa523753d90 (patch)
tree505bbbfaf37f821a049fab0af4b9932b9b26d9ae
parent8067bd824ecbf0f2c63a27937f3e36c4cbc99418 (diff)
parent62720cf5dd5c11eaf08e90ce281d6d084ae017f0 (diff)
Merge
-rw-r--r--indra/llinventory/llparcel.h3
-rw-r--r--indra/newview/llpanelenvironment.cpp33
2 files changed, 25 insertions, 11 deletions
diff --git a/indra/llinventory/llparcel.h b/indra/llinventory/llparcel.h
index 067391b5a1..3b39aeb56b 100644
--- a/indra/llinventory/llparcel.h
+++ b/indra/llinventory/llparcel.h
@@ -103,8 +103,9 @@ const U32 RT_SELL = 0x1 << 5;
const S32 INVALID_PARCEL_ID = -1;
-// if Region settings are used, parcel env. version is -1
const S32 INVALID_PARCEL_ENVIRONMENT_VERSION = -2;
+// if Region settings are used, parcel env. version is -1
+const S32 UNSET_PARCEL_ENVIRONMENT_VERSION = -1;
// Timeouts for parcels
// default is 21 days * 24h/d * 60m/h * 60s/m *1000000 usec/s = 1814400000000
diff --git a/indra/newview/llpanelenvironment.cpp b/indra/newview/llpanelenvironment.cpp
index df595632f8..8c86e3e8e4 100644
--- a/indra/newview/llpanelenvironment.cpp
+++ b/indra/newview/llpanelenvironment.cpp
@@ -797,16 +797,21 @@ void LLPanelEnvironmentInfo::onEnvironmentChanged(LLEnvironment::EnvSelection_t
// Panel receives environment from different sources, from environment update callbacks,
// from hovers (causes callbacks on version change) and from personal requests
// filter out dupplicates and out of order packets by checking parcel environment version.
- LL_DEBUGS("ENVPANEL") << "Received environment update " << mCurEnvVersion << " " << (getParcel() ? getParcel()->getParcelEnvironmentVersion() : (S32)-1) << LL_ENDL;
LLParcel *parcel = getParcel();
- if (parcel && mCurEnvVersion < parcel->getParcelEnvironmentVersion())
- {
- mCurrentEnvironment.reset();
- refreshFromSource();
- }
- else
+ if (parcel)
{
- refresh();
+ S32 new_version = parcel->getParcelEnvironmentVersion();
+ LL_DEBUGS("ENVPANEL") << "Received environment update " << mCurEnvVersion << " " << new_version << LL_ENDL;
+ if (mCurEnvVersion < new_version
+ || (mCurEnvVersion != new_version && new_version == UNSET_PARCEL_ENVIRONMENT_VERSION))
+ {
+ mCurrentEnvironment.reset();
+ refreshFromSource();
+ }
+ else
+ {
+ refresh();
+ }
}
}
}
@@ -837,16 +842,24 @@ void LLPanelEnvironmentInfo::onEnvironmentReceived(S32 parcel_id, LLEnvironment:
if (parcel_id == INVALID_PARCEL_ID)
{
// region, no version
- mCurEnvVersion = 1;
+ // -2 for invalid version viewer -1 for invalid version from server
+ mCurEnvVersion = UNSET_PARCEL_ENVIRONMENT_VERSION;
}
else
{
LLParcel* parcel = getParcel();
- if (parcel)
+ if (parcel
+ && mCurrentEnvironment->mDayCycle
+ && mCurrentEnvironment->mDayCycle->getAssetId() != LLSettingsDay::GetDefaultAssetId())
{
// not always up to date, we will get onEnvironmentChanged() update in such case.
mCurEnvVersion = parcel->getParcelEnvironmentVersion();
}
+ else
+ {
+ // When using 'region' as parcel environment
+ mCurEnvVersion = UNSET_PARCEL_ENVIRONMENT_VERSION;
+ }
LL_DEBUGS("ENVPANEL") << " Setting environment version: " << mCurEnvVersion << LL_ENDL;
}
refresh();