diff --git a/indra/libndhacd/CMakeLists.txt b/indra/libndhacd/CMakeLists.txt index bcc1973c0..28c4d2f9a 100644 --- a/indra/libndhacd/CMakeLists.txt +++ b/indra/libndhacd/CMakeLists.txt @@ -7,7 +7,7 @@ include(00-Common) include_directories(${LIBS_OPEN_DIR}/libhacd) set (libndhacd_SOURCE_FILES - LLConvexDecomposition.cpp + llconvexdecomposition.cpp nd_hacdConvexDecomposition.cpp nd_hacdStructs.cpp nd_hacdUtils.cpp @@ -16,12 +16,12 @@ set (libndhacd_SOURCE_FILES ) set (libndhacd_HEADER_FILES - LLConvexDecomposition.h + llconvexdecomposition.h ndConvexDecomposition.h nd_hacdConvexDecomposition.h nd_hacdStructs.h nd_StructTracer.h - LLConvexDecompositionStubImpl.h + llconvexdecompositionstubimpl.h nd_EnterExitTracer.h nd_hacdDefines.h nd_hacdUtils.h diff --git a/indra/libndhacd/LLConvexDecomposition.cpp b/indra/libndhacd/llconvexdecomposition.cpp similarity index 96% rename from indra/libndhacd/LLConvexDecomposition.cpp rename to indra/libndhacd/llconvexdecomposition.cpp index 80ec5f435..2c1948629 100644 --- a/indra/libndhacd/LLConvexDecomposition.cpp +++ b/indra/libndhacd/llconvexdecomposition.cpp @@ -1,5 +1,5 @@ /** - * @file LLConvexDecomposition.cpp + * @file llconvexdecomposition.cpp * @author falcon@lindenlab.com * @brief A stub implementation of LLConvexDecomposition interface * @@ -35,7 +35,7 @@ #include "nd_hacdConvexDecomposition.h" -#include "LLConvexDecomposition.h" +#include "llconvexdecomposition.h" /*static */bool LLConvexDecomposition::s_isInitialized = false; diff --git a/indra/libndhacd/LLConvexDecomposition.h b/indra/libndhacd/llconvexdecomposition.h similarity index 99% rename from indra/libndhacd/LLConvexDecomposition.h rename to indra/libndhacd/llconvexdecomposition.h index 2d7f5aa3a..9603c434f 100644 --- a/indra/libndhacd/LLConvexDecomposition.h +++ b/indra/libndhacd/llconvexdecomposition.h @@ -1,5 +1,5 @@ /** - * @file LLConvexDecomposition.cpp + * @file llconvexdecomposition.cpp * @brief LLConvexDecomposition interface definition * * $LicenseInfo:firstyear=2011&license=viewerlgpl$ diff --git a/indra/libndhacd/LLConvexDecompositionStubImpl.cpp b/indra/libndhacd/llconvexdecompositionstubimpl.cpp similarity index 97% rename from indra/libndhacd/LLConvexDecompositionStubImpl.cpp rename to indra/libndhacd/llconvexdecompositionstubimpl.cpp index 018143de1..d91f2ea86 100644 --- a/indra/libndhacd/LLConvexDecompositionStubImpl.cpp +++ b/indra/libndhacd/llconvexdecompositionstubimpl.cpp @@ -1,5 +1,5 @@ /** - * @file LLConvexDecompositionStubImpl.cpp + * @file llconvexdecompositionstubimpl.cpp * @author falcon@lindenlab.com * @brief A stub implementation of LLConvexDecomposition * @@ -28,7 +28,7 @@ #include #include -#include "LLConvexDecompositionStubImpl.h" +#include "llconvexdecompositionstubimpl.h" LLConvexDecomposition* LLConvexDecompositionImpl::getInstance() { diff --git a/indra/libndhacd/LLConvexDecompositionStubImpl.h b/indra/libndhacd/llconvexdecompositionstubimpl.h similarity index 97% rename from indra/libndhacd/LLConvexDecompositionStubImpl.h rename to indra/libndhacd/llconvexdecompositionstubimpl.h index 9599175ef..023bd7c23 100644 --- a/indra/libndhacd/LLConvexDecompositionStubImpl.h +++ b/indra/libndhacd/llconvexdecompositionstubimpl.h @@ -1,5 +1,5 @@ /** - * @file LLConvexDecompositionStubImpl.h + * @file llconvexdecompositionstubimpl.h * @author falcon@lindenlab.com * @brief A stub implementation of LLConvexDecomposition * @@ -29,7 +29,7 @@ #ifndef LL_CONVEX_DECOMP_UTIL_H #define LL_CONVEX_DECOMP_UTIL_H -#include "LLConvexDecomposition.h" +#include "llconvexdecomposition.h" class LLConvexDecompositionImpl : public LLConvexDecomposition { diff --git a/indra/libndhacd/nd_StructTracer.h b/indra/libndhacd/nd_StructTracer.h index 6dbe3ce3e..631bfd788 100644 --- a/indra/libndhacd/nd_StructTracer.h +++ b/indra/libndhacd/nd_StructTracer.h @@ -21,7 +21,7 @@ #include "ndConvexDecomposition.h" -#include "LLConvexDecomposition.h" +#include "llconvexdecomposition.h" #include "nd_hacdStructs.h" namespace ndStructTracer diff --git a/indra/libndhacd/nd_hacdConvexDecomposition.h b/indra/libndhacd/nd_hacdConvexDecomposition.h index e31779c65..6b7c7f952 100644 --- a/indra/libndhacd/nd_hacdConvexDecomposition.h +++ b/indra/libndhacd/nd_hacdConvexDecomposition.h @@ -19,7 +19,7 @@ #ifndef ND_HACD_CONVEXDECOMP_H #define ND_HACD_CONVEXDECOMP_H -#include "LLConvexDecomposition.h" +#include "llconvexdecomposition.h" #include #include diff --git a/indra/libndhacd/nd_hacdStructs.cpp b/indra/libndhacd/nd_hacdStructs.cpp index 4a5c9e6fb..8d3a21462 100644 --- a/indra/libndhacd/nd_hacdStructs.cpp +++ b/indra/libndhacd/nd_hacdStructs.cpp @@ -17,7 +17,6 @@ */ #include "nd_hacdStructs.h" -#include "LLConvexDecomposition.h" void DecompHull::clear() { diff --git a/indra/libndhacd/nd_hacdStructs.h b/indra/libndhacd/nd_hacdStructs.h index 5097b7428..c295fedca 100644 --- a/indra/libndhacd/nd_hacdStructs.h +++ b/indra/libndhacd/nd_hacdStructs.h @@ -21,7 +21,7 @@ #include "nd_hacdDefines.h" #include "hacdHACD.h" -#include "LLConvexDecomposition.h" +#include "llconvexdecomposition.h" #include struct LLCDHull; diff --git a/indra/libndhacd/nd_hacdUtils.h b/indra/libndhacd/nd_hacdUtils.h index e2d80e78d..8a59125ab 100644 --- a/indra/libndhacd/nd_hacdUtils.h +++ b/indra/libndhacd/nd_hacdUtils.h @@ -20,7 +20,6 @@ #define ND_HACD_UTILS_H #include "nd_hacdStructs.h" -#include "LLConvexDecomposition.h" tHACD* init( int nConcavity, int nClusters, int nMaxVerticesPerHull, double dMaxConnectDist, HACDDecoder *aData ); DecompData decompose( tHACD *aHACD ); diff --git a/indra/llmessage/llhttpclient.cpp b/indra/llmessage/llhttpclient.cpp index 1374a1b93..bd40d8e69 100644 --- a/indra/llmessage/llhttpclient.cpp +++ b/indra/llmessage/llhttpclient.cpp @@ -237,13 +237,21 @@ void LLHTTPClient::request( req->run(parent, new_parent_state, parent != NULL, true, default_engine); } -void LLHTTPClient::getByteRange(std::string const& url, S32 offset, S32 bytes, ResponderPtr responder, AIHTTPHeaders& headers/*,*/ DEBUG_CURLIO_PARAM(EDebugCurl debug)) +bool LLHTTPClient::getByteRange(std::string const& url, AIHTTPHeaders& headers, S32 offset, S32 bytes, ResponderPtr responder/*,*/ DEBUG_CURLIO_PARAM(EDebugCurl debug)) { - if(offset > 0 || bytes > 0) + try { - headers.addHeader("Range", llformat("bytes=%d-%d", offset, offset + bytes - 1)); + if (offset > 0 || bytes > 0) + { + headers.addHeader("Range", llformat("bytes=%d-%d", offset, offset + bytes - 1)); + } + request(url, HTTP_GET, NULL, responder, headers, NULL/*,*/ DEBUG_CURLIO_PARAM(debug)); } - request(url, HTTP_GET, NULL, responder, headers, NULL/*,*/ DEBUG_CURLIO_PARAM(debug)); + catch(AICurlNoEasyHandle const&) + { + return false; + } + return true; } void LLHTTPClient::head(std::string const& url, ResponderHeadersOnly* responder, AIHTTPHeaders& headers/*,*/ DEBUG_CURLIO_PARAM(EDebugCurl debug)) diff --git a/indra/llmessage/llhttpclient.h b/indra/llmessage/llhttpclient.h index a366811d6..3bb60b04f 100644 --- a/indra/llmessage/llhttpclient.h +++ b/indra/llmessage/llhttpclient.h @@ -133,6 +133,14 @@ public: public: typedef boost::shared_ptr buffer_ptr_t; + /** + * @brief return true if the status code indicates success. + */ + static bool isGoodStatus(U32 status) + { + return((200 <= status) && (status < 300)); + } + protected: ResponderBase(void); virtual ~ResponderBase(); @@ -452,9 +460,9 @@ public: static void head(std::string const& url, ResponderHeadersOnly* responder/*,*/ DEBUG_CURLIO_PARAM(EDebugCurl debug = debug_off)) { AIHTTPHeaders headers; head(url, responder, headers/*,*/ DEBUG_CURLIO_PARAM(debug)); } - static void getByteRange(std::string const& url, S32 offset, S32 bytes, ResponderPtr responder, AIHTTPHeaders& headers/*,*/ DEBUG_CURLIO_PARAM(EDebugCurl debug = debug_off)); - static void getByteRange(std::string const& url, S32 offset, S32 bytes, ResponderPtr responder/*,*/ DEBUG_CURLIO_PARAM(EDebugCurl debug = debug_off)) - { AIHTTPHeaders headers; getByteRange(url, offset, bytes, responder, headers/*,*/ DEBUG_CURLIO_PARAM(debug)); } + static bool getByteRange(std::string const& url, AIHTTPHeaders& headers, S32 offset, S32 bytes, ResponderPtr responder/*,*/ DEBUG_CURLIO_PARAM(EDebugCurl debug = debug_off)); + static bool getByteRange(std::string const& url, S32 offset, S32 bytes, ResponderPtr responder/*,*/ DEBUG_CURLIO_PARAM(EDebugCurl debug = debug_off)) + { AIHTTPHeaders headers; return getByteRange(url, headers, offset, bytes, responder/*,*/ DEBUG_CURLIO_PARAM(debug)); } static void get(std::string const& url, ResponderPtr responder, AIHTTPHeaders& headers/*,*/ DEBUG_CURLIO_PARAM(EDebugCurl debug = debug_off)); static void get(std::string const& url, ResponderPtr responder/*,*/ DEBUG_CURLIO_PARAM(EDebugCurl debug = debug_off)) diff --git a/indra/llprimitive/llmodel.cpp b/indra/llprimitive/llmodel.cpp index b722660bf..3e38db897 100644 --- a/indra/llprimitive/llmodel.cpp +++ b/indra/llprimitive/llmodel.cpp @@ -28,7 +28,7 @@ #include "llmodel.h" #include "llmemory.h" -#include "LLConvexDecomposition.h" +#include "llconvexdecomposition.h" #include "llsdserialize.h" #include "llvector4a.h" #if LL_MSVC diff --git a/indra/llwindow/llwindowmacosx.cpp b/indra/llwindow/llwindowmacosx.cpp index 91e4c00cf..fd4411f57 100644 --- a/indra/llwindow/llwindowmacosx.cpp +++ b/indra/llwindow/llwindowmacosx.cpp @@ -3277,7 +3277,7 @@ void LLWindowMacOSX::spawnWebBrowser(const std::string& escaped_url, bool async) llinfos << "Opening URL " << escaped_url << llendl; - CFStringRef stringRef = CFStringCreateWithCString(NULL, escaped_url.c_str(), kCFStringEncodingUTF8); + CFStringRef stringRef = CFStringCreateWithBytes(NULL, (UInt8 *)escaped_url.c_str(), strlen(escaped_url.c_str()), kCFStringEncodingUTF8, false); if (stringRef) { // This will succeed if the string is a full URL, including the http:// @@ -3315,6 +3315,21 @@ void LLWindowMacOSX::setTitle(const std::string &title) SetWindowTitleWithCFString(mWindow, title_str); } +// virtual +void LLWindowMacOSX::ShellEx(const std::string& command) +{ + char * path = NULL; + asprintf(&path, "%s %s", (char*)"file://", command.c_str()); + CFURLRef url = CFURLCreateAbsoluteURLWithBytes(NULL, (UInt8 *)path, strlen(path), + kCFURLPOSIXPathStyle, NULL, true); + if (url != NULL) + { + LSOpenCFURLRef(url, NULL); + CFRelease(url); + } + free(path); +} + LLSD LLWindowMacOSX::getNativeKeyData() { LLSD result = LLSD::emptyMap(); diff --git a/indra/llwindow/llwindowmacosx.h b/indra/llwindow/llwindowmacosx.h index 7f7181a58..d8d46edb9 100644 --- a/indra/llwindow/llwindowmacosx.h +++ b/indra/llwindow/llwindowmacosx.h @@ -116,6 +116,7 @@ public: /*virtual*/ void spawnWebBrowser(const std::string& escaped_url, bool async); /*virtual*/ void setTitle(const std::string &title); + /*virtual*/ void ShellEx(const std::string& command); static std::vector getDynamicFallbackFontList(); diff --git a/indra/llwindow/llwindowwin32.cpp b/indra/llwindow/llwindowwin32.cpp index 8e6b4c57c..aceb1a4fa 100644 --- a/indra/llwindow/llwindowwin32.cpp +++ b/indra/llwindow/llwindowwin32.cpp @@ -3329,9 +3329,9 @@ S32 OSMessageBoxWin32(const std::string& text, const std::string& caption, U32 t return retval; } -void LLWindowWin32::ShellEx(const std::string& command ) +void LLWindowWin32::ShellEx(const std::string& command) { - LLWString url_wstring = utf8str_to_wstring( command ); + LLWString url_wstring = utf8str_to_wstring( "\"" + command + "\"" ); llutf16string url_utf16 = wstring_to_utf16str( url_wstring ); SHELLEXECUTEINFO sei = { sizeof( sei ) }; diff --git a/indra/newview/CMakeLists.txt b/indra/newview/CMakeLists.txt index 8b55d30a3..008e1d420 100644 --- a/indra/newview/CMakeLists.txt +++ b/indra/newview/CMakeLists.txt @@ -253,6 +253,7 @@ set(viewer_SOURCE_FILES llfloaterproperties.cpp llfloaterregiondebugconsole.cpp llfloaterregioninfo.cpp + llfloaterregionrestarting.cpp llfloaterreporter.cpp llfloaterscriptdebug.cpp llfloaterscriptlimits.cpp @@ -774,6 +775,7 @@ set(viewer_HEADER_FILES llfloaterproperties.h llfloaterregiondebugconsole.h llfloaterregioninfo.h + llfloaterregionrestarting.h llfloaterreporter.h llfloaterscriptdebug.h llfloaterscriptlimits.h diff --git a/indra/newview/app_settings/settings.xml b/indra/newview/app_settings/settings.xml index 8fd80896c..01aec311a 100644 --- a/indra/newview/app_settings/settings.xml +++ b/indra/newview/app_settings/settings.xml @@ -738,7 +738,7 @@ LiruLegacyLogLaunch Comment - When opening a chat log, open in an external text editor instead of a browser floater(Windows Only). + When opening a chat log, open in an external text editor instead of a browser floater(Windows and Mac Only). Persist 1 Type @@ -1324,6 +1324,17 @@ This should be as low as possible, but too low may break functionality Value 1 + AnnounceBumps + + Comment + Announce if someone bumps into you. + Persist + 1 + Type + Boolean + Value + 0 + AnnounceSnapshots Comment @@ -2233,6 +2244,17 @@ This should be as low as possible, but too low may break functionality IsCOA 1 + UISndRestart + + Comment + Sound file for region restarting (uuid for sound asset) + Persist + 1 + Type + String + Value + 1e506d0c-4811-bdf3-5ec7-d624284c9040 + UISndSnapshot Comment @@ -14587,9 +14609,9 @@ This should be as low as possible, but too low may break functionality ShowChatHistory Comment - + Open local chat window on login Persist - 0 + 1 Type Boolean Value @@ -14598,14 +14620,25 @@ This should be as low as possible, but too low may break functionality ShowCommunicate Comment - + Open communicate window on login Persist - 0 + 1 Type Boolean Value 0 + ShowContacts + + Comment + Open contacts window on login + Persist + 1 + Type + Boolean + Value + 0 + ShowConsoleWindow Comment diff --git a/indra/newview/app_settings/settings_ascent.xml b/indra/newview/app_settings/settings_ascent.xml index 1e4a735df..8288edc6b 100644 --- a/indra/newview/app_settings/settings_ascent.xml +++ b/indra/newview/app_settings/settings_ascent.xml @@ -91,6 +91,17 @@ Value 1 + AlchemyRegionRestartShake + + Comment + Shake the screen when the region restart floater is displayed + Persist + 1 + Type + Boolean + Value + 0 + AscentPowerfulWizard Comment @@ -741,6 +752,51 @@ Value 0 + ExodusMapRolloverCircleColor + + Comment + Color setting of circle for rollovers on the minimap. + Persist + 1 + Type + Color4 + Value + Value + + 1.0 + 1.0 + 1.0 + 0.05 + + + ExodusMapRolloverColor + + Comment + Color setting for rollovers on the minimap. + Persist + 1 + Type + Color4 + Value + Value + + 0.0 + 1.0 + 1.0 + 1.0 + + + ExodusMinimapAreaEffect + + Comment + Radius of the area of affect for the minimap, adjusted by shift scrolling over the minimap. + Persist + 1 + Type + F32 + Value + 3.5 + OBJExportNotifyFailed Comment diff --git a/indra/newview/app_settings/settings_per_account.xml b/indra/newview/app_settings/settings_per_account.xml index b5d15381d..e528e92a2 100644 --- a/indra/newview/app_settings/settings_per_account.xml +++ b/indra/newview/app_settings/settings_per_account.xml @@ -723,6 +723,16 @@ Value - + EmergencyTeleportLandmark + + Comment + UUID of the landmark to teleport to in the last twenty seconds before a region will restart, empty is none. + Persist + 1 + Type + String + Value + + diff --git a/indra/newview/ascentprefssys.cpp b/indra/newview/ascentprefssys.cpp index c287fea3e..85d3bf5f2 100644 --- a/indra/newview/ascentprefssys.cpp +++ b/indra/newview/ascentprefssys.cpp @@ -252,12 +252,14 @@ void LLPrefsAscentSys::refreshValues() mPrivateLookAt = gSavedSettings.getBOOL("PrivateLookAt"); mShowLookAt = gSavedSettings.getBOOL("AscentShowLookAt"); mQuietSnapshotsToDisk = gSavedSettings.getBOOL("QuietSnapshotsToDisk"); + mAnnounceBumps = gSavedSettings.getBOOL("AnnounceBumps"); mDetachBridge = gSavedSettings.getBOOL("SGDetachBridge"); mRevokePermsOnStandUp = gSavedSettings.getBOOL("RevokePermsOnStandUp"); mDisableClickSit = gSavedSettings.getBOOL("DisableClickSit"); mDisableClickSitOtherOwner = gSavedSettings.getBOOL("DisableClickSitOtherOwner"); mDisplayScriptJumps = gSavedSettings.getBOOL("AscentDisplayTotalScriptJumps"); mNumScriptDiff = gSavedSettings.getF32("Ascentnumscriptdiff"); + mLandmark = gSavedPerAccountSettings.getString("EmergencyTeleportLandmark"); //Build ------------------------------------------------------------------------------- mAlpha = gSavedSettings.getF32("EmeraldBuildPrefs_Alpha"); @@ -408,12 +410,14 @@ void LLPrefsAscentSys::cancel() gSavedSettings.setBOOL("PrivateLookAt", mPrivateLookAt); gSavedSettings.setBOOL("AscentShowLookAt", mShowLookAt); gSavedSettings.setBOOL("QuietSnapshotsToDisk", mQuietSnapshotsToDisk); + gSavedSettings.setBOOL("AnnounceBumps", mAnnounceBumps); gSavedSettings.setBOOL("SGDetachBridge", mDetachBridge); gSavedSettings.setBOOL("RevokePermsOnStandUp", mRevokePermsOnStandUp); gSavedSettings.setBOOL("DisableClickSit", mDisableClickSit); gSavedSettings.setBOOL("DisableClickSitOtherOwner", mDisableClickSitOtherOwner); gSavedSettings.setBOOL("AscentDisplayTotalScriptJumps", mDisplayScriptJumps); gSavedSettings.setF32("Ascentnumscriptdiff", mNumScriptDiff); + gSavedPerAccountSettings.setString("EmergencyTeleportLandmark", mLandmark); //Build ------------------------------------------------------------------------------- gSavedSettings.setF32("EmeraldBuildPrefs_Alpha", mAlpha); diff --git a/indra/newview/ascentprefssys.h b/indra/newview/ascentprefssys.h index 785d14940..455a072a1 100644 --- a/indra/newview/ascentprefssys.h +++ b/indra/newview/ascentprefssys.h @@ -103,12 +103,14 @@ private: bool mPrivateLookAt; bool mShowLookAt; bool mQuietSnapshotsToDisk; + bool mAnnounceBumps; bool mDetachBridge; bool mRevokePermsOnStandUp; bool mDisableClickSit; bool mDisableClickSitOtherOwner; bool mDisplayScriptJumps; F32 mNumScriptDiff; + std::string mLandmark; //Build ------------------------------------------------------------------------------- F32 mAlpha; diff --git a/indra/newview/lldroptarget.cpp b/indra/newview/lldroptarget.cpp index 22b555228..9e7cc377e 100644 --- a/indra/newview/lldroptarget.cpp +++ b/indra/newview/lldroptarget.cpp @@ -145,6 +145,11 @@ void LLDropTarget::setControlName(const std::string& control_name, LLView* conte else { mControl = gSavedPerAccountSettings.getControl(control_name); + if (!mControl) + { + llerrs << "Could not find control \"" << control_name << "\" in gSavedPerAccountSettings" << llendl; + return; // Though this should never happen. + } const LLUUID id(mControl->getValue().asString()); if (id.isNull()) text = LLTrans::getString("CurrentlyNotSet"); diff --git a/indra/newview/llfloateravatarlist.cpp b/indra/newview/llfloateravatarlist.cpp index 95902a762..566159cc1 100644 --- a/indra/newview/llfloateravatarlist.cpp +++ b/indra/newview/llfloateravatarlist.cpp @@ -646,6 +646,8 @@ void LLFloaterAvatarList::updateAvatarSorting() } } +bool mm_getMarkerColor(const LLUUID&, LLColor4&); + /** * Redraws the avatar list * Only does anything if the avatar list is visible. @@ -738,7 +740,8 @@ void LLFloaterAvatarList::refreshAvatarList() LLColor4 color = sDefaultListText; //Lindens are always more Linden than your friend, make that take precedence - if (LLMuteList::getInstance()->isLinden(av_id)) + if (mm_getMarkerColor(av_id, color)) {} + else if (LLMuteList::getInstance()->isLinden(av_id)) { static const LLCachedControl ascent_linden_color("AscentLindenColor", LLColor4(0.f,0.f,1.f,1.f)); color = ascent_linden_color; diff --git a/indra/newview/llfloateravatarpicker.cpp b/indra/newview/llfloateravatarpicker.cpp index f503fa3ba..718750b5f 100644 --- a/indra/newview/llfloateravatarpicker.cpp +++ b/indra/newview/llfloateravatarpicker.cpp @@ -427,7 +427,7 @@ public: // in case of invalid characters, the avatar picker returns a 400 // just set it to process so it displays 'not found' - if ((200 <= status && status < 300) || status == 400) + if (isGoodStatus(status) || status == 400) { if (LLFloaterAvatarPicker::instanceExists()) { diff --git a/indra/newview/llfloaterchat.cpp b/indra/newview/llfloaterchat.cpp index eaa563278..348b9235a 100644 --- a/indra/newview/llfloaterchat.cpp +++ b/indra/newview/llfloaterchat.cpp @@ -102,13 +102,6 @@ LLFloaterChat::~LLFloaterChat() // Children all cleaned up by default view destructor. } -void LLFloaterChat::setVisible(BOOL visible) -{ - LLFloater::setVisible( visible ); - - gSavedSettings.setBOOL("ShowChatHistory", visible); -} - void LLFloaterChat::draw() { // enable say and shout only when text available @@ -140,6 +133,11 @@ BOOL LLFloaterChat::postBuild() return TRUE; } +void LLFloaterChat::onOpen() +{ + gSavedSettings.setBOOL("ShowChatHistory", true); +} + // public virtual void LLFloaterChat::onClose(bool app_quitting) { diff --git a/indra/newview/llfloaterchat.h b/indra/newview/llfloaterchat.h index 7eaab1b16..dcad5f632 100644 --- a/indra/newview/llfloaterchat.h +++ b/indra/newview/llfloaterchat.h @@ -59,9 +59,9 @@ public: LLFloaterChat(const LLSD& seed); ~LLFloaterChat(); - virtual void setVisible( BOOL b ); virtual void draw(); virtual BOOL postBuild(); + virtual void onOpen(); virtual void onClose(bool app_quitting); virtual void onFocusReceived(); virtual void handleVisibilityChange(BOOL cur_visibility); diff --git a/indra/newview/llfloaterchatterbox.cpp b/indra/newview/llfloaterchatterbox.cpp index c491f07fe..2e3598d23 100644 --- a/indra/newview/llfloaterchatterbox.cpp +++ b/indra/newview/llfloaterchatterbox.cpp @@ -78,9 +78,14 @@ BOOL LLFloaterMyFriends::postBuild() return TRUE; } +void LLFloaterMyFriends::onOpen() +{ + gSavedSettings.setBOOL("ShowContacts", true); +} void LLFloaterMyFriends::onClose(bool app_quitting) { + if (!app_quitting) gSavedSettings.setBOOL("ShowContacts", false); setVisible(FALSE); } @@ -122,6 +127,7 @@ LLFloaterChatterBox::LLFloaterChatterBox(const LLSD& seed) : removeFloater(floater_contacts); // reparent to floater view gFloaterView->addChild(floater_contacts); + if (gSavedSettings.getBOOL("ShowContacts")) floater_contacts->open(); } else { @@ -136,11 +142,13 @@ LLFloaterChatterBox::LLFloaterChatterBox(const LLSD& seed) : removeFloater(floater_chat); // reparent to floater view gFloaterView->addChild(floater_chat); + if (gSavedSettings.getBOOL("ShowChatHistory")) floater_chat->open(); } else { addFloater(floater_chat, FALSE); } + if (gSavedSettings.getBOOL("ShowCommunicate")) open(); // After all floaters have been added, so we may not be hidden anyhow. gSavedSettings.getControl("ShowLocalChatFloaterBar")->getSignal()->connect(boost::bind(handleLocalChatBar, floater_chat, _2)); mTabContainer->lockTabs(); } @@ -228,7 +236,7 @@ void LLFloaterChatterBox::onOpen() void LLFloaterChatterBox::onClose(bool app_quitting) { setVisible(FALSE); - gSavedSettings.setBOOL("ShowCommunicate", FALSE); + if (!app_quitting) gSavedSettings.setBOOL("ShowCommunicate", false); } void LLFloaterChatterBox::setMinimized(BOOL minimized) diff --git a/indra/newview/llfloaterchatterbox.h b/indra/newview/llfloaterchatterbox.h index d3b45576a..70f6314fe 100644 --- a/indra/newview/llfloaterchatterbox.h +++ b/indra/newview/llfloaterchatterbox.h @@ -126,7 +126,8 @@ public: virtual BOOL postBuild(); - void onClose(bool app_quitting); + virtual void onOpen(); + virtual void onClose(bool app_quitting); static void* createFriendsPanel(void* data); static void* createGroupsPanel(void* data); diff --git a/indra/newview/llfloaterland.cpp b/indra/newview/llfloaterland.cpp index 4c063e953..8dfa195f4 100644 --- a/indra/newview/llfloaterland.cpp +++ b/indra/newview/llfloaterland.cpp @@ -2161,7 +2161,7 @@ void LLPanelLandOptions::refreshSearch() bool can_change = LLViewerParcelMgr::isParcelModifiableByAgent( - parcel, GP_LAND_CHANGE_IDENTITY) + parcel, GP_LAND_FIND_PLACES) && region && !(region->getRegionFlag(REGION_FLAGS_BLOCK_PARCEL_SEARCH)); diff --git a/indra/newview/llfloaterregionrestarting.cpp b/indra/newview/llfloaterregionrestarting.cpp new file mode 100644 index 000000000..4e4116016 --- /dev/null +++ b/indra/newview/llfloaterregionrestarting.cpp @@ -0,0 +1,196 @@ +/** + * @file llfloaterregionrestarting.cpp + * @brief Shows countdown timer during region restart + * + * $LicenseInfo:firstyear=2006&license=viewerlgpl$ + * Second Life Viewer Source Code + * Copyright (C) 2010, 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 "llfloaterregionrestarting.h" + +#include "lluictrlfactory.h" +#include "llagent.h" +#include "llagentcamera.h" +#include "llenvmanager.h" +#include "llviewercontrol.h" +#include "llviewerwindow.h" + +// For emergency teleports +#include "llinventorymodel.h" +void emergency_teleport() +{ + static const LLCachedControl landmark(gSavedPerAccountSettings, "EmergencyTeleportLandmark"); + if (landmark().empty()) return; + const LLUUID id(landmark); + if (id.isNull()) return; + if (LLViewerInventoryItem* item = gInventory.getItem(id)) + gAgent.teleportViaLandmark(item->getAssetUUID()); +} +// + +enum shake_state +{ + SHAKE_START, + SHAKE_LEFT, + SHAKE_UP, + SHAKE_RIGHT, + SHAKE_DOWN, + SHAKE_DONE +}; +static shake_state sShakeState; + +LLFloaterRegionRestarting::LLFloaterRegionRestarting(const LLSD& key) : + LLEventTimer(1) +, mRestartSeconds(NULL) +, mSeconds(key["SECONDS"].asInteger()) +, mShakeIterations() +, mShakeMagnitude() +{ + //buildFromFile("floater_region_restarting.xml"); + LLUICtrlFactory::getInstance()->buildFloater(this, "floater_region_restarting.xml"); + + LLStringUtil::format_map_t args; + args["[NAME]"] = key["NAME"].asString(); + getChild("region_name")->setValue(getString("RegionName", args)); + mRestartSeconds = getChild("restart_seconds"); + center(); + + refresh(); + + mRegionChangedConnection = LLEnvManagerNew::instance().setRegionChangeCallback(boost::bind(&LLFloaterRegionRestarting::close, this, false)); + if (mSeconds <= 20) emergency_teleport(); // For emergency teleports +} + +LLFloaterRegionRestarting::~LLFloaterRegionRestarting() +{ + mRegionChangedConnection.disconnect(); +} + +BOOL LLFloaterRegionRestarting::postBuild() +{ + setBackgroundColor(gColors.getColor("NotifyCautionBoxColor")); + sShakeState = SHAKE_START; + return TRUE; +} + +BOOL LLFloaterRegionRestarting::tick() +{ + refresh(); + + return FALSE; +} + +void LLFloaterRegionRestarting::refresh() +{ + LLStringUtil::format_map_t args; + args["[SECONDS]"] = llformat("%d", mSeconds); + mRestartSeconds->setValue(getString("RestartSeconds", args)); + + if (mSeconds == 20) emergency_teleport(); // For emergency teleports + if (!mSeconds) return; // Zero means we're done. + --mSeconds; +} + +void LLFloaterRegionRestarting::draw() +{ + LLFloater::draw(); + + static const LLCachedControl alchemyRegionShake(gSavedSettings, "AlchemyRegionRestartShake", true); + if (!alchemyRegionShake) + return; + + const F32 SHAKE_INTERVAL = 0.025; + const F32 SHAKE_TOTAL_DURATION = 1.8; // the length of the default alert tone for this + const F32 SHAKE_INITIAL_MAGNITUDE = 1.5; + const F32 SHAKE_HORIZONTAL_BIAS = 0.25; + F32 time_shaking; + + if (SHAKE_START == sShakeState) + { + mShakeTimer.setTimerExpirySec(SHAKE_INTERVAL); + sShakeState = SHAKE_LEFT; + mShakeIterations = 0; + mShakeMagnitude = SHAKE_INITIAL_MAGNITUDE; + } + + if (SHAKE_DONE != sShakeState && mShakeTimer.hasExpired()) + { + gAgentCamera.unlockView(); + + switch(sShakeState) + { + case SHAKE_LEFT: + gAgentCamera.setPanLeftKey(mShakeMagnitude * SHAKE_HORIZONTAL_BIAS); + sShakeState = SHAKE_UP; + break; + + case SHAKE_UP: + gAgentCamera.setPanUpKey(mShakeMagnitude); + sShakeState = SHAKE_RIGHT; + break; + + case SHAKE_RIGHT: + gAgentCamera.setPanRightKey(mShakeMagnitude * SHAKE_HORIZONTAL_BIAS); + sShakeState = SHAKE_DOWN; + break; + + case SHAKE_DOWN: + gAgentCamera.setPanDownKey(mShakeMagnitude); + mShakeIterations++; + time_shaking = SHAKE_INTERVAL * (mShakeIterations * 4 /* left, up, right, down */); + if (SHAKE_TOTAL_DURATION <= time_shaking) + { + sShakeState = SHAKE_DONE; + mShakeMagnitude = 0.0; + } + else + { + sShakeState = SHAKE_LEFT; + F32 percent_done_shaking = (SHAKE_TOTAL_DURATION - time_shaking) / SHAKE_TOTAL_DURATION; + mShakeMagnitude = SHAKE_INITIAL_MAGNITUDE * (percent_done_shaking * percent_done_shaking); // exponential decay + } + break; + + default: + break; + } + mShakeTimer.setTimerExpirySec(SHAKE_INTERVAL); + } +} + +void LLFloaterRegionRestarting::onClose(bool app_quitting) +{ + if (sShakeState != SHAKE_DONE && sShakeState != SHAKE_START) // Finish shake if needed + { + gAgentCamera.resetView(TRUE, TRUE); + sShakeState = SHAKE_DONE; + } + LLFloater::onClose(app_quitting); +} + +void LLFloaterRegionRestarting::updateTime(const U32& time) +{ + mSeconds = time; + if (mSeconds <= 20) emergency_teleport(); // For emergency teleports + sShakeState = SHAKE_START; +} diff --git a/indra/newview/llfloaterregionrestarting.h b/indra/newview/llfloaterregionrestarting.h new file mode 100644 index 000000000..ee7cb1d30 --- /dev/null +++ b/indra/newview/llfloaterregionrestarting.h @@ -0,0 +1,59 @@ +/** + * @file llfloaterregionrestarting.h + * @brief Shows countdown timer during region restart + * + * $LicenseInfo:firstyear=2006&license=viewerlgpl$ + * Second Life Viewer Source Code + * Copyright (C) 2010, 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_LLFLOATERREGIONRESTARTING_H +#define LL_LLFLOATERREGIONRESTARTING_H + +#include "llfloater.h" +#include "lleventtimer.h" + +class LLFloaterRegionRestarting : public LLFloater, public LLEventTimer +, public LLFloaterSingleton +{ + friend class LLFloaterReg; + +public: + void updateTime(const U32& time); + + LLFloaterRegionRestarting(const LLSD& key); +private: + virtual ~LLFloaterRegionRestarting(); + virtual BOOL postBuild(); + virtual BOOL tick(); + virtual void refresh(); + virtual void draw(); + virtual void onClose(bool app_quitting); + + class LLTextBox* mRestartSeconds; + U32 mSeconds; + U32 mShakeIterations; + F32 mShakeMagnitude; + LLTimer mShakeTimer; + + boost::signals2::connection mRegionChangedConnection; +}; + +#endif // LL_LLFLOATERREGIONRESTARTING_H diff --git a/indra/newview/llgroupmgr.cpp b/indra/newview/llgroupmgr.cpp index cc42294fd..bc75b0f7d 100644 --- a/indra/newview/llgroupmgr.cpp +++ b/indra/newview/llgroupmgr.cpp @@ -47,6 +47,7 @@ #include "llviewerregion.h" #include "llviewerwindow.h" #include "llfloaterdirectory.h" +#include "llfloatergroupinfo.h" #include "llgroupactions.h" #include "llnotificationsutil.h" #include "lluictrlfactory.h" @@ -1448,7 +1449,8 @@ void LLGroupMgr::processCreateGroupReply(LLMessageSystem* msg, void ** data) gAgent.mGroups.push_back(gd); - LLGroupActions::closeGroup(LLUUID::null); + if (LLFloaterGroupInfo* flooter = LLFloaterGroupInfo::getInstance(LLUUID::null)) + flooter->onClose(false); LLGroupActions::showTab(group_id, "roles_tab"); } else diff --git a/indra/newview/llimpanel.cpp b/indra/newview/llimpanel.cpp index 9603208c7..855b82d58 100644 --- a/indra/newview/llimpanel.cpp +++ b/indra/newview/llimpanel.cpp @@ -1002,10 +1002,10 @@ void LLFloaterIMPanel::onFlyoutCommit(LLComboBox* flyout, const LLSD& value) void show_log_browser(const std::string& name, const std::string& id) { -#if LL_WINDOWS // Singu TODO: Other platforms? +#if LL_WINDOWS || LL_DARWIN // Singu TODO: Linux? if (gSavedSettings.getBOOL("LiruLegacyLogLaunch")) { - gViewerWindow->getWindow()->ShellEx("\"" + LLLogChat::makeLogFileName(name) + "\""); + gViewerWindow->getWindow()->ShellEx(LLLogChat::makeLogFileName(name)); return; } #endif diff --git a/indra/newview/llmenucommands.cpp b/indra/newview/llmenucommands.cpp index f00089379..8dbaa756d 100644 --- a/indra/newview/llmenucommands.cpp +++ b/indra/newview/llmenucommands.cpp @@ -102,7 +102,6 @@ #include "llmakeoutfitdialog.h" #include "llmoveview.h" // LLFloaterMove #include "lltextureview.h" -#include "lltoolbar.h" #include "lltoolgrab.h" #include "lltoolmgr.h" #include "lluictrlfactory.h" @@ -211,7 +210,6 @@ struct MenuFloaterDict : public LLSingleton registerFloater("sound_explorer", boost::bind(LLFloaterExploreSounds::toggle), boost::bind(LLFloaterExploreSounds::visible)); registerFloater("test", boost::bind(LLFloaterTest::show, (void*)NULL)); // Phoenix: Wolfspirit: Enabled Show Floater out of viewer menu - registerFloater("toolbar", boost::bind(toggle_control, "ShowToolBar"), boost::bind(&LLToolBar::getVisible, gToolBar)); registerFloater("WaterSettings", boost::bind(LLFloaterWater::show), boost::bind(LLFloaterWater::isOpen)); registerFloater("web", boost::bind(LLFloaterWebContent::showInstance, "dict web", LLFloaterWebContent::Params())); registerFloater("Windlight", boost::bind(LLFloaterWindLight::show), boost::bind(LLFloaterWindLight::isOpen)); diff --git a/indra/newview/llmeshrepository.cpp b/indra/newview/llmeshrepository.cpp index 5a55d2562..bb82041fa 100644 --- a/indra/newview/llmeshrepository.cpp +++ b/indra/newview/llmeshrepository.cpp @@ -67,6 +67,7 @@ #include "aicurl.h" #include "boost/lexical_cast.hpp" + #ifndef LL_WINDOWS #include "netdb.h" #endif @@ -239,7 +240,7 @@ public: } } - /*virtual*/ void completedRaw(U32 status, const std::string& reason, + virtual void completedRaw(U32 status, const std::string& reason, const LLChannelDescriptors& channels, const LLIOPipe::buffer_ptr_t& buffer); @@ -278,7 +279,7 @@ public: } } - /*virtual*/ void completedRaw(U32 status, const std::string& reason, + virtual void completedRaw(U32 status, const std::string& reason, const LLChannelDescriptors& channels, const LLIOPipe::buffer_ptr_t& buffer); @@ -303,10 +304,17 @@ public: ~LLMeshSkinInfoResponder() { - llassert(mProcessed || LLApp::isExiting()); + if (!LLApp::isQuitting() && + !mProcessed && + mMeshID.notNull()) + { // Something went wrong, retry + llwarns << "Timeout or service unavailable, retrying loadMeshSkinInfo() for " << mMeshID << llendl; + LLMeshRepository::sHTTPRetryCount++; + gMeshRepo.mThread->loadMeshSkinInfo(mMeshID); + } } - /*virtual*/ void completedRaw(U32 status, const std::string& reason, + virtual void completedRaw(U32 status, const std::string& reason, const LLChannelDescriptors& channels, const LLIOPipe::buffer_ptr_t& buffer); @@ -331,10 +339,17 @@ public: ~LLMeshDecompositionResponder() { - llassert(mProcessed || LLApp::isExiting()); + if (!LLApp::isQuitting() && + !mProcessed && + mMeshID.notNull()) + { // Something went wrong, retry + llwarns << "Timeout or service unavailable, retrying loadMeshDecomposition() for " << mMeshID << llendl; + LLMeshRepository::sHTTPRetryCount++; + gMeshRepo.mThread->loadMeshDecomposition(mMeshID); + } } - /*virtual*/ void completedRaw(U32 status, const std::string& reason, + virtual void completedRaw(U32 status, const std::string& reason, const LLChannelDescriptors& channels, const LLIOPipe::buffer_ptr_t& buffer); @@ -359,10 +374,17 @@ public: ~LLMeshPhysicsShapeResponder() { - llassert(mProcessed || LLApp::isExiting()); + if (!LLApp::isQuitting() && + !mProcessed && + mMeshID.notNull()) + { // Something went wrong, retry + llwarns << "Timeout or service unavailable, retrying loadMeshPhysicsShape() for " << mMeshID << llendl; + LLMeshRepository::sHTTPRetryCount++; + gMeshRepo.mThread->loadMeshPhysicsShape(mMeshID); + } } - /*virtual*/ void completedRaw(U32 status, const std::string& reason, + virtual void completedRaw(U32 status, const std::string& reason, const LLChannelDescriptors& channels, const LLIOPipe::buffer_ptr_t& buffer); @@ -437,7 +459,7 @@ public: { } - /*virtual*/ void completed(U32 status, + virtual void completed(U32 status, const std::string& reason, const LLSD& content) { @@ -451,7 +473,7 @@ public: LLWholeModelFeeObserver* observer = mObserverHandle.get(); - if (((200 <= status) && (status < 300)) && + if (isGoodStatus(status) && cc["state"].asString() == "upload") { mWholeModelUploadURL = cc["uploader"].asString(); @@ -495,7 +517,7 @@ public: { } - /*virtual*/ void completed(U32 status, + virtual void completed(U32 status, const std::string& reason, const LLSD& content) { @@ -511,7 +533,7 @@ public: // requested "mesh" asset type isn't actually the type // of the resultant object, fix it up here. - if (((200 <= status) && (status < 300)) && + if (isGoodStatus(status) && cc["state"].asString() == "complete") { mModelData["asset_type"] = "object"; @@ -568,6 +590,7 @@ void LLMeshRepoThread::run() mSignal->lock(); while (!LLApp::isQuitting()) { + if (!LLApp::isQuitting()) { static U32 count = 0; @@ -583,50 +606,35 @@ void LLMeshRepoThread::run() while (!mLODReqQ.empty() && count < MAX_MESH_REQUESTS_PER_SECOND && sActiveLODRequests < (S32)sMaxConcurrentRequests) { + if (mMutex) { mMutex->lock(); LODRequest req = mLODReqQ.front(); mLODReqQ.pop(); LLMeshRepository::sLODProcessing--; mMutex->unlock(); - try + if (!fetchMeshLOD(req.mMeshParams, req.mLOD, count))//failed, resubmit { - fetchMeshLOD(req.mMeshParams, req.mLOD, count); - } - catch(AICurlNoEasyHandle const& error) - { - llwarns << "fetchMeshLOD() failed: " << error.what() << llendl; mMutex->lock(); - LLMeshRepository::sLODProcessing++; mLODReqQ.push(req); mMutex->unlock(); - break; } } } while (!mHeaderReqQ.empty() && count < MAX_MESH_REQUESTS_PER_SECOND && sActiveHeaderRequests < (S32)sMaxConcurrentRequests) { + if (mMutex) { mMutex->lock(); HeaderRequest req = mHeaderReqQ.front(); mHeaderReqQ.pop(); mMutex->unlock(); - bool success = false; - try - { - success = fetchMeshHeader(req.mMeshParams, count); - } - catch(AICurlNoEasyHandle const& error) - { - llwarns << "fetchMeshHeader() failed: " << error.what() << llendl; - } - if (!success) + if (!fetchMeshHeader(req.mMeshParams, count))//failed, resubmit { mMutex->lock(); mHeaderReqQ.push(req) ; mMutex->unlock(); - break; } } } @@ -636,16 +644,7 @@ void LLMeshRepoThread::run() for (std::set::iterator iter = mSkinRequests.begin(); iter != mSkinRequests.end(); ++iter) { LLUUID mesh_id = *iter; - bool success = false; - try - { - success = fetchMeshSkinInfo(mesh_id); - } - catch(AICurlNoEasyHandle const& error) - { - llwarns << "fetchMeshSkinInfo(" << mesh_id << ") failed: " << error.what() << llendl; - } - if (!success) + if (!fetchMeshSkinInfo(mesh_id)) { incomplete.insert(mesh_id); } @@ -658,16 +657,7 @@ void LLMeshRepoThread::run() for (std::set::iterator iter = mDecompositionRequests.begin(); iter != mDecompositionRequests.end(); ++iter) { LLUUID mesh_id = *iter; - bool success = false; - try - { - success = fetchMeshDecomposition(mesh_id); - } - catch(AICurlNoEasyHandle const& error) - { - llwarns << "fetchMeshDecomposition(" << mesh_id << ") failed: " << error.what() << llendl; - } - if (!success) + if (!fetchMeshDecomposition(mesh_id)) { incomplete.insert(mesh_id); } @@ -680,16 +670,7 @@ void LLMeshRepoThread::run() for (std::set::iterator iter = mPhysicsShapeRequests.begin(); iter != mPhysicsShapeRequests.end(); ++iter) { LLUUID mesh_id = *iter; - bool success = false; - try - { - success = fetchMeshPhysicsShape(mesh_id); - } - catch(AICurlNoEasyHandle const& error) - { - llwarns << "fetchMeshPhysicsShape(" << mesh_id << ") failed: " << error.what() << llendl; - } - if (!success) + if (!fetchMeshPhysicsShape(mesh_id)) { incomplete.insert(mesh_id); } @@ -701,7 +682,11 @@ void LLMeshRepoThread::run() mSignal->wait(); } - mSignal->unlock(); + + if (mSignal->isLocked()) + { //make sure to let go of the mutex associated with the given signal before shutting down + mSignal->unlock(); + } res = LLConvexDecomposition::quitThread(); if (res != LLCD_OK) @@ -734,6 +719,8 @@ void LLMeshRepoThread::lockAndLoadMeshLOD(const LLVolumeParams& mesh_params, S32 } } + + void LLMeshRepoThread::loadMeshLOD(const LLVolumeParams& mesh_params, S32 lod) { //could be called from any thread LLMutexLock lock(mMutex); @@ -790,15 +777,21 @@ std::string LLMeshRepoThread::constructUrl(LLUUID mesh_id) bool LLMeshRepoThread::fetchMeshSkinInfo(const LLUUID& mesh_id) { //protected by mMutex + + if (!mHeaderMutex) + { + return false; + } + mHeaderMutex->lock(); if (mMeshHeader.find(mesh_id) == mMeshHeader.end()) - { - // We have no header info for this mesh, try again later. + { //we have no header info for this mesh, do nothing mHeaderMutex->unlock(); return false; } + bool ret = true ; U32 header_size = mMeshHeaderSize[mesh_id]; if (header_size > 0) @@ -820,7 +813,7 @@ bool LLMeshRepoThread::fetchMeshSkinInfo(const LLUUID& mesh_id) U8* buffer = new U8[size]; file.read(buffer, size); - //make sure buffer isn't all 0's (reserved block but not written) + //make sure buffer isn't all 0's by checking the first 1KB (reserved block but not written) bool zero = true; for (S32 i = 0; i < llmin(size, 1024) && zero; ++i) { @@ -845,9 +838,12 @@ bool LLMeshRepoThread::fetchMeshSkinInfo(const LLUUID& mesh_id) std::string http_url = constructUrl(mesh_id); if (!http_url.empty()) { - LLHTTPClient::getByteRange(http_url, offset, size, - new LLMeshSkinInfoResponder(mesh_id, offset, size), headers); - LLMeshRepository::sHTTPRequestCount++; + ret = LLHTTPClient::getByteRange(http_url, headers, offset, size, + new LLMeshSkinInfoResponder(mesh_id, offset, size)); + if (ret) + { + LLMeshRepository::sHTTPRequestCount++; + } } } } @@ -857,22 +853,26 @@ bool LLMeshRepoThread::fetchMeshSkinInfo(const LLUUID& mesh_id) } //early out was not hit, effectively fetched - return true; + return ret; } -//return false if failed to get header bool LLMeshRepoThread::fetchMeshDecomposition(const LLUUID& mesh_id) { //protected by mMutex + if (!mHeaderMutex) + { + return false; + } + mHeaderMutex->lock(); if (mMeshHeader.find(mesh_id) == mMeshHeader.end()) - { - // We have no header info for this mesh, try again later. + { //we have no header info for this mesh, do nothing mHeaderMutex->unlock(); return false; } U32 header_size = mMeshHeaderSize[mesh_id]; + bool ret = true ; if (header_size > 0) { @@ -889,11 +889,12 @@ bool LLMeshRepoThread::fetchMeshDecomposition(const LLUUID& mesh_id) if (file.getSize() >= offset+size) { LLMeshRepository::sCacheBytesRead += size; + file.seek(offset); U8* buffer = new U8[size]; file.read(buffer, size); - //make sure buffer isn't all 0's (reserved block but not written) + //make sure buffer isn't all 0's by checking the first 1KB (reserved block but not written) bool zero = true; for (S32 i = 0; i < llmin(size, 1024) && zero; ++i) { @@ -918,10 +919,12 @@ bool LLMeshRepoThread::fetchMeshDecomposition(const LLUUID& mesh_id) std::string http_url = constructUrl(mesh_id); if (!http_url.empty()) { - // This might throw AICurlNoEasyHandle. - LLHTTPClient::getByteRange(http_url, offset, size, - new LLMeshDecompositionResponder(mesh_id, offset, size), headers); - LLMeshRepository::sHTTPRequestCount++; + ret = LLHTTPClient::getByteRange(http_url, headers, offset, size, + new LLMeshDecompositionResponder(mesh_id, offset, size)); + if(ret) + { + LLMeshRepository::sHTTPRequestCount++; + } } } } @@ -931,22 +934,26 @@ bool LLMeshRepoThread::fetchMeshDecomposition(const LLUUID& mesh_id) } //early out was not hit, effectively fetched - return true; + return ret; } -//return false if failed to get header bool LLMeshRepoThread::fetchMeshPhysicsShape(const LLUUID& mesh_id) { //protected by mMutex + if (!mHeaderMutex) + { + return false; + } + mHeaderMutex->lock(); if (mMeshHeader.find(mesh_id) == mMeshHeader.end()) - { - // We have no header info for this mesh, retry later. + { //we have no header info for this mesh, do nothing mHeaderMutex->unlock(); return false; } U32 header_size = mMeshHeaderSize[mesh_id]; + bool ret = true ; if (header_size > 0) { @@ -967,7 +974,7 @@ bool LLMeshRepoThread::fetchMeshPhysicsShape(const LLUUID& mesh_id) U8* buffer = new U8[size]; file.read(buffer, size); - //make sure buffer isn't all 0's (reserved block but not written) + //make sure buffer isn't all 0's by checking the first 1KB (reserved block but not written) bool zero = true; for (S32 i = 0; i < llmin(size, 1024) && zero; ++i) { @@ -992,10 +999,13 @@ bool LLMeshRepoThread::fetchMeshPhysicsShape(const LLUUID& mesh_id) std::string http_url = constructUrl(mesh_id); if (!http_url.empty()) { - // This might throw AICurlNoEasyHandle. - LLHTTPClient::getByteRange(http_url, offset, size, - new LLMeshPhysicsShapeResponder(mesh_id, offset, size), headers); - LLMeshRepository::sHTTPRequestCount++; + ret = LLHTTPClient::getByteRange(http_url, headers, offset, size, + new LLMeshPhysicsShapeResponder(mesh_id, offset, size)); + + if(ret) + { + LLMeshRepository::sHTTPRequestCount++; + } } } else @@ -1009,7 +1019,7 @@ bool LLMeshRepoThread::fetchMeshPhysicsShape(const LLUUID& mesh_id) } //early out was not hit, effectively fetched - return true; + return ret; } //static @@ -1056,14 +1066,14 @@ bool LLMeshRepoThread::fetchMeshHeader(const LLVolumeParams& mesh_params, U32& c LLMeshRepository::sCacheBytesRead += bytes; file.read(buffer, bytes); if (headerReceived(mesh_params, buffer, bytes)) - { - // Already have header, no need to retry. + { //did not do an HTTP request, return false return true; } } } //either cache entry doesn't exist or is corrupt, request header from simulator + bool retval = true; AIHTTPHeaders headers("Accept", "application/octet-stream"); std::string http_url = constructUrl(mesh_params.getSculptID()); @@ -1072,19 +1082,29 @@ bool LLMeshRepoThread::fetchMeshHeader(const LLVolumeParams& mesh_params, U32& c //grab first 4KB if we're going to bother with a fetch. Cache will prevent future fetches if a full mesh fits //within the first 4KB //NOTE -- this will break of headers ever exceed 4KB - // This might throw AICurlNoEasyHandle. - LLHTTPClient::getByteRange(http_url, 0, 4096, new LLMeshHeaderResponder(mesh_params), headers); - LLMeshRepository::sHTTPRequestCount++; + retval = LLHTTPClient::getByteRange(http_url, headers, 0, 4096, new LLMeshHeaderResponder(mesh_params)); + if (retval) + { + LLMeshRepository::sHTTPRequestCount++; + } count++; } - return true; + return retval; } -void LLMeshRepoThread::fetchMeshLOD(const LLVolumeParams& mesh_params, S32 lod, U32& count) +//return false if failed to get mesh lod. +bool LLMeshRepoThread::fetchMeshLOD(const LLVolumeParams& mesh_params, S32 lod, U32& count) { //protected by mMutex + if (!mHeaderMutex) + { + return false; + } + mHeaderMutex->lock(); + bool retval = true; + LLUUID mesh_id = mesh_params.getSculptID(); U32 header_size = mMeshHeaderSize[mesh_id]; @@ -1108,7 +1128,7 @@ void LLMeshRepoThread::fetchMeshLOD(const LLVolumeParams& mesh_params, S32 lod, U8* buffer = new U8[size]; file.read(buffer, size); - //make sure buffer isn't all 0's (reserved block but not written) + //make sure buffer isn't all 0's by checking the first 1KB (reserved block but not written) bool zero = true; for (S32 i = 0; i < llmin(size, 1024) && zero; ++i) { @@ -1120,7 +1140,7 @@ void LLMeshRepoThread::fetchMeshLOD(const LLVolumeParams& mesh_params, S32 lod, if (lodReceived(mesh_params, lod, buffer, size)) { delete[] buffer; - return; + return true; } } @@ -1133,10 +1153,13 @@ void LLMeshRepoThread::fetchMeshLOD(const LLVolumeParams& mesh_params, S32 lod, std::string http_url = constructUrl(mesh_id); if (!http_url.empty()) { - // This might throw AICurlNoEasyHandle. - LLHTTPClient::getByteRange(constructUrl(mesh_id), offset, size, - new LLMeshLODResponder(mesh_params, lod, offset, size), headers); - LLMeshRepository::sHTTPRequestCount++; + retval = LLHTTPClient::getByteRange(constructUrl(mesh_id), headers, offset, size, + new LLMeshLODResponder(mesh_params, lod, offset, size)); + + if (retval) + { + LLMeshRepository::sHTTPRequestCount++; + } count++; } else @@ -1153,6 +1176,8 @@ void LLMeshRepoThread::fetchMeshLOD(const LLVolumeParams& mesh_params, S32 lod, { mHeaderMutex->unlock(); } + + return retval; } bool LLMeshRepoThread::headerReceived(const LLVolumeParams& mesh_params, U8* data, S32 data_size) @@ -1199,7 +1224,6 @@ bool LLMeshRepoThread::headerReceived(const LLVolumeParams& mesh_params, U8* dat mMeshHeader[mesh_id] = header; } - LLMutexLock lock(mMutex); // make sure only one thread access mPendingLOD at the same time. //check for pending requests @@ -1212,10 +1236,8 @@ bool LLMeshRepoThread::headerReceived(const LLVolumeParams& mesh_params, U8* dat mLODReqQ.push(req); LLMeshRepository::sLODProcessing++; } - - mPendingLOD.erase(iter); // FIRE-7182, only call erase if iter is really valid. + mPendingLOD.erase(iter); } - // mPendingLOD.erase(iter); // avoid crash by moving erase up. } return true; @@ -1375,6 +1397,11 @@ void LLMeshUploadThread::init(LLMeshUploadThread::instance_list& data, LLVector3 mMeshUploadTimeOut = gSavedSettings.getS32("MeshUploadTimeOut") ; } +LLMeshUploadThread::~LLMeshUploadThread() +{ + +} + LLMeshUploadThread::DecompRequest::DecompRequest(LLModel* mdl, LLModel* base_model, LLMeshUploadThread* thread) { mStage = "single_hull"; @@ -1476,18 +1503,18 @@ bool LLMeshUploadThread::run() void LLMeshUploadThread::postRequest(std::string& whole_model_upload_url, AIMeshUpload* state_machine) { - if (!mDoUpload) - { - LLHTTPClient::post(mWholeModelFeeCapability, mModelData, - new LLWholeModelFeeResponder(mModelData, mFeeObserverHandle, whole_model_upload_url)/*,*/ - DEBUG_CURLIO_PARAM(debug_on), keep_alive, state_machine, AIMeshUpload_responderFinished); - } - else + if (mDoUpload) { LLHTTPClient::post(whole_model_upload_url, mBody, new LLWholeModelUploadResponder(mModelData, mUploadObserverHandle)/*,*/ DEBUG_CURLIO_PARAM(debug_off), keep_alive, state_machine, AIMeshUpload_responderFinished); } + else + { + LLHTTPClient::post(mWholeModelFeeCapability, mModelData, + new LLWholeModelFeeResponder(mModelData, mFeeObserverHandle, whole_model_upload_url)/*,*/ + DEBUG_CURLIO_PARAM(debug_on), keep_alive, state_machine, AIMeshUpload_responderFinished); + } } void dump_llsd_to_file(const LLSD& content, std::string filename) @@ -1735,8 +1762,14 @@ void LLMeshUploadThread::generateHulls() } } + void LLMeshRepoThread::notifyLoadedMeshes() -{//called via gMeshRepo.notifyLoadedMeshes(). mMutex already locked +{ + if (!mMutex) + { + return; + } + while (!mLoadedQ.empty()) { mMutex->lock(); @@ -1860,6 +1893,12 @@ void LLMeshLODResponder::completedRaw(U32 status, const std::string& reason, { mProcessed = true; + // thread could have already be destroyed during logout + if( !gMeshRepo.mThread ) + { + return; + } + S32 data_size = buffer->countAfter(channels.in(), NULL); if (status < 200 || status >= 400) @@ -1877,6 +1916,7 @@ void LLMeshLODResponder::completedRaw(U32 status, const std::string& reason, } else { + llassert(is_internal_http_error_that_warrants_a_retry(status) || status == HTTP_SERVICE_UNAVAILABLE); //intentionally trigger a breakpoint llwarns << "Unhandled status " << status << llendl; } return; @@ -1917,6 +1957,12 @@ void LLMeshSkinInfoResponder::completedRaw(U32 status, const std::string& reason { mProcessed = true; + // thread could have already be destroyed during logout + if( !gMeshRepo.mThread ) + { + return; + } + S32 data_size = buffer->countAfter(channels.in(), NULL); if (status < 200 || status >= 400) @@ -1928,12 +1974,13 @@ void LLMeshSkinInfoResponder::completedRaw(U32 status, const std::string& reason { if (is_internal_http_error_that_warrants_a_retry(status) || status == HTTP_SERVICE_UNAVAILABLE) { //timeout or service unavailable, try again - llwarns << "Timeout or service unavailable, retrying." << llendl; + llwarns << "Timeout or service unavailable, retrying loadMeshSkinInfo() for " << mMeshID << llendl; LLMeshRepository::sHTTPRetryCount++; gMeshRepo.mThread->loadMeshSkinInfo(mMeshID); } else { + llassert(is_internal_http_error_that_warrants_a_retry(status) || status == HTTP_SERVICE_UNAVAILABLE); //intentionally trigger a breakpoint llwarns << "Unhandled status " << status << llendl; } return; @@ -1974,6 +2021,11 @@ void LLMeshDecompositionResponder::completedRaw(U32 status, const std::string& r { mProcessed = true; + if( !gMeshRepo.mThread ) + { + return; + } + S32 data_size = buffer->countAfter(channels.in(), NULL); if (status < 200 || status >= 400) @@ -1985,12 +2037,13 @@ void LLMeshDecompositionResponder::completedRaw(U32 status, const std::string& r { if (is_internal_http_error_that_warrants_a_retry(status) || status == HTTP_SERVICE_UNAVAILABLE) { //timeout or service unavailable, try again - llwarns << "Timeout or service unavailable, retrying." << llendl; + llwarns << "Timeout or service unavailable, retrying loadMeshDecomposition() for " << mMeshID << llendl; LLMeshRepository::sHTTPRetryCount++; gMeshRepo.mThread->loadMeshDecomposition(mMeshID); } else { + llassert(is_internal_http_error_that_warrants_a_retry(status) || status == HTTP_SERVICE_UNAVAILABLE); //intentionally trigger a breakpoint llwarns << "Unhandled status " << status << llendl; } return; @@ -2031,6 +2084,12 @@ void LLMeshPhysicsShapeResponder::completedRaw(U32 status, const std::string& re { mProcessed = true; + // thread could have already be destroyed during logout + if( !gMeshRepo.mThread ) + { + return; + } + S32 data_size = buffer->countAfter(channels.in(), NULL); if (status < 200 || status >= 400) @@ -2042,12 +2101,13 @@ void LLMeshPhysicsShapeResponder::completedRaw(U32 status, const std::string& re { if (is_internal_http_error_that_warrants_a_retry(status) || status == HTTP_SERVICE_UNAVAILABLE) { //timeout or service unavailable, try again - llwarns << "Timeout or service unavailable, retrying." << llendl; + llwarns << "Timeout or service unavailable, retrying loadMeshPhysicsShape() for " << mMeshID << llendl; LLMeshRepository::sHTTPRetryCount++; gMeshRepo.mThread->loadMeshPhysicsShape(mMeshID); } else { + llassert(is_internal_http_error_that_warrants_a_retry(status) || status == HTTP_SERVICE_UNAVAILABLE); //intentionally trigger a breakpoint llwarns << "Unhandled status " << status << llendl; } return; @@ -2088,18 +2148,27 @@ void LLMeshHeaderResponder::completedRaw(U32 status, const std::string& reason, { mProcessed = true; + // thread could have already be destroyed during logout + if( !gMeshRepo.mThread ) + { + return; + } + if (status < 200 || status >= 400) { //llwarns // << "Header responder failed with status: " // << status << ": " << reason << llendl; - // HTTP_SERVICE_UNAVAILABLE (503) or HTTP_INTERNAL_ERROR_*'s. + // 503 (service unavailable) or HTTP_INTERNAL_ERROR_*'s. // can be due to server load and can be retried // TODO*: Add maximum retry logic, exponential backoff // and (somewhat more optional than the others) retries // again after some set period of time + + llassert(status == HTTP_NOT_FOUND || status == HTTP_SERVICE_UNAVAILABLE || status == HTTP_REQUEST_TIME_OUT || is_internal_http_error_that_warrants_a_retry(status)); + if (is_internal_http_error_that_warrants_a_retry(status) || status == HTTP_SERVICE_UNAVAILABLE) { //retry llwarns << "Timeout or service unavailable, retrying." << llendl; @@ -2112,7 +2181,7 @@ void LLMeshHeaderResponder::completedRaw(U32 status, const std::string& reason, } else { - llwarns << "Unhandled status." << llendl; + llwarns << "Unhandled status: " << status << llendl; } } @@ -2401,8 +2470,7 @@ void LLMeshRepository::notifyLoadedMeshes() mDecompThread->notifyCompleted(); if (!mThread->mSignal->tryLock()) - { - // Curl thread is churning, wait for it to go idle. + { //curl thread is churning, wait for it to go idle return; } mThread->mSignal->unlock(); @@ -2414,7 +2482,6 @@ void LLMeshRepository::notifyLoadedMeshes() if (gAgent.getRegion()->getName() != region_name && gAgent.getRegion()->capabilitiesReceived()) { region_name = gAgent.getRegion()->getName(); - mGetMeshCapability = gAgent.getRegion()->getCapability("GetMesh2"); if (mGetMeshCapability.empty()) { @@ -2772,8 +2839,9 @@ void LLMeshRepository::uploadModel(std::vector& data, LLVector3 llinfos << "unable to upload, fee request failed" << llendl; return; } - AIMeshUpload* uploader = new AIMeshUpload(data, scale, upload_textures, upload_skin, upload_joints, upload_url, do_upload, fee_observer, upload_observer); - uploader->run(NULL, 0, false, true, &gMainThreadEngine); + AIMeshUpload* thread = new AIMeshUpload(data, scale, upload_textures, upload_skin, upload_joints, upload_url, + do_upload, fee_observer, upload_observer); + thread->run(NULL, 0, false, true, &gMainThreadEngine); } S32 LLMeshRepository::getMeshSize(const LLUUID& mesh_id, S32 lod) @@ -3069,13 +3137,15 @@ bool needTriangles( LLConvexDecomposition *aDC ) void LLPhysicsDecomp::setMeshData(LLCDMeshData& mesh, bool vertex_based) { - LLConvexDecomposition *pDeComp = LLConvexDecomposition::getInstance(); - - if( !pDeComp ) - return; - - if( vertex_based ) - vertex_based = !needTriangles( pDeComp ); + // HACD + if (vertex_based) + { + if (LLConvexDecomposition* pDeComp = LLConvexDecomposition::getInstance()) + vertex_based = !needTriangles(pDeComp); + else + return; + } + // mesh.mVertexBase = mCurRequest->mPositions[0].mV; mesh.mVertexStrideBytes = 12; @@ -3093,7 +3163,10 @@ void LLPhysicsDecomp::setMeshData(LLCDMeshData& mesh, bool vertex_based) if ((vertex_based || mesh.mNumTriangles > 0) && mesh.mNumVertices > 2) { LLCDResult ret = LLCD_OK; - ret = LLConvexDecomposition::getInstance()->setMeshData(&mesh, vertex_based); + if (LLConvexDecomposition::getInstance() != NULL) + { + ret = LLConvexDecomposition::getInstance()->setMeshData(&mesh, vertex_based); + } if (ret) { @@ -3148,6 +3221,7 @@ void LLPhysicsDecomp::doDecomposition() continue; } + if (param->mType == LLCDParam::LLCD_FLOAT) { ret = LLConvexDecomposition::getInstance()->setParam(param->mName, (F32) value.asReal()); @@ -3461,10 +3535,12 @@ void LLPhysicsDecomp::run() } } - mSignal->unlock(); - decomp->quitThread(); + if (mSignal->isLocked()) + { //let go of mSignal's associated mutex + mSignal->unlock(); + } mDone = true; } @@ -3670,4 +3746,3 @@ bool LLMeshRepository::meshRezEnabled() } return false; } - diff --git a/indra/newview/llmeshrepository.h b/indra/newview/llmeshrepository.h index 4b535f397..ab9220cdc 100644 --- a/indra/newview/llmeshrepository.h +++ b/indra/newview/llmeshrepository.h @@ -36,7 +36,7 @@ #define LLCONVEXDECOMPINTER_STATIC 1 -#include "LLConvexDecomposition.h" +#include "llconvexdecomposition.h" #include "lluploadfloaterobservers.h" #include "aistatemachinethread.h" @@ -324,7 +324,7 @@ public: void lockAndLoadMeshLOD(const LLVolumeParams& mesh_params, S32 lod); void loadMeshLOD(const LLVolumeParams& mesh_params, S32 lod); bool fetchMeshHeader(const LLVolumeParams& mesh_params, U32& count); - void fetchMeshLOD(const LLVolumeParams& mesh_params, S32 lod, U32& count); + bool fetchMeshLOD(const LLVolumeParams& mesh_params, S32 lod, U32& count); bool headerReceived(const LLVolumeParams& mesh_params, U8* data, S32 data_size); bool lodReceived(const LLVolumeParams& mesh_params, S32 lod, U8* data, S32 data_size); bool skinInfoReceived(const LLUUID& mesh_id, U8* data, S32 data_size); @@ -405,10 +405,11 @@ public: #endif void init(instance_list& data, LLVector3& scale, bool upload_textures, bool upload_skin, bool upload_joints, bool do_upload, LLHandle const& fee_observer, LLHandle const& upload_observer); + ~LLMeshUploadThread(); void postRequest(std::string& url, AIMeshUpload* state_machine); - /*virtual*/ bool run(); + virtual bool run(); void preStart(); void generateHulls(); @@ -504,8 +505,7 @@ public: void uploadModel(std::vector& data, LLVector3& scale, bool upload_textures, bool upload_skin, bool upload_joints, std::string upload_url, bool do_upload = true, - LLHandle fee_observer= (LLHandle()), - LLHandle upload_observer = (LLHandle())); + LLHandle fee_observer= (LLHandle()), LLHandle upload_observer = (LLHandle())); S32 getMeshSize(const LLUUID& mesh_id, S32 lod); diff --git a/indra/newview/llnetmap.cpp b/indra/newview/llnetmap.cpp index ce43bd8f8..e81c406a3 100644 --- a/indra/newview/llnetmap.cpp +++ b/indra/newview/llnetmap.cpp @@ -103,11 +103,15 @@ const S32 CIRCLE_STEPS = 100; const F64 COARSEUPDATE_MAX_Z = 1020.0f; +std::map LLNetMap::mClosestAgentsToCursor; // +static std::map mClosestAgentsAtLastClick; // + LLNetMap::LLNetMap(const std::string& name) : LLPanel(name), mScale(128.f), mObjectMapTPM(1.f), mObjectMapPixels(255.f), + mPickRadius(gSavedSettings, "ExodusMinimapAreaEffect"), // mTargetPan(0.f, 0.f), mCurPan(0.f, 0.f), mStartPan(0.f, 0.f), @@ -215,6 +219,13 @@ std::size_t hash_value(const LLUUID& uuid) return (std::size_t)uuid.getCRC32(); } boost::unordered_map mm_MarkerColors; +bool mm_getMarkerColor(const LLUUID& id, LLColor4& color) +{ + boost::unordered_map::const_iterator it = mm_MarkerColors.find(id); + if (it == mm_MarkerColors.end()) return false; + color = it->second; + return true; +} void LLNetMap::mm_setcolor(LLUUID key,LLColor4 col) { @@ -222,6 +233,10 @@ void LLNetMap::mm_setcolor(LLUUID key,LLColor4 col) } void LLNetMap::draw() { + LLViewerRegion* region = gAgent.getRegion(); + + if (region == NULL) return; + static LLFrameTimer map_timer; static LLUIColor map_track_color = gTrackColor; static const LLCachedControl map_frustum_color(gColors, "NetMapFrustum", LLColor4::white); @@ -262,18 +277,15 @@ void LLNetMap::draw() gGL.loadIdentity(); gGL.loadUIIdentity(); - gGL.scalef(scale.mV[0], scale.mV[1], scale.mV[2]); gGL.translatef(offset.mV[0], offset.mV[1], offset.mV[2]); - { LLLocalClipRect clip(getLocalRect()); { gGL.getTexUnit(0)->unbind(LLTexUnit::TT_TEXTURE); - gGL.matrixMode(LLRender::MM_MODELVIEW); - // Draw background rectangle + // Draw background rectangle. if(isBackgroundVisible()) { LLColor4 background_color = isBackgroundOpaque() ? getBackgroundColor().mV : getTransparentColor().mV; @@ -282,23 +294,22 @@ void LLNetMap::draw() } } - // region 0,0 is in the middle + // Region 0,0 is in the middle. S32 center_sw_left = getRect().getWidth() / 2 + llfloor(mCurPan.mV[VX]); S32 center_sw_bottom = getRect().getHeight() / 2 + llfloor(mCurPan.mV[VY]); gGL.pushMatrix(); - gGL.translatef( (F32) center_sw_left, (F32) center_sw_bottom, 0.f); static LLCachedControl rotate_map("MiniMapRotate", true); if (rotate_map) { - // rotate subsequent draws to agent rotation + // Rotate subsequent draws to agent rotation. rotation = atan2( LLViewerCamera::getInstance()->getAtAxis().mV[VX], LLViewerCamera::getInstance()->getAtAxis().mV[VY] ); gGL.rotatef( rotation * RAD_TO_DEG, 0.f, 0.f, 1.f); } - // figure out where agent is + // Figure out where agent is. static const LLCachedControl this_region_color(gColors, "NetMapThisRegion"); static const LLCachedControl live_region_color(gColors, "NetMapLiveRegion"); static const LLCachedControl dead_region_color(gColors, "NetMapDeadRegion"); @@ -311,13 +322,14 @@ void LLNetMap::draw() iter != LLWorld::getInstance()->getRegionList().end(); ++iter) { LLViewerRegion* regionp = *iter; + // Find x and y position relative to camera's center. LLVector3 origin_agent = regionp->getOriginAgent(); LLVector3 rel_region_pos = origin_agent - gAgentCamera.getCameraPositionAgent(); F32 relative_x = (rel_region_pos.mV[0] / region_width) * mScale; F32 relative_y = (rel_region_pos.mV[1] / region_width) * mScale; - // background region rectangle + // Background region rectangle. F32 bottom = relative_y; F32 left = relative_x; // Aurora Sim @@ -327,19 +339,9 @@ void LLNetMap::draw() F32 right = left + (regionp->getWidth() / REGION_WIDTH_METERS) * mScale ; // Aurora Sim - if (regionp == gAgent.getRegion()) - { - gGL.color4fv(this_region_color().mV); - } - else - { - gGL.color4fv(live_region_color().mV); - } - - if (!regionp->isAlive()) - { - gGL.color4fv(dead_region_color().mV); - } + if (regionp == region) gGL.color4fv(this_region_color().mV); + else if (!regionp->isAlive()) gGL.color4fv(dead_region_color().mV); + else gGL.color4fv(live_region_color().mV); // [SL:KB] - Patch: World-MinimapOverlay | Checked: 2012-07-26 (Catznip-3.3) static LLCachedControl s_fUseWorldMapTextures(gSavedSettings, "MiniMapWorldMapTextures"); @@ -445,7 +447,6 @@ void LLNetMap::draw() gObjectList.renderObjectsForMap(*this); mObjectImagep->setSubImage(mObjectRawImagep, 0, 0, mObjectImagep->getWidth(), mObjectImagep->getHeight()); - map_timer.reset(); } @@ -530,10 +531,15 @@ void LLNetMap::draw() // Mouse pointer in local coordinates S32 local_mouse_x; S32 local_mouse_y; - //localMouse(&local_mouse_x, &local_mouse_y); + LLUI::getMousePositionLocal(this, &local_mouse_x, &local_mouse_y); + + F32 min_pick_dist = mDotRadius * mPickRadius; + mClosestAgentToCursor.setNull(); - F32 closest_dist_squared = F32_MAX; // value will be overridden in the loop + mClosestAgentsToCursor.clear(); + + F32 closest_dist_squared = F32_MAX; F32 min_pick_dist_squared = (mDotRadius * MIN_PICK_SCALE) * (mDotRadius * MIN_PICK_SCALE); LLVector3 pos_map; @@ -564,38 +570,45 @@ void LLNetMap::draw() { pos_map.mV[VZ] = 16000.f; } - if(LLMuteList::getInstance()->isMuted(uuid)) - { - static const LLCachedControl muted_color("AscentMutedColor",LLColor4(0.7f,0.7f,0.7f,1.f)); - color = muted_color; - } - LLViewerRegion* avatar_region = LLWorld::getInstance()->getRegionFromPosGlobal(positions[i]); - LLUUID estate_owner = avatar_region ? avatar_region->getOwner() : LLUUID::null; + if (dist_vec(LLVector2(pos_map.mV[VX], pos_map.mV[VY]), LLVector2(local_mouse_x, local_mouse_y)) < min_pick_dist) + { + mClosestAgentsToCursor[uuid] = positions[i]; + static const LLCachedControl map_avatar_rollover_color(gSavedSettings, "ExodusMapRolloverColor", LLColor4::cyan); + color = map_avatar_rollover_color; + } + else + { - // MOYMOD Minimap custom av colors. - boost::unordered_map::const_iterator it = mm_MarkerColors.find(uuid); - if(it != mm_MarkerColors.end()) - { - color = it->second; - } - //Lindens are always more Linden than your friend, make that take precedence - else if (LLMuteList::getInstance()->isLinden(uuid)) - { - static const LLCachedControl linden_color("AscentLindenColor",LLColor4(0.f,0.f,1.f,1.f)); - color = linden_color; - } - //check if they are an estate owner at their current position - else if (estate_owner.notNull() && uuid == estate_owner) - { - static const LLCachedControl em_color("AscentEstateOwnerColor",LLColor4(1.f,0.6f,1.f,1.f)); - color = em_color; - } - //without these dots, SL would suck. - else if (show_friends && LLAvatarActions::isFriend(uuid)) - { - static const LLCachedControl friend_color("AscentFriendColor",LLColor4(1.f,1.f,0.f,1.f)); - color = friend_color; + if(LLMuteList::getInstance()->isMuted(uuid)) + { + static const LLCachedControl muted_color("AscentMutedColor",LLColor4(0.7f,0.7f,0.7f,1.f)); + color = muted_color; + } + + LLViewerRegion* avatar_region = LLWorld::getInstance()->getRegionFromPosGlobal(positions[i]); + const LLUUID estate_owner = avatar_region ? avatar_region->getOwner() : LLUUID::null; + + // MOYMOD Minimap custom av colors. + if (mm_getMarkerColor(uuid, color)) {} + //Lindens are always more Linden than your friend, make that take precedence + else if (LLMuteList::getInstance()->isLinden(uuid)) + { + static const LLCachedControl linden_color("AscentLindenColor",LLColor4(0.f,0.f,1.f,1.f)); + color = linden_color; + } + //check if they are an estate owner at their current position + else if (estate_owner.notNull() && uuid == estate_owner) + { + static const LLCachedControl em_color("AscentEstateOwnerColor",LLColor4(1.f,0.6f,1.f,1.f)); + color = em_color; + } + //without these dots, SL would suck. + else if (show_friends && LLAvatarActions::isFriend(uuid)) + { + static const LLCachedControl friend_color("AscentFriendColor",LLColor4(1.f,1.f,0.f,1.f)); + color = friend_color; + } } LLWorldMapView::drawAvatar( @@ -603,23 +616,12 @@ void LLNetMap::draw() color, pos_map.mV[VZ], mDotRadius); - F32 dist_to_cursor_squared = dist_vec_squared(LLVector2(pos_map.mV[VX], pos_map.mV[VY]), - LLVector2(local_mouse_x,local_mouse_y)); - if(dist_to_cursor_squared < min_pick_dist_squared) - { - if (dist_to_cursor_squared < closest_dist_squared) - { - closest_dist_squared = dist_to_cursor_squared; - mClosestAgentToCursor = uuid; - mClosestAgentPosition = positions[i]; - } - } - if (!gmSelected.empty()) if (uuid.notNull()) { bool selected = false; uuid_vec_t::iterator sel_iter = gmSelected.begin(); + for (; sel_iter != gmSelected.end(); sel_iter++) { if(*sel_iter == uuid) @@ -628,6 +630,7 @@ void LLNetMap::draw() break; } } + if (selected) { if( (pos_map.mV[VX] < 0) || @@ -637,13 +640,19 @@ void LLNetMap::draw() { S32 x = llround( pos_map.mV[VX] ); S32 y = llround( pos_map.mV[VY] ); + LLWorldMapView::drawTrackingCircle( getRect(), x, y, color, 1, 10); - } else - { - LLWorldMapView::drawTrackingDot(pos_map.mV[VX],pos_map.mV[VY],color,0.f); } + else LLWorldMapView::drawTrackingDot(pos_map.mV[VX],pos_map.mV[VY],color,0.f); } } + + F32 dist_to_cursor_squared = dist_vec_squared(LLVector2(pos_map.mV[VX], pos_map.mV[VY]), LLVector2(local_mouse_x,local_mouse_y)); + if (dist_to_cursor_squared < min_pick_dist_squared && dist_to_cursor_squared < closest_dist_squared) + { + closest_dist_squared = dist_to_cursor_squared; + mClosestAgentToCursor = uuid; + } } // Draw dot for autopilot target @@ -658,24 +667,31 @@ void LLNetMap::draw() { drawTracking( LLAvatarTracker::instance().getGlobalPos(), map_track_color ); } - else if ( LLTracker::TRACKING_LANDMARK == tracking_status - || LLTracker::TRACKING_LOCATION == tracking_status ) + else if ( LLTracker::TRACKING_LANDMARK == tracking_status || + LLTracker::TRACKING_LOCATION == tracking_status ) { drawTracking( LLTracker::getTrackedPositionGlobal(), map_track_color ); } } - // Draw dot for self avatar position - LLVector3d pos_global = gAgent.getPositionGlobal(); - pos_map = globalPosToView(pos_global); + pos_map = globalPosToView(gAgent.getPositionGlobal()); S32 dot_width = llround(mDotRadius * 2.f); LLUIImagePtr you = LLWorldMapView::sAvatarYouLargeImage; + if (you) { you->draw(llround(pos_map.mV[VX] - mDotRadius), llround(pos_map.mV[VY] - mDotRadius), dot_width, dot_width); + + F32 dist_to_cursor_squared = dist_vec_squared(LLVector2(pos_map.mV[VX], pos_map.mV[VY]), + LLVector2(local_mouse_x,local_mouse_y)); + + if (dist_to_cursor_squared < min_pick_dist_squared && dist_to_cursor_squared < closest_dist_squared) + { + mClosestAgentToCursor = gAgent.getID(); + } } // Draw chat range ring(s) @@ -721,18 +737,25 @@ void LLNetMap::draw() else { gGL.color4fv((map_frustum_rotating_color()).mV); - + // If we don't rotate the map, we have to rotate the frustum. gGL.pushMatrix(); gGL.translatef( ctr_x, ctr_y, 0 ); gGL.rotatef( atan2( LLViewerCamera::getInstance()->getAtAxis().mV[VX], LLViewerCamera::getInstance()->getAtAxis().mV[VY] ) * RAD_TO_DEG, 0.f, 0.f, -1.f); gGL.begin( LLRender::TRIANGLES ); - gGL.vertex2f( 0, 0 ); + gGL.vertex2f( 0.f, 0.f ); gGL.vertex2f( -half_width_pixels, far_clip_pixels ); gGL.vertex2f( half_width_pixels, far_clip_pixels ); gGL.end(); gGL.popMatrix(); } + + // Draw mouse radius + static const LLCachedControl map_avatar_rollover_color("ExodusMapRolloverCircleColor"); + gGL.color4fv((map_avatar_rollover_color()).mV); + // Todo: Detect if over the window and don't render a circle? + gl_circle_2d(local_mouse_x, local_mouse_y, min_pick_dist, 32, true); + // } gGL.popMatrix(); @@ -764,9 +787,7 @@ void LLNetMap::reshape(S32 width, S32 height, BOOL called_from_parent) LLVector3 LLNetMap::globalPosToView(const LLVector3d& global_pos) { - LLVector3d camera_position = gAgentCamera.getCameraPositionGlobal(); - - LLVector3d relative_pos_global = global_pos - camera_position; + LLVector3d relative_pos_global = global_pos - gAgentCamera.getCameraPositionGlobal(); LLVector3 pos_local; pos_local.setVec(relative_pos_global); // convert to floats from doubles @@ -862,6 +883,13 @@ LLVector3d LLNetMap::viewPosToGlobal( S32 x, S32 y ) BOOL LLNetMap::handleScrollWheel(S32 x, S32 y, S32 clicks) { + // + if (gKeyboard->currentMask(TRUE) & MASK_SHIFT) + { + mPickRadius = llclamp(mPickRadius + (2.5f * clicks), 1.f, 64.f); + return true; + } + // // note that clicks are reversed from what you'd think: i.e. > 0 means zoom out, < 0 means zoom in F32 new_scale = mScale * pow(MAP_SCALE_ZOOM_FACTOR, -clicks); F32 old_scale = mScale; @@ -881,7 +909,7 @@ BOOL LLNetMap::handleScrollWheel(S32 x, S32 y, S32 clicks) return TRUE; } -BOOL LLNetMap::handleToolTip( S32 x, S32 y, std::string& msg, LLRect* sticky_rect_screen ) +BOOL LLNetMap::handleToolTip( S32 x, S32 y, std::string& tool_tip, LLRect* sticky_rect_screen ) { if (gDisconnected) { @@ -898,41 +926,64 @@ BOOL LLNetMap::handleToolTip( S32 x, S32 y, std::string& msg, LLRect* sticky_rec sticky_rect.mRight = sticky_rect.mLeft + 2 * SLOP; sticky_rect.mTop = sticky_rect.mBottom + 2 * SLOP; - msg.assign(""); - std::string fullname; - if(mClosestAgentToCursor.notNull() && LLAvatarNameCache::getPNSName(mClosestAgentToCursor, fullname)) + tool_tip.assign(""); + + if (region->mMapAvatarIDs.count()) { - //msg.append(fullname); -// [RLVa:KB] - Version: 1.23.4 | Checked: 2009-07-08 (RLVa-1.0.0e) | Modified: RLVa-0.2.0b - msg.append( (!gRlvHandler.hasBehaviour(RLV_BHVR_SHOWNAMES)) ? fullname : RlvStrings::getAnonym(fullname) ); -// [/RLVa:KB] - msg.append("\n"); - - LLVector3d mypos = gAgent.getPositionGlobal(); - LLVector3d position = mClosestAgentPosition; - - if ( LLFloaterAvatarList::instanceExists() ) + if (mClosestAgentsToCursor.size()) { - if (LLAvatarListEntry *ent = LLFloaterAvatarList::getInstance()->getAvatarEntry(mClosestAgentToCursor)) - position = ent->getPosition(); - } - LLVector3d delta = position - mypos; - F32 distance = (F32)delta.magVec(); + bool single_agent(mClosestAgentsToCursor.size() == 1); // Singu note: For old look, only add the count if we have more than one + if (!single_agent) + tool_tip.append(llformat("Agents under cursor (%d/%d)\n", mClosestAgentsToCursor.size(), region->mMapAvatarIDs.count() + 1)); - msg.append( llformat("\n(Distance: %.02fm)\n\n",distance) ); + LLVector3d myPosition = gAgent.getPositionGlobal(); + + std::map::iterator current = mClosestAgentsToCursor.begin(); + std::map::iterator end = mClosestAgentsToCursor.end(); + for (; current != end; ++current) + { + LLUUID targetUUID = (*current).first; + LLVector3d targetPosition = (*current).second; + + std::string fullName; + if (targetUUID.notNull() && LLAvatarNameCache::getPNSName(targetUUID, fullName)) + { + //tool_tip.append(fullName); +// [RLVa:KB] - Version: 1.23.4 | Checked: 2009-07-08 (RLVa-1.0.0e) | Modified: RLVa-0.2.0b + tool_tip.append( (!gRlvHandler.hasBehaviour(RLV_BHVR_SHOWNAMES)) ? fullName : RlvStrings::getAnonym(fullName) ); +// [/RLVa:KB] + + // Use the radar for positioning, when possible. + if (LLFloaterAvatarList::instanceExists()) + { + if (LLAvatarListEntry* ent = LLFloaterAvatarList::getInstance()->getAvatarEntry(targetUUID)) + targetPosition = ent->getPosition(); + } + // + + LLVector3d delta = targetPosition - myPosition; + F32 distance = (F32)delta.magVec(); + if (single_agent) + tool_tip.append( llformat("\n\n(Distance: %.02fm)\n",distance) ); + else + tool_tip.append(llformat(" (%.02fm)\n", distance)); + } + } + tool_tip.append("\n"); + } } // [RLVa:KB] - Version: 1.23.4 | Checked: 2009-07-04 (RLVa-1.0.0a) | Modified: RLVa-0.2.0b - msg.append( (!gRlvHandler.hasBehaviour(RLV_BHVR_SHOWLOC)) ? region->getName() : RlvStrings::getString(RLV_STRING_HIDDEN) ); + tool_tip.append((!gRlvHandler.hasBehaviour(RLV_BHVR_SHOWLOC) ? region->getName() : RlvStrings::getString(RLV_STRING_HIDDEN))); // [/RLVa:KB] - //msg.append( region->getName() ); + //tool_tip.append("\n\n" + region->getName()); - msg.append("\n" + region->getHost().getHostName()); - msg.append("\n" + region->getHost().getString()); - msg.append("\n" + getToolTip()); + tool_tip.append("\n" + region->getHost().getHostName()); + tool_tip.append("\n" + region->getHost().getString()); + tool_tip.append("\n" + getToolTip()); } else { - return LLPanel::handleToolTip(x, y, msg, sticky_rect_screen); + return LLPanel::handleToolTip(x, y, tool_tip, sticky_rect_screen); } *sticky_rect_screen = sticky_rect; return TRUE; @@ -1283,9 +1334,11 @@ bool LLNetMap::OverlayToggle::handleEvent(LLPointer event, const LLSD& BOOL LLNetMap::handleRightMouseDown(S32 x, S32 y, MASK mask) { + mClosestAgentsAtLastClick = mClosestAgentsToCursor; mClosestAgentAtLastRightClick = mClosestAgentToCursor; if (mPopupMenu) { + // Singu TODO: It'd be spectacular to address multiple avatars from here. mPopupMenu->buildDrawLabels(); mPopupMenu->updateParent(LLMenuGL::sMenuContainer); LLMenuGL::showPopup(this, mPopupMenu, x, y); @@ -1404,58 +1457,50 @@ bool LLNetMap::LLScaleMap::handleEvent(LLPointer event, const LLSD& use } //moymod - minimap color shit -bool LLNetMap::mmsetred::handleEvent(LLPointer event, const LLSD& userdata) +void markMassAgents(const LLColor4& color) { - LLNetMap *self = mPtr; - //if(self->mClosestAgentAtLastRightClick){ - mm_setcolor(self->mClosestAgentAtLastRightClick,LLColor4(1.0,0.0,0.0,1.0)); - //} + std::map::iterator current = mClosestAgentsAtLastClick.begin(); + std::map::iterator end = mClosestAgentsAtLastClick.end(); + for(; current != end; ++current) LLNetMap::mm_setcolor((*current).first, color); +} + +bool LLNetMap::mmsetred::handleEvent(LLPointer, const LLSD&) +{ + markMassAgents(LLColor4::red); return true; +} +bool LLNetMap::mmsetgreen::handleEvent(LLPointer, const LLSD&) +{ + markMassAgents(LLColor4::green); return true; +} +bool LLNetMap::mmsetblue::handleEvent(LLPointer, const LLSD&) +{ + markMassAgents(LLColor4::blue); return true; +} +bool LLNetMap::mmsetyellow::handleEvent(LLPointer, const LLSD&) +{ + markMassAgents(LLColor4::yellow); return true; +} +bool LLNetMap::mmsetcustom::handleEvent(LLPointer, const LLSD&) +{ + markMassAgents(gSavedSettings.getColor4("MoyMiniMapCustomColor")); return true; +} +bool LLNetMap::mmsetunmark::handleEvent(LLPointer, const LLSD&) +{ + std::map::iterator it = mClosestAgentsAtLastClick.begin(); + std::map::iterator end = mClosestAgentsAtLastClick.end(); + for(; it!= end; ++it) mm_MarkerColors.erase((*it).first); return true; } -bool LLNetMap::mmsetgreen::handleEvent(LLPointer event, const LLSD& userdata) +bool LLNetMap::mmenableunmark::handleEvent(LLPointer, const LLSD& userdata) { - LLNetMap *self = mPtr; - //if(self->mClosestAgentAtLastRightClick){ - mm_setcolor(self->mClosestAgentAtLastRightClick,LLColor4(0.0,1.0,0.0,1.0)); - //} - return true; -} -bool LLNetMap::mmsetblue::handleEvent(LLPointer event, const LLSD& userdata) -{ - LLNetMap *self = mPtr; - //if(self->mClosestAgentAtLastRightClick){ - mm_setcolor(self->mClosestAgentAtLastRightClick,LLColor4(0.0,0.0,1.0,1.0)); - //} - return true; -} -bool LLNetMap::mmsetyellow::handleEvent(LLPointer event, const LLSD& userdata) -{ - LLNetMap *self = mPtr; - //if(self->mClosestAgentAtLastRightClick){ - mm_setcolor(self->mClosestAgentAtLastRightClick,LLColor4(1.0,1.0,0.0,1.0)); - //} - return true; -} -bool LLNetMap::mmsetcustom::handleEvent(LLPointer event, const LLSD& userdata) -{ - LLNetMap *self = mPtr; - //if(self->mClosestAgentAtLastRightClick){ - mm_setcolor(self->mClosestAgentAtLastRightClick,gSavedSettings.getColor4("MoyMiniMapCustomColor")); - //} - return true; -} -bool LLNetMap::mmsetunmark::handleEvent(LLPointer event, const LLSD& userdata) -{ - mm_MarkerColors.erase(mPtr->mClosestAgentAtLastRightClick); - return true; -} -bool LLNetMap::mmenableunmark::handleEvent(LLPointer event, const LLSD& userdata) -{ - LLNetMap *self = mPtr; - BOOL enabled = mPtr->mClosestAgentAtLastRightClick.notNull() && mm_MarkerColors.find(mPtr->mClosestAgentAtLastRightClick) != mm_MarkerColors.end(); - self->findControl(userdata["control"].asString())->setValue(enabled); + bool enabled(false); + std::map::iterator it = mClosestAgentsAtLastClick.begin(); + std::map::iterator end = mClosestAgentsAtLastClick.end(); + for(; it != end && !enabled; ++it) enabled = mm_MarkerColors.find((*it).first) != mm_MarkerColors.end(); + mPtr->findControl(userdata["control"].asString())->setValue(enabled); return true; } + bool LLNetMap::LLCenterMap::handleEvent(LLPointer event, const LLSD& userdata) { EMiniMapCenter center = (EMiniMapCenter)userdata.asInteger(); diff --git a/indra/newview/llnetmap.h b/indra/newview/llnetmap.h index 2a4db214d..0b291b5bc 100644 --- a/indra/newview/llnetmap.h +++ b/indra/newview/llnetmap.h @@ -132,6 +132,9 @@ private: F32 mObjectMapTPM; // texels per meter on map F32 mObjectMapPixels; // Width of object map in pixels F32 mDotRadius; // Size of avatar markers + // + LLCachedControl mPickRadius; // Size of the rightclick area of affect + // bool mPanning; // map is being dragged LLVector2 mTargetPan; @@ -148,8 +151,9 @@ private: LLPointer mParcelImagep; // [/SL:KB] + static std::map mClosestAgentsToCursor; // + LLUUID mClosestAgentToCursor; - LLVector3d mClosestAgentPosition; LLUUID mClosestAgentAtLastRightClick; static void showAgentProfile(void*); diff --git a/indra/newview/lltexturefetch.cpp b/indra/newview/lltexturefetch.cpp index f291de520..2079180fd 100644 --- a/indra/newview/lltexturefetch.cpp +++ b/indra/newview/lltexturefetch.cpp @@ -1496,7 +1496,7 @@ bool LLTextureFetchWorker::doWork(S32 param) HTTP_CASE(HTTP_INTERNAL_ERROR_CURL_OTHER) HTTP_CASE(HTTP_INTERNAL_ERROR_OTHER) default: - LL_DEBUGS("TexDebug") << mID << " status = " << mGetStatus << " (??)" << " Failcount = " << mHTTPFailCount << llendl; break; + LL_DEBUGS("TexDebug") << mID << " status = " << mGetStatus << " (?)" << " Failcount = " << mHTTPFailCount << llendl; break; } if (mGetStatus == HTTP_NOT_FOUND || mGetStatus == HTTP_INTERNAL_ERROR_CURL_TIMEOUT || mGetStatus == HTTP_INTERNAL_ERROR_LOW_SPEED) diff --git a/indra/newview/llvieweraudio.cpp b/indra/newview/llvieweraudio.cpp index 7a6b74e35..8f7a0ed65 100644 --- a/indra/newview/llvieweraudio.cpp +++ b/indra/newview/llvieweraudio.cpp @@ -96,6 +96,7 @@ void precache_audio() gAudiop->preloadSound(LLUUID(gSavedSettings.getString("UISndTyping"))); gAudiop->preloadSound(LLUUID(gSavedSettings.getString("UISndWindowClose"))); gAudiop->preloadSound(LLUUID(gSavedSettings.getString("UISndWindowOpen"))); + gAudiop->preloadSound(LLUUID(gSavedSettings.getString("UISndRestart"))); } } diff --git a/indra/newview/llviewermessage.cpp b/indra/newview/llviewermessage.cpp index ceea596b0..4adce648c 100644 --- a/indra/newview/llviewermessage.cpp +++ b/indra/newview/llviewermessage.cpp @@ -67,6 +67,7 @@ #include "llfloatermute.h" #include "llfloaterpostcard.h" #include "llfloaterpreference.h" +#include "llfloaterregionrestarting.h" #include "llfloaterteleporthistory.h" #include "llgroupactions.h" #include "llhudeffecttrail.h" @@ -6434,7 +6435,6 @@ bool handle_special_notification(std::string notificationID, LLSD& llsdBlock) std::string regionMaturity = LLViewerRegion::accessToString(regionAccess); LLStringUtil::toLower(regionMaturity); llsdBlock["REGIONMATURITY"] = regionMaturity; - bool returnValue = false; LLNotificationPtr maturityLevelNotification; std::string notifySuffix = "_Notify"; @@ -6583,6 +6583,34 @@ void home_position_set() gViewerWindow->saveSnapshot(snap_filename, gViewerWindow->getWindowWidthRaw(), gViewerWindow->getWindowHeightRaw(), FALSE, FALSE); } +void update_region_restart(const LLSD& llsdBlock) +{ + U32 seconds; + if (llsdBlock.has("MINUTES")) + { + seconds = 60U * static_cast(llsdBlock["MINUTES"].asInteger()); + } + else + { + seconds = static_cast(llsdBlock["SECONDS"].asInteger()); + } + + LLFloaterRegionRestarting* restarting_floater = LLFloaterRegionRestarting::findInstance(); + + if (restarting_floater) + { + restarting_floater->updateTime(seconds); + restarting_floater->center(); + } + else + { + LLSD params; + params["NAME"] = llsdBlock["NAME"]; + params["SECONDS"] = (LLSD::Integer)seconds; + LLFloaterRegionRestarting::showInstance(params); + } +} + bool attempt_standard_notification(LLMessageSystem* msgsystem) { // if we have additional alert data @@ -6654,6 +6682,12 @@ bool attempt_standard_notification(LLMessageSystem* msgsystem) { LLViewerStats::getInstance()->incStat(LLViewerStats::ST_KILLED_COUNT); } + else if (notificationID == "RegionRestartMinutes" || notificationID == "RegionRestartSeconds") + { + update_region_restart(llsdBlock); + LLUI::sAudioCallback(LLUUID(gSavedSettings.getString("UISndRestart"))); + return true; // Floater is enough. + } LLNotificationsUtil::add(notificationID, llsdBlock); return true; @@ -6712,7 +6746,6 @@ bool handle_not_age_verified_alert(const std::string &pAlertName) bool handle_special_alerts(const std::string &pAlertName) { bool isHandled = false; - if (LLStringUtil::compareStrings(pAlertName, "NotAgeVerified") == 0) { @@ -6763,17 +6796,27 @@ void process_alert_core(const std::string& message, BOOL modal) S32 mins = 0; LLStringUtil::convertToS32(text.substr(18), mins); args["MINUTES"] = llformat("%d",mins); - LLNotificationsUtil::add("RegionRestartMinutes", args); + update_region_restart(args); + //LLNotificationsUtil::add("RegionRestartMinutes", args); // Floater is enough. + LLUI::sAudioCallback(LLUUID(gSavedSettings.getString("UISndRestart"))); } else if (text.substr(0,17) == "RESTART_X_SECONDS") { S32 secs = 0; LLStringUtil::convertToS32(text.substr(18), secs); args["SECONDS"] = llformat("%d",secs); - LLNotificationsUtil::add("RegionRestartSeconds", args); + update_region_restart(args); + //LLNotificationsUtil::add("RegionRestartSeconds", args); // Floater is enough. + LLUI::sAudioCallback(LLUUID(gSavedSettings.getString("UISndRestart"))); } else { + // *NOTE: If the text from the server ever changes this line will need to be adjusted. + if (text.substr(0, 25) == "Region restart cancelled.") + { + LLFloaterRegionRestarting::hideInstance(); + } + std::string new_msg =LLNotificationTemplates::instance().getGlobalString(text); // [RLVa:KB] - Checked: 2012-02-07 (RLVa-1.4.5) | Added: RLVa-1.4.5 if ( (new_msg == text) && (rlv_handler_t::isEnabled()) ) @@ -6872,6 +6915,32 @@ void mean_name_callback(const LLUUID &id, const std::string& full_name, bool is_ } } +void chat_mean_collision(const LLUUID& id, const LLAvatarName& avname, const EMeanCollisionType& type, const F32& mag) +{ + LLStringUtil::format_map_t args; + if (type == MEAN_BUMP) + args["ACT"] = LLTrans::getString("bump"); + else if (type == MEAN_LLPUSHOBJECT) + args["ACT"] = LLTrans::getString("llpushobject"); + else if (type == MEAN_SELECTED_OBJECT_COLLIDE) + args["ACT"] = LLTrans::getString("selected_object_collide"); + else if (type == MEAN_SCRIPTED_OBJECT_COLLIDE) + args["ACT"] = LLTrans::getString("scripted_object_collide"); + else if (type == MEAN_PHYSICAL_OBJECT_COLLIDE) + args["ACT"] = LLTrans::getString("physical_object_collide"); + else + return; // How did we get here? I used to know you so well. + std::string name; + LLAvatarNameCache::getPNSName(avname, name); + args["NAME"] = name; + args["MAG"] = llformat("%f", mag); + LLChat chat(LLTrans::getString("BumpedYou", args)); + chat.mFromName = name; + chat.mURL = llformat("secondlife:///app/agent/%s/about", id.asString().c_str()); + chat.mSourceType = CHAT_SOURCE_SYSTEM; + LLFloaterChat::addChat(chat); +} + void process_mean_collision_alert_message(LLMessageSystem *msgsystem, void **user_data) { if (gAgent.inPrelude()) @@ -6901,6 +6970,8 @@ void process_mean_collision_alert_message(LLMessageSystem *msgsystem, void **use msgsystem->getU8Fast(_PREHASH_MeanCollision, _PREHASH_Type, u8type); type = (EMeanCollisionType)u8type; + static const LLCachedControl chat_collision("AnnounceBumps"); + if (chat_collision) LLAvatarNameCache::get(perp, boost::bind(chat_mean_collision, _1, _2, type, mag)); BOOL b_found = FALSE; diff --git a/indra/newview/llviewerobjectbackup.cpp b/indra/newview/llviewerobjectbackup.cpp index 2a426c3ee..e3afde844 100644 --- a/indra/newview/llviewerobjectbackup.cpp +++ b/indra/newview/llviewerobjectbackup.cpp @@ -851,16 +851,18 @@ void LLObjectBackup::importObject_continued(AIFilePicker* filepicker) llifstream import_file(file_name); LLSDSerialize::fromXML(mLLSD, import_file); import_file.close(); + if (!mLLSD.has("data")) + { + LLNotificationsUtil::add("InvalidObjectParams"); + close(); + return; + } show(false); mAgentPos = gAgent.getPositionAgent(); mAgentRot = LLQuaternion(gAgent.getAtAxis(), gAgent.getLeftAxis(), gAgent.getUpAxis()); // Get the texture map - - LLSD::map_const_iterator prim_it; - LLSD::array_const_iterator prim_arr_it; - mCurObject = 1; mCurPrim = 1; mObjects = mLLSD["data"].size(); @@ -868,11 +870,11 @@ void LLObjectBackup::importObject_continued(AIFilePicker* filepicker) mRezCount = 0; updateImportNumbers(); - for (prim_arr_it = mLLSD["data"].beginArray(); prim_arr_it != mLLSD["data"].endArray(); prim_arr_it++) + for (LLSD::array_const_iterator prim_arr_it = mLLSD["data"].beginArray(); prim_arr_it != mLLSD["data"].endArray(); prim_arr_it++) { LLSD llsd2 = (*prim_arr_it)["group_body"]; - for (prim_it = llsd2.beginMap(); prim_it != llsd2.endMap(); prim_it++) + for (LLSD::map_const_iterator prim_it = llsd2.beginMap(); prim_it != llsd2.endMap(); prim_it++) { LLSD prim_llsd = llsd2[prim_it->first]; LLSD::array_iterator text_it; diff --git a/indra/newview/llviewertexteditor.cpp b/indra/newview/llviewertexteditor.cpp index 57e63be70..82a70f65e 100644 --- a/indra/newview/llviewertexteditor.cpp +++ b/indra/newview/llviewertexteditor.cpp @@ -1667,7 +1667,7 @@ LLView* LLViewerTextEditor::fromXML(LLXMLNodePtr node, LLView *parent, LLUICtrlF node->getAttributeBOOL("hide_border", hide_border); text_editor->setBorderVisible(!hide_border); - BOOL parse_html = text_editor->mParseHTML; + BOOL parse_html = true; node->getAttributeBOOL("allow_html", parse_html); text_editor->setParseHTML(parse_html); text_editor->setParseHighlights(TRUE); diff --git a/indra/newview/llvoavatar.cpp b/indra/newview/llvoavatar.cpp index 901340a57..64222ff51 100644 --- a/indra/newview/llvoavatar.cpp +++ b/indra/newview/llvoavatar.cpp @@ -910,8 +910,10 @@ const LLUUID SHClientTagMgr::getClientID(const LLVOAvatar* pAvatar) const } return tag.asUUID(); } +bool mm_getMarkerColor(const LLUUID&, LLColor4&); bool SHClientTagMgr::getClientColor(const LLVOAvatar* pAvatar, bool check_status, LLColor4& color) const { + if (mm_getMarkerColor(pAvatar->getID(), color)) return true; static const LLCachedControl ascent_use_status_colors("AscentUseStatusColors",true); static const LLCachedControl ascent_show_self_tag_color("AscentShowSelfTagColor"); static const LLCachedControl ascent_show_others_tag_color("AscentShowOthersTagColor"); diff --git a/indra/newview/llvoavatarself.cpp b/indra/newview/llvoavatarself.cpp index c3ead99db..14cbd4993 100644 --- a/indra/newview/llvoavatarself.cpp +++ b/indra/newview/llvoavatarself.cpp @@ -2492,7 +2492,7 @@ public: /*virtual*/ void completedHeaders(U32 status, std::string const& reason, AIHTTPReceivedHeaders const& headers) { - if (200 <= status && status < 300) + if (isGoodStatus(status)) { LL_DEBUGS("Avatar") << "status OK" << llendl; } diff --git a/indra/newview/skins/default/xui/en-us/floater_buy_currency.xml b/indra/newview/skins/default/xui/en-us/floater_buy_currency.xml index 07a341e82..560a5cad2 100644 --- a/indra/newview/skins/default/xui/en-us/floater_buy_currency.xml +++ b/indra/newview/skins/default/xui/en-us/floater_buy_currency.xml @@ -26,11 +26,11 @@ left="0" name="step_1" width="64" /> - Contacting LindeX... + Contacting currency exchange... - Buy [CURRENCY] on the LindeX currency exchange + Buy [CURRENCY] on the currency exchange diff --git a/indra/newview/skins/default/xui/en-us/floater_region_restarting.xml b/indra/newview/skins/default/xui/en-us/floater_region_restarting.xml new file mode 100644 index 000000000..fdad11853 --- /dev/null +++ b/indra/newview/skins/default/xui/en-us/floater_region_restarting.xml @@ -0,0 +1,81 @@ + + + +The region you are in now +([NAME]) is about to restart. + +If you stay here, you'll be logged out. + + + Seconds Until Restart: +[SECONDS] + + + + + + + +The region you are in now +(-The longest region name-) is about to restart. + +If you stay here, you'll be logged out. + + +Seconds Until Restart: + 32767 + + + + diff --git a/indra/newview/skins/default/xui/en-us/floater_windlight_options.xml b/indra/newview/skins/default/xui/en-us/floater_windlight_options.xml index 4a0e79fd0..cd8cff527 100644 --- a/indra/newview/skins/default/xui/en-us/floater_windlight_options.xml +++ b/indra/newview/skins/default/xui/en-us/floater_windlight_options.xml @@ -351,7 +351,7 @@ mouse_opaque="true" name="WLGlowB" show_text="true" value="1.0" width="200" /> - + + + + + + + + + + + + + + @@ -60,18 +73,9 @@ - - - - - - - - - - - - + + + diff --git a/indra/newview/skins/default/xui/en-us/menu_viewer.xml b/indra/newview/skins/default/xui/en-us/menu_viewer.xml index 462427138..73199bf03 100644 --- a/indra/newview/skins/default/xui/en-us/menu_viewer.xml +++ b/indra/newview/skins/default/xui/en-us/menu_viewer.xml @@ -321,8 +321,8 @@ mouse_opaque="true" name="separator" width="211" /> - - + + diff --git a/indra/newview/skins/default/xui/en-us/notifications.xml b/indra/newview/skins/default/xui/en-us/notifications.xml index 6ba816d7c..037516e29 100644 --- a/indra/newview/skins/default/xui/en-us/notifications.xml +++ b/indra/newview/skins/default/xui/en-us/notifications.xml @@ -6942,20 +6942,20 @@ This will add a bookmark in your inventory so you can quickly IM this resident. -Region is restarting in [MINUTES] minutes. +This region will restart in [MINUTES] minutes. If you remain in this region you will be logged out. -Region is restarting in [SECONDS] seconds. +This region will restart in [SECONDS] seconds. If you remain in this region you will be logged out. diff --git a/indra/newview/skins/default/xui/en-us/panel_preferences_ascent_chat.xml b/indra/newview/skins/default/xui/en-us/panel_preferences_ascent_chat.xml index 675573dbf..5866ddce9 100644 --- a/indra/newview/skins/default/xui/en-us/panel_preferences_ascent_chat.xml +++ b/indra/newview/skins/default/xui/en-us/panel_preferences_ascent_chat.xml @@ -94,7 +94,7 @@ - + diff --git a/indra/newview/skins/default/xui/en-us/panel_preferences_ascent_system.xml b/indra/newview/skins/default/xui/en-us/panel_preferences_ascent_system.xml index a3a85a6d4..299ea3ed3 100644 --- a/indra/newview/skins/default/xui/en-us/panel_preferences_ascent_system.xml +++ b/indra/newview/skins/default/xui/en-us/panel_preferences_ascent_system.xml @@ -87,6 +87,7 @@ + @@ -95,6 +96,8 @@ + Drop a landmark below to autoteleport there in the last 20 seconds before region restarts + diff --git a/indra/newview/skins/default/xui/en-us/panel_toolbar.xml b/indra/newview/skins/default/xui/en-us/panel_toolbar.xml index a29f6239f..c35dbfac2 100644 --- a/indra/newview/skins/default/xui/en-us/panel_toolbar.xml +++ b/indra/newview/skins/default/xui/en-us/panel_toolbar.xml @@ -39,7 +39,7 @@ @@ -401,7 +401,7 @@ diff --git a/indra/newview/skins/default/xui/en-us/strings.xml b/indra/newview/skins/default/xui/en-us/strings.xml index b23b8e948..fed4eb9dc 100644 --- a/indra/newview/skins/default/xui/en-us/strings.xml +++ b/indra/newview/skins/default/xui/en-us/strings.xml @@ -352,6 +352,15 @@ Make sure you entered the correct Login URI. An example of a Login URI is: \"htt Return objects on your behalf (unknown)! + + [NAME] [ACT] with magnitude [MAG] + + bumped you + pushed you with a script + hit you with an object + hit you with a scripted object + hit you with a physical object + PG @@ -3058,10 +3067,10 @@ Where tag = tag string to match. Removes bot's matching the tag. - Currently not set - Currently set to: [ITEM] + Item currently not set + Item currently set to: [ITEM] Currently set to an item not on this account - Not logged in + Not logged in, item display unavailable Counting scripts, please wait... diff --git a/indra/newview/skins/default/xui/es/panel_preferences_ascent_chat.xml b/indra/newview/skins/default/xui/es/panel_preferences_ascent_chat.xml index fc16bc69d..4e49477f0 100644 --- a/indra/newview/skins/default/xui/es/panel_preferences_ascent_chat.xml +++ b/indra/newview/skins/default/xui/es/panel_preferences_ascent_chat.xml @@ -71,7 +71,7 @@ - + diff --git a/indra/newview/skins/default/xui/fr/floater_toolbar_prefs.xml b/indra/newview/skins/default/xui/fr/floater_toolbar_prefs.xml new file mode 100644 index 000000000..7a2d6dc5e --- /dev/null +++ b/indra/newview/skins/default/xui/fr/floater_toolbar_prefs.xml @@ -0,0 +1,93 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/indra/newview/skins/default/xui/fr/menu_viewer.xml b/indra/newview/skins/default/xui/fr/menu_viewer.xml index 477a728b8..109e28971 100644 --- a/indra/newview/skins/default/xui/fr/menu_viewer.xml +++ b/indra/newview/skins/default/xui/fr/menu_viewer.xml @@ -76,6 +76,7 @@ + diff --git a/indra/newview/skins/default/xui/fr/panel_preferences_ascent_chat.xml b/indra/newview/skins/default/xui/fr/panel_preferences_ascent_chat.xml index ea042b726..5a9d3f106 100644 --- a/indra/newview/skins/default/xui/fr/panel_preferences_ascent_chat.xml +++ b/indra/newview/skins/default/xui/fr/panel_preferences_ascent_chat.xml @@ -44,7 +44,7 @@ - + diff --git a/indra/newview/skins/default/xui/fr/panel_toolbar.xml b/indra/newview/skins/default/xui/fr/panel_toolbar.xml index 4a6af2b12..6c053e9ce 100644 --- a/indra/newview/skins/default/xui/fr/panel_toolbar.xml +++ b/indra/newview/skins/default/xui/fr/panel_toolbar.xml @@ -1,11 +1,9 @@ - - Rétablir les fenêtres - - + établir les fenêtres + -