From 2f655d117acca491270add307952042e8ab08aeb Mon Sep 17 00:00:00 2001 From: Rider Linden Date: Mon, 18 Jun 2018 15:48:48 -0700 Subject: Request environment when parcel settings are changed. --- indra/newview/llviewerparcelmgr.cpp | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) (limited to 'indra/newview/llviewerparcelmgr.cpp') diff --git a/indra/newview/llviewerparcelmgr.cpp b/indra/newview/llviewerparcelmgr.cpp index f4d14a39fe..d05d11625f 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; @@ -1811,6 +1813,27 @@ void LLViewerParcelMgr::processParcelProperties(LLMessageSystem *msg, void **use } }//if gAudiop }; + + if (LLEnvironment::instance().isExtendedEnvironmentEnabled()) + { + LL_WARNS("LAPRAS") << "TODO: Hey Rider! Fix this. 1) don't rerequest parcel information. 2) if sequent_id == -1 we are selecting a parcel. Deal with that correctly." << LL_ENDL; + + if (sequence_id == SELECTED_PARCEL_SEQ_ID) + { + LL_WARNS("LAPRAS") << "TODO: Hay Rider! Fix this. Get environment for selected parcel." << LL_ENDL; + } + else if ((sequence_id == HOVERED_PARCEL_SEQ_ID) || + (sequence_id == COLLISION_NOT_IN_GROUP_PARCEL_SEQ_ID) || + (sequence_id == COLLISION_NOT_ON_LIST_PARCEL_SEQ_ID) || + (sequence_id == COLLISION_BANNED_PARCEL_SEQ_ID)) + { + /*NoOp*/ + } + else + { + LLEnvironment::instance().requestParcel(local_id); + } + } } void LLViewerParcelMgr::optionally_start_music(const std::string& music_url) -- cgit v1.3 From 294793b9a983a0c26c0e82bd432d4cc311ecb1ba Mon Sep 17 00:00:00 2001 From: Rider Linden Date: Tue, 10 Jul 2018 15:15:47 -0700 Subject: MAINT-8821: Tighten up floater. Allow apply from gear menu. --- indra/newview/llenvironment.cpp | 6 +- indra/newview/llenvironment.h | 4 +- indra/newview/llfloatermyenvironment.cpp | 126 ++++++++++++++++++--- indra/newview/llfloatermyenvironment.h | 3 + indra/newview/llinventorybridge.cpp | 2 +- indra/newview/llpaneleditsky.h | 6 +- indra/newview/llpaneleditwater.h | 2 +- indra/newview/llviewerparcelmgr.cpp | 21 ++++ indra/newview/llviewerparcelmgr.h | 1 + .../skins/default/xui/en/menu_settings_gear.xml | 8 +- 10 files changed, 150 insertions(+), 29 deletions(-) (limited to 'indra/newview/llviewerparcelmgr.cpp') diff --git a/indra/newview/llenvironment.cpp b/indra/newview/llenvironment.cpp index ee5eec59a3..289d0c5388 100644 --- a/indra/newview/llenvironment.cpp +++ b/indra/newview/llenvironment.cpp @@ -366,9 +366,9 @@ bool LLEnvironment::canAgentUpdateParcelEnvironment(bool useselected) const { if (!LLEnvironment::instance().isExtendedEnvironmentEnabled()) return false; - // *TODO* - //LLParcel* parcel = (useselected) ? LLViewerParcelMgr::instance().getParcelSelection() : LLViewerParcelMgr::instance().getAgentParcel(); - LLParcel* parcel = LLViewerParcelMgr::instance().getAgentParcel(); + + LLParcel *parcel(LLViewerParcelMgr::instance().getAgentOrSelectedParcel()); + if (parcel) { return parcel->allowTerraformBy(gAgent.getID()); diff --git a/indra/newview/llenvironment.h b/indra/newview/llenvironment.h index d9a1494424..6f8d4b5203 100644 --- a/indra/newview/llenvironment.h +++ b/indra/newview/llenvironment.h @@ -149,14 +149,14 @@ public: bool canEdit() const; bool isExtendedEnvironmentEnabled() const; bool isInventoryEnabled() const; - bool canAgentUpdateParcelEnvironment(bool useselected = false) const; + bool canAgentUpdateParcelEnvironment(bool useselected = true) const; bool canAgentUpdateRegionEnvironment() const; LLSettingsDay::ptr_t getCurrentDay() const { return mCurrentEnvironment->getDayCycle(); } LLSettingsSky::ptr_t getCurrentSky() const { return mCurrentEnvironment->getSky(); } LLSettingsWater::ptr_t getCurrentWater() const { return mCurrentEnvironment->getWater(); } - static void getAtmosphericModelSettings(AtmosphericModelSettings& settingsOut, const LLSettingsSky::ptr_t &psky); + static void getAtmosphericModelSettings(AtmosphericModelSettings& settingsOut, const LLSettingsSky::ptr_t &psky); void update(const LLViewerCamera * cam); diff --git a/indra/newview/llfloatermyenvironment.cpp b/indra/newview/llfloatermyenvironment.cpp index 4863e4c471..a42a356c49 100644 --- a/indra/newview/llfloatermyenvironment.cpp +++ b/indra/newview/llfloatermyenvironment.cpp @@ -48,6 +48,8 @@ #include "llviewercontrol.h" #include "llfloaterperms.h" #include "llenvironment.h" +#include "llparcel.h" +#include "llviewerparcelmgr.h" //========================================================================= namespace @@ -61,6 +63,23 @@ namespace const std::string BUTTON_GEAR("btn_newsettings"); const std::string BUTTON_DELETE("btn_del"); + + const std::string ACTION_DOCREATE("MyEnvironments.DoCreate"); + const std::string ACTION_DOEDIT("MyEnvironments.DoEdit"); + const std::string ACTION_DOAPPLY("MyEnvironments.DoApply"); + const std::string ACTION_COPYPASTE("MyEnvironments.CopyPaste"); + const std::string ENABLE_ACTION("MyEnvironments.EnableAction"); + const std::string ENABLE_CANAPPLY("MyEnvironments.CanApply"); + const std::string ENABLE_ENVIRONMENT("MyEnvironments.EnvironmentEnabled"); + + const std::string PARAMETER_REGION("region"); + const std::string PARAMETER_PARCEL("parcel"); + const std::string PARAMETER_LOCAL("local"); + + const std::string PARAMETER_EDIT("edit"); + const std::string PARAMETER_COPY("copy"); + const std::string PARAMETER_PASTE("paste"); + const std::string PARAMETER_COPYUUID("copy_uuid"); } //========================================================================= @@ -137,21 +156,15 @@ LLFloaterMyEnvironment::LLFloaterMyEnvironment(const LLSD& key) : mTypeFilter((0x01 << static_cast(LLSettingsType::ST_DAYCYCLE)) | (0x01 << static_cast(LLSettingsType::ST_SKY)) | (0x01 << static_cast(LLSettingsType::ST_WATER))), mSelectedAsset() { - mCommitCallbackRegistrar.add("MyEnvironments.DoCreate", [this](LLUICtrl *, const LLSD &userdata) { onDoCreate(userdata); }); - - mEnableCallbackRegistrar.add("MyEnvironments.EnvironmentEnabled", [](LLUICtrl *, const LLSD &) { return LLEnvironment::instance().isInventoryEnabled(); }); - -#if 0 - mObserver = new LLFloaterGestureObserver(this); - LLGestureMgr::instance().addObserver(mObserver); + mCommitCallbackRegistrar.add(ACTION_DOCREATE, [this](LLUICtrl *, const LLSD &userdata) { onDoCreate(userdata); }); + mCommitCallbackRegistrar.add(ACTION_DOEDIT, [this](LLUICtrl *, const LLSD &userdata) {}); + mCommitCallbackRegistrar.add(ACTION_DOAPPLY, [this](LLUICtrl *, const LLSD &userdata) { onDoApply(userdata.asString()); }); + mCommitCallbackRegistrar.add(ACTION_COPYPASTE, [this](LLUICtrl *, const LLSD &userdata) {}); - mCommitCallbackRegistrar.add("Gesture.Action.ToogleActiveState", boost::bind(&LLFloaterGesture::onActivateBtnClick, this)); - mCommitCallbackRegistrar.add("Gesture.Action.ShowPreview", boost::bind(&LLFloaterGesture::onClickEdit, this)); - mCommitCallbackRegistrar.add("Gesture.Action.CopyPaste", boost::bind(&LLFloaterGesture::onCopyPasteAction, this, _2)); - mCommitCallbackRegistrar.add("Gesture.Action.SaveToCOF", boost::bind(&LLFloaterGesture::addToCurrentOutFit, this)); + mEnableCallbackRegistrar.add(ENABLE_ACTION, [this](LLUICtrl *, const LLSD &userdata) { return canAction(userdata.asString()); }); + mEnableCallbackRegistrar.add(ENABLE_CANAPPLY, [this](LLUICtrl *, const LLSD &userdata) { return canApply(userdata.asString()); }); + mEnableCallbackRegistrar.add(ENABLE_ENVIRONMENT, [](LLUICtrl *, const LLSD &) { return LLEnvironment::instance().isInventoryEnabled(); }); - mEnableCallbackRegistrar.add("Gesture.EnableAction", boost::bind(&LLFloaterGesture::isActionEnabled, this, _2)); -#endif } LLFloaterMyEnvironment::~LLFloaterMyEnvironment() @@ -279,8 +292,6 @@ void LLFloaterMyEnvironment::onDeleteSelected() LLPointer new_item = new LLViewerInventoryItem(inv_item); new_item->setParent(trash_id); - // no need to restamp it though it's a move into trash because - // it's a brand new item already. new_item->updateParentOnServer(FALSE); gInventory.updateItem(new_item); } @@ -294,6 +305,91 @@ void LLFloaterMyEnvironment::onDoCreate(const LLSD &data) menu_create_inventory_item(mInventoryList, NULL, data); } +void LLFloaterMyEnvironment::onDoApply(const std::string &context) +{ + uuid_vec_t selected; + getSelectedIds(selected); + + if (selected.size() != 1) // Exactly one item selected. + return; + + LLUUID item_id(selected.front()); + + LLInventoryItem* itemp = gInventory.getItem(item_id); + + if (itemp && itemp->getInventoryType() == LLInventoryType::IT_SETTINGS) + { + LLUUID asset_id = itemp->getAssetUUID(); + + if (context == PARAMETER_REGION) + { + LLEnvironment::instance().updateRegion(asset_id, -1, -1); + } + else if (context == PARAMETER_PARCEL) + { + LLParcel *parcel(LLViewerParcelMgr::instance().getAgentOrSelectedParcel()); + if (!parcel) + { + LL_WARNS("ENVIRONMENT") << "Unable to determine parcel." << LL_ENDL; + return; + } + LLEnvironment::instance().updateParcel(parcel->getLocalID(), asset_id, -1, -1); + } + else if (context == PARAMETER_LOCAL) + { + LLEnvironment::instance().setEnvironment(LLEnvironment::ENV_LOCAL, asset_id); + LLEnvironment::instance().setSelectedEnvironment(LLEnvironment::ENV_LOCAL); + } + } +} + + +bool LLFloaterMyEnvironment::canAction(const std::string &context) +{ +// uuid_vec_t selected; +// getSelectedIds(selected); +// +// if (selected.empty()) +// return false; +// +// if (context == PARAMETER_EDIT) +// { +// } +// else if (context == PARAMETER_COPY) +// { +// } +// else if (context == PARAMETER_PASTE) +// { +// } +// else if (context == PARAMETER_COPYUUID) +// { +// } + + return false; +} + +bool LLFloaterMyEnvironment::canApply(const std::string &context) +{ + uuid_vec_t selected; + getSelectedIds(selected); + + if (selected.size() != 1) // Exactly one item selected. + return false; + + if (context == PARAMETER_REGION) + { + return LLEnvironment::instance().canAgentUpdateRegionEnvironment(); + } + else if (context == PARAMETER_PARCEL) + { + return LLEnvironment::instance().canAgentUpdateParcelEnvironment(); + } + else + { + return (context == PARAMETER_LOCAL); + } +} + //------------------------------------------------------------------------- void LLFloaterMyEnvironment::refreshButtonStates() { diff --git a/indra/newview/llfloatermyenvironment.h b/indra/newview/llfloatermyenvironment.h index 51a44ec1aa..9d9659576d 100644 --- a/indra/newview/llfloatermyenvironment.h +++ b/indra/newview/llfloatermyenvironment.h @@ -69,6 +69,9 @@ private: void onSelectionChange(); void onDeleteSelected(); void onDoCreate(const LLSD &data); + void onDoApply(const std::string &context); + bool canAction(const std::string &context); + bool canApply(const std::string &context); void getSelectedIds(uuid_vec_t& ids) const; void refreshButtonStates(); diff --git a/indra/newview/llinventorybridge.cpp b/indra/newview/llinventorybridge.cpp index 44a9d0bff4..85e2974c1b 100644 --- a/indra/newview/llinventorybridge.cpp +++ b/indra/newview/llinventorybridge.cpp @@ -6926,7 +6926,7 @@ void LLSettingsBridge::performAction(LLInventoryModel* model, std::string action return; LLUUID asset_id = item->getAssetUUID(); - LLParcel *parcel = LLViewerParcelMgr::instance().getAgentParcel(); + LLParcel *parcel = LLViewerParcelMgr::instance().getAgentOrSelectedParcel(); if (!parcel) { LL_WARNS("INVENTORY") << "could not identify parcel." << LL_ENDL; diff --git a/indra/newview/llpaneleditsky.h b/indra/newview/llpaneleditsky.h index 30ab22147f..7c49c839ec 100644 --- a/indra/newview/llpaneleditsky.h +++ b/indra/newview/llpaneleditsky.h @@ -62,7 +62,7 @@ public: LLPanelSettingsSkyAtmosTab(); virtual BOOL postBuild() override; - virtual void setEnabled(BOOL enabled); + virtual void setEnabled(BOOL enabled) override; protected: virtual void refresh() override; @@ -87,7 +87,7 @@ public: LLPanelSettingsSkyCloudTab(); virtual BOOL postBuild() override; - virtual void setEnabled(BOOL enabled); + void setEnabled(BOOL enabled) override; protected: virtual void refresh() override; @@ -110,7 +110,7 @@ public: LLPanelSettingsSkySunMoonTab(); virtual BOOL postBuild() override; - virtual void setEnabled(BOOL enabled); + virtual void setEnabled(BOOL enabled) override; protected: virtual void refresh() override; diff --git a/indra/newview/llpaneleditwater.h b/indra/newview/llpaneleditwater.h index 044e8e2b80..5a04f98b05 100644 --- a/indra/newview/llpaneleditwater.h +++ b/indra/newview/llpaneleditwater.h @@ -66,7 +66,7 @@ public: LLPanelSettingsWaterMainTab(); virtual BOOL postBuild() override; - virtual void setEnabled(BOOL enabled); + virtual void setEnabled(BOOL enabled) override; protected: virtual void refresh() override; diff --git a/indra/newview/llviewerparcelmgr.cpp b/indra/newview/llviewerparcelmgr.cpp index d05d11625f..ed529975d2 100644 --- a/indra/newview/llviewerparcelmgr.cpp +++ b/indra/newview/llviewerparcelmgr.cpp @@ -647,6 +647,27 @@ 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 = LLViewerParcelMgr::instance().getAgentParcel(); + + return parcel; +} + // Return whether the agent can build on the land they are on bool LLViewerParcelMgr::allowAgentBuild() const { diff --git a/indra/newview/llviewerparcelmgr.h b/indra/newview/llviewerparcelmgr.h index 29219843c9..06dae6e57e 100644 --- a/indra/newview/llviewerparcelmgr.h +++ b/indra/newview/llviewerparcelmgr.h @@ -154,6 +154,7 @@ public: //LLParcel *getParcelSelection() const; LLParcel *getAgentParcel() const; + LLParcel *getAgentOrSelectedParcel() const; BOOL inAgentParcel(const LLVector3d &pos_global) const; diff --git a/indra/newview/skins/default/xui/en/menu_settings_gear.xml b/indra/newview/skins/default/xui/en/menu_settings_gear.xml index 41fd0fce2c..1d65ff3d99 100644 --- a/indra/newview/skins/default/xui/en/menu_settings_gear.xml +++ b/indra/newview/skins/default/xui/en/menu_settings_gear.xml @@ -9,7 +9,7 @@ layout="topleft" name="edit_settings"> + function="MyEnvironments.DoEdit" /> @@ -33,7 +33,7 @@ function="MyEnvironments.DoApply" parameter="parcel" /> Date: Fri, 3 Aug 2018 16:13:22 -0700 Subject: MAINT-7699: More robust cap protocol, better support for delete and support for individual tracks, support for setting environment by asset id in the cap MAINT-7703: Initial flags sent in message protocol for parcels --- indra/llinventory/llparcel.cpp | 3 + indra/llinventory/llparcel.h | 9 ++ indra/llinventory/llsettingsbase.cpp | 1 - indra/llmessage/message_prehash.cpp | 4 +- indra/llmessage/message_prehash.h | 3 + indra/newview/llenvironment.cpp | 183 ++++++++++++++++++----------- indra/newview/llenvironment.h | 44 ++++--- indra/newview/llsettingsvo.cpp | 2 +- indra/newview/llviewerparcelmgr.cpp | 58 ++++----- scripts/messages/message_template.msg | 5 + scripts/messages/message_template.msg.sha1 | 2 +- 11 files changed, 186 insertions(+), 128 deletions(-) (limited to 'indra/newview/llviewerparcelmgr.cpp') diff --git a/indra/llinventory/llparcel.cpp b/indra/llinventory/llparcel.cpp index 0908613c10..aff7f86fd4 100644 --- a/indra/llinventory/llparcel.cpp +++ b/indra/llinventory/llparcel.cpp @@ -231,6 +231,9 @@ void LLParcel::init(const LLUUID &owner_id, setAllowGroupAVSounds(TRUE); setAllowAnyAVSounds(TRUE); setHaveNewParcelLimitData(FALSE); + + setRegionAllowEnvironmentOverride(FALSE); + setParcelEnvironmentVersion(-1); } void LLParcel::overrideOwner(const LLUUID& owner_id, BOOL is_group_owned) diff --git a/indra/llinventory/llparcel.h b/indra/llinventory/llparcel.h index 6ef389d246..2497a069d7 100644 --- a/indra/llinventory/llparcel.h +++ b/indra/llinventory/llparcel.h @@ -511,6 +511,10 @@ public: { return mRegionDenyAgeUnverifiedOverride; } BOOL getRegionAllowAccessOverride() const { return mRegionAllowAccessoverride; } + BOOL getRegionAllowEnvironmentOverride() const + { return mRegionAllowEnvironmentOverride; } + S32 getParcelEnvironmentVersion() const + { return mCurrentEnvironmentVersion; } BOOL getAllowGroupAVSounds() const { return mAllowGroupAVSounds; } @@ -581,6 +585,9 @@ public: void setRegionDenyAnonymousOverride(BOOL override) { mRegionDenyAnonymousOverride = override; } void setRegionDenyAgeUnverifiedOverride(BOOL override) { mRegionDenyAgeUnverifiedOverride = override; } void setRegionAllowAccessOverride(BOOL override) { mRegionAllowAccessoverride = override; } + void setRegionAllowEnvironmentOverride(BOOL override) { mRegionAllowEnvironmentOverride = override; } + + void setParcelEnvironmentVersion(S32 version) { mCurrentEnvironmentVersion = version; } // Accessors for parcel sellWithObjects void setPreviousOwnerID(LLUUID prev_owner) { mPreviousOwnerID = prev_owner; } @@ -662,8 +669,10 @@ protected: BOOL mRegionDenyAnonymousOverride; BOOL mRegionDenyAgeUnverifiedOverride; BOOL mRegionAllowAccessoverride; + BOOL mRegionAllowEnvironmentOverride; BOOL mAllowGroupAVSounds; BOOL mAllowAnyAVSounds; + S32 mCurrentEnvironmentVersion; bool mIsDefaultDayCycle; diff --git a/indra/llinventory/llsettingsbase.cpp b/indra/llinventory/llsettingsbase.cpp index 8bcf8a4973..e00dd2199c 100644 --- a/indra/llinventory/llsettingsbase.cpp +++ b/indra/llinventory/llsettingsbase.cpp @@ -300,7 +300,6 @@ bool LLSettingsBase::validate() { LL_WARNS("SETTINGS") << "Validation warnings: " << result["warnings"] << LL_ENDL; } - LL_WARNS("SETTINGS") << "Validation success is " << result["success"] << LL_ENDL; return result["success"].asBoolean(); } diff --git a/indra/llmessage/message_prehash.cpp b/indra/llmessage/message_prehash.cpp index 1ae8a6ac15..6e5923862b 100644 --- a/indra/llmessage/message_prehash.cpp +++ b/indra/llmessage/message_prehash.cpp @@ -1375,7 +1375,9 @@ char const* const _PREHASH_RegionDenyAgeUnverified = LLMessageStringTable::getIn char const* const _PREHASH_AgeVerificationBlock = LLMessageStringTable::getInstance()->getString("AgeVerificationBlock"); char const* const _PREHASH_RegionAllowAccessBlock = LLMessageStringTable::getInstance()->getString("RegionAllowAccessBlock"); char const* const _PREHASH_RegionAllowAccessOverride = LLMessageStringTable::getInstance()->getString("RegionAllowAccessOverride"); - +char const* const _PREHASH_ParcelEnvironmentBlock = LLMessageStringTable::getInstance()->getString("ParcelEnvironmentBlock"); +char const* const _PREHASH_ParcelEnvironmentVersion = LLMessageStringTable::getInstance()->getString("ParcelEnvironmentVersion"); +char const* const _PREHASH_RegionAllowEnvironmentOverride = LLMessageStringTable::getInstance()->getString("RegionAllowEnvironmentOverride"); char const* const _PREHASH_UCoord = LLMessageStringTable::getInstance()->getString("UCoord"); char const* const _PREHASH_VCoord = LLMessageStringTable::getInstance()->getString("VCoord"); char const* const _PREHASH_FaceIndex = LLMessageStringTable::getInstance()->getString("FaceIndex"); diff --git a/indra/llmessage/message_prehash.h b/indra/llmessage/message_prehash.h index 7910fde305..30763d426e 100644 --- a/indra/llmessage/message_prehash.h +++ b/indra/llmessage/message_prehash.h @@ -1375,6 +1375,9 @@ extern char const* const _PREHASH_RegionDenyAgeUnverified; extern char const* const _PREHASH_AgeVerificationBlock; extern char const* const _PREHASH_RegionAllowAccessBlock; extern char const* const _PREHASH_RegionAllowAccessOverride; +extern char const* const _PREHASH_ParcelEnvironmentBlock; +extern char const* const _PREHASH_ParcelEnvironmentVersion; +extern char const* const _PREHASH_RegionAllowEnvironmentOverride; extern char const* const _PREHASH_UCoord; extern char const* const _PREHASH_VCoord; extern char const* const _PREHASH_FaceIndex; diff --git a/indra/newview/llenvironment.cpp b/indra/newview/llenvironment.cpp index f4dedbc848..3bcdf345f1 100644 --- a/indra/newview/llenvironment.cpp +++ b/indra/newview/llenvironment.cpp @@ -61,6 +61,18 @@ //========================================================================= namespace { + const std::string KEY_ENVIRONMENT("environment"); + const std::string KEY_DAYASSET("day_asset"); + const std::string KEY_DAYCYCLE("day_cycle"); + const std::string KEY_DAYHASH("day_hash"); + const std::string KEY_DAYLENGTH("day_length"); + const std::string KEY_DAYOFFSET("day_offset"); + const std::string KEY_ISDEFAULT("is_default"); + const std::string KEY_PARCELID("parcel_id"); + const std::string KEY_REGIONID("region_id"); + const std::string KEY_TRACKALTS("track_altitudes"); + + //--------------------------------------------------------------------- LLTrace::BlockTimerStatHandle FTM_ENVIRONMENT_UPDATE("Update Environment Tick"); LLTrace::BlockTimerStatHandle FTM_SHADER_PARAM_UPDATE("Update Shader Parameters"); @@ -254,6 +266,8 @@ const LLUUID LLEnvironment::KNOWN_SKY_MIDDAY("07589e0e-8e2e-4864-8e58-07b516efd9 const LLUUID LLEnvironment::KNOWN_SKY_SUNSET("8113ba47-3223-46ba-bae6-12c875091b32"); const LLUUID LLEnvironment::KNOWN_SKY_MIDNIGHT("90187088-d7f3-4656-8c27-8ba0e19e21e9"); +const S32 LLEnvironment::NO_TRACK(-1); + const F32 LLEnvironment::SUN_DELTA_YAW(F_PI); // 180deg //------------------------------------------------------------------------- @@ -269,6 +283,7 @@ LLEnvironment::LLEnvironment(): { } +#pragma optimize ("", off) void LLEnvironment::initSingleton() { LLSettingsSky::ptr_t p_default_sky = LLSettingsVOSky::buildDefaultSky(); @@ -280,16 +295,17 @@ void LLEnvironment::initSingleton() mEnvironments[ENV_DEFAULT] = mCurrentEnvironment; - requestRegionEnvironment(); + requestRegion(); - LLRegionInfoModel::instance().setUpdateCallback([this]() { onParcelChange(); }); gAgent.addParcelChangedCallback([this]() { onParcelChange(); }); //TODO: This frequently results in one more request than we need. It isn't breaking, but should be nicer. - gAgent.addRegionChangedCallback([this]() { requestRegionEnvironment(); }); + LLRegionInfoModel::instance().setUpdateCallback([this]() { requestRegion(); }); + gAgent.addRegionChangedCallback([this]() { requestRegion(); }); gAgent.whenPositionChanged([this](const LLVector3 &localpos, const LLVector3d &) { onAgentPositionHasChanged(localpos); }); } +#pragma optimize ("", on) LLEnvironment::~LLEnvironment() { @@ -391,6 +407,7 @@ bool LLEnvironment::isInventoryEnabled() const !gAgent.getRegionCapability("UpdateSettingsTaskInventory").empty()); } +#pragma optimize ("", off) void LLEnvironment::onParcelChange() { S32 parcel_id(INVALID_PARCEL_ID); @@ -403,11 +420,7 @@ void LLEnvironment::onParcelChange() requestParcel(parcel_id); } - -void LLEnvironment::requestRegionEnvironment() -{ - requestRegion(); -} +#pragma optimize ("", on) void LLEnvironment::onLegacyRegionSettings(LLSD data) { @@ -950,22 +963,10 @@ void LLEnvironment::updateShaderUniforms(LLGLSLShader *shader) void LLEnvironment::recordEnvironment(S32 parcel_id, LLEnvironment::EnvironmentInfo::ptr_t envinfo) { - LL_WARNS("ENVIRONMENT") << "Have environment" << LL_ENDL; - - LLSettingsDay::ptr_t pday = LLSettingsVODay::buildFromEnvironmentMessage(envinfo->mDaycycleData); - - LL_WARNS("ENVIRONMENT") << "serverhash=" << envinfo->mDayHash << " viewerhash=" << pday->getHash() << LL_ENDL; - if (envinfo->mParcelId == INVALID_PARCEL_ID) { // the returned info applies to an entire region. LL_WARNS("LAPRAS") << "Setting Region environment" << LL_ENDL; - setEnvironment(ENV_REGION, pday, envinfo->mDayLength, envinfo->mDayOffset); - if (parcel_id != INVALID_PARCEL_ID) - { - LL_WARNS("LAPRAS") << "Had requested parcel environment #" << parcel_id << " but got region." << LL_ENDL; - clearEnvironment(ENV_PARCEL); - } - + setEnvironment(ENV_REGION, envinfo->mDayCycle, envinfo->mDayLength, envinfo->mDayOffset); mTrackAltitudes = envinfo->mAltitudes; LL_WARNS("LAPRAS") << "Altitudes set to {" << mTrackAltitudes[0] << ", "<< mTrackAltitudes[1] << ", " << mTrackAltitudes[2] << ", " << mTrackAltitudes[3] << LL_ENDL; @@ -973,7 +974,6 @@ void LLEnvironment::recordEnvironment(S32 parcel_id, LLEnvironment::EnvironmentI else { LLParcel *parcel = LLViewerParcelMgr::instance().getAgentParcel(); - LL_WARNS("LAPRAS") << "Have parcel environment #" << envinfo->mParcelId << LL_ENDL; if (parcel && (parcel->getLocalID() != parcel_id)) { @@ -981,23 +981,33 @@ void LLEnvironment::recordEnvironment(S32 parcel_id, LLEnvironment::EnvironmentI return; } - setEnvironment(ENV_PARCEL, pday, envinfo->mDayLength, envinfo->mDayOffset); + if (!envinfo->mDayCycle) + { + LL_WARNS("LAPRAS") << "Clearing environment on parcel #" << parcel_id << LL_ENDL; + clearEnvironment(ENV_PARCEL); + } + else + { + setEnvironment(ENV_PARCEL, envinfo->mDayCycle, envinfo->mDayLength, envinfo->mDayOffset); + } } updateEnvironment(); } //========================================================================= +#pragma optimize ("", off) void LLEnvironment::requestRegion() { if (!isExtendedEnvironmentEnabled()) - { + { /*TODO: When EEP is live on the entire grid, this can go away. */ LLEnvironmentRequest::initiate(); return; } requestParcel(INVALID_PARCEL_ID); } +#pragma optimize ("", on) void LLEnvironment::updateRegion(const LLSettingsDay::ptr_t &pday, S32 day_length, S32 day_offset) { @@ -1048,8 +1058,14 @@ void LLEnvironment::requestParcel(S32 parcel_id) void LLEnvironment::updateParcel(S32 parcel_id, const LLUUID &asset_id, S32 day_length, S32 day_offset) { - LLSettingsVOBase::getSettingsAsset(asset_id, - [this, parcel_id, day_length, day_offset](LLUUID asset_id, LLSettingsBase::ptr_t settings, S32 status, LLExtStat) { onUpdateParcelAssetLoaded(asset_id, settings, status, parcel_id, day_length, day_offset); }); + std::string coroname = + LLCoros::instance().launch("LLEnvironment::coroUpdateEnvironment", + [this, parcel_id, asset_id, day_length, day_offset]() { coroUpdateEnvironment(parcel_id, NO_TRACK, + LLSettingsDay::ptr_t(), asset_id, day_length, day_offset, environment_apply_fn()); }); +// [this](S32 pid, EnvironmentInfo::ptr_t envinfo) { recordEnvironment(pid, envinfo); }); }); + +// LLSettingsVOBase::getSettingsAsset(asset_id, +// [this, parcel_id, day_length, day_offset](LLUUID asset_id, LLSettingsBase::ptr_t settings, S32 status, LLExtStat) { onUpdateParcelAssetLoaded(asset_id, settings, status, parcel_id, day_length, day_offset); }); } void LLEnvironment::onUpdateParcelAssetLoaded(LLUUID asset_id, LLSettingsBase::ptr_t settings, S32 status, S32 parcel_id, S32 day_length, S32 day_offset) @@ -1096,17 +1112,19 @@ void LLEnvironment::updateParcel(S32 parcel_id, const LLSettingsDay::ptr_t &pday { std::string coroname = LLCoros::instance().launch("LLEnvironment::coroUpdateEnvironment", - boost::bind(&LLEnvironment::coroUpdateEnvironment, this, parcel_id, - pday, day_length, day_offset, - [this](S32 pid, EnvironmentInfo::ptr_t envinfo) { recordEnvironment(pid, envinfo); })); + [this, parcel_id, pday, day_length, day_offset]() { coroUpdateEnvironment(parcel_id, NO_TRACK, + pday, LLUUID::null, day_length, day_offset, environment_apply_fn()); }); +// [this](S32 pid, EnvironmentInfo::ptr_t envinfo) { recordEnvironment(pid, envinfo); }); }); } + + void LLEnvironment::resetParcel(S32 parcel_id) { std::string coroname = LLCoros::instance().launch("LLEnvironment::coroResetEnvironment", - boost::bind(&LLEnvironment::coroResetEnvironment, this, parcel_id, - [this](S32 pid, EnvironmentInfo::ptr_t envinfo) { recordEnvironment(pid, envinfo); })); + [this, parcel_id]() { coroResetEnvironment(parcel_id, NO_TRACK, environment_apply_fn()); }); +// [this](S32 pid, EnvironmentInfo::ptr_t envinfo) { recordEnvironment(pid, envinfo); }); }); } void LLEnvironment::coroRequestEnvironment(S32 parcel_id, LLEnvironment::environment_apply_fn apply) @@ -1151,7 +1169,7 @@ void LLEnvironment::coroRequestEnvironment(S32 parcel_id, LLEnvironment::environ } else { - LLSD environment = result["environment"]; + LLSD environment = result[KEY_ENVIRONMENT]; if (environment.isDefined() && apply) { EnvironmentInfo::ptr_t envinfo = LLEnvironment::EnvironmentInfo::extract(environment); @@ -1166,7 +1184,7 @@ void LLEnvironment::coroRequestEnvironment(S32 parcel_id, LLEnvironment::environ } } -void LLEnvironment::coroUpdateEnvironment(S32 parcel_id, LLSettingsDay::ptr_t pday, S32 day_length, S32 day_offset, LLEnvironment::environment_apply_fn apply) +void LLEnvironment::coroUpdateEnvironment(S32 parcel_id, S32 track_no, LLSettingsDay::ptr_t pday, LLUUID settings_asset, S32 day_length, S32 day_offset, LLEnvironment::environment_apply_fn apply) { LLCore::HttpRequest::policy_t httpPolicy(LLCore::HttpRequest::DEFAULT_POLICY_ID); LLCoreHttpUtil::HttpCoroutineAdapter::ptr_t @@ -1192,22 +1210,39 @@ void LLEnvironment::coroUpdateEnvironment(S32 parcel_id, LLSettingsDay::ptr_t pd } LLSD body(LLSD::emptyMap()); - body["environment"] = LLSD::emptyMap(); + body[KEY_ENVIRONMENT] = LLSD::emptyMap(); - if (day_length >= 0) - body["environment"]["day_length"] = day_length; - if (day_offset >= 0) - body["environment"]["day_offset"] = day_offset; + if (track_no == NO_TRACK) + { // day length and offset are only applicable if we are addressing the entire day cycle. + if (day_length >= 0) + body[KEY_ENVIRONMENT][KEY_DAYLENGTH] = day_length; + if (day_offset >= 0) + body[KEY_ENVIRONMENT][KEY_DAYOFFSET] = day_offset; + } if (pday) - body["environment"]["day_cycle"] = pday->getSettings(); + body[KEY_ENVIRONMENT][KEY_DAYCYCLE] = pday->getSettings(); + else if (!settings_asset.isNull()) + body[KEY_ENVIRONMENT][KEY_DAYASSET] = settings_asset; + LL_WARNS("LAPRAS") << "Body = " << body << LL_ENDL; - if (parcel_id != INVALID_PARCEL_ID) + if ((parcel_id != INVALID_PARCEL_ID) || (track_no != NO_TRACK)) { std::stringstream query; + query << "?"; - query << "?parcelid=" << parcel_id; + if (parcel_id != INVALID_PARCEL_ID) + { + query << "parcelid=" << parcel_id; + + if (track_no != NO_TRACK) + query << "&"; + } + if (track_no != NO_TRACK) + { + query << "trackno=" << track_no; + } url += query.str(); } @@ -1228,7 +1263,7 @@ void LLEnvironment::coroUpdateEnvironment(S32 parcel_id, LLSettingsDay::ptr_t pd } else { - LLSD environment = result["environment"]; + LLSD environment = result[KEY_ENVIRONMENT]; if (environment.isDefined() && apply) { EnvironmentInfo::ptr_t envinfo = LLEnvironment::EnvironmentInfo::extract(environment); @@ -1243,7 +1278,7 @@ void LLEnvironment::coroUpdateEnvironment(S32 parcel_id, LLSettingsDay::ptr_t pd } } -void LLEnvironment::coroResetEnvironment(S32 parcel_id, environment_apply_fn apply) +void LLEnvironment::coroResetEnvironment(S32 parcel_id, S32 track_no, environment_apply_fn apply) { LLCore::HttpRequest::policy_t httpPolicy(LLCore::HttpRequest::DEFAULT_POLICY_ID); LLCoreHttpUtil::HttpCoroutineAdapter::ptr_t @@ -1254,11 +1289,22 @@ void LLEnvironment::coroResetEnvironment(S32 parcel_id, environment_apply_fn app if (url.empty()) return; - if (parcel_id != INVALID_PARCEL_ID) + if ((parcel_id != INVALID_PARCEL_ID) || (track_no != NO_TRACK)) { std::stringstream query; + query << "?"; - query << "?parcelid=" << parcel_id; + if (parcel_id != INVALID_PARCEL_ID) + { + query << "parcelid=" << parcel_id; + + if (track_no != NO_TRACK) + query << "&"; + } + if (track_no != NO_TRACK) + { + query << "trackno=" << track_no; + } url += query.str(); } @@ -1279,7 +1325,7 @@ void LLEnvironment::coroResetEnvironment(S32 parcel_id, environment_apply_fn app } else { - LLSD environment = result["environment"]; + LLSD environment = result[KEY_ENVIRONMENT]; if (environment.isDefined() && apply) { EnvironmentInfo::ptr_t envinfo = LLEnvironment::EnvironmentInfo::extract(environment); @@ -1339,10 +1385,9 @@ LLEnvironment::EnvironmentInfo::EnvironmentInfo(): mDayLength(0), mDayOffset(0), mDayHash(0), - mDaycycleData(), + mDayCycle(), mAltitudes({ { 0.0, 0.0, 0.0, 0.0 } }), - mIsDefault(false), - mIsRegion(false) + mIsDefault(false) { } @@ -1350,32 +1395,28 @@ LLEnvironment::EnvironmentInfo::ptr_t LLEnvironment::EnvironmentInfo::extract(LL { ptr_t pinfo = std::make_shared(); - if (environment.has("parcel_id")) - pinfo->mParcelId = environment["parcel_id"].asInteger(); - if (environment.has("region_id")) - pinfo->mRegionId = environment["region_id"].asUUID(); - if (environment.has("day_length")) - pinfo->mDayLength = LLSettingsDay::Seconds(environment["day_length"].asInteger()); - if (environment.has("day_offset")) - pinfo->mDayOffset = LLSettingsDay::Seconds(environment["day_offset"].asInteger()); - if (environment.has("day_hash")) - pinfo->mDayHash = environment["day_hash"].asInteger(); - if (environment.has("day_cycle")) - pinfo->mDaycycleData = environment["day_cycle"]; - if (environment.has("is_default")) - pinfo->mIsDefault = environment["is_default"].asBoolean(); - if (environment.has("track_altitudes")) - { - LL_WARNS("LAPRAS") << "track_altitudes=" << environment["track_altitudes"] << LL_ENDL; - - /*LAPRAS: TODO: Fix the simulator message. Shouldn't be 5, just 4*/ - int idx = 1; - for (F32 &altitude : pinfo->mAltitudes) + pinfo->mIsDefault = environment.has(KEY_ISDEFAULT) ? environment[KEY_ISDEFAULT].asBoolean() : true; + pinfo->mParcelId = environment.has(KEY_PARCELID) ? environment[KEY_PARCELID].asInteger() : INVALID_PARCEL_ID; + pinfo->mRegionId = environment.has(KEY_REGIONID) ? environment[KEY_REGIONID].asUUID() : LLUUID::null; + + if (environment.has(KEY_TRACKALTS)) + { + for (int idx = 0; idx < 3; idx++) { - altitude = environment["track_altitudes"][idx++].asReal(); + pinfo->mAltitudes[idx+1] = environment[KEY_TRACKALTS][idx].asReal(); } + pinfo->mAltitudes[0] = 0; + } + + if (environment.has(KEY_DAYCYCLE)) + { + pinfo->mDayCycle = LLSettingsVODay::buildFromEnvironmentMessage(environment[KEY_DAYCYCLE]); + pinfo->mDayLength = LLSettingsDay::Seconds(environment.has(KEY_DAYLENGTH) ? environment[KEY_DAYLENGTH].asInteger() : -1); + pinfo->mDayOffset = LLSettingsDay::Seconds(environment.has(KEY_DAYOFFSET) ? environment[KEY_DAYOFFSET].asInteger() : -1); + pinfo->mDayHash = environment.has(KEY_DAYHASH) ? environment[KEY_DAYHASH].asInteger() : 0; } + return pinfo; } diff --git a/indra/newview/llenvironment.h b/indra/newview/llenvironment.h index 6f8d4b5203..80d186c9e6 100644 --- a/indra/newview/llenvironment.h +++ b/indra/newview/llenvironment.h @@ -65,25 +65,24 @@ public: static const LLUUID KNOWN_SKY_SUNSET; static const LLUUID KNOWN_SKY_MIDNIGHT; + static const S32 NO_TRACK; + struct EnvironmentInfo { EnvironmentInfo(); typedef std::shared_ptr ptr_t; - S32 mParcelId; - LLUUID mRegionId; - S64Seconds mDayLength; - S64Seconds mDayOffset; - size_t mDayHash; - LLSD mDaycycleData; - std::array mAltitudes; - bool mIsDefault; - bool mIsRegion; - - - static ptr_t extract(LLSD); + S32 mParcelId; + LLUUID mRegionId; + S64Seconds mDayLength; + S64Seconds mDayOffset; + size_t mDayHash; + LLSettingsDay::ptr_t mDayCycle; + std::array mAltitudes; + bool mIsDefault; + static ptr_t extract(LLSD); }; enum EnvSelection_t @@ -226,8 +225,6 @@ public: //------------------------------------------- connection_t setEnvironmentChanged(environment_changed_fn cb); - void requestRegionEnvironment(); - void onLegacyRegionSettings(LLSD data); void requestRegion(); @@ -359,21 +356,20 @@ private: DayInstance::ptr_t getSelectedEnvironmentInstance(); - void updateCloudScroll(); - - void onParcelChange(); + void updateCloudScroll(); - void coroRequestEnvironment(S32 parcel_id, environment_apply_fn apply); - void coroUpdateEnvironment(S32 parcel_id, LLSettingsDay::ptr_t pday, S32 day_length, S32 day_offset, environment_apply_fn apply); - void coroResetEnvironment(S32 parcel_id, environment_apply_fn apply); + void onParcelChange(); - void recordEnvironment(S32 parcel_id, EnvironmentInfo::ptr_t environment); + void coroRequestEnvironment(S32 parcel_id, environment_apply_fn apply); + void coroUpdateEnvironment(S32 parcel_id, S32 track_no, LLSettingsDay::ptr_t pday, LLUUID settings_asset, S32 day_length, S32 day_offset, environment_apply_fn apply); + void coroResetEnvironment(S32 parcel_id, S32 track_no, environment_apply_fn apply); - void onAgentPositionHasChanged(const LLVector3 &localpos); + void recordEnvironment(S32 parcel_id, EnvironmentInfo::ptr_t environment); - void onSetEnvAssetLoaded(EnvSelection_t env, LLUUID asset_id, LLSettingsBase::ptr_t settings, S32 status); - void onUpdateParcelAssetLoaded(LLUUID asset_id, LLSettingsBase::ptr_t settings, S32 status, S32 parcel_id, S32 day_length, S32 day_offset); + void onAgentPositionHasChanged(const LLVector3 &localpos); + void onSetEnvAssetLoaded(EnvSelection_t env, LLUUID asset_id, LLSettingsBase::ptr_t settings, S32 status); + void onUpdateParcelAssetLoaded(LLUUID asset_id, LLSettingsBase::ptr_t settings, S32 status, S32 parcel_id, S32 day_length, S32 day_offset); }; diff --git a/indra/newview/llsettingsvo.cpp b/indra/newview/llsettingsvo.cpp index 010b5dec36..e464f3f8ef 100644 --- a/indra/newview/llsettingsvo.cpp +++ b/indra/newview/llsettingsvo.cpp @@ -269,7 +269,7 @@ void LLSettingsVOBase::onAssetDownloadComplete(LLVFS *vfs, const LLUUID &asset_i if (!settings) { status = 1; - LL_WARNS("SETTINGS") << "Unable to creat settings object." << LL_ENDL; + LL_WARNS("SETTINGS") << "Unable to create settings object." << LL_ENDL; } else { diff --git a/indra/newview/llviewerparcelmgr.cpp b/indra/newview/llviewerparcelmgr.cpp index ed529975d2..d263e15a10 100644 --- a/indra/newview/llviewerparcelmgr.cpp +++ b/indra/newview/llviewerparcelmgr.cpp @@ -1483,6 +1483,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; @@ -1573,6 +1575,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 ); // Actually extract the data. @@ -1590,6 +1598,8 @@ void LLViewerParcelMgr::processParcelProperties(LLMessageSystem *msg, void **use } } + bool environment_changed = (parcel->getParcelEnvironmentVersion() != parcel_environment_version); + parcel->init(owner_id, FALSE, FALSE, FALSE, claim_date, claim_price_per_meter, rent_price_per_meter, @@ -1615,6 +1625,10 @@ 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(parcel_environment_version); + parcel->setRegionAllowEnvironmentOverride(region_allow_environment_override); + parcel->unpackMessage(msg); if (parcel == parcel_mgr.mAgentParcel) @@ -1632,9 +1646,6 @@ void LLViewerParcelMgr::processParcelProperties(LLMessageSystem *msg, void **use // Let interesting parties know about agent parcel change. LLViewerParcelMgr* instance = LLViewerParcelMgr::getInstance(); - // Notify anything that wants to know when the agent changes parcels - gAgent.changeParcels(); - if (instance->mTeleportInProgress) { instance->mTeleportInProgress = FALSE; @@ -1648,12 +1659,21 @@ 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); - } + + LL_WARNS("LAPRAS") << "Parcel environment version is " << parcel->getParcelEnvironmentVersion() << LL_ENDL; + // Notify anything that wants to know when the agent changes parcels + gAgent.changeParcels(); + } + else if (agent_parcel_update) + { + // updated agent parcel + parcel_mgr.mAgentParcel->unpackMessage(msg); + if ((LLEnvironment::instance().isExtendedEnvironmentEnabled() && environment_changed)) + { + LL_WARNS("LAPRAS") << "Parcel environment version is " << parcel->getParcelEnvironmentVersion() << LL_ENDL; + LLEnvironment::instance().requestParcel(local_id); + } + } } // Handle updating selections, if necessary. @@ -1835,26 +1855,6 @@ void LLViewerParcelMgr::processParcelProperties(LLMessageSystem *msg, void **use }//if gAudiop }; - if (LLEnvironment::instance().isExtendedEnvironmentEnabled()) - { - LL_WARNS("LAPRAS") << "TODO: Hey Rider! Fix this. 1) don't rerequest parcel information. 2) if sequent_id == -1 we are selecting a parcel. Deal with that correctly." << LL_ENDL; - - if (sequence_id == SELECTED_PARCEL_SEQ_ID) - { - LL_WARNS("LAPRAS") << "TODO: Hay Rider! Fix this. Get environment for selected parcel." << LL_ENDL; - } - else if ((sequence_id == HOVERED_PARCEL_SEQ_ID) || - (sequence_id == COLLISION_NOT_IN_GROUP_PARCEL_SEQ_ID) || - (sequence_id == COLLISION_NOT_ON_LIST_PARCEL_SEQ_ID) || - (sequence_id == COLLISION_BANNED_PARCEL_SEQ_ID)) - { - /*NoOp*/ - } - else - { - LLEnvironment::instance().requestParcel(local_id); - } - } } void LLViewerParcelMgr::optionally_start_music(const std::string& music_url) diff --git a/scripts/messages/message_template.msg b/scripts/messages/message_template.msg index c56eaae6fe..01397181e4 100755 --- a/scripts/messages/message_template.msg +++ b/scripts/messages/message_template.msg @@ -4503,6 +4503,11 @@ version 2.0 RegionAllowAccessBlock Single { RegionAllowAccessOverride BOOL } } + { + ParcelEnvironmentBlock Single + { ParcelEnvironmentVersion S32 } + { RegionAllowEnvironmentOverride BOOL } + } } // ParcelPropertiesUpdate diff --git a/scripts/messages/message_template.msg.sha1 b/scripts/messages/message_template.msg.sha1 index 5bc06ec042..ae8937f461 100755 --- a/scripts/messages/message_template.msg.sha1 +++ b/scripts/messages/message_template.msg.sha1 @@ -1 +1 @@ -337f351910b0c8821cb3d447bc6578516a043c80 \ No newline at end of file +4c5ec7187d1af05b52b5c1bbac68d46fbc65da05 \ No newline at end of file -- cgit v1.3 From bb52cdf4f0104cb61c537041fc9574167fdf98eb Mon Sep 17 00:00:00 2001 From: andreykproductengine Date: Thu, 13 Sep 2018 18:36:47 +0300 Subject: SL-1307 EEP At startup viewer does not recognize what parcel you are on. --- indra/newview/llviewerparcelmgr.cpp | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'indra/newview/llviewerparcelmgr.cpp') diff --git a/indra/newview/llviewerparcelmgr.cpp b/indra/newview/llviewerparcelmgr.cpp index d263e15a10..3ad78efd41 100644 --- a/indra/newview/llviewerparcelmgr.cpp +++ b/indra/newview/llviewerparcelmgr.cpp @@ -659,6 +659,10 @@ LLParcel * LLViewerParcelMgr::getAgentOrSelectedParcel() const if (selection) { parcel = selection->getParcel(); + if (parcel->getLocalID() == INVALID_PARCEL_ID) + { + parcel = NULL; + } } } -- cgit v1.3 From d1f746ff7ff251f1fdf6c8a8eeb1b350cad8750e Mon Sep 17 00:00:00 2001 From: maxim_productengine Date: Fri, 14 Sep 2018 15:47:52 +0300 Subject: SL-9656 FIXED EEP viewer crash after opening About Land and then right-clicking a Day Cycle in Inventory --- indra/newview/llviewerparcelmgr.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'indra/newview/llviewerparcelmgr.cpp') diff --git a/indra/newview/llviewerparcelmgr.cpp b/indra/newview/llviewerparcelmgr.cpp index 3ad78efd41..5a393220c3 100644 --- a/indra/newview/llviewerparcelmgr.cpp +++ b/indra/newview/llviewerparcelmgr.cpp @@ -659,7 +659,7 @@ LLParcel * LLViewerParcelMgr::getAgentOrSelectedParcel() const if (selection) { parcel = selection->getParcel(); - if (parcel->getLocalID() == INVALID_PARCEL_ID) + if (parcel && (parcel->getLocalID() == INVALID_PARCEL_ID)) { parcel = NULL; } -- cgit v1.3 From cae08e0096f75827851a8c9447e163ddb0132f2d Mon Sep 17 00:00:00 2001 From: Rider Linden Date: Wed, 19 Sep 2018 15:31:23 -0700 Subject: SL-9661: Trigger an event when the settings on a parcel or region are changed. Environment panel montiors this event and updates itself when it occurs. --- indra/newview/llenvironment.cpp | 10 +++++++++- indra/newview/llenvironment.h | 17 ++++++++--------- indra/newview/llpanelenvironment.cpp | 22 ++++++++++++++++++++++ indra/newview/llpanelenvironment.h | 4 ++++ indra/newview/llviewerparcelmgr.cpp | 7 +++++++ indra/newview/llviewerparcelmgr.h | 1 + 6 files changed, 51 insertions(+), 10 deletions(-) (limited to 'indra/newview/llviewerparcelmgr.cpp') diff --git a/indra/newview/llenvironment.cpp b/indra/newview/llenvironment.cpp index ec2577d053..3d8222a371 100644 --- a/indra/newview/llenvironment.cpp +++ b/indra/newview/llenvironment.cpp @@ -502,7 +502,9 @@ void LLEnvironment::setEnvironment(LLEnvironment::EnvSelection_t env, const LLSe environment->setDay(pday, daylength, dayoffset); environment->setSkyTrack(mCurrentTrack); environment->animate(); - /*TODO: readjust environment*/ + + if (!mSignalEnvChanged.empty()) + mSignalEnvChanged(env); } @@ -519,6 +521,8 @@ void LLEnvironment::setEnvironment(LLEnvironment::EnvSelection_t env, LLEnvironm environment->clear(); environment->setSky((fixed.first) ? fixed.first : mEnvironments[ENV_DEFAULT]->getSky()); environment->setWater((fixed.second) ? fixed.second : mEnvironments[ENV_DEFAULT]->getWater()); + if (!mSignalEnvChanged.empty()) + mSignalEnvChanged(env); /*TODO: readjust environment*/ } @@ -605,6 +609,10 @@ void LLEnvironment::clearEnvironment(LLEnvironment::EnvSelection_t env) } mEnvironments[env].reset(); + + if (!mSignalEnvChanged.empty()) + mSignalEnvChanged(env); + /*TODO: readjust environment*/ } diff --git a/indra/newview/llenvironment.h b/indra/newview/llenvironment.h index b5bd353066..32a99c4286 100644 --- a/indra/newview/llenvironment.h +++ b/indra/newview/llenvironment.h @@ -135,15 +135,12 @@ public: }; typedef std::pair fixedEnvironment_t; + typedef std::function environment_apply_fn; + typedef boost::signals2::signal env_changed_signal_t; + typedef env_changed_signal_t::slot_type env_changed_fn; + typedef std::array altitude_list_t; - typedef std::function environment_apply_fn; - - typedef boost::signals2::signal environment_changed_signal_t; - typedef environment_changed_signal_t::slot_type environment_changed_fn; - - typedef std::array altitude_list_t; - - virtual ~LLEnvironment(); + virtual ~LLEnvironment(); void loadPreferences(); void updatePreferences(); @@ -229,7 +226,7 @@ public: LLSettingsDay::ptr_t createDayCycleFromEnvironment(EnvSelection_t env, LLSettingsBase::ptr_t settings); //------------------------------------------- - connection_t setEnvironmentChanged(environment_changed_fn cb); + connection_t setEnvironmentChanged(env_changed_fn cb) { return mSignalEnvChanged.connect(cb); } void requestRegion(environment_apply_fn cb = environment_apply_fn()); void updateRegion(const LLUUID &asset_id, S32 day_length, S32 day_offset, environment_apply_fn cb = environment_apply_fn()); @@ -350,6 +347,8 @@ private: LLSettingsBlender::ptr_t mBlenderSky; LLSettingsBlender::ptr_t mBlenderWater; + env_changed_signal_t mSignalEnvChanged; + UserPrefs mUserPrefs; S32 mCurrentTrack; diff --git a/indra/newview/llpanelenvironment.cpp b/indra/newview/llpanelenvironment.cpp index bc06bde138..1beba9db0c 100644 --- a/indra/newview/llpanelenvironment.cpp +++ b/indra/newview/llpanelenvironment.cpp @@ -125,6 +125,12 @@ LLPanelEnvironmentInfo::LLPanelEnvironmentInfo(): { } +LLPanelEnvironmentInfo::~LLPanelEnvironmentInfo() +{ + if (mChangeMonitor.connected()) + mChangeMonitor.disconnect(); +} + BOOL LLPanelEnvironmentInfo::postBuild() { getChild(RDG_ENVIRONMENT_SELECT)->setCommitCallback([this](LLUICtrl *, const LLSD &){ onSwitchDefaultSelection(); }); @@ -138,6 +144,8 @@ BOOL LLPanelEnvironmentInfo::postBuild() getChild(SLD_ALTITUDES)->setCommitCallback([this](LLUICtrl *cntrl, const LLSD &value) { onAltSliderCallback(cntrl, value); }); + mChangeMonitor = LLEnvironment::instance().setEnvironmentChanged([this](LLEnvironment::EnvSelection_t env) { onEnvironmentChanged(env); }); + return TRUE; } @@ -151,7 +159,9 @@ void LLPanelEnvironmentInfo::onOpen(const LLSD& key) void LLPanelEnvironmentInfo::onVisibilityChange(BOOL new_visibility) { if (new_visibility) + { gIdleCallbacks.addFunction(onIdlePlay, this); + } else { LLFloaterSettingsPicker *picker = getSettingsPicker(false); @@ -164,6 +174,7 @@ void LLPanelEnvironmentInfo::onVisibilityChange(BOOL new_visibility) LLFloaterEditExtDayCycle *dayeditor = getEditFloater(); if (mCommitConnection.connected()) mCommitConnection.disconnect(); + if (dayeditor) { if (dayeditor->isDirty()) @@ -674,6 +685,17 @@ void LLPanelEnvironmentInfo::onEditCommitted(LLSettingsDay::ptr_t newday) } } +void LLPanelEnvironmentInfo::onEnvironmentChanged(LLEnvironment::EnvSelection_t env) +{ + if ((isRegion() && (env == LLEnvironment::ENV_REGION)) || + ((env == LLEnvironment::ENV_PARCEL) && (getParcelId() == LLViewerParcelMgr::instance().getAgentParcelId()))) + { + mCurrentEnvironment.reset(); + refreshFromSource(); + } +} + + void LLPanelEnvironmentInfo::onPickerAssetDownloaded(LLSettingsBase::ptr_t settings) { LLSettingsVODay::buildFromOtherSetting(settings, [this](LLSettingsDay::ptr_t pday) diff --git a/indra/newview/llpanelenvironment.h b/indra/newview/llpanelenvironment.h index a632acfd03..2753e766ac 100644 --- a/indra/newview/llpanelenvironment.h +++ b/indra/newview/llpanelenvironment.h @@ -43,6 +43,7 @@ class LLPanelEnvironmentInfo : public LLPanel { public: LLPanelEnvironmentInfo(); + virtual ~LLPanelEnvironmentInfo(); virtual BOOL postBuild() override; virtual void onOpen(const LLSD& key) override; @@ -137,6 +138,8 @@ protected: LLEnvironment::EnvironmentInfo::ptr_t mCurrentEnvironment; + void onEnvironmentChanged(LLEnvironment::EnvSelection_t env); + class AltitudeData { public: @@ -162,6 +165,7 @@ private: typedef boost::signals2::connection connection_t; connection_t mCommitConnection; + connection_t mChangeMonitor; LLHandle mSettingsFloater; LLHandle mEditFloater; S32 mDirtyFlag; diff --git a/indra/newview/llviewerparcelmgr.cpp b/indra/newview/llviewerparcelmgr.cpp index 5a393220c3..c83e27ceed 100644 --- a/indra/newview/llviewerparcelmgr.cpp +++ b/indra/newview/llviewerparcelmgr.cpp @@ -1312,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) diff --git a/indra/newview/llviewerparcelmgr.h b/indra/newview/llviewerparcelmgr.h index 06dae6e57e..336a3ea228 100644 --- a/indra/newview/llviewerparcelmgr.h +++ b/indra/newview/llviewerparcelmgr.h @@ -263,6 +263,7 @@ public: // accessors for mAgentParcel const std::string& getAgentParcelName() const; + const S32 getAgentParcelId() const; // Create a landmark at the "appropriate" location for the // currently selected parcel. -- cgit v1.3 From aa43ddf674e672262428c400c076cc26966aedf9 Mon Sep 17 00:00:00 2001 From: maxim_productengine Date: Fri, 5 Oct 2018 16:48:49 +0300 Subject: SL-9808 [EEP] Don't update environment each time we receive parcel info after hovering any parcel --- indra/newview/llviewerparcelmgr.cpp | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) (limited to 'indra/newview/llviewerparcelmgr.cpp') diff --git a/indra/newview/llviewerparcelmgr.cpp b/indra/newview/llviewerparcelmgr.cpp index c83e27ceed..0d077161a6 100644 --- a/indra/newview/llviewerparcelmgr.cpp +++ b/indra/newview/llviewerparcelmgr.cpp @@ -1609,7 +1609,8 @@ void LLViewerParcelMgr::processParcelProperties(LLMessageSystem *msg, void **use } } - bool environment_changed = (parcel->getParcelEnvironmentVersion() != parcel_environment_version); + S32 cur_parcel_environment_version = parcel->getParcelEnvironmentVersion(); + bool environment_changed = (cur_parcel_environment_version != parcel_environment_version); parcel->init(owner_id, FALSE, FALSE, FALSE, @@ -1636,8 +1637,7 @@ 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(parcel_environment_version); + parcel->setParcelEnvironmentVersion(cur_parcel_environment_version); parcel->setRegionAllowEnvironmentOverride(region_allow_environment_override); parcel->unpackMessage(msg); @@ -1670,13 +1670,14 @@ void LLViewerParcelMgr::processParcelProperties(LLMessageSystem *msg, void **use instance->mTeleportFinishedSignal(instance->mTeleportInProgressPosition, false); } } - + parcel->setParcelEnvironmentVersion(parcel_environment_version); LL_WARNS("LAPRAS") << "Parcel environment version is " << parcel->getParcelEnvironmentVersion() << LL_ENDL; // Notify anything that wants to know when the agent changes parcels gAgent.changeParcels(); } else if (agent_parcel_update) { + parcel->setParcelEnvironmentVersion(parcel_environment_version); // updated agent parcel parcel_mgr.mAgentParcel->unpackMessage(msg); if ((LLEnvironment::instance().isExtendedEnvironmentEnabled() && environment_changed)) -- cgit v1.3 From bda785e8b1bef35ecd9d45a7092b0ab66c17d1f4 Mon Sep 17 00:00:00 2001 From: andreykproductengine Date: Mon, 12 Nov 2018 20:11:00 +0200 Subject: SL-10033 [EEP] Use fast environment transition for teleports --- indra/newview/llenvironment.cpp | 14 ++++++++------ indra/newview/llenvironment.h | 2 +- indra/newview/llviewerparcelmgr.cpp | 8 +++++++- indra/newview/llviewerparcelmgr.h | 1 + 4 files changed, 17 insertions(+), 8 deletions(-) (limited to 'indra/newview/llviewerparcelmgr.cpp') diff --git a/indra/newview/llenvironment.cpp b/indra/newview/llenvironment.cpp index 6bc7b8bf25..530dc79fe9 100644 --- a/indra/newview/llenvironment.cpp +++ b/indra/newview/llenvironment.cpp @@ -973,7 +973,7 @@ void LLEnvironment::updateShaderUniforms(LLGLSLShader *shader) } } -void LLEnvironment::recordEnvironment(S32 parcel_id, LLEnvironment::EnvironmentInfo::ptr_t envinfo) +void LLEnvironment::recordEnvironment(S32 parcel_id, LLEnvironment::EnvironmentInfo::ptr_t envinfo, LLSettingsBase::Seconds transition) { if (envinfo->mParcelId == INVALID_PARCEL_ID) { @@ -1027,8 +1027,8 @@ void LLEnvironment::recordEnvironment(S32 parcel_id, LLEnvironment::EnvironmentI setEnvironment(ENV_PARCEL, envinfo->mDayCycle, envinfo->mDayLength, envinfo->mDayOffset); } } - - updateEnvironment(); + + updateEnvironment(transition); } //========================================================================= @@ -1078,9 +1078,10 @@ void LLEnvironment::requestParcel(S32 parcel_id, environment_apply_fn cb) { if (!cb) { - cb = [this](S32 pid, EnvironmentInfo::ptr_t envinfo) + LLSettingsBase::Seconds transition = LLViewerParcelMgr::getInstance()->getTeleportInProgress() ? TRANSITION_FAST : TRANSITION_DEFAULT; + cb = [this, transition](S32 pid, EnvironmentInfo::ptr_t envinfo) { - recordEnvironment(pid, envinfo); + recordEnvironment(pid, envinfo, transition); }; } @@ -1093,7 +1094,8 @@ void LLEnvironment::requestParcel(S32 parcel_id, environment_apply_fn cb) if (!cb) { - cb = [this](S32 pid, EnvironmentInfo::ptr_t envinfo) { recordEnvironment(pid, envinfo); }; + LLSettingsBase::Seconds transition = LLViewerParcelMgr::getInstance()->getTeleportInProgress() ? TRANSITION_FAST : TRANSITION_DEFAULT; + cb = [this, transition](S32 pid, EnvironmentInfo::ptr_t envinfo) { recordEnvironment(pid, envinfo, transition); }; } std::string coroname = diff --git a/indra/newview/llenvironment.h b/indra/newview/llenvironment.h index 9e943cce00..a72a08c68e 100644 --- a/indra/newview/llenvironment.h +++ b/indra/newview/llenvironment.h @@ -360,7 +360,7 @@ private: void coroUpdateEnvironment(S32 parcel_id, S32 track_no, UpdateInfo::ptr_t updates, environment_apply_fn apply); void coroResetEnvironment(S32 parcel_id, S32 track_no, environment_apply_fn apply); - void recordEnvironment(S32 parcel_id, EnvironmentInfo::ptr_t environment); + void recordEnvironment(S32 parcel_id, EnvironmentInfo::ptr_t environment, LLSettingsBase::Seconds transition); void onAgentPositionHasChanged(const LLVector3 &localpos); diff --git a/indra/newview/llviewerparcelmgr.cpp b/indra/newview/llviewerparcelmgr.cpp index 0d077161a6..cca02544ee 100644 --- a/indra/newview/llviewerparcelmgr.cpp +++ b/indra/newview/llviewerparcelmgr.cpp @@ -1659,7 +1659,6 @@ void LLViewerParcelMgr::processParcelProperties(LLMessageSystem *msg, void **use if (instance->mTeleportInProgress) { - instance->mTeleportInProgress = FALSE; if(instance->mTeleportInProgressPosition.isNull()) { //initial update @@ -1674,6 +1673,7 @@ void LLViewerParcelMgr::processParcelProperties(LLMessageSystem *msg, void **use LL_WARNS("LAPRAS") << "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) { @@ -2576,3 +2576,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 +} diff --git a/indra/newview/llviewerparcelmgr.h b/indra/newview/llviewerparcelmgr.h index 336a3ea228..ec8dde7d40 100644 --- a/indra/newview/llviewerparcelmgr.h +++ b/indra/newview/llviewerparcelmgr.h @@ -287,6 +287,7 @@ public: boost::signals2::connection setTeleportFailedCallback(teleport_failed_callback_t cb); void onTeleportFinished(bool local, const LLVector3d& new_pos); void onTeleportFailed(); + bool getTeleportInProgress(); static BOOL isParcelOwnedByAgent(const LLParcel* parcelp, U64 group_proxy_power); static BOOL isParcelModifiableByAgent(const LLParcel* parcelp, U64 group_proxy_power); -- cgit v1.3 From 2401712d1073e85b4b9183d20c6e9274bc874f64 Mon Sep 17 00:00:00 2001 From: Rider Linden Date: Wed, 20 Feb 2019 15:20:30 -0800 Subject: SL-9660: Next pass cleanup. Removed and downgraded a number of logs. Removed refs to LAPAS. Better sync with legacy regions. --- indra/llinventory/llsettingsbase.cpp | 2 +- indra/llinventory/llsettingsdaycycle.cpp | 2 - indra/llinventory/llsettingssky.cpp | 3 - indra/llmessage/llassetstorage.cpp | 4 - indra/newview/lldaycyclemanager.cpp | 233 ---------------------------- indra/newview/lldaycyclemanager.h | 83 ---------- indra/newview/llenvironment.cpp | 76 +++++---- indra/newview/llenvironment.h | 51 +++--- indra/newview/llfloatereditextdaycycle.cpp | 2 +- indra/newview/llfloaterfixedenvironment.cpp | 8 +- indra/newview/llinventorybridge.cpp | 3 +- indra/newview/llpaneleditwater.cpp | 3 - indra/newview/llsettingsvo.cpp | 7 - indra/newview/llstartup.cpp | 15 -- indra/newview/llviewermenu.cpp | 1 - indra/newview/llviewermessage.cpp | 21 ++- indra/newview/llviewerparcelmgr.cpp | 4 +- 17 files changed, 99 insertions(+), 419 deletions(-) delete mode 100644 indra/newview/lldaycyclemanager.cpp delete mode 100644 indra/newview/lldaycyclemanager.h (limited to 'indra/newview/llviewerparcelmgr.cpp') diff --git a/indra/llinventory/llsettingsbase.cpp b/indra/llinventory/llsettingsbase.cpp index 5adb787048..7d7547ecb1 100644 --- a/indra/llinventory/llsettingsbase.cpp +++ b/indra/llinventory/llsettingsbase.cpp @@ -381,7 +381,7 @@ bool LLSettingsBase::validate() } if (result["warnings"].size() > 0) { - LL_WARNS("SETTINGS") << "Validation warnings: " << result["warnings"] << LL_ENDL; + LL_DEBUGS("SETTINGS") << "Validation warnings: " << result["warnings"] << LL_ENDL; } return result["success"].asBoolean(); diff --git a/indra/llinventory/llsettingsdaycycle.cpp b/indra/llinventory/llsettingsdaycycle.cpp index 188e205176..feb734f64e 100644 --- a/indra/llinventory/llsettingsdaycycle.cpp +++ b/indra/llinventory/llsettingsdaycycle.cpp @@ -863,8 +863,6 @@ LLSettingsDay::CycleTrack_t::value_type LLSettingsDay::getSettingsNearKeyframe(c F32 dist = get_wrapping_distance(startframe, (*it).first); - //LL_DEBUGS("LAPRAS") << "[" << startframe << " ... " << keyframe << " -> " << (*it).first << "@" << dist << LL_ENDL; - if (dist <= (fudge * 2.0f)) return (*it); diff --git a/indra/llinventory/llsettingssky.cpp b/indra/llinventory/llsettingssky.cpp index af7425cca0..744c5853e4 100644 --- a/indra/llinventory/llsettingssky.cpp +++ b/indra/llinventory/llsettingssky.cpp @@ -997,9 +997,6 @@ void LLSettingsSky::calculateHeavenlyBodyPositions() const mSunDirection.normalize(); mMoonDirection.normalize(); - //LL_WARNS("LAPRAS") << "Sun info: Rotation=" << sunq << " Vector=" << mSunDirection << LL_ENDL; - //LL_WARNS("LAPRAS") << "Moon info: Rotation=" << moonq << " Vector=" << mMoonDirection << LL_ENDL; - if (mSunDirection.lengthSquared() < 0.01f) LL_WARNS("SETTINGS") << "Zero length sun direction. Wailing and gnashing of teeth may follow... or not." << LL_ENDL; if (mMoonDirection.lengthSquared() < 0.01f) diff --git a/indra/llmessage/llassetstorage.cpp b/indra/llmessage/llassetstorage.cpp index 2b12a062c3..18b2b124e1 100644 --- a/indra/llmessage/llassetstorage.cpp +++ b/indra/llmessage/llassetstorage.cpp @@ -533,10 +533,6 @@ void LLAssetStorage::getAssetData(const LLUUID uuid, LLVFile file(mVFS, uuid, type); U32 size = exists ? file.getSize() : 0; -// LAPRAS TESTING -// if (type == LLAssetType::AT_SETTINGS) -// size = 0; - if (size > 0) { // we've already got the file diff --git a/indra/newview/lldaycyclemanager.cpp b/indra/newview/lldaycyclemanager.cpp deleted file mode 100644 index 23d442f3b6..0000000000 --- a/indra/newview/lldaycyclemanager.cpp +++ /dev/null @@ -1,233 +0,0 @@ -/** - * @file lldaycyclemanager.cpp - * @brief Implementation for the LLDayCycleManager class. - * - * $LicenseInfo:firstyear=2011&license=viewerlgpl$ - * Second Life Viewer Source Code - * Copyright (C) 2011, Linden Research, Inc. - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; - * version 2.1 of the License only. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - * - * Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA - * $/LicenseInfo$ - */ - -#include "llviewerprecompiledheaders.h" - -#include "lldaycyclemanager.h" - -#include "lldiriterator.h" - -#include "llenvironment.h" -#include "llsettingsdaycycle.h" - -void LLDayCycleManager::getPresetNames(preset_name_list_t& names) const -{ - names.clear(); - - for (dc_map_t::const_iterator it = mDayCycleMap.begin(); it != mDayCycleMap.end(); ++it) - { - names.push_back(it->first); - } -} - -void LLDayCycleManager::getPresetNames(preset_name_list_t& user, preset_name_list_t& sys) const -{ - user.clear(); - sys.clear(); - - for (dc_map_t::const_iterator it = mDayCycleMap.begin(); it != mDayCycleMap.end(); ++it) - { - const std::string& name = it->first; - - if (isSystemPreset(name)) - { - sys.push_back(name); - } - else - { - user.push_back(name); - } - } -} - -void LLDayCycleManager::getUserPresetNames(preset_name_list_t& user) const -{ - preset_name_list_t sys; // unused - getPresetNames(user, sys); -} - -bool LLDayCycleManager::getPreset(const std::string name, LLWLDayCycle& day_cycle) const -{ - dc_map_t::const_iterator it = mDayCycleMap.find(name); - if (it == mDayCycleMap.end()) - { - return false; - } - - day_cycle = it->second; - return true; -} - -bool LLDayCycleManager::getPreset(const std::string name, LLSD& day_cycle) const -{ - LLWLDayCycle dc; - if (!getPreset(name, dc)) - { - return false; - } - - day_cycle = dc.asLLSD(); - return true; -} - -bool LLDayCycleManager::presetExists(const std::string name) const -{ - LLWLDayCycle dummy; - return getPreset(name, dummy); -} - -bool LLDayCycleManager::isSystemPreset(const std::string& name) const -{ - return gDirUtilp->fileExists(getSysDir() + LLURI::escape(name) + ".xml"); -} - -bool LLDayCycleManager::savePreset(const std::string& name, const LLSD& data) -{ - // Save given preset. - LLWLDayCycle day; - day.loadDayCycle(data, LLEnvKey::SCOPE_LOCAL); - day.save(getUserDir() + LLURI::escape(name) + ".xml"); - - // Add it to our map. - addPreset(name, data); - mModifySignal(); - return true; -} - -bool LLDayCycleManager::deletePreset(const std::string& name) -{ - // Remove it from the map. - dc_map_t::iterator it = mDayCycleMap.find(name); - if (it == mDayCycleMap.end()) - { - LL_WARNS("Windlight") << "No day cycle named " << name << LL_ENDL; - return false; - } - mDayCycleMap.erase(it); - - // Remove from the filesystem. - std::string filename = LLURI::escape(name) + ".xml"; - if (gDirUtilp->fileExists(getUserDir() + filename)) - { - gDirUtilp->deleteFilesInDir(getUserDir(), filename); - } - - // Signal interested parties. - mModifySignal(); - return true; -} - -bool LLDayCycleManager::isSkyPresetReferenced(const std::string& preset_name) const -{ - // We're traversing local day cycles, they can only reference local skies. - LLWLParamKey key(preset_name, LLEnvKey::SCOPE_LOCAL); - - for (dc_map_t::const_iterator it = mDayCycleMap.begin(); it != mDayCycleMap.end(); ++it) - { - if (it->second.hasReferencesTo(key)) - { - return true; - } - } - - return false; -} - -boost::signals2::connection LLDayCycleManager::setModifyCallback(const modify_signal_t::slot_type& cb) -{ - return mModifySignal.connect(cb); -} - -// virtual -void LLDayCycleManager::initSingleton() -{ - LL_DEBUGS("Windlight") << "Loading all day cycles" << LL_ENDL; - loadAllPresets(); -} - -void LLDayCycleManager::loadAllPresets() -{ - mDayCycleMap.clear(); - - // First, load system (coming out of the box) day cycles. - loadPresets(getSysDir()); - - // Then load user presets. Note that user day cycles will modify any system ones already loaded. - loadPresets(getUserDir()); -} - -void LLDayCycleManager::loadPresets(const std::string& dir) -{ - LLDirIterator dir_iter(dir, "*.xml"); - - while (1) - { - std::string file; - if (!dir_iter.next(file)) break; // no more files - loadPreset(gDirUtilp->add(dir, file)); - } -} - -bool LLDayCycleManager::loadPreset(const std::string& path) -{ - LLSD data = LLWLDayCycle::loadDayCycleFromPath(path); - if (data.isUndefined()) - { - LL_WARNS() << "Error loading day cycle from " << path << LL_ENDL; - return false; - } - - std::string name(gDirUtilp->getBaseFileName(LLURI::unescape(path), /*strip_exten = */ true)); - addPreset(name, data); - - return true; -} - -bool LLDayCycleManager::addPreset(const std::string& name, const LLSD& data) -{ - if (name.empty()) - { - //llassert(name.empty()); - return false; - } - - LLWLDayCycle day; - day.loadDayCycle(data, LLEnvKey::SCOPE_LOCAL); - mDayCycleMap[name] = day; - return true; -} - -// static -std::string LLDayCycleManager::getSysDir() -{ - return gDirUtilp->getExpandedFilename(LL_PATH_APP_SETTINGS, "windlight/days", ""); -} - -// static -std::string LLDayCycleManager::getUserDir() -{ - return gDirUtilp->getExpandedFilename(LL_PATH_USER_SETTINGS , "windlight/days", ""); -} diff --git a/indra/newview/lldaycyclemanager.h b/indra/newview/lldaycyclemanager.h deleted file mode 100644 index 810212c92a..0000000000 --- a/indra/newview/lldaycyclemanager.h +++ /dev/null @@ -1,83 +0,0 @@ -/** - * @file lldaycyclemanager.h - * @brief Implementation for the LLDayCycleManager class. - * - * $LicenseInfo:firstyear=2011&license=viewerlgpl$ - * Second Life Viewer Source Code - * Copyright (C) 2011, Linden Research, Inc. - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; - * version 2.1 of the License only. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - * - * Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA - * $/LicenseInfo$ - */ - -#ifndef LL_LLDAYCYCLEMANAGER_H -#define LL_LLDAYCYCLEMANAGER_H - -#include -#include - -#include "llwlparammanager.h" - -/** - * WindLight day cycles manager class - * - * Provides interface for accessing, loading and saving day cycles. - */ -class LLDayCycleManager : public LLSingleton -{ - LLSINGLETON_EMPTY_CTOR(LLDayCycleManager); - LOG_CLASS(LLDayCycleManager); - -public: - typedef std::list preset_name_list_t; - -// typedef std::map dc_map_t; - typedef boost::signals2::signal modify_signal_t; - - void getPresetNames(preset_name_list_t& names) const; - void getPresetNames(preset_name_list_t& user, preset_name_list_t& sys) const; - void getUserPresetNames(preset_name_list_t& user) const; - -// bool getPreset(const std::string name, LLWLDayCycle& day_cycle) const; - bool getPreset(const std::string name, LLSD& day_cycle) const; - bool presetExists(const std::string name) const; - bool isSystemPreset(const std::string& name) const; - bool savePreset(const std::string& name, const LLSD& data); - bool deletePreset(const std::string& name); - - /// @return true if there is a day cycle that refers to the sky preset. - bool isSkyPresetReferenced(const std::string& preset_name) const; - - /// Emitted when a preset gets added or deleted. - boost::signals2::connection setModifyCallback(const modify_signal_t::slot_type& cb); - -private: - /*virtual*/ void initSingleton(); - - void loadAllPresets(); - void loadPresets(const std::string& dir); - bool loadPreset(const std::string& path); - bool addPreset(const std::string& name, const LLSD& data); - - static std::string getSysDir(); - static std::string getUserDir(); - - dc_map_t mDayCycleMap; - modify_signal_t mModifySignal; -}; - -#endif // LL_LLDAYCYCLEMANAGER_H diff --git a/indra/newview/llenvironment.cpp b/indra/newview/llenvironment.cpp index 4bf7a630a5..f021c4a8c3 100644 --- a/indra/newview/llenvironment.cpp +++ b/indra/newview/llenvironment.cpp @@ -470,7 +470,6 @@ namespace { if ((*it)->mBlendIn) { - //_WARNS("LAPRAS") << "Done blending '" << key_name << "' after " << (*it)->mTransition.value() - (*it)->mTimeRemaining.value() << " value now=" << target << LL_ENDL; mOverrideValues[key_name] = target; mOverrideExps[key_name] = (*it)->mExperience; this->mSettings[key_name] = target; @@ -1621,39 +1620,38 @@ void LLEnvironment::recordEnvironment(S32 parcel_id, LLEnvironment::EnvironmentI else if (envinfo->mDayCycle->isTrackEmpty(LLSettingsDay::TRACK_WATER) || envinfo->mDayCycle->isTrackEmpty(LLSettingsDay::TRACK_GROUND_LEVEL)) { - LL_WARNS("LAPRAS") << "Invalid day cycle for region" << LL_ENDL; + LL_WARNS("ENVIRONMENT") << "Invalid day cycle for region" << LL_ENDL; clearEnvironment(ENV_PARCEL); setEnvironment(ENV_REGION, LLSettingsDay::GetDefaultAssetId(), LLSettingsDay::DEFAULT_DAYLENGTH, LLSettingsDay::DEFAULT_DAYOFFSET, envinfo->mEnvVersion); updateEnvironment(); } else { - LL_INFOS("LAPRAS") << "Setting Region environment" << LL_ENDL; setEnvironment(ENV_REGION, envinfo->mDayCycle, envinfo->mDayLength, envinfo->mDayOffset, envinfo->mEnvVersion); mTrackAltitudes = envinfo->mAltitudes; } - LL_WARNS("LAPRAS") << "Altitudes set to {" << mTrackAltitudes[0] << ", "<< mTrackAltitudes[1] << ", " << mTrackAltitudes[2] << ", " << mTrackAltitudes[3] << LL_ENDL; + LL_DEBUGS("ENVIRONMENT") << "Altitudes set to {" << mTrackAltitudes[0] << ", "<< mTrackAltitudes[1] << ", " << mTrackAltitudes[2] << ", " << mTrackAltitudes[3] << LL_ENDL; } else { LLParcel *parcel = LLViewerParcelMgr::instance().getAgentParcel(); - LL_WARNS("LAPRAS") << "Have parcel environment #" << envinfo->mParcelId << LL_ENDL; + LL_DEBUGS("ENVIRONMENT") << "Have parcel environment #" << envinfo->mParcelId << LL_ENDL; if (parcel && (parcel->getLocalID() != parcel_id)) { - LL_WARNS("ENVIRONMENT") << "Requested parcel #" << parcel_id << " agent is on " << parcel->getLocalID() << LL_ENDL; + LL_DEBUGS("ENVIRONMENT") << "Requested parcel #" << parcel_id << " agent is on " << parcel->getLocalID() << LL_ENDL; return; } if (!envinfo->mDayCycle) { - LL_WARNS("LAPRAS") << "Clearing environment on parcel #" << parcel_id << LL_ENDL; + LL_DEBUGS("ENVIRONMENT") << "Clearing environment on parcel #" << parcel_id << LL_ENDL; clearEnvironment(ENV_PARCEL); } else if (envinfo->mDayCycle->isTrackEmpty(LLSettingsDay::TRACK_WATER) || envinfo->mDayCycle->isTrackEmpty(LLSettingsDay::TRACK_GROUND_LEVEL)) { - LL_WARNS("LAPRAS") << "Invalid day cycle for parcel #" << parcel_id << LL_ENDL; + LL_WARNS("ENVIRONMENT") << "Invalid day cycle for parcel #" << parcel_id << LL_ENDL; clearEnvironment(ENV_PARCEL); } else @@ -1665,6 +1663,27 @@ void LLEnvironment::recordEnvironment(S32 parcel_id, LLEnvironment::EnvironmentI updateEnvironment(transition); } +void LLEnvironment::adjustRegionOffset(F32 adjust) +{ + if (isExtendedEnvironmentEnabled()) + { + LL_WARNS("ENVIRONMENT") << "Attempt to adjust region offset on EEP region. Legacy regions only." << LL_ENDL; + } + + if (mEnvironments[ENV_REGION]) + { + F32 day_length = mEnvironments[ENV_REGION]->getDayLength(); + F32 day_offset = mEnvironments[ENV_REGION]->getDayOffset(); + + F32 day_adjustment = adjust * day_length; + + day_offset += day_adjustment; + if (day_offset < 0.0f) + day_offset = day_length + day_offset; + mEnvironments[ENV_REGION]->setDayOffset(LLSettingsBase::Seconds(day_offset)); + } +} + //========================================================================= void LLEnvironment::requestRegion(environment_apply_fn cb) { @@ -1820,7 +1839,7 @@ void LLEnvironment::coroRequestEnvironment(S32 parcel_id, LLEnvironment::environ if (url.empty()) return; - LL_WARNS("LAPRAS") << "Requesting for parcel_id=" << parcel_id << LL_ENDL; + LL_DEBUGS("ENVIRONMENT") << "Requesting for parcel_id=" << parcel_id << LL_ENDL; if (parcel_id != INVALID_PARCEL_ID) { @@ -1830,24 +1849,14 @@ void LLEnvironment::coroRequestEnvironment(S32 parcel_id, LLEnvironment::environ url += query.str(); } - LL_WARNS("LAPRAS") << "url=" << url << LL_ENDL; - LLSD result = httpAdapter->getAndSuspend(httpRequest, url); // results that come back may contain the new settings -// LLSD notify; - LLSD httpResults = result["http_result"]; LLCore::HttpStatus status = LLCoreHttpUtil::HttpCoroutineAdapter::getStatusFromLLSD(httpResults); if (!status) { - LL_WARNS("WindlightCaps") << "Couldn't retrieve environment settings for " << ((parcel_id == INVALID_PARCEL_ID) ? ("region!") : ("parcel!")) << LL_ENDL; - -// std::stringstream msg; -// msg << status.toString() << " (Code " << status.toTerseString() << ")"; -// notify = LLSD::emptyMap(); -// notify["FAIL_REASON"] = msg.str(); - + LL_WARNS("ENVIRONMENT") << "Couldn't retrieve environment settings for " << ((parcel_id == INVALID_PARCEL_ID) ? ("region!") : ("parcel!")) << LL_ENDL; } else { @@ -1859,11 +1868,6 @@ void LLEnvironment::coroRequestEnvironment(S32 parcel_id, LLEnvironment::environ } } -// if (!notify.isUndefined()) -// { -// LLNotificationsUtil::add("WLRegionApplyFail", notify); -// //LLEnvManagerNew::instance().onRegionSettingsApplyResponse(false); -// } } void LLEnvironment::coroUpdateEnvironment(S32 parcel_id, S32 track_no, UpdateInfo::ptr_t updates, environment_apply_fn apply) @@ -1906,7 +1910,7 @@ void LLEnvironment::coroUpdateEnvironment(S32 parcel_id, S32 track_no, UpdateInf body[KEY_ENVIRONMENT][KEY_DAYNAME] = updates->mDayName; } - LL_WARNS("LAPRAS") << "Body = " << body << LL_ENDL; + //_WARNS("ENVIRONMENT") << "Body = " << body << LL_ENDL; if ((parcel_id != INVALID_PARCEL_ID) || (track_no != NO_TRACK)) { @@ -1934,10 +1938,10 @@ void LLEnvironment::coroUpdateEnvironment(S32 parcel_id, S32 track_no, UpdateInf LLSD httpResults = result["http_result"]; LLCore::HttpStatus status = LLCoreHttpUtil::HttpCoroutineAdapter::getStatusFromLLSD(httpResults); - LL_WARNS("LAPRAS") << "success=" << result["success"] << LL_ENDL; + if ((!status) || !result["success"].asBoolean()) { - LL_WARNS("WindlightCaps") << "Couldn't update Windlight settings for " << ((parcel_id == INVALID_PARCEL_ID) ? ("region!") : ("parcel!")) << LL_ENDL; + LL_WARNS("ENVIRONMENT") << "Couldn't update Windlight settings for " << ((parcel_id == INVALID_PARCEL_ID) ? ("region!") : ("parcel!")) << LL_ENDL; notify = LLSD::emptyMap(); notify["FAIL_REASON"] = result["message"].asString(); @@ -1996,10 +2000,10 @@ void LLEnvironment::coroResetEnvironment(S32 parcel_id, S32 track_no, environmen LLSD httpResults = result["http_result"]; LLCore::HttpStatus status = LLCoreHttpUtil::HttpCoroutineAdapter::getStatusFromLLSD(httpResults); - LL_WARNS("LAPRAS") << "success=" << result["success"] << LL_ENDL; + if ((!status) || !result["success"].asBoolean()) { - LL_WARNS("WindlightCaps") << "Couldn't reset Windlight settings in " << ((parcel_id == INVALID_PARCEL_ID) ? ("region!") : ("parcel!")) << LL_ENDL; + LL_WARNS("ENVIRONMENT") << "Couldn't reset Windlight settings in " << ((parcel_id == INVALID_PARCEL_ID) ? ("region!") : ("parcel!")) << LL_ENDL; notify = LLSD::emptyMap(); notify["FAIL_REASON"] = result["message"].asString(); @@ -2416,8 +2420,6 @@ void LLEnvironment::setExperienceEnvironment(LLUUID experience_id, LLSD data, F3 void LLEnvironment::listenExperiencePump(const LLSD &message) { - LL_WARNS("LAPRAS") << "Have experience event: " << message << LL_ENDL; - LLUUID experience_id = message["experience"]; LLSD data = message[experience_id.asString()]; std::string permission(data["permission"].asString()); @@ -2564,6 +2566,16 @@ void LLEnvironment::DayInstance::setBlenders(const LLSettingsBlender::ptr_t &sky mBlenderWater = waterblend; } +LLSettingsBase::TrackPosition LLEnvironment::DayInstance::getProgress() const +{ + LLSettingsBase::Seconds now(LLDate::now().secondsSinceEpoch()); + now += mDayOffset; + + if ((mDayLength <= 0) || !mDayCycle) + return -1.0f; // no actual day cycle. + + return convert_time_to_position(now, mDayLength); +} LLSettingsBase::TrackPosition LLEnvironment::DayInstance::secondsToKeyframe(LLSettingsDay::Seconds seconds) { diff --git a/indra/newview/llenvironment.h b/indra/newview/llenvironment.h index 6a930959bb..64350c42e8 100644 --- a/indra/newview/llenvironment.h +++ b/indra/newview/llenvironment.h @@ -197,6 +197,10 @@ public: // Construct a new day cycle based on the environment. Replacing either the water or the sky tracks. LLSettingsDay::ptr_t createDayCycleFromEnvironment(EnvSelection_t env, LLSettingsBase::ptr_t settings); + F32 getProgress() const { return (mCurrentEnvironment) ? mCurrentEnvironment->getProgress() : -1.0f; } + F32 getRegionProgress() const { return (mEnvironments[ENV_REGION]) ? mEnvironments[ENV_REGION]->getProgress() : -1.0f; } + void adjustRegionOffset(F32 adjust); // only used on legacy regions, to better sync the viewer with other agents + //------------------------------------------- connection_t setEnvironmentChanged(env_changed_fn cb) { return mSignalEnvChanged.connect(cb); } @@ -233,37 +237,42 @@ public: }; typedef std::shared_ptr ptr_t; - DayInstance(EnvSelection_t env); - virtual ~DayInstance() { }; + DayInstance(EnvSelection_t env); + virtual ~DayInstance() { }; + + virtual ptr_t clone() const; + + virtual bool applyTimeDelta(const LLSettingsBase::Seconds& delta); + + virtual void setDay(const LLSettingsDay::ptr_t &pday, LLSettingsDay::Seconds daylength, LLSettingsDay::Seconds dayoffset); + virtual void setSky(const LLSettingsSky::ptr_t &psky); + virtual void setWater(const LLSettingsWater::ptr_t &pwater); - virtual ptr_t clone() const; + void initialize(); + bool isInitialized(); - virtual bool applyTimeDelta(const LLSettingsBase::Seconds& delta); + void clear(); - virtual void setDay(const LLSettingsDay::ptr_t &pday, LLSettingsDay::Seconds daylength, LLSettingsDay::Seconds dayoffset); - virtual void setSky(const LLSettingsSky::ptr_t &psky); - virtual void setWater(const LLSettingsWater::ptr_t &pwater); + void setSkyTrack(S32 trackno); - void initialize(); - bool isInitialized(); + LLSettingsDay::ptr_t getDayCycle() const { return mDayCycle; } + LLSettingsSky::ptr_t getSky() const { return mSky; } + LLSettingsWater::ptr_t getWater() const { return mWater; } + LLSettingsDay::Seconds getDayLength() const { return mDayLength; } + LLSettingsDay::Seconds getDayOffset() const { return mDayOffset; } + S32 getSkyTrack() const { return mSkyTrack; } - void clear(); + void setDayOffset(LLSettingsBase::Seconds offset) { mDayOffset = offset; animate(); } - void setSkyTrack(S32 trackno); + virtual void animate(); - LLSettingsDay::ptr_t getDayCycle() const { return mDayCycle; } - LLSettingsSky::ptr_t getSky() const { return mSky; } - LLSettingsWater::ptr_t getWater() const { return mWater; } - LLSettingsDay::Seconds getDayLength() const { return mDayLength; } - LLSettingsDay::Seconds getDayOffset() const { return mDayOffset; } - S32 getSkyTrack() const { return mSkyTrack; } + void setBlenders(const LLSettingsBlender::ptr_t &skyblend, const LLSettingsBlender::ptr_t &waterblend); - virtual void animate(); + EnvSelection_t getEnvironmentSelection() const { return mEnv; } + void setEnvironmentSelection(EnvSelection_t env) { mEnv = env; } - void setBlenders(const LLSettingsBlender::ptr_t &skyblend, const LLSettingsBlender::ptr_t &waterblend); + LLSettingsBase::TrackPosition getProgress() const; - EnvSelection_t getEnvironmentSelection() const { return mEnv; } - void setEnvironmentSelection(EnvSelection_t env) { mEnv = env; } protected: LLSettingsDay::ptr_t mDayCycle; LLSettingsSky::ptr_t mSky; diff --git a/indra/newview/llfloatereditextdaycycle.cpp b/indra/newview/llfloatereditextdaycycle.cpp index 482caaaa85..3b148fa89e 100644 --- a/indra/newview/llfloatereditextdaycycle.cpp +++ b/indra/newview/llfloatereditextdaycycle.cpp @@ -1797,7 +1797,7 @@ void LLFloaterEditExtDayCycle::loadSettingFromFile(const std::vectorgetAssetUUID(); - LL_WARNS("LAPRAS") << "Locally applying asset ID " << asset_id << LL_ENDL; LLEnvironment::instance().setEnvironment(LLEnvironment::ENV_LOCAL, asset_id); LLEnvironment::instance().setSelectedEnvironment(LLEnvironment::ENV_LOCAL); } @@ -6958,7 +6957,7 @@ void LLSettingsBridge::performAction(LLInventoryModel* model, std::string action } S32 parcel_id = parcel->getLocalID(); - LL_WARNS("LAPRAS") << "Applying asset ID " << asset_id << " to parcel " << parcel_id << LL_ENDL; + LL_DEBUGS("ENVIRONMENT") << "Applying asset ID " << asset_id << " to parcel " << parcel_id << LL_ENDL; LLEnvironment::instance().updateParcel(parcel_id, asset_id, name, LLEnvironment::NO_TRACK, -1, -1); LLEnvironment::instance().setSharedEnvironment(); } diff --git a/indra/newview/llpaneleditwater.cpp b/indra/newview/llpaneleditwater.cpp index f639ad0d98..1f9c79c9eb 100644 --- a/indra/newview/llpaneleditwater.cpp +++ b/indra/newview/llpaneleditwater.cpp @@ -189,7 +189,6 @@ void LLPanelSettingsWaterMainTab::onLargeWaveChanged() { LLVector2 vect(getChild(FIELD_WATER_WAVE1_XY)->getValue()); vect *= -1.0; // Flip so that north and east are - - LL_WARNS("LAPRAS") << "Changing Large Wave from " << mWaterSettings->getWave1Dir() << " -> " << vect << LL_ENDL; mWaterSettings->setWave1Dir(vect); setIsDirty(); } @@ -198,7 +197,6 @@ void LLPanelSettingsWaterMainTab::onSmallWaveChanged() { LLVector2 vect(getChild(FIELD_WATER_WAVE2_XY)->getValue()); vect *= -1.0; // Flip so that north and east are - - LL_WARNS("LAPRAS") << "Changing Small Wave from " << mWaterSettings->getWave2Dir() << " -> " << vect << LL_ENDL; mWaterSettings->setWave2Dir(vect); setIsDirty(); } @@ -207,7 +205,6 @@ void LLPanelSettingsWaterMainTab::onSmallWaveChanged() void LLPanelSettingsWaterMainTab::onNormalScaleChanged() { LLVector3 vect(getChild(FIELD_WATER_NORMAL_SCALE_X)->getValue().asReal(), getChild(FIELD_WATER_NORMAL_SCALE_Y)->getValue().asReal(), getChild(FIELD_WATER_NORMAL_SCALE_Z)->getValue().asReal()); - LL_WARNS("LAPRAS") << "Changing normal scale from " << mWaterSettings->getNormalScale() << " -> " << vect << LL_ENDL; mWaterSettings->setNormalScale(vect); setIsDirty(); } diff --git a/indra/newview/llsettingsvo.cpp b/indra/newview/llsettingsvo.cpp index 3ef5e46e38..10a0527fe2 100644 --- a/indra/newview/llsettingsvo.cpp +++ b/indra/newview/llsettingsvo.cpp @@ -324,7 +324,6 @@ void LLSettingsVOBase::onAssetDownloadComplete(LLVFS *vfs, const LLUUID &asset_i } else { - //_WARNS("LAPRAS") << "Setting asset ID to " << asset_id << LL_ENDL; settings->setAssetId(asset_id); } } @@ -870,7 +869,6 @@ LLSD LLSettingsVOWater::convertToLegacy(const LLSettingsWater::ptr_t &pwater) legacy[SETTING_LEGACY_WAVE1_DIR] = settings[SETTING_WAVE1_DIR]; legacy[SETTING_LEGACY_WAVE2_DIR] = settings[SETTING_WAVE2_DIR]; - //_WARNS("LAPRAS") << "Legacy water: " << legacy << LL_ENDL; return legacy; } //------------------------------------------------------------------------- @@ -1120,8 +1118,6 @@ LLSettingsDay::ptr_t LLSettingsVODay::buildFromLegacyMessage(const LLUUID ®io ( SETTING_FRAMES, frames ) ( SETTING_TYPE, "daycycle" ); - //_WARNS("LAPRAS") << "newsettings=" << newsettings << LL_ENDL; - LLSettingsSky::validation_list_t validations = LLSettingsDay::validationList(); LLSD results = LLSettingsDay::settingValidation(newsettings, validations); if (!results["success"].asBoolean()) @@ -1299,7 +1295,6 @@ LLSD LLSettingsVODay::convertToLegacy(const LLSettingsVODay::ptr_t &pday) F32 frame = ((tracksky.size() == 1) && (it == tracksky.begin())) ? -1.0f : (*it).first; llsdcycle.append( LLSDArray(LLSD::Real(frame))(name.str()) ); } - //_WARNS("LAPRAS") << "Cycle created with " << llsdcycle.size() << "entries: " << llsdcycle << LL_ENDL; LLSD llsdskylist(LLSD::emptyMap()); @@ -1311,8 +1306,6 @@ LLSD LLSettingsVODay::convertToLegacy(const LLSettingsVODay::ptr_t &pday) llsdskylist[(*its).first] = llsdsky; } - //_WARNS("LAPRAS") << "Sky map with " << llsdskylist.size() << " entries created: " << llsdskylist << LL_ENDL; - return LLSDArray(LLSD::emptyMap())(llsdcycle)(llsdskylist)(llsdwater); } diff --git a/indra/newview/llstartup.cpp b/indra/newview/llstartup.cpp index 9c0e842c30..1d24df5886 100644 --- a/indra/newview/llstartup.cpp +++ b/indra/newview/llstartup.cpp @@ -941,21 +941,6 @@ bool idle_startup() LLFile::mkdir(gDirUtilp->getChatLogsDir()); LLFile::mkdir(gDirUtilp->getPerAccountChatLogsDir()); - - //good a place as any to create user windlight directories - std::string user_windlight_path_name(gDirUtilp->getExpandedFilename( LL_PATH_USER_SETTINGS , "windlight", "")); - LLFile::mkdir(user_windlight_path_name.c_str()); - - std::string user_windlight_skies_path_name(gDirUtilp->getExpandedFilename( LL_PATH_USER_SETTINGS , "windlight/skies", "")); - LLFile::mkdir(user_windlight_skies_path_name.c_str()); - - std::string user_windlight_water_path_name(gDirUtilp->getExpandedFilename( LL_PATH_USER_SETTINGS , "windlight/water", "")); - LLFile::mkdir(user_windlight_water_path_name.c_str()); - - std::string user_windlight_days_path_name(gDirUtilp->getExpandedFilename( LL_PATH_USER_SETTINGS , "windlight/days", "")); - LLFile::mkdir(user_windlight_days_path_name.c_str()); - - if (show_connect_box) { LLSLURL slurl; diff --git a/indra/newview/llviewermenu.cpp b/indra/newview/llviewermenu.cpp index 1bbda04ae6..c9b13f92d3 100644 --- a/indra/newview/llviewermenu.cpp +++ b/indra/newview/llviewermenu.cpp @@ -8616,7 +8616,6 @@ class LLWorldEnvPreset : public view_listener_t { std::string item = userdata.asString(); -// *LAPRAS* These go away! Keep for the moment. if (item == "new_water") { LLFloaterReg::showInstance("env_fixed_environmentent_water", "new"); diff --git a/indra/newview/llviewermessage.cpp b/indra/newview/llviewermessage.cpp index 0597347ca8..e610387b37 100644 --- a/indra/newview/llviewermessage.cpp +++ b/indra/newview/llviewermessage.cpp @@ -3780,11 +3780,24 @@ void process_time_synch(LLMessageSystem *mesgsys, void **user_data) LLWorld::getInstance()->setSpaceTimeUSec(space_time_usec); - LL_DEBUGS("WindlightSync") << "Sun phase: " << phase << " rad = " << fmodf(phase / F_TWO_PI + 0.25, 1.f) * 24.f << " h" << LL_ENDL; + LL_DEBUGS("ENVIRONMENT") << "Sun phase: " << phase << " rad = " << fmodf(phase / F_TWO_PI + 0.25, 1.f) * 24.f << " h" << LL_ENDL; - - /* LAPRAS - We decode these parts of the message but ignore them + F32 region_phase = LLEnvironment::instance().getRegionProgress(); + if (region_phase >= 0.0) + { + F32 adjusted_phase = fmodf(phase / F_TWO_PI + 0.25, 1.f); + F32 delta_phase = adjusted_phase - region_phase; + + LL_DEBUGS("ENVIRONMENT") << "adjusted phase = " << adjusted_phase << " local phase = " << region_phase << " delta = " << delta_phase << LL_ENDL; + + if (!LLEnvironment::instance().isExtendedEnvironmentEnabled() && (fabs(delta_phase) > 0.125)) + { + LL_INFOS("ENVIRONMENT") << "Adjusting environment to match region. adjustment=" << delta_phase << LL_ENDL; + LLEnvironment::instance().adjustRegionOffset(delta_phase); + } + } + + /* We decode these parts of the message but ignore them as the real values are provided elsewhere. */ (void)sun_direction, (void)moon_direction, (void)phase; } diff --git a/indra/newview/llviewerparcelmgr.cpp b/indra/newview/llviewerparcelmgr.cpp index cca02544ee..e2a7c563a7 100644 --- a/indra/newview/llviewerparcelmgr.cpp +++ b/indra/newview/llviewerparcelmgr.cpp @@ -1670,7 +1670,7 @@ void LLViewerParcelMgr::processParcelProperties(LLMessageSystem *msg, void **use } } parcel->setParcelEnvironmentVersion(parcel_environment_version); - LL_WARNS("LAPRAS") << "Parcel environment version is " << parcel->getParcelEnvironmentVersion() << LL_ENDL; + 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; @@ -1682,7 +1682,7 @@ void LLViewerParcelMgr::processParcelProperties(LLMessageSystem *msg, void **use parcel_mgr.mAgentParcel->unpackMessage(msg); if ((LLEnvironment::instance().isExtendedEnvironmentEnabled() && environment_changed)) { - LL_WARNS("LAPRAS") << "Parcel environment version is " << parcel->getParcelEnvironmentVersion() << LL_ENDL; + LL_DEBUGS("ENVIRONMENT") << "Parcel environment version is " << parcel->getParcelEnvironmentVersion() << LL_ENDL; LLEnvironment::instance().requestParcel(local_id); } } -- cgit v1.3