diff --git a/.hgeol b/.hgeol new file mode 100644 index 0000000000..94205bd3ef --- /dev/null +++ b/.hgeol @@ -0,0 +1,12 @@ +[repository] +native = LF + +[patterns] +path:indra/lscript/lscript_compile/windows/unistd.h = CRLF +path:indra/newview/installers/windows/FILES_ARE_UNICODE_UTF-16LE.txt = CRLF +path:indra/tools/vstool/README.txt = CRLF +**.h = native +**.cpp = native +**.py = native +**.xml = native +**.txt = native diff --git a/.hgpatchinfo/Appearance-Misc.dep b/.hgpatchinfo/Appearance-Misc.dep index 1cea281640..0f6e0edc63 100644 --- a/.hgpatchinfo/Appearance-Misc.dep +++ b/.hgpatchinfo/Appearance-Misc.dep @@ -1 +1 @@ -6fe7cc30ebc09cfe92787b71fa9dc55fd0396ec5 \ No newline at end of file +471361eabfbf2865016a50e8087712b2266e83c7 \ No newline at end of file diff --git a/.hgpatchinfo/RLVa.dep b/.hgpatchinfo/RLVa.dep index 07f2e4f2f9..938785d899 100644 --- a/.hgpatchinfo/RLVa.dep +++ b/.hgpatchinfo/RLVa.dep @@ -1 +1 @@ -543c14d1270ba0327474287b08ae6463d8c03fdb \ No newline at end of file +264c7688ecdba8432a64f36a24e389eb85cbc10d \ No newline at end of file diff --git a/.hgpatchinfo/Viewer-Build.dep b/.hgpatchinfo/Viewer-Build.dep index ac16606ab8..631a7e898a 100644 --- a/.hgpatchinfo/Viewer-Build.dep +++ b/.hgpatchinfo/Viewer-Build.dep @@ -1 +1 @@ -a48d42d15595c42a3ccb17a7c5ed246b87225cf3 \ No newline at end of file +59b305ccfba9d4ba7935475d31f94b6ecfe415a4 \ No newline at end of file diff --git a/.hgpatchinfo/Viewer-Build.desc b/.hgpatchinfo/Viewer-Build.desc index b6edfa6f3b..8d302b3560 100644 --- a/.hgpatchinfo/Viewer-Build.desc +++ b/.hgpatchinfo/Viewer-Build.desc @@ -1,14 +1,11 @@ [Viewer/Build] -- changed : compiler options for "Release with Debug" builds -- changed : compiler and linker options for "Release" builds -- changed : removed LL's changeset tags and added new (consistent) SL-X.Y.Z tags for releases -- changed : break into the debugger rather than forcing the process into an unrecoverable state for "llerrs" on non-release builds +* Changed compiler options for "Release with Debug" builds +* Changed compiler and linker options for "Release" builds +* Removed LL's changeset tags and added new (consistent) SL-X.Y.Z tags for releases +* Break into the debugger rather than forcing the process into an unrecoverable state for "llerrs" on non-release builds -> Windows only -- changed : set the "UNATTENDED" flag to FALSE for all (Windows) *OS build configurations -- changed : updated OpenJPEG package with debug information for crash debugging -- fixed : *OS builds don't set the default Visual Studio project and configuration -- fixed : libpng is built with "Whole Program Optimization" and causing slow linker performance - -> "MSIL .netmodule or module compiled with /GL found; restarting link with /LTCG; add /LTCG to the link command line to improve linker performance" - -> causes the linker to abort the current run and start over -- fixed : viewer fails to compile with only the Windows 8 SDK installed -- fixed : viewer won't compile when bison v2.7.1 is installed +* Set the "UNATTENDED" flag to FALSE for all (Windows) *OS build configurations +* CATZ-234: Updated FMOD Ex library to v4.44.61 (Windows) +* CATZ-232: Updated OpenJPEG library to v1.5.2 (Windows) +* [FIXED] Viewer fails to compile with only the Windows 8 SDK installed +* [FIXED] JpegLib is built with "Whole Program Optimization" and causing slow linker performance diff --git a/autobuild.xml b/autobuild.xml index 943616ed69..6170fb62e6 100755 --- a/autobuild.xml +++ b/autobuild.xml @@ -71,9 +71,9 @@ archive hash - 370de49a91ce91516697db8968f5e8b0 + 47ddd059d48f650e39796c10ea828689 url - http://downloads.phoenixviewer.com/ndPhysicsStub-1.0-darwin-201505191946-r76.tar.bz2 + http://downloads.phoenixviewer.com/ndPhysicsStub-1.0-darwin-201606211534-r77.tar.bz2 name darwin @@ -295,9 +295,9 @@ archive hash - d0abfb393024eea8cffdfde3ec5b673d + 72b06fb0bbc1d52179abf8bd8db9b2df url - http://downloads.phoenixviewer.com/boost-1.57-darwin-201505120538-r136.tar.bz2 + http://downloads.phoenixviewer.com/boost-1.57-darwin64-201606171648.tar.bz2 name darwin @@ -347,9 +347,9 @@ archive hash - b93d42a16c5a9e6731ca57d363c231e0 + a1964fea0954d31c3aa29ae196b17f8f url - http://downloads.phoenixviewer.com/colladadom-2.3.201505131932-r98-darwin-201505131932-r98.tar.bz2 + http://downloads.phoenixviewer.com/colladadom-2.3.201606172015-darwin-201606172015.tar.bz2 name darwin @@ -975,9 +975,9 @@ archive hash - af760536a469b6e28df675d4c7eca54b + 9253e0ebde03d4c2161dfeaf02565758 url - http://downloads.phoenixviewer.com/google_breakpad-1413.201505171732-r96-darwin-201505171732-r96.tar.bz2 + http://downloads.phoenixviewer.com/google_breakpad-1413.201606211136-r97-darwin-201606211136-r97.tar.bz2 name darwin @@ -1301,9 +1301,9 @@ archive hash - bf4bb114d861213eb946c6e8b7e35178 + a087b1642025efa765e47e8149b026ee url - http://downloads.phoenixviewer.com/jsoncpp-0.5.0.201508041108-r34-darwin-201508041108-r34.tar.bz2 + http://downloads.phoenixviewer.com/jsoncpp-0.5.0.201606172236-r32-darwin-201606172236-r32.tar.bz2 name darwin @@ -1673,11 +1673,11 @@ archive hash - 82779518d3079508ecdafe708e003aaf + 85d8896ca1cec09affc48122aeea22d2 hash_algorithm md5 url - http://downloads.phoenixviewer.com/llceflib-1.5.3.201601201743-r174-darwin-201601201743-r174.tar.bz2 + http://downloads.phoenixviewer.com/llceflib-1.5.3.201606212155-r177-darwin-201606212155-r177.tar.bz2 name darwin @@ -2135,9 +2135,9 @@ archive hash - 64b2e1e2e4869c56c235ba43c1e66bdb + 582d360d195d3dfb48695cb5e206cbf1 url - http://downloads.phoenixviewer.com/pcre-8.35.-darwin-201505122041-r52.tar.bz2 + http://downloads.phoenixviewer.com/pcre-8.35.-darwin-201606171942.tar.bz2 name darwin diff --git a/indra/cmake/00-Common.cmake b/indra/cmake/00-Common.cmake index 9eba6d9045..4f0fd0df23 100644 --- a/indra/cmake/00-Common.cmake +++ b/indra/cmake/00-Common.cmake @@ -312,6 +312,9 @@ if (DARWIN) set(CMAKE_CXX_LINK_FLAGS "-Wl,-no_compact_unwind -Wl,-headerpad_max_install_names,-search_paths_first") set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_CXX_LINK_FLAGS}") set(DARWIN_extra_cstar_flags "-g -Wno-unused-local-typedef -Wno-deprecated-declarations") + # Take a deep breath and turn on C++11... + set(DARWIN_extra_cstar_flags "-std=c++11 -stdlib=libc++ -Wno-overloaded-virtual ${DARWIN_extra_cstar_flags}") + # set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${DARWIN_extra_cstar_flags}") set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${DARWIN_extra_cstar_flags}") # NOTE: it's critical that the optimization flag is put in front. diff --git a/indra/cmake/Variables.cmake b/indra/cmake/Variables.cmake index 9b4feee86d..fcd584cab4 100644 --- a/indra/cmake/Variables.cmake +++ b/indra/cmake/Variables.cmake @@ -158,7 +158,7 @@ if (${CMAKE_SYSTEM_NAME} MATCHES "Darwin") #set(CMAKE_OSX_SYSROOT macosx10.9) if(IS_DIRECTORY "/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.11.sdk") # Assume Xcode 7 if El Capitan SDK is present - set(XCODE_VERSION 7.0) + set(XCODE_VERSION 7.3) set(CMAKE_OSX_SYSROOT macosx10.11) message(STATUS "OS X SDK 10.11 found.") elseif(IS_DIRECTORY "/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.10.sdk") @@ -180,7 +180,9 @@ if (${CMAKE_SYSTEM_NAME} MATCHES "Darwin") set(CMAKE_XCODE_ATTRIBUTE_GCC_STRICT_ALIASING NO) set(CMAKE_XCODE_ATTRIBUTE_GCC_FAST_MATH NO) set(CMAKE_XCODE_ATTRIBUTE_CLANG_X86_VECTOR_INSTRUCTIONS ssse3) - set(CMAKE_XCODE_ATTRIBUTE_CLANG_CXX_LIBRARY "libstdc++") + # Need libc++ for C++11 and Boost + #set(CMAKE_XCODE_ATTRIBUTE_CLANG_CXX_LIBRARY "libstdc++") + set(CMAKE_XCODE_ATTRIBUTE_CLANG_CXX_LIBRARY "libc++") set(CMAKE_XCODE_ATTRIBUTE_DEBUG_INFORMATION_FORMAT dwarf-with-dsym) # Build only for i386 by default, system default on MacOSX 10.6+ is x86_64 diff --git a/indra/llcommon/llfile.h b/indra/llcommon/llfile.h index 3e25228aeb..6dfabd5f94 100644 --- a/indra/llcommon/llfile.h +++ b/indra/llcommon/llfile.h @@ -45,7 +45,10 @@ typedef FILE LLFILE; typedef struct _stat llstat; #else typedef struct stat llstat; -#include +// This file only exists on Linux +# if LL_LINUX +# include +# endif #endif #ifndef S_ISREG diff --git a/indra/llcommon/llpreprocessor.h b/indra/llcommon/llpreprocessor.h index 6aa62554c3..2f194658b5 100644 --- a/indra/llcommon/llpreprocessor.h +++ b/indra/llcommon/llpreprocessor.h @@ -201,7 +201,7 @@ #elif LL_LINUX #define LL_TYPEOF(exp) typeof(exp) #elif LL_DARWIN -#define LL_TYPEOF(exp) typeof(exp) +#define LL_TYPEOF(exp) decltype(exp) #endif #define LL_TO_STRING_HELPER(x) #x diff --git a/indra/llcommon/llstring.h b/indra/llcommon/llstring.h index a75744617a..9a24087fcd 100644 --- a/indra/llcommon/llstring.h +++ b/indra/llcommon/llstring.h @@ -444,7 +444,7 @@ public: struct LLDictionaryLess { public: - bool operator()(const std::string& a, const std::string& b) + bool operator()(const std::string& a, const std::string& b) const { return (LLStringUtil::precedesDict(a, b) ? true : false); } diff --git a/indra/llcommon/lluri.cpp b/indra/llcommon/lluri.cpp index 96e0c3f16f..db881954ba 100644 --- a/indra/llcommon/lluri.cpp +++ b/indra/llcommon/lluri.cpp @@ -261,7 +261,7 @@ static BOOL isDefault(const std::string& scheme, U16 port) void LLURI::parseAuthorityAndPathUsingOpaque() { - if (mScheme == "http" || mScheme == "https" || mScheme == "hop" || + if (mScheme == "http" || mScheme == "https" || mScheme == "hop" || mScheme == "inworldz" || mScheme == "iw" || mScheme == "ftp" || mScheme == "secondlife" || mScheme == "x-grid-location-info") { diff --git a/indra/llmath/v4color.cpp b/indra/llmath/v4color.cpp index 79a64b24f2..aa84374372 100644 --- a/indra/llmath/v4color.cpp +++ b/indra/llmath/v4color.cpp @@ -122,7 +122,7 @@ LLColor4 LLColor4::cyan6(0.2f, 0.6f, 0.6f, 1.0f); ////////////////////////////////////////////////////////////////////////////// // conversion -LLColor4::operator const LLColor4U() const +LLColor4::operator /*const*/ LLColor4U() const { return LLColor4U( (U8)llclampb(ll_round(mV[VRED]*255.f)), diff --git a/indra/llmath/v4color.h b/indra/llmath/v4color.h index 0d632f59be..7d553ef62a 100644 --- a/indra/llmath/v4color.h +++ b/indra/llmath/v4color.h @@ -131,7 +131,7 @@ class LLColor4 friend const LLColor4& operator*=(LLColor4 &a, const LLColor4 &b); // Doesn't multiply alpha! (for lighting) // conversion - operator const LLColor4U() const; + operator /*const*/ LLColor4U() const; // Basic color values. static LLColor4 red; diff --git a/indra/llmath/v4coloru.h b/indra/llmath/v4coloru.h index 5d525762a4..2101efc5fc 100644 --- a/indra/llmath/v4coloru.h +++ b/indra/llmath/v4coloru.h @@ -130,7 +130,7 @@ public: static BOOL parseColor4U(const std::string& buf, LLColor4U* value); // conversion - operator const LLColor4() const + operator /*const*/ LLColor4() const { return LLColor4(*this); } diff --git a/indra/llui/llstatgraph.h b/indra/llui/llstatgraph.h index f381e92a4d..ba7cfc5d10 100644 --- a/indra/llui/llstatgraph.h +++ b/indra/llui/llstatgraph.h @@ -126,7 +126,7 @@ private: F32 mValue; LLUIColor mColor; - bool operator <(const Threshold& other) + bool operator <(const Threshold& other) const { return mValue < other.mValue; } diff --git a/indra/llui/llurlentry.cpp b/indra/llui/llurlentry.cpp index c8f971c299..e3b67ffd35 100644 --- a/indra/llui/llurlentry.cpp +++ b/indra/llui/llurlentry.cpp @@ -42,7 +42,7 @@ // hop:// protocol> //#define APP_HEADER_REGEX "((x-grid-location-info://[-\\w\\.]+/app)|(secondlife:///app))" -#define APP_HEADER_REGEX "(((hop|x-grid-location-info)://[-\\w\\.\\:\\@]+/app)|((hop|secondlife):///app))" +#define APP_HEADER_REGEX "(((hop|x-grid-location-info)://[-\\w\\.\\:\\@]+/app)|((hop|secondlife|inworldz|iw):///app))" // // Utility functions @@ -340,7 +340,9 @@ std::string LLUrlEntryHTTPNoProtocol::getTooltip(const std::string &url) const LLUrlEntryInvalidSLURL::LLUrlEntryInvalidSLURL() : LLUrlEntryBase() { - mPattern = boost::regex("(http://(maps.secondlife.com|slurl.com)/secondlife/|secondlife://(/app/(worldmap|teleport)/)?)[^ /]+(/-?[0-9]+){1,3}(/?(\\?title|\\?img|\\?msg)=\\S*)?/?", + // Inworldz special + //mPattern = boost::regex("(http://(maps.secondlife.com|slurl.com)/secondlife/|secondlife://(/app/(worldmap|teleport)/)?)[^ /]+(/-?[0-9]+){1,3}(/?(\\?title|\\?img|\\?msg)=\\S*)?/?", + mPattern = boost::regex("(http://(maps.secondlife.com|slurl.com)/secondlife/|(secondlife|inworldz|iw)://(/app/(worldmap|teleport)/)?)[^ /]+(/-?[0-9]+){1,3}(/?(\\?title|\\?img|\\?msg)=\\S*)?/?", boost::regex::perl|boost::regex::icase); mMenuName = "menu_url_http.xml"; mTooltip = LLTrans::getString("TooltipHttpUrl"); @@ -1016,7 +1018,7 @@ LLUrlEntryObjectIM::LLUrlEntryObjectIM() { // hop:// protocol; Ansa: Stop at first space so we can use it in notifications! //mPattern = boost::regex("secondlife:///app/objectim/[\\da-f-]+\?.*", - mPattern = boost::regex("(hop|secondlife):///app/objectim/[\\da-f-]+\?[^ \t\r\n\v\f]*", + mPattern = boost::regex("(hop|secondlife|inworldz|iw):///app/objectim/[\\da-f-]+\?[^ \t\r\n\v\f]*", // boost::regex::perl|boost::regex::icase); mMenuName = "menu_url_objectim.xml"; @@ -1145,7 +1147,9 @@ void LLUrlEntryParcel::processParcelInfo(const LLParcelData& parcel_data) // LLUrlEntryPlace::LLUrlEntryPlace() { - mPattern = boost::regex("((hop://[-\\w\\.\\:\\@]+/)|((x-grid-location-info://[-\\w\\.]+/region/)|(secondlife://)))\\S+/?(\\d+/\\d+/\\d+|\\d+/\\d+)/?", // + // Inworldz special + //mPattern = boost::regex("((hop://[-\\w\\.\\:\\@]+/)|((x-grid-location-info://[-\\w\\.]+/region/)|(secondlife://)))\\S+/?(\\d+/\\d+/\\d+|\\d+/\\d+)/?", // + mPattern = boost::regex("((hop://[-\\w\\.\\:\\@]+/)|((x-grid-location-info://[-\\w\\.]+/region/)|((secondlife|inworldz|iw)://)))\\S+/?(\\d+/\\d+/\\d+|\\d+/\\d+)/?", // boost::regex::perl|boost::regex::icase); mMenuName = "menu_url_slurl.xml"; mTooltip = LLTrans::getString("TooltipSLURL"); @@ -1327,7 +1331,7 @@ std::string LLUrlEntryTeleport::getLocation(const std::string &url) const // LLUrlEntrySL::LLUrlEntrySL() { - mPattern = boost::regex("(hop|secondlife)://(\\w+)?(:\\d+)?/\\S+", // + mPattern = boost::regex("(hop|secondlife|inworldz|iw)://(\\w+)?(:\\d+)?/\\S+", // boost::regex::perl|boost::regex::icase); mMenuName = "menu_url_slapp.xml"; mTooltip = LLTrans::getString("TooltipSLAPP"); @@ -1344,7 +1348,7 @@ std::string LLUrlEntrySL::getLabel(const std::string &url, const LLUrlLabelCallb // LLUrlEntrySLLabel::LLUrlEntrySLLabel() { - mPattern = boost::regex("\\[(hop|secondlife)://\\S+[ \t]+[^\\]]+\\]", // + mPattern = boost::regex("\\[(hop|secondlife|inworldz|iw)://\\S+[ \t]+[^\\]]+\\]", // boost::regex::perl|boost::regex::icase); mMenuName = "menu_url_slapp.xml"; mTooltip = LLTrans::getString("TooltipSLAPP"); diff --git a/indra/llwindow/llopenglview-objc.mm b/indra/llwindow/llopenglview-objc.mm index a78fec1f2e..cd6147fbf2 100644 --- a/indra/llwindow/llopenglview-objc.mm +++ b/indra/llwindow/llopenglview-objc.mm @@ -236,8 +236,8 @@ attributedStringInfo getSegments(NSAttributedString *str) NSOpenGLPFADoubleBuffer, NSOpenGLPFAClosestPolicy, NSOpenGLPFAAccelerated, - NSOpenGLPFASampleBuffers, (samples > 0 ? 1 : 0), - NSOpenGLPFASamples, samples, + NSOpenGLPFASampleBuffers, static_cast(samples > 0 ? 1 : 0), + NSOpenGLPFASamples, static_cast(samples), NSOpenGLPFAStencilSize, 8, NSOpenGLPFADepthSize, 24, NSOpenGLPFAAlphaSize, 8, @@ -380,8 +380,8 @@ attributedStringInfo getSegments(NSAttributedString *str) - (void)mouseMoved:(NSEvent *)theEvent { float mouseDeltas[2] = { - [theEvent deltaX], - [theEvent deltaY] + static_cast([theEvent deltaX]), + static_cast([theEvent deltaY]) }; callDeltaUpdate(mouseDeltas, 0); @@ -401,8 +401,8 @@ attributedStringInfo getSegments(NSAttributedString *str) // The old CoreGraphics APIs we previously relied on are now flagged as obsolete. // NSEvent isn't obsolete, and provides us with the correct deltas. float mouseDeltas[2] = { - [theEvent deltaX], - [theEvent deltaY] + static_cast([theEvent deltaX]), + static_cast([theEvent deltaY]) }; callDeltaUpdate(mouseDeltas, 0); @@ -604,13 +604,13 @@ attributedStringInfo getSegments(NSAttributedString *str) if (mMarkedTextAllowed) { unsigned int selected[2] = { - selectedRange.location, - selectedRange.length + static_cast(selectedRange.location), + static_cast(selectedRange.length) }; unsigned int replacement[2] = { - replacementRange.location, - replacementRange.length + static_cast(replacementRange.location), + static_cast(replacementRange.length) }; int string_length = [aString length]; diff --git a/indra/llwindow/llwindowmacosx.cpp b/indra/llwindow/llwindowmacosx.cpp index 07861f125e..978a5d0aac 100644 --- a/indra/llwindow/llwindowmacosx.cpp +++ b/indra/llwindow/llwindowmacosx.cpp @@ -553,7 +553,7 @@ void getPreeditLocation(float *location, unsigned int length) preeditor->getPreeditLocation(length, &coord, &rect, NULL); - float c[4] = {coord.mX, coord.mY, 0, 0}; + float c[4] = {static_cast(coord.mX), static_cast(coord.mY), 0, 0}; convertRectToScreen(gWindowImplementation->getWindow(), c); @@ -909,7 +909,7 @@ BOOL LLWindowMacOSX::setPosition(const LLCoordScreen position) { if(mWindow) { - float pos[2] = {position.mX, position.mY}; + float pos[2] = {static_cast(position.mX), static_cast(position.mY)}; setWindowPos(mWindow, pos); } diff --git a/indra/media_plugins/cef/CMakeLists.txt b/indra/media_plugins/cef/CMakeLists.txt index 72c6cc93da..adb3e2f732 100644 --- a/indra/media_plugins/cef/CMakeLists.txt +++ b/indra/media_plugins/cef/CMakeLists.txt @@ -123,7 +123,8 @@ if (DARWIN) PREFIX "" BUILD_WITH_INSTALL_RPATH 1 INSTALL_NAME_DIR "@executable_path" - LINK_FLAGS "-exported_symbols_list ${CMAKE_CURRENT_SOURCE_DIR}/../base/media_plugin_base.exp" + CXX_FLAGS "-std=c++11 -stdlib=libc++" + LINK_FLAGS "-stdlib=libc++ -exported_symbols_list ${CMAKE_CURRENT_SOURCE_DIR}/../base/media_plugin_base.exp" ) add_custom_command(TARGET media_plugin_cef diff --git a/indra/media_plugins/quicktime/CMakeLists.txt b/indra/media_plugins/quicktime/CMakeLists.txt index c5615145be..4e3a564cd8 100644 --- a/indra/media_plugins/quicktime/CMakeLists.txt +++ b/indra/media_plugins/quicktime/CMakeLists.txt @@ -75,7 +75,7 @@ if (QUICKTIME) PREFIX "" BUILD_WITH_INSTALL_RPATH 1 INSTALL_NAME_DIR "@executable_path" - LINK_FLAGS "-exported_symbols_list ${CMAKE_CURRENT_SOURCE_DIR}/../base/media_plugin_base.exp" + LINK_FLAGS "-stdlib=libc++ -exported_symbols_list ${CMAKE_CURRENT_SOURCE_DIR}/../base/media_plugin_base.exp" ) # We use a bunch of deprecated system APIs. diff --git a/indra/newview/CMakeLists.txt b/indra/newview/CMakeLists.txt index 1530ad2dc6..27a113368d 100644 --- a/indra/newview/CMakeLists.txt +++ b/indra/newview/CMakeLists.txt @@ -1548,9 +1548,6 @@ set(viewer_HEADER_FILES pieseparator.h pieslice.h pipeline.h - roles_constants.h - qtoolalign.h - quickprefs.h rlvactions.h rlvdefines.h rlvhandler.h @@ -1561,6 +1558,9 @@ set(viewer_HEADER_FILES rlvextensions.h rlvfloaters.h rlvui.h + roles_constants.h + qtoolalign.h + quickprefs.h sanitycheck.h streamtitledisplay.h utilitybar.h diff --git a/indra/newview/aoengine.cpp b/indra/newview/aoengine.cpp index 0188fba6f4..aa242241d6 100644 --- a/indra/newview/aoengine.cpp +++ b/indra/newview/aoengine.cpp @@ -574,17 +574,21 @@ void AOEngine::checkSitCancel() if (foreignAnimations(seat)) { - LLUUID animation = mCurrentSet->getStateByRemapID(ANIM_AGENT_SIT)->mCurrentAnimationID; - if (animation.notNull()) + AOSet::AOState* aoState = mCurrentSet->getStateByRemapID(ANIM_AGENT_SIT); + if (aoState) { - LL_DEBUGS("AOEngine") << "Stopping sit animation due to foreign animations running" << LL_ENDL; - gAgent.sendAnimationRequest(animation, ANIM_REQUEST_STOP); - // remove cycle point cover-up - gAgent.sendAnimationRequest(ANIM_AGENT_SIT_GENERIC, ANIM_REQUEST_STOP); - gAgentAvatarp->LLCharacter::stopMotion(animation); - mSitCancelTimer.stop(); - // stop cycle tiemr - mCurrentSet->stopTimer(); + LLUUID animation = aoState->mCurrentAnimationID; + if (animation.notNull()) + { + LL_DEBUGS("AOEngine") << "Stopping sit animation due to foreign animations running" << LL_ENDL; + gAgent.sendAnimationRequest(animation, ANIM_REQUEST_STOP); + // remove cycle point cover-up + gAgent.sendAnimationRequest(ANIM_AGENT_SIT_GENERIC, ANIM_REQUEST_STOP); + gAgentAvatarp->LLCharacter::stopMotion(animation); + mSitCancelTimer.stop(); + // stop cycle tiemr + mCurrentSet->stopTimer(); + } } } } @@ -931,6 +935,11 @@ BOOL AOEngine::removeSet(AOSet* set) BOOL AOEngine::removeAnimation(const AOSet* set, AOSet::AOState* state, S32 index) { + if (index < 0) + { + return FALSE; + } + S32 numOfAnimations = state->mAnimations.size(); if (numOfAnimations == 0) { @@ -1717,9 +1726,16 @@ void AOEngine::onNotecardLoadComplete(LLVFS* vfs, const LLUUID& assetUUID, LLAss S32 notecardSize = vfs->getSize(assetUUID, type); char* buffer = new char[notecardSize]; - vfs->getData(assetUUID, type, (U8*) buffer, 0, notecardSize); - AOEngine::instance().parseNotecard(buffer); + S32 ret = vfs->getData(assetUUID, type, reinterpret_cast(buffer), 0, notecardSize); + if (ret > 0) + { + AOEngine::instance().parseNotecard(buffer); + } + else + { + delete[] buffer; + } } void AOEngine::parseNotecard(const char* buffer) @@ -1739,7 +1755,7 @@ void AOEngine::parseNotecard(const char* buffer) } std::string text(buffer); - delete buffer; + delete[] buffer; std::vector lines; LLStringUtil::getTokens(text, lines, "\n"); diff --git a/indra/newview/app_settings/settings.xml b/indra/newview/app_settings/settings.xml index 9f2b858e2e..aea7ecd0de 100644 --- a/indra/newview/app_settings/settings.xml +++ b/indra/newview/app_settings/settings.xml @@ -1309,6 +1309,17 @@ Value 1 + RLVaExperimentalCommands + + Comment + Enables the experimental command set + Persist + 1 + Type + Boolean + Value + 1 + RLVaHideLockedLayers Comment @@ -1355,17 +1366,6 @@ Backup 0 - RLVaShowNameTags - - Comment - Display of names above avatars is subject to the general "Show Names" setting when @shownames=n restricted - Persist - 1 - Type - Boolean - Value - 0 - RLVaTopLevelMenu Comment diff --git a/indra/newview/chatbar_as_cmdline.cpp b/indra/newview/chatbar_as_cmdline.cpp index 714dfacc14..e459912fc6 100644 --- a/indra/newview/chatbar_as_cmdline.cpp +++ b/indra/newview/chatbar_as_cmdline.cpp @@ -777,7 +777,7 @@ bool cmd_line_chat(const std::string& revised_text, EChatType type, bool from_ge report_to_nearby_chat(llformat("Object with key %s not found!", target_key.asString().c_str())); return false; } - if ((!rlv_handler_t::isEnabled()) || (gRlvHandler.canSit(myObject, LLVector3::zero))) + if ((!RlvActions::isRlvEnabled()) || (RlvActions::canSit(myObject, LLVector3::zero))) { LLMessageSystem *msg = gMessageSystem; msg->newMessageFast(_PREHASH_AgentRequestSit); diff --git a/indra/newview/fschathistory.cpp b/indra/newview/fschathistory.cpp index b118bab962..1e832201b3 100644 --- a/indra/newview/fschathistory.cpp +++ b/indra/newview/fschathistory.cpp @@ -740,10 +740,11 @@ protected: void showInfoCtrl() { - const bool isVisible = !mAvatarID.isNull() && !mFrom.empty() && (CHAT_SOURCE_SYSTEM != mSourceType || mType == CHAT_TYPE_RADAR); +// const bool isVisible = !mAvatarID.isNull() && !mFrom.empty() && (CHAT_SOURCE_SYSTEM != mSourceType || mType == CHAT_TYPE_RADAR);; // [RLVa:KB] - Checked: 2010-04-22 (RLVa-1.2.2a) | Added: RLVa-1.2.0f - if (isVisible && mShowInfoCtrl) + const bool isVisible = mShowInfoCtrl && !mAvatarID.isNull() && !mFrom.empty() && (CHAT_SOURCE_SYSTEM != mSourceType || mType == CHAT_TYPE_RADAR);; // [/RLVa:KB] + if (isVisible) { const LLRect sticky_rect = mUserNameTextBox->getRect(); S32 icon_x = llmin(sticky_rect.mLeft + mUserNameTextBox->getTextBoundingRect().getWidth() + 7, sticky_rect.mRight - 3); diff --git a/indra/newview/fscommon.cpp b/indra/newview/fscommon.cpp index 4191c1bd52..b29b8590a2 100644 --- a/indra/newview/fscommon.cpp +++ b/indra/newview/fscommon.cpp @@ -38,6 +38,7 @@ #include "llmutelist.h" #include "llnotificationmanager.h" #include "lltooldraganddrop.h" +#include "lltrans.h" #include "llviewerinventory.h" #include "llviewernetwork.h" #include "llviewerobject.h" diff --git a/indra/newview/fsgridhandler.cpp b/indra/newview/fsgridhandler.cpp index 1a3aa35046..482e29ff47 100644 --- a/indra/newview/fsgridhandler.cpp +++ b/indra/newview/fsgridhandler.cpp @@ -1432,6 +1432,10 @@ std::string LLGridManager::getAppSLURLBase(const std::string& grid) { ret = mGridList[grid][GRID_APP_SLURL_BASE].asString(); } + else if (grid == INWORLDZ_URI) + { + ret = "inworldz:///app"; + } else { std::string app_base; @@ -1463,6 +1467,6 @@ std::string LLGridManager::getAppSLURLBase(const std::string& grid) ret = llformat(app_base.c_str(), grid_norm.c_str()); } - LL_DEBUGS("GridManager") << "App slurl base: " << ret << LL_ENDL; + LL_DEBUGS("GridManager") << "App slurl base: " << ret << " - grid = " << grid << LL_ENDL; return ret; } diff --git a/indra/newview/fsgridhandler.h b/indra/newview/fsgridhandler.h index 7b293ebf07..9424787f57 100644 --- a/indra/newview/fsgridhandler.h +++ b/indra/newview/fsgridhandler.h @@ -70,6 +70,9 @@ const std::string GRID_SLURL_BASE = "slurl_base"; const std::string GRID_APP_SLURL_BASE = "app_slurl_base"; // +// Inworldz special +#define INWORLDZ_URI "inworldz.com:8002" + class GridInfoRequestResponder; // diff --git a/indra/newview/fsslurl.cpp b/indra/newview/fsslurl.cpp index 93b1b840c2..5307651f5b 100644 --- a/indra/newview/fsslurl.cpp +++ b/indra/newview/fsslurl.cpp @@ -52,14 +52,17 @@ const char* LLSLURL::SLURL_X_GRID_LOCATION_INFO_SCHEME = "x-grid-location-info"; const char* LLSLURL::WWW_SLURL_COM = "www.slurl.com"; const char* LLSLURL::MAPS_SECONDLIFE_COM = "maps.secondlife.com"; -// const char* LLSLURL::SLURL_COM = "slurl.com"; const char* LLSLURL::SLURL_APP_PATH = "app"; const char* LLSLURL::SLURL_SECONDLIFE_PATH = "secondlife"; const char* LLSLURL::SLURL_REGION_PATH = "region"; const char* LLSLURL::SIM_LOCATION_HOME = "home"; const char* LLSLURL::SIM_LOCATION_LAST = "last"; -// + +// Inworldz special +const char* LLSLURL::SLURL_INWORLDZ_SCHEME = "inworldz"; +const char* LLSLURL::SLURL_IW_SCHEME = "iw"; +const char* LLSLURL::PLACES_INWORLDZ_COM = "places.inworldz.com"; // resolve a simstring from a slurl LLSLURL::LLSLURL(const std::string& slurl) @@ -212,7 +215,7 @@ LLSLURL::LLSLURL(const std::string& slurl) if(mGrid.empty() && LLStartUp::getStartupState() == STATE_STARTED) { // we couldn't find the grid in the grid manager, so bail - LL_WARNS() << "unable to find grid" << LL_ENDL; + LL_WARNS("SLURL") << "unable to find grid" << LL_ENDL; return; } // set the type as appropriate. @@ -241,6 +244,55 @@ LLSLURL::LLSLURL(const std::string& slurl) path_array.insert(0, slurl_uri.hostNameAndPort()); } } + else if (slurl_uri.scheme() == LLSLURL::SLURL_INWORLDZ_SCHEME || + slurl_uri.scheme() == LLSLURL::SLURL_IW_SCHEME) + { + LL_DEBUGS("SLURL") << "inworldz scheme" << LL_ENDL; + + mGrid = INWORLDZ_URI; + + if (path_array[0].asString() == LLSLURL::SLURL_APP_PATH) + { + // it's in the form iw:///(app) + // so parse the grid name to derive the grid ID + if (!slurl_uri.hostNameAndPort().empty()) + { + LL_DEBUGS("SLURL") << "(inworldz|iw):///app" << LL_ENDL; + + mGrid = LLGridManager::getInstance()->getGridByProbing(slurl_uri.hostNameAndPort()); + if (mGrid.empty()) + { + mGrid = LLGridManager::getInstance()->getGridByProbing(slurl_uri.hostName()); + } + } + else if (path_array[0].asString() == LLSLURL::SLURL_APP_PATH) + { + LL_DEBUGS("SLURL") << "(inworldz|iw):///app" << LL_ENDL; + + // for app style slurls, where no grid name is specified, assume the currently + // selected or logged in grid. + mGrid = LLGridManager::getInstance()->getGridId(); + } + + if (mGrid.empty() && LLStartUp::getStartupState() == STATE_STARTED) + { + // we couldn't find the grid in the grid manager, so bail + LL_WARNS("SLURL")<<"unable to find grid"< or /app/, so it must be iw:// + // therefore the hostname will be the region name, and it's a location type + mType = LOCATION; + // 'normalize' it so the region name is in fact the head of the path_array + path_array.insert(0, slurl_uri.hostName()); + } + } else if((slurl_uri.scheme() == LLSLURL::SLURL_HTTP_SCHEME) || (slurl_uri.scheme() == LLSLURL::SLURL_HTTPS_SCHEME) || (slurl_uri.scheme() == LLSLURL::SLURL_X_GRID_LOCATION_INFO_SCHEME) @@ -257,6 +309,13 @@ LLSLURL::LLSLURL(const std::string& slurl) else mGrid = default_grid; } + // places.inworldz.com isn't your regular everyday slurl + else if (slurl_uri.hostName() == LLSLURL::PLACES_INWORLDZ_COM) + { + // likewise, places.inworldz.com implies inworldz and a location + mGrid = INWORLDZ_URI; + mType = LOCATION; + } else { LL_DEBUGS("SLURL") << "slurl style Standalone" << LL_ENDL; @@ -330,14 +389,12 @@ LLSLURL::LLSLURL(const std::string& slurl) path_array.erase(0); // leave app appended. } -// else if ( slurl_uri.scheme() == LLSLURL::HOP_SCHEME) { LL_DEBUGS("SLURL") << "It's a location hop" << LL_ENDL; mType = LOCATION; } -// - else + else if (slurl_uri.hostName() != LLSLURL::PLACES_INWORLDZ_COM) { LL_DEBUGS("SLURL") << "Not a valid https/http/x-grid-location-info slurl " << slurl << LL_ENDL; // not a valid https/http/x-grid-location-info slurl, so it'll likely just be a URL diff --git a/indra/newview/fsslurl.h b/indra/newview/fsslurl.h index c2b9808819..ef19cda080 100644 --- a/indra/newview/fsslurl.h +++ b/indra/newview/fsslurl.h @@ -53,6 +53,11 @@ public: static const char* SLURL_APP_PATH; static const char* SLURL_REGION_PATH; + // Inworldz special + static const char* SLURL_INWORLDZ_SCHEME; + static const char* SLURL_IW_SCHEME; + static const char* PLACES_INWORLDZ_COM; + enum SLURL_TYPE { INVALID, diff --git a/indra/newview/llagent.cpp b/indra/newview/llagent.cpp index 96f8218312..71dae1cd54 100644 --- a/indra/newview/llagent.cpp +++ b/indra/newview/llagent.cpp @@ -98,14 +98,17 @@ #include "stringize.h" #include "boost/foreach.hpp" #include "llcorehttputil.h" +// [RLVa:KB] - Checked: 2011-11-04 (RLVa-1.4.4a) +#include "rlvactions.h" +#include "rlvhandler.h" +#include "rlvhelper.h" +#include "rlvui.h" +// [/RLVa:KB] // Firestorm includes #include "fslslbridge.h" #include "kcwlinterface.h" #include "llpresetsmanager.h" -#include "rlvactions.h" -#include "rlvhandler.h" -#include "rlvhelper.h" #include "NACLantispam.h" using namespace LLAvatarAppearanceDefines; @@ -216,7 +219,10 @@ private: class LLTeleportRequestViaLocationLookAt : public LLTeleportRequestViaLocation { public: - LLTeleportRequestViaLocationLookAt(const LLVector3d &pPosGlobal); +// [RLVa:KB] - Checked: RLVa-2.0.0 + LLTeleportRequestViaLocationLookAt(const LLVector3d &pPosGlobal, const LLVector3& look_at); +// [/RLVa:KB] +// LLTeleportRequestViaLocationLookAt(const LLVector3d &pPosGlobal); virtual ~LLTeleportRequestViaLocationLookAt(); virtual bool canRestartTeleport(); @@ -225,8 +231,14 @@ public: virtual void restartTeleport(); protected: +// [RLVa:KB] - Checked: RLVa-2.0.0 + const LLVector3& getLookAt() const { return mLookAt; } +// [/RLVa:KB] private: +// [RLVa:KB] - Checked: RLVa-2.0.0 + LLVector3 mLookAt; +// [/RLVa:KB] }; @@ -2300,7 +2312,10 @@ std::ostream& operator<<(std::ostream &s, const LLAgent &agent) //----------------------------------------------------------------------------- BOOL LLAgent::needsRenderAvatar() { - if (gAgentCamera.cameraMouselook() && !LLVOAvatar::sVisibleInFirstPerson) +// if (gAgentCamera.cameraMouselook() && !LLVOAvatar::sVisibleInFirstPerson) +// [RLVa:KB] - Checked: RLVa-2.0.2 + if ( (gAgentCamera.cameraMouselook() && !LLVOAvatar::sVisibleInFirstPerson) || (gRlvHandler.hasBehaviour(RLV_BHVR_SHOWSELF)) ) +// [/RLVa:KB] { return FALSE; } @@ -2311,7 +2326,10 @@ BOOL LLAgent::needsRenderAvatar() // TRUE if we need to render your own avatar's head. BOOL LLAgent::needsRenderHead() { - return (LLVOAvatar::sVisibleInFirstPerson && LLPipeline::sReflectionRender) || (mShowAvatar && !gAgentCamera.cameraMouselook()); +// [RLVa:KB] - Checked: RLVa-2.0.2 + return ((LLVOAvatar::sVisibleInFirstPerson && LLPipeline::sReflectionRender) || (mShowAvatar && !gAgentCamera.cameraMouselook())) && (!gRlvHandler.hasBehaviour(RLV_BHVR_SHOWSELFHEAD)); +// [/RLVa:KB] +// return (LLVOAvatar::sVisibleInFirstPerson && LLPipeline::sReflectionRender) || (mShowAvatar && !gAgentCamera.cameraMouselook()); } //----------------------------------------------------------------------------- @@ -2934,15 +2952,11 @@ void LLAgent::onAnimStop(const LLUUID& id) } else if (id == ANIM_AGENT_AWAY) { -// clearAFK(); // [RLVa:KB] - Checked: 2010-05-03 (RLVa-1.2.0g) | Added: RLVa-1.1.0g -#ifdef RLV_EXTENSION_CMD_ALLOWIDLE if (!gRlvHandler.hasBehaviour(RLV_BHVR_ALLOWIDLE)) clearAFK(); -#else - clearAFK(); -#endif // RLV_EXTENSION_CMD_ALLOWIDLE // [/RLVa:KB] +// clearAFK(); } else if (id == ANIM_AGENT_STANDUP) { @@ -4641,10 +4655,13 @@ void LLAgent::onCapabilitiesReceivedAfterTeleport() } -void LLAgent::teleportRequest( - const U64& region_handle, - const LLVector3& pos_local, - bool look_at_from_camera) +//void LLAgent::teleportRequest( +// const U64& region_handle, +// const LLVector3& pos_local, +// bool look_at_from_camera) +// [RLVa:KB] - Checked: RLVa-2.0.0 +void LLAgent::teleportRequest(const U64& region_handle, const LLVector3& pos_local, const LLVector3& look_at) +// [/RLVa:KB] { LLViewerRegion* regionp = getRegion(); bool is_local = (region_handle == regionp->getHandle()); @@ -4660,11 +4677,11 @@ void LLAgent::teleportRequest( msg->nextBlockFast(_PREHASH_Info); msg->addU64("RegionHandle", region_handle); msg->addVector3("Position", pos_local); - LLVector3 look_at(0,1,0); - if (look_at_from_camera) - { - look_at = LLViewerCamera::getInstance()->getAtAxis(); - } +// LLVector3 look_at(0,1,0); +// if (look_at_from_camera) +// { +// look_at = LLViewerCamera::getInstance()->getAtAxis(); +// } msg->addVector3("LookAt", look_at); sendReliableMessage(); } @@ -4777,13 +4794,10 @@ void LLAgent::restoreCanceledTeleportRequest() void LLAgent::teleportViaLocation(const LLVector3d& pos_global) { -// [RLVa:KB] - Checked: 2010-03-02 (RLVa-1.2.0c) | Modified: RLVa-1.2.0a - if ( (rlv_handler_t::isEnabled()) && (!RlvUtil::isForceTp()) ) +// [RLVa:KB] - Checked: RLVa-2.0.0 + if ( (RlvActions::isRlvEnabled()) && (!RlvUtil::isForceTp()) ) { - // If we're getting teleported due to @tpto we should disregard any @tploc=n or @unsit=n restrictions from the same object - if ( (gRlvHandler.hasBehaviourExcept(RLV_BHVR_TPLOC, gRlvHandler.getCurrentObject())) || - ( (isAgentAvatarValid()) && (gAgentAvatarp->isSitting()) && - (gRlvHandler.hasBehaviourExcept(RLV_BHVR_UNSIT, gRlvHandler.getCurrentObject()))) ) + if ( (RlvActions::isLocalTp(pos_global)) ? !RlvActions::canTeleportToLocal(pos_global) : !RlvActions::canTeleportToLocation() ) { RlvUtil::notifyBlocked(RLV_STRING_BLOCKED_TELEPORT); return; @@ -4858,25 +4872,37 @@ void LLAgent::doTeleportViaLocation(const LLVector3d& pos_global) } // Teleport to global position, but keep facing in the same direction -void LLAgent::teleportViaLocationLookAt(const LLVector3d& pos_global) +// [RLVa:KB] - Checked: RLVa-2.0.0 +void LLAgent::teleportViaLocationLookAt(const LLVector3d& pos_global, const LLVector3& look_at) { -// [RLVa:KB] - Checked: 2010-10-07 (RLVa-1.2.1f) | Added: RLVa-1.2.1f - // RELEASE-RLVa: [SL-2.2.0] Make sure this isn't used for anything except double-click teleporting - if ( (rlv_handler_t::isEnabled()) && (!RlvUtil::isForceTp()) && - ((gRlvHandler.hasBehaviour(RLV_BHVR_SITTP)) || (!RlvActions::canStand())) ) + if ( (RlvActions::isRlvEnabled()) && (!RlvUtil::isForceTp()) ) { - RlvUtil::notifyBlocked(RLV_STRING_BLOCKED_TELEPORT); - return; - } -// [/RLVa:KB] + if ( (RlvActions::isLocalTp(pos_global)) ? !RlvActions::canTeleportToLocal(pos_global) : !RlvActions::canTeleportToLocation() ) + { + RlvUtil::notifyBlocked(RLV_STRING_BLOCKED_TELEPORT); + return; + } - mTeleportRequest = LLTeleportRequestPtr(new LLTeleportRequestViaLocationLookAt(pos_global)); + if ( (gRlvHandler.getCurrentCommand()) && (RLV_BHVR_TPTO == gRlvHandler.getCurrentCommand()->getBehaviourType()) ) + { + gRlvHandler.setCanCancelTp(false); + } + } + + mTeleportRequest = LLTeleportRequestPtr(new LLTeleportRequestViaLocationLookAt(pos_global, (look_at.isExactlyZero()) ? LLViewerCamera::getInstance()->getAtAxis() : look_at)); startTeleportRequest(); } +// [/RLVa:KB] +//void LLAgent::teleportViaLocationLookAt(const LLVector3d& pos_global) +//{ +// mTeleportRequest = LLTeleportRequestPtr(new LLTeleportRequestViaLocationLookAt(pos_global)); +// startTeleportRequest(); +//} -void LLAgent::doTeleportViaLocationLookAt(const LLVector3d& pos_global) +// [RLVa:KB] - Checked: RLVa-2.0.0 +void LLAgent::doTeleportViaLocationLookAt(const LLVector3d& pos_global, const LLVector3& look_at) { - mbTeleportKeepsLookAt = true; + mbTeleportKeepsLookAt = look_at.isExactlyZero(); if(!gAgentCamera.isfollowCamLocked()) { @@ -4892,7 +4918,7 @@ void LLAgent::doTeleportViaLocationLookAt(const LLVector3d& pos_global) } // LLVector3 pos_local = (LLVector3)(pos_global - from_region_handle(region_handle)); - teleportRequest(region_handle, pos_local, getTeleportKeepsLookAt()); + teleportRequest(region_handle, pos_local, look_at); // Client LSL Bridge if (FSLSLBridge::instance().canUseBridge()) @@ -4910,6 +4936,21 @@ LLAgent::ETeleportState LLAgent::getTeleportState() const return (mTeleportRequest && (mTeleportRequest->getStatus() == LLTeleportRequest::kFailed)) ? TELEPORT_NONE : mTeleportState; } +// [/RLVa:KB] +//void LLAgent::doTeleportViaLocationLookAt(const LLVector3d& pos_global, const LLVector3& look_at) +//{ +// mbTeleportKeepsLookAt = true; +// +// if(!gAgentCamera.isfollowCamLocked()) +// { +// gAgentCamera.setFocusOnAvatar(FALSE, ANIMATE); // detach camera form avatar, so it keeps direction +// } +// +// U64 region_handle = to_region_handle(pos_global); +// LLVector3 pos_local = (LLVector3)(pos_global - from_region_handle(region_handle)); +// teleportRequest(region_handle, pos_local, look_at); +// teleportRequest(region_handle, pos_local, getTeleportKeepsLookAt()); +//} void LLAgent::setTeleportState(ETeleportState state) @@ -5416,11 +5457,18 @@ void LLTeleportRequestViaLocation::restartTeleport() // LLTeleportRequestViaLocationLookAt //----------------------------------------------------------------------------- -LLTeleportRequestViaLocationLookAt::LLTeleportRequestViaLocationLookAt(const LLVector3d &pPosGlobal) - : LLTeleportRequestViaLocation(pPosGlobal) +// [RLVa:KB] - Checked: RLVa-2.0.0 +LLTeleportRequestViaLocationLookAt::LLTeleportRequestViaLocationLookAt(const LLVector3d &pPosGlobal, const LLVector3& look_at) + : LLTeleportRequestViaLocation(pPosGlobal), mLookAt(look_at) { LL_INFOS("Teleport") << "LLTeleportRequestViaLocationLookAt created" << LL_ENDL; } +// [/RLVa:KB] + +//LLTeleportRequestViaLocationLookAt::LLTeleportRequestViaLocationLookAt(const LLVector3d &pPosGlobal) +// : LLTeleportRequestViaLocation(pPosGlobal) +//{ +//} LLTeleportRequestViaLocationLookAt::~LLTeleportRequestViaLocationLookAt() { @@ -5436,13 +5484,19 @@ bool LLTeleportRequestViaLocationLookAt::canRestartTeleport() void LLTeleportRequestViaLocationLookAt::startTeleport() { LL_INFOS("Teleport") << "LLTeleportRequestViaLocationLookAt::startTeleport" << LL_ENDL; - gAgent.doTeleportViaLocationLookAt(getPosGlobal()); +// [RLVa:KB] - Checked: RLVa-2.0.0 + gAgent.doTeleportViaLocationLookAt(getPosGlobal(), getLookAt()); +// [/RLVa:KB] +// gAgent.doTeleportViaLocationLookAt(getPosGlobal()); } void LLTeleportRequestViaLocationLookAt::restartTeleport() { LL_INFOS("Teleport") << "LLTeleportRequestViaLocationLookAt::restartTeleport" << LL_ENDL; - gAgent.doTeleportViaLocationLookAt(getPosGlobal()); +// [RLVa:KB] - Checked: RLVa-2.0.0 + gAgent.doTeleportViaLocationLookAt(getPosGlobal(), getLookAt()); +// [/RLVa:KB] +// gAgent.doTeleportViaLocationLookAt(getPosGlobal()); } diff --git a/indra/newview/llagent.h b/indra/newview/llagent.h index e7075c03e9..0cf1c2933a 100644 --- a/indra/newview/llagent.h +++ b/indra/newview/llagent.h @@ -721,7 +721,10 @@ public: void teleportHome() { teleportViaLandmark(LLUUID::null); } // Go home void teleportViaLure(const LLUUID& lure_id, BOOL godlike); // To an invited location void teleportViaLocation(const LLVector3d& pos_global); // To a global location - this will probably need to be deprecated - void teleportViaLocationLookAt(const LLVector3d& pos_global);// To a global location, preserving camera rotation +// [RLVa:KB] - Checked: RLVa-2.0.0 + void teleportViaLocationLookAt(const LLVector3d& pos_global, const LLVector3& look_at = LLVector3::zero);// To a global location, preserving camera rotation +// [/RLVa:KB] +// void teleportViaLocationLookAt(const LLVector3d& pos_global);// To a global location, preserving camera rotation void teleportCancel(); // May or may not be allowed by server void restoreCanceledTeleportRequest(); bool getTeleportKeepsLookAt() { return mbTeleportKeepsLookAt; } // Whether look-at reset after teleport @@ -765,13 +768,19 @@ private: bool hasPendingTeleportRequest(); void startTeleportRequest(); - void teleportRequest(const U64& region_handle, - const LLVector3& pos_local, // Go to a named location home - bool look_at_from_camera = false); +// [RLVa:KB] - Checked: RLVa-2.0.0 + void teleportRequest(const U64& region_handle, const LLVector3& pos_local, const LLVector3& look_at = LLVector3(0, 1, 0)); +// [/RLVa:KB] +// void teleportRequest(const U64& region_handle, +// const LLVector3& pos_local, // Go to a named location home +// bool look_at_from_camera = false); void doTeleportViaLandmark(const LLUUID& landmark_id); // Teleport to a landmark void doTeleportViaLure(const LLUUID& lure_id, BOOL godlike); // To an invited location void doTeleportViaLocation(const LLVector3d& pos_global); // To a global location - this will probably need to be deprecated - void doTeleportViaLocationLookAt(const LLVector3d& pos_global);// To a global location, preserving camera rotation +// [RLVa:KB] - Checked: RLVa-2.0.0 + void doTeleportViaLocationLookAt(const LLVector3d& pos_global, const LLVector3& look_at);// To a global location, preserving camera rotation +// [/RLVa:KB] +// void doTeleportViaLocationLookAt(const LLVector3d& pos_global);// To a global location, preserving camera rotation void handleTeleportFinished(); void handleTeleportFailed(); diff --git a/indra/newview/llagentcamera.cpp b/indra/newview/llagentcamera.cpp index 1d29bf4b9e..a6b4c6cd92 100644 --- a/indra/newview/llagentcamera.cpp +++ b/indra/newview/llagentcamera.cpp @@ -217,10 +217,18 @@ void LLAgentCamera::init() mCameraOffsetInitial[CAMERA_PRESET_REAR_VIEW] = gSavedSettings.getControl("CameraOffsetRearView"); mCameraOffsetInitial[CAMERA_PRESET_FRONT_VIEW] = gSavedSettings.getControl("CameraOffsetFrontView"); mCameraOffsetInitial[CAMERA_PRESET_GROUP_VIEW] = gSavedSettings.getControl("CameraOffsetGroupView"); +// [RLVa:KB] - Checked: RLVa-2.0.0 + mCameraOffsetInitial[CAMERA_RLV_SETCAM_VIEW] = gSavedSettings.declareVec3("CameraOffsetRLVaView", LLVector3(mCameraOffsetInitial[CAMERA_PRESET_REAR_VIEW]->getDefault()), "Declared in code", LLControlVariable::PERSIST_NO); + mCameraOffsetInitial[CAMERA_RLV_SETCAM_VIEW]->setHiddenFromSettingsEditor(true); +// [/RLVa:KB] mFocusOffsetInitial[CAMERA_PRESET_REAR_VIEW] = gSavedSettings.getControl("FocusOffsetRearView"); mFocusOffsetInitial[CAMERA_PRESET_FRONT_VIEW] = gSavedSettings.getControl("FocusOffsetFrontView"); mFocusOffsetInitial[CAMERA_PRESET_GROUP_VIEW] = gSavedSettings.getControl("FocusOffsetGroupView"); +// [RLVa:KB] - Checked: RLVa-2.0.0 + mFocusOffsetInitial[CAMERA_RLV_SETCAM_VIEW] = gSavedSettings.declareVec3("FocusOffsetRLVaView", LLVector3(mFocusOffsetInitial[CAMERA_PRESET_REAR_VIEW]->getDefault()), "Declared in code", LLControlVariable::PERSIST_NO); + mFocusOffsetInitial[CAMERA_RLV_SETCAM_VIEW]->setHiddenFromSettingsEditor(true); +// [/RLVa:KB] mCameraCollidePlane.clearVec(); mCurrentCameraDistance = getCameraOffsetInitial().magVec() * gSavedSettings.getF32("CameraOffsetScale"); @@ -830,7 +838,13 @@ void LLAgentCamera::setCameraZoomFraction(F32 fraction) LLVector3d camera_offset_dir = mCameraFocusOffsetTarget; camera_offset_dir.normalize(); - mCameraFocusOffsetTarget = camera_offset_dir * rescale(fraction, 0.f, 1.f, max_zoom, min_zoom); +// [RLVa:KB] - Checked: 2.0.0 + const LLVector3d focus_offset_target = camera_offset_dir * rescale(fraction, 0.f, 1.f, max_zoom, min_zoom); + if ( (RlvActions::isRlvEnabled()) && (!allowFocusOffsetChange(focus_offset_target)) ) + return; + mCameraFocusOffsetTarget = focus_offset_target; +// [/RLVa:KB] +// mCameraFocusOffsetTarget = camera_offset_dir * rescale(fraction, 0.f, 1.f, max_zoom, min_zoom); } startCameraAnimation(); } @@ -962,6 +976,11 @@ void LLAgentCamera::cameraZoomIn(const F32 fraction) new_distance = llclamp( new_distance, APPEARANCE_MIN_ZOOM, APPEARANCE_MAX_ZOOM ); } +// [RLVa:KB] - Checked: 2.0.0 + if ( (RlvActions::isRlvEnabled()) && (!allowFocusOffsetChange(new_distance * camera_offset_unit)) ) + return; +// [/RLVa:KB] + mCameraFocusOffsetTarget = new_distance * camera_offset_unit; } @@ -1033,6 +1052,11 @@ void LLAgentCamera::cameraOrbitIn(const F32 meters) new_distance = llclamp( new_distance, APPEARANCE_MIN_ZOOM, APPEARANCE_MAX_ZOOM ); } +// [RLVa:KB] - Checked: 2.0.0 + if ( (RlvActions::isRlvEnabled()) && (!allowFocusOffsetChange(new_distance * camera_offset_unit)) ) + return; +// [/RLVa:KB] + // Compute new camera offset mCameraFocusOffsetTarget = new_distance * camera_offset_unit; cameraZoomIn(1.f); @@ -1177,6 +1201,14 @@ void LLAgentCamera::updateCamera() mCameraUpVector = LLVector3::z_axis; //LLVector3 camera_skyward(0.f, 0.f, 1.f); +// [RLVa:KB] - Checked: RLVa-2.0.0 + // Set focus back on our avie if something changed it + if ( (gRlvHandler.hasBehaviour(RLV_BHVR_SETCAM_UNLOCK)) && (cameraThirdPerson()) && (!getFocusOnAvatar()) ) + { + setFocusOnAvatar(TRUE, FALSE); + } +// [/RLVa:KB] + U32 camera_mode = mCameraAnimating ? mLastCameraMode : mCameraMode; validateFocusObject(); @@ -1957,6 +1989,44 @@ LLVector3d LLAgentCamera::calcCameraPositionTargetGlobal(BOOL *hit_limit) // } +// [RLVa:KB] - Checked: RLVa-2.0.0 + if ( (CAMERA_MODE_THIRD_PERSON == mCameraMode) && (RlvActions::isRlvEnabled()) && (RlvActions::isCameraDistanceClamped()) ) + { + m_fRlvMinDist = m_fRlvMaxDist = false; + + // Av-locked | Focus-locked | Result + // =================================================== + // T | T | skip focus => slam av + // T | F | skip focus => slam av + // F | T | skip av => slam focus + // F | F | clamp focus then av + bool fCamAvDistClamped, fCamAvDistLocked = false; float nCamAvDistLimitMin, nCamAvDistLimitMax; + if (fCamAvDistClamped = RlvActions::getCameraAvatarDistanceLimits(nCamAvDistLimitMin, nCamAvDistLimitMax)) + fCamAvDistLocked = nCamAvDistLimitMin == nCamAvDistLimitMax; + bool fCamOriginDistClamped, fCamOriginDistLocked = false; float nCamOriginDistLimitMin, nCamOriginDistLimitMax; + if (fCamOriginDistClamped = RlvActions::getCameraOriginDistanceLimits(nCamOriginDistLimitMin, nCamOriginDistLimitMax)) + fCamOriginDistLocked = nCamOriginDistLimitMin == nCamOriginDistLimitMax; + + // Check focus distance limits + if ( (fCamOriginDistClamped) && (!fCamAvDistLocked) ) + { + const LLVector3 offsetCameraLocal = mCameraZoomFraction * getCameraOffsetInitial() * gSavedSettings.getF32("CameraOffsetScale"); + const LLVector3d offsetCamera(gAgent.getFrameAgent().rotateToAbsolute(offsetCameraLocal)); + const LLVector3d posFocusCam = frame_center_global + head_offset + offsetCamera; + if (clampCameraPosition(camera_position_global, posFocusCam, nCamOriginDistLimitMin, nCamOriginDistLimitMax)) + isConstrained = TRUE; + } + + // Check avatar distance limits + if ( (fCamAvDistClamped) && (fCamAvDistLocked || !fCamOriginDistClamped) ) + { + const LLVector3d posAvatarCam = gAgent.getPosGlobalFromAgent( (isAgentAvatarValid()) ? gAgentAvatarp->mHeadp->getWorldPosition() : gAgent.getPositionAgent() ); + if (clampCameraPosition(camera_position_global, posAvatarCam, nCamAvDistLimitMin, nCamAvDistLimitMax)) + isConstrained = TRUE; + } + } +// [/RLVa:KB] + // Don't let camera go underground F32 camera_min_off_ground = getCameraMinOffGround(); @@ -1977,6 +2047,49 @@ LLVector3d LLAgentCamera::calcCameraPositionTargetGlobal(BOOL *hit_limit) return camera_position_global; } +// [RLVa:KB] - Checked: RLVa-2.0.0 +bool LLAgentCamera::allowFocusOffsetChange(const LLVector3d& offsetFocus) +{ + if (RlvActions::isCameraDistanceClamped()) + { + if ( (CAMERA_MODE_THIRD_PERSON == getCameraMode()) && ((m_fRlvMinDist) || (m_fRlvMaxDist)) ) + { + const LLVector3d posFocusGlobal = calcFocusPositionTargetGlobal(); + // Don't allow moving the focus offset if at minimum and moving closer (or if at maximum and moving further) to prevent camera warping + F32 nCurDist = llabs((posFocusGlobal + mCameraFocusOffsetTarget - m_posRlvRefGlobal).magVec()); + F32 nNewDist = llabs((posFocusGlobal + offsetFocus - m_posRlvRefGlobal).magVec()); + if ( ((m_fRlvMaxDist) && (nNewDist > nCurDist)) || ((m_fRlvMinDist) && (nNewDist < nCurDist)) ) + return false; + } + } + return true; +} + +bool LLAgentCamera::clampCameraPosition(LLVector3d& posCamGlobal, const LLVector3d posCamRefGlobal, float nDistMin, float nDistMax) +{ + const LLVector3d offsetCamera = posCamGlobal - posCamRefGlobal; + + F32 nCamAvDist = llabs(offsetCamera.magVec()), nDistMult = NAN; + if (nCamAvDist > nDistMax) + { + nDistMult = nDistMax / nCamAvDist; + m_fRlvMaxDist = true; + } + else if (nCamAvDist < nDistMin) + { + nDistMult = nDistMin / nCamAvDist; + m_fRlvMinDist = true; + } + + if (!isnan(nDistMult)) + { + posCamGlobal = posCamRefGlobal + nDistMult * offsetCamera; + m_posRlvRefGlobal = posCamRefGlobal; + return true; + } + return false; +} +// [/RLVa:KB] LLVector3 LLAgentCamera::getCameraOffsetInitial() { @@ -2110,6 +2223,10 @@ void LLAgentCamera::resetCamera() void LLAgentCamera::changeCameraToMouselook(BOOL animate) { if (!gSavedSettings.getBOOL("EnableMouselook") +// [RLVa:KB] - Checked: RLVa-2.0.0 + || ( (RlvActions::isRlvEnabled()) && (!RlvActions::canChangeToMouselook()) ) +// [/RLVa:KB] + || LLViewerJoystick::getInstance()->getOverrideCamera()) { return; @@ -2404,6 +2521,26 @@ void LLAgentCamera::changeCameraToCustomizeAvatar() void LLAgentCamera::switchCameraPreset(ECameraPreset preset) { +// [RLVa:KB] - Checked: RLVa-2.0.0 + if (RlvActions::isRlvEnabled()) + { + // Don't allow changing away from the our view if an object is restricting it + if (RlvActions::isCameraPresetLocked()) + preset = CAMERA_RLV_SETCAM_VIEW; + + // Don't reset anything if our view is already current + if ( (CAMERA_RLV_SETCAM_VIEW == preset) && (CAMERA_RLV_SETCAM_VIEW == mCameraPreset) ) + return; + + // Reset our view when switching away + if (CAMERA_RLV_SETCAM_VIEW != preset) + { + mCameraOffsetInitial[CAMERA_RLV_SETCAM_VIEW]->resetToDefault(); + mFocusOffsetInitial[CAMERA_RLV_SETCAM_VIEW]->resetToDefault(); + } + } +// [/RLVa:KB] + //zoom is supposed to be reset for the front and group views mCameraZoomFraction = 1.f; diff --git a/indra/newview/llagentcamera.h b/indra/newview/llagentcamera.h index 92178c70a5..98296e8a8a 100644 --- a/indra/newview/llagentcamera.h +++ b/indra/newview/llagentcamera.h @@ -56,7 +56,12 @@ enum ECameraPreset CAMERA_PRESET_FRONT_VIEW, /** "Above and to the left, over the shoulder, pulled back a little on the zoom" */ - CAMERA_PRESET_GROUP_VIEW + CAMERA_PRESET_GROUP_VIEW, + +// [RLVa:KB] - Checked: RLVa-2.0.0 + /* Used by RLVa */ + CAMERA_RLV_SETCAM_VIEW +// [/RLVa:KB] }; //------------------------------------------------------------------------ @@ -305,6 +310,18 @@ public: F32 mHUDTargetZoom; // Target zoom level for HUD objects (used when editing) F32 mHUDCurZoom; // Current animated zoom level for HUD objects +// [RLVa:KB] - Checked: RLVa-2.0.0 + //-------------------------------------------------------------------- + // RLVa + //-------------------------------------------------------------------- +protected: + bool allowFocusOffsetChange(const LLVector3d& offsetFocus); + bool clampCameraPosition(LLVector3d& posCamGlobal, const LLVector3d posCamRefGlobal, float nDistMin, float nDistMax); + + bool m_fRlvMaxDist; // True if the camera is at max distance + bool m_fRlvMinDist; // True if the camera is at min distance + LLVector3d m_posRlvRefGlobal; // Current reference point for distance calculations +// [/RLVa:KB] /******************************************************************************** ** ** diff --git a/indra/newview/llagentlistener.cpp b/indra/newview/llagentlistener.cpp index ff3d4e6ce2..85bae5cd75 100644 --- a/indra/newview/llagentlistener.cpp +++ b/indra/newview/llagentlistener.cpp @@ -186,7 +186,7 @@ void LLAgentListener::requestSit(LLSD const & event_data) const // [RLVa:KB] - Checked: 2010-03-06 (RLVa-1.2.0c) | Modified: RLVa-1.1.0j // TODO-RLVa: [RLVa-1.2.1] Figure out how to call this? - if ( (rlv_handler_t::isEnabled()) && (!gRlvHandler.canSit(object)) ) + if ( (rlv_handler_t::isEnabled()) && (!RlvActions::canSit(object)) ) { return; } diff --git a/indra/newview/llappdelegate-objc.mm b/indra/newview/llappdelegate-objc.mm index c0a89bc0a4..b2ed17364c 100644 --- a/indra/newview/llappdelegate-objc.mm +++ b/indra/newview/llappdelegate-objc.mm @@ -109,7 +109,9 @@ callWindowUnhide(); } -- (NSApplicationDelegateReply) applicationShouldTerminate:(NSApplication *)sender +// This got changed at some point in the SDK. +//- (NSApplicationDelegateReply) applicationShouldTerminate:(NSApplication *)sender +- (NSApplicationTerminateReply) applicationShouldTerminate:(NSApplication *)sender { if (!runMainLoop()) { diff --git a/indra/newview/llappearancemgr.cpp b/indra/newview/llappearancemgr.cpp index f6274acc30..cd4461f4cd 100644 --- a/indra/newview/llappearancemgr.cpp +++ b/indra/newview/llappearancemgr.cpp @@ -59,7 +59,6 @@ #include "llappviewer.h" #include "llcoros.h" #include "lleventcoro.h" - #include "llavatarpropertiesprocessor.h" // [RLVa:KB] - Checked: 2011-05-22 (RLVa-1.3.1) @@ -67,6 +66,7 @@ #include "rlvhelper.h" #include "rlvlocks.h" // [/RLVa:KB] + #include "fslslbridge.h" #if LL_MSVC @@ -1323,23 +1323,19 @@ static void removeDuplicateItems(LLInventoryModel::item_array_t& items) // [SL:KB] - Patch: Appearance-WearableDuplicateAssets | Checked: 2015-06-30 (Catznip-3.7) static void removeDuplicateWearableItemsByAssetID(LLInventoryModel::item_array_t& items) { - struct is_duplicate_asset - { - bool operator()(const LLViewerInventoryItem* pItem) + std::set idsAsset; + items.erase(std::remove_if(items.begin(), items.end(), + [&idsAsset](const LLViewerInventoryItem* pItem) { if (pItem->isWearableType()) { const LLUUID& idAsset = pItem->getAssetUUID(); - if ( (idAsset.notNull()) && (m_idsAsset.end() != m_idsAsset.find(idAsset)) ) + if ( (idAsset.notNull()) && (idsAsset.end() != idsAsset.find(idAsset)) ) return true; - m_idsAsset.insert(idAsset); + idsAsset.insert(idAsset); } return false; - } - protected: - std::set m_idsAsset; - }; - items.erase(std::remove_if(items.begin(), items.end(), is_duplicate_asset()), items.end()); + }), items.end()); } // [/SL:KB] @@ -2083,6 +2079,8 @@ void LLAppearanceMgr::filterWearableItems( } } +//void LLAppearanceMgr::updateCOF(const LLUUID& category, bool append) +// [RLVa:KB] - Checked: 2010-03-05 (RLVa-1.2.0) void LLAppearanceMgr::updateCOF(const LLUUID& category, bool append) { LLViewerInventoryCategory *pcat = gInventory.getCategory(category); @@ -2617,9 +2615,8 @@ void LLAppearanceMgr::updateAppearanceFromCOF(bool enforce_item_restrictions, std::set pendingAttachments; if (LLAttachmentsMgr::instance().getPendingAttachments(pendingAttachments)) { - for (std::set::const_iterator itAttachItem = pendingAttachments.begin(); itAttachItem != pendingAttachments.end(); ++itAttachItem) + for (const LLUUID& idAttachItem : pendingAttachments) { - const LLUUID& idAttachItem = *itAttachItem; if ( (!gAgentAvatarp->isWearingAttachment(idAttachItem)) || (isLinkedInCOF(idAttachItem)) ) { LLAttachmentsMgr::instance().clearPendingAttachmentLink(idAttachItem); diff --git a/indra/newview/llappviewer.cpp b/indra/newview/llappviewer.cpp index c24ef03c88..46ebcf89a4 100644 --- a/indra/newview/llappviewer.cpp +++ b/indra/newview/llappviewer.cpp @@ -95,9 +95,8 @@ // [SL:KB] - Patch: Appearance-Misc | Checked: 2013-02-12 (Catznip-3.4) #include "llappearancemgr.h" // [/SL:KB] -// [RLVa:KB] - Checked: 2010-04-18 (RLVa-1.4.0) +// [RLVa:KB] - Checked: 2010-05-03 (RLVa-1.2.0g) #include "rlvactions.h" -#include "rlvhelper.h" #include "rlvhandler.h" // [/RLVa:KB] @@ -543,17 +542,13 @@ void idle_afk_check() { // check idle timers F32 current_idle = gAwayTriggerTimer.getElapsedTimeF32(); -// F32 afk_timeout = gSavedSettings.getS32("AFKTimeout"); -// [RLVa:KB] - Checked: 2010-05-03 (RLVa-1.2.0g) | Modified: RLVa-1.2.0g -#ifdef RLV_EXTENSION_CMD_ALLOWIDLE - // Enforce an idle time of 30 minutes if @allowidle=n restricted // Cache frequently hit location static LLCachedControl sAFKTimeout(gSavedSettings, "AFKTimeout"); +// [RLVa:KB] - Checked: 2010-05-03 (RLVa-1.2.0g) | Modified: RLVa-1.2.0g + // Enforce an idle time of 30 minutes if @allowidle=n restricted S32 afk_timeout = (!gRlvHandler.hasBehaviour(RLV_BHVR_ALLOWIDLE)) ? sAFKTimeout : 60 * 30; -#else - static LLCachedControl afk_timeout(gSavedSettings, "AFKTimeout"); // -#endif // RLV_EXTENSION_CMD_ALLOWIDLE // [/RLVa:KB] +// F32 afk_timeout = gSavedSettings.getS32("AFKTimeout"); // Explicit conversions just cos. //if (afk_timeout && (current_idle > afk_timeout) && ! gAgent.getAFK()) if (static_cast(afk_timeout) && (current_idle > static_cast(afk_timeout)) && ! gAgent.getAFK()) @@ -3903,16 +3898,28 @@ LLSD LLAppViewer::getViewerInfo() const LLViewerRegion* region = gAgent.getRegion(); if (region) { - LLVector3d pos = gAgent.getPositionGlobal(); - info["POSITION"] = ll_sd_from_vector3d(pos); - info["POSITION_LOCAL"] = ll_sd_from_vector3(gAgent.getPosAgentFromGlobal(pos)); - info["REGION"] = gAgent.getRegion()->getName(); - info["HOSTNAME"] = gAgent.getRegion()->getHost().getHostName(); - info["HOSTIP"] = gAgent.getRegion()->getHost().getString(); +// [RLVa:KB] - Checked: 2014-02-24 (RLVa-1.4.10) + if (RlvActions::canShowLocation()) + { +// [/RLVa:KB] + LLVector3d pos = gAgent.getPositionGlobal(); + info["POSITION"] = ll_sd_from_vector3d(pos); + info["POSITION_LOCAL"] = ll_sd_from_vector3(gAgent.getPosAgentFromGlobal(pos)); + info["REGION"] = gAgent.getRegion()->getName(); + info["HOSTNAME"] = gAgent.getRegion()->getHost().getHostName(); + info["HOSTIP"] = gAgent.getRegion()->getHost().getString(); +// info["SERVER_VERSION"] = gLastVersionChannel; + LLSLURL slurl; + LLAgentUI::buildSLURL(slurl); + info["SLURL"] = slurl.getSLURLString(); +// [RLVa:KB] - Checked: 2014-02-24 (RLVa-1.4.10) + } + else + { + info["REGION"] = RlvStrings::getString(RLV_STRING_HIDDEN_REGION); + } info["SERVER_VERSION"] = gLastVersionChannel; - LLSLURL slurl; - LLAgentUI::buildSLURL(slurl); - info["SLURL"] = slurl.getSLURLString(); +// [/RLVa:KB] } // CPU @@ -3932,7 +3939,7 @@ LLSD LLAppViewer::getViewerInfo() const #endif // [RLVa:KB] - Checked: 2010-04-18 (RLVa-1.2.0) - info["RLV_VERSION"] = (RlvActions::isRlvEnabled()) ? RlvStrings::getVersionAbout() : "(disabled)"; + info["RLV_VERSION"] = (rlv_handler_t::isEnabled()) ? RlvStrings::getVersionAbout() : "(disabled)"; // [/RLVa:KB] info["OPENGL_VERSION"] = (const char*)(glGetString(GL_VERSION)); info["LIBCURL_VERSION"] = LLCore::LLHttp::getCURLVersion(); @@ -4114,13 +4121,9 @@ std::string LLAppViewer::getViewerInfoString() const if (info.has("REGION")) { // [RLVa:KB] - Checked: 2014-02-24 (RLVa-1.4.10) - support << "\n\n"; - if (RlvActions::canShowLocation()) - support << LLTrans::getString("AboutPosition", args); - else - support << RlvStrings::getString(RLV_STRING_HIDDEN_REGION); + support << "\n\n" << LLTrans::getString( (RlvActions::canShowLocation()) ? "AboutPosition" : "AboutPositionRLVShowLoc", args); // [/RLVa:KB] - //support << "\n\n" << LLTrans::getString("AboutPosition", args); +// support << "\n\n" << LLTrans::getString("AboutPosition", args); } support << "\n\n" << LLTrans::getString("AboutSystem", args); support << "\n"; diff --git a/indra/newview/llappviewermacosx.cpp b/indra/newview/llappviewermacosx.cpp index 8b4078488a..1a3da9c092 100644 --- a/indra/newview/llappviewermacosx.cpp +++ b/indra/newview/llappviewermacosx.cpp @@ -297,7 +297,7 @@ void LLAppViewerMacOSX::initCrashReporting(bool reportFreeze) std::string appname = gDirUtilp->getExecutableFilename(); std::string str[] = { "-pid", pid_str.str(), "-dumpdir", logdir, "-procname", appname.c_str() }; std::vector< std::string > args( str, str + ( sizeof ( str ) / sizeof ( std::string ) ) ); - LL_WARNS() << "about to launch mac-crash-logger" << pid_str << " " << logdir << " " << appname << LL_ENDL; + LL_WARNS() << "about to launch mac-crash-logger" << pid_str.str() << " " << logdir << " " << appname << LL_ENDL; launchApplication(&command_str, &args); } diff --git a/indra/newview/llavataractions.cpp b/indra/newview/llavataractions.cpp index 1d3de0d2e2..4113bfaa4b 100644 --- a/indra/newview/llavataractions.cpp +++ b/indra/newview/llavataractions.cpp @@ -74,6 +74,11 @@ #include "llsidepanelinventory.h" #include "llavatarname.h" #include "llagentui.h" +// [RLVa:KB] - Checked: 2011-04-11 (RLVa-1.3.0) +#include "rlvactions.h" +#include "rlvcommon.h" +#include "rlvhandler.h" +// [/RLVa:KB] // Firestorm includes #include "fsfloaterim.h" @@ -91,9 +96,6 @@ #include "llviewerparcelmgr.h" #include "llviewerwindow.h" // For opening logs externally #include "llworld.h" -#include "rlvactions.h" -#include "rlvcommon.h" -#include "rlvhandler.h" // Flags for kick message const U32 KICK_FLAGS_DEFAULT = 0x0; @@ -243,7 +245,7 @@ void LLAvatarActions::startIM(const LLUUID& id) return; // [RLVa:KB] - Checked: 2013-05-09 (RLVa-1.4.9) - if ( (!RlvActions::canStartIM(id)) && (!RlvActions::hasOpenP2PSession(id)) ) + if (!RlvActions::canStartIM(id)) { make_ui_sound("UISndInvalidOp"); RlvUtil::notifyBlocked(RLV_STRING_BLOCKED_STARTIM, LLSD().with("RECIPIENT", LLSLURL("agent", id, "completename").getSLURLString())); @@ -288,7 +290,7 @@ void LLAvatarActions::startCall(const LLUUID& id) } // [RLVa:KB] - Checked: 2013-05-09 (RLVa-1.4.9) - if ( (!RlvActions::canStartIM(id)) && (!RlvActions::hasOpenP2PSession(id)) ) + if (!RlvActions::canStartIM(id)) { make_ui_sound("UISndInvalidOp"); RlvUtil::notifyBlocked(RLV_STRING_BLOCKED_STARTIM, LLSD().with("RECIPIENT", LLSLURL("agent", id, "completename").getSLURLString())); @@ -556,6 +558,17 @@ void LLAvatarActions::teleport_request_callback(const LLSD& notification, const { LLMessageSystem* msg = gMessageSystem; +// [RLVa:KB] - Checked: RLVa-2.0.0 + const LLUUID idRecipient = notification["substitutions"]["uuid"]; + std::string strMessage = response["message"]; + + // Filter the request message if the recipients is IM-blocked + if ( (!RlvActions::isRlvEnabled()) || ((RlvActions::canStartIM(idRecipient)) && (RlvActions::canSendIM(idRecipient))) ) + { + strMessage = RlvStrings::getString(RLV_STRING_HIDDEN); + } +// [/RLVa:KB] + msg->newMessageFast(_PREHASH_ImprovedInstantMessage); msg->nextBlockFast(_PREHASH_AgentData); msg->addUUIDFast(_PREHASH_AgentID, gAgent.getID()); @@ -573,7 +586,10 @@ void LLAvatarActions::teleport_request_callback(const LLSD& notification, const LLAgentUI::buildFullname(name); msg->addStringFast(_PREHASH_FromAgentName, name); - msg->addStringFast(_PREHASH_Message, response["message"]); +// [RLVa:KB] - Checked: RLVa-2.0.0 + msg->addStringFast(_PREHASH_Message, strMessage); +// [/RLVa:KB] +// msg->addStringFast(_PREHASH_Message, response["message"]); msg->addU32Fast(_PREHASH_ParentEstateID, 0); msg->addUUIDFast(_PREHASH_RegionID, LLUUID::null); msg->addVector3Fast(_PREHASH_Position, gAgent.getPositionAgent()); @@ -601,14 +617,17 @@ void LLAvatarActions::teleportRequest(const LLUUID& id) LLSD notification; notification["uuid"] = id; - LLAvatarName av_name; - if (!LLAvatarNameCache::get(id, &av_name)) - { - // unlikely ... they just picked this name from somewhere... - LLAvatarNameCache::get(id, boost::bind(&LLAvatarActions::teleportRequest, id)); - return; // reinvoke this when the name resolves - } - notification["NAME"] = av_name.getCompleteName(); +// [RLVa:KB] - Checked: RLVa-1.5.0 + notification["NAME"] = LLSLURL("agent", id, (RlvActions::canShowName(RlvActions::SNC_TELEPORTREQUEST, id)) ? "completename" : "rlvanonym").getSLURLString(); +// [/RLVa:KB] +// LLAvatarName av_name; +// if (!LLAvatarNameCache::get(id, &av_name)) +// { +// // unlikely ... they just picked this name from somewhere... +// LLAvatarNameCache::get(id, boost::bind(&LLAvatarActions::teleportRequest, id)); +// return; // reinvoke this when the name resolves +// } +// notification["NAME"] = av_name.getCompleteName(); LLSD payload; diff --git a/indra/newview/llavatarlist.cpp b/indra/newview/llavatarlist.cpp index 5ed7f84f20..4a7cdb4f1a 100644 --- a/indra/newview/llavatarlist.cpp +++ b/indra/newview/llavatarlist.cpp @@ -49,8 +49,8 @@ #include "lltooldraganddrop.h" // [RLVa:KB] - Checked: 2010-06-04 (RLVa-1.2.2a) #include "rlvhandler.h" +#include "rlvactions.h" // [/RLVa:KB] - static LLDefaultChildRegistry::Register r("avatar_list"); // Last interaction time update period. @@ -186,7 +186,7 @@ LLAvatarList::LLAvatarList(const Params& p) , mShowSpeakingIndicator(p.show_speaking_indicator) , mShowPermissions(p.show_permissions_granted) , mShowCompleteName(false) -// [RLVa:KB] - Checked: 2010-04-05 (RLVa-1.2.2a) | Added: RLVa-1.2.0d +// [RLVa:KB] - Checked: RLVa-1.2.0 , mRlvCheckShowNames(false) // [/RLVa:KB] , mShowVoiceVolume(p.show_voice_volume) @@ -400,7 +400,7 @@ void LLAvatarList::refresh() // FIRE-12750: Name filter not working correctly //if (!have_filter || findInsensitive(getAvatarName(av_name), mNameFilter)) - if (!have_filter || findInsensitive(getNameForDisplay(av_name, mShowDisplayName, mShowUsername, mRlvCheckShowNames), mNameFilter)) + if (!have_filter || findInsensitive(getNameForDisplay(buddy_id, av_name, mShowDisplayName, mShowUsername, mRlvCheckShowNames), mNameFilter)) // { if (nadded >= ADD_LIMIT) @@ -456,7 +456,7 @@ void LLAvatarList::refresh() have_names &= LLAvatarNameCache::get(buddy_id, &av_name); // FIRE-12750: Name filter not working correctly //if (!findInsensitive(getAvatarName(av_name), mNameFilter)) - if (!findInsensitive(getNameForDisplay(av_name, mShowDisplayName, mShowUsername, mRlvCheckShowNames), mNameFilter)) + if (!findInsensitive(getNameForDisplay(buddy_id, av_name, mShowDisplayName, mShowUsername, mRlvCheckShowNames), mNameFilter)) // { removeItemByUUID(buddy_id); @@ -533,7 +533,7 @@ bool LLAvatarList::filterHasMatches() // FIRE-12750: Name filter not working correctly //if (have_name && !findInsensitive(getAvatarName(av_name), mNameFilter)) - if (have_name && !findInsensitive(getNameForDisplay(av_name, mShowDisplayName, mShowUsername, mRlvCheckShowNames), mNameFilter)) + if (have_name && !findInsensitive(getNameForDisplay(buddy_id, av_name, mShowDisplayName, mShowUsername, mRlvCheckShowNames), mNameFilter)) // { continue; @@ -589,7 +589,7 @@ void LLAvatarList::addNewItem(const LLUUID& id, const std::string& name, BOOL is { LLAvatarListItem* item = new LLAvatarListItem(); item->setShowCompleteName(mShowCompleteName); -// [RLVa:KB] - Checked: 2010-04-05 (RLVa-1.2.2a) | Added: RLVa-1.2.0d +// [RLVa:KB] - Checked: RLVa-1.2.0 item->setRlvCheckShowNames(mRlvCheckShowNames); // [/RLVa:KB] @@ -618,7 +618,7 @@ BOOL LLAvatarList::handleRightMouseDown(S32 x, S32 y, MASK mask) BOOL handled = LLUICtrl::handleRightMouseDown(x, y, mask); // if ( mContextMenu && !isAvalineItemSelected()) // [RLVa:KB] - Checked: 2010-06-04 (RLVa-1.2.2a) | Modified: RLVa-1.2.0d - if ( (mContextMenu && !isAvalineItemSelected()) && ((!mRlvCheckShowNames) || (!gRlvHandler.hasBehaviour(RLV_BHVR_SHOWNAMES))) ) + if ( (mContextMenu && !isAvalineItemSelected()) && ((!mRlvCheckShowNames) || (!RlvActions::hasBehaviour(RLV_BHVR_SHOWNAMES))) ) // [/RLVa:KB] { uuid_vec_t selected_uuids; @@ -743,27 +743,27 @@ void LLAvatarList::onItemDoubleClicked(LLUICtrl* ctrl, S32 x, S32 y, MASK mask) { // mItemDoubleClickSignal(ctrl, x, y, mask); // [RLVa:KB] - Checked: 2010-06-05 (RLVa-1.2.2a) | Added: RLVa-1.2.0d - if ( (!mRlvCheckShowNames) || (!gRlvHandler.hasBehaviour(RLV_BHVR_SHOWNAMES)) ) + if ( (!mRlvCheckShowNames) || (!RlvActions::hasBehaviour(RLV_BHVR_SHOWNAMES)) ) mItemDoubleClickSignal(ctrl, x, y, mask); // [/RLVa:KB] } // FIRE-12750: Name filter not working correctly // static -std::string LLAvatarList::getNameForDisplay(const LLAvatarName& av_name, bool show_displayname, bool show_username, bool rlv_check_shownames) +std::string LLAvatarList::getNameForDisplay(const LLUUID& avatar_id, const LLAvatarName& av_name, bool show_displayname, bool show_username, bool rlv_check_shownames) { - bool fRlvFilter = (rlv_check_shownames) && (gRlvHandler.hasBehaviour(RLV_BHVR_SHOWNAMES)); + bool fRlvCanShowName = (!rlv_check_shownames) || (RlvActions::canShowName(RlvActions::SNC_DEFAULT, avatar_id)); if (show_displayname && !show_username) { - return ( (!fRlvFilter) ? av_name.getDisplayName() : RlvStrings::getAnonym(av_name) ); + return ( (fRlvCanShowName) ? av_name.getDisplayName() : RlvStrings::getAnonym(av_name) ); } else if (!show_displayname && show_username) { - return ( (!fRlvFilter) ? av_name.getUserName() : RlvStrings::getAnonym(av_name) ); + return ( (fRlvCanShowName) ? av_name.getUserName() : RlvStrings::getAnonym(av_name) ); } - else + else { - return ( (!fRlvFilter) ? av_name.getCompleteName() : RlvStrings::getAnonym(av_name) ); + return ( (fRlvCanShowName) ? av_name.getCompleteName() : RlvStrings::getAnonym(av_name) ); } } // diff --git a/indra/newview/llavatarlist.h b/indra/newview/llavatarlist.h index 3a16c40bab..2bbf5a1d86 100644 --- a/indra/newview/llavatarlist.h +++ b/indra/newview/llavatarlist.h @@ -103,7 +103,7 @@ public: // Return true if filter has at least one match. bool filterHasMatches(); -// [RLVa:KB] - Checked: 2010-04-05 (RLVa-1.2.2a) | Added: RLVa-1.2.0d +// [RLVa:KB] - Checked: RLVa-1.2.0 void setRlvCheckShowNames(bool fRlvCheckShowNames) { mRlvCheckShowNames = fRlvCheckShowNames; } // We need this to be public since we call it from RlvUIEnabler::onToggleShowNames() void updateAvatarNames(); @@ -114,7 +114,7 @@ public: // [/FS:CR] // FIRE-12750: Name filter not working correctly - static std::string getNameForDisplay(const LLAvatarName& av_name, bool show_displayname, bool show_username, bool rlv_check_shownames); + static std::string getNameForDisplay(const LLUUID& avatar_id, const LLAvatarName& av_name, bool show_displayname, bool show_username, bool rlv_check_shownames); boost::signals2::connection setRefreshCompleteCallback(const commit_signal_t::slot_type& cb); @@ -155,7 +155,7 @@ private: bool mShowSpeakingIndicator; bool mShowPermissions; bool mShowCompleteName; -// [RLVa:KB] - Checked: 2010-04-05 (RLVa-1.2.2a) | Added: RLVa-1.2.0d +// [RLVa:KB] - RLVa-1.2.0 bool mRlvCheckShowNames; // [/RLVa:KB] bool mShowDisplayName; diff --git a/indra/newview/llavatarlistitem.cpp b/indra/newview/llavatarlistitem.cpp index 0b5c017a9e..bc0813c34a 100644 --- a/indra/newview/llavatarlistitem.cpp +++ b/indra/newview/llavatarlistitem.cpp @@ -42,8 +42,9 @@ #include "llavatariconctrl.h" #include "lloutputmonitorctrl.h" #include "lltooldraganddrop.h" -// [RLVa:KB] - Checked: 2010-04-05 (RLVa-1.2.2a) -#include "rlvhandler.h" +// [RLVa:KB] - Checked: RLVa-2.0.1 +#include "rlvactions.h" +#include "rlvcommon.h" // [/RLVa:KB] #include #include "llnotificationsutil.h" @@ -87,7 +88,7 @@ LLAvatarListItem::LLAvatarListItem(bool not_from_ui_factory/* = true*/) mOnlineStatus(E_UNKNOWN), mShowInfoBtn(true), mShowProfileBtn(true), -// [RLVa:KB] - Checked: 2010-04-05 (RLVa-1.2.2a) | Added: RLVa-1.2.0d +// [RLVa:KB] - Checked: RLVa-1.2.0 mRlvCheckShowNames(false), // [/RLVa:KB] mShowPermissions(false), @@ -234,9 +235,10 @@ void LLAvatarListItem::onMouseEnter(S32 x, S32 y, MASK mask) // , removed on-hover visibility. Don't do this. instead flip info buttons on full-time in postbuild. // mInfoBtn->setVisible(mShowInfoBtn); // mProfileBtn->setVisible(mShowProfileBtn); -// [RLVa:KB] - Checked: 2010-04-05 (RLVa-1.2.2a) | Added: RLVa-1.2.0d - //mInfoBtn->setVisible( (mShowInfoBtn) && ((!mRlvCheckShowNames) || (!gRlvHandler.hasBehaviour(RLV_BHVR_SHOWNAMES))) ); - //mProfileBtn->setVisible( (mShowProfileBtn) && ((!mRlvCheckShowNames) || (!gRlvHandler.hasBehaviour(RLV_BHVR_SHOWNAMES))) ); +// [RLVa:KB] - Checked: RLVa-1.2.0 + //bool fRlvCanShowName = (!mRlvCheckShowNames) || (RlvActions::canShowName(RlvActions::SNC_DEFAULT, mAvatarId)); + //mInfoBtn->setVisible( (mShowInfoBtn) && (fRlvCanShowName) ); + //mProfileBtn->setVisible( (mShowProfileBtn) && (fRlvCanShowName) ); // [/RLVa:KB] mHovered = true; @@ -424,13 +426,13 @@ void LLAvatarListItem::setLastInteractionTime(U32 secs_since) void LLAvatarListItem::setShowInfoBtn(bool show) { mShowInfoBtn = show; - mInfoBtn->setVisible( (mShowInfoBtn) && ((!mRlvCheckShowNames) || (!gRlvHandler.hasBehaviour(RLV_BHVR_SHOWNAMES))) ); + mInfoBtn->setVisible( (mShowInfoBtn) && ((!mRlvCheckShowNames) || (RlvActions::canShowName(RlvActions::SNC_DEFAULT, mAvatarId))) ); } void LLAvatarListItem::setShowVoiceVolume(bool show) { mShowVoiceVolume = show; - mVoiceSlider->setVisible( (mShowVoiceVolume) && ((!mRlvCheckShowNames) || (!gRlvHandler.hasBehaviour(RLV_BHVR_SHOWNAMES))) ); + mVoiceSlider->setVisible( (mShowVoiceVolume) && ((!mRlvCheckShowNames) || (RlvActions::canShowName(RlvActions::SNC_DEFAULT, mAvatarId))) ); if (show) { updateVoiceLevelSlider(); @@ -511,7 +513,7 @@ void LLAvatarListItem::onProfileBtnClick() BOOL LLAvatarListItem::handleDoubleClick(S32 x, S32 y, MASK mask) { // if(mInfoBtn->getRect().pointInRect(x, y)) -// [SL:KB] - Checked: 2010-10-31 (RLVa-1.2.2a) | Added: RLVa-1.2.2a +// [RVLa:KB] - Checked: RLVa-1.2.2 if ( (mInfoBtn->getVisible()) && (mInfoBtn->getEnabled()) && (mInfoBtn->getRect().pointInRect(x, y)) ) // [/SL:KB] { @@ -519,7 +521,7 @@ BOOL LLAvatarListItem::handleDoubleClick(S32 x, S32 y, MASK mask) return TRUE; } // if(mProfileBtn->getRect().pointInRect(x, y)) -// [SL:KB] - Checked: 2010-10-31 (RLVa-1.2.2a) | Added: RLVa-1.2.2a +// [RLVa:KB] - Checked: RLVa-1.2.2 if ( (mProfileBtn->getVisible()) && (mProfileBtn->getEnabled()) && (mProfileBtn->getRect().pointInRect(x, y)) ) // [/SL:KB] { @@ -599,22 +601,22 @@ void LLAvatarListItem::onAvatarNameCache(const LLAvatarName& av_name) //} //setAvatarName(name_string); //setAvatarToolTip(av_name.getUserName()); -// [RLVa:KB] - Checked: 2010-10-31 (RLVa-1.2.2a) | Modified: RLVa-1.2.2a +// [RLVa:KB] - Checked: RLVa-1.2.2 // Centralized in LLAvatarList::getNameForDisplay! - bool fRlvFilter = (mRlvCheckShowNames) && (gRlvHandler.hasBehaviour(RLV_BHVR_SHOWNAMES)); + bool fRlvCanShowName = (!mRlvCheckShowNames) || (RlvActions::canShowName(RlvActions::SNC_DEFAULT, mAvatarId)); //if (mShowDisplayName && !mShowUsername) - // setAvatarName( (!fRlvFilter) ? av_name.getDisplayName() : RlvStrings::getAnonym(av_name) ); + // setAvatarName( (fRlvCanShowName) ? av_name.getDisplayName() : RlvStrings::getAnonym(av_name) ); //else if (!mShowDisplayName && mShowUsername) - // setAvatarName( (!fRlvFilter) ? av_name.getUserName() : RlvStrings::getAnonym(av_name) ); + // setAvatarName( (fRlvCanShowName) ? av_name.getUserName() : RlvStrings::getAnonym(av_name) ); //else - // setAvatarName( (!fRlvFilter) ? av_name.getCompleteName() : RlvStrings::getAnonym(av_name) ); - setAvatarName(LLAvatarList::getNameForDisplay(av_name, mShowDisplayName, mShowUsername, mRlvCheckShowNames)); + // setAvatarName( (fRlvCanShowName) ? av_name.getCompleteName() : RlvStrings::getAnonym(av_name) ); + setAvatarName(LLAvatarList::getNameForDisplay(mAvatarId, av_name, mShowDisplayName, mShowUsername, mRlvCheckShowNames)); - // NOTE: If you change this, you will break sorting the contacts list - // by username unless you go change the comparator too. -- TS - setAvatarToolTip( (!fRlvFilter) ? av_name.getUserName() : RlvStrings::getAnonym(av_name) ); + // NOTE: If you change this, you will break sorting the contacts list + // by username unless you go change the comparator too. -- TS + setAvatarToolTip( (fRlvCanShowName) ? av_name.getUserName() : RlvStrings::getAnonym(av_name) ); // TODO-RLVa: bit of a hack putting this here. Maybe find a better way? - mAvatarIcon->setDrawTooltip(!fRlvFilter); + mAvatarIcon->setDrawTooltip(fRlvCanShowName); // [/RLVa:KB] //KC - store the username for use in sorting diff --git a/indra/newview/llavatarlistitem.h b/indra/newview/llavatarlistitem.h index da3ff143d8..3b4b6f50f7 100644 --- a/indra/newview/llavatarlistitem.h +++ b/indra/newview/llavatarlistitem.h @@ -117,7 +117,7 @@ public: void showLastInteractionTime(bool show); void setAvatarIconVisible(bool visible); void setShowCompleteName(bool show) { mShowCompleteName = show;}; -// [RLVa:KB] - Checked: 2010-04-05 (RLVa-1.2.2a) | Added: RLVa-1.2.0d +// [RLVa:KB] - Checked: RLVa-1.2.0 void setRlvCheckShowNames(bool fRlvCheckShowNames); void updateRlvRestrictions(); // [/RLVa:KB] @@ -253,7 +253,7 @@ private: bool mShowInfoBtn; bool mShowVoiceVolume; bool mShowProfileBtn; -// [RLVa:KB] - Checked: 2010-04-05 (RLVa-1.2.2a) | Added: RLVa-1.2.0d +// [RLVa:KB] - Checked: RLVa-1.2.0 bool mRlvCheckShowNames; // [/RLVa:KB] std::string mUserName; //KC - username cache used for sorting diff --git a/indra/newview/llchathistory.cpp b/indra/newview/llchathistory.cpp index ab95aa76e9..9b8feba76e 100644 --- a/indra/newview/llchathistory.cpp +++ b/indra/newview/llchathistory.cpp @@ -661,10 +661,11 @@ protected: void showInfoCtrl() { - const bool isVisible = !mAvatarID.isNull() && !mFrom.empty() && CHAT_SOURCE_SYSTEM != mSourceType; +// const bool isVisible = !mAvatarID.isNull() && !mFrom.empty() && CHAT_SOURCE_SYSTEM != mSourceType; // [RLVa:KB] - Checked: 2010-04-22 (RLVa-1.2.2a) | Added: RLVa-1.2.0f - if (isVisible && mShowInfoCtrl) + const bool isVisible = mShowInfoCtrl && !mAvatarID.isNull() && !mFrom.empty() && CHAT_SOURCE_SYSTEM != mSourceType; // [/RLVa:KB] + if (isVisible) { const LLRect sticky_rect = mUserNameTextBox->getRect(); S32 icon_x = llmin(sticky_rect.mLeft + mUserNameTextBox->getTextBoundingRect().getWidth() + 7, sticky_rect.mRight - 3); diff --git a/indra/newview/lldrawpoolterrain.cpp b/indra/newview/lldrawpoolterrain.cpp index a44b534189..5bc6864cd2 100644 --- a/indra/newview/lldrawpoolterrain.cpp +++ b/indra/newview/lldrawpoolterrain.cpp @@ -324,10 +324,16 @@ void LLDrawPoolTerrain::renderFullShader() // Hack! Get the region that this draw pool is rendering from! LLViewerRegion *regionp = mDrawFace[0]->getDrawable()->getVObj()->getRegion(); LLVLComposition *compp = regionp->getComposition(); - LLViewerTexture *detail_texture0p = compp->mDetailTextures[0]; - LLViewerTexture *detail_texture1p = compp->mDetailTextures[1]; - LLViewerTexture *detail_texture2p = compp->mDetailTextures[2]; - LLViewerTexture *detail_texture3p = compp->mDetailTextures[3]; +// [SL:KB] - Patch: Render-TextureToggle (Catznip-4.0) + LLViewerTexture *detail_texture0p = (LLPipeline::sRenderTextures) ? compp->mDetailTextures[0] : LLViewerFetchedTexture::sDefaultDiffuseImagep; + LLViewerTexture *detail_texture1p = (LLPipeline::sRenderTextures) ? compp->mDetailTextures[1] : LLViewerFetchedTexture::sDefaultDiffuseImagep; + LLViewerTexture *detail_texture2p = (LLPipeline::sRenderTextures) ? compp->mDetailTextures[2] : LLViewerFetchedTexture::sDefaultDiffuseImagep; + LLViewerTexture *detail_texture3p = (LLPipeline::sRenderTextures) ? compp->mDetailTextures[3] : LLViewerFetchedTexture::sDefaultDiffuseImagep; +// [/SL:KB] +// LLViewerTexture *detail_texture0p = compp->mDetailTextures[0]; +// LLViewerTexture *detail_texture1p = compp->mDetailTextures[1]; +// LLViewerTexture *detail_texture2p = compp->mDetailTextures[2]; +// LLViewerTexture *detail_texture3p = compp->mDetailTextures[3]; LLVector3d region_origin_global = gAgent.getRegion()->getOriginGlobal(); F32 offset_x = (F32)fmod(region_origin_global.mdV[VX], 1.0/(F64)sDetailScale)*sDetailScale; @@ -475,10 +481,16 @@ void LLDrawPoolTerrain::renderFull4TU() // Hack! Get the region that this draw pool is rendering from! LLViewerRegion *regionp = mDrawFace[0]->getDrawable()->getVObj()->getRegion(); LLVLComposition *compp = regionp->getComposition(); - LLViewerTexture *detail_texture0p = compp->mDetailTextures[0]; - LLViewerTexture *detail_texture1p = compp->mDetailTextures[1]; - LLViewerTexture *detail_texture2p = compp->mDetailTextures[2]; - LLViewerTexture *detail_texture3p = compp->mDetailTextures[3]; +// [SL:KB] - Patch: Render-TextureToggle (Catznip-4.0) + LLViewerTexture *detail_texture0p = (LLPipeline::sRenderTextures) ? compp->mDetailTextures[0] : LLViewerFetchedTexture::sDefaultDiffuseImagep; + LLViewerTexture *detail_texture1p = (LLPipeline::sRenderTextures) ? compp->mDetailTextures[1] : LLViewerFetchedTexture::sDefaultDiffuseImagep; + LLViewerTexture *detail_texture2p = (LLPipeline::sRenderTextures) ? compp->mDetailTextures[2] : LLViewerFetchedTexture::sDefaultDiffuseImagep; + LLViewerTexture *detail_texture3p = (LLPipeline::sRenderTextures) ? compp->mDetailTextures[3] : LLViewerFetchedTexture::sDefaultDiffuseImagep; +// [/SL:KB] +// LLViewerTexture *detail_texture0p = compp->mDetailTextures[0]; +// LLViewerTexture *detail_texture1p = compp->mDetailTextures[1]; +// LLViewerTexture *detail_texture2p = compp->mDetailTextures[2]; +// LLViewerTexture *detail_texture3p = compp->mDetailTextures[3]; LLVector3d region_origin_global = gAgent.getRegion()->getOriginGlobal(); F32 offset_x = (F32)fmod(region_origin_global.mdV[VX], 1.0/(F64)sDetailScale)*sDetailScale; @@ -677,10 +689,16 @@ void LLDrawPoolTerrain::renderFull2TU() // Hack! Get the region that this draw pool is rendering from! LLViewerRegion *regionp = mDrawFace[0]->getDrawable()->getVObj()->getRegion(); LLVLComposition *compp = regionp->getComposition(); - LLViewerTexture *detail_texture0p = compp->mDetailTextures[0]; - LLViewerTexture *detail_texture1p = compp->mDetailTextures[1]; - LLViewerTexture *detail_texture2p = compp->mDetailTextures[2]; - LLViewerTexture *detail_texture3p = compp->mDetailTextures[3]; +// [SL:KB] - Patch: Render-TextureToggle (Catznip-4.0) + LLViewerTexture *detail_texture0p = (LLPipeline::sRenderTextures) ? compp->mDetailTextures[0] : LLViewerFetchedTexture::sDefaultDiffuseImagep; + LLViewerTexture *detail_texture1p = (LLPipeline::sRenderTextures) ? compp->mDetailTextures[1] : LLViewerFetchedTexture::sDefaultDiffuseImagep; + LLViewerTexture *detail_texture2p = (LLPipeline::sRenderTextures) ? compp->mDetailTextures[2] : LLViewerFetchedTexture::sDefaultDiffuseImagep; + LLViewerTexture *detail_texture3p = (LLPipeline::sRenderTextures) ? compp->mDetailTextures[3] : LLViewerFetchedTexture::sDefaultDiffuseImagep; +// [/SL:KB] +// LLViewerTexture *detail_texture0p = compp->mDetailTextures[0]; +// LLViewerTexture *detail_texture1p = compp->mDetailTextures[1]; +// LLViewerTexture *detail_texture2p = compp->mDetailTextures[2]; +// LLViewerTexture *detail_texture3p = compp->mDetailTextures[3]; LLVector3d region_origin_global = gAgent.getRegion()->getOriginGlobal(); F32 offset_x = (F32)fmod(region_origin_global.mdV[VX], 1.0/(F64)sDetailScale)*sDetailScale; diff --git a/indra/newview/lldrawpooltree.cpp b/indra/newview/lldrawpooltree.cpp index d07239c0cb..06d8547f12 100644 --- a/indra/newview/lldrawpooltree.cpp +++ b/indra/newview/lldrawpooltree.cpp @@ -98,7 +98,13 @@ void LLDrawPoolTree::render(S32 pass) LLGLState test(GL_ALPHA_TEST, LLGLSLShader::sNoFixedFunction ? 0 : 1); LLOverrideFaceColor color(this, 1.f, 1.f, 1.f, 1.f); - gGL.getTexUnit(sDiffTex)->bind(mTexturep); +// [SL:KB] - Patch: Render-TextureToggle (Catznip-4.0) + if( (LLPipeline::sRenderTextures) ) + gGL.getTexUnit(sDiffTex)->bind( mTexturep ); + else + gGL.getTexUnit(sDiffTex)->bind( LLViewerFetchedTexture::sDefaultDiffuseImagep ); +// [/SL:KB] +// gGL.getTexUnit(sDiffTex)->bind(mTexturep); for (std::vector::iterator iter = mDrawFace.begin(); iter != mDrawFace.end(); iter++) diff --git a/indra/newview/llface.cpp b/indra/newview/llface.cpp index b339522305..4da204b538 100644 --- a/indra/newview/llface.cpp +++ b/indra/newview/llface.cpp @@ -53,6 +53,9 @@ #include "llviewershadermgr.h" #include "llviewertexture.h" #include "llvoavatar.h" +// [RLVa:KB] - Checked: RLVa-2.0.0 +#include "rlvhandler.h" +// [/RLVa:KB] #if LL_LINUX // Work-around spurious used before init warning on Vector4a @@ -166,6 +169,10 @@ void LLFace::init(LLDrawable* drawablep, LLViewerObject* objp) mBoundingSphereRadius = 0.0f ; mHasMedia = FALSE ; + +// [SL:KB] - Patch: Render-TextureToggle (Catznip-4.0) + mShowDiffTexture = true; +// [/SL:KB] } void LLFace::destroy() @@ -282,6 +289,14 @@ void LLFace::setTexture(U32 ch, LLViewerTexture* tex) return ; } +// [SL:KB] - Patch: Render-TextureToggle (Catznip-4.0) + if ( (LLRender::DIFFUSE_MAP == ch) && (!mShowDiffTexture) ) + { + mOrigDiffTexture = tex; + return; + } +// [/SL:KB] + if(mTexture[ch].notNull()) { mTexture[ch]->removeFace(ch, this) ; @@ -2698,9 +2713,60 @@ LLViewerTexture* LLFace::getTexture(U32 ch) const { llassert(ch < LLRender::NUM_TEXTURE_CHANNELS); +// [SL:KB] - Patch: Render-TextureToggle (Catznip-4.0) + // Check whether the diffuse texture needs to be obscured or restored + if (mShowDiffTexture != LLPipeline::sRenderTextures) + setDefaultTexture(LLRender::DIFFUSE_MAP, !LLPipeline::sRenderTextures); +// [/SL:KB] + return mTexture[ch] ; } +// [SL:KB] - Patch: Render-TextureToggle (Catznip-4.0) +void LLFace::setDefaultTexture(U32 nChannel, bool fShowDefault) const +{ + bool fUpdated = false; + if ( (LLRender::DIFFUSE_MAP == nChannel) && (mVObjp) && (!mVObjp->isDead()) && ((LL_PCODE_VOLUME == mVObjp->getPCode()) || (LLViewerObject::LL_VO_PART_GROUP == mVObjp->getPCode())) ) + { + if ( ((mShowDiffTexture) && (fShowDefault)) || + ((!mShowDiffTexture) && (fShowDefault) && (mOrigDiffTexture.notNull()) && (mTexture[nChannel]) && (mTexture[nChannel]->getID() != LLViewerFetchedTexture::sDefaultDiffuseImagep->getID())) ) + { + if (mOrigDiffTexture.notNull()) + mShowDiffTexture = true; // Swap out the default texture + else + mOrigDiffTexture = mTexture[nChannel]; // Cache the original texture + + if ( (!gRlvHandler.hasBehaviour(RLV_BHVR_SETCAM_TEXTURES)) || (!mVObjp->isAttachment()) ) + { + if (LL_PCODE_VOLUME == mVObjp->getPCode()) + const_cast(this)->switchTexture(nChannel, LLViewerFetchedTexture::sDefaultDiffuseImagep); + else + const_cast(this)->setTexture(nChannel, LLViewerFetchedTexture::sDefaultDiffuseImagep); + } + mShowDiffTexture = false; fUpdated = true; + } + else if ( (!mShowDiffTexture) && (!fShowDefault) && (mOrigDiffTexture.notNull()) ) + { + mShowDiffTexture = true; + if (LL_PCODE_VOLUME == mVObjp->getPCode()) + const_cast(this)->switchTexture(nChannel, mOrigDiffTexture); + else + const_cast(this)->setTexture(nChannel, mOrigDiffTexture); + mOrigDiffTexture = nullptr; fUpdated = true; + } + + if ((fUpdated) && (mDrawablep)) + { + gPipeline.markTextured(mDrawablep); + const_cast(mDrawablep.get())->updateTexture(); + } + } + + // Always flip the flag even if we didn't obscure so we don't keep wasting cycles with negative checks + mShowDiffTexture = !fShowDefault; +} +// [/SL:KB] + void LLFace::setVertexBuffer(LLVertexBuffer* buffer) { mVertexBuffer = buffer; diff --git a/indra/newview/llface.h b/indra/newview/llface.h index ee545acb94..35cfdc1f8b 100644 --- a/indra/newview/llface.h +++ b/indra/newview/llface.h @@ -220,6 +220,10 @@ public: BOOL switchTexture() ; +// [SL:KB] - Patch: Render-TextureToggle (Catznip-4.0) + void setDefaultTexture(U32 nChannel, bool fShowDefault) const; +// [/SL:KB] + //vertex buffer tracking void setVertexBuffer(LLVertexBuffer* buffer); void clearVertexBuffer(); //sets mVertexBuffer to NULL @@ -294,7 +298,11 @@ private: F32 mBoundingSphereRadius ; bool mHasMedia ; - +// [SL:KB] - Patch: Render-TextureToggle (Catznip-4.0) + mutable bool mShowDiffTexture; + mutable LLPointer mOrigDiffTexture; +// [/SL:KB] + protected: static BOOL sSafeRenderSelect; diff --git a/indra/newview/llfloateravatarpicker.cpp b/indra/newview/llfloateravatarpicker.cpp index da20794924..f1f464a480 100644 --- a/indra/newview/llfloateravatarpicker.cpp +++ b/indra/newview/llfloateravatarpicker.cpp @@ -408,6 +408,7 @@ void LLFloaterAvatarPicker::onList() RLV_ASSERT( (pTabs) && (pNearMePanel) ); if ( (pTabs) && (pNearMePanel) ) { + // TODO-RLVa: check this for RlvActions::canShowName() bool fRlvEnable = !gRlvHandler.hasBehaviour(RLV_BHVR_SHOWNAMES); pTabs->enableTabButton(pTabs->getIndexForPanel(pNearMePanel), fRlvEnable); if ( (!fRlvEnable) && (pTabs->getCurrentPanel() == pNearMePanel) ) diff --git a/indra/newview/llfloaterbuy.cpp b/indra/newview/llfloaterbuy.cpp index 5a9cdbba44..fa1667de73 100644 --- a/indra/newview/llfloaterbuy.cpp +++ b/indra/newview/llfloaterbuy.cpp @@ -104,7 +104,10 @@ void LLFloaterBuy::show(const LLSaleInfo& sale_info) // Clean up the lists... floater->reset(); floater->mSaleInfo = sale_info; - floater->mObjectSelection = LLSelectMgr::getInstance()->getEditSelection(); +// [RLVa:KB] - Checked: RLVa-2.0.0 + floater->mObjectSelection = LLSelectMgr::getInstance()->getSelection(); +// [/RLVa:KB] +// floater->mObjectSelection = LLSelectMgr::getInstance()->getEditSelection(); LLSelectNode* node = selection->getFirstRootNode(); if (!node) diff --git a/indra/newview/llfloaterbuycontents.cpp b/indra/newview/llfloaterbuycontents.cpp index b32ac860aa..9d0682d251 100644 --- a/indra/newview/llfloaterbuycontents.cpp +++ b/indra/newview/llfloaterbuycontents.cpp @@ -104,7 +104,10 @@ void LLFloaterBuyContents::show(const LLSaleInfo& sale_info) if (list) list->deleteAllItems(); - floater->mObjectSelection = LLSelectMgr::getInstance()->getEditSelection(); +// [RLVa:KB] - Checked: RLVa-2.0.0 + floater->mObjectSelection = LLSelectMgr::getInstance()->getSelection(); +// [/RLVa:KB] +// floater->mObjectSelection = LLSelectMgr::getInstance()->getEditSelection(); LLUUID owner_id; std::string owner_name; diff --git a/indra/newview/llfloaterimnearbychat.cpp b/indra/newview/llfloaterimnearbychat.cpp index 6dc7efc5f9..983c1721cf 100644 --- a/indra/newview/llfloaterimnearbychat.cpp +++ b/indra/newview/llfloaterimnearbychat.cpp @@ -71,6 +71,7 @@ #include "llautoreplace.h" // [RLVa:KB] - Checked: 2010-02-27 (RLVa-1.2.0b) #include "rlvhandler.h" +#include "rlvactions.h" // [/RLVa:KB] S32 LLFloaterIMNearbyChat::sLastSpecialChatChannel = 0; @@ -876,7 +877,7 @@ void send_chat_from_viewer(std::string utf8_out_text, EChatType type, S32 channe else { // Don't allow chat on a non-public channel if sendchannel restricted (unless the channel is an exception) - if ( (gRlvHandler.hasBehaviour(RLV_BHVR_SENDCHANNEL)) && (!gRlvHandler.isException(RLV_BHVR_SENDCHANNEL, channel)) ) + if (!RlvActions::canSendChannel(channel)) return; // Don't allow chat on debug channel if @sendchat, @redirchat or @rediremote restricted (shows as public chat on viewers) diff --git a/indra/newview/llfloaterimnearbychathandler.cpp b/indra/newview/llfloaterimnearbychathandler.cpp index 552c131f31..bfe543a76a 100644 --- a/indra/newview/llfloaterimnearbychathandler.cpp +++ b/indra/newview/llfloaterimnearbychathandler.cpp @@ -46,8 +46,9 @@ #include "llrootview.h" #include "lllayoutstack.h" -// [RLVa:KB] - Checked: 2010-04-21 (RLVa-1.2.0f) -#include "rlvhandler.h" +// [RLVa:KB] - Checked: RLVa-2.0.0 +#include "rlvactions.h" +#include "rlvcommon.h" // [/RLVa:KB] #include "fsconsoleutils.h" @@ -551,16 +552,16 @@ void LLFloaterIMNearbyChatHandler::processChat(const LLChat& chat_msg, LLChat& tmp_chat = const_cast(chat_msg); // [RLVa:KB] - Checked: 2010-04-20 (RLVa-1.2.0f) | Modified: RLVa-1.2.0f - if (rlv_handler_t::isEnabled()) + if (RlvActions::isRlvEnabled()) { // NOTE-RLVa: we can only filter the *message* here since most everything else will already be part of "args" as well LLChat& tmp_chat = const_cast(chat_msg); - if ( (gRlvHandler.hasBehaviour(RLV_BHVR_SHOWLOC)) && (!tmp_chat.mRlvLocFiltered) && (CHAT_SOURCE_AGENT != tmp_chat.mSourceType) ) + if ( (!RlvActions::canShowLocation()) && (!tmp_chat.mRlvLocFiltered) && (CHAT_SOURCE_AGENT != tmp_chat.mSourceType) ) { RlvUtil::filterLocation(tmp_chat.mText); tmp_chat.mRlvLocFiltered = TRUE; } - if ( (gRlvHandler.hasBehaviour(RLV_BHVR_SHOWNAMES)) && (!tmp_chat.mRlvNamesFiltered) && (CHAT_SOURCE_AGENT != tmp_chat.mSourceType) ) + if ( (!RlvActions::canShowName(RlvActions::SNC_DEFAULT)) && (!tmp_chat.mRlvNamesFiltered) && (CHAT_SOURCE_AGENT != tmp_chat.mSourceType) ) { RlvUtil::filterNames(tmp_chat.mText); tmp_chat.mRlvNamesFiltered = TRUE; @@ -664,8 +665,8 @@ void LLFloaterIMNearbyChatHandler::processChat(const LLChat& chat_msg, LLFirstUse::otherAvatarChatFirst(); // Add sender to the recent people list. -// [RLVa:KB] - Checked: 2012-03-15 (RLVa-1.4.6) | Added: RLVa-1.4.6 - if (!gRlvHandler.hasBehaviour(RLV_BHVR_SHOWNAMES)) +// [RLVa:KB] - Checked: RLVa-2.0.0 + if ( (!RlvActions::isRlvEnabled()) || (RlvActions::canShowName(RlvActions::SNC_DEFAULT, chat_msg.mFromID)) ) LLRecentPeople::instance().add(chat_msg.mFromID); // [/RLVa:KB] // LLRecentPeople::instance().add(chat_msg.mFromID); @@ -784,8 +785,8 @@ void LLFloaterIMNearbyChatHandler::processChat(const LLChat& chat_msg, LLUUID id; id.generate(); chat["id"] = id; -// [RLVa:KB] - Checked: 2010-04-20 (RLVa-1.2.0f) | Added: RLVa-1.2.0f - if (rlv_handler_t::isEnabled()) +// [RLVa:KB] - Checked: RLVa-1.2.0 + if (RlvActions::isRlvEnabled()) chat["show_icon_tooltip"] = !chat_msg.mRlvNamesFiltered; // [/RLVa:KB] std::string r_color_name = "White"; diff --git a/indra/newview/llfloaterinspect.cpp b/indra/newview/llfloaterinspect.cpp index 6ae9f045dc..e9aacd408f 100644 --- a/indra/newview/llfloaterinspect.cpp +++ b/indra/newview/llfloaterinspect.cpp @@ -42,9 +42,10 @@ #include "llviewercontrol.h" #include "llviewerobject.h" #include "lluictrlfactory.h" -// [RLVa:KB] - Checked: 2011-05-22 (RLVa-1.3.1a) -#include "rlvhandler.h" -#include "llagent.h" +// [RLVa:KB] - Checked: RLVa-2.0.1 +#include "rlvactions.h" +#include "rlvcommon.h" +#include "rlvui.h" // [/RLVa:KB] //LLFloaterInspect* LLFloaterInspect::sInstance = NULL; @@ -105,11 +106,13 @@ void LLFloaterInspect::onOpen(const LLSD& key) mObjectSelection = LLSelectMgr::getInstance()->getSelection(); refresh(); } -void LLFloaterInspect::onClickCreatorProfile() + +// [RLVa:KB] - Checked: RLVa-2.0.1 +const LLSelectNode* LLFloaterInspect::getSelectedNode() /*const*/ { if(mObjectList->getAllSelected().size() == 0) { - return; + return NULL; } LLScrollListItem* first_selected =mObjectList->getFirstSelected(); @@ -124,41 +127,29 @@ void LLFloaterInspect::onClickCreatorProfile() return (obj_id == node->getObject()->getID()); } } func(first_selected->getUUID()); - LLSelectNode* node = mObjectSelection->getFirstNode(&func); + return mObjectSelection->getFirstNode(&func); + } + return NULL; +} + +void LLFloaterInspect::onClickCreatorProfile() +{ + const LLSelectNode* node = getSelectedNode(); if(node) { -// LLAvatarActions::showProfile(node->mPermissions->getCreator()); -// [RLVa:KB] - Checked: 2010-08-25 (RLVa-1.2.2a) | Modified: RLVa-1.0.0e + // Only anonymize the creator if they're also the owner or if they're a nearby avie const LLUUID& idCreator = node->mPermissions->getCreator(); - if ( (gRlvHandler.hasBehaviour(RLV_BHVR_SHOWNAMES)) && - ((node->mPermissions->getOwner() == idCreator) || (RlvUtil::isNearbyAgent(idCreator))) ) + if ( (!RlvActions::canShowName(RlvActions::SNC_DEFAULT, idCreator)) && ((node->mPermissions->getOwner() == idCreator) || (RlvUtil::isNearbyAgent(idCreator))) ) { return; } LLAvatarActions::showProfile(idCreator); -// [/RLVa:KB] } - } } void LLFloaterInspect::onClickOwnerProfile() { - if(mObjectList->getAllSelected().size() == 0) return; - LLScrollListItem* first_selected =mObjectList->getFirstSelected(); - - if (first_selected) - { - LLUUID selected_id = first_selected->getUUID(); - struct f : public LLSelectedNodeFunctor - { - LLUUID obj_id; - f(const LLUUID& id) : obj_id(id) {} - virtual bool apply(LLSelectNode* node) - { - return (obj_id == node->getObject()->getID()); - } - } func(selected_id); - LLSelectNode* node = mObjectSelection->getFirstNode(&func); + const LLSelectNode* node = getSelectedNode(); if(node) { if(node->mPermissions->isGroupOwned()) @@ -169,30 +160,108 @@ void LLFloaterInspect::onClickOwnerProfile() else { const LLUUID& owner_id = node->mPermissions->getOwner(); -// [RLVa:KB] - Checked: 2010-08-25 (RLVa-1.2.2a) | Modified: RLVa-1.0.0e - if (gRlvHandler.hasBehaviour(RLV_BHVR_SHOWNAMES)) - return; -// [/RLVa:KB] + if (!RlvActions::canShowName(RlvActions::SNC_DEFAULT, owner_id)) + return; LLAvatarActions::showProfile(owner_id); } } - } } void LLFloaterInspect::onSelectObject() { if(LLFloaterInspect::getSelectedUUID() != LLUUID::null) { -// getChildView("button owner")->setEnabled(true); -// getChildView("button creator")->setEnabled(true); -// [RLVa:KB] - Checked: 2010-08-25 (RLVa-1.2.2a) | Modified: RLVa-1.0.0e - getChildView("button owner")->setEnabled(!gRlvHandler.hasBehaviour(RLV_BHVR_SHOWNAMES)); - // TODO-RLVa: [RLVa-1.2.2] Is it worth checking the selected node just to selectively disable this button? - getChildView("button creator")->setEnabled(true); -// [/RLVa:KB] + if (!RlvActions::isRlvEnabled()) + { + getChildView("button owner")->setEnabled(true); + getChildView("button creator")->setEnabled(true); + } + else + { + const LLSelectNode* node = getSelectedNode(); + const LLUUID& idOwner = (node) ? node->mPermissions->getOwner() : LLUUID::null; + const LLUUID& idCreator = (node) ? node->mPermissions->getCreator() : LLUUID::null; + + // See LLFloaterInspect::onClickCreatorProfile() + getChildView("button owner")->setEnabled( (RlvActions::canShowName(RlvActions::SNC_DEFAULT, idOwner)) || ((node) && (node->mPermissions->isGroupOwned())) ); + // See LLFloaterInspect::onClickOwnerProfile() + getChildView("button creator")->setEnabled( ((idOwner != idCreator) && (!RlvUtil::isNearbyAgent(idCreator))) || (RlvActions::canShowName(RlvActions::SNC_DEFAULT, idCreator)) ); + } } } +// [/RLVa:KB] + +//void LLFloaterInspect::onClickCreatorProfile() +//{ +// if(mObjectList->getAllSelected().size() == 0) +// { +// return; +// } +// LLScrollListItem* first_selected =mObjectList->getFirstSelected(); +// +// if (first_selected) +// { +// struct f : public LLSelectedNodeFunctor +// { +// LLUUID obj_id; +// f(const LLUUID& id) : obj_id(id) {} +// virtual bool apply(LLSelectNode* node) +// { +// return (obj_id == node->getObject()->getID()); +// } +// } func(first_selected->getUUID()); +// LLSelectNode* node = mObjectSelection->getFirstNode(&func); +// if(node) +// { +// LLAvatarActions::showProfile(node->mPermissions->getCreator()); +// } +// } +//} + +//void LLFloaterInspect::onClickOwnerProfile() +//{ +// if(mObjectList->getAllSelected().size() == 0) return; +// LLScrollListItem* first_selected =mObjectList->getFirstSelected(); +// +// if (first_selected) +// { +// LLUUID selected_id = first_selected->getUUID(); +// struct f : public LLSelectedNodeFunctor +// { +// LLUUID obj_id; +// f(const LLUUID& id) : obj_id(id) {} +// virtual bool apply(LLSelectNode* node) +// { +// return (obj_id == node->getObject()->getID()); +// } +// } func(selected_id); +// LLSelectNode* node = mObjectSelection->getFirstNode(&func); +// if(node) +// { +// if(node->mPermissions->isGroupOwned()) +// { +// const LLUUID& idGroup = node->mPermissions->getGroup(); +// LLGroupActions::show(idGroup); +// } +// else +// { +// const LLUUID& owner_id = node->mPermissions->getOwner(); +// LLAvatarActions::showProfile(owner_id); +// } +// +// } +// } +//} + +//void LLFloaterInspect::onSelectObject() +//{ +// if(LLFloaterInspect::getSelectedUUID() != LLUUID::null) +// { +// getChildView("button owner")->setEnabled(true); +// getChildView("button creator")->setEnabled(true); +// } +//} LLUUID LLFloaterInspect::getSelectedUUID() { @@ -278,12 +347,11 @@ void LLFloaterInspect::refresh() // actual name and set a placeholder. if (LLAvatarNameCache::get(idOwner, &av_name)) { -// owner_name = av_name.getCompleteName(); -// [RLVa:KB] - Checked: 2010-11-01 (RLVa-1.2.2a) | Modified: RLVa-1.2.2a - bool fRlvFilterOwner = (gRlvHandler.hasBehaviour(RLV_BHVR_SHOWNAMES)) && (idOwner != gAgent.getID()) && - (!obj->mPermissions->isGroupOwned()); - owner_name = (!fRlvFilterOwner) ? av_name.getCompleteName() : RlvStrings::getAnonym(av_name); +// [RLVa:KB] - Checked: RLVa-2.0.1 + bool fRlvCanShowName = (RlvActions::canShowName(RlvActions::SNC_DEFAULT, idOwner)) || (obj->mPermissions->isGroupOwned()); + owner_name = (fRlvCanShowName) ? av_name.getCompleteName() : RlvStrings::getAnonym(av_name); // [/RLVa:KB] +// owner_name = av_name.getCompleteName(); } else { @@ -298,14 +366,12 @@ void LLFloaterInspect::refresh() if (LLAvatarNameCache::get(idCreator, &av_name)) { -// creator_name = av_name.getCompleteName(); -// [RLVa:KB] - Checked: 2010-11-01 (RLVa-1.2.2a) | Modified: RLVa-1.2.2a +// [RLVa:KB] - Checked: RLVa-2.0.1 const LLUUID& idCreator = obj->mPermissions->getCreator(); - LLAvatarNameCache::get(idCreator, &av_name); - bool fRlvFilterCreator = (gRlvHandler.hasBehaviour(RLV_BHVR_SHOWNAMES)) && (idCreator != gAgent.getID()) && - ( (obj->mPermissions->getOwner() == idCreator) || (RlvUtil::isNearbyAgent(idCreator)) ); - creator_name = (!fRlvFilterCreator) ? av_name.getCompleteName() : RlvStrings::getAnonym(av_name); + bool fRlvCanShowName = (RlvActions::canShowName(RlvActions::SNC_DEFAULT, idCreator)) || ( (obj->mPermissions->getOwner() != idCreator) && (!RlvUtil::isNearbyAgent(idCreator)) ); + creator_name = (fRlvCanShowName) ? av_name.getCompleteName() : RlvStrings::getAnonym(av_name); // [/RLVa:KB] +// creator_name = av_name.getCompleteName(); } else { @@ -316,7 +382,7 @@ void LLFloaterInspect::refresh() } mCreatorNameCacheConnection = LLAvatarNameCache::get(idCreator, boost::bind(&LLFloaterInspect::onGetCreatorNameCallback, this)); } - + row["id"] = obj->getObject()->getID(); row["columns"][0]["column"] = "object_name"; row["columns"][0]["type"] = "text"; diff --git a/indra/newview/llfloaterinspect.h b/indra/newview/llfloaterinspect.h index 44381eac96..7f7f7377f0 100644 --- a/indra/newview/llfloaterinspect.h +++ b/indra/newview/llfloaterinspect.h @@ -36,6 +36,9 @@ class LLObjectSelection; class LLScrollListCtrl; class LLUICtrl; +// [RLVa:KB] - Checked: RLVa-2.0.1 +class LLSelectNode; +// [/RLVa:KB] class LLFloaterInspect : public LLFloater { @@ -61,6 +64,10 @@ protected: void setDirty() { mDirty = TRUE; } bool mDirty; +// [RLVa:KB] - Checked: RLVa-2.0.1 + const LLSelectNode* getSelectedNode() /*const*/; +// [/RLVa:KB] + private: void onGetOwnerNameCallback(); void onGetCreatorNameCallback(); diff --git a/indra/newview/llfloaterpreference.cpp b/indra/newview/llfloaterpreference.cpp index 6beb7b81b5..f57cc63901 100644 --- a/indra/newview/llfloaterpreference.cpp +++ b/indra/newview/llfloaterpreference.cpp @@ -118,6 +118,10 @@ #include "llteleporthistorystorage.h" #include "llproxy.h" #include "llweb.h" +// [RLVa:KB] - Checked: 2010-03-18 (RLVa-1.2.0a) +#include "rlvactions.h" +#include "rlvhandler.h" +// [/RLVa:KB] #include "lllogininstance.h" // to check if logged in yet #include "llsdserialize.h" @@ -148,8 +152,6 @@ #include "llwaterparammanager.h" #include "llwldaycycle.h" #include "llwlparammanager.h" -#include "rlvactions.h" -#include "rlvhandler.h" #include "NACLantispam.h" #include "../llcrashlogger/llcrashlogger.h" @@ -2167,8 +2169,14 @@ void LLFloaterPreferenceGraphicsAdvanced::refreshEnabledState() LLSliderCtrl* terrain_detail = getChild("TerrainDetail"); // can be linked with control var LLTextBox* terrain_text = getChild("TerrainDetailText"); - ctrl_shader_enable->setEnabled(LLFeatureManager::getInstance()->isFeatureAvailable("VertexShaderEnable")); - +// ctrl_shader_enable->setEnabled(LLFeatureManager::getInstance()->isFeatureAvailable("VertexShaderEnable")); +// [RLVa:KB] - Checked: 2010-03-18 (RLVa-1.2.0a) | Modified: RLVa-0.2.0a + // "Basic Shaders" can't be disabled - but can be enabled - under @setenv=n + bool fCtrlShaderEnable = LLFeatureManager::getInstance()->isFeatureAvailable("VertexShaderEnable"); + ctrl_shader_enable->setEnabled( + fCtrlShaderEnable && ((!gRlvHandler.hasBehaviour(RLV_BHVR_SETENV)) || (!gSavedSettings.getBOOL("VertexShaderEnable"))) ); +// [/RLVa:KB] + BOOL shaders = ctrl_shader_enable->get(); if (shaders) { @@ -2189,7 +2197,13 @@ void LLFloaterPreferenceGraphicsAdvanced::refreshEnabledState() // *HACK just checks to see if we can use shaders... // maybe some cards that use shaders, but don't support windlight - ctrl_wind_light->setEnabled(ctrl_shader_enable->getEnabled() && shaders); +// ctrl_wind_light->setEnabled(ctrl_shader_enable->getEnabled() && shaders); +// [RLVa:KB] - Checked: 2010-03-18 (RLVa-1.2.0a) | Modified: RLVa-0.2.0a + // "Atmospheric Shaders" can't be disabled - but can be enabled - under @setenv=n + bool fCtrlWindLightEnable = fCtrlShaderEnable && shaders; + ctrl_wind_light->setEnabled( + fCtrlWindLightEnable && ((!gRlvHandler.hasBehaviour(RLV_BHVR_SETENV)) || (!gSavedSettings.getBOOL("WindLightUseAtmosShaders"))) ); +// [/RLVa:KB] sky->setEnabled(ctrl_wind_light->get() && shaders); sky_text->setEnabled(ctrl_wind_light->get() && shaders); diff --git a/indra/newview/llfloaterproperties.cpp b/indra/newview/llfloaterproperties.cpp index 3ba8bbf2dc..e3a468167f 100644 --- a/indra/newview/llfloaterproperties.cpp +++ b/indra/newview/llfloaterproperties.cpp @@ -59,8 +59,9 @@ #include "lluictrlfactory.h" -// [RLVa:KB] - Checked: 2010-08-25 (RLVa-1.2.1b) -#include "rlvhandler.h" +// [RLVa:KB] - Checked: RLVa-2.0.1 +#include "rlvactions.h" +#include "rlvcommon.h" // [/RLVa:KB] #include "llviewernetwork.h" // For OpenSim export perms #include "llexperiencecache.h" @@ -306,11 +307,10 @@ void LLFloaterProperties::refreshFromItem(LLInventoryItem* item) getChildView("BtnCreator")->setEnabled(TRUE); getChildView("LabelCreatorTitle")->setEnabled(TRUE); getChildView("LabelCreatorName")->setEnabled(TRUE); -// [RLVa:KB] - Checked: 2010-08-25 (RLVa-1.2.1b) | Modified: RLVa-1.0.0e +// [RLVa:KB] - Checked: RLVa-2.0.1 // If the object creator matches the object owner we need to anonymize the creator field as well - if ( (gRlvHandler.hasBehaviour(RLV_BHVR_SHOWNAMES)) && - ( ((perm.isOwned()) && (!perm.isGroupOwned()) && (perm.getOwner() == item->getCreatorUUID()) ) || - (RlvUtil::isNearbyAgent(item->getCreatorUUID())) ) ) + if ( (!RlvActions::canShowName(RlvActions::SNC_DEFAULT, item->getCreatorUUID())) && + ( ((perm.isOwned()) && (!perm.isGroupOwned()) && (perm.getOwner() == item->getCreatorUUID()) ) || (RlvUtil::isNearbyAgent(item->getCreatorUUID())) ) ) { childSetEnabled("BtnCreator", FALSE); name = RlvStrings::getAnonym(name); @@ -331,6 +331,9 @@ void LLFloaterProperties::refreshFromItem(LLInventoryItem* item) //////////////// if(perm.isOwned()) { +// [RLVa:KB] - Checked: RVLa-2.0.1 + bool fRlvCanShowOwner = true; +// [/RLVa:KB] std::string name; if (perm.isGroupOwned()) { @@ -339,14 +342,18 @@ void LLFloaterProperties::refreshFromItem(LLInventoryItem* item) else { gCacheName->getFullName(perm.getOwner(), name); -// [RLVa:KB] - Checked: 2010-08-25 (RLVa-1.2.1b) | Modified: RLVa-1.0.0e - if (gRlvHandler.hasBehaviour(RLV_BHVR_SHOWNAMES)) - name = RlvStrings::getAnonym(name); +// [RLVa:KB] - Checked: RLVa-2.0.1 + if (RlvActions::isRlvEnabled()) + { + fRlvCanShowOwner = RlvActions::canShowName(RlvActions::SNC_DEFAULT, perm.getOwner()); + if (!fRlvCanShowOwner) + name = RlvStrings::getAnonym(name); + } // [/RLVa:KB] } // getChildView("BtnOwner")->setEnabled(TRUE); -// [RLVa:KB] - Checked: 2010-08-25 (RLVa-1.2.1b) | Added: RLVa-1.0.0e - getChildView("BtnOwner")->setEnabled(!gRlvHandler.hasBehaviour(RLV_BHVR_SHOWNAMES)); +// [RLVa:KB] - Checked: RLVa-2.0.1 + getChildView("BtnOwner")->setEnabled(fRlvCanShowOwner); // [/RLVa:KB] getChildView("LabelOwnerTitle")->setEnabled(TRUE); getChildView("LabelOwnerName")->setEnabled(TRUE); @@ -616,12 +623,12 @@ void LLFloaterProperties::onClickCreator() if(!item) return; if(!item->getCreatorUUID().isNull()) { -// [RLVa:KB] - Checked: 2010-08-25 (RLVa-1.2.1b) | Added: RLVa-1.2.1b - if (gRlvHandler.hasBehaviour(RLV_BHVR_SHOWNAMES)) +// [RLVa:KB] - Checked: RLVa-1.2.1 + const LLUUID& idCreator = item->getCreatorUUID(); + if ( (RlvActions::isRlvEnabled()) && (!RlvActions::canShowName(RlvActions::SNC_DEFAULT, idCreator)) ) { const LLPermissions& perm = item->getPermissions(); - if ( ((perm.isOwned()) && (!perm.isGroupOwned()) && (perm.getOwner() == item->getCreatorUUID()) ) || - (RlvUtil::isNearbyAgent(item->getCreatorUUID())) ) + if ( ((perm.isOwned()) && (!perm.isGroupOwned()) && (perm.getOwner() == idCreator) ) || (RlvUtil::isNearbyAgent(idCreator)) ) { return; } @@ -642,8 +649,8 @@ void LLFloaterProperties::onClickOwner() } else { -// [RLVa:KB] - Checked: 2010-08-25 (RLVa-1.2.1b) | Modified: RLVa-1.0.0e - if (gRlvHandler.hasBehaviour(RLV_BHVR_SHOWNAMES)) +// [RLVa:KB] - Checked: RLVa-1.0.0 + if ( (RlvActions::isRlvEnabled()) && (!RlvActions::canShowName(RlvActions::SNC_DEFAULT, item->getPermissions().getOwner())) ) return; // [/RLVa:KB] LLAvatarActions::showProfile(item->getPermissions().getOwner()); diff --git a/indra/newview/llgesturemgr.cpp b/indra/newview/llgesturemgr.cpp index 29e2505237..07bb73015d 100644 --- a/indra/newview/llgesturemgr.cpp +++ b/indra/newview/llgesturemgr.cpp @@ -61,6 +61,10 @@ #include "chatbar_as_cmdline.h" // For FIRE-1624 +// [RLVa:KB] - Checked: RLVa-2.0.0 +#include "rlvactions.h" +// [/RLVa:KB] + // Longest time, in seconds, to wait for all animations to stop playing const F32 MAX_WAIT_ANIM_SECS = 60.f; @@ -532,6 +536,11 @@ void LLGestureMgr::playGesture(LLMultiGesture* gesture) { if (!gesture) return; +// [RLVa:KB] - Checked: RLVa-2.0.0 | Handles: @sendgesture + if (!RlvActions::canPlayGestures()) + return; +// [/RLVa:KB] + // Reset gesture to first step gesture->mCurrentStep = 0; diff --git a/indra/newview/llgiveinventory.cpp b/indra/newview/llgiveinventory.cpp index b282f6c29c..240039a1ff 100644 --- a/indra/newview/llgiveinventory.cpp +++ b/indra/newview/llgiveinventory.cpp @@ -46,9 +46,10 @@ #include "llrecentpeople.h" #include "llviewerobjectlist.h" #include "llvoavatarself.h" -// [RLVa:KB] - Checked: 2010-03-04 (RLVa-1.2.2a) +// [RLVa:KB] - Checked: RLVa-1.2.2 #include "llavatarnamecache.h" -#include "rlvhandler.h" +#include "rlvactions.h" +#include "rlvcommon.h" #include "rlvui.h" // [/RLVa:KB] #include "llworld.h" // Aurora Sim @@ -326,9 +327,8 @@ void LLGiveInventory::logInventoryOffer(const LLUUID& to_agent, const LLUUID &im { gIMMgr->addSystemMessage(im_session_id, "inventory_item_offered", args); } -// [RLVa:KB] - Checked: 2010-05-26 (RLVa-1.2.2a) | Modified: RLVa-1.2.0h - else if ( (gRlvHandler.hasBehaviour(RLV_BHVR_SHOWNAMES)) && (RlvUtil::isNearbyAgent(to_agent)) && - (!RlvUIEnabler::hasOpenProfile(to_agent)) ) +// [RLVa:KB] - Checked: RLVa-1.2.0 + else if ( (RlvActions::isRlvEnabled()) && (!RlvActions::canShowName(RlvActions::SNC_DEFAULT, to_agent)) && (RlvUtil::isNearbyAgent(to_agent)) && (!RlvUIEnabler::hasOpenProfile(to_agent)) ) { // Log to chat history if the user didn't drop on an IM session or a profile to avoid revealing the name of the recipient std::string strMsgName = "inventory_item_offered-im"; LLSD args; LLAvatarName avName; @@ -462,10 +462,10 @@ void LLGiveInventory::commitGiveInventoryItem(const LLUUID& to_agent, // add buddy to recent people list // LLRecentPeople::instance().add(to_agent); -// [RLVa:KB] - Checked: 2010-04-21 (RLVa-1.2.2a) | Added: RLVa-1.2.0f +// [RLVa:KB] - Checked: RLVa-2.0.0 // Block the recent activity update if this was an in-world drop on an avatar (as opposed to a drop on an IM session or on a profile) - if ( (!gRlvHandler.hasBehaviour(RLV_BHVR_SHOWNAMES)) || (im_session_id.notNull()) || (!RlvUtil::isNearbyAgent(to_agent)) || - (RlvUIEnabler::hasOpenProfile(to_agent)) ) + if ( (!RlvActions::isRlvEnabled()) || + (RlvActions::canShowName(RlvActions::SNC_DEFAULT, to_agent)) || (im_session_id.notNull()) || (!RlvUtil::isNearbyAgent(to_agent)) || (RlvUIEnabler::hasOpenProfile(to_agent)) ) { LLRecentPeople::instance().add(to_agent); } @@ -536,10 +536,10 @@ bool LLGiveInventory::commitGiveInventoryCategory(const LLUUID& to_agent, // add buddy to recent people list // LLRecentPeople::instance().add(to_agent); -// [RLVa:KB] - Checked: 2010-04-20 (RLVa-1.2.2a) | Added: RLVa-1.2.0f +// [RLVa:KB] - Checked: RLVa-2.0.0 // Block the recent activity update if this was an in-world drop on an avatar (as opposed to a drop on an IM session or on a profile) - if ( (!gRlvHandler.hasBehaviour(RLV_BHVR_SHOWNAMES)) || (im_session_id.notNull()) || (!RlvUtil::isNearbyAgent(to_agent)) || - (RlvUIEnabler::hasOpenProfile(to_agent)) ) + if ( (!RlvActions::isRlvEnabled()) || + (RlvActions::canShowName(RlvActions::SNC_DEFAULT, to_agent)) || (im_session_id.notNull()) || (!RlvUtil::isNearbyAgent(to_agent)) || (RlvUIEnabler::hasOpenProfile(to_agent)) ) { LLRecentPeople::instance().add(to_agent); } diff --git a/indra/newview/llglsandbox.cpp b/indra/newview/llglsandbox.cpp index 8a6052c153..822016942c 100644 --- a/indra/newview/llglsandbox.cpp +++ b/indra/newview/llglsandbox.cpp @@ -64,7 +64,9 @@ #include "llspatialpartition.h" #include "llviewershadermgr.h" // [RLVa:KB] - Checked: 2010-04-11 (RLVa-1.2.0e) +#include "rlvactions.h" #include "rlvhandler.h" +#include "rlvhelper.h" // [/RLVa:KB] // Height of the yellow selection highlight posts for land @@ -167,13 +169,15 @@ void LLToolSelectRect::handleRectangleSelection(S32 x, S32 y, MASK mask) // [RLVa:KB] - Checked: 2010-04-11 (RLVa-1.2.0e) | Modified: RLVa-1.0.0g if (gRlvHandler.hasBehaviour(RLV_BHVR_FARTOUCH)) { + static RlvCachedBehaviourModifier s_nFartouchDist(RLV_MODIFIER_FARTOUCHDIST); + // We'll allow drag selection under fartouch, but only within the fartouch range // (just copy/paste the code above us to make that work, thank you Lindens!) LLVector3 relative_av_pos = av_pos; relative_av_pos -= LLViewerCamera::getInstance()->getOrigin(); - F32 new_far = relative_av_pos * LLViewerCamera::getInstance()->getAtAxis() + 1.5f; - F32 new_near = relative_av_pos * LLViewerCamera::getInstance()->getAtAxis() - 1.5f; + F32 new_far = relative_av_pos * LLViewerCamera::getInstance()->getAtAxis() + s_nFartouchDist; + F32 new_near = relative_av_pos * LLViewerCamera::getInstance()->getAtAxis() - s_nFartouchDist; new_near = llmax(new_near, 0.1f); @@ -182,7 +186,7 @@ void LLToolSelectRect::handleRectangleSelection(S32 x, S32 y, MASK mask) // Usurp these two limit_select_distance = TRUE; - select_dist_squared = 1.5f * 1.5f; + select_dist_squared = s_nFartouchDist * s_nFartouchDist; } // [/RLVa:KB] LLViewerCamera::getInstance()->setPerspective(FOR_SELECTION, @@ -269,7 +273,7 @@ void LLToolSelectRect::handleRectangleSelection(S32 x, S32 y, MASK mask) } // [RLVa:KB] - Checked: 2010-11-29 (RLVa-1.3.0c) | Added: RLVa-1.3.0c - if ( (rlv_handler_t::isEnabled()) && (!gRlvHandler.canEdit(vobjp)) ) + if ( (RlvActions::isRlvEnabled()) && (!RlvActions::canEdit(vobjp)) ) { continue; } diff --git a/indra/newview/llgroupactions.cpp b/indra/newview/llgroupactions.cpp index 56a7938ab3..dbe14c9616 100644 --- a/indra/newview/llgroupactions.cpp +++ b/indra/newview/llgroupactions.cpp @@ -41,6 +41,12 @@ #include "llnotificationsutil.h" #include "llstatusbar.h" // can_afford_transaction() #include "groupchatlistener.h" +// [RLVa:KB] - Checked: 2011-03-28 (RLVa-1.3.0) +#include "llslurl.h" +#include "rlvactions.h" +#include "rlvcommon.h" +#include "rlvhandler.h" +// [/RLVa:KB] // Firestorm includes #include "exogroupmutelist.h" @@ -51,10 +57,6 @@ #include "fsfloaterim.h" #include "llpanelgroup.h" #include "llresmgr.h" -#include "llslurl.h" -#include "rlvactions.h" -#include "rlvcommon.h" -#include "rlvhandler.h" // // Globals @@ -235,7 +237,7 @@ void LLGroupActions::startCall(const LLUUID& group_id) } // [RLVa:KB] - Checked: 2013-05-09 (RLVa-1.4.9) - if ( (!RlvActions::canStartIM(group_id)) && (!RlvActions::hasOpenGroupSession(group_id)) ) + if (!RlvActions::canStartIM(group_id)) { make_ui_sound("UISndInvalidOp"); RlvUtil::notifyBlocked(RLV_STRING_BLOCKED_STARTIM, LLSD().with("RECIPIENT", LLSLURL("group", group_id, "about").getSLURLString())); @@ -614,7 +616,7 @@ LLUUID LLGroupActions::startIM(const LLUUID& group_id) if (group_id.isNull()) return LLUUID::null; // [RLVa:KB] - Checked: 2013-05-09 (RLVa-1.4.9) - if ( (!RlvActions::canStartIM(group_id)) && (!RlvActions::hasOpenGroupSession(group_id)) ) + if (!RlvActions::canStartIM(group_id)) { make_ui_sound("UISndInvalidOp"); RlvUtil::notifyBlocked(RLV_STRING_BLOCKED_STARTIM, LLSD().with("RECIPIENT", LLSLURL("group", group_id, "about").getSLURLString())); @@ -834,7 +836,10 @@ void LLGroupActions::ejectFromGroup(const LLUUID& idGroup, const LLUUID& idAgent LLSD payload; payload["avatar_id"] = idAgent; payload["group_id"] = idGroup; - std::string fullname = LLSLURL("agent", idAgent, "inspect").getSLURLString(); + // Show complete name in eject dialog + //std::string fullname = LLSLURL("agent", idAgent, "inspect").getSLURLString(); + std::string fullname = LLSLURL("agent", idAgent, "completename").getSLURLString(); + // args["AVATAR_NAME"] = fullname; LLNotificationsUtil::add("EjectGroupMemberWarning", args, diff --git a/indra/newview/llhudtext.cpp b/indra/newview/llhudtext.cpp index 8f325043e3..ad4dc3a1de 100644 --- a/indra/newview/llhudtext.cpp +++ b/indra/newview/llhudtext.cpp @@ -46,7 +46,8 @@ #include "llstatusbar.h" #include "llmenugl.h" #include "pipeline.h" -// [RLVa:KB] - Checked: 2010-03-27 (RLVa-1.4.0a) +// [RLVa:KB] - Checked: RLVa-1.4.0 +#include "rlvactions.h" #include "rlvhandler.h" // [/RLVa:KB] #include @@ -260,14 +261,14 @@ void LLHUDText::setString(const std::string &text_utf8) // addLine(text_utf8, mColor); // [RLVa:KB] - Checked: 2010-03-02 (RLVa-1.4.0a) | Modified: RLVa-1.0.0f // NOTE: setString() is called for debug and map beacons as well - if (rlv_handler_t::isEnabled()) + if (RlvActions::isRlvEnabled()) { std::string text(text_utf8); if (gRlvHandler.canShowHoverText(mSourceObject)) { - if (gRlvHandler.hasBehaviour(RLV_BHVR_SHOWLOC)) + if (!RlvActions::canShowLocation()) RlvUtil::filterLocation(text); - if (gRlvHandler.hasBehaviour(RLV_BHVR_SHOWNAMES)) + if (!RlvActions::canShowName(RlvActions::SNC_DEFAULT)) RlvUtil::filterNames(text); } else diff --git a/indra/newview/llinspectobject.cpp b/indra/newview/llinspectobject.cpp index a2d3a15b5b..30275d44a4 100644 --- a/indra/newview/llinspectobject.cpp +++ b/indra/newview/llinspectobject.cpp @@ -39,6 +39,7 @@ #include "llviewermediafocus.h" #include "llviewerobjectlist.h" // to select the requested object // [RLVa:KB] - Checked: 2010-02-27 (RLVa-1.2.0c) +#include "rlvactions.h" #include "rlvhandler.h" #include "lltoolpie.h" // [/RLVa:KB] @@ -401,7 +402,7 @@ void LLInspectObject::updateSitLabel(LLSelectNode* nodep) if (rlv_handler_t::isEnabled()) { const LLPickInfo& pick = LLToolPie::getInstance()->getPick(); - sit_btn->setEnabled( (pick.mObjectID.notNull()) && (gRlvHandler.canSit(pick.getObject(), pick.mObjectOffset)) ); + sit_btn->setEnabled( (pick.mObjectID.notNull()) && (RlvActions::canSit(pick.getObject(), pick.mObjectOffset)) ); } // [/RLVa:KB] } @@ -501,12 +502,10 @@ void LLInspectObject::updateCreator(LLSelectNode* nodep) LLUUID creator_id = nodep->mPermissions->getCreator(); // std::string creator_url = // LLSLURL("agent", creator_id, "about").getSLURLString(); -// [RLVa:KB] - Checked: 2010-11-02 (RLVa-1.2.2a) | Modified: RLVa-1.2.2a +// [RLVa:KB] - Checked: RLVa-1.2.2 // Only anonymize the creator if they're also the owner or if they're a nearby avie - bool fRlvHideCreator = (gRlvHandler.hasBehaviour(RLV_BHVR_SHOWNAMES)) && - ((nodep->mPermissions->getOwner() == creator_id) || (RlvUtil::isNearbyAgent(creator_id))); - std::string creator_url = - LLSLURL("agent", creator_id, (!fRlvHideCreator) ? "about" : "rlvanonym").getSLURLString(); + bool fRlvHideCreator = (!RlvActions::canShowName(RlvActions::SNC_DEFAULT, creator_id)) && ((nodep->mPermissions->getOwner() == creator_id) || (RlvUtil::isNearbyAgent(creator_id))); + const std::string creator_url = LLSLURL("agent", creator_id, (!fRlvHideCreator) ? "about" : "rlvanonym").getSLURLString(); // [/RLVa:KB] args["[CREATOR]"] = creator_url; @@ -523,8 +522,8 @@ void LLInspectObject::updateCreator(LLSelectNode* nodep) { owner_id = nodep->mPermissions->getOwner(); // owner_url = LLSLURL("agent", owner_id, "about").getSLURLString(); -// [RLVa:KB] - Checked: 2010-11-02 (RLVa-1.2.2a) | Modified: RLVa-1.2.2a - bool fRlvHideOwner = (gRlvHandler.hasBehaviour(RLV_BHVR_SHOWNAMES)); +// [RLVa:KB] - Checked: RLVa-1.2.2 + bool fRlvHideOwner = (!RlvActions::canShowName(RlvActions::SNC_DEFAULT, owner_id)); owner_url = LLSLURL("agent", owner_id, (!fRlvHideOwner) ? "about" : "rlvanonym").getSLURLString(); // [/RLVa:KB] } diff --git a/indra/newview/llinventoryfilter.cpp b/indra/newview/llinventoryfilter.cpp index d6c283b3df..77be2a41d8 100644 --- a/indra/newview/llinventoryfilter.cpp +++ b/indra/newview/llinventoryfilter.cpp @@ -1050,17 +1050,22 @@ void LLInventoryFilter::setFilterWorn(BOOL worn) // // FIRE-19340: search inventory by transferable permission -void LLInventoryFilter::setFilterTransferable(BOOL transferable) -{ - setModified(); - if (transferable) - { - mFilterOps.mFilterTypes |= FILTERTYPE_TRANSFERABLE; - } - else - { - mFilterOps.mFilterTypes &= ~FILTERTYPE_TRANSFERABLE; - } +void LLInventoryFilter::setFilterTransferable(BOOL transferable) +{ + BOOL current = (mFilterOps.mFilterTypes & FILTERTYPE_TRANSFERABLE) != 0; + + if (current != transferable) + { + setModified(); + if (transferable) + { + mFilterOps.mFilterTypes |= FILTERTYPE_TRANSFERABLE; + } + else + { + mFilterOps.mFilterTypes &= ~FILTERTYPE_TRANSFERABLE; + } + } } // diff --git a/indra/newview/llnetmap.cpp b/indra/newview/llnetmap.cpp index d684e534ea..c9daeca3bc 100644 --- a/indra/newview/llnetmap.cpp +++ b/indra/newview/llnetmap.cpp @@ -74,8 +74,9 @@ #include "llviewerwindow.h" #include "llworld.h" #include "llworldmapview.h" // shared draw code -// [RLVa:KB] - Checked: 2010-04-19 (RLVa-1.2.0f) -#include "rlvhandler.h" +// [RLVa:KB] - Checked: RLVa-2.0.1 +#include "rlvactions.h" +#include "rlvcommon.h" // [/RLVa:KB] #include "llmutelist.h" #include "lfsimfeaturehandler.h" @@ -677,7 +678,7 @@ void LLNetMap::draw() // [RLVa:KB] - Checked: 2010-04-19 (RLVa-1.2.0f) | Modified: RLVa-1.2.0f | FS-Specific LLWorldMapView::drawAvatar( pos_map.mV[VX], pos_map.mV[VY], - ((!gRlvHandler.hasBehaviour(RLV_BHVR_SHOWNAMES)) ? color : map_avatar_color.get()), + (RlvActions::canShowName(RlvActions::SNC_DEFAULT, uuid)) ? color : map_avatar_color.get(), pos_map.mV[VZ], mDotRadius, unknown_relative_z); // [/RLVa:KB] @@ -995,26 +996,17 @@ BOOL LLNetMap::handleToolTip( S32 x, S32 y, MASK mask ) // If the cursor is near an avatar on the minimap, a mini-inspector will be // shown for the avatar, instead of the normal map tooltip. // if (handleToolTipAgent(mClosestAgentToCursor)) -// [RLVa:KB] - Checked: 2010-10-31 (RLVa-1.2.2a) | Modified: RLVa-1.2.2a - if ( (!gRlvHandler.hasBehaviour(RLV_BHVR_SHOWNAMES)) && (handleToolTipAgent(mClosestAgentToCursor)) ) +// [RLVa:KB] - Checked: RLVa-1.2.2 + bool fRlvCanShowName = (mClosestAgentToCursor.notNull()) && (RlvActions::canShowName(RlvActions::SNC_DEFAULT, mClosestAgentToCursor)); + if ( (fRlvCanShowName) && (handleToolTipAgent(mClosestAgentToCursor)) ) // [/RLVa:KB] { return TRUE; } -// [RLVa:KB] - Checked: 2010-10-31 (RLVa-1.2.2a) | Modified: RLVa-1.2.2a - LLStringUtil::format_map_t args; - - LLAvatarName avName; - if ( (gRlvHandler.hasBehaviour(RLV_BHVR_SHOWNAMES)) && - (mClosestAgentToCursor.notNull()) && (LLAvatarNameCache::get(mClosestAgentToCursor, &avName)) ) - { - args["[AGENT]"] = RlvStrings::getAnonym(avName) + "\n"; - } - else - { - args["[AGENT]"] = ""; - } +// [RLVa:KB] - Checked: RLVa-1.2.2 + LLStringUtil::format_map_t args; LLAvatarName avName; + args["[AGENT]"] = ( (!fRlvCanShowName) && (mClosestAgentToCursor.notNull()) && (LLAvatarNameCache::get(mClosestAgentToCursor, &avName)) ) ? RlvStrings::getAnonym(avName) + "\n" : ""; // [/RLVa:KB] LLRect sticky_rect; @@ -1029,8 +1021,8 @@ BOOL LLNetMap::handleToolTip( S32 x, S32 y, MASK mask ) sticky_rect.mTop = sticky_rect.mBottom + 2 * SLOP; // region_name = region->getName(); -// [RLVa:KB] - Checked: 2010-10-19 (RLVa-1.2.2b) | Modified: RLVa-1.2.2b - region_name = ((!gRlvHandler.hasBehaviour(RLV_BHVR_SHOWLOC)) ? region->getName() : RlvStrings::getString(RLV_STRING_HIDDEN_REGION)); +// [RLVa:KB] - Checked: RLVa-1.2.2 + region_name = (RlvActions::canShowLocation()) ? region->getName() : RlvStrings::getString(RLV_STRING_HIDDEN_REGION); // [/RLVa:KB] // Synchronize tooltips throughout instances //if (!region_name.empty()) @@ -1553,7 +1545,7 @@ BOOL LLNetMap::handleRightMouseDown(S32 x, S32 y, MASK mask) mPopupMenu->setItemVisible("More Options", mClosestAgentsToCursor.size() == 1); mPopupMenu->setItemVisible("View Profile", mClosestAgentsToCursor.size() == 1); - bool can_show_names = !gRlvHandler.hasBehaviour(RLV_BHVR_SHOWNAMES); + bool can_show_names = !RlvActions::hasBehaviour(RLV_BHVR_SHOWNAMES); mPopupMenu->setItemEnabled("Add to Set Multiple", can_show_names); mPopupMenu->setItemEnabled("More Options", can_show_names); mPopupMenu->setItemEnabled("View Profile", can_show_names); @@ -1601,8 +1593,8 @@ BOOL LLNetMap::handleRightMouseDown(S32 x, S32 y, MASK mask) mPopupMenu->setItemVisible("MarkAvatar", mClosestAgentToCursor.notNull()); mPopupMenu->setItemVisible("Start Tracking", mClosestAgentToCursor.notNull()); mPopupMenu->setItemVisible("Profile Separator", (mClosestAgentsToCursor.size() >= 1 || mClosestAgentToCursor.notNull())); - mPopupMenu->setItemEnabled("Place Profile", !gRlvHandler.hasBehaviour(RLV_BHVR_SHOWLOC)); - mPopupMenu->setItemEnabled("World Map", !gRlvHandler.hasBehaviour(RLV_BHVR_SHOWWORLDMAP)); + mPopupMenu->setItemEnabled("Place Profile", RlvActions::canShowLocation()); + mPopupMenu->setItemEnabled("World Map", !RlvActions::hasBehaviour(RLV_BHVR_SHOWWORLDMAP)); // [/SL:KB] mPopupMenu->buildDrawLabels(); @@ -1960,7 +1952,7 @@ bool LLNetMap::canMap() bool LLNetMap::canShare() { - return (!gRlvHandler.hasBehaviour(RLV_BHVR_SHOWINV)); + return (!RlvActions::hasBehaviour(RLV_BHVR_SHOWINV)); } bool LLNetMap::canOfferTeleport() diff --git a/indra/newview/llnotificationalerthandler.cpp b/indra/newview/llnotificationalerthandler.cpp index 9d2810cb37..1058c3836c 100644 --- a/indra/newview/llnotificationalerthandler.cpp +++ b/indra/newview/llnotificationalerthandler.cpp @@ -97,7 +97,7 @@ bool LLAlertHandler::processNotification(const LLNotificationPtr& notification) // - LLHandlerUtil::logToIMP2P() below will still be called with to_file_only == false // - LLHandlerUtil::logToIM() will eventually be called as a result and without an open IM session it will log the // same message as it would for an open session whereas to_file_only == true would take a different code path - if ( (RlvActions::hasOpenP2PSession(from_id)) || (RlvActions::canStartIM(from_id)) ) + if (RlvActions::canStartIM(from_id)) { // [/RLVa:KB] // firstly create session... diff --git a/indra/newview/llnotificationofferhandler.cpp b/indra/newview/llnotificationofferhandler.cpp index 8caefb111c..80dada39cb 100644 --- a/indra/newview/llnotificationofferhandler.cpp +++ b/indra/newview/llnotificationofferhandler.cpp @@ -119,7 +119,7 @@ bool LLOfferHandler::processNotification(const LLNotificationPtr& notification) // [RLVa:KB] - Checked: 2013-05-09 (RLVa-1.4.9) // Don't spawn an IM session for non-chat related events - if ( (RlvActions::hasOpenP2PSession(from_id)) || (RlvActions::canStartIM(from_id)) ) + if (RlvActions::canStartIM(from_id)) { // [/RLVa:KB] LLHandlerUtil::spawnIMSession(name, from_id); diff --git a/indra/newview/llpanelexperiencelisteditor.cpp b/indra/newview/llpanelexperiencelisteditor.cpp index 254b959259..3a921a7e35 100644 --- a/indra/newview/llpanelexperiencelisteditor.cpp +++ b/indra/newview/llpanelexperiencelisteditor.cpp @@ -95,8 +95,8 @@ void LLPanelExperienceListEditor::setExperienceIds( const LLSD& experience_ids ) { mExperienceIds.clear(); // [SL:KB] - Because GCC likes to be special -// ...and Clang doesn't (argh!) -#if LL_GNUC +// ...and Clang does too +#if LL_GNUC || LL_CLANG std::transform(experience_ids.beginArray(), experience_ids.endArray(), std::inserter(mExperienceIds, mExperienceIds.end()), [](const LLSD& sd) { return sd.asUUID(); }); #else mExperienceIds.insert(experience_ids.beginArray(), experience_ids.endArray()); diff --git a/indra/newview/llpanelgrouproles.cpp b/indra/newview/llpanelgrouproles.cpp index 2337268cbd..48403afd8a 100644 --- a/indra/newview/llpanelgrouproles.cpp +++ b/indra/newview/llpanelgrouproles.cpp @@ -1199,8 +1199,11 @@ void LLPanelGroupMembersSubTab::confirmEjectMembers() if (selection_count == 1) { LLSD args; - std::string fullname; - gCacheName->getFullName(mMembersList->getValue(), fullname); + // FIRE-19529: Group eject dialog doesn't show avatar name + //std::string fullname; + //gCacheName->getFullName(mMembersList->getValue(), fullname); + std::string fullname = LLSLURL("agent", mMembersList->getValue().asUUID(), "completename").getSLURLString(); + // args["AVATAR_NAME"] = fullname; LLSD payload; LLNotificationsUtil::add("EjectGroupMemberWarning", diff --git a/indra/newview/llpanelobjectinventory.cpp b/indra/newview/llpanelobjectinventory.cpp index 2e01d84399..5740fcef62 100644 --- a/indra/newview/llpanelobjectinventory.cpp +++ b/indra/newview/llpanelobjectinventory.cpp @@ -772,6 +772,18 @@ void LLTaskInvFVBridge::buildContextMenu(LLMenuGL& menu, U32 flags) // [/RLVa:KB] } items.push_back(std::string("Task Properties")); +// [RLVa:KB] - Checked: 2010-09-28 (RLVa-1.2.1f) | Added: RLVa-1.2.1f + items.push_back(std::string("Task Rename")); + if ( (!isItemRenameable()) || ((flags & FIRST_SELECTED_ITEM) == 0) ) + { + disabled_items.push_back(std::string("Task Rename")); + } + items.push_back(std::string("Task Remove")); + if (!isItemRemovable()) + { + disabled_items.push_back(std::string("Task Remove")); + } +// [/RLVa:KB] // if(isItemRenameable()) // { // items.push_back(std::string("Task Rename")); @@ -784,18 +796,6 @@ void LLTaskInvFVBridge::buildContextMenu(LLMenuGL& menu, U32 flags) // { // items.push_back(std::string("Task Remove")); // } -// [RLVa:KB] - Checked: 2010-09-28 (RLVa-1.2.1f) | Added: RLVa-1.2.1f - items.push_back(std::string("Task Rename")); - items.push_back(std::string("Task Remove")); - if (!isItemRenameable() || (flags & FIRST_SELECTED_ITEM) == 0) - { - disabled_items.push_back(std::string("Task Rename")); - } - if (!isItemRemovable()) - { - disabled_items.push_back(std::string("Task Remove")); - } -// [/RLVa:KB] hide_context_entries(menu, items, disabled_items); } @@ -1294,6 +1294,7 @@ void LLTaskNotecardBridge::openItem() { return; } + // [RLVa:KB] - Checked: 2010-03-27 (RLVa-1.2.0b) | Modified: RLVa-1.2.0b if ( (rlv_handler_t::isEnabled()) && (gRlvAttachmentLocks.isLockedAttachment(object->getRootEdit())) ) { diff --git a/indra/newview/llpanelpeople.cpp b/indra/newview/llpanelpeople.cpp index 353c2f9d4e..21471cb864 100644 --- a/indra/newview/llpanelpeople.cpp +++ b/indra/newview/llpanelpeople.cpp @@ -75,6 +75,10 @@ #include "llagentui.h" #include "llslurl.h" #include "llevents.h" // for LLEventPumps +// [RLVa:KB] - Checked: RLVa-1.2.2 +#include "rlvactions.h" +// [/RLVa:KB] + // Firestorm includes #include "fscommon.h" @@ -82,7 +86,6 @@ #include "lggcontactsets.h" #include "llcombobox.h" #include "lllayoutstack.h" -#include "rlvhandler.h" #include @@ -693,7 +696,7 @@ BOOL LLPanelPeople::postBuild() //mNearbyList->setShowIcons("NearbyListShowIcons"); //mNearbyList->setShowCompleteName(!gSavedSettings.getBOOL("NearbyListHideUsernames")); // Firestorm radar -// [RLVa:KB] - Checked: 2010-04-05 (RLVa-1.2.2a) | Added: RLVa-1.2.0d +// [RLVa:KB] - Checked: RLVa-1.2.0 // Externalized to FSRadar //mNearbyList->setRlvCheckShowNames(true); // [/RLVa:KB] @@ -1010,7 +1013,7 @@ void LLPanelPeople::updateFacebookList(bool visible) void LLPanelPeople::updateButtons() { std::string cur_tab = getActiveTabName(); -// [RLVa:KB] - Checked: 2013-05-06 (RLVa-1.4.9) +// [RLVa:KB] - Checked: RLVa-1.4.9 bool nearby_tab_active = (cur_tab == NEARBY_TAB_NAME); // [/RLVa:KB] bool friends_tab_active = (cur_tab == FRIENDS_TAB_NAME); @@ -1060,7 +1063,7 @@ void LLPanelPeople::updateButtons() //if (cur_panel->hasChild("add_friend_btn", TRUE)) // cur_panel->getChildView("add_friend_btn")->setEnabled(item_selected && !is_friend && !is_self); if (!nearby_tab_active && cur_panel->hasChild("add_friend_btn", TRUE)) - cur_panel->getChildView("add_friend_btn")->setEnabled(item_selected && !is_friend && !is_self && !gRlvHandler.hasBehaviour(RLV_BHVR_SHOWNAMES)); + cur_panel->getChildView("add_friend_btn")->setEnabled(item_selected && !is_friend && !is_self && RlvActions::canShowName(RlvActions::SNC_DEFAULT, selected_id)); // RLVa check if (friends_tab_active) @@ -1077,6 +1080,16 @@ void LLPanelPeople::updateButtons() } } } + +// [RLVa:KB] - Checked: RLVa-1.2.0 + if ( (nearby_tab_active) && (RlvActions::isRlvEnabled()) && (!RlvActions::canShowName(RlvActions::SNC_DEFAULT)) ) + { + bool fCanShowNames = true; + std::for_each(selected_uuids.begin(), selected_uuids.end(), [&fCanShowNames](const LLUUID& idAgent) { fCanShowNames &= RlvActions::canShowName(RlvActions::SNC_DEFAULT, idAgent); }); + if (!fCanShowNames) + item_selected = multiple_selected = false; + } +// [/RLBa:KB] } std::string LLPanelPeople::getActiveTabName() const @@ -1323,6 +1336,13 @@ void LLPanelPeople::onAvatarListDoubleClicked(LLUICtrl* ctrl) return; } +// [RLVa:KB] - Checked: RLVa-2.0.1 + if ( (RlvActions::isRlvEnabled()) && (NEARBY_TAB_NAME == getActiveTabName()) && (!RlvActions::canShowName(RlvActions::SNC_DEFAULT, clicked_id)) ) + { + return; + } +// [/RLVa:KB] + #if 0 // SJB: Useful for testing, but not currently functional or to spec LLAvatarActions::showProfile(clicked_id); #else // spec says open IM window @@ -1439,6 +1459,15 @@ void LLPanelPeople::onImButtonClicked() { uuid_vec_t selected_uuids; getCurrentItemIDs(selected_uuids); +// [RLVa:KB] - Checked: RLVa-2.0.1 + if ( (RlvActions::isRlvEnabled()) && (NEARBY_TAB_NAME == getActiveTabName()) && (!RlvActions::canShowName(RlvActions::SNC_DEFAULT)) ) + { + bool fCanShowNames = true; + std::for_each(selected_uuids.begin(), selected_uuids.end(), [&fCanShowNames](const LLUUID& idAgent) { fCanShowNames &= RlvActions::canShowName(RlvActions::SNC_DEFAULT, idAgent); }); + if (!fCanShowNames) + return; + } +// [/RLVa:KB] if ( selected_uuids.size() == 1 ) { // if selected only one person then start up IM diff --git a/indra/newview/llpanelpeople.h b/indra/newview/llpanelpeople.h index dfec38fdcc..17747f2d1f 100644 --- a/indra/newview/llpanelpeople.h +++ b/indra/newview/llpanelpeople.h @@ -69,6 +69,10 @@ public: bool mTryToConnectToFacebook; +// [RLVa:KB] - Checked: RLVa-1.2.0 + LLAvatarList* getNearbyList() { return mNearbyList; } +// [/RLVa:KB] + // internals class Updater; diff --git a/indra/newview/llpanelpeoplemenus.cpp b/indra/newview/llpanelpeoplemenus.cpp index 0fcf685c6a..735cebb599 100644 --- a/indra/newview/llpanelpeoplemenus.cpp +++ b/indra/newview/llpanelpeoplemenus.cpp @@ -48,7 +48,9 @@ #include "llvoavatarself.h" #include "roles_constants.h" #include "llinventorybridge.h" // CHUI merge -#include "rlvhandler.h" +// [RLVa:KB] - Checked: RLVa-2.0.1 +#include "rlvactions.h" +// [/RLVa:KB] namespace LLPanelPeopleMenus { @@ -210,7 +212,10 @@ bool PeopleContextMenu::enableContextMenuItem(const LLSD& userdata) for (;id != uuids_end; ++id) { - if ( LLAvatarActions::isFriend(*id) ) +// if ( LLAvatarActions::isFriend(*id) ) +// [RLVa:KB] - Checked: 2014-03-31 (RLVa-2.0.1) + if ( (LLAvatarActions::isFriend(*id)) || (!RlvActions::canShowName(RlvActions::SNC_DEFAULT, *id)) ) +// [/RLVa:KB] { result = false; break; @@ -233,7 +238,10 @@ bool PeopleContextMenu::enableContextMenuItem(const LLSD& userdata) for (;id != uuids_end; ++id) { - if ( !LLAvatarActions::isFriend(*id) ) +// if ( !LLAvatarActions::isFriend(*id) ) +// [RLVa:KB] - Checked: 2014-03-31 (RLVa-2.0.1) + if ( (!LLAvatarActions::isFriend(*id)) || (!RlvActions::canShowName(RlvActions::SNC_DEFAULT, *id)) ) +// [/RLVa:KB] { result = false; break; @@ -276,7 +284,7 @@ bool PeopleContextMenu::enableContextMenuItem(const LLSD& userdata) // FIRE-8804: Prevent opening inventory from using share in radar context menu else if (item == std::string("can_open_inventory")) { - return (!gRlvHandler.hasBehaviour(RLV_BHVR_SHOWINV)); + return (!RlvActions::hasBehaviour(RLV_BHVR_SHOWINV)); } // else if (item == std::string("can_callog")) @@ -352,14 +360,29 @@ void PeopleContextMenu::requestTeleport() { // boost::bind cannot recognize overloaded method LLAvatarActions::teleportRequest(), // so we have to use a wrapper. +// [RLVa:KB] - Checked: RLVa-2.0.1 + bool fRlvCanShowName = (!m_fRlvCheck) || (RlvActions::canShowName(RlvActions::SNC_DEFAULT, mUUIDs.front())); + RlvActions::setShowName(RlvActions::SNC_TELEPORTREQUEST, fRlvCanShowName); LLAvatarActions::teleportRequest(mUUIDs.front()); + RlvActions::setShowName(RlvActions::SNC_TELEPORTREQUEST, true); +// [/RLVa:KB] +// LLAvatarActions::teleportRequest(mUUIDs.front()); } void PeopleContextMenu::offerTeleport() { // boost::bind cannot recognize overloaded method LLAvatarActions::offerTeleport(), // so we have to use a wrapper. +// [RLVa:KB] - Checked: RLVa-2.0.1 + bool fRlvCanShowName = true; + if ( (m_fRlvCheck) && (RlvActions::isRlvEnabled()) ) + std::for_each(mUUIDs.begin(), mUUIDs.end(), [&fRlvCanShowName](const LLUUID& idAgent) { fRlvCanShowName &= RlvActions::canShowName(RlvActions::SNC_DEFAULT, idAgent); }); + + RlvActions::setShowName(RlvActions::SNC_TELEPORTOFFER, fRlvCanShowName); LLAvatarActions::offerTeleport(mUUIDs); + RlvActions::setShowName(RlvActions::SNC_TELEPORTOFFER, true); +// [/RLVa:KB] +// LLAvatarActions::offerTeleport(mUUIDs); } void PeopleContextMenu::eject() @@ -422,7 +445,29 @@ void NearbyPeopleContextMenu::buildContextMenu(class LLMenuGL& menu, U32 flags) menuentry_vec_t items; menuentry_vec_t disabled_items; - if (flags & ITEM_IN_MULTI_SELECTION) +// [RLVa:KB] - Checked: RLVa-1.5.0 + bool fRlvCanShowName = true; + if ( (m_fRlvCheck) && (RlvActions::isRlvEnabled()) ) + std::for_each(mUUIDs.begin(), mUUIDs.end(), [&fRlvCanShowName](const LLUUID& idAgent) { fRlvCanShowName &= RlvActions::canShowName(RlvActions::SNC_DEFAULT, idAgent); }); + + if (!fRlvCanShowName) + { + if (flags & ITEM_IN_MULTI_SELECTION) + { + items.push_back(std::string("offer_teleport")); + } + else + { + items.push_back(std::string("offer_teleport")); + items.push_back(std::string("request_teleport")); + items.push_back(std::string("separator_invite_to_group")); + items.push_back(std::string("zoom_in")); + items.push_back(std::string("block_unblock")); + } + } + else if (flags & ITEM_IN_MULTI_SELECTION) +// [/RLVa:KB] +// if (flags & ITEM_IN_MULTI_SELECTION) { items.push_back(std::string("add_friends")); items.push_back(std::string("remove_friends")); diff --git a/indra/newview/llpanelpeoplemenus.h b/indra/newview/llpanelpeoplemenus.h index a0348c7fe2..c0417f808e 100644 --- a/indra/newview/llpanelpeoplemenus.h +++ b/indra/newview/llpanelpeoplemenus.h @@ -38,6 +38,9 @@ namespace LLPanelPeopleMenus class PeopleContextMenu : public LLListContextMenu { public: +// [RLVa:KB] - Checked: RLVa-1.5.0 + PeopleContextMenu() : m_fRlvCheck(false) {} +// [/RLVa:KB] /*virtual*/ LLContextMenu* createMenu(); protected: @@ -54,6 +57,10 @@ private: // Add to contact set void addToContactSet(); +// [RLVa:KB] - Checked: RLVa-1.5.0 +protected: + bool m_fRlvCheck; +// [/RLVa:KB] }; /** @@ -61,6 +68,10 @@ private: */ class NearbyPeopleContextMenu : public PeopleContextMenu { +// [RLVa:KB] - Checked: RLVa-1.5.0 +public: + NearbyPeopleContextMenu() : PeopleContextMenu() { m_fRlvCheck = true; } +// [/RLVa:KB] protected: /*virtual*/ void buildContextMenu(class LLMenuGL& menu, U32 flags); }; diff --git a/indra/newview/llpanelpermissions.cpp b/indra/newview/llpanelpermissions.cpp index 5cf920461a..27f926b54a 100644 --- a/indra/newview/llpanelpermissions.cpp +++ b/indra/newview/llpanelpermissions.cpp @@ -65,7 +65,8 @@ #include "lltrans.h" // [RLVa:KB] - Checked: 2010-08-25 (RLVa-1.2.2a) #include "llslurl.h" -#include "rlvhandler.h" +#include "rlvactions.h" +#include "rlvcommon.h" // [/RLVa:KB] // For OpenSim export permisson #include "lfsimfeaturehandler.h" @@ -462,17 +463,17 @@ void LLPanelPermissions::refresh() // getChildView("Owner Name")->setEnabled(TRUE); // [RLVa:KB] - Moved further down to avoid an annoying flicker when the text is set twice in a row -// [RLVa:KB] - Checked: 2010-11-02 (RLVa-1.2.2a) | Modified: RLVa-1.2.2a - if (gRlvHandler.hasBehaviour(RLV_BHVR_SHOWNAMES)) +// [RLVa:KB] - Checked: RLVa-2.0.1 + if ( (RlvActions::isRlvEnabled()) && (!RlvActions::canShowName(RlvActions::SNC_DEFAULT)) ) { // Only anonymize the creator if all of the selection was created by the same avie who's also the owner or they're a nearby avie - //if ( (creators_identical) && (mCreatorID != gAgent.getID()) && ((mCreatorID == mOwnerID) || (RlvUtil::isNearbyAgent(mCreatorID))) ) - // creator_name = LLSLURL("agent", mCreatorID, "rlvanonym").getSLURLString(); + if ( (creators_identical) && (!RlvActions::canShowName(RlvActions::SNC_DEFAULT, mCreatorID)) && ((mCreatorID == mOwnerID) || (RlvUtil::isNearbyAgent(mCreatorID))) ) + creator_name = LLSLURL("agent", mCreatorID, "rlvanonym").getSLURLString(); // Only anonymize the owner name if all of the selection is owned by the same avie and isn't group owned - if ( (owners_identical) && (!LLSelectMgr::getInstance()->selectIsGroupOwned()) && (mOwnerID != gAgent.getID()) ) + if ( (owners_identical) && (!LLSelectMgr::getInstance()->selectIsGroupOwned()) && (!RlvActions::canShowName(RlvActions::SNC_DEFAULT, mOwnerID)) ) owner_name = LLSLURL("agent", mOwnerID, "rlvanonym").getSLURLString(); - + // Only anonymize the last owner name if all of the selection was last owned by the same avie if ( (last_owners_identical) && (mLastOwnerID != gAgent.getID()) ) last_owner_name = LLSLURL("agent", mLastOwnerID, "rlvanonym").getSLURLString(); diff --git a/indra/newview/llsearchhistory.cpp b/indra/newview/llsearchhistory.cpp index 0ea05a03d6..0c643a5b0a 100644 --- a/indra/newview/llsearchhistory.cpp +++ b/indra/newview/llsearchhistory.cpp @@ -116,7 +116,7 @@ void LLSearchHistory::addEntry(const std::string& search_query) mSearchHistory.push_front(item); } -bool LLSearchHistory::LLSearchHistoryItem::operator < (const LLSearchHistory::LLSearchHistoryItem& right) +bool LLSearchHistory::LLSearchHistoryItem::operator < (const LLSearchHistory::LLSearchHistoryItem& right) const { S32 result = LLStringUtil::compareInsensitive(search_query, right.search_query); diff --git a/indra/newview/llsearchhistory.h b/indra/newview/llsearchhistory.h index 3309a8fcac..11d03f8173 100644 --- a/indra/newview/llsearchhistory.h +++ b/indra/newview/llsearchhistory.h @@ -98,7 +98,7 @@ public: /** * Allows std::list sorting */ - bool operator < (const LLSearchHistory::LLSearchHistoryItem& right); + bool operator < (const LLSearchHistory::LLSearchHistoryItem& right) const; /** * Allows std::list sorting diff --git a/indra/newview/llselectmgr.cpp b/indra/newview/llselectmgr.cpp index 8af9a06dfe..5a4334a4ff 100644 --- a/indra/newview/llselectmgr.cpp +++ b/indra/newview/llselectmgr.cpp @@ -99,6 +99,7 @@ // [RLVa:KB] - Checked: 2011-05-22 (RLVa-1.3.1a) #include "rlvactions.h" #include "rlvhandler.h" +#include "rlvhelper.h" // [/RLVa:KB] // Aurora Sim #include "llviewernetwork.h" @@ -4394,7 +4395,7 @@ void LLSelectMgr::convertTransient() void LLSelectMgr::deselectAllIfTooFar() { -// [RLVa:KB] - Checked: 2010-11-29 (RLVa-1.3.0c) | Modified: RLVa-1.3.0c +// [RLVa:KB] - Checked: RLVa-1.3.0 if ( (!mSelectedObjects->isEmpty()) && ((gRlvHandler.hasBehaviour(RLV_BHVR_EDIT)) || (gRlvHandler.hasBehaviour(RLV_BHVR_EDITOBJ))) ) { struct NotTransientOrFocusedMediaOrEditable : public LLSelectedNodeFunctor @@ -4402,8 +4403,7 @@ void LLSelectMgr::deselectAllIfTooFar() bool apply(LLSelectNode* pNode) { const LLViewerObject* pObj = pNode->getObject(); - return (!pNode->isTransient()) && (pObj) && (!gRlvHandler.canEdit(pObj)) && - (pObj->getID() != LLViewerMediaFocus::getInstance()->getFocusedObjectID()); + return (!pNode->isTransient()) && (pObj) && (!RlvActions::canEdit(pObj)) && (pObj->getID() != LLViewerMediaFocus::getInstance()->getFocusedObjectID()); } } f; if (mSelectedObjects->getFirstRootNode(&f, TRUE)) @@ -4416,15 +4416,13 @@ void LLSelectMgr::deselectAllIfTooFar() return; } -// [RLVa:KB] - Checked: 2010-05-03 (RLVa-1.2.0g) | Modified: RLVa-1.1.0l -#ifdef RLV_EXTENSION_CMD_INTERACT - // [Fall-back code] Don't allow an active selection (except for HUD attachments - see above) when @interact=n restricted +// [RLVa:KB] - Checked: RLVa-1.2.0 + // [Fall-back code] Don't allow an active selection (except for HUD attachments - see above) when @interact restricted if (gRlvHandler.hasBehaviour(RLV_BHVR_INTERACT)) { deselectAll(); return; } -#endif // RLV_EXTENSION_CMD_INTERACT // [/RLVa:KB] // HACK: Don't deselect when we're navigating to rate an object's @@ -4437,6 +4435,8 @@ void LLSelectMgr::deselectAllIfTooFar() LLVector3d selectionCenter = getSelectionCenterGlobal(); // if (gSavedSettings.getBOOL("LimitSelectDistance") // [RLVa:KB] - Checked: 2010-04-11 (RLVa-1.2.0e) | Modified: RLVa-0.2.0f + static RlvCachedBehaviourModifier s_nFartouchDist(RLV_MODIFIER_FARTOUCHDIST); + BOOL fRlvFartouch = gRlvHandler.hasBehaviour(RLV_BHVR_FARTOUCH) && gFloaterTools->getVisible(); if ( (gSavedSettings.getBOOL("LimitSelectDistance") || (fRlvFartouch) ) // [/RLVa:KB] @@ -4447,7 +4447,7 @@ void LLSelectMgr::deselectAllIfTooFar() { // F32 deselect_dist = gSavedSettings.getF32("MaxSelectDistance"); // [RLVa:KB] - Checked: 2010-04-11 (RLVa-1.2.0e) | Modified: RLVa-0.2.0f - F32 deselect_dist = (!fRlvFartouch) ? gSavedSettings.getF32("MaxSelectDistance") : 1.5f; + F32 deselect_dist = (!fRlvFartouch) ? gSavedSettings.getF32("MaxSelectDistance") : s_nFartouchDist; // [/RLVa:KB] F32 deselect_dist_sq = deselect_dist * deselect_dist; diff --git a/indra/newview/llsidepaneliteminfo.cpp b/indra/newview/llsidepaneliteminfo.cpp index 37a8397c82..c43fef98cc 100644 --- a/indra/newview/llsidepaneliteminfo.cpp +++ b/indra/newview/llsidepaneliteminfo.cpp @@ -46,8 +46,9 @@ #include "llviewerobjectlist.h" #include "llexperiencecache.h" #include "lltrans.h" -// [RLVa:KB] - Checked: 2010-08-25 (RLVa-1.2.2a) -#include "rlvhandler.h" +// [RLVa:KB] - Checked: RLVa-2.0.1 +#include "rlvactions.h" +#include "rlvcommon.h" // [/RLVa:KB] //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ @@ -361,13 +362,16 @@ void LLSidepanelItemInfo::refreshFromItem(LLViewerInventoryItem* item) // std::string name = // LLSLURL("agent", creator_id, "completename").getSLURLString(); // getChildView("BtnCreator")->setEnabled(TRUE); -// [RLVa:KB] - Checked: 2010-11-01 (RLVa-1.2.2a) | Modified: RLVa-1.2.2a +// [RLVa:KB] - Checked: RLVa-2.0.1 // If the object creator matches the object owner we need to anonymize the creator field as well - bool fRlvFilterCreator = (gRlvHandler.hasBehaviour(RLV_BHVR_SHOWNAMES)) && - ( ((perm.isOwned()) && (!perm.isGroupOwned()) && (perm.getOwner() == creator_id) && (perm.getOwner() != gAgent.getID())) || - (RlvUtil::isNearbyAgent(item->getCreatorUUID())) ); - std::string name = LLSLURL("agent", creator_id, (!fRlvFilterCreator) ? "completename" : "rlvanonym").getSLURLString(); - getChildView("BtnCreator")->setEnabled(!fRlvFilterCreator); + bool fRlvCanShowCreator = true; + if ( (RlvActions::isRlvEnabled()) && (!RlvActions::canShowName(RlvActions::SNC_DEFAULT, creator_id)) && + ( ((perm.isOwned()) && (!perm.isGroupOwned()) && (perm.getOwner() == creator_id) ) || (RlvUtil::isNearbyAgent(item->getCreatorUUID())) ) ) + { + fRlvCanShowCreator = false; + } + std::string name = LLSLURL("agent", creator_id, (fRlvCanShowCreator) ? "completename" : "rlvanonym").getSLURLString(); + getChildView("BtnCreator")->setEnabled(fRlvCanShowCreator); // [/RLVa:KB] getChildView("LabelCreatorTitle")->setEnabled(TRUE); getChildView("LabelCreatorName")->setEnabled(FALSE); @@ -386,6 +390,9 @@ void LLSidepanelItemInfo::refreshFromItem(LLViewerInventoryItem* item) //////////////// if(perm.isOwned()) { +// [RLVa:KB] - Checked: RVLa-2.0.1 + bool fRlvCanShowOwner = true; +// [/RLVa:KB] std::string name; if (perm.isGroupOwned()) { @@ -395,14 +402,14 @@ void LLSidepanelItemInfo::refreshFromItem(LLViewerInventoryItem* item) { LLUUID owner_id = perm.getOwner(); // name = LLSLURL("agent", owner_id, "completename").getSLURLString(); -// [RLVa:KB] - Checked: 2010-11-01 (RLVa-1.2.2a) | Modified: RLVa-1.2.2a - bool fRlvFilterOwner = (gRlvHandler.hasBehaviour(RLV_BHVR_SHOWNAMES)) && (owner_id != gAgent.getID()); - name = LLSLURL("agent", owner_id, (!fRlvFilterOwner) ? "completename" : "rlvanonym").getSLURLString(); +// [RLVa:KB] - Checked: RLVa-2.0.1 + fRlvCanShowOwner = RlvActions::canShowName(RlvActions::SNC_DEFAULT, owner_id); + name = LLSLURL("agent", owner_id, (fRlvCanShowOwner) ? "completename" : "rlvanonym").getSLURLString(); // [/RLVa:KB] } // getChildView("BtnOwner")->setEnabled(TRUE); -// [RLVa:KB] - Checked: 2010-08-25 (RLVa-1.2.2a) | Added: RLVa-1.0.0e - getChildView("BtnOwner")->setEnabled(!gRlvHandler.hasBehaviour(RLV_BHVR_SHOWNAMES)); +// [RLVa:KB] - Checked: RLVa-2.0.1 + getChildView("BtnOwner")->setEnabled(fRlvCanShowOwner); // [/RLVa:KB] getChildView("LabelOwnerTitle")->setEnabled(TRUE); getChildView("LabelOwnerName")->setEnabled(FALSE); @@ -760,12 +767,12 @@ void LLSidepanelItemInfo::onClickCreator() if(!item) return; if(!item->getCreatorUUID().isNull()) { -// [RLVa:KB] - Checked: 2010-08-25 (RLVa-1.2.2a) | Added: RLVa-1.2.1b - if (gRlvHandler.hasBehaviour(RLV_BHVR_SHOWNAMES)) +// [RLVa:KB] - Checked: RLVa-1.2.1 + const LLUUID& idCreator = item->getCreatorUUID(); + if ( (RlvActions::isRlvEnabled()) && (!RlvActions::canShowName(RlvActions::SNC_DEFAULT, idCreator)) ) { const LLPermissions& perm = item->getPermissions(); - if ( ((perm.isOwned()) && (!perm.isGroupOwned()) && (perm.getOwner() == item->getCreatorUUID()) && (perm.getOwner() != gAgent.getID())) || - (RlvUtil::isNearbyAgent(item->getCreatorUUID())) ) + if ( ((perm.isOwned()) && (!perm.isGroupOwned()) && (perm.getOwner() == idCreator) ) || (RlvUtil::isNearbyAgent(idCreator)) ) { return; } @@ -786,8 +793,8 @@ void LLSidepanelItemInfo::onClickOwner() } else { -// [RLVa:KB] - Checked: 2010-08-25 (RLVa-1.2.2a) | Modified: RLVa-1.0.0e - if ( (gRlvHandler.hasBehaviour(RLV_BHVR_SHOWNAMES)) && (item->getPermissions().getOwner() != gAgent.getID()) ) +// [RLVa:KB] - Checked: RLVa-1.0.0 + if ( (RlvActions::isRlvEnabled()) && (!RlvActions::canShowName(RlvActions::SNC_DEFAULT, item->getPermissions().getOwner())) ) return; // [/RLVa:KB] LLAvatarActions::showProfile(item->getPermissions().getOwner()); diff --git a/indra/newview/llstartup.cpp b/indra/newview/llstartup.cpp index 682d866570..350f863eb3 100644 --- a/indra/newview/llstartup.cpp +++ b/indra/newview/llstartup.cpp @@ -192,6 +192,10 @@ #include "llvoicechannel.h" #include "llpathfindingmanager.h" +// [RLVa:KB] - Checked: 2010-02-27 (RLVa-1.2.0a) +#include "rlvhandler.h" +// [/RLVa:KB] + #include "lllogin.h" #include "llevents.h" #include "llstartuplistener.h" @@ -233,7 +237,6 @@ #include "llprogressview.h" #include "lltoolbarview.h" #include "NACLantispam.h" -#include "rlvhandler.h" #include "streamtitledisplay.h" #include "tea.h" @@ -1372,11 +1375,7 @@ bool idle_startup() // All accounts have both a home and a last location, and we don't support // more locations than that. Choose the appropriate one. JC // [RLVa:KB] - Checked: 2010-04-01 (RLVa-1.2.0c) | Modified: RLVa-0.2.1d -#ifndef RLV_EXTENSION_STARTLOCATION - if (rlv_handler_t::isEnabled()) -#else if ( (rlv_handler_t::isEnabled()) && (RlvSettings::getLoginLastLocation()) ) -#endif // RLV_EXTENSION_STARTLOCATION { // Force login at the last location LLStartUp::setStartSLURL(LLSLURL(LLSLURL::SIM_LOCATION_LAST)); diff --git a/indra/newview/llstatusbar.cpp b/indra/newview/llstatusbar.cpp index 9b24136b38..7a5668b28d 100644 --- a/indra/newview/llstatusbar.cpp +++ b/indra/newview/llstatusbar.cpp @@ -110,7 +110,6 @@ // #include "fssearchableui.h" - // // Globals // diff --git a/indra/newview/lltooldraganddrop.cpp b/indra/newview/lltooldraganddrop.cpp index 07d1753777..ad8aadd806 100644 --- a/indra/newview/lltooldraganddrop.cpp +++ b/indra/newview/lltooldraganddrop.cpp @@ -1865,11 +1865,11 @@ EAcceptance LLToolDragAndDrop::dad3dRezAttachmentFromInv( } else { -// rez_attachment(item, 0); // [SL:KB] - Patch: Appearance-DnDWear | Checked: 2010-09-28 (Catznip-2.2) // Make this behave consistent with dad3dWearItem rez_attachment(item, 0, !(mask & MASK_CONTROL)); // [/SL:KB] +// rez_attachment(item, 0); } } return ACCEPT_YES_SINGLE; diff --git a/indra/newview/lltoolface.cpp b/indra/newview/lltoolface.cpp index ac2700949a..8405e1ee0a 100644 --- a/indra/newview/lltoolface.cpp +++ b/indra/newview/lltoolface.cpp @@ -40,6 +40,7 @@ #include "llviewerwindow.h" #include "llfloatertools.h" // [RLVa:KB] - Checked: 2010-04-11 (RLVa-1.2.0e) +#include "rlvactions.h" #include "rlvhandler.h" // [/RLVa:KB] @@ -112,7 +113,7 @@ void LLToolFace::pickCallback(const LLPickInfo& pick_info) // [RLVa:KB] - Checked: 2010-11-29 (RLVa-1.3.0c) | Modified: RLVa-1.3.0c if ( (rlv_handler_t::isEnabled()) && - ( (!gRlvHandler.canEdit(hit_obj)) || + ( (!RlvActions::canEdit(hit_obj)) || ((gRlvHandler.hasBehaviour(RLV_BHVR_FARTOUCH)) && (!gRlvHandler.canTouch(hit_obj, pick_info.mObjectOffset))) ) ) { return; diff --git a/indra/newview/lltoolpie.cpp b/indra/newview/lltoolpie.cpp index 5c14ecab43..f2f3b640f3 100644 --- a/indra/newview/lltoolpie.cpp +++ b/indra/newview/lltoolpie.cpp @@ -74,6 +74,7 @@ #include "llweb.h" #include "pipeline.h" // setHighlightObject // [RLVa:KB] - Checked: 2010-03-06 (RLVa-1.2.0c) +#include "rlvactions.h" #include "rlvhandler.h" // [/RLVa:KB] @@ -477,7 +478,7 @@ ECursorType LLToolPie::cursorFromObject(LLViewerObject* object) // if (isAgentAvatarValid() && !gAgentAvatarp->isSitting()) // not already sitting? // [RLVa:KB] - Checked: 2010-03-06 (RLVa-1.2.0c) | Modified: RLVa-1.2.0g if ( (isAgentAvatarValid() && !gAgentAvatarp->isSitting()) && - ((!rlv_handler_t::isEnabled()) || (gRlvHandler.canSit(object, LLToolPie::getInstance()->getHoverPick().mObjectOffset))) ) + ((!rlv_handler_t::isEnabled()) || (RlvActions::canSit(object, LLToolPie::getInstance()->getHoverPick().mObjectOffset))) ) // [/RLVa:KB] { cursor = UI_CURSOR_TOOLSIT; @@ -609,6 +610,7 @@ BOOL LLToolPie::handleHover(S32 x, S32 y, MASK mask) } // [/RLVa:KB] LLSelectMgr::getInstance()->setHoverObject(object, mHoverPick.mObjectFace); + if (object) { parent = object->getRootEdit(); @@ -752,10 +754,24 @@ BOOL LLToolPie::handleMouseUp(S32 x, S32 y, MASK mask) FALSE /* ignore transparent */, FALSE /* ignore particles */); - if (!mPick.mPosGlobal.isExactlyZero() // valid coordinates for pick - && (mPick.mPickType == LLPickInfo::PICK_LAND // we clicked on land - || mPick.mObjectID.notNull())) // or on an object +// if (!mPick.mPosGlobal.isExactlyZero() // valid coordinates for pick +// && (mPick.mPickType == LLPickInfo::PICK_LAND // we clicked on land +// || mPick.mObjectID.notNull())) // or on an object +// [RLVa:KB] - Checked: RLVa-2.0.0 + bool fValidPick = (!mPick.mPosGlobal.isExactlyZero() // valid coordinates for pick + && (mPick.mPickType == LLPickInfo::PICK_LAND // we clicked on land + || mPick.mObjectID.notNull())); // or on an object + + if ( (fValidPick) && (RlvActions::isRlvEnabled()) && (!RlvActions::canTeleportToLocal(mPick.mPosGlobal)) ) + { + RlvUtil::notifyBlocked(RLV_STRING_BLOCKED_AUTOPILOT); + fValidPick = false; + } + + if (fValidPick) +// [/RLVa:KB] { + // handle special cases of steering picks LLViewerObject* avatar_object = mPick.getObject(); @@ -850,8 +866,20 @@ BOOL LLToolPie::handleDoubleClick(S32 x, S32 y, MASK mask) } } - if ((mPick.mPickType == LLPickInfo::PICK_LAND && !mPick.mPosGlobal.isExactlyZero()) || - (mPick.mObjectID.notNull() && !mPick.mPosGlobal.isExactlyZero())) +// if ((mPick.mPickType == LLPickInfo::PICK_LAND && !mPick.mPosGlobal.isExactlyZero()) || +// (mPick.mObjectID.notNull() && !mPick.mPosGlobal.isExactlyZero())) +// [RLVa:KB] - Checked: RLVa-2.0.0 + bool fValidPick = ((mPick.mPickType == LLPickInfo::PICK_LAND && !mPick.mPosGlobal.isExactlyZero()) || + (mPick.mObjectID.notNull() && !mPick.mPosGlobal.isExactlyZero())); + + if ( (fValidPick) && (RlvActions::isRlvEnabled()) && (!RlvActions::canTeleportToLocal(mPick.mPosGlobal)) ) + { + RlvUtil::notifyBlocked(RLV_STRING_BLOCKED_AUTOPILOT); + fValidPick = false; + } + + if (fValidPick) +// [/RLVa:KB] { walkToClickedLocation(); return TRUE; @@ -1148,8 +1176,8 @@ BOOL LLToolPie::handleTooltipObject( LLViewerObject* hover_object, std::string l if (LLAvatarNameCache::get(hover_object->getID(), &av_name)) { // final_name = av_name.getCompleteName(); -// [RLVa:KB] - Checked: 2010-10-31 (RLVa-1.2.2a) | Modified: RLVa-1.2.2a - final_name = (!gRlvHandler.hasBehaviour(RLV_BHVR_SHOWNAMES)) ? av_name.getCompleteName() : RlvStrings::getAnonym(av_name); +// [RLVa:KB] - Checked: RLVa-1.2.2 + final_name = (RlvActions::canShowName(RlvActions::SNC_DEFAULT, hover_object->getID())) ? av_name.getCompleteName() : RlvStrings::getAnonym(av_name); // [/RLVa:KB] // Make sure group title gets added to the tool tip. This is done separately to // the RLVa code to prevent this change from getting lost in future RLVa merges @@ -1166,9 +1194,9 @@ BOOL LLToolPie::handleTooltipObject( LLViewerObject* hover_object, std::string l // *HACK: We may select this object, so pretend it was clicked mPick = mHoverPick; -// [RLVa:KB] - Checked: 2010-04-11 (RLVa-1.2.2a) | Added: RLVa-1.2.0e +// [RLVa:KB] - Checked: RLVa-1.2.0 if ( (!rlv_handler_t::isEnabled()) || - ( (gRlvHandler.canTouch(hover_object, mHoverPick.mObjectOffset)) && (!gRlvHandler.hasBehaviour(RLV_BHVR_SHOWNAMES)) ) ) + ( (gRlvHandler.canTouch(hover_object, mHoverPick.mObjectOffset)) && (RlvActions::canShowName(RlvActions::SNC_DEFAULT, hover_object->getID())) ) ) { // [/RLVa:KB] LLInspector::Params p; @@ -1488,7 +1516,15 @@ BOOL LLToolPie::handleToolTip(S32 local_x, S32 local_y, MASK mask) // [/RLVa:KB] LLViewerObject* hover_object = mHoverPick.getObject(); - + +// [RLVa:KB] - Checked: RLVa-1.2.0 + // NOTE: handleTooltipObject() will block HUD tooltips anyway but technically interact should only interfere with world interaction + if ( (gRlvHandler.hasBehaviour(RLV_BHVR_INTERACT)) && (hover_object) && (!hover_object->isHUDAttachment()) ) + { + return TRUE; + } +// [/RLVa:KB] + // update hover object and hover parcel LLSelectMgr::getInstance()->setHoverObject(hover_object, mHoverPick.mObjectFace); diff --git a/indra/newview/lltoolplacer.cpp b/indra/newview/lltoolplacer.cpp index 44cad88644..0bc5749d0a 100644 --- a/indra/newview/lltoolplacer.cpp +++ b/indra/newview/lltoolplacer.cpp @@ -45,6 +45,7 @@ #include "llui.h" // [RLVa:KB] - Checked: 2010-03-23 (RLVa-1.2.0a) #include "rlvhandler.h" +#include "rlvhelper.h" // [/RLVa:KB] //Headers added for functions moved from viewer.cpp @@ -166,9 +167,11 @@ BOOL LLToolPlacer::raycastForNewObjPos( S32 x, S32 y, LLViewerObject** hit_obj, // [RLVa:KB] - Checked: 2010-04-11 (RLVa-1.2.0e) | Modified: RLVa-0.2.0f // NOTE: don't use surface_pos_global since for prims it will be the center of the prim while we need center + offset - if ( (gRlvHandler.hasBehaviour(RLV_BHVR_FARTOUCH)) && (dist_vec_squared(gAgent.getPositionGlobal(), pick.mPosGlobal) > 1.5f * 1.5f) ) + if (gRlvHandler.hasBehaviour(RLV_BHVR_FARTOUCH)) { - return FALSE; + static RlvCachedBehaviourModifier s_nFartouchDist(RLV_MODIFIER_FARTOUCHDIST); + if (dist_vec_squared(gAgent.getPositionGlobal(), pick.mPosGlobal) > s_nFartouchDist * s_nFartouchDist) + return FALSE; } // [/RLVa:KB] diff --git a/indra/newview/lltoolselect.cpp b/indra/newview/lltoolselect.cpp index 4f63d50fb3..38e7b3b8a8 100644 --- a/indra/newview/lltoolselect.cpp +++ b/indra/newview/lltoolselect.cpp @@ -47,8 +47,9 @@ #include "llviewerwindow.h" #include "llvoavatarself.h" #include "llworld.h" -// [RLVa:KB] - Checked: 2010-03-06 (RLVa-1.2.0c) -#include "rlvhandler.h" +// [RLVa:KB] - Checked: RLVa-2.0.0 +#include "rlvactions.h" +#include "rlvhelper.h" #include "llfloaterreg.h" // [/RLVa:KB] @@ -86,22 +87,23 @@ LLObjectSelectionHandle LLToolSelect::handleObjectSelection(const LLPickInfo& pi } // [RLVa:KB] - Checked: 2010-11-29 (RLVa-1.3.0c) | Modified: RLVa-1.3.0c - if ( (object) && (rlv_handler_t::isEnabled()) ) + if ( (object) && (RlvActions::isRlvEnabled()) ) { - if (!gRlvHandler.canEdit(object)) + if (!RlvActions::canEdit(object)) { if (!temp_select) return LLSelectMgr::getInstance()->getSelection(); else if (LLToolMgr::instance().inBuildMode()) LLToolMgr::instance().toggleBuildMode(LLSD("toggleonly")); } - - if ( (gRlvHandler.hasBehaviour(RLV_BHVR_FARTOUCH)) && ((!object->isAttachment()) || (!object->permYouOwner())) && - (dist_vec_squared(gAgent.getPositionAgent(), object->getPositionRegion()) > 1.5f * 1.5f) ) + + if ( (RlvActions::hasBehaviour(RLV_BHVR_FARTOUCH)) && ((!object->isAttachment()) || (!object->permYouOwner())) ) { - // NOTE: see behaviour notes for a rather lengthy explanation of why we're doing things this way - //if (dist_vec_squared(gAgent.getPositionAgent(), object->getPositionRegion() + pick.mObjectOffset) > 1.5f * 1.5f) - if (dist_vec_squared(gAgent.getPositionAgent(), pick.mIntersection) > 1.5f * 1.5f) + static RlvCachedBehaviourModifier s_nFartouchDist(RLV_MODIFIER_FARTOUCHDIST); + float nFartouchDistSq = s_nFartouchDist * s_nFartouchDist; + // NOTE: recheck why we did it this way, might be able to simplify + if ( (dist_vec_squared(gAgent.getPositionAgent(), object->getPositionRegion()) > nFartouchDistSq) && + (dist_vec_squared(gAgent.getPositionAgent(), pick.mIntersection) > nFartouchDistSq) ) { if ( (LLFloaterReg::instanceVisible("build")) && (pick.mKeyMask != MASK_SHIFT) && (pick.mKeyMask != MASK_CONTROL) ) LLSelectMgr::getInstance()->deselectAll(); diff --git a/indra/newview/llviewercamera.cpp b/indra/newview/llviewercamera.cpp index ac09961402..4b0a36ddcd 100644 --- a/indra/newview/llviewercamera.cpp +++ b/indra/newview/llviewercamera.cpp @@ -41,7 +41,8 @@ #include "llworld.h" #include "lltoolmgr.h" #include "llviewerjoystick.h" -// [RLVa:KB] - Checked: 2010-04-11 (RLVa-1.2.0e) +// [RLVa:KB] - RLVa-2.0.0 +#include "rlvactions.h" #include "rlvhandler.h" // [/RLVa:KB] @@ -356,15 +357,17 @@ void LLViewerCamera::setPerspective(BOOL for_selection, if (limit_select_distance) { // ...select distance from control -// z_far = gSavedSettings.getF32("MaxSelectDistance"); -// [RLVa:KB] - Checked: 2010-04-11 (RLVa-1.2.0e) | Added: RLVa-1.2.0e - z_far = (!gRlvHandler.hasBehaviour(RLV_BHVR_FARTOUCH)) ? gSavedSettings.getF32("MaxSelectDistance") : 1.5; -// [/RLVa:KB] + z_far = gSavedSettings.getF32("MaxSelectDistance"); } else { z_far = gAgentCamera.mDrawDistance; } + +// [RLVa:KB] - Checked: RLVa-2.0.0 + if (RlvActions::hasBehaviour(RLV_BHVR_FARTOUCH)) + z_far = RlvActions::getModifierValue(RLV_MODIFIER_FARTOUCHDIST); +// [/RLVa:KB] } else { @@ -882,6 +885,12 @@ BOOL LLViewerCamera::areVertsVisible(LLViewerObject* volumep, BOOL all_verts) void LLViewerCamera::setDefaultFOV(F32 vertical_fov_rads) { +// [RLVa:KB] - Checked: RLVa-2.0.0 + F32 nCamFOVMin, nCamFOVMax; + if ( (RlvActions::isRlvEnabled()) && (RlvActions::getCameraFOVLimits(nCamFOVMin, nCamFOVMax)) ) + vertical_fov_rads = llclamp(vertical_fov_rads, nCamFOVMin, nCamFOVMax); +// [/RLVa:KB] + vertical_fov_rads = llclamp(vertical_fov_rads, getMinView(), getMaxView()); setView(vertical_fov_rads); mCameraFOVDefault = vertical_fov_rads; diff --git a/indra/newview/llviewercontrol.cpp b/indra/newview/llviewercontrol.cpp index 280c45313a..aceb18c327 100644 --- a/indra/newview/llviewercontrol.cpp +++ b/indra/newview/llviewercontrol.cpp @@ -78,6 +78,9 @@ #include "llslurl.h" #include "llstartup.h" #include "llupdaterservice.h" +// [RLVa:KB] - Checked: 2015-12-27 (RLVa-1.5.0) +#include "rlvcommon.h" +// [/RLVa:KB] // Firestorm inclues #include "fsfloatercontacts.h" @@ -1050,6 +1053,9 @@ void settings_setup_listeners() gSavedSettings.getControl("SpellCheck")->getSignal()->connect(boost::bind(&handleSpellCheckChanged)); gSavedSettings.getControl("SpellCheckDictionary")->getSignal()->connect(boost::bind(&handleSpellCheckChanged)); gSavedSettings.getControl("LoginLocation")->getSignal()->connect(boost::bind(&handleLoginLocationChanged)); +// [RLVa:KB] - Checked: 2015-12-27 (RLVa-1.5.0) + gSavedSettings.getControl("RestrainedLove")->getSignal()->connect(boost::bind(&RlvSettings::onChangedSettingMain, _2)); +// [/RLVa:KB] gSavedPerAccountSettings.getControl("AvatarHoverOffsetZ")->getSignal()->connect(boost::bind(&handleAvatarZOffsetChanged, _2)); // Moved Avatar Z offset from RLVa to here // Is done inside XUI now, using visibility_control // gSavedSettings.getControl("ShowNavbarFavoritesPanel")->getSignal()->connect(boost::bind(&toggle_show_favorites_panel, _2)); @@ -1092,8 +1098,6 @@ void settings_setup_listeners() gSavedSettings.getControl("ChatFontSize")->getSignal()->connect(boost::bind(&LLViewerChat::signalChatFontChanged)); // [FS communication UI] - gSavedSettings.getControl(RLV_SETTING_MAIN)->getSignal()->connect(boost::bind(&RlvSettings::onChangedSettingMain, _2)); - gSavedPerAccountSettings.getControl("GlobalOnlineStatusToggle")->getSignal()->connect(boost::bind(&handleGlobalOnlineStatusChanged, _2)); // FIRE-17393: Control HUD text fading by options diff --git a/indra/newview/llviewerdisplay.cpp b/indra/newview/llviewerdisplay.cpp index cafbf4f9a4..34a6e843fc 100644 --- a/indra/newview/llviewerdisplay.cpp +++ b/indra/newview/llviewerdisplay.cpp @@ -558,6 +558,9 @@ void display(BOOL rebuild, F32 zoom_factor, int subfield, BOOL for_snapshot) // No teleport in progress gViewerWindow->setShowProgress(FALSE,FALSE); gTeleportDisplay = FALSE; +// [SL:KB] - Patch: Appearance-TeleportAttachKill | Checked: Catznip-4.0 + LLViewerParcelMgr::getInstance()->onTeleportDone(); +// [/SL:KB] break; } } diff --git a/indra/newview/llviewerfloaterreg.cpp b/indra/newview/llviewerfloaterreg.cpp index dc2d128ad2..fa30a9f294 100644 --- a/indra/newview/llviewerfloaterreg.cpp +++ b/indra/newview/llviewerfloaterreg.cpp @@ -200,7 +200,6 @@ #include "NACLfloaterexploresounds.h" #include "particleeditor.h" #include "quickprefs.h" - // handle secondlife:///app/openfloater/{NAME} URLs class LLFloaterOpenHandler : public LLCommandHandler { @@ -385,6 +384,7 @@ void LLViewerFloaterReg::registerFloaters() LLFloaterReg::add("region_restarting", "floater_region_restarting.xml", (LLFloaterBuildFunc)&LLFloaterReg::build); // [RLVa:KB] - Checked: 2010-03-11 (RLVa-1.2.0e) | Added: RLVa-1.2.0a LLFloaterReg::add("rlv_behaviours", "floater_rlv_behaviours.xml", (LLFloaterBuildFunc)&LLFloaterReg::build); + LLFloaterReg::add("rlv_console", "floater_rlv_console.xml", (LLFloaterBuildFunc)&LLFloaterReg::build); LLFloaterReg::add("rlv_locks", "floater_rlv_locks.xml", (LLFloaterBuildFunc)&LLFloaterReg::build); LLFloaterReg::add("rlv_strings", "floater_rlv_strings.xml", (LLFloaterBuildFunc)&LLFloaterReg::build); // [/RLVa:KB] diff --git a/indra/newview/llviewerjointattachment.cpp b/indra/newview/llviewerjointattachment.cpp index b07ee917d3..22f1123be6 100644 --- a/indra/newview/llviewerjointattachment.cpp +++ b/indra/newview/llviewerjointattachment.cpp @@ -173,6 +173,12 @@ BOOL LLViewerJointAttachment::addObject(LLViewerObject* object) if (isObjectAttached(object)) { LL_INFOS() << "(same object re-attached)" << LL_ENDL; +// [SL:KB] - Patch: Appearance-TeleportAttachKill | Checked: Catznip-4.0 + if ( (object->permYouOwner()) && (gAgentAvatarp) ) + { + gAgentAvatarp->removePendingDetach(object->getID()); + } +// [/SL:KB] removeObject(object); // Pass through anyway to let setupDrawable() // re-connect object to the joint correctly diff --git a/indra/newview/llviewerkeyboard.cpp b/indra/newview/llviewerkeyboard.cpp index be5c7945d7..b591378c78 100644 --- a/indra/newview/llviewerkeyboard.cpp +++ b/indra/newview/llviewerkeyboard.cpp @@ -122,6 +122,10 @@ void agent_push_down( EKeystate s ) static void agent_check_temporary_run(LLAgent::EDoubleTapRunMode mode) { +// [RLVa:KB] - Checked: 2011-05-11 (RLVa-1.3.0i) | Added: RLVa-1.3.0i + if ( (gAgent.mDoubleTapRunMode == mode) && (gAgent.getTempRun()) ) + gAgent.clearTempRun(); +// [/RLVa:KB] // if (gAgent.mDoubleTapRunMode == mode && // gAgent.getRunning() && // !gAgent.getAlwaysRun()) @@ -130,10 +134,6 @@ static void agent_check_temporary_run(LLAgent::EDoubleTapRunMode mode) // gAgent.clearRunning(); // gAgent.sendWalkRun(gAgent.getRunning()); // } -// [RLVa:KB] - Checked: 2011-05-11 (RLVa-1.3.0i) | Added: RLVa-1.3.0i - if ( (gAgent.mDoubleTapRunMode == mode) && (gAgent.getTempRun()) ) - gAgent.clearTempRun(); -// [/RLVa:KB] } static void agent_handle_doubletap_run(EKeystate s, LLAgent::EDoubleTapRunMode mode) diff --git a/indra/newview/llviewermenu.cpp b/indra/newview/llviewermenu.cpp index 3a1d5dc68b..25358883aa 100644 --- a/indra/newview/llviewermenu.cpp +++ b/indra/newview/llviewermenu.cpp @@ -134,13 +134,13 @@ #include "llpathfindingmanager.h" #include "llstartup.h" #include "boost/unordered_map.hpp" - -// Firestorm includes // [RLVa:KB] - Checked: 2011-05-22 (RLVa-1.3.1a) #include "rlvactions.h" #include "rlvhandler.h" #include "rlvlocks.h" // [/RLVa:KB] + +// Firestorm includes #include "fsdata.h" #include "fslslbridge.h" #include "fscommon.h" @@ -1365,13 +1365,22 @@ class LLAdvancedToggleWireframe : public view_listener_t { bool handleEvent(const LLSD& userdata) { -// [RLVa:KB] - Checked: 2013-05-11 (RLVa-1.4.9) +// [RLVa:KB] - Checked: RLVa-2.0.0 bool fRlvBlockWireframe = gRlvAttachmentLocks.hasLockedHUD(); if ( (!gUseWireframe) && (fRlvBlockWireframe) ) - { RlvUtil::notifyBlocked(RLV_STRING_BLOCKED_WIREFRAME); - } - gUseWireframe = (!gUseWireframe) && (!fRlvBlockWireframe); + set_use_wireframe( (!gUseWireframe) && (!fRlvBlockWireframe) ); + return true; + } +}; + +// Called from rlvhandler.cpp +void set_use_wireframe(BOOL useWireframe) + { + if (gUseWireframe == useWireframe) + return; + + gUseWireframe = useWireframe; // [/RLVa:KB] // gUseWireframe = !(gUseWireframe); @@ -1392,9 +1401,9 @@ class LLAdvancedToggleWireframe : public view_listener_t LLViewerShaderMgr::instance()->setShaders(); } - return true; +// return true; } -}; +//}; class LLAdvancedCheckWireframe : public view_listener_t { @@ -3575,15 +3584,15 @@ bool enable_object_mute() lastname && !LLStringUtil::compareStrings(lastname->getString(), "Linden"); bool is_self = avatar->isSelf(); // return !is_linden && !is_self; -// [RLVa:KB] - Checked: 2010-08-25 (RLVa-1.2.1b) | Added: RLVa-1.2.1b -// return !is_linden && !is_self && !gRlvHandler.hasBehaviour(RLV_BHVR_SHOWNAMES); +// [RLVa:KB] - Checked: RLVa-1.2.1 +// return !is_linden && !is_self && (RlvActions::canShowName(RlvActions::SNC_DEFAULT, avatar->getID())); // [/RLVa:KB] // Make enable/disable of block/unblock menu items work for avatars if(is_linden || is_self) return false; - if(gRlvHandler.hasBehaviour(RLV_BHVR_SHOWNAMES)) + if (!RlvActions::canShowName(RlvActions::SNC_DEFAULT, avatar->getID())) return false; LLNameValue *firstname = avatar->getNVPair("FirstName"); @@ -3743,14 +3752,14 @@ class LLObjectMute : public view_listener_t LLVOAvatar* avatar = find_avatar_from_object(object); if (avatar) { -// [RLVa:KB] - Checked: 2010-08-25 (RLVa-1.2.1b) | Added: RLVa-1.0.0e - if (gRlvHandler.hasBehaviour(RLV_BHVR_SHOWNAMES)) + id = avatar->getID(); +// [RLVa:KB] - Checked: RLVa-1.0.0 + if (!RlvActions::canShowName(RlvActions::SNC_DEFAULT, id)) return true; // [/RLVa:KB] avatar->mNeedsImpostorUpdate = TRUE; - id = avatar->getID(); LLNameValue *firstname = avatar->getNVPair("FirstName"); LLNameValue *lastname = avatar->getNVPair("LastName"); @@ -3918,8 +3927,8 @@ void handle_avatar_freeze(const LLSD& avatar_id) // { // LLSD args; // args["AVATAR_NAME"] = fullname; -// [RLVa:KB] - Checked: 2010-09-28 (RLVa-1.2.1f) | Modified: RLVa-1.0.0e -// args["AVATAR_NAME"] = (!gRlvHandler.hasBehaviour(RLV_BHVR_SHOWNAMES)) ? fullname : RlvStrings::getAnonym(fullname); +// [RLVa:KB] - Checked: RLVa-1.0.0 +// args["AVATAR_NAME"] = (RlvActions::canShowName(RlvActions::SNC_DEFAULT, avatar->getID())) ? fullname : RlvStrings::getAnonym(fullname); // [/RLVa:KB] // LLNotificationsUtil::add("FreezeAvatarFullname", // args, @@ -4066,8 +4075,8 @@ void handle_avatar_eject(const LLSD& avatar_id) // { // LLSD args; // args["AVATAR_NAME"] = fullname; -// [RLVa:KB] - Checked: 2010-09-28 (RLVa-1.2.1f) | Modified: RLVa-1.0.0e -// args["AVATAR_NAME"] = (!gRlvHandler.hasBehaviour(RLV_BHVR_SHOWNAMES)) ? fullname : RlvStrings::getAnonym(fullname); +// [RLVa:KB] - Checked: RLVa-1.0.0 +// args["AVATAR_NAME"] = (RlvActions::canShowName(RlvActions::SNC_DEFAULT, avatar->getID())) ? fullname : RlvStrings::getAnonym(fullname); // [/RLVa:KB] // LLNotificationsUtil::add("EjectAvatarFullname", // args, @@ -4089,8 +4098,8 @@ void handle_avatar_eject(const LLSD& avatar_id) // { // LLSD args; // args["AVATAR_NAME"] = fullname; -// [RLVa:KB] - Checked: 2010-09-28 (RLVa-1.2.1f) | Modified: RLVa-1.0.0e -// args["AVATAR_NAME"] = (!gRlvHandler.hasBehaviour(RLV_BHVR_SHOWNAMES)) ? fullname : RlvStrings::getAnonym(fullname); +// [RLVa:KB] - Checked: RLVa-1.0.0 +// args["AVATAR_NAME"] = (RlvActions::canShowName(RlvActions::SNC_DEFAULT, avatar->getID())) ? fullname : RlvStrings::getAnonym(fullname); // [/RLVa:KB] // LLNotificationsUtil::add("EjectAvatarFullnameNoBan", // args, @@ -4880,8 +4889,8 @@ class LLAvatarEnableAddFriend : public view_listener_t { LLVOAvatar* avatar = find_avatar_from_object(LLSelectMgr::getInstance()->getSelection()->getPrimaryObject()); // bool new_value = avatar && !LLAvatarActions::isFriend(avatar->getID()); -// [RLVa:KB] - Checked: 2010-04-20 (RLVa-1.2.0f) | Modified: RLVa-1.2.0f - bool new_value = avatar && !LLAvatarActions::isFriend(avatar->getID()) && (!gRlvHandler.hasBehaviour(RLV_BHVR_SHOWNAMES)); +// [RLVa:KB] - Checked: RLVa-1.2.0 + bool new_value = avatar && !LLAvatarActions::isFriend(avatar->getID()) && (RlvActions::canShowName(RlvActions::SNC_DEFAULT, avatar->getID())); // [/RLVa:KB] return new_value; } @@ -4959,7 +4968,7 @@ bool is_object_sittable() if (rlv_handler_t::isEnabled()) { const LLPickInfo& pick = LLToolPie::getInstance()->getPick(); - if ( (pick.mObjectID.notNull()) && (!gRlvHandler.canSit(pick.getObject(), pick.mObjectOffset)) ) + if ( (pick.mObjectID.notNull()) && (!RlvActions::canSit(pick.getObject(), pick.mObjectOffset)) ) return false; } // [/RLVa:KB] @@ -4998,7 +5007,7 @@ void handle_object_sit_or_stand() // if (object && object->getPCode() == LL_PCODE_VOLUME) // [RLVa:KB] - Checked: 2010-03-06 (RLVa-1.2.0c) | Modified: RLVa-1.2.0c if ( (object && object->getPCode() == LL_PCODE_VOLUME) && - ((!rlv_handler_t::isEnabled()) || (gRlvHandler.canSit(object, pick.mObjectOffset))) ) + ((!rlv_handler_t::isEnabled()) || (RlvActions::canSit(object, pick.mObjectOffset))) ) // [/RLVa:KB] { // [RLVa:KB] - Checked: 2010-08-29 (RLVa-1.2.1c) | Added: RLVa-1.2.1c @@ -7282,8 +7291,8 @@ class LLAvatarInviteToGroup : public view_listener_t { LLVOAvatar* avatar = find_avatar_from_object( LLSelectMgr::getInstance()->getSelection()->getPrimaryObject() ); // if(avatar) -// [RLVa:KB] - Checked: 2010-06-04 (RLVa-1.2.0d) | Added: RLVa-1.2.0d - if ( (avatar) && (!gRlvHandler.hasBehaviour(RLV_BHVR_SHOWNAMES)) ) +// [RLVa:KB] - Checked: RLVa-1.2.0 + if ( (avatar) && (RlvActions::canShowName(RlvActions::SNC_DEFAULT, avatar->getID())) ) // [/RLVa:KB] { LLAvatarActions::inviteToGroup(avatar->getID()); @@ -7298,8 +7307,8 @@ class LLAvatarAddFriend : public view_listener_t { LLVOAvatar* avatar = find_avatar_from_object( LLSelectMgr::getInstance()->getSelection()->getPrimaryObject() ); // if(avatar && !LLAvatarActions::isFriend(avatar->getID())) -// [RLVa:KB] - Checked: 2010-04-20 (RLVa-1.2.0f) | Modified: RLVa-1.2.0f - if ( (avatar && !LLAvatarActions::isFriend(avatar->getID())) && (!gRlvHandler.hasBehaviour(RLV_BHVR_SHOWNAMES)) ) +// [RLVa:KB] - Checked: RLVa-1.2.0 + if ( (avatar && !LLAvatarActions::isFriend(avatar->getID())) && (RlvActions::canShowName(RlvActions::SNC_DEFAULT, avatar->getID())) ) // [/RLVa:KB] { request_friendship(avatar->getID()); @@ -7342,8 +7351,8 @@ class LLAvatarAddContact : public view_listener_t { LLVOAvatar* avatar = find_avatar_from_object( LLSelectMgr::getInstance()->getSelection()->getPrimaryObject() ); // if(avatar) -// [RLVa:KB] - Checked: 2010-04-20 (RLVa-1.2.0f) | Modified: RLVa-1.2.0f - if ( (avatar) && (!gRlvHandler.hasBehaviour(RLV_BHVR_SHOWNAMES)) ) +// [RLVa:KB] - Checked: RLVa-1.2.0 + if ( (avatar) && (RlvActions::canShowName(RlvActions::SNC_DEFAULT, avatar->getID())) ) // [/RLVa:KB] { create_inventory_callingcard(avatar->getID()); @@ -7409,8 +7418,8 @@ bool enable_pay_avatar() LLViewerObject* obj = LLSelectMgr::getInstance()->getSelection()->getPrimaryObject(); LLVOAvatar* avatar = find_avatar_from_object(obj); // return (avatar != NULL); -// [RLVa:KB] - Checked: 2010-08-25 (RLVa-1.2.1b) | Added: RLVa-1.2.1b - return (avatar != NULL) && (!gRlvHandler.hasBehaviour(RLV_BHVR_SHOWNAMES)); +// [RLVa:KB] - Checked: RLVa-1.2.1 + return (avatar != NULL) && (RlvActions::canShowName(RlvActions::SNC_DEFAULT, avatar->getID())); // [/RLVa:KB] } @@ -7466,7 +7475,7 @@ bool enable_object_sit(LLUICtrl* ctrl) { const LLPickInfo& pick = LLToolPie::getInstance()->getPick(); if (pick.mObjectID.notNull()) - sitting_on_sel = !gRlvHandler.canSit(pick.getObject(), pick.mObjectOffset); + sitting_on_sel = !RlvActions::canSit(pick.getObject(), pick.mObjectOffset); } // [/RLVa:KB] @@ -7801,8 +7810,8 @@ class LLShowAgentProfile : public view_listener_t LLVOAvatar* avatar = find_avatar_from_object(agent_id); // if (avatar) -// [RLVa:KB] - Checked: 2010-06-04 (RLVa-1.2.0d) | Modified: RLVa-1.2.0d - if ( (avatar) && ((!gRlvHandler.hasBehaviour(RLV_BHVR_SHOWNAMES)) || (gAgent.getID() == agent_id)) ) +// [RLVa:KB] - Checked: RLVa-1.2.0 + if ( (avatar) && ((RlvActions::canShowName(RlvActions::SNC_DEFAULT, agent_id)) || (gAgent.getID() == agent_id)) ) // [/RLVa:KB] { LLAvatarActions::showProfile(avatar->getID()); @@ -8535,8 +8544,8 @@ class LLAvatarSendIM : public view_listener_t { LLVOAvatar* avatar = find_avatar_from_object( LLSelectMgr::getInstance()->getSelection()->getPrimaryObject() ); // if(avatar) -// [RLVa:KB] - Checked: 2010-06-04 (RLVa-1.2.0d) | Added: RLVa-1.2.0d - if ( (avatar) && (!gRlvHandler.hasBehaviour(RLV_BHVR_SHOWNAMES)) ) +// [RLVa:KB] - Checked: RLVa-1.2.0 + if ( (avatar) && (RlvActions::canShowName(RlvActions::SNC_DEFAULT, avatar->getID())) ) // [/RLVa:KB] { LLAvatarActions::startIM(avatar->getID()); @@ -8551,8 +8560,8 @@ class LLAvatarCall : public view_listener_t { LLVOAvatar* avatar = find_avatar_from_object( LLSelectMgr::getInstance()->getSelection()->getPrimaryObject() ); // if(avatar) -// [RLVa:KB] - Checked: 2010-06-04 (RLVa-1.2.0d) | Added: RLVa-1.2.0d - if ( (avatar) && (!gRlvHandler.hasBehaviour(RLV_BHVR_SHOWNAMES)) ) +// [RLVa:KB] - Checked: RLVa-1.2.0 + if ( (avatar) && (RlvActions::canShowName(RlvActions::SNC_DEFAULT, avatar->getID())) ) // [/RLVa:KB] { LLAvatarActions::startCall(avatar->getID()); @@ -8561,10 +8570,16 @@ class LLAvatarCall : public view_listener_t } }; -// [RLVa:KB] - Checked: 2010-08-25 (RLVa-1.2.1b) | Added: RLVa-1.2.1b +// [RLVa:KB] - Checked: RLVa-1.2.1 bool enable_avatar_call() { - return (!gRlvHandler.hasBehaviour(RLV_BHVR_SHOWNAMES)) && (LLAvatarActions::canCall()); + if (RlvActions::isRlvEnabled()) + { + const LLVOAvatar* pAvatar = find_avatar_from_object(LLSelectMgr::getInstance()->getSelection()->getPrimaryObject()); + if ((!pAvatar) || (!RlvActions::canShowName(RlvActions::SNC_DEFAULT, pAvatar->getID()))) + return false; + } + return LLAvatarActions::canCall(); } // [/RLVa:KB] @@ -11336,9 +11351,13 @@ void initialize_menus() view_listener_t::addMenu(new LLEditableSelectedMono(), "EditableSelectedMono"); view_listener_t::addMenu(new LLToggleUIHints(), "ToggleUIHints"); -// [RLVa:KB] - Checked: 2010-04-23 (RLVa-1.2.0g) | Added: RLVa-1.2.0 +// [RLVa:KB] - Checked: RLVa-2.0.0 enable.add("RLV.MainToggleVisible", boost::bind(&rlvMenuMainToggleVisible, _1)); - enable.add("RLV.EnableIfNot", boost::bind(&rlvMenuEnableIfNot, _2)); + if (RlvActions::isRlvEnabled()) + { + enable.add("RLV.CanShowName", boost::bind(&rlvMenuCanShowName)); + enable.add("RLV.EnableIfNot", boost::bind(&rlvMenuEnableIfNot, _2)); + } // [/RLVa:KB] // Toggle internal web browser diff --git a/indra/newview/llviewermenu.h b/indra/newview/llviewermenu.h index 9e05c070ed..6643ea4970 100644 --- a/indra/newview/llviewermenu.h +++ b/indra/newview/llviewermenu.h @@ -39,6 +39,10 @@ class LLObjectSelection; class LLSelectNode; class PieMenu; // ## Zi: Pie Menu +// [RLVa:KB] - Checked: RLVa-2.0.0 +void set_use_wireframe(BOOL useWireframe); +// [/RLVa:KB] + void initialize_edit_menu(); void initialize_spellcheck_menu(); void initialize_volume_controls_callbacks(); // Centralize a some of these volume panel callbacks diff --git a/indra/newview/llviewermessage.cpp b/indra/newview/llviewermessage.cpp index 1bb79290bb..1502f721b9 100644 --- a/indra/newview/llviewermessage.cpp +++ b/indra/newview/llviewermessage.cpp @@ -119,6 +119,12 @@ #include "llpanelplaceprofile.h" #include "llviewerregion.h" #include "llfloaterregionrestarting.h" +// [RLVa:KB] - Checked: 2010-03-09 (RLVa-1.2.0a) +#include "rlvactions.h" +#include "rlvhandler.h" +#include "rlvinventory.h" +#include "rlvui.h" +// [/RLVa:KB] #include // #include @@ -147,10 +153,6 @@ #include "llgiveinventory.h" #include "lllandmarkactions.h" #include "lltexturefetch.h" -#include "rlvactions.h" -#include "rlvhandler.h" -#include "rlvinventory.h" -#include "rlvui.h" #include "sound_ids.h" #include "tea.h" // #include "NACLantispam.h" @@ -1624,13 +1626,12 @@ void LLOfferInfo::send_auto_receive_response(void) { // add buddy to recent people list // LLRecentPeople::instance().add(mFromID); -// [RLVa:KB] - Checked: 2010-04-20 (RLVa-1.2.2a) | Added: RLVa-1.2.0f - // RELEASE-RLVa: [RLVa-1.2.2] Make sure this stays in sync with the condition in inventory_offer_handler() - if ( (!gRlvHandler.hasBehaviour(RLV_BHVR_SHOWNAMES)) || (!RlvUtil::isNearbyAgent(mFromID)) || - (RlvUIEnabler::hasOpenIM(mFromID)) || ((RlvUIEnabler::hasOpenProfile(mFromID))) ) - { +// [RLVa:KB] - Checked: RLVa-2.0.1 + // RELEASE-RLVa: [RLVa-2.0.1] Make sure this stays in sync with the condition in inventory_offer_handler() + bool fRlvCanShowName = (!RlvActions::isRlvEnabled()) || + (RlvActions::canShowName(RlvActions::SNC_DEFAULT, mFromID)) || (!RlvUtil::isNearbyAgent(mFromID)) || (RlvUIEnabler::hasOpenIM(mFromID)) || (RlvUIEnabler::hasOpenProfile(mFromID)); + if (fRlvCanShowName) LLRecentPeople::instance().add(mFromID); - } // [/RLVa:KB] } } @@ -1989,9 +1990,11 @@ bool LLOfferInfo::inventory_task_offer_callback(const LLSD& notification, const // [SL:KB] - Checked: 2010-11-02 (RLVa-1.2.2a) | Added: RLVa-1.2.2a std::string name_slurl = LLSLURL("agent", mFromID, "about").getSLURLString(); -// [RLVa:KB] - Checked: 2010-11-02 (RLVa-1.2.2a) | Modified: RLVa-1.2.2a - // RELEASE-RLVa: [RLVa-1.2.2] Make sure this stays in sync with the condition in inventory_offer_handler() - if ( (gRlvHandler.hasBehaviour(RLV_BHVR_SHOWNAMES)) && (RlvUtil::isNearbyAgent(mFromID)) ) +// [RLVa:KB] - Checked: RLVa-2.0.1 + // RELEASE-RLVa: [RLVa-2.0.1] Make sure this stays in sync with the condition in inventory_offer_handler() + bool fRlvCanShowName = (!RlvActions::isRlvEnabled()) || + (RlvActions::canShowName(RlvActions::SNC_DEFAULT, mFromID)) || (!RlvUtil::isNearbyAgent(mFromID)) || (RlvUIEnabler::hasOpenIM(mFromID)) || (RlvUIEnabler::hasOpenProfile(mFromID)); + if (!fRlvCanShowName) name_slurl = LLSLURL("agent", mFromID, "rlvanonym").getSLURLString(); // [/RLVa:KB] @@ -2271,9 +2274,9 @@ void inventory_offer_handler(LLOfferInfo* info) // Object -> Agent Inventory Offer if (info->mFromObject && !bAutoAccept) { -// [RLVa:KB] - Checked: 2010-11-02 (RLVa-1.2.2a) | Modified: RLVa-1.2.2a +// [RLVa:KB] - Checked: RLVa-1.2.2 // Only filter if the object owner is a nearby agent - if ( (gRlvHandler.hasBehaviour(RLV_BHVR_SHOWNAMES)) && (RlvUtil::isNearbyAgent(info->mFromID)) ) + if ( (RlvActions::isRlvEnabled()) && (!RlvActions::canShowName(RlvActions::SNC_DEFAULT, info->mFromID)) && (RlvUtil::isNearbyAgent(info->mFromID)) ) { payload["rlv_shownames"] = TRUE; args["NAME_SLURL"] = LLSLURL("agent", info->mFromID, "rlvanonym").getSLURLString(); @@ -2294,10 +2297,11 @@ void inventory_offer_handler(LLOfferInfo* info) } else // Agent -> Agent Inventory Offer { -// [RLVa:KB] - Checked: 2010-11-02 (RLVa-1.2.2a) | Modified: RLVa-1.2.2a +// [RLVa:KB] - Checked: RLVa-2.0.1 // Only filter if the offer is from a nearby agent and if there's no open IM session (doesn't necessarily have to be focused) - if ( (gRlvHandler.hasBehaviour(RLV_BHVR_SHOWNAMES)) && (RlvUtil::isNearbyAgent(info->mFromID)) && - (!RlvUIEnabler::hasOpenIM(info->mFromID)) ) + bool fRlvCanShowName = (!RlvActions::isRlvEnabled()) || + (RlvActions::canShowName(RlvActions::SNC_DEFAULT, info->mFromID)) || (!RlvUtil::isNearbyAgent(info->mFromID)) || (RlvUIEnabler::hasOpenIM(info->mFromID)) || (RlvUIEnabler::hasOpenProfile(info->mFromID)); + if (!fRlvCanShowName) { payload["rlv_shownames"] = TRUE; args["NAME"] = RlvStrings::getAnonym(info->mFromName); @@ -3510,11 +3514,11 @@ void process_improved_im(LLMessageSystem *msg, void **user_data) case IM_INVENTORY_ACCEPTED: { // args["NAME"] = LLSLURL("agent", from_id, "completename").getSLURLString();; -// [RLVa:KB] - Checked: 2010-11-02 (RLVa-1.2.2a) | Modified: RLVa-1.2.2a +// [RLVa:KB] - Checked: RLVa-1.2.2 // Only anonymize the name if the agent is nearby, there isn't an open IM session to them and their profile isn't open - bool fRlvFilterName = (gRlvHandler.hasBehaviour(RLV_BHVR_SHOWNAMES)) && (RlvUtil::isNearbyAgent(from_id)) && - (!RlvUIEnabler::hasOpenProfile(from_id)) && (!RlvUIEnabler::hasOpenIM(from_id)); - args["NAME"] = LLSLURL("agent", from_id, (!fRlvFilterName) ? "completename" : "rlvanonym").getSLURLString();; + bool fRlvCanShowName = (!RlvActions::isRlvEnabled()) || + (RlvActions::canShowName(RlvActions::SNC_DEFAULT, from_id)) || (!RlvUtil::isNearbyAgent(from_id)) || (RlvUIEnabler::hasOpenProfile(from_id)) || (RlvUIEnabler::hasOpenIM(from_id)); + args["NAME"] = LLSLURL("agent", from_id, (fRlvCanShowName) ? "completename" : "rlvanonym").getSLURLString();; // [/RLVa:KB] LLSD payload; payload["from_id"] = from_id; @@ -3527,11 +3531,11 @@ void process_improved_im(LLMessageSystem *msg, void **user_data) case IM_INVENTORY_DECLINED: { // args["NAME"] = LLSLURL("agent", from_id, "completename").getSLURLString();; -// [RLVa:KB] - Checked: 2010-11-02 (RLVa-1.2.2a) | Modified: RLVa-1.2.2a +// [RLVa:KB] - Checked: RLVa-1.2.2 // Only anonymize the name if the agent is nearby, there isn't an open IM session to them and their profile isn't open - bool fRlvFilterName = (gRlvHandler.hasBehaviour(RLV_BHVR_SHOWNAMES)) && (RlvUtil::isNearbyAgent(from_id)) && - (!RlvUIEnabler::hasOpenProfile(from_id)) && (!RlvUIEnabler::hasOpenIM(from_id)); - args["NAME"] = LLSLURL("agent", from_id, (!fRlvFilterName) ? "completename" : "rlvanonym").getSLURLString();; + bool fRlvCanShowName = (!RlvActions::isRlvEnabled()) || + (RlvActions::canShowName(RlvActions::SNC_DEFAULT, from_id)) || (!RlvUtil::isNearbyAgent(from_id)) || (RlvUIEnabler::hasOpenProfile(from_id)) || (RlvUIEnabler::hasOpenIM(from_id)); + args["NAME"] = LLSLURL("agent", from_id, (fRlvCanShowName) ? "completename" : "rlvanonym").getSLURLString();; // [/RLVa:KB] LLSD payload; payload["from_id"] = from_id; @@ -3606,18 +3610,18 @@ void process_improved_im(LLMessageSystem *msg, void **user_data) LLSD query_string; query_string["owner"] = from_id; -// [RLVa:KB] - Checked: 2010-04-22 (RLVa-1.2.0f) | Added: RLVa-1.2.0f - if (rlv_handler_t::isEnabled()) +// [RLVa:KB] - Checked: RLVa-1.2.0 + if (RlvActions::isRlvEnabled()) { // NOTE: the chat message itself will be filtered in LLNearbyChatHandler::processChat() - if ( (gRlvHandler.hasBehaviour(RLV_BHVR_SHOWNAMES)) && (!from_group) && (RlvUtil::isNearbyAgent(from_id)) ) + if ( (!RlvActions::canShowName(RlvActions::SNC_DEFAULT)) && (!from_group) && (RlvUtil::isNearbyAgent(from_id)) ) { query_string["rlv_shownames"] = TRUE; RlvUtil::filterNames(name); chat.mFromName = name; } - if (gRlvHandler.hasBehaviour(RLV_BHVR_SHOWLOC)) + if (!RlvActions::canShowLocation()) { std::string::size_type idxPos = location.find('/'); if ( (std::string::npos != idxPos) && (RlvUtil::isNearbyRegion(location.substr(0, idxPos))) ) @@ -3811,7 +3815,7 @@ void process_improved_im(LLMessageSystem *msg, void **user_data) case IM_LURE_USER: case IM_TELEPORT_REQUEST: { -// [RLVa:KB] - Checked: 2013-11-08 (RLVa-1.4.9) +// [RLVa:KB] - Checked: RLVa-1.4.9 // If we auto-accept the offer/request then this will override DnD status (but we'll still let the other party know later) bool fRlvAutoAccept = (rlv_handler_t::isEnabled()) && ( ((IM_LURE_USER == dialog) && (RlvActions::autoAcceptTeleportOffer(from_id))) || @@ -3823,7 +3827,7 @@ void process_improved_im(LLMessageSystem *msg, void **user_data) return; } // else if (is_do_not_disturb) -// [RLVa:KB] - Checked: 2013-11-08 (RLVa-1.4.9) +// [RLVa:KB] - Checked: RLVa-1.4.9 else if ( (is_do_not_disturb) && (!fRlvAutoAccept) ) // [/RLVa:KB] { @@ -3894,7 +3898,7 @@ void process_improved_im(LLMessageSystem *msg, void **user_data) } } -// [RLVa:KB] - Checked: 2013-11-08 (RLVa-1.4.9) +// [RLVa:KB] - Checked: RLVa-1.4.9 if (rlv_handler_t::isEnabled()) { if ( ((IM_LURE_USER == dialog) && (!RlvActions::canAcceptTpOffer(from_id))) || @@ -3906,8 +3910,9 @@ void process_improved_im(LLMessageSystem *msg, void **user_data) return; } - // Censor lure message if: 1) restricted from receiving IMs from the sender, or 2) teleport offer and @showloc=n restricted - if ( (!RlvActions::canReceiveIM(from_id)) || ((IM_LURE_USER == dialog) && (gRlvHandler.hasBehaviour(RLV_BHVR_SHOWLOC))) ) + // Censor message if: 1) restricted from receiving IMs from the sender, or 2) teleport offer/request and @showloc=n restricted + if ( (!RlvActions::canReceiveIM(from_id)) || + ((gRlvHandler.hasBehaviour(RLV_BHVR_SHOWLOC)) && (IM_LURE_USER == dialog || IM_TELEPORT_REQUEST == dialog)) ) { message = RlvStrings::getString(RLV_STRING_HIDDEN); } @@ -3973,8 +3978,8 @@ void process_improved_im(LLMessageSystem *msg, void **user_data) params.substitutions = args; params.payload = payload; -// [RLVa:KB] - Checked: 20103-11-08 (RLVa-1.4.9) - if ( (rlv_handler_t::isEnabled()) && (fRlvAutoAccept) ) +// [RLVa:KB] - Checked: RLVa-1.4.9 + if (fRlvAutoAccept) { if (IM_LURE_USER == dialog) gRlvHandler.setCanCancelTp(false); @@ -4622,7 +4627,7 @@ void process_chat_from_simulator(LLMessageSystem *msg, void **user_data) // Filtering "rules": // avatar => filter only their name (unless it's this avie) // other => filter everything - if (gRlvHandler.hasBehaviour(RLV_BHVR_SHOWNAMES)) + if (!RlvActions::canShowName(RlvActions::SNC_DEFAULT)) { if (CHAT_SOURCE_AGENT != chat.mSourceType) { @@ -4632,19 +4637,19 @@ void process_chat_from_simulator(LLMessageSystem *msg, void **user_data) { chat.mFromName = RlvStrings::getAnonym(chat.mFromName); chat.mRlvNamesFiltered = TRUE; - } + } } // Create an "objectim" URL for objects if we're either @shownames or @showloc restricted // (we need to do this now because we won't be have enough information to do it later on) - if ( (CHAT_SOURCE_OBJECT == chat.mSourceType) && - ((gRlvHandler.hasBehaviour(RLV_BHVR_SHOWNAMES)) || (gRlvHandler.hasBehaviour(RLV_BHVR_SHOWLOC))) ) + if ( (CHAT_SOURCE_OBJECT == chat.mSourceType) && + ( (!RlvActions::canShowName(RlvActions::SNC_DEFAULT)) || (!RlvActions::canShowLocation()) ) ) { LLSD sdQuery; sdQuery["name"] = chat.mFromName; sdQuery["owner"] = owner_id; - if ( (gRlvHandler.hasBehaviour(RLV_BHVR_SHOWNAMES)) && (!is_owned_by_me) ) + if ( (!RlvActions::canShowName(RlvActions::SNC_COUNT, owner_id)) && (!is_owned_by_me) ) sdQuery["rlv_shownames"] = true; const LLViewerRegion* pRegion = LLWorld::getInstance()->getRegionFromPosAgent(chat.mPosAgent); @@ -5960,6 +5965,14 @@ void process_kill_object(LLMessageSystem *mesgsys, void **user_data) LLViewerObject *objectp = gObjectList.findObject(id); if (objectp) { +// [SL:KB] - Patch: Appearance-TeleportAttachKill | Checked: Catznip-4.0 + if ( (objectp->isAttachment()) && (gAgentAvatarp) && (gAgent.getTeleportState() != LLAgent::TELEPORT_NONE) && (objectp->permYouOwner()) ) + { + gAgentAvatarp->addPendingDetach(objectp->getRootEdit()->getID()); + continue; + } +// [/SL:KB] + // Display green bubble on kill if ( gShowObjectUpdates ) { @@ -7867,14 +7880,14 @@ void process_alert_core(const std::string& message, BOOL modal) } std::string new_msg =LLNotifications::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()) ) - { - if (gRlvHandler.hasBehaviour(RLV_BHVR_SHOWLOC)) - RlvUtil::filterLocation(new_msg); - if (gRlvHandler.hasBehaviour(RLV_BHVR_SHOWNAMES)) - RlvUtil::filterNames(new_msg); - } +// [RLVa:KB] - Checked: RLVa-1.4.5 + if ( (new_msg == text) && (RlvActions::isRlvEnabled()) ) + { + if (!RlvActions::canShowLocation()) + RlvUtil::filterLocation(new_msg); + if (!RlvActions::canShowName(RlvActions::SNC_DEFAULT)) + RlvUtil::filterNames(new_msg); + } // [/RLVa:KB] args["MESSAGE"] = new_msg; LLNotificationsUtil::add("SystemMessage", args); @@ -7883,12 +7896,12 @@ void process_alert_core(const std::string& message, BOOL modal) { LLSD args; std::string new_msg =LLNotifications::instance().getGlobalString(message); -// [RLVa:KB] - Checked: 2012-02-07 (RLVa-1.4.5) | Added: RLVa-1.4.5 - if ( (new_msg == message) && (rlv_handler_t::isEnabled()) ) +// [RLVa:KB] - Checked: RLVa-1.4.5 + if ( (new_msg == message) && (RlvActions::isRlvEnabled()) ) { - if (gRlvHandler.hasBehaviour(RLV_BHVR_SHOWLOC)) + if (!RlvActions::canShowLocation()) RlvUtil::filterLocation(new_msg); - if (gRlvHandler.hasBehaviour(RLV_BHVR_SHOWNAMES)) + if (!RlvActions::canShowName(RlvActions::SNC_DEFAULT)) RlvUtil::filterNames(new_msg); } // [/RLVa:KB] @@ -7907,12 +7920,12 @@ void process_alert_core(const std::string& message, BOOL modal) std::string localized_msg; bool is_message_localized = LLTrans::findString(localized_msg, new_msg); -// [RLVa:KB] - Checked: 2012-02-07 (RLVa-1.4.5) | Added: RLVa-1.4.5 - if ( (new_msg == message) && (rlv_handler_t::isEnabled()) ) +// [RLVa:KB] - Checked: RLVa-1.4.5 + if ( (new_msg == message) && (RlvActions::isRlvEnabled()) ) { - if (gRlvHandler.hasBehaviour(RLV_BHVR_SHOWLOC)) + if (!RlvActions::canShowLocation()) RlvUtil::filterLocation(new_msg); - if (gRlvHandler.hasBehaviour(RLV_BHVR_SHOWNAMES)) + if (!RlvActions::canShowName(RlvActions::SNC_DEFAULT)) RlvUtil::filterNames(new_msg); } // [/RLVa:KB] @@ -8947,20 +8960,14 @@ void send_lures(const LLSD& notification, const LLSD& response) LLAgentUI::buildSLURL(slurl); text.append("\r\n").append(slurl.getSLURLString()); -// [RLVa:KB] - Checked: 2010-11-30 (RLVa-1.3.0) - if ( (RlvActions::hasBehaviour(RLV_BHVR_SENDIM)) || (RlvActions::hasBehaviour(RLV_BHVR_SENDIMTO)) ) - { - // Filter the lure message if one of the recipients of the lure can't be sent an IM to - for (LLSD::array_const_iterator it = notification["payload"]["ids"].beginArray(); - it != notification["payload"]["ids"].endArray(); ++it) - { - if (!RlvActions::canSendIM(it->asUUID())) - { - text = RlvStrings::getString(RLV_STRING_HIDDEN); - break; - } - } - } +// [RLVa:KB] - Checked: RLVa-2.0.0 + // Filter the lure message if any of the recipients are IM-blocked + const LLSD& sdRecipients = notification["payload"]["ids"]; + if ( (gRlvHandler.isEnabled()) && + (std::any_of(sdRecipients.beginArray(), sdRecipients.endArray(), [](const LLSD& id) { return !RlvActions::canStartIM(id.asUUID()) || !RlvActions::canSendIM(id.asUUID()); })) ) + { + text = RlvStrings::getString(RLV_STRING_HIDDEN); + } // [/RLVa:KB] LLMessageSystem* msg = gMessageSystem; @@ -8982,12 +8989,18 @@ void send_lures(const LLSD& notification, const LLSD& response) // Record the offer. { +// [RLVa:KB] - Checked: RLVa-2.0.1 + bool fRlvCanShowName = (!notification["payload"].has("rlv_shownames")) ? true : !notification["payload"]["rlv_shownames"].asBoolean(); +// [/RLVa:KB] // Show complete name for TP lures //std::string target_name; //gCacheName->getFullName(target_id, target_name); // for im log filenames LLSD args; //args["TO_NAME"] = LLSLURL("agent", target_id, "displayname").getSLURLString();; - args["TO_NAME"] = LLSLURL("agent", target_id, "completename").getSLURLString(); +// [RLVa:KB] - Checked: 2014-03-31 (Catznip-3.6) + args["TO_NAME"] = LLSLURL("agent", target_id, (fRlvCanShowName) ? "completename" : "rlvanonym").getSLURLString();; +// [/RLVa:KB] +// args["TO_NAME"] = LLSLURL("agent", target_id, "completename").getSLURLString(); // LLSD payload; @@ -8998,7 +9011,11 @@ void send_lures(const LLSD& notification, const LLSD& response) LLNotificationsUtil::add("TeleportOfferSent", args, payload); // Add the recepient to the recent people list. - LLRecentPeople::instance().add(target_id); +// [RLVa:KB] - Checked: RLVa-2.0.1 + if (fRlvCanShowName) + LLRecentPeople::instance().add(target_id); +// [/RLVa:KB] +// LLRecentPeople::instance().add(target_id); } } gAgent.sendReliableMessage(); @@ -9044,30 +9061,37 @@ void handle_lure(const uuid_vec_t& ids) LLSD edit_args; // [RLVa:KB] - Checked: 2010-04-07 (RLVa-1.2.0d) | Modified: RLVa-1.0.0a - edit_args["REGION"] = - (!gRlvHandler.hasBehaviour(RLV_BHVR_SHOWLOC)) ? gAgent.getRegion()->getName() : RlvStrings::getString(RLV_STRING_HIDDEN); + edit_args["REGION"] = (!gRlvHandler.hasBehaviour(RLV_BHVR_SHOWLOC)) ? gAgent.getRegion()->getName() : RlvStrings::getString(RLV_STRING_HIDDEN); // [/RLVa:KB] // edit_args["REGION"] = gAgent.getRegion()->getName(); LLSD payload; - for (std::vector::const_iterator it = ids.begin(); - it != ids.end(); - ++it) +// [RLVa:KB] - Checked: RLVa-2.0.1 + bool fRlvShouldHideNames = false; + for (const LLUUID& idAgent : ids) { -// [RLVa:KB] - Checked: 2010-04-07 (RLVa-1.2.0d) | Modified: RLVa-1.0.0a // Only allow offering teleports if everyone is a @tplure exception or able to map this avie under @showloc=n if (gRlvHandler.hasBehaviour(RLV_BHVR_SHOWLOC)) { - const LLRelationship* pBuddyInfo = LLAvatarTracker::instance().getBuddyInfo(*it); - if ( (!gRlvHandler.isException(RLV_BHVR_TPLURE, *it, RLV_CHECK_PERMISSIVE)) && + const LLRelationship* pBuddyInfo = LLAvatarTracker::instance().getBuddyInfo(idAgent); + if ( (!gRlvHandler.isException(RLV_BHVR_TPLURE, idAgent, RLV_CHECK_PERMISSIVE)) && ((!pBuddyInfo) || (!pBuddyInfo->isOnline()) || (!pBuddyInfo->isRightGrantedTo(LLRelationship::GRANT_MAP_LOCATION))) ) { + RlvUtil::notifyBlocked(RLV_STRING_BLOCKED_TELEPORT_OFFER); return; } } -// [/RLVa:KB] - payload["ids"].append(*it); + fRlvShouldHideNames |= !RlvActions::canShowName(RlvActions::SNC_TELEPORTOFFER, idAgent); + payload["ids"].append(idAgent); } + payload["rlv_shownames"] = fRlvShouldHideNames; +// [/RLVa:KB] +// for (std::vector::const_iterator it = ids.begin(); +// it != ids.end(); +// ++it) +// { +// payload["ids"].append(*it); +// } if (gAgent.isGodlike()) { LLNotificationsUtil::add("OfferTeleportFromGod", edit_args, payload, handle_lure_callback); diff --git a/indra/newview/llviewerobject.cpp b/indra/newview/llviewerobject.cpp index a353b5b262..1e7538f525 100644 --- a/indra/newview/llviewerobject.cpp +++ b/indra/newview/llviewerobject.cpp @@ -103,6 +103,7 @@ #include "llfloaterperms.h" #include "llvocache.h" // [RLVa:KB] - Checked: 2011-05-22 (RLVa-1.3.1a) +#include "rlvactions.h" #include "rlvhandler.h" #include "rlvlocks.h" // [/RLVa:KB] @@ -5910,7 +5911,7 @@ BOOL LLViewerObject::permTransfer() const BOOL LLViewerObject::allowOpen() const { // [RLVa:KB] - Checked: 2010-11-29 (RLVa-1.3.0c) | Modified: RLVa-1.3.0c - return !flagInventoryEmpty() && (permYouOwner() || permModify()) && ((!rlv_handler_t::isEnabled()) || (gRlvHandler.canEdit(this))); + return !flagInventoryEmpty() && (permYouOwner() || permModify()) && ((!RlvActions::isRlvEnabled()) || (RlvActions::canEdit(this))); // [/RLVa:KB] // return !flagInventoryEmpty() && (permYouOwner() || permModify()); } diff --git a/indra/newview/llviewerobjectlist.cpp b/indra/newview/llviewerobjectlist.cpp index 31663e1c57..590198ce9e 100644 --- a/indra/newview/llviewerobjectlist.cpp +++ b/indra/newview/llviewerobjectlist.cpp @@ -766,6 +766,29 @@ void LLViewerObjectList::dirtyAllObjectInventory() } } +// [SL:KB] - Patch: Render-TextureToggle (Catznip-4.0) +void LLViewerObjectList::setAllObjectDefaultTextures(U32 nChannel, bool fShowDefault) +{ + LLPipeline::sRenderTextures = !fShowDefault; + + for (LLViewerObject* pObj : mObjects) + { + LLDrawable* pDrawable = pObj->mDrawable; + if ( (pDrawable) && (!pDrawable->isDead()) ) + { + for (int idxFace = 0, cntFace = pDrawable->getNumFaces(); idxFace < cntFace; idxFace++) + { + if (LLFace* pFace = pDrawable->getFace(idxFace)) + pFace->setDefaultTexture(nChannel, fShowDefault); + } + + if (LLVOVolume* pVoVolume = pDrawable->getVOVolume()) + pVoVolume->markForUpdate(true); + } + } +} +// [/SL:KB] + void LLViewerObjectList::updateApparentAngles(LLAgent &agent) { S32 i; diff --git a/indra/newview/llviewerobjectlist.h b/indra/newview/llviewerobjectlist.h index a0a65b91fa..96bbf4a4b1 100644 --- a/indra/newview/llviewerobjectlist.h +++ b/indra/newview/llviewerobjectlist.h @@ -124,6 +124,9 @@ public: void resetObjectBeacons(); void dirtyAllObjectInventory(); +// [SL:KB] - Patch: Render-TextureToggle (Catznip-4.0) + void setAllObjectDefaultTextures(U32 nChannel, bool fShowDefault); +// [/SL:KB] void removeFromActiveList(LLViewerObject* objectp); void updateActive(LLViewerObject *objectp); diff --git a/indra/newview/llviewerparcelmgr.cpp b/indra/newview/llviewerparcelmgr.cpp index aa799b3469..7462840b99 100644 --- a/indra/newview/llviewerparcelmgr.cpp +++ b/indra/newview/llviewerparcelmgr.cpp @@ -2587,6 +2587,13 @@ boost::signals2::connection LLViewerParcelMgr::setTeleportFailedCallback(telepor return mTeleportFailedSignal.connect(cb); } +// [SL:KB] - Patch: Appearance-TeleportAttachKill | Checked: Catznip-4.0 +boost::signals2::connection LLViewerParcelMgr::setTeleportDoneCallback(teleport_done_callback_t cb) +{ + return mTeleportDoneSignal.connect(cb); +} +// [/SL:KB] + /* Ok, we're notified that teleport has been finished. * We should now propagate the notification via mTeleportFinishedSignal * to all interested parties. @@ -2615,6 +2622,13 @@ void LLViewerParcelMgr::onTeleportFailed() mTeleportFailedSignal(); } +// [SL:KB] - Patch: Appearance-TeleportAttachKill | Checked: Catznip-4.0 +void LLViewerParcelMgr::onTeleportDone() +{ + mTeleportDoneSignal(); +} +// [/SL:KB] + // [SL:KB] - Patch: World-MinimapOverlay | Checked: 2012-06-20 (Catznip-3.3) boost::signals2::connection LLViewerParcelMgr::setCollisionUpdateCallback(const collision_update_signal_t::slot_type& cb) { diff --git a/indra/newview/llviewerparcelmgr.h b/indra/newview/llviewerparcelmgr.h index dccb8d1925..9601aaf421 100644 --- a/indra/newview/llviewerparcelmgr.h +++ b/indra/newview/llviewerparcelmgr.h @@ -81,6 +81,10 @@ public: typedef boost::signals2::signal teleport_finished_signal_t; typedef boost::function teleport_failed_callback_t; typedef boost::signals2::signal teleport_failed_signal_t; +// [SL:KB] - Patch: Appearance-TeleportAttachKill | Checked: Catznip-4.0 + typedef boost::function teleport_done_callback_t; + typedef boost::signals2::signal teleport_done_signal_t; +// [/SL:KB] LLViewerParcelMgr(); ~LLViewerParcelMgr(); @@ -298,8 +302,14 @@ public: boost::signals2::connection setTeleportFinishedCallback(teleport_finished_callback_t cb); boost::signals2::connection setTeleportFailedCallback(teleport_failed_callback_t cb); +// [SL:KB] - Patch: Appearance-TeleportAttachKill | Checked: Catznip-4.0 + boost::signals2::connection setTeleportDoneCallback(teleport_done_callback_t cb); +// [/SL:KB] void onTeleportFinished(bool local, const LLVector3d& new_pos); void onTeleportFailed(); +// [SL:KB] - Patch: Appearance-TeleportAttachKill | Checked: Catznip-4.0 + void onTeleportDone(); +// [/SL:KB] static BOOL isParcelOwnedByAgent(const LLParcel* parcelp, U64 group_proxy_power); static BOOL isParcelModifiableByAgent(const LLParcel* parcelp, U64 group_proxy_power); @@ -354,6 +364,9 @@ private: LLVector3d mTeleportInProgressPosition; teleport_finished_signal_t mTeleportFinishedSignal; teleport_failed_signal_t mTeleportFailedSignal; +// [SL:KB] - Patch: Appearance-TeleportAttachKill | Checked: Catznip-4.0 + teleport_done_signal_t mTeleportDoneSignal; +// [/SL:KB] // Array of pieces of parcel edges to potentially draw // Has (parcels_per_edge + 1) * (parcels_per_edge + 1) elements so diff --git a/indra/newview/llviewerstats.cpp b/indra/newview/llviewerstats.cpp index d7b6f021e0..e93c076fe5 100644 --- a/indra/newview/llviewerstats.cpp +++ b/indra/newview/llviewerstats.cpp @@ -313,7 +313,12 @@ U32Bytes gTotalWorldData, U32 gSimPingCount = 0; U32Bits gObjectData; F32Milliseconds gAvgSimPing(0.f); +// Deal with Clang C++11 pedantry +#if LL_CLANG +U32Bytes gTotalTextureBytesPerBoostLevel[LLViewerTexture::MAX_GL_IMAGE_CATEGORY]; +#else U32Bytes gTotalTextureBytesPerBoostLevel[LLViewerTexture::MAX_GL_IMAGE_CATEGORY] = {U32Bytes(0)}; +#endif extern U32 gVisCompared; extern U32 gVisTested; diff --git a/indra/newview/llviewertexture.cpp b/indra/newview/llviewertexture.cpp index 88d421ff33..3e6424e7c6 100644 --- a/indra/newview/llviewertexture.cpp +++ b/indra/newview/llviewertexture.cpp @@ -85,6 +85,9 @@ LLPointer LLViewerFetchedTexture::sWhiteImagep = NULL; LLPointer LLViewerFetchedTexture::sDefaultImagep = NULL; LLPointer LLViewerFetchedTexture::sSmokeImagep = NULL; LLPointer LLViewerFetchedTexture::sFlatNormalImagep = NULL; +// [SL:KB] - Patch: Render-TextureToggle (Catznip-4.0) +LLPointer LLViewerFetchedTexture::sDefaultDiffuseImagep = NULL; +// [/SL:KB] LLViewerMediaTexture::media_map_t LLViewerMediaTexture::sMediaMap; LLTexturePipelineTester* LLViewerTextureManager::sTesterp = NULL; const std::string sTesterName("TextureTester"); diff --git a/indra/newview/llviewertexture.h b/indra/newview/llviewertexture.h index 8fcd0660d8..04afa120e4 100644 --- a/indra/newview/llviewertexture.h +++ b/indra/newview/llviewertexture.h @@ -561,6 +561,9 @@ public: static LLPointer sDefaultImagep; // "Default" texture for error cases, the only case of fetched texture which is generated in local. static LLPointer sSmokeImagep; // Old "Default" translucent texture static LLPointer sFlatNormalImagep; // Flat normal map denoting no bumpiness on a surface +// [SL:KB] - Patch: Render-TextureToggle (Catznip-4.0) + static LLPointer sDefaultDiffuseImagep; +// [/SL:KB] }; // diff --git a/indra/newview/llviewerwindow.cpp b/indra/newview/llviewerwindow.cpp index 730d82e91f..5fa0ddec08 100644 --- a/indra/newview/llviewerwindow.cpp +++ b/indra/newview/llviewerwindow.cpp @@ -4496,9 +4496,8 @@ LLViewerObject* LLViewerWindow::cursorIntersect(S32 mouse_x, S32 mouse_y, F32 de } } -// [RLVa:KB] - Checked: 2010-01-02 (RLVa-1.1.0l) | Added: RLVa-1.1.0l -#ifdef RLV_EXTENSION_CMD_INTERACT - if ( (rlv_handler_t::isEnabled()) && (found) && (gRlvHandler.hasBehaviour(RLV_BHVR_INTERACT)) ) +// [RLVa:KB] - Checked: RLVa-1.2.0 + if ( (found) && ((gTeleportDisplay) || ((rlv_handler_t::isEnabled()) && (found) && (gRlvHandler.hasBehaviour(RLV_BHVR_INTERACT)))) ) { // Allow picking if: // - the drag-and-drop tool is active (allows inventory offers) @@ -4506,14 +4505,13 @@ LLViewerObject* LLViewerWindow::cursorIntersect(S32 mouse_x, S32 mouse_y, F32 de // - the pie tool is active *and* we picked our own avie (allows "mouse steering" and the self pie menu) LLTool* pCurTool = LLToolMgr::getInstance()->getCurrentTool(); if ( (LLToolDragAndDrop::getInstance() != pCurTool) && - (!LLToolCamera::getInstance()->hasMouseCapture()) && - ((LLToolPie::getInstance() != pCurTool) || (gAgent.getID() != found->getID())) ) + (!LLToolCamera::getInstance()->hasMouseCapture()) && + ((LLToolPie::getInstance() != pCurTool) || (gAgent.getID() != found->getID())) ) { found = NULL; } -#endif // RLV_EXTENSION_CMD_INTERACT -// [/RLVa:KB] } +// [/RLVa:KB] } return found; diff --git a/indra/newview/llvoavatar.cpp b/indra/newview/llvoavatar.cpp index 306225f723..5a1b8f8238 100644 --- a/indra/newview/llvoavatar.cpp +++ b/indra/newview/llvoavatar.cpp @@ -98,7 +98,8 @@ #include "llanimstatelabels.h" #include "lltrans.h" #include "llappearancemgr.h" -// [RLVa:KB] - Checked: 2010-04-01 (RLVa-1.2.0c) +// [RLVa:KB] - Checked: RLVa-2.0.1 +#include "rlvactions.h" #include "rlvhandler.h" // [/RLVa:KB] @@ -2802,8 +2803,13 @@ void LLVOAvatar::idleUpdateNameTag(const LLVector3& root_pos_last) const F32 time_visible = mTimeVisible.getElapsedTimeF32(); const F32 NAME_SHOW_TIME = F32(renderNameShowTime); // seconds const F32 FADE_DURATION = F32(renderNameFadeDuration); // seconds -// [RLVa:KB] - Checked: 2010-04-04 (RLVa-1.2.2a) | Added: RLVa-0.2.0b - bool fRlvShowNames = gRlvHandler.hasBehaviour(RLV_BHVR_SHOWNAMES); +// [RLVa:KB] - Checked: RLVa-2.0.1 + bool fRlvShowAvTag = true, fRlvShowAvName = true; + if (RlvActions::isRlvEnabled()) + { + fRlvShowAvTag = RlvActions::canShowName(RlvActions::SNC_NAMETAG, getID()); + fRlvShowAvName = (fRlvShowAvTag) && (RlvActions::canShowName(RlvActions::SNC_DEFAULT, getID())); + } // [/RLVa:KB] BOOL visible_avatar = isVisible() || mNeedsAnimUpdate; BOOL visible_chat = useChatBubbles && (mChats.size() || mTyping); @@ -2811,8 +2817,8 @@ void LLVOAvatar::idleUpdateNameTag(const LLVector3& root_pos_last) BOOL render_name = visible_chat || visible_typing || (visible_avatar && -// [RLVa:KB] - Checked: 2010-04-04 (RLVa-1.2.2a) | Added: RLVa-1.0.0h - ( (!fRlvShowNames) || (RlvSettings::getShowNameTags()) ) && +// [RLVa:KB] - Checked: RLVa-2.0.1 + (fRlvShowAvTag) && // [/RLVa:KB] ((sRenderName == RENDER_NAME_ALWAYS) || (sRenderName == RENDER_NAME_FADE && time_visible < NAME_SHOW_TIME))); @@ -2850,8 +2856,8 @@ void LLVOAvatar::idleUpdateNameTag(const LLVector3& root_pos_last) new_name = TRUE; } -// [RLVa:KB] - Checked: 2010-04-04 (RLVa-1.2.2a) | Added: RLVa-0.2.0b - if (fRlvShowNames) +// [RLVa:KB] - Checked: RLVa-0.2.0 + if (!fRlvShowAvName) { if (mRenderGroupTitles) { @@ -2936,8 +2942,8 @@ void LLVOAvatar::idleUpdateNameTagText(BOOL new_name) static const F32 chat_range_shout_squared = LFSimFeatureHandler::getInstance()->shoutRange() * LFSimFeatureHandler::getInstance()->shoutRange(); // -// [RLVa:KB] - Checked: 2010-10-31 (RLVa-1.2.2a) | Added: RLVa-1.2.2a - bool fRlvShowNames = gRlvHandler.hasBehaviour(RLV_BHVR_SHOWNAMES); +// [RLVa:KB] - Checked: RLVa-2.0.1 + bool fRlvShowAvName = RlvActions::canShowName(RlvActions::SNC_DEFAULT, getID()); // [/RLVa:KB] // Show auto-response in nametag static LLCachedControl fsAutorespondMode(gSavedPerAccountSettings, "FSAutorespondMode"); @@ -2962,8 +2968,8 @@ void LLVOAvatar::idleUpdateNameTagText(BOOL new_name) is_muted = isInMuteList(); } // bool is_friend = LLAvatarTracker::instance().isBuddy(getID()); -// [RLVa:KB] - Checked: 2010-10-31 (RLVa-1.2.2a) | Added: RLVa-1.2.2a - bool is_friend = (!fRlvShowNames) && (LLAvatarTracker::instance().isBuddy(getID())); +// [RLVa:KB] - Checked: RLVa-1.2.2 + bool is_friend = (fRlvShowAvName) && (LLAvatarTracker::instance().isBuddy(getID())); // [/RLVa:KB] bool is_cloud = getIsCloud(); @@ -3160,8 +3166,8 @@ void LLVOAvatar::idleUpdateNameTagText(BOOL new_name) } // if (sRenderGroupTitles -// [RLVa:KB] - Checked: 2010-10-31 (RLVa-1.2.2a) | Modified: RLVa-1.2.2a - if (sRenderGroupTitles && !fRlvShowNames +// [RLVa:KB] - Checked: RLVa-1.2.2 + if (sRenderGroupTitles && fRlvShowAvName // [/RLVa:KB] && title && title->getString() && title->getString()[0] != '\0') { @@ -3186,8 +3192,8 @@ void LLVOAvatar::idleUpdateNameTagText(BOOL new_name) clearNameTag(); } -// [RLVa:KB] - Checked: 2010-10-31 (RLVa-1.2.2a) | Modified: RLVa-1.2.2a - if ( (!fRlvShowNames) || (isSelf()) ) +// [RLVa:KB] - Checked: RLVa-1.2.2 + if ( (fRlvShowAvName) || (isSelf()) ) { // [/RLVa:KB] // Might be blank if name not available yet, that's OK @@ -3224,7 +3230,7 @@ void LLVOAvatar::idleUpdateNameTagText(BOOL new_name) addNameTagLine(username, username_color, LLFontGL::NORMAL, LLFontGL::getFontSansSerifSmall()); } -// [RLVa:KB] - Checked: 2010-10-31 (RLVa-1.2.2a) | Modified: RLVa-1.2.2a +// [RLVa:KB] - Checked: RLVa-1.2.2 } else { @@ -3236,8 +3242,8 @@ void LLVOAvatar::idleUpdateNameTagText(BOOL new_name) { const LLFontGL* font = LLFontGL::getFontSansSerif(); std::string full_name = LLCacheName::buildFullName( firstname->getString(), lastname->getString() ); -// [RLVa:KB] - Checked: 2010-10-31 (RLVa-1.2.2a) | Modified: RLVa-1.2.2a - if ( (fRlvShowNames) && (!isSelf()) ) +// [RLVa:KB] - Checked: RLVa-1.2.2 + if ( (!fRlvShowAvName) && (!isSelf()) ) { full_name = RlvStrings::getAnonym(full_name); addNameTagLine(full_name, name_tag_color, LLFontGL::NORMAL, font, true); @@ -9187,7 +9193,8 @@ void LLVOAvatar::calculateUpdateRenderComplexity() static const U32 COMPLEXITY_BODY_PART_COST = 200; // Diagnostic list of all textures on our avatar - static std::set all_textures; + // Disable useless diagnostics + //static std::set all_textures; if (mVisualComplexityStale) { @@ -9283,41 +9290,43 @@ void LLVOAvatar::calculateUpdateRenderComplexity() // Diagnostic output to identify all avatar-related textures. // Does not affect rendering cost calculation. // Could be wrapped in a debug option if output becomes problematic. - if (isSelf()) - { - // print any attachment textures we didn't already know about. - for (LLVOVolume::texture_cost_t::iterator it = textures.begin(); it != textures.end(); ++it) - { - LLUUID image_id = it->first; - if( ! (image_id.isNull() || image_id == IMG_DEFAULT || image_id == IMG_DEFAULT_AVATAR) - && (all_textures.find(image_id) == all_textures.end())) - { - // attachment texture not previously seen. - LL_INFOS() << "attachment_texture: " << image_id.asString() << LL_ENDL; - all_textures.insert(image_id); - } - } + // Disable useless diagnostics + //if (isSelf()) + //{ + // // print any attachment textures we didn't already know about. + // for (LLVOVolume::texture_cost_t::iterator it = textures.begin(); it != textures.end(); ++it) + // { + // LLUUID image_id = it->first; + // if( ! (image_id.isNull() || image_id == IMG_DEFAULT || image_id == IMG_DEFAULT_AVATAR) + // && (all_textures.find(image_id) == all_textures.end())) + // { + // // attachment texture not previously seen. + // LL_INFOS() << "attachment_texture: " << image_id.asString() << LL_ENDL; + // all_textures.insert(image_id); + // } + // } - // print any avatar textures we didn't already know about - for (LLAvatarAppearanceDictionary::Textures::const_iterator iter = LLAvatarAppearanceDictionary::getInstance()->getTextures().begin(); - iter != LLAvatarAppearanceDictionary::getInstance()->getTextures().end(); - ++iter) - { - const LLAvatarAppearanceDictionary::TextureEntry *texture_dict = iter->second; - // TODO: MULTI-WEARABLE: handle multiple textures for self - const LLViewerTexture* te_image = getImage(iter->first,0); - if (!te_image) - continue; - LLUUID image_id = te_image->getID(); - if( image_id.isNull() || image_id == IMG_DEFAULT || image_id == IMG_DEFAULT_AVATAR) - continue; - if (all_textures.find(image_id) == all_textures.end()) - { - LL_INFOS() << "local_texture: " << texture_dict->mName << ": " << image_id << LL_ENDL; - all_textures.insert(image_id); - } - } - } + // // print any avatar textures we didn't already know about + // for (LLAvatarAppearanceDictionary::Textures::const_iterator iter = LLAvatarAppearanceDictionary::getInstance()->getTextures().begin(); + // iter != LLAvatarAppearanceDictionary::getInstance()->getTextures().end(); + // ++iter) + // { + // const LLAvatarAppearanceDictionary::TextureEntry *texture_dict = iter->second; + // // TODO: MULTI-WEARABLE: handle multiple textures for self + // const LLViewerTexture* te_image = getImage(iter->first,0); + // if (!te_image) + // continue; + // LLUUID image_id = te_image->getID(); + // if( image_id.isNull() || image_id == IMG_DEFAULT || image_id == IMG_DEFAULT_AVATAR) + // continue; + // if (all_textures.find(image_id) == all_textures.end()) + // { + // LL_INFOS() << "local_texture: " << texture_dict->mName << ": " << image_id << LL_ENDL; + // all_textures.insert(image_id); + // } + // } + //} + // if ( cost != mVisualComplexity ) { diff --git a/indra/newview/llvoavatarself.cpp b/indra/newview/llvoavatarself.cpp index a57aee677a..2123440e58 100644 --- a/indra/newview/llvoavatarself.cpp +++ b/indra/newview/llvoavatarself.cpp @@ -78,10 +78,15 @@ #include "llstartup.h" #include "llsdserialize.h" #include "llcorehttputil.h" -// [RLVa:KB] - Checked: 2011-05-22 (RLVa-1.3.1a) +// [RLVa:KB] - Checked: RLVa-2.0.2 #include "rlvhandler.h" +#include "rlvhelper.h" #include "rlvlocks.h" // [/RLVa:KB] +// [SL:KB] - Patch: Appearance-TeleportAttachKill | Checked: Catznip-4.0 +#include "llviewerparcelmgr.h" +extern BOOL gTeleportDisplay; +// [/SL:KB] // [Legacy Bake] #ifdef OPENSIM @@ -1266,12 +1271,25 @@ void LLVOAvatarSelf::updateAttachmentVisibility(U32 camera_mode) } else { +// [RLVa:KB] - Checked: RLVa-2.0.2 + bool fRlvCanShowAttachment = true; + if (rlv_handler_t::isEnabled()) + { + fRlvCanShowAttachment = + (!gRlvHandler.hasBehaviour(RLV_BHVR_SHOWSELF)) && + ( (!gRlvHandler.hasBehaviour(RLV_BHVR_SHOWSELFHEAD)) || (RLV_ATTACHGROUP_HEAD != rlvAttachGroupFromIndex(attachment->getGroup())) ); + } +// [/RLVa:KB] + switch (camera_mode) { case CAMERA_MODE_MOUSELOOK: if (LLVOAvatar::sVisibleInFirstPerson && attachment->getVisibleInFirstPerson()) { - attachment->setAttachmentVisibility(TRUE); +// [RLVa:KB] - Checked: RLVa-2.0.2 + attachment->setAttachmentVisibility(fRlvCanShowAttachment); +// [/RLVa:KB] +// attachment->setAttachmentVisibility(TRUE); } else { @@ -1279,7 +1297,10 @@ void LLVOAvatarSelf::updateAttachmentVisibility(U32 camera_mode) } break; default: - attachment->setAttachmentVisibility(TRUE); +// [RLVa:KB] - Checked: RLVa-2.0.2 + attachment->setAttachmentVisibility(fRlvCanShowAttachment); +// [/RLVa:KB] +// attachment->setAttachmentVisibility(TRUE); break; } } @@ -3266,6 +3287,60 @@ void LLVOAvatarSelf::dumpWearableInfo(LLAPRFile& outfile) apr_file_printf( file, "\n\n" ); } +// [SL:KB] - Patch: Appearance-TeleportAttachKill | Checked: Catznip-4.0 +void LLVOAvatarSelf::addPendingDetach(const LLUUID& idObject) +{ + if (mPendingObjectDetach.end() == std::find(mPendingObjectDetach.begin(), mPendingObjectDetach.end(), idObject)) + mPendingObjectDetach.push_back(idObject); + + if ((!mPendingObjectDetach.empty()) && (!mTeleportDoneConn.connected())) + mTeleportDoneConn = LLViewerParcelMgr::instance().setTeleportDoneCallback(boost::bind(&LLVOAvatarSelf::onTeleportDone, this)); +} + +bool LLVOAvatarSelf::isPendingDetach(const LLUUID& idObject) const +{ + return mPendingObjectDetach.end() != std::find(mPendingObjectDetach.begin(), mPendingObjectDetach.end(), idObject); +} + +void LLVOAvatarSelf::removePendingDetach(const LLUUID& idObject) +{ + auto itPendingDetach = std::find(mPendingObjectDetach.begin(), mPendingObjectDetach.end(), idObject); + if (mPendingObjectDetach.end() != itPendingDetach) + mPendingObjectDetach.erase(itPendingDetach); + + if (mPendingObjectDetach.empty()) + mTeleportDoneConn.disconnect(); +} + +void LLVOAvatarSelf::onTeleportDone() +{ + mTeleportDoneConn.disconnect(); + doAfterInterval(boost::bind(&LLVOAvatarSelf::checkPendingDetach, this), 30.f); +} + +void LLVOAvatarSelf::checkPendingDetach() +{ + if (gTeleportDisplay) + return; + + for (const LLUUID& idObj : mPendingObjectDetach) + { + LLViewerObject* pObject = gObjectList.findObject(idObj); + if (pObject) + { + gObjectList.killObject(pObject); + if (gShowObjectUpdates) + { + LLColor4 color(0.f, 1.f, 0.f, 1.f); + gPipeline.addDebugBlip(pObject->getPositionAgent(), color); + } + LLSelectMgr::getInstance()->removeObjectFromSelections(idObj); + } + } + mPendingObjectDetach.clear(); +} +// [/SL:KB] + // [RLVa:KB] - Checked: 2013-03-03 (RLVa-1.4.8) F32 LLVOAvatarSelf::getAvatarOffset() /*const*/ { diff --git a/indra/newview/llvoavatarself.h b/indra/newview/llvoavatarself.h index f8c5e203d5..f1af6cb271 100644 --- a/indra/newview/llvoavatarself.h +++ b/indra/newview/llvoavatarself.h @@ -450,6 +450,19 @@ private: void appearanceChangeMetricsCoro(std::string url); bool mInitialMetric; S32 mMetricSequence; + +// [SL:KB] - Patch: Appearance-TeleportAttachKill | Checked: Catznip-4.0 +public: + void addPendingDetach(const LLUUID& idObject); + bool isPendingDetach(const LLUUID& idObject) const; + void removePendingDetach(const LLUUID& idObject); + void checkPendingDetach(); + void onTeleportDone(); +protected: + std::list mPendingObjectDetach; + boost::signals2::connection mTeleportDoneConn; +// [/SL:KB] + /** Diagnostics ** ** *******************************************************************************/ diff --git a/indra/newview/llvoicevivox.cpp b/indra/newview/llvoicevivox.cpp index 077d8d8ea4..84946ce5a3 100644 --- a/indra/newview/llvoicevivox.cpp +++ b/indra/newview/llvoicevivox.cpp @@ -985,14 +985,17 @@ bool LLVivoxVoiceClient::loginToVivox() errs << mVoiceAccountServerURI << "\n:UDP: 3478, 3479, 5060, 5062, 12000-17000"; args["HOSTID"] = errs.str(); mTerminateDaemon = true; - if (LLGridManager::getInstance()->isSystemGrid()) - { - LLNotificationsUtil::add("NoVoiceConnect", args); - } - else - { - LLNotificationsUtil::add("NoVoiceConnect-GIAB", args); - } + // FIRE-13130 / FIRE-19552: Unknown notification "NoVoiceConnect-GIAB" + //if (LLGridManager::getInstance()->isSystemGrid()) + //{ + // LLNotificationsUtil::add("NoVoiceConnect", args); + //} + //else + //{ + // LLNotificationsUtil::add("NoVoiceConnect-GIAB", args); + //} + LLNotificationsUtil::add("NoVoiceConnect", args); + // mIsLoggingIn = false; return false; @@ -2884,14 +2887,17 @@ void LLVivoxVoiceClient::connectorCreateResponse(int statusCode, std::string &st errs << mVoiceAccountServerURI << "\n:UDP: 3478, 3479, 5060, 5062, 12000-17000"; args["HOSTID"] = errs.str(); mTerminateDaemon = true; - if (LLGridManager::getInstance()->isSystemGrid()) - { - LLNotificationsUtil::add("NoVoiceConnect", args); - } - else - { - LLNotificationsUtil::add("NoVoiceConnect-GIAB", args); - } + // FIRE-13130 / FIRE-19552: Unknown notification "NoVoiceConnect-GIAB" + //if (LLGridManager::getInstance()->isSystemGrid()) + //{ + // LLNotificationsUtil::add("NoVoiceConnect", args); + //} + //else + //{ + // LLNotificationsUtil::add("NoVoiceConnect-GIAB", args); + //} + LLNotificationsUtil::add("NoVoiceConnect", args); + // result["connector"] = LLSD::Boolean(false); } diff --git a/indra/newview/llvovolume.cpp b/indra/newview/llvovolume.cpp index b7ce5d2655..2f6aefb2be 100644 --- a/indra/newview/llvovolume.cpp +++ b/indra/newview/llvovolume.cpp @@ -77,8 +77,8 @@ #include "llvoavatar.h" #include "llvocache.h" #include "llmaterialmgr.h" -// [RLVa:KB] - Checked: 2011-05-22 (RLVa-1.3.1a) -#include "rlvhandler.h" +// [RLVa:KB] - Checked: RLVa-2.0.0 +#include "rlvactions.h" #include "rlvlocks.h" // [/RLVa:KB] @@ -4554,10 +4554,10 @@ void LLVolumeGeometryManager::registerFace(LLSpatialGroup* group, LLFace* facep, // if (facep->getViewerObject()->isSelected() && LLSelectMgr::getInstance()->mHideSelectedObjects) // [RLVa:KB] - Checked: 2010-11-29 (RLVa-1.3.0c) | Modified: RLVa-1.3.0c const LLViewerObject* pObj = facep->getViewerObject(); - if ( (pObj->isSelected() && LLSelectMgr::getInstance()->mHideSelectedObjects) && - ( (!rlv_handler_t::isEnabled()) || - ( ((!pObj->isHUDAttachment()) || (!gRlvAttachmentLocks.isLockedAttachment(pObj->getRootEdit()))) && - (gRlvHandler.canEdit(pObj)) ) ) ) + if ( (pObj->isSelected() && LLSelectMgr::getInstance()->mHideSelectedObjects) && + ( (!RlvActions::isRlvEnabled()) || + ( ((!pObj->isHUDAttachment()) || (!gRlvAttachmentLocks.isLockedAttachment(pObj->getRootEdit()))) && + (RlvActions::canEdit(pObj)) ) ) ) // [/RVLa:KB] { return; diff --git a/indra/newview/llworld.cpp b/indra/newview/llworld.cpp index 72174b14df..641ca5c2af 100644 --- a/indra/newview/llworld.cpp +++ b/indra/newview/llworld.cpp @@ -1855,6 +1855,35 @@ void LLWorld::getAvatars(uuid_vec_t* avatar_ids, std::vector* positi } } +// [RLVa:KB] - Checked: RLVa-2.0.1 +bool LLWorld::getAvatar(const LLUUID& idAvatar, LLVector3d& posAvatar) const +{ + for (const LLCharacter* pCharacter : LLCharacter::sInstances) + { + const LLVOAvatar* pAvatar = static_cast(pCharacter); + if ( (!pAvatar->isDead()) && (!pAvatar->mIsDummy) && (!pAvatar->isOrphaned()) && (idAvatar == pAvatar->getID()) ) + { + posAvatar = pAvatar->getPositionGlobal(); + return true; + } + } + + for (const LLViewerRegion* pRegion : LLWorld::getInstance()->getRegionList()) + { + for (S32 idxAgent = 0, cntAgent = pRegion->mMapAvatarIDs.size(); idxAgent < cntAgent; ++idxAgent) + { + if (idAvatar == pRegion->mMapAvatarIDs[idxAgent]) + { + posAvatar = unpackLocalToGlobalPosition(pRegion->mMapAvatars[idxAgent], pRegion->getOriginGlobal()); + return true; + } + } + } + + return false; +} +// [/RLVa:KB] + bool LLWorld::isRegionListed(const LLViewerRegion* region) const { region_list_t::const_iterator it = find(mRegionList.begin(), mRegionList.end(), region); diff --git a/indra/newview/llworld.h b/indra/newview/llworld.h index 08d368a91e..bfa668eae8 100644 --- a/indra/newview/llworld.h +++ b/indra/newview/llworld.h @@ -235,6 +235,9 @@ public: // Make radar more exact and prevent false region crossing notifications //const LLVector3d& relative_to = LLVector3d(), F32 radius = FLT_MAX) const; const LLVector3d& relative_to = LLVector3d(), F32 radius = FLT_MAX, std::map* region_assignments = NULL) const; +// [RLVa:KB] - Checked: RLVa-2.0.1 + bool getAvatar(const LLUUID& idAvatar, LLVector3d& posAvatar) const; +// [/RLVa:KB] // Returns 'true' if the region is in mRegionList, // 'false' if the region has been removed due to region change diff --git a/indra/newview/llworldmapmessage.cpp b/indra/newview/llworldmapmessage.cpp index 8d07330cb1..4779fd7fa3 100644 --- a/indra/newview/llworldmapmessage.cpp +++ b/indra/newview/llworldmapmessage.cpp @@ -132,11 +132,6 @@ void LLWorldMapMessage::sendHandleRegionRequest(U64 region_handle, void LLWorldMapMessage::sendMapBlockRequest(U16 min_x, U16 min_y, U16 max_x, U16 max_y, bool return_nonexistent) { -// Aurora Sim -#ifdef OPENSIM - if(LLGridManager::getInstance()->isInOpenSim()) return_nonexistent = true; -#endif //OPENSIM -// Aurora Sim //LL_INFOS("World Map") << "LLWorldMap::sendMapBlockRequest()" << ", min = (" << min_x << ", " << min_y << "), max = (" << max_x << ", " << max_y << "), nonexistent = " << return_nonexistent << LL_ENDL; LLMessageSystem* msg = gMessageSystem; msg->newMessageFast(_PREHASH_MapBlockRequest); @@ -216,9 +211,10 @@ void LLWorldMapMessage::processMapBlockReply(LLMessageSystem* msg, void**) // // was: llassert(!name.empty()) // which made debug builds impossible to use on OpenSim - if(name.empty()) + if (name.empty() && accesscode != 255) { LL_WARNS() << "MapBlockReply returned empty region name, not inserting in the world map" << LL_ENDL; + continue; } // // Insert that region in the world map, if failure, flag it as a "null_sim" diff --git a/indra/newview/pipeline.cpp b/indra/newview/pipeline.cpp index 8871cbe8e3..87b4ee99e0 100644 --- a/indra/newview/pipeline.cpp +++ b/indra/newview/pipeline.cpp @@ -114,8 +114,8 @@ #include "llpathfindingpathtool.h" #include "llscenemonitor.h" #include "llprogressview.h" -// [RLVa:KB] - Checked: 2011-05-22 (RLVa-1.3.1a) -#include "rlvhandler.h" +// [RLVa:KB] - Checked: RLVa-2.0.0 +#include "rlvactions.h" #include "rlvlocks.h" // [/RLVa:KB] #include "exopostprocess.h" // Import Vignette from Exodus @@ -408,6 +408,9 @@ BOOL LLPipeline::sRenderingHUDs; F32 LLPipeline::sVolumeSAFrame = 0.f; // ZK LBG bool LLPipeline::sRenderParticles; // flag to hold correct, user selected, status of particles +// [SL:KB] - Patch: Render-TextureToggle (Catznip-4.0) +bool LLPipeline::sRenderTextures = true; +// [/SL:KB] // EventHost API LLPipeline listener. static LLPipelineListener sPipelineListener; @@ -3618,9 +3621,9 @@ void LLPipeline::stateSort(LLDrawable* drawablep, LLCamera& camera) // [RLVa:KB] - Checked: 2010-09-28 (RLVa-1.2.1f) | Modified: RLVa-1.2.1f const LLViewerObject* pObj = drawablep->getVObj(); if ( (pObj) && (pObj->isSelected()) && - ( (!rlv_handler_t::isEnabled()) || + ( (!RlvActions::isRlvEnabled()) || ( ((!pObj->isHUDAttachment()) || (!gRlvAttachmentLocks.isLockedAttachment(pObj->getRootEdit()))) && - (gRlvHandler.canEdit(pObj)) ) ) ) + (RlvActions::canEdit(pObj)) ) ) ) // [/RVLa:KB] { return; diff --git a/indra/newview/pipeline.h b/indra/newview/pipeline.h index 8347864eef..cb8e918dcc 100644 --- a/indra/newview/pipeline.h +++ b/indra/newview/pipeline.h @@ -591,6 +591,9 @@ public: static F32 sVolumeSAFrame; static bool sRenderParticles; // flag to hold correct, user selected, status of particles +// [SL:KB] - Patch: Render-TextureToggle (Catznip-4.0) + static bool sRenderTextures; +// [/SL:KB] static LLTrace::EventStatHandle sStatBatchSize; diff --git a/indra/newview/quickprefs.cpp b/indra/newview/quickprefs.cpp index c42d93ed5a..39a640f6c4 100644 --- a/indra/newview/quickprefs.cpp +++ b/indra/newview/quickprefs.cpp @@ -53,6 +53,8 @@ #include "lltoolbarview.h" #include "llviewercontrol.h" #include "llviewerregion.h" +#include "llvoavatar.h" +#include "llvoavatarself.h" #include "llwaterparammanager.h" #include "llwlparamset.h" #include "llwlparammanager.h" diff --git a/indra/newview/rlvactions.cpp b/indra/newview/rlvactions.cpp index b97e060de3..d58781cdb9 100644 --- a/indra/newview/rlvactions.cpp +++ b/indra/newview/rlvactions.cpp @@ -1,106 +1,321 @@ -/** +/** * - * Copyright (c) 2009-2013, Kitty Barnett - * - * The source code in this file is provided to you under the terms of the + * Copyright (c) 2009-2016, Kitty Barnett + * + * The source code in this file is provided to you under the terms of the * GNU Lesser General Public License, version 2.1, but WITHOUT ANY WARRANTY; - * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A - * PARTICULAR PURPOSE. Terms of the LGPL can be found in doc/LGPL-licence.txt + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A + * PARTICULAR PURPOSE. Terms of the LGPL can be found in doc/LGPL-licence.txt * in this distribution, or online at http://www.gnu.org/licenses/lgpl-2.1.txt - * + * * By copying, modifying or distributing this software, you acknowledge that - * you have read and understood your obligations described above, and agree to + * you have read and understood your obligations described above, and agree to * abide by those obligations. - * + * */ #include "llviewerprecompiledheaders.h" +#include "llagent.h" #include "llimview.h" +#include "llviewercamera.h" #include "llvoavatarself.h" +#include "llworld.h" #include "rlvactions.h" +#include "rlvhelper.h" #include "rlvhandler.h" +// ============================================================================ +// Camera +// + +bool RlvActions::canChangeCameraFOV(const LLUUID& idRlvObject) +{ + // NOTE: if an object has exclusive camera control then all other objects are locked out + return (!gRlvHandler.hasBehaviour(RLV_BHVR_SETCAM)) || (gRlvHandler.hasBehaviour(idRlvObject, RLV_BHVR_SETCAM)); +} + +bool RlvActions::canChangeCameraPreset(const LLUUID& idRlvObject) +{ + // NOTE: if an object has exclusive camera control then all other objects are locked out + return + ( (!gRlvHandler.hasBehaviour(RLV_BHVR_SETCAM)) || (gRlvHandler.hasBehaviour(idRlvObject, RLV_BHVR_SETCAM)) ) && + (!gRlvHandler.hasBehaviour(RLV_BHVR_SETCAM_EYEOFFSET)) && (!gRlvHandler.hasBehaviour(RLV_BHVR_SETCAM_FOCUSOFFSET)); +} + +bool RlvActions::canChangeToMouselook() +{ + // User can switch to mouselook if: + // - not specifically prevented from going into mouselook (NOTE: if an object has exclusive camera control only that object can prevent mouselook) + // - there is no minimum camera distance defined (or it's higher than > 0m) + const RlvBehaviourModifier* pCamDistMinModifier = RlvBehaviourDictionary::instance().getModifier(RLV_MODIFIER_SETCAM_AVDISTMIN); + return + ( (!gRlvHandler.hasBehaviour(RLV_BHVR_SETCAM)) ? !gRlvHandler.hasBehaviour(RLV_BHVR_SETCAM_MOUSELOOK) : !gRlvHandler.hasBehaviour(pCamDistMinModifier->getPrimaryObject(), RLV_BHVR_SETCAM_MOUSELOOK) ) && + ( (!pCamDistMinModifier->hasValue()) || (pCamDistMinModifier->getValue() == 0.f) ); +} + +bool RlvActions::isCameraDistanceClamped() +{ + return + (gRlvHandler.hasBehaviour(RLV_BHVR_SETCAM_AVDISTMIN)) || (gRlvHandler.hasBehaviour(RLV_BHVR_SETCAM_AVDISTMAX)) || + (gRlvHandler.hasBehaviour(RLV_BHVR_SETCAM_ORIGINDISTMIN)) || (gRlvHandler.hasBehaviour(RLV_BHVR_SETCAM_ORIGINDISTMAX)); +} + +bool RlvActions::isCameraFOVClamped() +{ + return (gRlvHandler.hasBehaviour(RLV_BHVR_SETCAM_FOVMIN)) || (gRlvHandler.hasBehaviour(RLV_BHVR_SETCAM_FOVMAX)); +} + +bool RlvActions::isCameraPresetLocked() +{ + return (gRlvHandler.hasBehaviour(RLV_BHVR_SETCAM)) || (gRlvHandler.hasBehaviour(RLV_BHVR_SETCAM_EYEOFFSET)) || (gRlvHandler.hasBehaviour(RLV_BHVR_SETCAM_FOCUSOFFSET)); +} + +bool RlvActions::getCameraAvatarDistanceLimits(float& nDistMin, float& nDistMax) +{ + bool fDistMin = gRlvHandler.hasBehaviour(RLV_BHVR_SETCAM_AVDISTMIN), fDistMax = gRlvHandler.hasBehaviour(RLV_BHVR_SETCAM_AVDISTMAX); + if ( (fDistMin) || (fDistMax) ) + { + static RlvCachedBehaviourModifier sCamDistMin(RLV_MODIFIER_SETCAM_AVDISTMIN); + static RlvCachedBehaviourModifier sCamDistMax(RLV_MODIFIER_SETCAM_AVDISTMAX); + + nDistMax = (fDistMax) ? sCamDistMax : F32_MAX; + nDistMin = (fDistMin) ? sCamDistMin : 0.0; + return true; + } + return false; +} + +bool RlvActions::getCameraOriginDistanceLimits(float& nDistMin, float& nDistMax) +{ + bool fDistMin = gRlvHandler.hasBehaviour(RLV_BHVR_SETCAM_ORIGINDISTMIN), fDistMax = gRlvHandler.hasBehaviour(RLV_BHVR_SETCAM_ORIGINDISTMAX); + if ( (fDistMin) || (fDistMax) ) + { + static RlvCachedBehaviourModifier sCamDistMin(RLV_MODIFIER_SETCAM_ORIGINDISTMIN); + static RlvCachedBehaviourModifier sCamDistMax(RLV_MODIFIER_SETCAM_ORIGINDISTMAX); + + nDistMax = (fDistMax) ? sCamDistMax : F32_MAX; + nDistMin = (fDistMin) ? sCamDistMin : 0.0; + return true; + } + return false; +} + +bool RlvActions::getCameraFOVLimits(F32& nFOVMin, F32& nFOVMax) +{ + bool fClampMin = gRlvHandler.hasBehaviour(RLV_BHVR_SETCAM_FOVMIN), fClampMax = gRlvHandler.hasBehaviour(RLV_BHVR_SETCAM_FOVMAX); + if ( (fClampMin) || (fClampMax) ) + { + static RlvCachedBehaviourModifier sCamFovMin(RLV_MODIFIER_SETCAM_FOVMIN); + static RlvCachedBehaviourModifier sCamFovMax(RLV_MODIFIER_SETCAM_FOVMAX); + + nFOVMin = (fClampMin) ? sCamFovMin : LLViewerCamera::getInstance()->getMinView(); + nFOVMax = (fClampMax) ? sCamFovMax : LLViewerCamera::getInstance()->getMaxView(); + return true; + } + return false; +} + // ============================================================================ // Communication/Avatar interaction -// +// bool RlvActions::s_BlockNamesContexts[SNC_COUNT] = { 0 }; -// Checked: 2010-11-30 (RLVa-1.3.0) +// Little helper function to check the IM exclusion range for @recvim, @sendim and @startim (returns: min_dist <= (pos user - pos target) <= max_dist) +static bool rlvCheckAvatarIMDistance(const LLUUID& idAvatar, ERlvBehaviourModifier eModDistMin, ERlvBehaviourModifier eModDistMax) +{ + LLVector3d posAgent; + const RlvBehaviourModifier *pBhvrModDistMin = RlvBehaviourDictionary::instance().getModifier(eModDistMin), *pBhvrModDistMax = RlvBehaviourDictionary::instance().getModifier(eModDistMax); + if ( ((pBhvrModDistMin->hasValue()) || (pBhvrModDistMax->hasValue())) && (LLWorld::getInstance()->getAvatar(idAvatar, posAgent)) ) + { + float nDist = llabs(dist_vec_squared(gAgent.getPositionGlobal(), posAgent)); + return (nDist >= pBhvrModDistMin->getValue()) && (nDist <= pBhvrModDistMax->getValue()); + } + return false; +} + bool RlvActions::canReceiveIM(const LLUUID& idSender) { // User can receive an IM from "sender" (could be an agent or a group) if: - // - not generally restricted from receiving IMs (or the sender is an exception) + // - not generally restricted from receiving IMs (or the sender is an exception or inside the exclusion range) // - not specifically restricted from receiving an IM from the sender - return - (!rlv_handler_t::isEnabled()) || - ( ( (!gRlvHandler.hasBehaviour(RLV_BHVR_RECVIM)) || (gRlvHandler.isException(RLV_BHVR_RECVIM, idSender)) ) && + return + (!isRlvEnabled()) || + ( ( (!gRlvHandler.hasBehaviour(RLV_BHVR_RECVIM)) || (gRlvHandler.isException(RLV_BHVR_RECVIM, idSender)) || (rlvCheckAvatarIMDistance(idSender, RLV_MODIFIER_RECVIMDISTMIN, RLV_MODIFIER_RECVIMDISTMAX)) ) && ( (!gRlvHandler.hasBehaviour(RLV_BHVR_RECVIMFROM)) || (!gRlvHandler.isException(RLV_BHVR_RECVIMFROM, idSender)) ) ); } -// Checked: 2010-11-30 (RLVa-1.3.0) +bool RlvActions::canPlayGestures() +{ + return (!gRlvHandler.hasBehaviour(RLV_BHVR_SENDGESTURE)); +} + +bool RlvActions::canSendChannel(int nChannel) +{ + return + ( (!gRlvHandler.hasBehaviour(RLV_BHVR_SENDCHANNEL)) || (gRlvHandler.isException(RLV_BHVR_SENDCHANNEL, nChannel)) ) && + ( (!gRlvHandler.hasBehaviour(RLV_BHVR_SENDCHANNELEXCEPT)) || (!gRlvHandler.isException(RLV_BHVR_SENDCHANNELEXCEPT, nChannel)) ); +} + bool RlvActions::canSendIM(const LLUUID& idRecipient) { // User can send an IM to "recipient" (could be an agent or a group) if: - // - not generally restricted from sending IMs (or the recipient is an exception) + // - not generally restricted from sending IMs (or the recipient is an exception or inside the exclusion range) // - not specifically restricted from sending an IM to the recipient - return - (!rlv_handler_t::isEnabled()) || - ( ( (!gRlvHandler.hasBehaviour(RLV_BHVR_SENDIM)) || (gRlvHandler.isException(RLV_BHVR_SENDIM, idRecipient)) ) && + return + (!isRlvEnabled()) || + ( ( (!gRlvHandler.hasBehaviour(RLV_BHVR_SENDIM)) || (gRlvHandler.isException(RLV_BHVR_SENDIM, idRecipient)) || (rlvCheckAvatarIMDistance(idRecipient, RLV_MODIFIER_SENDIMDISTMIN, RLV_MODIFIER_SENDIMDISTMAX)) ) && ( (!gRlvHandler.hasBehaviour(RLV_BHVR_SENDIMTO)) || (!gRlvHandler.isException(RLV_BHVR_SENDIMTO, idRecipient)) ) ); } -// Checked: 2011-04-12 (RLVa-1.3.0) bool RlvActions::canStartIM(const LLUUID& idRecipient) { // User can start an IM session with "recipient" (could be an agent or a group) if: - // - not generally restricted from starting IM sessions (or the recipient is an exception) + // - not generally restricted from starting IM sessions (or the recipient is an exception or inside the exclusion range) // - not specifically restricted from starting an IM session with the recipient - return - (!rlv_handler_t::isEnabled()) || - ( ( (!gRlvHandler.hasBehaviour(RLV_BHVR_STARTIM)) || (gRlvHandler.isException(RLV_BHVR_STARTIM, idRecipient)) ) && - ( (!gRlvHandler.hasBehaviour(RLV_BHVR_STARTIMTO)) || (!gRlvHandler.isException(RLV_BHVR_STARTIMTO, idRecipient)) ) ); + // - the session already exists + return + (!isRlvEnabled()) || + ( ( (!gRlvHandler.hasBehaviour(RLV_BHVR_STARTIM)) || (gRlvHandler.isException(RLV_BHVR_STARTIM, idRecipient)) || (rlvCheckAvatarIMDistance(idRecipient, RLV_MODIFIER_STARTIMDISTMIN, RLV_MODIFIER_STARTIMDISTMAX)) ) && + ( (!gRlvHandler.hasBehaviour(RLV_BHVR_STARTIMTO)) || (!gRlvHandler.isException(RLV_BHVR_STARTIMTO, idRecipient)) ) ) || + ( (hasOpenP2PSession(idRecipient)) || (hasOpenGroupSession(idRecipient)) ); +} + +bool RlvActions::canShowName(EShowNamesContext eContext, const LLUUID& idAgent) +{ + // Handle most common case upfront + if (!s_BlockNamesContexts[eContext]) + return true; + + if (idAgent.notNull()) + { + switch (eContext) + { + // Show/hide avatar nametag + case SNC_NAMETAG: + return (gRlvHandler.isException(RLV_BHVR_SHOWNAMETAGS, idAgent)) || (gAgentID == idAgent); + // Show/hide avatar name + case SNC_DEFAULT: + case SNC_TELEPORTOFFER: + case SNC_TELEPORTREQUEST: + return gRlvHandler.isException(RLV_BHVR_SHOWNAMES, idAgent); + default: + return false; + } + } + return false; } // ============================================================================ // Movement // -// Checked: 2010-12-11 (RLVa-1.2.2) bool RlvActions::canAcceptTpOffer(const LLUUID& idSender) { return ((!gRlvHandler.hasBehaviour(RLV_BHVR_TPLURE)) || (gRlvHandler.isException(RLV_BHVR_TPLURE, idSender))) && (canStand()); } -// Checked: 2013-11-08 (RLVa-1.4.9) bool RlvActions::autoAcceptTeleportOffer(const LLUUID& idSender) { return ((idSender.notNull()) && (gRlvHandler.isException(RLV_BHVR_ACCEPTTP, idSender))) || (gRlvHandler.hasBehaviour(RLV_BHVR_ACCEPTTP)); } -// Checked: 2013-11-08 (RLVa-1.4.9) bool RlvActions::canAcceptTpRequest(const LLUUID& idSender) { return (!gRlvHandler.hasBehaviour(RLV_BHVR_TPREQUEST)) || (gRlvHandler.isException(RLV_BHVR_TPREQUEST, idSender)); } -// Checked: 2013-11-08 (RLVa-1.4.9) bool RlvActions::autoAcceptTeleportRequest(const LLUUID& idRequester) { return ((idRequester.notNull()) && (gRlvHandler.isException(RLV_BHVR_ACCEPTTPREQUEST, idRequester))) || (gRlvHandler.hasBehaviour(RLV_BHVR_ACCEPTTPREQUEST)); } // ============================================================================ -// World interaction -// +// Teleporting +// + +bool RlvActions::canTeleportToLocal(const LLVector3d& posGlobal) +{ + // User can initiate a local teleport if: + // - not restricted from "sit teleporting" (or the destination is within the allowed xy-radius) + // - not restricted from teleporting locally (or the destination is within the allowed xy-radius) + // - can stand up (or isn't sitting) + // NOTE: if we're teleporting due to an active command we should disregard any restrictions from the same object + const LLUUID& idRlvObjExcept = gRlvHandler.getCurrentObject(); + bool fCanStand = RlvActions::canStand(idRlvObjExcept); + if ( (fCanStand) && ((gRlvHandler.hasBehaviourExcept(RLV_BHVR_SITTP, gRlvHandler.getCurrentObject())) || (gRlvHandler.hasBehaviourExcept(RLV_BHVR_TPLOCAL, gRlvHandler.getCurrentObject()))) ) + { + // User can stand up but is either @sittp or @tplocal restricted so we need to distance check + const F32 nDistSq = (LLVector2(posGlobal.mdV[0], posGlobal.mdV[1]) - LLVector2(gAgent.getPositionGlobal().mdV[0], gAgent.getPositionGlobal().mdV[1])).lengthSquared(); + F32 nMaxDist = llmin(RlvBehaviourDictionary::instance().getModifier(RLV_MODIFIER_TPLOCALDIST)->getValue(), RLV_MODIFIER_TPLOCAL_DEFAULT); + if (gRlvHandler.hasBehaviour(RLV_BHVR_SITTP)) + nMaxDist = llmin(nMaxDist, RlvBehaviourDictionary::instance().getModifier(RLV_MODIFIER_SITTPDIST)->getValue()); + return (nDistSq < nMaxDist * nMaxDist); + } + return fCanStand; +} + +bool RlvActions::canTeleportToLocation() +{ + // NOTE: if we're teleporting due to an active command we should disregard any restrictions from the same object + const LLUUID& idRlvObjExcept = gRlvHandler.getCurrentObject(); + return (!gRlvHandler.hasBehaviourExcept(RLV_BHVR_TPLOC, idRlvObjExcept)) && (RlvActions::canStand(idRlvObjExcept)); +} + +bool RlvActions::isLocalTp(const LLVector3d& posGlobal) +{ + const F32 nDistSq = (LLVector2(posGlobal.mdV[0], posGlobal.mdV[1]) - LLVector2(gAgent.getPositionGlobal().mdV[0], gAgent.getPositionGlobal().mdV[1])).lengthSquared(); + return nDistSq < RLV_MODIFIER_TPLOCAL_DEFAULT * RLV_MODIFIER_TPLOCAL_DEFAULT; +} + +// ============================================================================ +// World interaction +// + +bool RlvActions::canEdit(const LLViewerObject* pObj) +{ + // User can edit the specified object if: + // - not generally restricted from editing (or the object's root is an exception) + // - not specifically restricted from editing this object's root + return + (pObj) && + ((!hasBehaviour(RLV_BHVR_EDIT)) || (gRlvHandler.isException(RLV_BHVR_EDIT, pObj->getRootEdit()->getID()))) && + ((!hasBehaviour(RLV_BHVR_EDITOBJ)) || (!gRlvHandler.isException(RLV_BHVR_EDITOBJ, pObj->getRootEdit()->getID()))); +} + + +bool RlvActions::canSit(const LLViewerObject* pObj, const LLVector3& posOffset /*= LLVector3::zero*/) +{ + // User can sit on the specified object if: + // - not prevented from sitting + // - not prevented from standing up or not currently sitting + // - not standtp restricted or not currently sitting (if the user is sitting and tried to sit elsewhere the tp would just kick in) + // - not a regular sit (i.e. due to @sit:=force) + // - not @sittp=n or @fartouch=n restricted or if they clicked on a point within the allowed radius + static RlvCachedBehaviourModifier s_nFarTouchDist(RLV_MODIFIER_FARTOUCHDIST); + static RlvCachedBehaviourModifier s_nSitTpDist(RLV_MODIFIER_SITTPDIST); + return + ( (pObj) && (LL_PCODE_VOLUME == pObj->getPCode()) ) && + (!hasBehaviour(RLV_BHVR_SIT)) && + ( ((!hasBehaviour(RLV_BHVR_UNSIT)) && (!hasBehaviour(RLV_BHVR_STANDTP))) || + ((isAgentAvatarValid()) && (!gAgentAvatarp->isSitting())) ) && + ( ( (NULL != gRlvHandler.getCurrentCommand()) && (RLV_BHVR_SIT == gRlvHandler.getCurrentCommand()->getBehaviourType()) ) || + ( ((!hasBehaviour(RLV_BHVR_SITTP)) || (dist_vec_squared(gAgent.getPositionGlobal(), pObj->getPositionGlobal() + LLVector3d(posOffset)) < s_nSitTpDist * s_nSitTpDist)) && + ((!hasBehaviour(RLV_BHVR_FARTOUCH)) || (dist_vec_squared(gAgent.getPositionGlobal(), pObj->getPositionGlobal() + LLVector3d(posOffset)) < s_nFarTouchDist * s_nFarTouchDist)) ) ); +} -// Checked: 2010-03-07 (RLVa-1.2.0) bool RlvActions::canStand() { // NOTE: return FALSE only if we're @unsit=n restricted and the avie is currently sitting on something and TRUE for everything else return (!gRlvHandler.hasBehaviour(RLV_BHVR_UNSIT)) || ((isAgentAvatarValid()) && (!gAgentAvatarp->isSitting())); } +bool RlvActions::canStand(const LLUUID& idRlvObjExcept) +{ + // NOTE: must match generic function above + return (!gRlvHandler.hasBehaviourExcept(RLV_BHVR_UNSIT, idRlvObjExcept)) || ((isAgentAvatarValid()) && (!gAgentAvatarp->isSitting())); +} + // Checked: 2014-02-24 (RLVa-1.4.10) bool RlvActions::canShowLocation() { @@ -109,7 +324,13 @@ bool RlvActions::canShowLocation() // ============================================================================ // Helper functions -// +// + +template<> +const float& RlvActions::getModifierValue(ERlvBehaviourModifier eBhvrMod) +{ + return RlvBehaviourDictionary::instance().getModifier(eBhvrMod)->getValue(); +} // Checked: 2013-05-10 (RLVa-1.4.9) bool RlvActions::hasBehaviour(ERlvBehaviour eBhvr) diff --git a/indra/newview/rlvactions.h b/indra/newview/rlvactions.h index fbc8ab12ba..e11066e25a 100644 --- a/indra/newview/rlvactions.h +++ b/indra/newview/rlvactions.h @@ -1,17 +1,17 @@ -/** +/** * - * Copyright (c) 2009-2013, Kitty Barnett - * - * The source code in this file is provided to you under the terms of the + * Copyright (c) 2009-2016, Kitty Barnett + * + * The source code in this file is provided to you under the terms of the * GNU Lesser General Public License, version 2.1, but WITHOUT ANY WARRANTY; - * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A - * PARTICULAR PURPOSE. Terms of the LGPL can be found in doc/LGPL-licence.txt + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A + * PARTICULAR PURPOSE. Terms of the LGPL can be found in doc/LGPL-licence.txt * in this distribution, or online at http://www.gnu.org/licenses/lgpl-2.1.txt - * + * * By copying, modifying or distributing this software, you acknowledge that - * you have read and understood your obligations described above, and agree to + * you have read and understood your obligations described above, and agree to * abide by those obligations. - * + * */ #ifndef RLV_ACTIONS_H @@ -25,6 +25,51 @@ class RlvActions { + // ====== + // Camera + // ====== +public: + /* + * Returns true if the specified object cannot manipulate the camera FOV + */ + static bool canChangeCameraFOV(const LLUUID& idRlvObject); + + /* + * Returns true if the specified object can manipulate the camera offset and/or focus offset values + */ + static bool canChangeCameraPreset(const LLUUID& idRlvObject); + + /* + * Returns true if the user can switch to mouselook + */ + static bool canChangeToMouselook(); + + /* + * Returns true if the camera's distance (from either the avatar of the focus) is currently restricted/clamped + */ + static bool isCameraDistanceClamped(); + + /* + * Returns true if the camera's FOV is currently restricted/clamped + */ + static bool isCameraFOVClamped(); + + /* + * Returns true if the camera offset and focus offset are locked (prevents changing the current camera preset) + */ + static bool isCameraPresetLocked(); + + /* + * Retrieves the current (avatar or focus) camera distance limits + */ + static bool getCameraAvatarDistanceLimits(float& nDistMin, float& nDistMax); + static bool getCameraOriginDistanceLimits(float& nDistMin, float& nDistMax); + + /* + * Retrieves the current camera FOV limits - returns isCameraFOVClamped() + */ + static bool getCameraFOVLimits(float& nFOVMin, float& nFOVMax); + // ================================ // Communication/Avatar interaction // ================================ @@ -34,24 +79,34 @@ public: */ static bool canReceiveIM(const LLUUID& idSender); + /* + * Returns true if the user is allowed to send/play gestures (whether active ones from the chat bar or using the gesture preview floater) + */ + static bool canPlayGestures(); + + /* + * Returns true if the user is allowed to chat on the specified channel + */ + static bool canSendChannel(int nChannel); + /* * Returns true if the user is allowed to send IMs to the specified recipient (can be an avatar or a group) */ static bool canSendIM(const LLUUID& idRecipient); /* - * Returns true if the user is allowed to start a - P2P or group - conversation with the specified UUID. + * Returns true if the user is allowed to start a - P2P or group - conversation with the specified UUID (or if the session already exists) */ - static bool canStartIM(const LLUUID& idRecipient); // @startim and @startimto + static bool canStartIM(const LLUUID& idRecipient); /* * Returns true if an avatar's name should be hidden for the requested operation/context * (This is used to hide an avatar name in one case but not a near-identical case - such as teleporting a friend vs a nearby agent - * in a way that limits the amount of code that needs to be changed to carry context from one function to another) */ - enum EShowNamesContext { SNC_TELEPORTOFFER = 0, SNC_TELEPORTREQUEST, SNC_COUNT }; - static bool canShowName(EShowNamesContext eContext) { return (eContext < SNC_COUNT) ? !s_BlockNamesContexts[eContext] : false; } - static void setShowName(EShowNamesContext eContext, bool fShowName) { if ( (eContext < SNC_COUNT) && (isRlvEnabled()) ) { s_BlockNamesContexts[eContext] = !fShowName; } } + enum EShowNamesContext { SNC_DEFAULT = 0, SNC_NAMETAG, SNC_TELEPORTOFFER, SNC_TELEPORTREQUEST, SNC_COUNT }; + static bool canShowName(EShowNamesContext eContext, const LLUUID& idAgent = LLUUID::null); + static void setShowName(EShowNamesContext eContext, bool fCanShowName) { if ( (eContext < SNC_COUNT) && (isRlvEnabled()) ) { s_BlockNamesContexts[eContext] = !fCanShowName; } } protected: // Backwards logic so that we can initialize to 0 and it won't block when we forget to/don't check if RLVa is disabled @@ -83,14 +138,44 @@ public: */ static bool autoAcceptTeleportRequest(const LLUUID& idRequester); + // =========== + // Teleporting + // =========== +public: + /* + * Returns true if the user can teleport locally (short distances) + */ + static bool canTeleportToLocal(const LLVector3d& posGlobal); + + /* + * Returns true if the user can teleport to a (remote) location + */ + static bool canTeleportToLocation(); + + /* + * Returns true if the teleport is considered local (e.g. double-click tp) + */ + static bool isLocalTp(const LLVector3d& posGlobal); + // ================= // World interaction // ================= public: + /* + * Returns true if the user can edit the specified object + */ + static bool canEdit(const LLViewerObject* pObj); + + /* + * Returns true if the user can sit up on the specified object + */ + static bool canSit(const LLViewerObject* pObj, const LLVector3& posOffset = LLVector3::zero); + /* * Returns true if the user can stand up (returns true if the user isn't currently sitting) */ static bool canStand(); + static bool canStand(const LLUUID& idRlvObjExcept); /* * Returns true if the user can see their in-world location @@ -102,13 +187,18 @@ public: // ================ public: /* - * Convenience function to check for a behaviour without having to include rlvhandler.h. + * Convenience function to get the current/active value of a behaviour modifier + */ + template static const T& getModifierValue(ERlvBehaviourModifier eBhvrMod); + + /* + * Convenience function to check for a behaviour without having to include rlvhandler.h. * Do NOT call this function if speed is important (i.e. per-frame) */ static bool hasBehaviour(ERlvBehaviour eBhvr); /* - * Returns true if a - P2P or group - IM session is open with the specified UUID. + * Returns true if a - P2P or group - IM session is open with the specified UUID */ static bool hasOpenP2PSession(const LLUUID& idAgent); static bool hasOpenGroupSession(const LLUUID& idGroup); diff --git a/indra/newview/rlvcommon.cpp b/indra/newview/rlvcommon.cpp index 91da4a1963..341a51a805 100644 --- a/indra/newview/rlvcommon.cpp +++ b/indra/newview/rlvcommon.cpp @@ -1,5 +1,5 @@ /** - * @file rlvcommon.cpp + * * Copyright (c) 2009-2011, Kitty Barnett * * The source code in this file is provided to you under the terms of the @@ -20,7 +20,9 @@ #include "llavatarnamecache.h" #include "llinstantmessage.h" #include "llnotificationsutil.h" +#include "llregionhandle.h" #include "llsdserialize.h" +#include "lltrans.h" #include "llviewerparcelmgr.h" #include "llviewermenu.h" #include "llviewerregion.h" @@ -35,8 +37,14 @@ #include "llscriptruntimeperms.h" #include // icontains #include // regex_replace_all -#include // -#include "lltrace.h" +#include + +// ============================================================================ +// Forward declarations +// + +// llviewermenu.cpp +LLVOAvatar* find_avatar_from_object(LLViewerObject* object); // ============================================================================ // RlvNotifications @@ -73,7 +81,6 @@ bool RlvSettings::fCompositeFolders = false; bool RlvSettings::fCanOOC = true; bool RlvSettings::fLegacyNaming = true; bool RlvSettings::fNoSetEnv = false; -bool RlvSettings::fShowNameTags = false; // Checked: 2010-02-27 (RLVa-1.2.0a) | Modified: RLVa-1.1.0i void RlvSettings::initClass() @@ -81,9 +88,6 @@ void RlvSettings::initClass() static bool fInitialized = false; if (!fInitialized) { - // Ansariel: Wired up in LLViewerControl because of FIRE-16601 - //gSavedSettings.getControl(RLV_SETTING_MAIN)->getSignal()->connect(boost::bind(&onChangedSettingMain, _2)); - #ifdef RLV_EXPERIMENTAL_COMPOSITEFOLDERS fCompositeFolders = rlvGetSetting(RLV_SETTING_ENABLECOMPOSITES, false); if (gSavedSettings.controlExists(RLV_SETTING_ENABLECOMPOSITES)) @@ -97,15 +101,9 @@ void RlvSettings::initClass() fCanOOC = rlvGetSetting(RLV_SETTING_CANOOC, true); fNoSetEnv = rlvGetSetting(RLV_SETTING_NOSETENV, false); - fShowNameTags = rlvGetSetting(RLV_SETTING_SHOWNAMETAGS, false); - if (gSavedSettings.controlExists(RLV_SETTING_SHOWNAMETAGS)) - gSavedSettings.getControl(RLV_SETTING_SHOWNAMETAGS)->getSignal()->connect(boost::bind(&onChangedSettingBOOL, _2, &fShowNameTags)); - -#ifdef RLV_EXTENSION_STARTLOCATION // Don't allow toggling RLVaLoginLastLocation from the debug settings floater if (gSavedPerAccountSettings.controlExists(RLV_SETTING_LOGINLASTLOCATION)) gSavedPerAccountSettings.getControl(RLV_SETTING_LOGINLASTLOCATION)->setHiddenFromSettingsEditor(true); -#endif // RLV_EXTENSION_STARTLOCATION if (gSavedSettings.controlExists(RLV_SETTING_TOPLEVELMENU)) gSavedSettings.getControl(RLV_SETTING_TOPLEVELMENU)->getSignal()->connect(boost::bind(&onChangedMenuLevel)); @@ -114,21 +112,19 @@ void RlvSettings::initClass() } } -#ifdef RLV_EXTENSION_STARTLOCATION - // Checked: 2010-04-01 (RLVa-1.2.0c) | Modified: RLVa-0.2.1d - void RlvSettings::updateLoginLastLocation() +// Checked: 2010-04-01 (RLVa-1.2.0c) | Modified: RLVa-0.2.1d +void RlvSettings::updateLoginLastLocation() +{ + if ( (!LLApp::isQuitting()) && (gSavedPerAccountSettings.controlExists(RLV_SETTING_LOGINLASTLOCATION)) ) { - if ( (!LLApp::isQuitting()) && (gSavedPerAccountSettings.controlExists(RLV_SETTING_LOGINLASTLOCATION)) ) + BOOL fValue = (gRlvHandler.hasBehaviour(RLV_BHVR_TPLOC)) || (!RlvActions::canStand()); + if (gSavedPerAccountSettings.getBOOL(RLV_SETTING_LOGINLASTLOCATION) != fValue) { - BOOL fValue = (gRlvHandler.hasBehaviour(RLV_BHVR_TPLOC)) || (!RlvActions::canStand()); - if (gSavedPerAccountSettings.getBOOL(RLV_SETTING_LOGINLASTLOCATION) != fValue) - { - gSavedPerAccountSettings.setBOOL(RLV_SETTING_LOGINLASTLOCATION, fValue); - gSavedPerAccountSettings.saveToFile(gSavedSettings.getString("PerAccountSettingsFile"), TRUE); - } + gSavedPerAccountSettings.setBOOL(RLV_SETTING_LOGINLASTLOCATION, fValue); + gSavedPerAccountSettings.saveToFile(gSavedSettings.getString("PerAccountSettingsFile"), TRUE); } } -#endif // RLV_EXTENSION_STARTLOCATION +} // Checked: 2011-08-16 (RLVa-1.4.0b) | Added: RLVa-1.4.0b bool RlvSettings::onChangedMenuLevel() @@ -152,9 +148,9 @@ void RlvSettings::onChangedSettingMain(const LLSD& sdValue) { LLNotificationsUtil::add( "GenericAlert", - LLSD().with("MESSAGE", llformat(RlvStrings::getString("message_toggle_restart").c_str(), - (sdValue.asBoolean()) ? RlvStrings::getString("message_toggle_restart_enabled").c_str() - : RlvStrings::getString("message_toggle_restart_disabled").c_str()))); + LLSD().with("MESSAGE", llformat(LLTrans::getString("RLVaToggleMessage").c_str(), + (sdValue.asBoolean()) ? LLTrans::getString("RLVaToggleEnabled").c_str() + : LLTrans::getString("RLVaToggleDisabled").c_str()))); } } @@ -175,14 +171,10 @@ void RlvStrings::initClass() // Load the default string values std::vector files = gDirUtilp->findSkinnedFilenames(LLDir::XUI, RLV_STRINGS_FILE, LLDir::ALL_SKINS); m_StringMapPath = (!files.empty()) ? files.front() : LLStringUtil::null; - // Old compiler compatibility - //for (auto itFile = files.cbegin(); itFile != files.cend(); ++itFile) - BOOST_FOREACH(const std::string file, files) + for (std::vector::const_iterator itFile = files.begin(); itFile != files.end(); ++itFile) { - //loadFromFile(*itFile, false); - loadFromFile(file, false); + loadFromFile(*itFile, false); } - // // Load the custom string overrides loadFromFile(gDirUtilp->getExpandedFilename(LL_PATH_USER_SETTINGS, RLV_STRINGS_FILE), true); @@ -211,7 +203,7 @@ void RlvStrings::loadFromFile(const std::string& strFilePath, bool fUserOverride const LLSD& sdStrings = sdFileData["strings"]; for (LLSD::map_const_iterator itString = sdStrings.beginMap(); itString != sdStrings.endMap(); ++itString) { - if ((!itString->second.has("value")) || ((fUserOverride) && (!hasString(itString->first)))) + if ( (!itString->second.has("value")) || ((fUserOverride) && (!hasString(itString->first))) ) continue; std::list& listValues = m_StringMap[itString->first]; @@ -276,7 +268,6 @@ const std::string& RlvStrings::getAnonym(const std::string& strName) const std::string& RlvStrings::getString(const std::string& strStringName) { static const std::string strMissing = "(Missing RLVa string)"; - initClass(); // Ansariel: Make sure RlvStrings gets initialized before accessing it string_map_t::const_iterator itString = m_StringMap.find(strStringName); return (itString != m_StringMap.end()) ? itString->second.back() : strMissing; } @@ -293,6 +284,8 @@ const char* RlvStrings::getStringFromReturnCode(ERlvCmdRet eRet) return "duplicate"; case RLV_RET_SUCCESS_DELAYED: return "delayed"; + case RLV_RET_SUCCESS_DEPRECATED: + return "deprecated"; case RLV_RET_FAILED_SYNTAX: return "thingy error"; case RLV_RET_FAILED_OPTION: @@ -307,8 +300,8 @@ const char* RlvStrings::getStringFromReturnCode(ERlvCmdRet eRet) return "unknown command"; case RLV_RET_FAILED_NOSHAREDROOT: return "missing #RLV"; - case RLV_RET_DEPRECATED: - return "deprecated"; + case RLV_RET_FAILED_DEPRECATED: + return "deprecated and disabled"; // The following are identified by the chat verb case RLV_RET_RETAINED: case RLV_RET_SUCCESS: @@ -401,7 +394,7 @@ void RlvUtil::filterNames(std::string& strUTF8Text, bool fFilterLegacy) for (int idxAgent = 0, cntAgent = idAgents.size(); idxAgent < cntAgent; idxAgent++) { LLAvatarName avName; - if (LLAvatarNameCache::get(idAgents[idxAgent], &avName)) + if ( (LLAvatarNameCache::get(idAgents[idxAgent], &avName)) && (!RlvActions::canShowName(RlvActions::SNC_DEFAULT, idAgents[idxAgent])) ) { const std::string& strDisplayName = escape_for_regex(avName.getDisplayName()); bool fFilterDisplay = (strDisplayName.length() > 2); @@ -436,7 +429,7 @@ void RlvUtil::filterScriptQuestions(S32& nQuestions, LLSD& sdPayload) { // Notify the user that we blocked it since they're not allowed to wear any new attachments sdPayload["rlv_blocked"] = RLV_STRING_BLOCKED_PERMATTACH; - nQuestions &= ~SCRIPT_PERMISSIONS[SCRIPT_PERMISSION_ATTACH].permbit; + nQuestions &= ~SCRIPT_PERMISSIONS[SCRIPT_PERMISSION_ATTACH].permbit; } // Check SCRIPT_PERMISSION_TELEPORT @@ -444,7 +437,7 @@ void RlvUtil::filterScriptQuestions(S32& nQuestions, LLSD& sdPayload) { // Notify the user that we blocked it since they're not allowed to teleport sdPayload["rlv_blocked"] = RLV_STRING_BLOCKED_PERMTELEPORT; - nQuestions &= ~SCRIPT_PERMISSIONS[SCRIPT_PERMISSION_TELEPORT].permbit; + nQuestions &= ~SCRIPT_PERMISSIONS[SCRIPT_PERMISSION_TELEPORT].permbit; } sdPayload["questions"] = nQuestions; @@ -549,6 +542,18 @@ bool RlvUtil::sendChatReply(S32 nChannel, const std::string& strUTF8Text) return true; } +void RlvUtil::teleportCallback(U64 hRegion, const LLVector3& posRegion, const LLVector3& vecLookAt) +{ + if (hRegion) + { + const LLVector3d posGlobal = from_region_handle(hRegion) + (LLVector3d)posRegion; + if (vecLookAt.isExactlyZero()) + gAgent.teleportViaLocation(posGlobal); + else + gAgent.teleportViaLocationLookAt(posGlobal, vecLookAt); + } +} + // ============================================================================ // Generic menu enablers // @@ -563,7 +568,7 @@ bool rlvMenuMainToggleVisible(LLUICtrl* pMenuCtrl) if (gSavedSettings.getBOOL(RLV_SETTING_MAIN) == rlv_handler_t::isEnabled()) pMenuItem->setLabel(strLabel); else - pMenuItem->setLabel(strLabel + RlvStrings::getString("message_toggle_restart_pending")); + pMenuItem->setLabel(strLabel + " " + LLTrans::getString("RLVaPendingRestart")); } return true; } @@ -595,13 +600,19 @@ void rlvMenuToggleVisible() } } +bool rlvMenuCanShowName() +{ + const LLVOAvatar* pAvatar = find_avatar_from_object(LLSelectMgr::getInstance()->getSelection()->getPrimaryObject()); + return (pAvatar) && (RlvActions::canShowName(RlvActions::SNC_DEFAULT, pAvatar->getID())); +} + // Checked: 2010-04-23 (RLVa-1.2.0g) | Modified: RLVa-1.2.0g bool rlvMenuEnableIfNot(const LLSD& sdParam) { bool fEnable = true; if (rlv_handler_t::isEnabled()) { - ERlvBehaviour eBhvr = RlvCommand::getBehaviourFromString(sdParam.asString()); + ERlvBehaviour eBhvr = RlvBehaviourDictionary::instance().getBehaviourFromString(sdParam.asString(), RLV_TYPE_ADDREM); fEnable = (eBhvr != RLV_BHVR_UNKNOWN) ? !gRlvHandler.hasBehaviour(eBhvr) : true; } return fEnable; @@ -645,7 +656,7 @@ bool RlvSelectHasLockedAttach::apply(LLSelectNode* pNode) bool RlvSelectIsEditable::apply(LLSelectNode* pNode) { const LLViewerObject* pObj = pNode->getObject(); - return (pObj) && (!gRlvHandler.canEdit(pObj)); + return (pObj) && (!RlvActions::canEdit(pObj)); } // Checked: 2011-05-28 (RLVa-1.4.0a) | Modified: RLVa-1.4.0a diff --git a/indra/newview/rlvcommon.h b/indra/newview/rlvcommon.h index 97f92e55ba..c19f273770 100644 --- a/indra/newview/rlvcommon.h +++ b/indra/newview/rlvcommon.h @@ -1,5 +1,5 @@ /** - * @file rlvcommon.h + * * Copyright (c) 2009-2011, Kitty Barnett * * The source code in this file is provided to you under the terms of the @@ -57,6 +57,7 @@ class RlvObject; struct RlvException; typedef boost::variant RlvExceptionOption; +typedef boost::variant RlvBehaviourModifierValue; class RlvGCTimer; @@ -97,12 +98,9 @@ public: static bool getHideLockedAttach() { return rlvGetSetting(RLV_SETTING_HIDELOCKEDATTACH, false); } static bool getHideLockedInventory() { return rlvGetSetting(RLV_SETTING_HIDELOCKEDINVENTORY, false); } static bool getSharedInvAutoRename() { return rlvGetSetting(RLV_SETTING_SHAREDINVAUTORENAME, true); } - static bool getShowNameTags() { return fShowNameTags; } - #ifdef RLV_EXTENSION_STARTLOCATION static bool getLoginLastLocation() { return rlvGetPerUserSetting(RLV_SETTING_LOGINLASTLOCATION, true); } static void updateLoginLastLocation(); - #endif // RLV_EXTENSION_STARTLOCATION static void initClass(); static void onChangedSettingMain(const LLSD& sdValue); @@ -116,7 +114,6 @@ protected: static bool fCanOOC; static bool fLegacyNaming; static bool fNoSetEnv; - static bool fShowNameTags; }; // ============================================================================ @@ -172,10 +169,11 @@ public: static void notifyFailedAssertion(const std::string& strAssert, const std::string& strFile, int nLine); static void sendBusyMessage(const LLUUID& idTo, const std::string& strMsg, const LLUUID& idSession = LLUUID::null); - static bool isValidReplyChannel(S32 nChannel); + static bool isValidReplyChannel(S32 nChannel, bool fLoopback = false); static bool sendChatReply(S32 nChannel, const std::string& strUTF8Text); static bool sendChatReply(const std::string& strChannel, const std::string& strUTF8Text); + static void teleportCallback(U64 hRegion, const LLVector3& posRegion, const LLVector3& vecLookAt); protected: static bool m_fForceTp; // @standtp }; @@ -184,16 +182,16 @@ protected: // Extensibility classes // -class RlvCommandHandler +class RlvExtCommandHandler { public: - virtual ~RlvCommandHandler() {} + virtual ~RlvExtCommandHandler() {} virtual bool onAddRemCommand(const RlvCommand& rlvCmd, ERlvCmdRet& cmdRet) { return false; } virtual bool onClearCommand(const RlvCommand& rlvCmd, ERlvCmdRet& cmdRet) { return false; } virtual bool onReplyCommand(const RlvCommand& rlvCmd, ERlvCmdRet& cmdRet) { return false; } virtual bool onForceCommand(const RlvCommand& rlvCmd, ERlvCmdRet& cmdRet) { return false; } }; -typedef bool (RlvCommandHandler::*rlvCommandHandler)(const RlvCommand& rlvCmd, ERlvCmdRet& cmdRet); +typedef bool (RlvExtCommandHandler::*rlvExtCommandHandler)(const RlvCommand& rlvCmd, ERlvCmdRet& cmdRet); // ============================================================================ // Generic menu enablers @@ -201,6 +199,7 @@ typedef bool (RlvCommandHandler::*rlvCommandHandler)(const RlvCommand& rlvCmd, E bool rlvMenuMainToggleVisible(LLUICtrl* pMenuItem); void rlvMenuToggleVisible(); +bool rlvMenuCanShowName(); bool rlvMenuEnableIfNot(const LLSD& sdParam); // ============================================================================ @@ -302,9 +301,9 @@ inline bool RlvUtil::isEmote(const std::string& strUTF8Text) } // Checked: 2010-03-09 (RLVa-1.2.0b) | Added: RLVa-1.0.2a -inline bool RlvUtil::isValidReplyChannel(S32 nChannel) +inline bool RlvUtil::isValidReplyChannel(S32 nChannel, bool fLoopback /*=false*/) { - return (nChannel > 0) && (CHAT_CHANNEL_DEBUG != nChannel); + return (nChannel > ((!fLoopback) ? 0 : -1)) && (CHAT_CHANNEL_DEBUG != nChannel); } // Checked: 2009-08-05 (RLVa-1.0.1e) | Added: RLVa-1.0.0e diff --git a/indra/newview/rlvdefines.h b/indra/newview/rlvdefines.h index 2b49e6f763..a571aea4eb 100644 --- a/indra/newview/rlvdefines.h +++ b/indra/newview/rlvdefines.h @@ -1,6 +1,6 @@ /** - * @file rlvdefines.h - * Copyright (c) 2009-2011, Kitty Barnett + * + * Copyright (c) 2009-2016, Kitty Barnett * * The source code in this file is provided to you under the terms of the * GNU Lesser General Public License, version 2.1, but WITHOUT ANY WARRANTY; @@ -17,56 +17,20 @@ #ifndef RLV_DEFINES_H #define RLV_DEFINES_H -// ============================================================================ -// Extensions -// - -// Extensions -#define RLV_EXTENSION_CMD_GETSETDEBUG_EX // Extends the debug variables accessible through @getdebug_xxx/@setdebug_xxx -#define RLV_EXTENSION_CMD_FINDFOLDERS // @findfolders: FIRE-4453 +#include "rlvcommon.h" #include "rlvhelper.h" #include "rlvhandler.h" #include "rlvinventory.h" #include +// ============================================================================ +// RlvBehaviourDictionary +// + +/* + * Processing of RLVa commands used to be a big switch/case loop with one function for each command type(addrem, reply + * and force). This is slowly being replaced with templated command handling which might be more confusing intially + * (also due to my poor naming schemes) but is actually far simpler and less error-prone than the old way. + * + * In the general case you just add a definition for the command below and then write the function body in rlvhandler.cpp + * and you're done! Told you this was easy. + * + * Reply command + * ============= + * Definition: RlvReplyProcessor("commandname"[, ])); + * Implement : ERlvCmdRet RlvReplyHandler::onCommand(const RlvCommand& rlvCmd, std::string& strReply) + * + * Force command + * ============= + * Definition: new RlvForceProcessor("commandname"[, ])); + * Implement : ERlvCmdRet RlvForceProcessor::onCommand(const RlvCommand& rlvCmd) + * + * Behaviours + * ========== + * Behaviours come in many forms but the added complexity is only in the variety of choices. The implementation is as + * easy as reply or force commands. + * + * For simple behaviours that only require recordkeeping and don't run code when set/unset (see ERlvBehaviourOptionType): + * Definition: RlvBehaviourGenericProcessor("commandname", RLV_BHVR_COMMANDNAME) + * Implement : nothing! (it automagically works) + * For simple behaviours that only require recordkeeping and only run code when they toggle: + * Definition: RlvBehaviourGenericToggleProcessor("commandname")) + * Implement : void RlvBehaviourToggleHandler::onCommandToggle(ERlvBehaviour eBhvr, bool fHasBhvr) + * For behaviours that require manual processing: + * Definition: RlvBehaviourProcessor("commandname")) + * Implement : ERlvCmdRet RlvBehaviourHandler::onCommand(const RlvCommand& rlvCmd, bool& fRefCount) + * For behaviours that run code when their modifier changes: + * Definition: addModifier(RLV_BHVR_COMMANDNAME, RLV_MODIFIER_COMMANDNAME, new RlvBehaviourModifierHandler(, , )); + * Implement : void RlvBehaviourModifierHandler::onValueChanged() + * + */ +RlvBehaviourDictionary::RlvBehaviourDictionary() +{ + // Array auto-initialization to 0 is still not supported in VS2013 + memset(m_BehaviourModifiers, 0, sizeof(RlvBehaviourModifier*) * RLV_MODIFIER_COUNT); + + // + // Restrictions + // + addEntry(new RlvBehaviourGenericProcessor("acceptpermission", RLV_BHVR_ACCEPTPERMISSION)); + addEntry(new RlvBehaviourGenericProcessor("accepttp", RLV_BHVR_ACCEPTTP, RlvBehaviourInfo::BHVR_STRICT)); + addEntry(new RlvBehaviourGenericProcessor("accepttprequest", RLV_BHVR_ACCEPTTPREQUEST, RlvBehaviourInfo::BHVR_STRICT | RlvBehaviourInfo::BHVR_EXTENDED)); + addEntry(new RlvBehaviourProcessor("addattach")); + addEntry(new RlvBehaviourInfo("addoutfit", RLV_BHVR_ADDOUTFIT, RLV_TYPE_ADDREM)); + addEntry(new RlvBehaviourGenericProcessor("allowidle", RLV_BHVR_ALLOWIDLE, RlvBehaviourInfo::BHVR_EXPERIMENTAL)); + addEntry(new RlvBehaviourGenericProcessor("alwaysrun", RLV_BHVR_ALWAYSRUN)); + addEntry(new RlvBehaviourInfo("attachthis", RLV_BHVR_ATTACHTHIS, RLV_TYPE_ADDREM, RlvBehaviourInfo::FORCEWEAR_NODE)); + addEntry(new RlvBehaviourInfo("attachallthis", RLV_BHVR_ATTACHTHIS, RLV_TYPE_ADDREM, RlvBehaviourInfo::FORCEWEAR_SUBTREE)); + addEntry(new RlvBehaviourInfo("attachthis_except", RLV_BHVR_ATTACHTHISEXCEPT, RLV_TYPE_ADDREM, RlvBehaviourInfo::FORCEWEAR_NODE)); + addEntry(new RlvBehaviourInfo("attachallthis_except", RLV_BHVR_ATTACHTHISEXCEPT, RLV_TYPE_ADDREM, RlvBehaviourInfo::FORCEWEAR_SUBTREE)); + addEntry(new RlvBehaviourGenericProcessor("chatwhisper", RLV_BHVR_CHATWHISPER)); + addEntry(new RlvBehaviourGenericProcessor("chatnormal", RLV_BHVR_CHATNORMAL)); + addEntry(new RlvBehaviourGenericProcessor("chatshout", RLV_BHVR_CHATSHOUT)); + addEntry(new RlvBehaviourProcessor("detach")); + addEntry(new RlvBehaviourInfo("detachthis", RLV_BHVR_DETACHTHIS, RLV_TYPE_ADDREM, RlvBehaviourInfo::FORCEWEAR_NODE)); + addEntry(new RlvBehaviourInfo("detachallthis", RLV_BHVR_DETACHTHIS, RLV_TYPE_ADDREM, RlvBehaviourInfo::FORCEWEAR_SUBTREE)); + addEntry(new RlvBehaviourInfo("detachthis_except", RLV_BHVR_DETACHTHISEXCEPT, RLV_TYPE_ADDREM, RlvBehaviourInfo::FORCEWEAR_NODE)); + addEntry(new RlvBehaviourInfo("detachallthis_except", RLV_BHVR_DETACHTHISEXCEPT, RLV_TYPE_ADDREM, RlvBehaviourInfo::FORCEWEAR_SUBTREE)); + addEntry(new RlvBehaviourGenericToggleProcessor("edit")); + addEntry(new RlvBehaviourGenericProcessor("editobj", RLV_BHVR_EDITOBJ)); + addEntry(new RlvBehaviourGenericProcessor("emote", RLV_BHVR_EMOTE)); + addEntry(new RlvBehaviourGenericProcessor("fartouch", RLV_BHVR_FARTOUCH)); + addModifier(RLV_BHVR_FARTOUCH, RLV_MODIFIER_FARTOUCHDIST, new RlvBehaviourModifier("Fartouch Distance", RLV_MODIFIER_FARTOUCH_DEFAULT, true, new RlvBehaviourModifier_CompMin)); + addEntry(new RlvBehaviourGenericProcessor("fly", RLV_BHVR_FLY)); + addEntry(new RlvBehaviourGenericProcessor("interact", RLV_BHVR_INTERACT, RlvBehaviourInfo::BHVR_EXTENDED)); + addEntry(new RlvBehaviourInfo("notify", RLV_BHVR_NOTIFY, RLV_TYPE_ADDREM)); + addEntry(new RlvBehaviourGenericProcessor("permissive", RLV_BHVR_PERMISSIVE)); + addEntry(new RlvBehaviourGenericProcessor("recvchat", RLV_BHVR_RECVCHAT, RlvBehaviourInfo::BHVR_STRICT)); + addEntry(new RlvBehaviourGenericProcessor("recvchatfrom", RLV_BHVR_RECVCHATFROM, RlvBehaviourInfo::BHVR_STRICT)); + addEntry(new RlvBehaviourGenericProcessor("recvemote", RLV_BHVR_RECVEMOTE, RlvBehaviourInfo::BHVR_STRICT)); + addEntry(new RlvBehaviourGenericProcessor("recvemotefrom", RLV_BHVR_RECVEMOTEFROM, RlvBehaviourInfo::BHVR_STRICT)); + addEntry(new RlvBehaviourProcessor("recvim", RlvBehaviourInfo::BHVR_STRICT)); + addModifier(RLV_BHVR_RECVIM, RLV_MODIFIER_RECVIMDISTMIN, new RlvBehaviourModifier("RecvIM Distance (Min)", F32_MAX, true, new RlvBehaviourModifier_CompMax)); + addModifier(RLV_BHVR_RECVIM, RLV_MODIFIER_RECVIMDISTMAX, new RlvBehaviourModifier("RecvIM Distance (Max)", F32_MAX, true, new RlvBehaviourModifier_CompMin)); + addEntry(new RlvBehaviourGenericProcessor("recvimfrom", RLV_BHVR_RECVIMFROM, RlvBehaviourInfo::BHVR_STRICT)); + addEntry(new RlvBehaviourInfo("redirchat", RLV_BHVR_REDIRCHAT, RLV_TYPE_ADDREM)); + addEntry(new RlvBehaviourInfo("rediremote", RLV_BHVR_REDIREMOTE, RLV_TYPE_ADDREM)); + addEntry(new RlvBehaviourProcessor("remattach")); + addEntry(new RlvBehaviourInfo("remoutfit", RLV_BHVR_REMOUTFIT, RLV_TYPE_ADDREM)); + addEntry(new RlvBehaviourGenericProcessor("rez", RLV_BHVR_REZ)); + addEntry(new RlvBehaviourProcessor("sendchannel", RlvBehaviourInfo::BHVR_STRICT)); + addEntry(new RlvBehaviourProcessor("sendchannel_except", RlvBehaviourInfo::BHVR_STRICT)); + addEntry(new RlvBehaviourGenericProcessor("sendchat", RLV_BHVR_SENDCHAT)); + addEntry(new RlvBehaviourToggleProcessor("sendim", RlvBehaviourInfo::BHVR_STRICT)); + addModifier(RLV_BHVR_SENDIM, RLV_MODIFIER_SENDIMDISTMIN, new RlvBehaviourModifier("SendIM Distance (Min)", F32_MAX, true, new RlvBehaviourModifier_CompMax)); + addModifier(RLV_BHVR_SENDIM, RLV_MODIFIER_SENDIMDISTMAX, new RlvBehaviourModifier("SendIM Distance (Max)", F32_MAX, true, new RlvBehaviourModifier_CompMin)); + addEntry(new RlvBehaviourGenericProcessor("sendimto", RLV_BHVR_SENDIMTO, RlvBehaviourInfo::BHVR_STRICT)); + addEntry(new RlvBehaviourGenericProcessor("sendgesture", RLV_BHVR_SENDGESTURE, RlvBehaviourInfo::BHVR_EXPERIMENTAL)); + addEntry(new RlvBehaviourGenericToggleProcessor("setdebug")); + addEntry(new RlvBehaviourGenericToggleProcessor("setenv")); + addEntry(new RlvBehaviourGenericProcessor("setgroup", RLV_BHVR_SETGROUP)); + addEntry(new RlvBehaviourInfo("sharedunwear", RLV_BHVR_SHAREDUNWEAR, RLV_TYPE_ADDREM, RlvBehaviourInfo::BHVR_EXTENDED)); + addEntry(new RlvBehaviourInfo("sharedwear", RLV_BHVR_SHAREDWEAR, RLV_TYPE_ADDREM, RlvBehaviourInfo::BHVR_EXTENDED)); + addEntry(new RlvBehaviourProcessor("showhovertext")); + addEntry(new RlvBehaviourGenericProcessor("showhovertextall", RLV_BHVR_SHOWHOVERTEXTALL)); + addEntry(new RlvBehaviourGenericProcessor("showhovertexthud", RLV_BHVR_SHOWHOVERTEXTHUD)); + addEntry(new RlvBehaviourGenericProcessor("showhovertextworld", RLV_BHVR_SHOWHOVERTEXTWORLD)); + addEntry(new RlvBehaviourGenericToggleProcessor("showinv")); + addEntry(new RlvBehaviourGenericProcessor("showloc", RLV_BHVR_SHOWLOC)); + addEntry(new RlvBehaviourGenericProcessor("showminimap", RLV_BHVR_SHOWMINIMAP)); + addEntry(new RlvBehaviourToggleProcessor("shownames", RlvBehaviourInfo::BHVR_STRICT)); + addEntry(new RlvBehaviourToggleProcessor("shownametags", RlvBehaviourInfo::BHVR_STRICT )); + addEntry(new RlvBehaviourGenericToggleProcessor("showself", RlvBehaviourInfo::BHVR_EXTENDED)); + addEntry(new RlvBehaviourGenericToggleProcessor("showselfhead", RlvBehaviourInfo::BHVR_EXTENDED)); + addEntry(new RlvBehaviourGenericProcessor("showworldmap", RLV_BHVR_SHOWWORLDMAP)); + addEntry(new RlvBehaviourGenericProcessor("sit", RLV_BHVR_SIT)); + addEntry(new RlvBehaviourGenericProcessor("sittp", RLV_BHVR_SITTP)); + addModifier(RLV_BHVR_SITTP, RLV_MODIFIER_SITTPDIST, new RlvBehaviourModifier("SitTp Distance", RLV_MODIFIER_SITTP_DEFAULT, true, new RlvBehaviourModifier_CompMin)); + addEntry(new RlvBehaviourGenericProcessor("standtp", RLV_BHVR_STANDTP)); + addEntry(new RlvBehaviourProcessor("startim", RlvBehaviourInfo::BHVR_STRICT)); + addModifier(RLV_BHVR_STARTIM, RLV_MODIFIER_STARTIMDISTMIN, new RlvBehaviourModifier("StartIM Distance (Min)", F32_MAX, true, new RlvBehaviourModifier_CompMax)); + addModifier(RLV_BHVR_STARTIM, RLV_MODIFIER_STARTIMDISTMAX, new RlvBehaviourModifier("StartIM Distance (Max)", F32_MAX, true, new RlvBehaviourModifier_CompMin)); + addEntry(new RlvBehaviourGenericProcessor("startimto", RLV_BHVR_STARTIMTO, RlvBehaviourInfo::BHVR_STRICT)); + addEntry(new RlvBehaviourGenericProcessor("temprun", RLV_BHVR_TEMPRUN)); + addEntry(new RlvBehaviourGenericProcessor("touchall", RLV_BHVR_TOUCHALL)); + addEntry(new RlvBehaviourGenericProcessor("touchattach", RLV_BHVR_TOUCHATTACH)); + addEntry(new RlvBehaviourGenericProcessor("touchattachother", RLV_BHVR_TOUCHATTACHOTHER)); + addEntry(new RlvBehaviourGenericProcessor("touchattachself", RLV_BHVR_TOUCHATTACHSELF)); + addEntry(new RlvBehaviourGenericProcessor("touchfar", RLV_BHVR_FARTOUCH, RlvBehaviourInfo::BHVR_SYNONYM)); + addEntry(new RlvBehaviourGenericProcessor("touchhud", RLV_BHVR_TOUCHHUD, RlvBehaviourInfo::BHVR_EXTENDED)); + addEntry(new RlvBehaviourGenericProcessor("touchme", RLV_BHVR_TOUCHME)); + addEntry(new RlvBehaviourGenericProcessor("touchthis", RLV_BHVR_TOUCHTHIS)); + addEntry(new RlvBehaviourGenericProcessor("touchworld", RLV_BHVR_TOUCHWORLD)); + addEntry(new RlvBehaviourGenericProcessor("tplm", RLV_BHVR_TPLM)); + addEntry(new RlvBehaviourGenericProcessor("tploc", RLV_BHVR_TPLOC)); + addEntry(new RlvBehaviourGenericProcessor("tplocal", RLV_BHVR_TPLOCAL)); + addModifier(RLV_BHVR_TPLOCAL, RLV_MODIFIER_TPLOCALDIST, new RlvBehaviourModifier("Local Teleport Distance", RLV_MODIFIER_TPLOCAL_DEFAULT, true, new RlvBehaviourModifier_CompMin)); + addEntry(new RlvBehaviourGenericProcessor("tplure", RLV_BHVR_TPLURE, RlvBehaviourInfo::BHVR_STRICT)); + addEntry(new RlvBehaviourGenericProcessor("tprequest", RLV_BHVR_TPREQUEST, RlvBehaviourInfo::BHVR_STRICT | RlvBehaviourInfo::BHVR_EXTENDED)); + addEntry(new RlvBehaviourInfo("unsharedunwear", RLV_BHVR_UNSHAREDUNWEAR, RLV_TYPE_ADDREM)); + addEntry(new RlvBehaviourInfo("unsharedwear", RLV_BHVR_UNSHAREDWEAR, RLV_TYPE_ADDREM)); + addEntry(new RlvBehaviourGenericProcessor("unsit", RLV_BHVR_UNSIT)); + addEntry(new RlvBehaviourGenericProcessor("viewnote", RLV_BHVR_VIEWNOTE)); + addEntry(new RlvBehaviourGenericProcessor("viewscript", RLV_BHVR_VIEWSCRIPT)); + addEntry(new RlvBehaviourGenericProcessor("viewtexture", RLV_BHVR_VIEWTEXTURE)); + // Camera + addEntry(new RlvBehaviourGenericToggleProcessor("setcam")); + addEntry(new RlvBehaviourGenericProcessor("setcam_avdistmin", RLV_BHVR_SETCAM_AVDISTMIN)); + addModifier(RLV_BHVR_SETCAM_AVDISTMIN, RLV_MODIFIER_SETCAM_AVDISTMIN, new RlvBehaviourModifierHandler("Camera - Avatar Distance (Min)", 0.0f, false, new RlvBehaviourModifier_CompMax())); + addEntry(new RlvBehaviourGenericProcessor("setcam_avdistmax", RLV_BHVR_SETCAM_AVDISTMAX)); + addModifier(RLV_BHVR_SETCAM_AVDISTMAX, RLV_MODIFIER_SETCAM_AVDISTMAX, new RlvBehaviourModifier("Camera - Avatar Distance (Max)", F32_MAX, false, new RlvBehaviourModifier_CompMin)); + addEntry(new RlvBehaviourGenericProcessor("setcam_origindistmin", RLV_BHVR_SETCAM_ORIGINDISTMIN)); + addModifier(RLV_BHVR_SETCAM_ORIGINDISTMIN, RLV_MODIFIER_SETCAM_ORIGINDISTMIN, new RlvBehaviourModifier("Camera - Focus Distance (Min)", 0.0f, true, new RlvBehaviourModifier_CompMax)); + addEntry(new RlvBehaviourGenericProcessor("setcam_origindistmax", RLV_BHVR_SETCAM_ORIGINDISTMAX)); + addModifier(RLV_BHVR_SETCAM_ORIGINDISTMAX, RLV_MODIFIER_SETCAM_ORIGINDISTMAX, new RlvBehaviourModifier("Camera - Focus Distance (Max)", F32_MAX, true, new RlvBehaviourModifier_CompMin)); + addEntry(new RlvBehaviourGenericToggleProcessor("setcam_eyeoffset", RlvBehaviourInfo::BHVR_EXPERIMENTAL)); + addModifier(RLV_BHVR_SETCAM_EYEOFFSET, RLV_MODIFIER_SETCAM_EYEOFFSET, new RlvBehaviourModifierHandler("Camera - Eye Offset", LLVector3::zero, true, nullptr)); + addEntry(new RlvBehaviourGenericToggleProcessor("setcam_focusoffset", RlvBehaviourInfo::BHVR_EXPERIMENTAL)); + addModifier(RLV_BHVR_SETCAM_FOCUSOFFSET, RLV_MODIFIER_SETCAM_FOCUSOFFSET, new RlvBehaviourModifierHandler("Camera - Focus Offset", LLVector3::zero, true, nullptr)); + addEntry(new RlvBehaviourGenericProcessor("setcam_fovmin", RLV_BHVR_SETCAM_FOVMIN)); + addModifier(RLV_BHVR_SETCAM_FOVMIN, RLV_MODIFIER_SETCAM_FOVMIN, new RlvBehaviourModifierHandler("Camera - FOV (Min)", DEFAULT_FIELD_OF_VIEW, true, new RlvBehaviourModifier_CompMax)); + addEntry(new RlvBehaviourGenericProcessor("setcam_fovmax", RLV_BHVR_SETCAM_FOVMAX)); + addEntry(new RlvBehaviourGenericToggleProcessor("setcam_mouselook")); + addModifier(RLV_BHVR_SETCAM_FOVMAX, RLV_MODIFIER_SETCAM_FOVMAX, new RlvBehaviourModifierHandler("Camera - FOV (Max)", DEFAULT_FIELD_OF_VIEW, true, new RlvBehaviourModifier_CompMin)); + addEntry(new RlvBehaviourGenericProcessor("setcam_textures", RLV_BHVR_SETCAM_TEXTURES)); + addModifier(RLV_BHVR_SETCAM_TEXTURES, RLV_MODIFIER_SETCAM_TEXTURE, new RlvBehaviourModifierHandler("Camera - Forced Texture", IMG_DEFAULT, true, nullptr)); + addEntry(new RlvBehaviourGenericToggleProcessor("setcam_unlock")); + // Camera (compatibility shim - to be deprecated) + addEntry(new RlvBehaviourGenericProcessor("camdistmin", RLV_BHVR_SETCAM_AVDISTMIN, RlvBehaviourInfo::BHVR_SYNONYM | RlvBehaviourInfo::BHVR_DEPRECATED)); + addEntry(new RlvBehaviourGenericProcessor("camdistmax", RLV_BHVR_SETCAM_AVDISTMAX, RlvBehaviourInfo::BHVR_SYNONYM | RlvBehaviourInfo::BHVR_DEPRECATED)); + addEntry(new RlvBehaviourGenericProcessor("camtextures", RLV_BHVR_SETCAM_TEXTURES, RlvBehaviourInfo::BHVR_SYNONYM | RlvBehaviourInfo::BHVR_DEPRECATED)); + addEntry(new RlvBehaviourProcessor("camzoommin", RlvBehaviourInfo::BHVR_DEPRECATED)); + addEntry(new RlvBehaviourProcessor("camzoommax", RlvBehaviourInfo::BHVR_DEPRECATED)); + addEntry(new RlvBehaviourGenericToggleProcessor("camunlock", RlvBehaviourInfo::BHVR_SYNONYM | RlvBehaviourInfo::BHVR_DEPRECATED)); + + // + // Force-wear + // + addEntry(new RlvBehaviourInfo("attach", RLV_CMD_FORCEWEAR, RLV_TYPE_FORCE, RlvBehaviourInfo::FORCEWEAR_WEAR_REPLACE | RlvBehaviourInfo::FORCEWEAR_NODE | RlvBehaviourInfo::FORCEWEAR_CONTEXT_NONE)); + addEntry(new RlvBehaviourInfo("attachall", RLV_CMD_FORCEWEAR, RLV_TYPE_FORCE, RlvBehaviourInfo::FORCEWEAR_WEAR_REPLACE | RlvBehaviourInfo::FORCEWEAR_SUBTREE | RlvBehaviourInfo::FORCEWEAR_CONTEXT_NONE)); + addEntry(new RlvBehaviourInfo("attachover", RLV_CMD_FORCEWEAR, RLV_TYPE_FORCE, RlvBehaviourInfo::FORCEWEAR_WEAR_ADD | RlvBehaviourInfo::FORCEWEAR_NODE | RlvBehaviourInfo::FORCEWEAR_CONTEXT_NONE)); + addEntry(new RlvBehaviourInfo("attachallover", RLV_CMD_FORCEWEAR, RLV_TYPE_FORCE, RlvBehaviourInfo::FORCEWEAR_WEAR_ADD | RlvBehaviourInfo::FORCEWEAR_SUBTREE | RlvBehaviourInfo::FORCEWEAR_CONTEXT_NONE)); + addEntry(new RlvBehaviourInfo("attachthis", RLV_CMD_FORCEWEAR, RLV_TYPE_FORCE, RlvBehaviourInfo::FORCEWEAR_WEAR_REPLACE | RlvBehaviourInfo::FORCEWEAR_NODE | RlvBehaviourInfo::FORCEWEAR_CONTEXT_OBJECT)); + addEntry(new RlvBehaviourInfo("attachallthis", RLV_CMD_FORCEWEAR, RLV_TYPE_FORCE, RlvBehaviourInfo::FORCEWEAR_WEAR_REPLACE | RlvBehaviourInfo::FORCEWEAR_SUBTREE | RlvBehaviourInfo::FORCEWEAR_CONTEXT_OBJECT)); + addEntry(new RlvBehaviourInfo("attachthisover", RLV_CMD_FORCEWEAR, RLV_TYPE_FORCE, RlvBehaviourInfo::FORCEWEAR_WEAR_ADD | RlvBehaviourInfo::FORCEWEAR_NODE | RlvBehaviourInfo::FORCEWEAR_CONTEXT_OBJECT)); + addEntry(new RlvBehaviourInfo("attachallthisover", RLV_CMD_FORCEWEAR, RLV_TYPE_FORCE, RlvBehaviourInfo::FORCEWEAR_WEAR_ADD | RlvBehaviourInfo::FORCEWEAR_SUBTREE | RlvBehaviourInfo::FORCEWEAR_CONTEXT_OBJECT)); + addEntry(new RlvForceProcessor("detach", RlvBehaviourInfo::FORCEWEAR_WEAR_REMOVE | RlvBehaviourInfo::FORCEWEAR_NODE | RlvBehaviourInfo::FORCEWEAR_CONTEXT_NONE)); + addEntry(new RlvBehaviourInfo("detachall", RLV_CMD_FORCEWEAR, RLV_TYPE_FORCE, RlvBehaviourInfo::FORCEWEAR_WEAR_REMOVE | RlvBehaviourInfo::FORCEWEAR_SUBTREE | RlvBehaviourInfo::FORCEWEAR_CONTEXT_NONE)); + addEntry(new RlvBehaviourInfo("detachthis", RLV_CMD_FORCEWEAR, RLV_TYPE_FORCE, RlvBehaviourInfo::FORCEWEAR_WEAR_REMOVE | RlvBehaviourInfo::FORCEWEAR_NODE | RlvBehaviourInfo::FORCEWEAR_CONTEXT_OBJECT)); + addEntry(new RlvBehaviourInfo("detachallthis", RLV_CMD_FORCEWEAR, RLV_TYPE_FORCE, RlvBehaviourInfo::FORCEWEAR_WEAR_REMOVE | RlvBehaviourInfo::FORCEWEAR_SUBTREE | RlvBehaviourInfo::FORCEWEAR_CONTEXT_OBJECT)); + addEntry(new RlvForceProcessor("remattach", RlvBehaviourInfo::FORCEWEAR_WEAR_REMOVE | RlvBehaviourInfo::FORCEWEAR_NODE | RlvBehaviourInfo::FORCEWEAR_CONTEXT_NONE)); + addEntry(new RlvForceProcessor("remoutfit", RlvBehaviourInfo::FORCEWEAR_WEAR_REMOVE | RlvBehaviourInfo::FORCEWEAR_NODE | RlvBehaviourInfo::FORCEWEAR_CONTEXT_NONE)); + // Synonyms (addoutfit* -> attach*) + addEntry(new RlvBehaviourInfo("addoutfit", RLV_CMD_FORCEWEAR, RLV_TYPE_FORCE, RlvBehaviourInfo::FORCEWEAR_WEAR_REPLACE | RlvBehaviourInfo::FORCEWEAR_NODE | RlvBehaviourInfo::FORCEWEAR_CONTEXT_NONE | RlvBehaviourInfo::BHVR_SYNONYM)); + addEntry(new RlvBehaviourInfo("addoutfitall", RLV_CMD_FORCEWEAR, RLV_TYPE_FORCE, RlvBehaviourInfo::FORCEWEAR_WEAR_REPLACE | RlvBehaviourInfo::FORCEWEAR_SUBTREE | RlvBehaviourInfo::FORCEWEAR_CONTEXT_NONE | RlvBehaviourInfo::BHVR_SYNONYM)); + addEntry(new RlvBehaviourInfo("addoutfitover", RLV_CMD_FORCEWEAR, RLV_TYPE_FORCE, RlvBehaviourInfo::FORCEWEAR_WEAR_ADD | RlvBehaviourInfo::FORCEWEAR_NODE | RlvBehaviourInfo::FORCEWEAR_CONTEXT_NONE | RlvBehaviourInfo::BHVR_SYNONYM)); + addEntry(new RlvBehaviourInfo("addoutfitallover", RLV_CMD_FORCEWEAR, RLV_TYPE_FORCE, RlvBehaviourInfo::FORCEWEAR_WEAR_ADD | RlvBehaviourInfo::FORCEWEAR_SUBTREE | RlvBehaviourInfo::FORCEWEAR_CONTEXT_NONE | RlvBehaviourInfo::BHVR_SYNONYM)); + addEntry(new RlvBehaviourInfo("addoutfitthis", RLV_CMD_FORCEWEAR, RLV_TYPE_FORCE, RlvBehaviourInfo::FORCEWEAR_WEAR_REPLACE | RlvBehaviourInfo::FORCEWEAR_NODE | RlvBehaviourInfo::FORCEWEAR_CONTEXT_OBJECT | RlvBehaviourInfo::BHVR_SYNONYM)); + addEntry(new RlvBehaviourInfo("addoutfitallthis", RLV_CMD_FORCEWEAR, RLV_TYPE_FORCE, RlvBehaviourInfo::FORCEWEAR_WEAR_REPLACE | RlvBehaviourInfo::FORCEWEAR_SUBTREE | RlvBehaviourInfo::FORCEWEAR_CONTEXT_OBJECT | RlvBehaviourInfo::BHVR_SYNONYM)); + addEntry(new RlvBehaviourInfo("addoutfitthisover", RLV_CMD_FORCEWEAR, RLV_TYPE_FORCE, RlvBehaviourInfo::FORCEWEAR_WEAR_ADD | RlvBehaviourInfo::FORCEWEAR_NODE | RlvBehaviourInfo::FORCEWEAR_CONTEXT_OBJECT | RlvBehaviourInfo::BHVR_SYNONYM)); + addEntry(new RlvBehaviourInfo("addoutfitallthisover", RLV_CMD_FORCEWEAR, RLV_TYPE_FORCE, RlvBehaviourInfo::FORCEWEAR_WEAR_ADD | RlvBehaviourInfo::FORCEWEAR_SUBTREE | RlvBehaviourInfo::FORCEWEAR_CONTEXT_OBJECT | RlvBehaviourInfo::BHVR_SYNONYM)); + // Synonyms (attach*overorreplace -> attach*) + addEntry(new RlvBehaviourInfo("attachoverorreplace", RLV_CMD_FORCEWEAR, RLV_TYPE_FORCE, RlvBehaviourInfo::FORCEWEAR_WEAR_REPLACE | RlvBehaviourInfo::FORCEWEAR_NODE | RlvBehaviourInfo::FORCEWEAR_CONTEXT_NONE | RlvBehaviourInfo::BHVR_SYNONYM)); + addEntry(new RlvBehaviourInfo("attachalloverorreplace", RLV_CMD_FORCEWEAR, RLV_TYPE_FORCE, RlvBehaviourInfo::FORCEWEAR_WEAR_REPLACE | RlvBehaviourInfo::FORCEWEAR_SUBTREE | RlvBehaviourInfo::FORCEWEAR_CONTEXT_NONE | RlvBehaviourInfo::BHVR_SYNONYM)); + addEntry(new RlvBehaviourInfo("attachthisoverorreplace",RLV_CMD_FORCEWEAR, RLV_TYPE_FORCE, RlvBehaviourInfo::FORCEWEAR_WEAR_REPLACE | RlvBehaviourInfo::FORCEWEAR_NODE | RlvBehaviourInfo::FORCEWEAR_CONTEXT_OBJECT | RlvBehaviourInfo::BHVR_SYNONYM)); + addEntry(new RlvBehaviourInfo("attachallthisoverorreplace",RLV_CMD_FORCEWEAR,RLV_TYPE_FORCE,RlvBehaviourInfo::FORCEWEAR_WEAR_REPLACE | RlvBehaviourInfo::FORCEWEAR_SUBTREE | RlvBehaviourInfo::FORCEWEAR_CONTEXT_OBJECT | RlvBehaviourInfo::BHVR_SYNONYM)); + + // + // Force-only + // + addEntry(new RlvBehaviourInfo("adjustheight", RLV_BHVR_ADJUSTHEIGHT, RLV_TYPE_FORCE)); + addEntry(new RlvForceProcessor("detachme")); + addEntry(new RlvForceProcessor("setcam_focus", RlvBehaviourInfo::BHVR_EXPERIMENTAL)); + addEntry(new RlvForceProcessor("setcam_eyeoffset", RlvBehaviourInfo::BHVR_EXPERIMENTAL)); + addEntry(new RlvForceProcessor("setcam_focusoffset", RlvBehaviourInfo::BHVR_EXPERIMENTAL)); + addEntry(new RlvForceProcessor("setcam_fov", RlvBehaviourInfo::BHVR_EXPERIMENTAL)); + addEntry(new RlvForceProcessor("setcam_mode", RlvBehaviourInfo::BHVR_EXPERIMENTAL)); + addEntry(new RlvForceProcessor("setgroup")); + addEntry(new RlvForceProcessor("sit")); + addEntry(new RlvForceProcessor("tpto")); + addEntry(new RlvBehaviourInfo("unsit", RLV_BHVR_UNSIT, RLV_TYPE_FORCE)); + + // + // Reply-only + // + addEntry(new RlvBehaviourInfo("findfolder", RLV_BHVR_FINDFOLDER, RLV_TYPE_REPLY)); + addEntry(new RlvBehaviourInfo("findfolders", RLV_BHVR_FINDFOLDERS, RLV_TYPE_REPLY, RlvBehaviourInfo::BHVR_EXTENDED)); + addEntry(new RlvBehaviourInfo("getaddattachnames", RLV_BHVR_GETADDATTACHNAMES, RLV_TYPE_REPLY, RlvBehaviourInfo::BHVR_EXPERIMENTAL)); + addEntry(new RlvBehaviourInfo("getaddoutfitnames", RLV_BHVR_GETADDOUTFITNAMES, RLV_TYPE_REPLY, RlvBehaviourInfo::BHVR_EXPERIMENTAL)); + addEntry(new RlvBehaviourInfo("getattach", RLV_BHVR_GETATTACH, RLV_TYPE_REPLY)); + addEntry(new RlvBehaviourInfo("getattachnames", RLV_BHVR_GETATTACHNAMES, RLV_TYPE_REPLY, RlvBehaviourInfo::BHVR_EXPERIMENTAL)); + addEntry(new RlvReplyProcessor("getcam_avdist", RlvBehaviourInfo::BHVR_EXPERIMENTAL)); + addEntry(new RlvReplyProcessor("getcam_avdistmin", RlvBehaviourInfo::BHVR_EXPERIMENTAL)); + addEntry(new RlvReplyProcessor("getcam_avdistmax", RlvBehaviourInfo::BHVR_EXPERIMENTAL)); + addEntry(new RlvReplyProcessor("getcam_fov", RlvBehaviourInfo::BHVR_EXPERIMENTAL)); + addEntry(new RlvReplyProcessor("getcam_fovmin", RlvBehaviourInfo::BHVR_EXPERIMENTAL)); + addEntry(new RlvReplyProcessor("getcam_fovmax", RlvBehaviourInfo::BHVR_EXPERIMENTAL)); + addEntry(new RlvReplyProcessor("getcam_textures", RlvBehaviourInfo::BHVR_EXPERIMENTAL)); + addEntry(new RlvReplyProcessor("getcommand", RlvBehaviourInfo::BHVR_EXTENDED)); + addEntry(new RlvBehaviourInfo("getgroup", RLV_BHVR_GETGROUP, RLV_TYPE_REPLY)); + addEntry(new RlvBehaviourInfo("getinv", RLV_BHVR_GETINV, RLV_TYPE_REPLY)); + addEntry(new RlvBehaviourInfo("getinvworn", RLV_BHVR_GETINVWORN, RLV_TYPE_REPLY)); + addEntry(new RlvBehaviourInfo("getoutfit", RLV_BHVR_GETOUTFIT, RLV_TYPE_REPLY)); + addEntry(new RlvBehaviourInfo("getoutfitnames", RLV_BHVR_GETOUTFITNAMES, RLV_TYPE_REPLY, RlvBehaviourInfo::BHVR_EXPERIMENTAL)); + addEntry(new RlvBehaviourInfo("getpath", RLV_BHVR_GETPATH, RLV_TYPE_REPLY)); + addEntry(new RlvBehaviourInfo("getpathnew", RLV_BHVR_GETPATHNEW, RLV_TYPE_REPLY)); + addEntry(new RlvBehaviourInfo("getremattachnames", RLV_BHVR_GETREMATTACHNAMES, RLV_TYPE_REPLY, RlvBehaviourInfo::BHVR_EXPERIMENTAL)); + addEntry(new RlvBehaviourInfo("getremoutfitnames", RLV_BHVR_GETREMOUTFITNAMES, RLV_TYPE_REPLY, RlvBehaviourInfo::BHVR_EXPERIMENTAL)); + addEntry(new RlvBehaviourInfo("getsitid", RLV_BHVR_GETSITID, RLV_TYPE_REPLY)); + addEntry(new RlvBehaviourInfo("getstatus", RLV_BHVR_GETSTATUS, RLV_TYPE_REPLY)); + addEntry(new RlvBehaviourInfo("getstatusall", RLV_BHVR_GETSTATUSALL, RLV_TYPE_REPLY)); + addEntry(new RlvBehaviourInfo("version", RLV_BHVR_VERSION, RLV_TYPE_REPLY)); + addEntry(new RlvBehaviourInfo("versionnew", RLV_BHVR_VERSIONNEW, RLV_TYPE_REPLY)); + addEntry(new RlvBehaviourInfo("versionnum", RLV_BHVR_VERSIONNUM, RLV_TYPE_REPLY)); + + // Populate m_String2InfoMap (the tuple should be unique) + for (const RlvBehaviourInfo* pBhvrInfo : m_BhvrInfoList) + { + RLV_VERIFY(m_String2InfoMap.insert(std::make_pair(std::make_pair(pBhvrInfo->getBehaviour(), (ERlvParamType)pBhvrInfo->getParamTypeMask()), pBhvrInfo)).second == true); + } + + // Populate m_Bhvr2InfoMap (there can be multiple entries per ERlvBehaviour) + for (const RlvBehaviourInfo* pBhvrInfo : m_BhvrInfoList) + { + if ( (pBhvrInfo->getParamTypeMask() & RLV_TYPE_ADDREM) && (!pBhvrInfo->isSynonym()) ) + { +#ifdef RLV_DEBUG + for (const rlv_bhvr2info_map_t::value_type& itBhvr : boost::make_iterator_range(m_Bhvr2InfoMap.lower_bound(pBhvrInfo->getBehaviourType()), m_Bhvr2InfoMap.upper_bound(pBhvrInfo->getBehaviourType()))) + { + RLV_ASSERT( (itBhvr.first != pBhvrInfo->getBehaviourType()) || (itBhvr.second->getBehaviourFlags() != pBhvrInfo->getBehaviourFlags()) ); + } +#endif // RLV_DEBUG + m_Bhvr2InfoMap.insert(std::pair(pBhvrInfo->getBehaviourType(), pBhvrInfo)); + } + } + + // Process blocked commands + if (RlvSettings::getNoSetEnv()) + toggleBehaviourFlag("setenv", RLV_TYPE_ADDREM, RlvBehaviourInfo::BHVR_BLOCKED, true); +} + +RlvBehaviourDictionary::~RlvBehaviourDictionary() +{ + for (const RlvBehaviourInfo* pBhvrInfo : m_BhvrInfoList) + delete pBhvrInfo; + m_BhvrInfoList.clear(); + + for (int idxBhvrMod = 0; idxBhvrMod < RLV_MODIFIER_COUNT; idxBhvrMod++) + { + delete m_BehaviourModifiers[idxBhvrMod]; + m_BehaviourModifiers[idxBhvrMod] = nullptr; + } +} + +void RlvBehaviourDictionary::addEntry(const RlvBehaviourInfo* pEntry) +{ + // Filter experimental commands (if disabled) + static LLCachedControl sEnableExperimental(gSavedSettings, "RLVaExperimentalCommands"); + if ( (!pEntry) || ((!sEnableExperimental) && (pEntry->isExperimental())) ) + { + return; + } + + // Sanity check for duplicate entries +#ifndef LL_RELEASE_FOR_DOWNLOAD + std::for_each(m_BhvrInfoList.begin(), m_BhvrInfoList.end(), + [&pEntry](const RlvBehaviourInfo* pBhvrInfo) { + RLV_ASSERT_DBG( ((pBhvrInfo->getBehaviour()) != (pEntry->getBehaviour())) || ((pBhvrInfo->getParamTypeMask() & pEntry->getParamTypeMask()) == 0) ); + }); +#endif // LL_RELEASE_FOR_DOWNLOAD + + m_BhvrInfoList.push_back(pEntry); +} + +void RlvBehaviourDictionary::addModifier(ERlvBehaviour eBhvr, ERlvBehaviourModifier eModifier, RlvBehaviourModifier* pModifierEntry) +{ + if (eModifier < RLV_MODIFIER_COUNT) + { + m_BehaviourModifiers[eModifier] = pModifierEntry; + m_Bhvr2ModifierMap.insert(std::make_pair(eBhvr, eModifier)); + } +} + +const RlvBehaviourInfo* RlvBehaviourDictionary::getBehaviourInfo(const std::string& strBhvr, ERlvParamType eParamType, bool* pfStrict) const +{ + bool fStrict = boost::algorithm::ends_with(strBhvr, "_sec"); + if (pfStrict) + *pfStrict = fStrict; + + rlv_string2info_map_t::const_iterator itBhvr = m_String2InfoMap.find(std::make_pair(strBhvr, (eParamType & RLV_TYPE_ADDREM) ? RLV_TYPE_ADDREM : eParamType)); + return ( (itBhvr != m_String2InfoMap.end()) && ((!fStrict) || (itBhvr->second->hasStrict())) ) ? itBhvr->second : NULL; +} + +ERlvBehaviour RlvBehaviourDictionary::getBehaviourFromString(const std::string& strBhvr, ERlvParamType eParamType, bool* pfStrict) const +{ + const RlvBehaviourInfo* pBhvrInfo = getBehaviourInfo(strBhvr, eParamType, pfStrict); + return (pBhvrInfo) ? pBhvrInfo->getBehaviourType() : RLV_BHVR_UNKNOWN; +} + +bool RlvBehaviourDictionary::getCommands(const std::string& strMatch, ERlvParamType eParamType, std::list& cmdList) const +{ + cmdList.clear(); + for (const RlvBehaviourInfo* pBhvrInfo : m_BhvrInfoList) + { + if ( (pBhvrInfo->getParamTypeMask() & eParamType) || (RLV_TYPE_UNKNOWN == eParamType) ) + { + std::string strCmd = pBhvrInfo->getBehaviour(); + if ( (std::string::npos != strCmd.find(strMatch)) || (strMatch.empty()) ) + cmdList.push_back(strCmd); + if ( (pBhvrInfo->hasStrict()) && ((std::string::npos != strCmd.append("_sec").find(strMatch)) || (strMatch.empty())) ) + cmdList.push_back(strCmd); + } + } + return !cmdList.empty(); +} + +bool RlvBehaviourDictionary::getHasStrict(ERlvBehaviour eBhvr) const +{ + for (const rlv_bhvr2info_map_t::value_type& itBhvr : boost::make_iterator_range(m_Bhvr2InfoMap.lower_bound(eBhvr), m_Bhvr2InfoMap.upper_bound(eBhvr))) + { + // Only restrictions can be strict + if (RLV_TYPE_ADDREM != itBhvr.second->getParamTypeMask()) + continue; + return itBhvr.second->hasStrict(); + } + RLV_ASSERT(false); + return false; +} + +RlvBehaviourModifier* RlvBehaviourDictionary::getModifierFromBehaviour(ERlvBehaviour eBhvr) const +{ + rlv_bhvr2mod_map_t::const_iterator itMod = m_Bhvr2ModifierMap.find(eBhvr); + ERlvBehaviourModifier eBhvrMod = (m_Bhvr2ModifierMap.end() != itMod) ? itMod->second : RLV_MODIFIER_UNKNOWN; + return (eBhvrMod < RLV_MODIFIER_UNKNOWN) ? m_BehaviourModifiers[eBhvrMod] : nullptr; +} + +void RlvBehaviourDictionary::toggleBehaviourFlag(const std::string& strBhvr, ERlvParamType eParamType, RlvBehaviourInfo::EBehaviourFlags eBhvrFlag, bool fEnable) +{ + rlv_string2info_map_t::const_iterator itBhvr = m_String2InfoMap.find(std::make_pair(strBhvr, (eParamType & RLV_TYPE_ADDREM) ? RLV_TYPE_ADDREM : eParamType)); + if (m_String2InfoMap.end() != itBhvr) + { + const_cast(itBhvr->second)->toggleBehaviourFlag(eBhvrFlag, fEnable); + } +} + +// ============================================================================ +// RlvBehaviourModifier +// + +RlvBehaviourModifier::RlvBehaviourModifier(std::string strName, const RlvBehaviourModifierValue& defaultValue, bool fAddDefaultOnEmpty, RlvBehaviourModifier_Comp* pValueComparator) + : m_strName(strName), m_DefaultValue(defaultValue), m_fAddDefaultOnEmpty(fAddDefaultOnEmpty), m_pValueComparator(pValueComparator) +{ + m_pValueComparator = (pValueComparator) ? pValueComparator : new RlvBehaviourModifier_Comp(); +} + +RlvBehaviourModifier::~RlvBehaviourModifier() +{ + if (m_pValueComparator) + { + delete m_pValueComparator; + m_pValueComparator = NULL; + } +} + +bool RlvBehaviourModifier::addValue(const RlvBehaviourModifierValue& modValue, const LLUUID& idObject) +{ + if (modValue.which() == m_DefaultValue.which()) + { + m_Values.insert((m_pValueComparator) ? std::lower_bound(m_Values.begin(), m_Values.end(), std::make_pair(modValue, idObject), boost::bind(&RlvBehaviourModifier_Comp::operator(), m_pValueComparator, _1, _2)) : m_Values.end(), std::make_pair(modValue, idObject)); + // NOTE: change signal needs to trigger before modifier handlers so cached values have a chance to update properly + m_ChangeSignal(getValue()); + onValueChange(); + return true; + } + return false; +} + +const LLUUID& RlvBehaviourModifier::getPrimaryObject() const +{ + return (m_pValueComparator) ? m_pValueComparator->m_idPrimaryObject : LLUUID::null; +} + +bool RlvBehaviourModifier::hasValue() const { + // If no primary object is set this returns "any value set"; otherwise it returns "any value set by the primary object" + if ( (!m_pValueComparator) || (m_pValueComparator->m_idPrimaryObject.isNull()) ) + return !m_Values.empty(); + return (!m_Values.empty()) ? m_Values.front().second == m_pValueComparator->m_idPrimaryObject : false; +} + +void RlvBehaviourModifier::removeValue(const RlvBehaviourModifierValue& modValue, const LLUUID& idObject) +{ + if ( (modValue.which() == m_DefaultValue.which()) ) + { + auto itValue = std::find(m_Values.begin(), m_Values.end(), std::make_pair(modValue, idObject)); + if (m_Values.end() != itValue) + { + m_Values.erase(itValue); + onValueChange(); + m_ChangeSignal(getValue()); + } + } +} + +void RlvBehaviourModifier::setPrimaryObject(const LLUUID& idPrimaryObject) +{ + if (m_pValueComparator) + { + m_pValueComparator->m_idPrimaryObject = idPrimaryObject; + m_Values.sort(boost::bind(&RlvBehaviourModifier_Comp::operator(), m_pValueComparator, _1, _2)); + onValueChange(); + m_ChangeSignal(getValue()); + } +} + +bool RlvBehaviourModifier::convertOptionValue(const std::string& optionValue, RlvBehaviourModifierValue& modValue) const +{ + try + { + if (typeid(float) == m_DefaultValue.type()) + { + modValue = std::stof(optionValue); + return true; + } + else if (typeid(int) == m_DefaultValue.type()) + { + modValue = std::stoi(optionValue); + return true; + } + else if (typeid(LLVector3) == m_DefaultValue.type()) + { + LLVector3 vecOption; + if (3 == sscanf(optionValue.c_str(), "%f/%f/%f", vecOption.mV + 0, vecOption.mV + 1, vecOption.mV + 2)) + { + modValue = vecOption; + return true; + } + } + else if (typeid(LLUUID) == m_DefaultValue.type()) + { + LLUUID idOption; + if (LLUUID::parseUUID(optionValue, &idOption)) + { + modValue = idOption; + return true; + } + } + return false; + } + catch (const std::invalid_argument&) + { + return false; + } +} + // ============================================================================ // RlvCommmand // -RlvCommand::bhvr_map_t RlvCommand::m_BhvrMap; - -// Checked: 2009-12-27 (RLVa-1.1.0k) | Modified: RLVa-1.1.0k RlvCommand::RlvCommand(const LLUUID& idObj, const std::string& strCommand) - : m_fValid(false), m_idObj(idObj), m_eBehaviour(RLV_BHVR_UNKNOWN), m_fStrict(false), m_eParamType(RLV_TYPE_UNKNOWN), m_eRet(RLV_RET_UNKNOWN) + : m_fValid(false), m_idObj(idObj), m_pBhvrInfo(NULL), m_eParamType(RLV_TYPE_UNKNOWN), m_fStrict(false), m_fRefCounted(false) { if ((m_fValid = parseCommand(strCommand, m_strBehaviour, m_strOption, m_strParam))) { @@ -63,24 +555,18 @@ RlvCommand::RlvCommand(const LLUUID& idObj, const std::string& strCommand) if (!m_fValid) { - m_strBehaviour = m_strOption = m_strParam = ""; + m_strOption = m_strParam = ""; return; } - // HACK: all those @*overorreplace synonyms are rather tedious (and error-prone) to deal with so replace them their equivalent - if ( (RLV_TYPE_FORCE == m_eParamType) && - (m_strBehaviour.length() > 13) && (m_strBehaviour.length() - 13 == m_strBehaviour.rfind("overorreplace")) ) - { - m_strBehaviour.erase(m_strBehaviour.length() - 13, 13); - } - // HACK: all those @addoutfit* synonyms are rather tedious (and error-prone) to deal with so replace them their @attach* equivalent - if ( (RLV_TYPE_FORCE == m_eParamType) && (0 == m_strBehaviour.find("addoutfit")) ) - { - m_strBehaviour.replace(0, 9, "attach"); - } - m_eBehaviour = getBehaviourFromString(m_strBehaviour, &m_fStrict); + m_pBhvrInfo = RlvBehaviourDictionary::instance().getBehaviourInfo(m_strBehaviour, m_eParamType, &m_fStrict); } +RlvCommand::RlvCommand(const RlvCommand& rlvCmd, ERlvParamType eParamType) + : m_fValid(rlvCmd.m_fValid), m_idObj(rlvCmd.m_idObj), m_strBehaviour(rlvCmd.m_strBehaviour), m_pBhvrInfo(rlvCmd.m_pBhvrInfo), + m_eParamType( (RLV_TYPE_UNKNOWN == eParamType) ? rlvCmd.m_eParamType : eParamType),m_fStrict(rlvCmd.m_fStrict), m_strOption(rlvCmd.m_strOption), m_strParam(rlvCmd.m_strParam), m_fRefCounted(false) +{ +} bool RlvCommand::parseCommand(const std::string& strCommand, std::string& strBehaviour, std::string& strOption, std::string& strParam) { @@ -116,103 +602,134 @@ bool RlvCommand::parseCommand(const std::string& strCommand, std::string& strBeh return true; } -// Checked: 2009-12-05 (RLVa-1.1.0h) | Added: RLVa-1.1.0h -ERlvBehaviour RlvCommand::getBehaviourFromString(const std::string& strBhvr, bool* pfStrict /*=NULL*/) -{ - std::string::size_type idxStrict = strBhvr.find("_sec"); - bool fStrict = (std::string::npos != idxStrict) && (idxStrict + 4 == strBhvr.length()); - if (pfStrict) - *pfStrict = fStrict; +// ============================================================================ +// Command option parsing utility classes +// - RLV_ASSERT(m_BhvrMap.size() > 0); - bhvr_map_t::const_iterator itBhvr = m_BhvrMap.find( (!fStrict) ? strBhvr : strBhvr.substr(0, idxStrict)); - if ( (itBhvr != m_BhvrMap.end()) && ((!fStrict) || (hasStrictVariant(itBhvr->second))) ) - return itBhvr->second; - return RLV_BHVR_UNKNOWN; +template<> +bool RlvCommandOptionHelper::parseOption(const std::string& strOption, LLUUID& idOption) +{ + idOption.set(strOption); + return idOption.notNull(); } -// Checked: 2010-12-11 (RLVa-1.2.2c) | Added: RLVa-1.2.2c -bool RlvCommand::getCommands(bhvr_map_t& cmdList, const std::string &strMatch) +template<> +bool RlvCommandOptionHelper::parseOption(const std::string& strOption, int& nOption) { - if (strMatch.empty()) + try + { + nOption = std::stoi(strOption); + } + catch (const std::invalid_argument&) + { return false; - cmdList.clear(); - - RLV_ASSERT(m_BhvrMap.size() > 0); - for (bhvr_map_t::const_iterator itBhvr = m_BhvrMap.begin(); itBhvr != m_BhvrMap.end(); ++itBhvr) - { - std::string strCmd = itBhvr->first; ERlvBehaviour eBhvr = itBhvr->second; - if (std::string::npos != strCmd.find(strMatch)) - cmdList.insert(std::pair(strCmd, eBhvr)); - if ( (hasStrictVariant(eBhvr)) && (std::string::npos != strCmd.append("_sec").find(strMatch)) ) - cmdList.insert(std::pair(strCmd, eBhvr)); } - return (0 != cmdList.size()); + return true; } -// Checked: 2010-02-27 (RLVa-1.2.0a) | Modified: RLVa-1.1.0h -void RlvCommand::initLookupTable() +template<> +bool RlvCommandOptionHelper::parseOption(const std::string& strOption, float& nOption) { - static bool fInitialized = false; - if (!fInitialized) + try { - // NOTE: keep this matched with the enumeration at all times - std::string arBehaviours[RLV_BHVR_COUNT] = - { - "detach", "attach", "addattach", "remattach", "addoutfit", "remoutfit", "sharedwear", "sharedunwear", - "unsharedwear", "unsharedunwear", "emote", "sendchat", "recvchat", "recvchatfrom", "recvemote", "recvemotefrom", - "redirchat", "rediremote", "chatwhisper", "chatnormal", "chatshout", "sendchannel", "sendim", "sendimto", - "recvim", "recvimfrom", "startim", "startimto", "permissive", "notify", "showinv", "showminimap", "showworldmap", "showloc", - "shownames", "showhovertext", "showhovertexthud", "showhovertextworld", "showhovertextall", "tplm", "tploc", "tplure", "tprequest", - "viewnote", "viewscript", "viewtexture", "acceptpermission", "accepttp", "accepttprequest", "allowidle", "edit", "editobj", "rez", - "fartouch", "interact", "touchthis", "touchattach", "touchattachself", "touchattachother", "touchhud", "touchworld", "touchall", - "touchme", "fly", "setgroup", "unsit", "sit", "sittp", "standtp", "setdebug", "setenv", "alwaysrun", "temprun", "detachme", - "attachover", "attachthis", "attachthisover", "attachthis_except", "detachthis", "detachthis_except", "attachall", - "attachallover", "detachall", "attachallthis", "attachallthis_except", "attachallthisover", "detachallthis", - "detachallthis_except", "adjustheight", "tpto", "version", "versionnew", "versionnum", "getattach", "getattachnames", - "getaddattachnames", "getremattachnames", "getoutfit", "getoutfitnames", "getaddoutfitnames", "getremoutfitnames", - "findfolder", "findfolders", "getpath", "getpathnew", "getinv", "getinvworn", "getgroup", "getsitid", "getcommand", - "getstatus", "getstatusall" - }; - - for (int idxBvhr = 0; idxBvhr < RLV_BHVR_COUNT; idxBvhr++) - m_BhvrMap.insert(std::pair(arBehaviours[idxBvhr], (ERlvBehaviour)idxBvhr)); - - // FIRE-4358: Add "touchfar" synonym for "fartouch" - m_BhvrMap.insert(std::pair("touchfar", RLV_BHVR_FARTOUCH)); - - fInitialized = true; + nOption = std::stof(strOption); } + catch (const std::invalid_argument&) + { + return false; + } + return true; +} + +template<> +bool RlvCommandOptionHelper::parseOption(const std::string& strOption, LLWearableType::EType& wtOption) +{ + wtOption = LLWearableType::typeNameToType(strOption); + return (LLWearableType::WT_INVALID != wtOption) && (LLWearableType::WT_NONE != wtOption); +} + +template<> +bool RlvCommandOptionHelper::parseOption(const std::string& strOption, LLViewerJointAttachment*& pAttachPt) +{ + pAttachPt = RlvAttachPtLookup::getAttachPoint(strOption); + return pAttachPt != NULL; +} + +template<> +bool RlvCommandOptionHelper::parseOption(const std::string& strOption, ERlvAttachGroupType& eAttachGroup) +{ + eAttachGroup = rlvAttachGroupFromString(strOption); + return eAttachGroup != RLV_ATTACHGROUP_INVALID; +} + +template<> +bool RlvCommandOptionHelper::parseOption(const std::string& strOption, LLViewerInventoryCategory*& pFolder) +{ + pFolder = RlvInventory::instance().getSharedFolder(strOption); + return pFolder != NULL; +} + +template<> +bool RlvCommandOptionHelper::parseOption(const std::string& strOption, LLVector3& vecOption) + { + if (!strOption.empty()) + { + S32 cntToken = sscanf(strOption.c_str(), "%f/%f/%f", vecOption.mV + 0, vecOption.mV + 1, vecOption.mV + 2); + return (3 == cntToken); + } + return false; +} + +template<> +bool RlvCommandOptionHelper::parseOption(const std::string& strOption, LLVector3d& vecOption) + { + if (!strOption.empty()) + { + S32 cntToken = sscanf(strOption.c_str(), "%lf/%lf/%lf", vecOption.mdV + 0, vecOption.mdV + 1, vecOption.mdV + 2); + return (3 == cntToken); + } + return false; +} + +template<> +bool RlvCommandOptionHelper::parseOption(const std::string& strOption, RlvCommandOptionGeneric& genericOption) +{ + LLWearableType::EType wtType(LLWearableType::WT_INVALID); LLUUID idOption; ERlvAttachGroupType eAttachGroup(RLV_ATTACHGROUP_INVALID); + LLViewerJointAttachment* pAttachPt = NULL; LLViewerInventoryCategory* pFolder = NULL; LLVector3d posOption; float nOption; + + if (!strOption.empty()) // + blocked_autopilot + + value + Unable to use the autopilot due to RLV restrictions + blocked_generic value @@ -76,6 +81,11 @@ value Unable to initiate teleport due to RLV restrictions + blocked_teleport_offer + + value + Unable to offer teleport due to RLV restrictions + blocked_viewxxx value @@ -110,28 +120,6 @@ customizable 1 - - - message_toggle_restart - - value - RestrainedLove Support will be %s after you restart - - message_toggle_restart_pending - - value - (pending restart) - - message_toggle_restart_enabled - - value - enabled - - message_toggle_restart_disabled - - value - disabled - diff --git a/indra/newview/skins/default/xui/en/strings.xml b/indra/newview/skins/default/xui/en/strings.xml index 1316f2df9a..10ebb3e856 100644 --- a/indra/newview/skins/default/xui/en/strings.xml +++ b/indra/newview/skins/default/xui/en/strings.xml @@ -36,6 +36,11 @@ You are at [POSITION_LOCAL_0,number,1], [POSITION_LOCAL_1,number,1], [POSITION_L SLURL: <nolink>[SLURL]</nolink> (global coordinates [POSITION_0,number,1], [POSITION_1,number,1], [POSITION_2,number,1]) [SERVER_VERSION] +[SERVER_RELEASE_NOTES_URL] + + +You are in [REGION] +[SERVER_VERSION] [SERVER_RELEASE_NOTES_URL] [User] + + (pending restart) + RestrainedLove Support will be %s after you restart + enabled + disabled + Experience (no experience) diff --git a/indra/newview/skins/vintage/xui/en/floater_about_land.xml b/indra/newview/skins/vintage/xui/en/floater_about_land.xml old mode 100755 new mode 100644 diff --git a/indra/newview/skins/vintage/xui/en/widgets/inventory_panel.xml b/indra/newview/skins/vintage/xui/en/widgets/inventory_panel.xml old mode 100755 new mode 100644