From c8a932fa8a09a925c0cb3a0bc25e90456bb56d68 Mon Sep 17 00:00:00 2001 From: andreykproductengine Date: Fri, 25 Aug 2017 16:43:19 +0300 Subject: MAINT-989 Fixed Avatar Physics Vary Extremely With Different Framerates --- indra/newview/llphysicsmotion.cpp | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/indra/newview/llphysicsmotion.cpp b/indra/newview/llphysicsmotion.cpp index ea10d03264..65b57a2790 100644 --- a/indra/newview/llphysicsmotion.cpp +++ b/indra/newview/llphysicsmotion.cpp @@ -44,7 +44,7 @@ typedef std::map controller_map_t; typedef std::map default_controller_map_t; #define MIN_REQUIRED_PIXEL_AREA_AVATAR_PHYSICS_MOTION 0.f -#define TIME_ITERATION_STEP 0.1f +#define TIME_ITERATION_STEP 0.033f // roughtly 30 fps inline F64 llsgn(const F64 a) { @@ -493,8 +493,8 @@ BOOL LLPhysicsMotion::onUpdate(F32 time) const F32 time_delta = time - mLastTime; - // Don't update too frequently, to avoid precision errors from small time slices. - if (time_delta <= .01) + // Don't update too frequently (below 0.01), to avoid precision errors from small time slices. + if (time_delta <= TIME_ITERATION_STEP) { return FALSE; } @@ -561,7 +561,10 @@ BOOL LLPhysicsMotion::onUpdate(F32 time) F32 time_iteration_step = TIME_ITERATION_STEP; if (time_iteration + TIME_ITERATION_STEP > time_delta) { - time_iteration_step = time_delta-time_iteration; + time_iteration_step = time_delta - time_iteration; + // Leave the rest for next update. + mLastTime = time - time_iteration_step; + break; } // mPositon_local should be in normalized 0,1 range already. Just making sure... @@ -716,7 +719,6 @@ BOOL LLPhysicsMotion::onUpdate(F32 time) mAccelerationJoint_local = acceleration_joint_local; mPosition_local = position_new_local; } - mLastTime = time; mPosition_world = joint->getWorldPosition(); mVelocityJoint_local = velocity_joint_local; -- cgit v1.2.3 From 0b7020c0c57560e8ffd13ea57e378807222e4680 Mon Sep 17 00:00:00 2001 From: Mnikolenko Productengine Date: Fri, 15 Sep 2017 16:45:46 +0300 Subject: MAINT-7801 FIXED "Take a snapshot" fails to assign new snapshot for Outfit if default folder for uploads was changed --- indra/newview/lloutfitgallery.cpp | 28 ++++++++++++++++++++++------ indra/newview/lloutfitgallery.h | 2 ++ 2 files changed, 24 insertions(+), 6 deletions(-) diff --git a/indra/newview/lloutfitgallery.cpp b/indra/newview/lloutfitgallery.cpp index cca65f2ce1..c38d3ab140 100644 --- a/indra/newview/lloutfitgallery.cpp +++ b/indra/newview/lloutfitgallery.cpp @@ -72,6 +72,7 @@ LLOutfitGallery::LLOutfitGallery(const LLOutfitGallery::Params& p) mItemsAddedCount(0), mOutfitLinkPending(NULL), mOutfitRenamePending(NULL), + mSnapshotFolderID(NULL), mRowPanelHeight(p.row_panel_height), mVerticalGap(p.vertical_gap), mHorizontalGap(p.horizontal_gap), @@ -1011,8 +1012,8 @@ void LLOutfitGallery::onTextureSelectionChanged(LLInventoryItem* itemp) void LLOutfitGallery::loadPhotos() { //Iterate over inventory - LLUUID textures = gInventory.findCategoryUUIDForType(LLFolderType::FT_TEXTURE); - LLViewerInventoryCategory* textures_category = gInventory.getCategory(textures); + mSnapshotFolderID = gInventory.findUserDefinedCategoryUUIDForType(LLFolderType::FT_TEXTURE); + LLViewerInventoryCategory* textures_category = gInventory.getCategory(mSnapshotFolderID); if (!textures_category) return; if (mTexturesObserver == NULL) @@ -1022,12 +1023,26 @@ void LLOutfitGallery::loadPhotos() } // Start observing changes in "Textures" category. - mTexturesObserver->addCategory(textures, - boost::bind(&LLOutfitGallery::refreshTextures, this, textures)); - + mTexturesObserver->addCategory(mSnapshotFolderID, + boost::bind(&LLOutfitGallery::refreshTextures, this, mSnapshotFolderID)); + textures_category->fetch(); } +void LLOutfitGallery::updateSnapshotFolderObserver() +{ + if(mSnapshotFolderID != gInventory.findUserDefinedCategoryUUIDForType(LLFolderType::FT_TEXTURE)) + { + if (gInventory.containsObserver(mTexturesObserver)) + { + gInventory.removeObserver(mTexturesObserver); + } + delete mTexturesObserver; + mTexturesObserver = NULL; + loadPhotos(); + } +} + void LLOutfitGallery::refreshOutfit(const LLUUID& category_id) { LLViewerInventoryCategory* category = gInventory.getCategory(category_id); @@ -1200,7 +1215,7 @@ void LLOutfitGallery::uploadPhoto(LLUUID outfit_id) LLViewerInventoryCategory *outfit_cat = gInventory.getCategory(outfit_id); if (!outfit_cat) return; - + updateSnapshotFolderObserver(); checkRemovePhoto(outfit_id); std::string upload_pending_name = outfit_id.asString(); std::string upload_pending_desc = ""; @@ -1372,6 +1387,7 @@ void LLOutfitGallery::onBeforeOutfitSnapshotSave() if (!selected_outfit_id.isNull()) { checkRemovePhoto(selected_outfit_id); + updateSnapshotFolderObserver(); } } diff --git a/indra/newview/lloutfitgallery.h b/indra/newview/lloutfitgallery.h index b1ca850508..383924a7d6 100644 --- a/indra/newview/lloutfitgallery.h +++ b/indra/newview/lloutfitgallery.h @@ -130,6 +130,7 @@ protected: private: void loadPhotos(); void uploadPhoto(LLUUID outfit_id); + void updateSnapshotFolderObserver(); LLUUID getPhotoAssetId(const LLUUID& outfit_id); LLUUID getDefaultPhoto(); void linkPhotoToOutfit(LLUUID outfit_id, LLUUID photo_id); @@ -168,6 +169,7 @@ private: LLPanel* mLastRowPanel; LLUUID mOutfitLinkPending; LLUUID mOutfitRenamePending; + LLUUID mSnapshotFolderID; LLTextBox* mMessageTextBox; bool mGalleryCreated; int mRowCount; -- cgit v1.2.3 From 18483e902c0c821dc5d0bb8349f83d1a3b34d5a8 Mon Sep 17 00:00:00 2001 From: andreykproductengine Date: Mon, 18 Sep 2017 18:11:04 +0300 Subject: MAINT-7779 Protections against wrong data --- indra/newview/lltexturecache.cpp | 19 +++++++++---------- 1 file changed, 9 insertions(+), 10 deletions(-) diff --git a/indra/newview/lltexturecache.cpp b/indra/newview/lltexturecache.cpp index f0c28041d1..87a2c0ae60 100644 --- a/indra/newview/lltexturecache.cpp +++ b/indra/newview/lltexturecache.cpp @@ -550,9 +550,11 @@ bool LLTextureCacheRemoteWorker::doWrite() { if ((mOffset != 0) // We currently do not support write offsets || (mDataSize <= 0) // Things will go badly wrong if mDataSize is nul or negative... - || (mImageSize < mDataSize)) + || (mImageSize < mDataSize) + || (mRawDiscardLevel < 0) + || (mRawImage->isBufferInvalid())) // decode failed or malfunctioned, don't write { - LL_WARNS() << "INIT state check failed" << LL_ENDL; + LL_WARNS() << "INIT state check failed for image: " << mID << " Size: " << mImageSize << " DataSize: " << mDataSize << " Discard:" << mRawDiscardLevel << LL_ENDL; mDataSize = -1; // failed done = true; } @@ -577,15 +579,12 @@ bool LLTextureCacheRemoteWorker::doWrite() idx = mCache->setHeaderCacheEntry(mID, entry, mImageSize, mDataSize); // create the new entry. if(idx >= 0) { - // (almost always) write to the fast cache. - if (mRawImage->getDataSize()) + // write to the fast cache. + if(!mCache->writeToFastCache(idx, mRawImage, mRawDiscardLevel)) { - if(!mCache->writeToFastCache(idx, mRawImage, mRawDiscardLevel)) - { - LL_WARNS() << "writeToFastCache failed" << LL_ENDL; - mDataSize = -1; // failed - done = true; - } + LL_WARNS() << "writeToFastCache failed" << LL_ENDL; + mDataSize = -1; // failed + done = true; } } } -- cgit v1.2.3 From 012ba25d45e1c0c09090ee11204ee31eceb4b81f Mon Sep 17 00:00:00 2001 From: Mnikolenko Productengine Date: Tue, 19 Sep 2017 11:15:51 +0300 Subject: MAINT-7811 FIXED The "Use Texture" option appears when it shouldn't be displayed --- indra/newview/llpanelface.cpp | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/indra/newview/llpanelface.cpp b/indra/newview/llpanelface.cpp index a16259886d..f95a83f427 100644 --- a/indra/newview/llpanelface.cpp +++ b/indra/newview/llpanelface.cpp @@ -1623,6 +1623,15 @@ void LLPanelFace::updateShinyControls(bool is_setting_texture, bool mess_with_sh } } } + else + { + if (shiny_texture_ID.isNull() && comboShiny && comboShiny->itemExists(USE_TEXTURE)) + { + comboShiny->remove(SHINY_TEXTURE); + comboShiny->selectFirstItem(); + } + } + LLComboBox* combo_matmedia = getChild("combobox matmedia"); LLRadioGroup* radio_mat_type = getChild("radio_material_type"); -- cgit v1.2.3 From a27466ca07e5568442053e02ac9e76297ee74787 Mon Sep 17 00:00:00 2001 From: Mnikolenko Productengine Date: Thu, 21 Sep 2017 12:19:02 +0300 Subject: MAINT-7822 Crash in LLScriptFloaterManager() --- indra/newview/llscriptfloater.cpp | 15 ++++++++++++++- indra/newview/llscriptfloater.h | 1 + 2 files changed, 15 insertions(+), 1 deletion(-) diff --git a/indra/newview/llscriptfloater.cpp b/indra/newview/llscriptfloater.cpp index b2c450aa0c..da912ef3d4 100644 --- a/indra/newview/llscriptfloater.cpp +++ b/indra/newview/llscriptfloater.cpp @@ -349,8 +349,8 @@ void LLScriptFloater::hideToastsIfNeeded() ////////////////////////////////////////////////////////////////////////// LLScriptFloaterManager::LLScriptFloaterManager() + : mDialogLimitationsSlot() { - gSavedSettings.getControl("ScriptDialogLimitations")->getCommitSignal()->connect(boost::bind(&clearScriptNotifications)); } void LLScriptFloaterManager::onAddNotification(const LLUUID& notification_id) @@ -361,6 +361,19 @@ void LLScriptFloaterManager::onAddNotification(const LLUUID& notification_id) return; } + if (!mDialogLimitationsSlot.connected()) + { + LLPointer cntrl_ptr = gSavedSettings.getControl("ScriptDialogLimitations"); + if (cntrl_ptr.notNull()) + { + mDialogLimitationsSlot = cntrl_ptr->getCommitSignal()->connect(boost::bind(&clearScriptNotifications)); + } + else + { + LL_WARNS() << "Unable to set signal on setting 'ScriptDialogLimitations'" << LL_ENDL; + } + } + // get scripted Object's ID LLUUID object_id = notification_id_to_object_id(notification_id); diff --git a/indra/newview/llscriptfloater.h b/indra/newview/llscriptfloater.h index 0192a8893e..3695b8a3e1 100644 --- a/indra/newview/llscriptfloater.h +++ b/indra/newview/llscriptfloater.h @@ -139,6 +139,7 @@ private: typedef std::map floater_position_map_t; floater_position_map_t mFloaterPositions; + boost::signals2::connection mDialogLimitationsSlot; }; /** -- cgit v1.2.3 From 818a0f7f774655d9fa58d3e1a452439e334aaf56 Mon Sep 17 00:00:00 2001 From: AndreyL ProductEngine Date: Wed, 20 Sep 2017 15:01:36 +0300 Subject: MAINT-7790 Fixed vertical image alignment for buttons --- indra/llui/llbutton.cpp | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/indra/llui/llbutton.cpp b/indra/llui/llbutton.cpp index 8c7df45884..510a2537b9 100644 --- a/indra/llui/llbutton.cpp +++ b/indra/llui/llbutton.cpp @@ -808,11 +808,12 @@ void LLButton::draw() } else { - imagep->draw(0, 0, (enabled ? mImageColor.get() : disabled_color) % alpha ); + S32 y = getLocalRect().getHeight() - imagep->getHeight(); + imagep->draw(0, y, (enabled ? mImageColor.get() : disabled_color) % alpha); if (mCurGlowStrength > 0.01f) { gGL.setSceneBlendType(glow_type); - imagep->drawSolid(0, 0, glow_color % (mCurGlowStrength * alpha)); + imagep->drawSolid(0, y, glow_color % (mCurGlowStrength * alpha)); gGL.setSceneBlendType(LLRender::BT_ALPHA); } } @@ -954,7 +955,8 @@ void LLButton::drawBorder(LLUIImage* imagep, const LLColor4& color, S32 size) } else { - imagep->drawBorder(0, 0, color, size); + S32 y = getLocalRect().getHeight() - imagep->getHeight(); + imagep->drawBorder(0, y, color, size); } } -- cgit v1.2.3 From f4e303c067bbf4fdad2fe8f8c02878bee3b74cb0 Mon Sep 17 00:00:00 2001 From: andreykproductengine Date: Thu, 21 Sep 2017 17:01:45 +0300 Subject: MAINT-1209 Fixed Light does not revert to a simple light when texture is set to none --- indra/newview/llpanelvolume.cpp | 19 ++++++++----------- indra/newview/llpanelvolume.h | 1 - 2 files changed, 8 insertions(+), 12 deletions(-) diff --git a/indra/newview/llpanelvolume.cpp b/indra/newview/llpanelvolume.cpp index c9f8683e0e..b1895bfc9b 100644 --- a/indra/newview/llpanelvolume.cpp +++ b/indra/newview/llpanelvolume.cpp @@ -710,22 +710,20 @@ void LLPanelVolume::onLightCancelColor(const LLSD& data) void LLPanelVolume::onLightCancelTexture(const LLSD& data) { LLTextureCtrl* LightTextureCtrl = getChild("light texture control"); - - if (LightTextureCtrl) - { - LightTextureCtrl->setImageAssetID(mLightSavedTexture); - } - LLVOVolume *volobjp = (LLVOVolume *) mObject.get(); - if(volobjp) + + if (volobjp && LightTextureCtrl) { // Cancel the light texture as requested // NORSPEC-292 - // + // + // Texture picker triggers cancel both in case of actual cancel and in case of + // selection of "None" texture. + LLUUID tex_id = LightTextureCtrl->getImageAssetID(); bool is_spotlight = volobjp->isLightSpotlight(); - volobjp->setLightTextureID(mLightSavedTexture); //updates spotlight + volobjp->setLightTextureID(tex_id); //updates spotlight - if (!is_spotlight && mLightSavedTexture.notNull()) + if (!is_spotlight && tex_id.notNull()) { LLVector3 spot_params = volobjp->getSpotLightParams(); getChild("Light FOV")->setValue(spot_params.mV[0]); @@ -769,7 +767,6 @@ void LLPanelVolume::onLightSelectTexture(const LLSD& data) { LLUUID id = LightTextureCtrl->getImageAssetID(); volobjp->setLightTextureID(id); - mLightSavedTexture = id; } } diff --git a/indra/newview/llpanelvolume.h b/indra/newview/llpanelvolume.h index deb6b6f2a6..e3453ae99c 100644 --- a/indra/newview/llpanelvolume.h +++ b/indra/newview/llpanelvolume.h @@ -111,7 +111,6 @@ protected: LLColor4 mLightSavedColor; - LLUUID mLightSavedTexture; LLPointer mObject; LLPointer mRootObject; -- cgit v1.2.3 From a65c18c1d370b34cb41e8130bca2e5e068bac553 Mon Sep 17 00:00:00 2001 From: Mnikolenko Productengine Date: Tue, 26 Sep 2017 11:21:02 +0300 Subject: MAINT-7824 FIXED Items inside other notecards with full perms refuse to copy into inventory when being looked at inside an object. --- indra/newview/llpreviewnotecard.cpp | 10 ++++++++++ indra/newview/llpreviewnotecard.h | 1 + indra/newview/llviewertexteditor.h | 3 ++- 3 files changed, 13 insertions(+), 1 deletion(-) diff --git a/indra/newview/llpreviewnotecard.cpp b/indra/newview/llpreviewnotecard.cpp index 850c3b350d..d4a8bbdf45 100644 --- a/indra/newview/llpreviewnotecard.cpp +++ b/indra/newview/llpreviewnotecard.cpp @@ -163,6 +163,16 @@ BOOL LLPreviewNotecard::canClose() } } +/* virtual */ +void LLPreviewNotecard::setObjectID(const LLUUID& object_id) +{ + LLPreview::setObjectID(object_id); + + LLViewerTextEditor* editor = getChild("Notecard Editor"); + editor->setNotecardObjectID(mObjectUUID); + editor->makePristine(); +} + const LLInventoryItem* LLPreviewNotecard::getDragItem() { LLViewerTextEditor* editor = getChild("Notecard Editor"); diff --git a/indra/newview/llpreviewnotecard.h b/indra/newview/llpreviewnotecard.h index 017c4485ba..46a6d0ef50 100644 --- a/indra/newview/llpreviewnotecard.h +++ b/indra/newview/llpreviewnotecard.h @@ -47,6 +47,7 @@ public: virtual ~LLPreviewNotecard(); bool saveItem(); + void setObjectID(const LLUUID& object_id); // llview virtual void draw(); diff --git a/indra/newview/llviewertexteditor.h b/indra/newview/llviewertexteditor.h index 33cfca4f90..44f104dde1 100644 --- a/indra/newview/llviewertexteditor.h +++ b/indra/newview/llviewertexteditor.h @@ -71,7 +71,8 @@ public: mObjectID = object_id; mPreviewID = preview_id; } - + void setNotecardObjectID(const LLUUID& object_id){ mObjectID = object_id;} + void setASCIIEmbeddedText(const std::string& instr); void setEmbeddedText(const std::string& instr); std::string getEmbeddedText(); -- cgit v1.2.3 From 515687cc32a96b8eb3ac78b077351e6d35a88abc Mon Sep 17 00:00:00 2001 From: Mnikolenko Productengine Date: Tue, 26 Sep 2017 11:26:04 +0300 Subject: MAINT-7846 The link in the required update modal should open the download web page in external browser. --- indra/newview/skins/default/xui/en/notifications.xml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/indra/newview/skins/default/xui/en/notifications.xml b/indra/newview/skins/default/xui/en/notifications.xml index ee1ff372a7..9af4b299de 100644 --- a/indra/newview/skins/default/xui/en/notifications.xml +++ b/indra/newview/skins/default/xui/en/notifications.xml @@ -3991,7 +3991,8 @@ http://secondlife.com/download. + type="alertmodal" + force_urls_external="true"> There is a required update for your Second Life Installation. You may download this update from http://www.secondlife.com/downloads -- cgit v1.2.3 From 36c991877f128bfb76e1b6d476d7f49956c0d87f Mon Sep 17 00:00:00 2001 From: daianakproductengine Date: Tue, 26 Sep 2017 18:22:05 +0300 Subject: MAINT-1208 Fixed 'Save as' screenshot dialog doesn't allow to save screenshot without automatically adding number to name of file --- indra/newview/llviewerwindow.cpp | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/indra/newview/llviewerwindow.cpp b/indra/newview/llviewerwindow.cpp index b052a48424..7b4895b862 100644 --- a/indra/newview/llviewerwindow.cpp +++ b/indra/newview/llviewerwindow.cpp @@ -4379,6 +4379,8 @@ BOOL LLViewerWindow::saveImageNumbered(LLImageFormatted *image, BOOL force_picke else pick_type = LLFilePicker::FFSAVE_ALL; // ??? + BOOL is_snapshot_name_loc_set = isSnapshotLocSet(); + // Get a base file location if needed. if (force_picker || !isSnapshotLocSet()) { @@ -4427,7 +4429,12 @@ BOOL LLViewerWindow::saveImageNumbered(LLImageFormatted *image, BOOL force_picke filepath = sSnapshotDir; filepath += gDirUtilp->getDirDelimiter(); filepath += sSnapshotBaseName; - filepath += llformat("_%.3d",i); + + if (is_snapshot_name_loc_set) + { + filepath += llformat("_%.3d",i); + } + filepath += extension; llstat stat_info; -- cgit v1.2.3 From e6e606df3cbe6373e90c7bd82c419103f8243971 Mon Sep 17 00:00:00 2001 From: ruslantproductengine Date: Thu, 28 Sep 2017 14:32:29 +0300 Subject: MAINT-7666 [CEF] mouse cursor target is offset on login screen for high resolution screens --- indra/newview/llmediactrl.cpp | 88 ++++++++++++++++++++++++------------------- indra/newview/llmediactrl.h | 3 ++ 2 files changed, 53 insertions(+), 38 deletions(-) diff --git a/indra/newview/llmediactrl.cpp b/indra/newview/llmediactrl.cpp index 00043d1e72..803bacc567 100644 --- a/indra/newview/llmediactrl.cpp +++ b/indra/newview/llmediactrl.cpp @@ -805,44 +805,8 @@ void LLMediaCtrl::draw() F32 max_u = ( F32 )media_plugin->getWidth() / ( F32 )media_plugin->getTextureWidth(); F32 max_v = ( F32 )media_plugin->getHeight() / ( F32 )media_plugin->getTextureHeight(); - LLRect r = getRect(); - S32 width, height; - S32 x_offset = 0; - S32 y_offset = 0; - - if(mStretchToFill) - { - if(mMaintainAspectRatio) - { - F32 media_aspect = (F32)(media_plugin->getWidth()) / (F32)(media_plugin->getHeight()); - F32 view_aspect = (F32)(r.getWidth()) / (F32)(r.getHeight()); - if(media_aspect > view_aspect) - { - // max width, adjusted height - width = r.getWidth(); - height = llmin(llmax(ll_round(width / media_aspect), 0), r.getHeight()); - } - else - { - // max height, adjusted width - height = r.getHeight(); - width = llmin(llmax(ll_round(height * media_aspect), 0), r.getWidth()); - } - } - else - { - width = r.getWidth(); - height = r.getHeight(); - } - } - else - { - width = llmin(media_plugin->getWidth(), r.getWidth()); - height = llmin(media_plugin->getHeight(), r.getHeight()); - } - - x_offset = (r.getWidth() - width) / 2; - y_offset = (r.getHeight() - height) / 2; + S32 x_offset, y_offset, width, height; + calcOffsetsAndSize(&x_offset, &y_offset, &width, &height); // draw the browser gGL.begin( LLRender::QUADS ); @@ -899,10 +863,58 @@ void LLMediaCtrl::draw() setBackgroundOpaque(background_opaque); } +//////////////////////////////////////////////////////////////////////////////// +// +void LLMediaCtrl::calcOffsetsAndSize(S32 *x_offset, S32 *y_offset, S32 *width, S32 *height) +{ + const LLRect &r = getRect(); + *x_offset = *y_offset = 0; + + if (mStretchToFill) + { + if (mMaintainAspectRatio) + { + F32 media_aspect = (F32)(mMediaSource->getMediaPlugin()->getWidth()) / (F32)(mMediaSource->getMediaPlugin()->getHeight()); + F32 view_aspect = (F32)(r.getWidth()) / (F32)(r.getHeight()); + if (media_aspect > view_aspect) + { + // max width, adjusted height + *width = r.getWidth(); + *height = llmin(llmax(ll_round(*width / media_aspect), 0), r.getHeight()); + } + else + { + // max height, adjusted width + *height = r.getHeight(); + *width = llmin(llmax(ll_round(*height * media_aspect), 0), r.getWidth()); + } + } + else + { + *width = r.getWidth(); + *height = r.getHeight(); + } + } + else + { + *width = llmin(mMediaSource->getMediaPlugin()->getWidth(), r.getWidth()); + *height = llmin(mMediaSource->getMediaPlugin()->getHeight(), r.getHeight()); + } + + *x_offset = (r.getWidth() - *width) / 2; + *y_offset = (r.getHeight() - *height) / 2; +} + //////////////////////////////////////////////////////////////////////////////// // void LLMediaCtrl::convertInputCoords(S32& x, S32& y) { + S32 x_offset, y_offset, width, height; + calcOffsetsAndSize(&x_offset, &y_offset, &width, &height); + + x -= x_offset; + y -= y_offset; + bool coords_opengl = false; if(mMediaSource && mMediaSource->hasMedia()) diff --git a/indra/newview/llmediactrl.h b/indra/newview/llmediactrl.h index 125a67e23e..11400c8274 100644 --- a/indra/newview/llmediactrl.h +++ b/indra/newview/llmediactrl.h @@ -181,6 +181,9 @@ public: protected: void convertInputCoords(S32& x, S32& y); + private: + void calcOffsetsAndSize(S32 *x_offset, S32 *y_offset, S32 *width, S32 *height); + private: void onVisibilityChanged ( const LLSD& new_visibility ); void onPopup(const LLSD& notification, const LLSD& response); -- cgit v1.2.3 From d8dd2e7899e678781d4865cd52b2c3f1a7699924 Mon Sep 17 00:00:00 2001 From: Mnikolenko Productengine Date: Thu, 28 Sep 2017 16:13:44 +0300 Subject: MAINT-7835 Start location is not changed correctly via 'maps.secondlife.com' link in some cases --- indra/newview/llpanellogin.cpp | 9 +++++---- indra/newview/llpanellogin.h | 6 +++++- indra/newview/llstartup.cpp | 2 +- 3 files changed, 11 insertions(+), 6 deletions(-) diff --git a/indra/newview/llpanellogin.cpp b/indra/newview/llpanellogin.cpp index a88c10521c..8881222f2c 100644 --- a/indra/newview/llpanellogin.cpp +++ b/indra/newview/llpanellogin.cpp @@ -75,6 +75,7 @@ LLPanelLogin *LLPanelLogin::sInstance = NULL; BOOL LLPanelLogin::sCapslockDidNotification = FALSE; +BOOL LLPanelLogin::sCredentialSet = FALSE; class LLLoginLocationAutoHandler : public LLCommandHandler { @@ -176,6 +177,7 @@ LLPanelLogin::LLPanelLogin(const LLRect &rect, setBackgroundOpaque(TRUE); mPasswordModified = FALSE; + LLPanelLogin::sInstance = this; LLView* login_holder = gViewerWindow->getLoginPanelHolder(); @@ -458,6 +460,7 @@ void LLPanelLogin::setFields(LLPointer credential, LL_WARNS() << "Attempted fillFields with no login view shown" << LL_ENDL; return; } + sCredentialSet = TRUE; LL_INFOS("Credentials") << "Setting login fields to " << *credential << LL_ENDL; LLSD identifier = credential->getIdentifier(); @@ -680,10 +683,8 @@ void LLPanelLogin::onUpdateStartSLURL(const LLSLURL& new_start_slurl) } if ( new_start_slurl.getLocationString().length() ) { - if (location_combo->getCurrentIndex() == -1) - { - location_combo->setLabel(new_start_slurl.getLocationString()); - } + + location_combo->setLabel(new_start_slurl.getLocationString()); sInstance->mLocationLength = new_start_slurl.getLocationString().length(); sInstance->updateLoginButtons(); } diff --git a/indra/newview/llpanellogin.h b/indra/newview/llpanellogin.h index 869f2f8d39..82ef048493 100644 --- a/indra/newview/llpanellogin.h +++ b/indra/newview/llpanellogin.h @@ -56,9 +56,11 @@ public: void* callback_data); static void setFields(LLPointer credential, BOOL remember); - + static void getFields(LLPointer& credential, BOOL& remember); + static BOOL isCredentialSet() { return sCredentialSet; } + static BOOL areCredentialFieldsDirty(); static void setLocation(const LLSLURL& slurl); static void autologinToLocation(const LLSLURL& slurl); @@ -115,6 +117,8 @@ private: static LLPanelLogin* sInstance; static BOOL sCapslockDidNotification; bool mFirstLoginThisInstall; + + static BOOL sCredentialSet; unsigned int mUsernameLength; unsigned int mPasswordLength; diff --git a/indra/newview/llstartup.cpp b/indra/newview/llstartup.cpp index 8295ce029b..df1d2a3946 100644 --- a/indra/newview/llstartup.cpp +++ b/indra/newview/llstartup.cpp @@ -766,7 +766,7 @@ bool idle_startup() // Show the login dialog login_show(); // connect dialog is already shown, so fill in the names - if (gUserCredential.notNull()) + if (gUserCredential.notNull() && !LLPanelLogin::isCredentialSet()) { LLPanelLogin::setFields( gUserCredential, gRememberPassword); } -- cgit v1.2.3 From 5844a9372fdd6e009d4eee0702204f4642f17bf8 Mon Sep 17 00:00:00 2001 From: andreykproductengine Date: Thu, 28 Sep 2017 17:10:38 +0300 Subject: SL-775 Texture cache purge improvements --- indra/newview/lltexturecache.cpp | 95 +++++++++++++++++++++++++++++++++++++--- indra/newview/lltexturecache.h | 3 ++ 2 files changed, 93 insertions(+), 5 deletions(-) diff --git a/indra/newview/lltexturecache.cpp b/indra/newview/lltexturecache.cpp index 87a2c0ae60..1aa95f996a 100644 --- a/indra/newview/lltexturecache.cpp +++ b/indra/newview/lltexturecache.cpp @@ -53,6 +53,7 @@ const F32 TEXTURE_CACHE_PURGE_AMOUNT = .20f; // % amount to reduce the cache by const F32 TEXTURE_CACHE_LRU_SIZE = .10f; // % amount for LRU list (low overhead to regenerate) const S32 TEXTURE_FAST_CACHE_ENTRY_OVERHEAD = sizeof(S32) * 4; //w, h, c, level const S32 TEXTURE_FAST_CACHE_ENTRY_SIZE = 16 * 16 * 4 + TEXTURE_FAST_CACHE_ENTRY_OVERHEAD; +const F32 TEXTURE_LAZY_PURGE_TIME_LIMIT = .01f; // 10ms class LLTextureCacheWorker : public LLWorkerClass { @@ -1634,6 +1635,91 @@ void LLTextureCache::purgeAllTextures(bool purge_directories) LL_INFOS() << "The entire texture cache is cleared." << LL_ENDL ; } +void LLTextureCache::purgeTexturesLazy(F32 time_limit) +{ + if (mReadOnly) + { + return; + } + + if (!mThreaded) + { + // *FIX:Mani - watchdog off. + LLAppViewer::instance()->pauseMainloopTimeout(); + } + + // time_limit doesn't account for lock time + LLMutexLock lock(&mHeaderMutex); + + if (mPurgeEntryList.empty()) + { + // Read the entries list and form list of textures to purge + std::vector entries; + U32 num_entries = openAndReadEntries(entries); + if (!num_entries) + { + return; // nothing to purge + } + + // Use mTexturesSizeMap to collect UUIDs of textures with bodies + typedef std::set > time_idx_set_t; + std::set > time_idx_set; + for (size_map_t::iterator iter1 = mTexturesSizeMap.begin(); + iter1 != mTexturesSizeMap.end(); ++iter1) + { + if (iter1->second > 0) + { + id_map_t::iterator iter2 = mHeaderIDMap.find(iter1->first); + if (iter2 != mHeaderIDMap.end()) + { + S32 idx = iter2->second; + time_idx_set.insert(std::make_pair(entries[idx].mTime, idx)); + } + else + { + LL_ERRS() << "mTexturesSizeMap / mHeaderIDMap corrupted." << LL_ENDL; + } + } + } + + S64 cache_size = mTexturesSizeTotal; + S64 purged_cache_size = (sCacheMaxTexturesSize * (S64)((1.f - TEXTURE_CACHE_PURGE_AMOUNT) * 100)) / 100; + for (time_idx_set_t::iterator iter = time_idx_set.begin(); + iter != time_idx_set.end(); ++iter) + { + S32 idx = iter->second; + if (cache_size >= purged_cache_size) + { + cache_size -= entries[idx].mBodySize; + mPurgeEntryList.push_back(std::pair(idx, entries[idx])); + } + else + { + break; + } + } + LL_DEBUGS() << "Formed Purge list of " << mPurgeEntryList.size() << " entries" << LL_ENDL; + } + else + { + // Remove collected entried + LLTimer timer; + while (!mPurgeEntryList.empty() && timer.getElapsedTimeF32() < time_limit) + { + S32 idx = mPurgeEntryList.back().first; + Entry entry = mPurgeEntryList.back().second; + mPurgeEntryList.pop_back(); + // make sure record is still valid + id_map_t::iterator iter_header = mHeaderIDMap.find(entry.mID); + if (iter_header != mHeaderIDMap.end() && iter_header->second == idx) + { + removeEntry(idx, entry, getTextureFileName(entry.mID)); + writeEntryToHeaderImmediately(idx, entry); + } + } + } +} + void LLTextureCache::purgeTextures(bool validate) { if (mReadOnly) @@ -1887,11 +1973,10 @@ LLTextureCache::handle_t LLTextureCache::writeToCache(const LLUUID& id, U32 prio } if (mDoPurge) { - // NOTE: This may cause an occasional hiccup, - // but it really needs to be done on the control thread - // (i.e. here) - purgeTextures(false); - mDoPurge = FALSE; + // NOTE: Needs to be done on the control thread + // (i.e. here) + purgeTexturesLazy(TEXTURE_LAZY_PURGE_TIME_LIMIT); + mDoPurge = !mPurgeEntryList.empty(); } LLMutexLock lock(&mWorkersMutex); LLTextureCacheWorker* worker = new LLTextureCacheRemoteWorker(this, priority, id, diff --git a/indra/newview/lltexturecache.h b/indra/newview/lltexturecache.h index 95f9afc2bc..23d08d439c 100644 --- a/indra/newview/lltexturecache.h +++ b/indra/newview/lltexturecache.h @@ -155,6 +155,7 @@ private: void readHeaderCache(); void clearCorruptedCache(); void purgeAllTextures(bool purge_directories); + void purgeTexturesLazy(F32 time_limit); void purgeTextures(bool validate); LLAPRFile* openHeaderEntriesFile(bool readonly, S32 offset); void closeHeaderEntriesFile(); @@ -225,6 +226,8 @@ private: typedef std::map idx_entry_map_t; idx_entry_map_t mUpdatedEntryMap; + typedef std::vector> idx_entry_vector_t; + idx_entry_vector_t mPurgeEntryList; // Statics static F32 sHeaderCacheVersion; -- cgit v1.2.3 From f7b4b1fe2a4fde0bcb392f64656a5be53d99adb8 Mon Sep 17 00:00:00 2001 From: Mnikolenko Productengine Date: Fri, 29 Sep 2017 16:25:58 +0300 Subject: MAINT-7835 FIXED issue with resetting username after failed attempt to login --- indra/newview/llpanellogin.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/indra/newview/llpanellogin.cpp b/indra/newview/llpanellogin.cpp index 8881222f2c..0bcbdf7e67 100644 --- a/indra/newview/llpanellogin.cpp +++ b/indra/newview/llpanellogin.cpp @@ -863,6 +863,7 @@ void LLPanelLogin::onClickConnect(void *) } else { + sCredentialSet = FALSE; LLPointer cred; BOOL remember; getFields(cred, remember); -- cgit v1.2.3 From f33c96421049d0f0a447d9a51d4f29b655a7246a Mon Sep 17 00:00:00 2001 From: Mnikolenko Productengine Date: Tue, 3 Oct 2017 10:51:14 +0300 Subject: MAINT-7862 FIXED Crash in LLGroupMgr::sendGroupTitlesRequest(..) --- indra/newview/llcommandhandler.cpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/indra/newview/llcommandhandler.cpp b/indra/newview/llcommandhandler.cpp index 5ea7efc045..76d965b1f1 100644 --- a/indra/newview/llcommandhandler.cpp +++ b/indra/newview/llcommandhandler.cpp @@ -134,7 +134,11 @@ bool LLCommandHandlerRegistry::dispatch(const std::string& cmd, { break; } - + //skip initial request from external browser before STATE_BROWSER_INIT + if (LLStartUp::getStartupState() == STATE_FIRST) + { + return true; + } cur_time = LLTimer::getElapsedSeconds(); if (cur_time < last_throttle_time + THROTTLE_PERIOD) { -- cgit v1.2.3 From e0265d3754b190d28d5a5a55fc1a1e510d9aef59 Mon Sep 17 00:00:00 2001 From: Mnikolenko Productengine Date: Tue, 3 Oct 2017 12:00:11 +0300 Subject: build fix --- indra/newview/lltexturecache.cpp | 3 ++- indra/newview/lltexturecache.h | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/indra/newview/lltexturecache.cpp b/indra/newview/lltexturecache.cpp index 1aa95f996a..1000377718 100644 --- a/indra/newview/lltexturecache.cpp +++ b/indra/newview/lltexturecache.cpp @@ -1713,7 +1713,8 @@ void LLTextureCache::purgeTexturesLazy(F32 time_limit) id_map_t::iterator iter_header = mHeaderIDMap.find(entry.mID); if (iter_header != mHeaderIDMap.end() && iter_header->second == idx) { - removeEntry(idx, entry, getTextureFileName(entry.mID)); + std::string tex_filename = getTextureFileName(entry.mID); + removeEntry(idx, entry, tex_filename); writeEntryToHeaderImmediately(idx, entry); } } diff --git a/indra/newview/lltexturecache.h b/indra/newview/lltexturecache.h index 23d08d439c..bcc27c6598 100644 --- a/indra/newview/lltexturecache.h +++ b/indra/newview/lltexturecache.h @@ -226,7 +226,7 @@ private: typedef std::map idx_entry_map_t; idx_entry_map_t mUpdatedEntryMap; - typedef std::vector> idx_entry_vector_t; + typedef std::vector > idx_entry_vector_t; idx_entry_vector_t mPurgeEntryList; // Statics -- cgit v1.2.3 From 21d8a7f09ce544240a4d70df6e8879996c5059f6 Mon Sep 17 00:00:00 2001 From: Mnikolenko Productengine Date: Tue, 3 Oct 2017 15:17:35 +0300 Subject: startup crash fix --- indra/newview/llmediactrl.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/indra/newview/llmediactrl.cpp b/indra/newview/llmediactrl.cpp index 803bacc567..a8025906c7 100644 --- a/indra/newview/llmediactrl.cpp +++ b/indra/newview/llmediactrl.cpp @@ -872,7 +872,7 @@ void LLMediaCtrl::calcOffsetsAndSize(S32 *x_offset, S32 *y_offset, S32 *width, S if (mStretchToFill) { - if (mMaintainAspectRatio) + if (mMaintainAspectRatio && mMediaSource && mMediaSource->getMediaPlugin()) { F32 media_aspect = (F32)(mMediaSource->getMediaPlugin()->getWidth()) / (F32)(mMediaSource->getMediaPlugin()->getHeight()); F32 view_aspect = (F32)(r.getWidth()) / (F32)(r.getHeight()); -- cgit v1.2.3 From 5756d41595f3aa2fb1431d1859ee883c15814ae4 Mon Sep 17 00:00:00 2001 From: andreykproductengine Date: Mon, 2 Oct 2017 20:38:37 +0300 Subject: MAINT-7863 Fixed Log in keeps fetching marketplace folders and items --- indra/newview/llinventorymodel.cpp | 5 ----- 1 file changed, 5 deletions(-) diff --git a/indra/newview/llinventorymodel.cpp b/indra/newview/llinventorymodel.cpp index dc75e09ad9..054db2a3ec 100644 --- a/indra/newview/llinventorymodel.cpp +++ b/indra/newview/llinventorymodel.cpp @@ -2058,11 +2058,6 @@ bool LLInventoryModel::loadSkeleton( // correct contents the next time the viewer opens the folder. tcat->setVersion(NO_VERSION); } - else if (tcat->getPreferredType() == LLFolderType::FT_MARKETPLACE_STOCK) - { - // Do not trust stock folders being updated - tcat->setVersion(NO_VERSION); - } else { cached_ids.insert(tcat->getUUID()); -- cgit v1.2.3 From 13565cdf0e98f35d3c2735bbda2ab2bcaf2f1235 Mon Sep 17 00:00:00 2001 From: Mnikolenko Productengine Date: Thu, 5 Oct 2017 15:47:02 +0300 Subject: MAINT-7871 Blocked residents can pay 1L$ to Blocker and use pay message to avoid block --- indra/newview/llviewermessage.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/indra/newview/llviewermessage.cpp b/indra/newview/llviewermessage.cpp index 1ce18f5496..4848101750 100644 --- a/indra/newview/llviewermessage.cpp +++ b/indra/newview/llviewermessage.cpp @@ -5664,7 +5664,8 @@ static void process_money_balance_reply_extended(LLMessageSystem* msg) args["NAME"] = source_slurl; is_name_group = is_source_group; name_id = source_id; - if (!reason.empty()) + + if (!reason.empty() && !LLMuteList::getInstance()->isMuted(source_id)) { message = LLTrans::getString("paid_you_ldollars" + gift_suffix, args); } -- cgit v1.2.3 From 1bf5806f31dc7083564da27942838a3b69e92806 Mon Sep 17 00:00:00 2001 From: andreykproductengine Date: Fri, 6 Oct 2017 16:03:41 +0300 Subject: MAINT-1013 Changing YieldTime should show effects immediately --- indra/newview/llappviewer.cpp | 8 +++----- indra/newview/llappviewer.h | 1 - 2 files changed, 3 insertions(+), 6 deletions(-) diff --git a/indra/newview/llappviewer.cpp b/indra/newview/llappviewer.cpp index b7267fbdfe..3f4a111a9a 100644 --- a/indra/newview/llappviewer.cpp +++ b/indra/newview/llappviewer.cpp @@ -693,7 +693,6 @@ LLAppViewer::LLAppViewer() mSavePerAccountSettings(false), // don't save settings on logout unless login succeeded. mQuitRequested(false), mLogoutRequestSent(false), - mYieldTime(-1), mLastAgentControlFlags(0), mLastAgentForceUpdate(0), mMainloopTimeout(NULL), @@ -1457,10 +1456,11 @@ bool LLAppViewer::frame() LL_RECORD_BLOCK_TIME(FTM_SLEEP); // yield some time to the os based on command line option - if(mYieldTime >= 0) + static LLCachedControl yield_time(gSavedSettings, "YieldTime", -1); + if(yield_time >= 0) { LL_RECORD_BLOCK_TIME(FTM_YIELD); - ms_sleep(mYieldTime); + ms_sleep(yield_time); } // yield cooperatively when not running as foreground window @@ -2751,8 +2751,6 @@ bool LLAppViewer::initConfiguration() } } - mYieldTime = gSavedSettings.getS32("YieldTime"); - // Display splash screen. Must be after above check for previous // crash as this dialog is always frontmost. diff --git a/indra/newview/llappviewer.h b/indra/newview/llappviewer.h index 520ff68a02..52d2bce42b 100644 --- a/indra/newview/llappviewer.h +++ b/indra/newview/llappviewer.h @@ -291,7 +291,6 @@ private: bool mQuitRequested; // User wants to quit, may have modified documents open. bool mLogoutRequestSent; // Disconnect message sent to simulator, no longer safe to send messages to the sim. - S32 mYieldTime; U32 mLastAgentControlFlags; F32 mLastAgentForceUpdate; struct SettingsFiles* mSettingsLocationList; -- cgit v1.2.3 From 8adad782a071d2855543f006455a9f75fd3e4aec Mon Sep 17 00:00:00 2001 From: Mnikolenko Productengine Date: Mon, 9 Oct 2017 10:47:10 +0300 Subject: MAINT-7611 Chat history does not display in the conversation log for groups that have a leading space in their name --- indra/newview/llconversationlog.cpp | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) diff --git a/indra/newview/llconversationlog.cpp b/indra/newview/llconversationlog.cpp index 4e69896b69..9ccf9b98f7 100644 --- a/indra/newview/llconversationlog.cpp +++ b/indra/newview/llconversationlog.cpp @@ -196,8 +196,6 @@ LLConversationLog::LLConversationLog() : keep_log_ctrlp->getSignal()->connect(boost::bind(&LLConversationLog::enableLogging, this, _2)); if (log_mode > 0) { - loadFromFile(getFileName()); - enableLogging(log_mode); } } @@ -483,16 +481,15 @@ bool LLConversationLog::saveToFile(const std::string& filename) // examples of two file entries // [1343221177] 0 1 0 John Doe| 7e4ec5be-783f-49f5-71dz-16c58c64c145 4ec62a74-c246-0d25-2af6-846beac2aa55 john.doe| // [1343222639] 2 0 0 Ad-hoc Conference| c3g67c89-c479-4c97-b21d-32869bcfe8rc 68f1c33e-4135-3e3e-a897-8c9b23115c09 Ad-hoc Conference hash597394a0-9982-766d-27b8-c75560213b9a| - fprintf(fp, "[%lld] %d %d %d %s| %s %s %s|\n", (S64)conv_it->getTime().value(), (S32)conv_it->getConversationType(), (S32)0, (S32)conv_it->hasOfflineMessages(), - conv_it->getConversationName().c_str(), + conv_it->getConversationName().c_str(), participant_id.c_str(), conversation_id.c_str(), - conv_it->getHistoryFileName().c_str()); + LLURI::escape(conv_it->getHistoryFileName()).c_str()); } fclose(fp); return true; @@ -511,6 +508,7 @@ bool LLConversationLog::loadFromFile(const std::string& filename) LL_WARNS() << "Couldn't open call log list" << filename << LL_ENDL; return false; } + bool purge_required = false; char buffer[MAX_STRING]; char conv_name_buffer[MAX_STRING]; @@ -546,7 +544,7 @@ bool LLConversationLog::loadFromFile(const std::string& filename) .conversation_name(conv_name_buffer) .participant_id(LLUUID(part_id_buffer)) .session_id(LLUUID(conv_id_buffer)) - .history_filename(history_file_name); + .history_filename(LLURI::unescape(history_file_name)); LLConversation conversation(params); @@ -555,6 +553,7 @@ bool LLConversationLog::loadFromFile(const std::string& filename) // being over 30 days old should be purged from the conversation log text file on login. if (conversation.isOlderThan(CONVERSATION_LIFETIME)) { + purge_required = true; continue; } @@ -562,8 +561,11 @@ bool LLConversationLog::loadFromFile(const std::string& filename) } fclose(fp); - LLFile::remove(filename); - cache(); + if(purge_required) + { + LLFile::remove(filename); + cache(); + } notifyObservers(); return true; -- cgit v1.2.3 From 7d393759bae8028be8e2ca2d9e09b7b90a0d9ed5 Mon Sep 17 00:00:00 2001 From: andreykproductengine Date: Thu, 5 Oct 2017 16:03:49 +0300 Subject: MAINT-7820 Additional crash logging --- indra/llcommon/llcoros.cpp | 45 +++++++++++++++++++++++++++++++++++++++++++++ indra/llcommon/llcoros.h | 3 +++ 2 files changed, 48 insertions(+) diff --git a/indra/llcommon/llcoros.cpp b/indra/llcommon/llcoros.cpp index 3ffce4810a..934f04287d 100644 --- a/indra/llcommon/llcoros.cpp +++ b/indra/llcommon/llcoros.cpp @@ -40,6 +40,10 @@ #include "stringize.h" #include "llexception.h" +#if LL_WINDOWS +#include +#endif + namespace { void no_op() {} } // anonymous namespace @@ -272,6 +276,43 @@ void LLCoros::setStackSize(S32 stacksize) mStackSize = stacksize; } +#if LL_WINDOWS + +static const U32 STATUS_MSC_EXCEPTION = 0xE06D7363; // compiler specific + +U32 exception_filter(U32 code, struct _EXCEPTION_POINTERS *exception_infop) +{ + if (code == STATUS_MSC_EXCEPTION) + { + // C++ exception, go on + return EXCEPTION_CONTINUE_SEARCH; + } + else + { + // handle it + return EXCEPTION_EXECUTE_HANDLER; + } +} + +void LLCoros::winlevel(const callable_t& callable) +{ + __try + { + callable(); + } + __except (exception_filter(GetExceptionCode(), GetExceptionInformation())) + { + // convert to C++ styled exception + // Note: it might be better to use _se_set_translator + // if you want exception to inherit full callstack + char integer_string[32]; + sprintf(integer_string, "SEH, code: %lu\n", GetExceptionCode()); + throw std::exception(integer_string); + } +} + +#endif + // Top-level wrapper around caller's coroutine callable. This function accepts // the coroutine library's implicit coro::self& parameter and saves it, but // does not pass it down to the caller's callable. @@ -282,7 +323,11 @@ void LLCoros::toplevel(coro::self& self, CoroData* data, const callable_t& calla // run the code the caller actually wants in the coroutine try { +#if LL_WINDOWS + winlevel(callable); +#else callable(); +#endif } catch (const LLContinueError&) { diff --git a/indra/llcommon/llcoros.h b/indra/llcommon/llcoros.h index bbe2d22af4..884d6b159c 100644 --- a/indra/llcommon/llcoros.h +++ b/indra/llcommon/llcoros.h @@ -182,6 +182,9 @@ private: bool cleanup(const LLSD&); struct CoroData; static void no_cleanup(CoroData*); +#if LL_WINDOWS + static void winlevel(const callable_t& callable); +#endif static void toplevel(coro::self& self, CoroData* data, const callable_t& callable); static CoroData& get_CoroData(const std::string& caller); -- cgit v1.2.3 From 1baa1e6d4da09daa9e1314b643df45028fb47175 Mon Sep 17 00:00:00 2001 From: Mnikolenko Productengine Date: Mon, 9 Oct 2017 17:41:01 +0300 Subject: MAINT-7882 Crash in LLVOAvatar::logMetricsTimerRecord(...) --- indra/newview/llvoavatar.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/indra/newview/llvoavatar.cpp b/indra/newview/llvoavatar.cpp index efcdb07176..cc708ea275 100644 --- a/indra/newview/llvoavatar.cpp +++ b/indra/newview/llvoavatar.cpp @@ -7025,7 +7025,7 @@ void LLVOAvatar::logMetricsTimerRecord(const std::string& phase_name, F32 elapse record["elapsed"] = elapsed; record["completed"] = completed; U32 grid_x(0), grid_y(0); - if (getRegion()) + if (getRegion() && LLWorld::instance().isRegionListed(getRegion())) { record["central_bake_version"] = LLSD::Integer(getRegion()->getCentralBakeVersion()); grid_from_region_handle(getRegion()->getHandle(), &grid_x, &grid_y); -- cgit v1.2.3 From bff358ecc532ed22f7fcbfee978537098bd8be6d Mon Sep 17 00:00:00 2001 From: Mnikolenko Productengine Date: Tue, 10 Oct 2017 14:52:54 +0300 Subject: MAINT-7892 Show MOTD on teleport --- indra/newview/llviewerdisplay.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/indra/newview/llviewerdisplay.cpp b/indra/newview/llviewerdisplay.cpp index bfa9fa03fa..6d4fc94b63 100644 --- a/indra/newview/llviewerdisplay.cpp +++ b/indra/newview/llviewerdisplay.cpp @@ -441,6 +441,7 @@ void display(BOOL rebuild, F32 zoom_factor, int subfield, BOOL for_snapshot) gAgent.setTeleportMessage( LLAgent::sTeleportProgressMessages["requesting"]); gViewerWindow->setProgressString(LLAgent::sTeleportProgressMessages["requesting"]); + gViewerWindow->setProgressMessage(gAgent.mMOTD); break; case LLAgent::TELEPORT_REQUESTED: @@ -518,6 +519,7 @@ void display(BOOL rebuild, F32 zoom_factor, int subfield, BOOL for_snapshot) } gViewerWindow->setProgressPercent( percent_done ); + gViewerWindow->setProgressMessage(std::string()); } else if (gRestoreGL) @@ -539,6 +541,7 @@ void display(BOOL rebuild, F32 zoom_factor, int subfield, BOOL for_snapshot) gViewerWindow->setProgressPercent( percent_done ); } + gViewerWindow->setProgressMessage(std::string()); } ////////////////////////// -- cgit v1.2.3 From 746848bee9a2358a6229498901208db38c4b4542 Mon Sep 17 00:00:00 2001 From: Rider Linden Date: Thu, 6 Apr 2017 14:46:48 -0700 Subject: MAINT-7255: Change viewer to use UserInfo cap if available. --- indra/newview/llagent.cpp | 156 +++++++++++++++++++++++++++++++++----- indra/newview/llagent.h | 10 ++- indra/newview/llviewermessage.cpp | 2 +- indra/newview/llviewerregion.cpp | 1 + 4 files changed, 148 insertions(+), 21 deletions(-) diff --git a/indra/newview/llagent.cpp b/indra/newview/llagent.cpp index 8dd0b06ed2..ebff73debf 100644 --- a/indra/newview/llagent.cpp +++ b/indra/newview/llagent.cpp @@ -47,7 +47,9 @@ #include "llfloatercamera.h" #include "llfloaterimcontainer.h" #include "llfloaterperms.h" +#include "llfloaterpreference.h" #include "llfloaterreg.h" +#include "llfloatersnapshot.h" #include "llfloatertools.h" #include "llgroupactions.h" #include "llgroupmgr.h" @@ -4334,15 +4336,143 @@ void LLAgent::sendAgentDataUpdateRequest() void LLAgent::sendAgentUserInfoRequest() { - if(getID().isNull()) - return; // not logged in - gMessageSystem->newMessageFast(_PREHASH_UserInfoRequest); - gMessageSystem->nextBlockFast(_PREHASH_AgentData); - gMessageSystem->addUUIDFast(_PREHASH_AgentID, getID()); - gMessageSystem->addUUIDFast(_PREHASH_SessionID, getSessionID()); - sendReliableMessage(); + std::string cap; + + if (getID().isNull()) + return; // not logged in + + if (mRegionp) + cap = mRegionp->getCapability("UserInfo"); + + if (!cap.empty()) + { + LLCoros::instance().launch("requestAgentUserInfoCoro", + boost::bind(&LLAgent::requestAgentUserInfoCoro, this, cap)); + } + else + { + sendAgentUserInfoRequestMessage(); + } } +void LLAgent::requestAgentUserInfoCoro(std::string capurl) +{ + LLCore::HttpRequest::policy_t httpPolicy(LLCore::HttpRequest::DEFAULT_POLICY_ID); + LLCoreHttpUtil::HttpCoroutineAdapter::ptr_t + httpAdapter(new LLCoreHttpUtil::HttpCoroutineAdapter("requestAgentUserInfoCoro", httpPolicy)); + LLCore::HttpRequest::ptr_t httpRequest(new LLCore::HttpRequest); + LLCore::HttpOptions::ptr_t httpOpts(new LLCore::HttpOptions); + LLCore::HttpHeaders::ptr_t httpHeaders; + + httpOpts->setFollowRedirects(true); + + LLSD result = httpAdapter->getAndSuspend(httpRequest, capurl, httpOpts, httpHeaders); + + LLSD httpResults = result[LLCoreHttpUtil::HttpCoroutineAdapter::HTTP_RESULTS]; + LLCore::HttpStatus status = LLCoreHttpUtil::HttpCoroutineAdapter::getStatusFromLLSD(httpResults); + + if (!status) + { + LL_WARNS("UserInfo") << "Failed to get user information." << LL_ENDL; + return; + } + else if (!result["success"].asBoolean()) + { + LL_WARNS("UserInfo") << "Failed to get user information: " << result["message"] << LL_ENDL; + return; + } + + bool im_via_email; + std::string email; + std::string dir_visibility; + + im_via_email = result["im_via_email"].asBoolean(); + email = result["email"].asString(); + dir_visibility = result["directory_visibility"].asString(); + + // TODO: This should probably be changed. I'm not entirely comfortable + // having LLAgent interact directly with the UI in this way. + LLFloaterPreference::updateUserInfo(dir_visibility, im_via_email); + LLFloaterSnapshot::setAgentEmail(email); +} + +void LLAgent::sendAgentUpdateUserInfo(bool im_via_email, const std::string& directory_visibility) +{ + std::string cap; + + if (getID().isNull()) + return; // not logged in + + if (mRegionp) + cap = mRegionp->getCapability("UserInfo"); + + if (!cap.empty()) + { + LLCoros::instance().launch("updateAgentUserInfoCoro", + boost::bind(&LLAgent::updateAgentUserInfoCoro, this, cap, im_via_email, directory_visibility)); + } + else + { + sendAgentUpdateUserInfoMessage(im_via_email, directory_visibility); + } +} + + +void LLAgent::updateAgentUserInfoCoro(std::string capurl, bool im_via_email, std::string directory_visibility) +{ + LLCore::HttpRequest::policy_t httpPolicy(LLCore::HttpRequest::DEFAULT_POLICY_ID); + LLCoreHttpUtil::HttpCoroutineAdapter::ptr_t + httpAdapter(new LLCoreHttpUtil::HttpCoroutineAdapter("requestAgentUserInfoCoro", httpPolicy)); + LLCore::HttpRequest::ptr_t httpRequest(new LLCore::HttpRequest); + LLCore::HttpOptions::ptr_t httpOpts(new LLCore::HttpOptions); + LLCore::HttpHeaders::ptr_t httpHeaders; + + httpOpts->setFollowRedirects(true); + LLSD body(LLSDMap + ("dir_visibility", LLSD::String(directory_visibility)) + ("im_via_email", LLSD::Boolean(im_via_email))); + + LLSD result = httpAdapter->postAndSuspend(httpRequest, capurl, body, httpOpts, httpHeaders); + + LLSD httpResults = result[LLCoreHttpUtil::HttpCoroutineAdapter::HTTP_RESULTS]; + LLCore::HttpStatus status = LLCoreHttpUtil::HttpCoroutineAdapter::getStatusFromLLSD(httpResults); + + if (!status) + { + LL_WARNS("UserInfo") << "Failed to set user information." << LL_ENDL; + } + else if (!result["success"].asBoolean()) + { + LL_WARNS("UserInfo") << "Failed to set user information: " << result["message"] << LL_ENDL; + } +} + +// deprecated: +// May be removed when UserInfo cap propagates to all simhosts in grid +void LLAgent::sendAgentUserInfoRequestMessage() +{ + gMessageSystem->newMessageFast(_PREHASH_UserInfoRequest); + gMessageSystem->nextBlockFast(_PREHASH_AgentData); + gMessageSystem->addUUIDFast(_PREHASH_AgentID, getID()); + gMessageSystem->addUUIDFast(_PREHASH_SessionID, getSessionID()); + sendReliableMessage(); +} + +void LLAgent::sendAgentUpdateUserInfoMessage(bool im_via_email, const std::string& directory_visibility) +{ + gMessageSystem->newMessageFast(_PREHASH_UpdateUserInfo); + gMessageSystem->nextBlockFast(_PREHASH_AgentData); + gMessageSystem->addUUIDFast(_PREHASH_AgentID, getID()); + gMessageSystem->addUUIDFast(_PREHASH_SessionID, getSessionID()); + gMessageSystem->nextBlockFast(_PREHASH_UserData); + gMessageSystem->addBOOLFast(_PREHASH_IMViaEMail, im_via_email); + gMessageSystem->addString("DirectoryVisibility", directory_visibility); + gAgent.sendReliableMessage(); + +} +// end deprecated +//------ + void LLAgent::observeFriends() { if(!mFriendObserver) @@ -4410,18 +4540,6 @@ const void LLAgent::getTeleportSourceSLURL(LLSLURL& slurl) const slurl = *mTeleportSourceSLURL; } -void LLAgent::sendAgentUpdateUserInfo(bool im_via_email, const std::string& directory_visibility ) -{ - gMessageSystem->newMessageFast(_PREHASH_UpdateUserInfo); - gMessageSystem->nextBlockFast(_PREHASH_AgentData); - gMessageSystem->addUUIDFast(_PREHASH_AgentID, getID()); - gMessageSystem->addUUIDFast(_PREHASH_SessionID, getSessionID()); - gMessageSystem->nextBlockFast(_PREHASH_UserData); - gMessageSystem->addBOOLFast(_PREHASH_IMViaEMail, im_via_email); - gMessageSystem->addString("DirectoryVisibility", directory_visibility); - gAgent.sendReliableMessage(); -} - // static void LLAgent::dumpGroupInfo() { diff --git a/indra/newview/llagent.h b/indra/newview/llagent.h index b5da5e9062..4bb4d317e8 100644 --- a/indra/newview/llagent.h +++ b/indra/newview/llagent.h @@ -912,9 +912,17 @@ public: void sendReliableMessage(); void sendAgentDataUpdateRequest(); void sendAgentUserInfoRequest(); - // IM to Email and Online visibility + +// IM to Email and Online visibility void sendAgentUpdateUserInfo(bool im_to_email, const std::string& directory_visibility); +private: + void requestAgentUserInfoCoro(std::string capurl); + void updateAgentUserInfoCoro(std::string capurl, bool im_via_email, std::string directory_visibility); + // DEPRECATED: may be removed when User Info cap propagates + void sendAgentUserInfoRequestMessage(); + void sendAgentUpdateUserInfoMessage(bool im_via_email, const std::string& directory_visibility); + //-------------------------------------------------------------------- // Receive //-------------------------------------------------------------------- diff --git a/indra/newview/llviewermessage.cpp b/indra/newview/llviewermessage.cpp index 4848101750..98093344a9 100644 --- a/indra/newview/llviewermessage.cpp +++ b/indra/newview/llviewermessage.cpp @@ -7259,7 +7259,7 @@ void send_places_query(const LLUUID& query_id, gAgent.sendReliableMessage(); } - +// Deprecated in favor of cap "UserInfo" void process_user_info_reply(LLMessageSystem* msg, void**) { LLUUID agent_id; diff --git a/indra/newview/llviewerregion.cpp b/indra/newview/llviewerregion.cpp index 3fd2af87de..3f479802aa 100644 --- a/indra/newview/llviewerregion.cpp +++ b/indra/newview/llviewerregion.cpp @@ -2896,6 +2896,7 @@ void LLViewerRegionImpl::buildCapabilityNames(LLSD& capabilityNames) capabilityNames.append("UpdateScriptAgent"); capabilityNames.append("UpdateScriptTask"); capabilityNames.append("UploadBakedTexture"); + capabilityNames.append("UserInfo"); capabilityNames.append("ViewerAsset"); capabilityNames.append("ViewerMetrics"); capabilityNames.append("ViewerStartAuction"); -- cgit v1.2.3 From dde727aa0f293b4a91ebe5ed573a55e87caa413a Mon Sep 17 00:00:00 2001 From: Rider Linden Date: Tue, 6 Jun 2017 10:21:34 -0700 Subject: MAINT-7254, MAINT-7255: Use cap to get and set UserInfo on simhost. Check new is_verified flag and disable IM2Email if value is false. --- indra/newview/llagent.cpp | 4 +++- indra/newview/llfloaterpreference.cpp | 11 ++++++----- indra/newview/llfloaterpreference.h | 4 ++-- indra/newview/llviewermessage.cpp | 3 ++- 4 files changed, 13 insertions(+), 9 deletions(-) diff --git a/indra/newview/llagent.cpp b/indra/newview/llagent.cpp index ebff73debf..f67bb22f5b 100644 --- a/indra/newview/llagent.cpp +++ b/indra/newview/llagent.cpp @@ -4383,16 +4383,18 @@ void LLAgent::requestAgentUserInfoCoro(std::string capurl) } bool im_via_email; + bool is_verified_email; std::string email; std::string dir_visibility; im_via_email = result["im_via_email"].asBoolean(); + is_verified_email = result["is_verified"].asBoolean(); email = result["email"].asString(); dir_visibility = result["directory_visibility"].asString(); // TODO: This should probably be changed. I'm not entirely comfortable // having LLAgent interact directly with the UI in this way. - LLFloaterPreference::updateUserInfo(dir_visibility, im_via_email); + LLFloaterPreference::updateUserInfo(dir_visibility, im_via_email, is_verified_email); LLFloaterSnapshot::setAgentEmail(email); } diff --git a/indra/newview/llfloaterpreference.cpp b/indra/newview/llfloaterpreference.cpp index 1f460c05ec..e369403e22 100644 --- a/indra/newview/llfloaterpreference.cpp +++ b/indra/newview/llfloaterpreference.cpp @@ -1016,12 +1016,12 @@ void LLFloaterPreference::onBtnCancel(const LLSD& userdata) } // static -void LLFloaterPreference::updateUserInfo(const std::string& visibility, bool im_via_email) +void LLFloaterPreference::updateUserInfo(const std::string& visibility, bool im_via_email, bool is_verified_email) { LLFloaterPreference* instance = LLFloaterReg::findTypedInstance("preferences"); if (instance) { - instance->setPersonalInfo(visibility, im_via_email); + instance->setPersonalInfo(visibility, im_via_email, is_verified_email); } } @@ -1830,7 +1830,7 @@ bool LLFloaterPreference::moveTranscriptsAndLog() return true; } -void LLFloaterPreference::setPersonalInfo(const std::string& visibility, bool im_via_email) +void LLFloaterPreference::setPersonalInfo(const std::string& visibility, bool im_via_email, bool is_verified_email) { mGotPersonalInfo = true; mOriginalIMViaEmail = im_via_email; @@ -1855,8 +1855,9 @@ void LLFloaterPreference::setPersonalInfo(const std::string& visibility, bool im getChildView("friends_online_notify_checkbox")->setEnabled(TRUE); getChild("online_visibility")->setValue(mOriginalHideOnlineStatus); getChild("online_visibility")->setLabelArg("[DIR_VIS]", mDirectoryVisibility); - getChildView("send_im_to_email")->setEnabled(TRUE); - getChild("send_im_to_email")->setValue(im_via_email); + getChildView("send_im_to_email")->setEnabled(is_verified_email); + // *TODO: Show or hide verify email text here based on is_verified_email + getChild("send_im_to_email")->setValue(im_via_email); getChildView("favorites_on_login_check")->setEnabled(TRUE); getChildView("log_path_button")->setEnabled(TRUE); getChildView("chat_font_size")->setEnabled(TRUE); diff --git a/indra/newview/llfloaterpreference.h b/indra/newview/llfloaterpreference.h index 2bb2e7e9ff..444ad5a928 100644 --- a/indra/newview/llfloaterpreference.h +++ b/indra/newview/llfloaterpreference.h @@ -75,7 +75,7 @@ public: /*virtual*/ void changed(const LLUUID& session_id, U32 mask) {}; // static data update, called from message handler - static void updateUserInfo(const std::string& visibility, bool im_via_email); + static void updateUserInfo(const std::string& visibility, bool im_via_email, bool is_verified_email); // refresh all the graphics preferences menus static void refreshEnabledGraphics(); @@ -147,7 +147,7 @@ public: void onClickLogPath(); bool moveTranscriptsAndLog(); void enableHistory(); - void setPersonalInfo(const std::string& visibility, bool im_via_email); + void setPersonalInfo(const std::string& visibility, bool im_via_email, bool is_verified_email); void refreshEnabledState(); void onCommitWindowedMode(); void refresh(); // Refresh enable/disable diff --git a/indra/newview/llviewermessage.cpp b/indra/newview/llviewermessage.cpp index 98093344a9..2144c7d481 100644 --- a/indra/newview/llviewermessage.cpp +++ b/indra/newview/llviewermessage.cpp @@ -7277,7 +7277,8 @@ void process_user_info_reply(LLMessageSystem* msg, void**) std::string dir_visibility; msg->getString( "UserData", "DirectoryVisibility", dir_visibility); - LLFloaterPreference::updateUserInfo(dir_visibility, im_via_email); + // For Message based user info information the is_verified is assumed to be false. + LLFloaterPreference::updateUserInfo(dir_visibility, im_via_email, false); LLFloaterSnapshot::setAgentEmail(email); } -- cgit v1.2.3 From 526087d9ab6f1fb24e8808a6bef83e26fe6da857 Mon Sep 17 00:00:00 2001 From: Rider Linden Date: Wed, 4 Oct 2017 12:43:53 -0700 Subject: MAINT-7468: Show tooltip on disabled IM to Email if unverified email. --- indra/newview/llfloaterpreference.cpp | 7 +++++++ indra/newview/skins/default/xui/en/floater_preferences.xml | 6 ++++++ 2 files changed, 13 insertions(+) diff --git a/indra/newview/llfloaterpreference.cpp b/indra/newview/llfloaterpreference.cpp index e369403e22..5222637039 100644 --- a/indra/newview/llfloaterpreference.cpp +++ b/indra/newview/llfloaterpreference.cpp @@ -1856,6 +1856,13 @@ void LLFloaterPreference::setPersonalInfo(const std::string& visibility, bool im getChild("online_visibility")->setValue(mOriginalHideOnlineStatus); getChild("online_visibility")->setLabelArg("[DIR_VIS]", mDirectoryVisibility); getChildView("send_im_to_email")->setEnabled(is_verified_email); + + std::string tooltip; + if (!is_verified_email) + tooltip = getString("email_unverified_tooltip"); + + getChildView("send_im_to_email")->setToolTip(tooltip); + // *TODO: Show or hide verify email text here based on is_verified_email getChild("send_im_to_email")->setValue(im_via_email); getChildView("favorites_on_login_check")->setEnabled(TRUE); diff --git a/indra/newview/skins/default/xui/en/floater_preferences.xml b/indra/newview/skins/default/xui/en/floater_preferences.xml index 5ca527ad20..845c1efe4d 100644 --- a/indra/newview/skins/default/xui/en/floater_preferences.xml +++ b/indra/newview/skins/default/xui/en/floater_preferences.xml @@ -11,6 +11,12 @@ single_instance="true" title="PREFERENCES" width="658"> + + Please verify your email to enable IM to Email by visiting +https://accounts.secondlife.com/change_email/ + +