diff --git a/README b/README index a441bfedf..8d470c1c9 100644 --- a/README +++ b/README @@ -15,8 +15,8 @@ Singularity Viewer is a SecondLife(tm) protocol compatible client application. It can be used to access SecondLife services as well as a number of others such as those based upon the OpenSim platform. -Singulariy is maintained by a small group of volunteers who can be contacted -both, in-world (SingularityViewer group) as well on IRC (#SingularityViewer +Singularity is maintained by a small group of volunteers who can be contacted +both, in-world (SingularityViewer group) as well as on IRC (#SingularityViewer @ FreeNode). Bug requests and features requests can be submitted through our Issue Tracker (http://code.google.com/p/singularity-viewer/issues/list or from the viewer menu: Help --> Bug Reporting --> Singularity Issue Tracker...) diff --git a/indra/CMakeLists.txt b/indra/CMakeLists.txt index fc7b0a878..8b71ccf51 100644 --- a/indra/CMakeLists.txt +++ b/indra/CMakeLists.txt @@ -75,7 +75,6 @@ if (WINDOWS AND EXISTS ${LIBS_CLOSED_DIR}copy_win_scripts) endif (WINDOWS AND EXISTS ${LIBS_CLOSED_DIR}copy_win_scripts) add_custom_target(viewer) -add_subdirectory(${LIBS_OPEN_PREFIX}llcrashlogger) add_subdirectory(${LIBS_OPEN_PREFIX}llplugin) add_subdirectory(${LIBS_OPEN_PREFIX}llui) @@ -87,28 +86,6 @@ add_subdirectory(${LIBS_OPEN_PREFIX}plugins) # add_subdirectory(${VIEWER_PREFIX}test_apps/llplugintest) #endif (NOT LINUX) -if (LINUX) - add_subdirectory(${VIEWER_PREFIX}linux_crash_logger) - add_dependencies(viewer linux-crash-logger-strip-target) -elseif (DARWIN) - #add_subdirectory(${VIEWER_PREFIX}mac_crash_logger) - #add_subdirectory(${VIEWER_PREFIX}mac_updater) - add_dependencies(viewer mac-crash-logger) - #add_dependencies(viewer mac-updater) -elseif (WINDOWS) - add_subdirectory(${VIEWER_PREFIX}win_crash_logger) - # cmake EXISTS requires an absolute path, see indra/cmake/Variables.cmake - if (EXISTS ${VIEWER_DIR}win_setup) - add_subdirectory(${VIEWER_DIR}win_setup) - endif (EXISTS ${VIEWER_DIR}win_setup) - add_subdirectory(${VIEWER_PREFIX}win_updater) - add_dependencies(viewer windows-updater) - add_dependencies(viewer windows-crash-logger) -elseif (SOLARIS) - add_subdirectory(solaris_crash_logger) - add_dependencies(viewer solaris-crash-logger) -endif (LINUX) - add_subdirectory(${VIEWER_PREFIX}newview/statemachine) add_subdirectory(${VIEWER_PREFIX}newview) add_dependencies(viewer secondlife-bin) diff --git a/indra/aistatemachine/aistatemachine.cpp b/indra/aistatemachine/aistatemachine.cpp index 6903589f2..bf867fffd 100644 --- a/indra/aistatemachine/aistatemachine.cpp +++ b/indra/aistatemachine/aistatemachine.cpp @@ -202,7 +202,7 @@ char const* HelloWorld::state_str_impl(state_type run_state) const // with that state. // multiplex_impl() may never reentrant (cause itself to be called). // multiplex_impl() should end by callling either one of: -// idle(current_state), yield*(), finish() [or abort()]. +// idle(), yield*(), finish() [or abort()]. // Leaving multiplex_impl() without calling any of those might result in an // immediate reentry, which could lead to 100% CPU usage unless the state // is changed with set_state(). @@ -212,7 +212,7 @@ char const* HelloWorld::state_str_impl(state_type run_state) const // the call back passed to run() will be called. // Upon return from the call back, the state machine object might be destructed // (see below). -// If idle(current_state) was called, and the state was (still) current_state, +// If idle() was called, and the state was (still) current_state, // then multiplex_impl() will not be called again until the state is // advanced, or cont() is called. // @@ -245,10 +245,9 @@ char const* HelloWorld::state_str_impl(state_type run_state) const // following functions can be called: // // - set_state(new_state) --> Force the state to new_state. This voids any previous call to set_state() or idle(). -// - idle(current_state) --> If the current state is still current_state (if there was no call to advance_state() -// since the last call to set_state(current_state)) then go idle (do nothing until -// cont() or advance_state() is called). If the current state is not current_state, -// then multiplex_impl shall be reentered immediately upon return. +// - idle() --> If there was no call to advance_state() since the last call to set_state(current_state)) +// then go idle (do nothing until cont() or advance_state() is called). If the current +// state is not current_state, then multiplex_impl shall be reentered immediately upon return. // - finish() --> Disables any scheduled runs. // --> finish_impl --> [optional] kill() // --> call back diff --git a/indra/cmake/00-Common.cmake b/indra/cmake/00-Common.cmake index e8ce73f7d..a45c07f69 100644 --- a/indra/cmake/00-Common.cmake +++ b/indra/cmake/00-Common.cmake @@ -12,11 +12,25 @@ include(Variables) set(CMAKE_CXX_FLAGS_DEBUG "-D_DEBUG -DLL_DEBUG=1") set(CMAKE_CXX_FLAGS_RELEASE - "-DLL_RELEASE=1 -DLL_RELEASE_FOR_DOWNLOAD=1 -D_SECURE_SCL=0 -DLL_SEND_CRASH_REPORTS=1 -DNDEBUG") + "-DLL_RELEASE=1 -DLL_RELEASE_FOR_DOWNLOAD=1 -D_SECURE_SCL=0 -DNDEBUG") set(CMAKE_C_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE}") set(CMAKE_CXX_FLAGS_RELWITHDEBINFO - "-DLL_RELEASE=1 -D_SECURE_SCL=0 -DLL_SEND_CRASH_REPORTS=0 -DNDEBUG -DLL_RELEASE_WITH_DEBUG_INFO=1") + "-DLL_RELEASE=1 -D_SECURE_SCL=0 -DNDEBUG -DLL_RELEASE_WITH_DEBUG_INFO=1") + +# Configure crash reporting +set(RELEASE_CRASH_REPORTING OFF CACHE BOOL "Enable use of crash reporting in release builds") +set(NON_RELEASE_CRASH_REPORTING OFF CACHE BOOL "Enable use of crash reporting in developer builds") + +if(RELEASE_CRASH_REPORTING) + set(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} -DLL_SEND_CRASH_REPORTS=1") +endif() + +if(NON_RELEASE_CRASH_REPORTING) + set(CMAKE_CXX_FLAGS_RELWITHDEBINFO "${CMAKE_CXX_FLAGS_RELWITHDEBINFO} -DLL_SEND_CRASH_REPORTS=1") + set(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} -DLL_SEND_CRASH_REPORTS=1") +endif() + # Don't bother with a MinSizeRel build. diff --git a/indra/cmake/Boost.cmake b/indra/cmake/Boost.cmake index 16d4d2461..e8d97a574 100644 --- a/indra/cmake/Boost.cmake +++ b/indra/cmake/Boost.cmake @@ -8,34 +8,77 @@ if (STANDALONE) include(FindBoost) set(Boost_USE_MULTITHREADED ON) - find_package(Boost 1.40.0 COMPONENTS date_time filesystem program_options regex system thread wave) + find_package(Boost 1.51.0 COMPONENTS date_time filesystem program_options regex system thread wave context) else (STANDALONE) use_prebuilt_binary(boost) set(Boost_INCLUDE_DIRS ${LIBS_PREBUILT_DIR}/${LL_ARCH_DIR}/include) + set(Boost_VERSION "1.52") if (WINDOWS) - set(BOOST_VERSION 1_45) - set(BOOST_OPTIM_SUFFIX mt) - set(BOOST_DEBUG_SUFFIX mt-gd) - + set(Boost_CONTEXT_LIBRARY + optimized libboost_context-mt + debug libboost_context-mt-gd) + set(Boost_FILESYSTEM_LIBRARY + optimized libboost_filesystem-mt + debug libboost_filesystem-mt-gd) set(Boost_PROGRAM_OPTIONS_LIBRARY - optimized libboost_program_options-vc${MSVC_SUFFIX}-${BOOST_OPTIM_SUFFIX}-${BOOST_VERSION} - debug libboost_program_options-vc${MSVC_SUFFIX}-${BOOST_DEBUG_SUFFIX}-${BOOST_VERSION}) + optimized libboost_program_options-mt + debug libboost_program_options-mt-gd) set(Boost_REGEX_LIBRARY - optimized libboost_regex-vc${MSVC_SUFFIX}-${BOOST_OPTIM_SUFFIX}-${BOOST_VERSION} - debug libboost_regex-vc${MSVC_SUFFIX}-${BOOST_DEBUG_SUFFIX}-${BOOST_VERSION}) - - elseif (DARWIN) - set(Boost_FILESYSTEM_LIBRARY boost_filesystem) - set(Boost_PROGRAM_OPTIONS_LIBRARY boost_program_options) - set(Boost_REGEX_LIBRARY boost_regex) - set(Boost_SYSTEM_LIBRARY boost_system) - set(Boost_DATE_TIME_LIBRARY boost_date_time) + optimized libboost_regex-mt + debug libboost_regex-mt-gd) + set(Boost_SIGNALS_LIBRARY + optimized libboost_signals-mt + debug libboost_signals-mt-gd) + set(Boost_SYSTEM_LIBRARY + optimized libboost_system-mt + debug libboost_system-mt-gd) + set(Boost_THREAD_LIBRARY + optimized libboost_thread-mt + debug libboost_thread-mt-gd) elseif (LINUX) - set(Boost_FILESYSTEM_LIBRARY boost_filesystem-mt) - set(Boost_PROGRAM_OPTIONS_LIBRARY boost_program_options-mt) - set(Boost_REGEX_LIBRARY boost_regex-mt) - set(Boost_SYSTEM_LIBRARY boost_system-mt) - set(Boost_DATE_TIME_LIBRARY boost_date_time-mt) + set(Boost_CONTEXT_LIBRARY + optimized boost_context-mt.a + debug boost_context-mt-d.a) + set(Boost_FILESYSTEM_LIBRARY + optimized boost_filesystem-mt.a + debug boost_filesystem-mt-d.a) + set(Boost_PROGRAM_OPTIONS_LIBRARY + optimized boost_program_options-mt.a + debug boost_program_options-mt-d.a) + set(Boost_REGEX_LIBRARY + optimized boost_regex-mt.a + debug boost_regex-mt-d.a) + set(Boost_SIGNALS_LIBRARY + optimized boost_signals-mt.a + debug boost_signals-mt-d.a) + set(Boost_SYSTEM_LIBRARY + optimized boost_system-mt.a + debug boost_system-mt-d.a) + set(Boost_THREAD_LIBRARY + optimized boost_thread-mt.a + debug boost_thread-mt-d.a) + elseif (DARWIN) + set(Boost_CONTEXT_LIBRARY + optimized boost_context-mt + debug boost_context-mt-d) + set(Boost_FILESYSTEM_LIBRARY + optimized boost_filesystem-mt + debug boost_filesystem-mt-d) + set(Boost_PROGRAM_OPTIONS_LIBRARY + optimized boost_program_options-mt + debug boost_program_options-mt-d) + set(Boost_REGEX_LIBRARY + optimized boost_regex-mt + debug boost_regex-mt-d) + set(Boost_SIGNALS_LIBRARY + optimized boost_signals-mt + debug boost_signals-mt-d) + set(Boost_SYSTEM_LIBRARY + optimized boost_system-mt + debug boost_system-mt-d) + set(Boost_THREAD_LIBRARY + optimized boost_thread-mt + debug boost_thread-mt-d) endif (WINDOWS) endif (STANDALONE) diff --git a/indra/cmake/CMakeLists.txt b/indra/cmake/CMakeLists.txt index 9eacfcada..5ff1b0399 100644 --- a/indra/cmake/CMakeLists.txt +++ b/indra/cmake/CMakeLists.txt @@ -37,6 +37,7 @@ set(cmake_SOURCE_FILES FindColladadom.cmake FindELFIO.cmake FindGLOD.cmake + FindGoogleBreakpad.cmake FindGooglePerfTools.cmake FindHunSpell.cmake FindJsonCpp.cmake @@ -50,6 +51,7 @@ set(cmake_SOURCE_FILES GStreamer010Plugin.cmake Glui.cmake Glut.cmake + GoogleBreakpad.cmake GooglePerfTools.cmake Hunspell.cmake JPEG.cmake @@ -59,7 +61,6 @@ set(cmake_SOURCE_FILES LLAudio.cmake LLCharacter.cmake LLCommon.cmake - LLCrashLogger.cmake LLImage.cmake LLImageJ2COJ.cmake LLInventory.cmake @@ -69,6 +70,7 @@ set(cmake_SOURCE_FILES LLPlugin.cmake LLPrimitive.cmake LLPhysicsExtensions.cmake + LLSharedLibs.cmake LLQtWebkit.cmake LLRender.cmake LLUI.cmake diff --git a/indra/cmake/Colladadom.cmake b/indra/cmake/Colladadom.cmake index 1e4a9ed56..e503d99e7 100644 --- a/indra/cmake/Colladadom.cmake +++ b/indra/cmake/Colladadom.cmake @@ -10,9 +10,9 @@ if (STANDALONE) else (STANDALONE) use_prebuilt_binary(colladadom) - if (NOT WINDOWS) + if (NOT WINDOWS AND NOT LINUX) use_prebuilt_binary(pcre) - endif (NOT WINDOWS) + endif (NOT WINDOWS AND NOT LINUX) if (NOT DARWIN AND NOT WINDOWS) use_prebuilt_binary(libxml) @@ -28,18 +28,12 @@ else (STANDALONE) set(COLLADADOM_LIBRARIES debug libcollada14dom22-d optimized libcollada14dom22 - debug libboost_filesystem-vc100-mt-gd-1_45.lib - optimized libboost_filesystem-vc100-mt-1_45.lib - debug libboost_system-vc100-mt-gd-1_45.lib - optimized libboost_system-vc100-mt-1_45.lib ) else (WINDOWS) set(COLLADADOM_LIBRARIES collada14dom minizip xml2 - pcrecpp - pcre ) endif (WINDOWS) endif (STANDALONE) diff --git a/indra/cmake/ConfigurePkgConfig.cmake b/indra/cmake/ConfigurePkgConfig.cmake index 82ee3e7a5..afbc36d63 100644 --- a/indra/cmake/ConfigurePkgConfig.cmake +++ b/indra/cmake/ConfigurePkgConfig.cmake @@ -14,7 +14,7 @@ IF("$ENV{PKG_CONFIG_LIBDIR}" STREQUAL "") else (WORD_SIZE EQUAL 32) SET(PKG_CONFIG_NO_MULTI_GUESS /usr/lib64 /usr/lib) SET(PKG_CONFIG_NO_MULTI_LOCAL_GUESS /usr/local/lib64 /usr/local/lib) - SET(PKG_CONFIG_MULTI_GUESS /usr/local/lib/x86_64-linux-gnu) + SET(PKG_CONFIG_MULTI_GUESS /usr/lib/x86_64-linux-gnu) SET(PKG_CONFIG_MULTI_LOCAL_GUESS /usr/local/lib/x86_64-linux-gnu) endif (WORD_SIZE EQUAL 32) diff --git a/indra/cmake/DirectX.cmake b/indra/cmake/DirectX.cmake index c10e7e344..a0dc4b2b5 100644 --- a/indra/cmake/DirectX.cmake +++ b/indra/cmake/DirectX.cmake @@ -1,18 +1,55 @@ # -*- cmake -*- +include(Variables) + if (WINDOWS) - find_path(DIRECTX_INCLUDE_DIR dxdiag.h - "$ENV{DXSDK_DIR}/Include" - "$ENV{PROGRAMFILES}/Microsoft DirectX SDK (June 2010)/Include" - "$ENV{PROGRAMFILES}/Microsoft DirectX SDK (March 2009)/Include" - "$ENV{PROGRAMFILES}/Microsoft DirectX SDK (August 2008)/Include" - "$ENV{PROGRAMFILES}/Microsoft DirectX SDK (June 2008)/Include" - "$ENV{PROGRAMFILES}/Microsoft DirectX SDK (March 2008)/Include" - "$ENV{PROGRAMFILES}/Microsoft DirectX SDK (November 2007)/Include" - "$ENV{PROGRAMFILES}/Microsoft DirectX SDK (August 2007)/Include" - "C:/DX90SDK/Include" - "$ENV{PROGRAMFILES}/DX90SDK/Include" + if (WORD_SIZE EQUAL 32) + set (DIRECTX_ARCHITECTURE x86) + elseif (WORD_SIZE EQUAL 64) + set (DIRECTX_ARCHITECTURE x64) + else (WORD_SIZE EQUAL 32) + set (DIRECTX_ARCHITECTURE x86) + endif (WORD_SIZE EQUAL 32) + + find_path(DIRECTX_ROOT_DIR Include/dxdiag.h + PATHS + "$ENV{DXSDK_DIR}" + "$ENV{ProgramFiles}/Microsoft DirectX SDK (June 2010)" + "$ENV{ProgramFiles(x86)}/Microsoft DirectX SDK (June 2010)" + "$ENV{ProgramFiles}/Microsoft DirectX SDK (February 2010)" + "$ENV{ProgramFiles(x86)}/Microsoft DirectX SDK (February 2010)" + "$ENV{ProgramFiles}/Microsoft DirectX SDK (March 2009)" + "$ENV{ProgramFiles(x86)}/Microsoft DirectX SDK (March 2009)" + "$ENV{ProgramFiles}/Microsoft DirectX SDK (August 2008)" + "$ENV{ProgramFiles(x86)}/Microsoft DirectX SDK (August 2008)" + "$ENV{ProgramFiles}/Microsoft DirectX SDK (June 2008)" + "$ENV{ProgramFiles(x86)}/Microsoft DirectX SDK (June 2008)" + "$ENV{ProgramFiles}/Microsoft DirectX SDK (March 2008)" + "$ENV{ProgramFiles(x86)}/Microsoft DirectX SDK (March 2008)" + "$ENV{ProgramFiles}/Microsoft DirectX SDK (November 2007)" + "$ENV{ProgramFiles(x86)}/Microsoft DirectX SDK (November 2007)" + "$ENV{ProgramFiles}/Microsoft DirectX SDK (August 2007)" + "$ENV{ProgramFiles(x86)}/Microsoft DirectX SDK (August 2007)" ) + + if (DIRECTX_ROOT_DIR) + set (DIRECTX_INCLUDE_DIR "${DIRECTX_ROOT_DIR}/Include") + set (DIRECTX_LIBRARY_DIR "${DIRECTX_ROOT_DIR}/Lib/${DIRECTX_ARCHITECTURE}") + else (DIRECTX_ROOT_DIR) + find_path (WIN_KIT_ROOT_DIR Include/um/windows.h + PATHS + "$ENV{ProgramFiles}/Windows Kits/8.1" + "$ENV{ProgramFiles(x86)}/Windows Kits/8.1" + "$ENV{ProgramFiles}/Windows Kits/8.0" + "$ENV{ProgramFiles(x86)}/Windows Kits/8.0" + ) + + if (WIN_KIT_ROOT_DIR) + set (DIRECTX_INCLUDE_DIR "${WIN_KIT_ROOT_DIR}/Include/um" "${WIN_KIT_ROOT_DIR}/Include/shared") + set (DIRECTX_LIBRARY_DIR "${WIN_KIT_ROOT_DIR}/Lib/Win8/um/${DIRECTX_ARCHITECTURE}") + endif (WIN_KIT_ROOT_DIR) + endif (DIRECTX_ROOT_DIR) + if (DIRECTX_INCLUDE_DIR) include_directories(${DIRECTX_INCLUDE_DIR}) if (DIRECTX_FIND_QUIETLY) @@ -22,19 +59,6 @@ if (WINDOWS) message(FATAL_ERROR "Could not find DirectX SDK Include") endif (DIRECTX_INCLUDE_DIR) - - find_path(DIRECTX_LIBRARY_DIR dxguid.lib - "$ENV{DXSDK_DIR}/Lib/x86" - "$ENV{PROGRAMFILES}/Microsoft DirectX SDK (June 2010)/Lib/x86" - "$ENV{PROGRAMFILES}/Microsoft DirectX SDK (March 2009)/Lib/x86" - "$ENV{PROGRAMFILES}/Microsoft DirectX SDK (August 2008)/Lib/x86" - "$ENV{PROGRAMFILES}/Microsoft DirectX SDK (June 2008)/Lib/x86" - "$ENV{PROGRAMFILES}/Microsoft DirectX SDK (March 2008)/Lib/x86" - "$ENV{PROGRAMFILES}/Microsoft DirectX SDK (November 2007)/Lib/x86" - "$ENV{PROGRAMFILES}/Microsoft DirectX SDK (August 2007)/Lib/x86" - "C:/DX90SDK/Lib" - "$ENV{PROGRAMFILES}/DX90SDK/Lib" - ) if (DIRECTX_LIBRARY_DIR) if (DIRECTX_FIND_QUIETLY) message(STATUS "Found DirectX include: ${DIRECTX_LIBRARY_DIR}") diff --git a/indra/cmake/FindGoogleBreakpad.cmake b/indra/cmake/FindGoogleBreakpad.cmake new file mode 100644 index 000000000..18e0b56ed --- /dev/null +++ b/indra/cmake/FindGoogleBreakpad.cmake @@ -0,0 +1,40 @@ +# -*- cmake -*- + +# - Find Google BreakPad +# Find the Google BreakPad includes and library +# This module defines +# BREAKPAD_INCLUDE_DIRECTORIES, where to find the Goole BreakPad includes. +# BREAKPAD_EXCEPTION_HANDLER_LIBRARIES, the libraries needed to use Google BreakPad. +# BREAKPAD_EXCEPTION_HANDLER_FOUND, If false, do not try to use Google BreakPad. +# also defined, but not for general use are +# BREAKPAD_EXCEPTION_HANDLER_LIBRARY, where to find the Google BreakPad library. + +FIND_PATH(BREAKPAD_INCLUDE_DIRECTORIES common/using_std_string.h PATH_SUFFIXES google_breakpad) + +SET(BREAKPAD_EXCEPTION_HANDLER_NAMES ${BREAKPAD_EXCEPTION_HANDLER_NAMES} breakpad_client) +FIND_LIBRARY(BREAKPAD_EXCEPTION_HANDLER_LIBRARY + NAMES ${BREAKPAD_EXCEPTION_HANDLER_NAMES} + ) + +IF (BREAKPAD_EXCEPTION_HANDLER_LIBRARY AND BREAKPAD_INCLUDE_DIRECTORIES) + SET(BREAKPAD_EXCEPTION_HANDLER_LIBRARIES ${BREAKPAD_EXCEPTION_HANDLER_LIBRARY}) + SET(BREAKPAD_EXCEPTION_HANDLER_FOUND "YES") +ELSE (BREAKPAD_EXCEPTION_HANDLER_LIBRARY AND BREAKPAD_INCLUDE_DIRECTORIES) + SET(BREAKPAD_EXCEPTION_HANDLER_FOUND "NO") +ENDIF (BREAKPAD_EXCEPTION_HANDLER_LIBRARY AND BREAKPAD_INCLUDE_DIRECTORIES) + + +IF (BREAKPAD_EXCEPTION_HANDLER_FOUND) + IF (NOT BREAKPAD_EXCEPTION_HANDLER_FIND_QUIETLY) + MESSAGE(STATUS "Found Google BreakPad: ${BREAKPAD_EXCEPTION_HANDLER_LIBRARIES}") + ENDIF (NOT BREAKPAD_EXCEPTION_HANDLER_FIND_QUIETLY) +ELSE (BREAKPAD_EXCEPTION_HANDLER_FOUND) + IF (BREAKPAD_EXCEPTION_HANDLER_FIND_REQUIRED) + MESSAGE(FATAL_ERROR "Could not find Google BreakPad library") + ENDIF (BREAKPAD_EXCEPTION_HANDLER_FIND_REQUIRED) +ENDIF (BREAKPAD_EXCEPTION_HANDLER_FOUND) + +MARK_AS_ADVANCED( + BREAKPAD_EXCEPTION_HANDLER_LIBRARY + BREAKPAD_INCLUDE_DIRECTORIES + ) diff --git a/indra/cmake/GoogleBreakpad.cmake b/indra/cmake/GoogleBreakpad.cmake new file mode 100644 index 000000000..69e54ee1b --- /dev/null +++ b/indra/cmake/GoogleBreakpad.cmake @@ -0,0 +1,21 @@ +# -*- cmake -*- +include(Prebuilt) + +if (STANDALONE) + set(BREAKPAD_EXCEPTION_HANDLER_FIND_REQUIRED ON) + include(FindGoogleBreakpad) +else (STANDALONE) + use_prebuilt_binary(google_breakpad) + if (DARWIN) + set(BREAKPAD_EXCEPTION_HANDLER_LIBRARIES exception_handler) + endif (DARWIN) + if (LINUX) + set(BREAKPAD_EXCEPTION_HANDLER_LIBRARIES breakpad_client) + endif (LINUX) + if (WINDOWS) + set(BREAKPAD_EXCEPTION_HANDLER_LIBRARIES exception_handler crash_generation_client crash_generation_server common) + endif (WINDOWS) + # yes, this does look dumb, no, it's not incorrect + # I think it's incorrect: the second one should go --Aleric + set(BREAKPAD_INCLUDE_DIRECTORIES "${LIBS_PREBUILT_DIR}/${LL_ARCH_DIR}/include/google_breakpad" "${LIBS_PREBUILT_DIR}/${LL_ARCH_DIR}/include/google_breakpad/google_breakpad") +endif (STANDALONE) diff --git a/indra/cmake/LLAddBuildTest.cmake b/indra/cmake/LLAddBuildTest.cmake index 74f2e0cb1..3d42088bc 100644 --- a/indra/cmake/LLAddBuildTest.cmake +++ b/indra/cmake/LLAddBuildTest.cmake @@ -159,3 +159,23 @@ MACRO(ADD_VIEWER_COMM_BUILD_TEST name parent wrapper) ## MESSAGE(STATUS "ADD_VIEWER_COMM_BUILD_TEST ${name} wrapper = ${wrapper}") ADD_COMM_BUILD_TEST("${name}" "${parent}" "${wrapper}" llviewerprecompiledheaders.cpp) ENDMACRO(ADD_VIEWER_COMM_BUILD_TEST name parent wrapper) +MACRO(SET_TEST_PATH LISTVAR) + IF(WINDOWS) + # We typically build/package only Release variants of third-party + # libraries, so append the Release staging dir in case the library being + # sought doesn't have a debug variant. + set(${LISTVAR} ${SHARED_LIB_STAGING_DIR}/${CMAKE_CFG_INTDIR} ${SHARED_LIB_STAGING_DIR}/Release) + ELSEIF(DARWIN) + # We typically build/package only Release variants of third-party + # libraries, so append the Release staging dir in case the library being + # sought doesn't have a debug variant. + set(${LISTVAR} ${SHARED_LIB_STAGING_DIR}/${CMAKE_CFG_INTDIR}/Resources ${SHARED_LIB_STAGING_DIR}/Release/Resources /usr/lib) + ELSE(WINDOWS) + # Linux uses a single staging directory anyway. + IF (STANDALONE) + set(${LISTVAR} ${CMAKE_BINARY_DIR}/llcommon /usr/lib /usr/local/lib) + ELSE (STANDALONE) + set(${LISTVAR} ${SHARED_LIB_STAGING_DIR} /usr/lib) + ENDIF (STANDALONE) + ENDIF(WINDOWS) +ENDMACRO(SET_TEST_PATH) diff --git a/indra/cmake/LLCrashLogger.cmake b/indra/cmake/LLCrashLogger.cmake deleted file mode 100644 index f2cb83eb8..000000000 --- a/indra/cmake/LLCrashLogger.cmake +++ /dev/null @@ -1,7 +0,0 @@ -# -*- cmake -*- - -set(LLCRASHLOGGER_INCLUDE_DIRS - ${LIBS_OPEN_DIR}/llcrashlogger - ) - -set(LLCRASHLOGGER_LIBRARIES llcrashlogger) diff --git a/indra/cmake/LLSharedLibs.cmake b/indra/cmake/LLSharedLibs.cmake new file mode 100644 index 000000000..14dd67f32 --- /dev/null +++ b/indra/cmake/LLSharedLibs.cmake @@ -0,0 +1,73 @@ +# ll_deploy_sharedlibs_command +# target_exe: the cmake target of the executable for which the shared libs will be deployed. +macro(ll_deploy_sharedlibs_command target_exe) + get_target_property(TARGET_LOCATION ${target_exe} LOCATION) + get_filename_component(OUTPUT_PATH ${TARGET_LOCATION} PATH) + + if(DARWIN) + SET_TEST_PATH(SEARCH_DIRS) + get_target_property(IS_BUNDLE ${target_exe} MACOSX_BUNDLE) + if(IS_BUNDLE) + # If its a bundle the exe is not in the target location, this should find it. + get_filename_component(TARGET_FILE ${TARGET_LOCATION} NAME) + set(OUTPUT_PATH ${TARGET_LOCATION}.app/Contents/MacOS) + set(TARGET_LOCATION ${OUTPUT_PATH}/${TARGET_FILE}) + set(OUTPUT_PATH ${OUTPUT_PATH}/../Resources) + endif(IS_BUNDLE) + elseif(WINDOWS) + SET_TEST_PATH(SEARCH_DIRS) + LIST(APPEND SEARCH_DIRS "$ENV{SystemRoot}/system32") + elseif(LINUX) + SET_TEST_PATH(SEARCH_DIRS) + set(OUTPUT_PATH ${OUTPUT_PATH}/lib) + endif(DARWIN) + + add_custom_command( + TARGET ${target_exe} POST_BUILD + COMMAND ${CMAKE_COMMAND} + ARGS + "-DBIN_NAME=\"${TARGET_LOCATION}\"" + "-DSEARCH_DIRS=\"${SEARCH_DIRS}\"" + "-DDST_PATH=\"${OUTPUT_PATH}\"" + "-P" + "${CMAKE_SOURCE_DIR}/cmake/DeploySharedLibs.cmake" + ) + +endmacro(ll_deploy_sharedlibs_command) + +# ll_stage_sharedlib +# Performs config and adds a copy command for a sharedlib target. +macro(ll_stage_sharedlib DSO_TARGET) + # target gets written to the DLL staging directory. + # Also this directory is shared with RunBuildTest.cmake, y'know, for the tests. + set_target_properties(${DSO_TARGET} PROPERTIES RUNTIME_OUTPUT_DIRECTORY ${SHARED_LIB_STAGING_DIR}) + if(NOT WINDOWS) + get_target_property(DSO_PATH ${DSO_TARGET} LOCATION) + get_filename_component(DSO_FILE ${DSO_PATH} NAME) + if(DARWIN) + set(SHARED_LIB_STAGING_DIR_CONFIG ${SHARED_LIB_STAGING_DIR}/${CMAKE_CFG_INTDIR}/Resources) + else(DARWIN) + set(SHARED_LIB_STAGING_DIR_CONFIG ${SHARED_LIB_STAGING_DIR}/${CMAKE_CFG_INTDIR}) + endif(DARWIN) + + # *TODO - maybe make this a symbolic link? -brad + add_custom_command( + TARGET ${DSO_TARGET} POST_BUILD + COMMAND ${CMAKE_COMMAND} + ARGS + -E + copy_if_different + ${DSO_PATH} + ${SHARED_LIB_STAGING_DIR_CONFIG}/${DSO_FILE} + COMMENT "Copying llcommon to the staging folder." + ) + endif(NOT WINDOWS) + + if (DARWIN) + set_target_properties(${DSO_TARGET} PROPERTIES + BUILD_WITH_INSTALL_RPATH 1 + INSTALL_NAME_DIR "@executable_path/../Resources" + ) + endif(DARWIN) + +endmacro(ll_stage_sharedlib) diff --git a/indra/libhacd/hacdHACD.cpp b/indra/libhacd/hacdHACD.cpp index bce8cedd7..35206f8ce 100644 --- a/indra/libhacd/hacdHACD.cpp +++ b/indra/libhacd/hacdHACD.cpp @@ -679,7 +679,7 @@ namespace HACD { if ((!condition1) && m_callBack) { - sprintf(msg, "\n-> %lu\t%f\t%f\t%f\n", m_pqueue.size(), m_graph.m_vertices[v1].m_surf*100.0/m_area, m_graph.m_vertices[v2].m_surf*100.0/m_area, m_graph.m_edges[currentEdge.m_name].m_concavity); + sprintf(msg, "\n-> %zu\t%f\t%f\t%f\n", m_pqueue.size(), m_graph.m_vertices[v1].m_surf*100.0/m_area, m_graph.m_vertices[v2].m_surf*100.0/m_area, m_graph.m_edges[currentEdge.m_name].m_concavity); (*m_callBack)(msg, progress, globalConcavity, m_graph.GetNVertices()); } globalConcavity = std::max(globalConcavity ,m_graph.m_edges[currentEdge.m_name].m_concavity); @@ -879,7 +879,7 @@ namespace HACD if (m_callBack) { char msg[1024]; - sprintf(msg, "\t CH(%lu) \t %lu \t %lf \t %lu \t %f \t %lu\n", v, static_cast(p), m_graph.m_vertices[v].m_concavity, m_graph.m_vertices[v].m_distPoints.Size(), m_graph.m_vertices[v].m_surf*100.0/m_area, m_graph.m_vertices[v].m_ancestors.size()); + sprintf(msg, "\t CH(%zu) \t %zu \t %lf \t %zu \t %f \t %zu\n", v, static_cast(p), m_graph.m_vertices[v].m_concavity, m_graph.m_vertices[v].m_distPoints.Size(), m_graph.m_vertices[v].m_surf*100.0/m_area, m_graph.m_vertices[v].m_ancestors.size()); (*m_callBack)(msg, 0.0, 0.0, m_nClusters); p++; } diff --git a/indra/linux_crash_logger/CMakeLists.txt b/indra/linux_crash_logger/CMakeLists.txt deleted file mode 100644 index d885e3704..000000000 --- a/indra/linux_crash_logger/CMakeLists.txt +++ /dev/null @@ -1,72 +0,0 @@ -# -*- cmake -*- - -project(linux_crash_logger) - -include(00-Common) -include(LLCommon) -include(LLCrashLogger) -include(LLMath) -include(LLMessage) -include(LLVFS) -include(LLXML) -include(Linking) -include(UI) - -include_directories( - ${LLCOMMON_INCLUDE_DIRS} - ${LLCRASHLOGGER_INCLUDE_DIRS} - ${LLMATH_INCLUDE_DIRS} - ${LLVFS_INCLUDE_DIRS} - ${LLXML_INCLUDE_DIRS} - ) - -set(linux_crash_logger_SOURCE_FILES - linux_crash_logger.cpp - llcrashloggerlinux.cpp - ) - -set(linux_crash_logger_HEADER_FILES - CMakeLists.txt - - llcrashloggerlinux.h - ) - -set_source_files_properties(${linux_crash_logger_HEADER_FILES} - PROPERTIES HEADER_FILE_ONLY TRUE) - -list(APPEND linux_crash_logger_SOURCE_FILES - ${linux_crash_logger_HEADER_FILES} - ) - -set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -Wl,--as-needed") - -add_executable(linux-crash-logger ${linux_crash_logger_SOURCE_FILES}) - -target_link_libraries(linux-crash-logger - ${LLCRASHLOGGER_LIBRARIES} - ${LLVFS_LIBRARIES} - ${LLXML_LIBRARIES} - ${LLMESSAGE_LIBRARIES} - ${LLUI_LIBRARIES} - ${LLVFS_LIBRARIES} - ${LLMATH_LIBRARIES} - ${LLCOMMON_LIBRARIES} - ${UI_LIBRARIES} - ${DB_LIBRARIES} - ${XMLRPCEPI_LIBRARIES} - ${CURL_LIBRARIES} - ${APR_LIBRARIES} - ${APRUTIL_LIBRARIES} - ${CRYPTO_LIBRARIES} - rt - ) - -add_custom_command( - OUTPUT linux-crash-logger-stripped - COMMAND strip - ARGS --strip-debug -o linux-crash-logger-stripped linux-crash-logger - DEPENDS linux-crash-logger - ) - -add_custom_target(linux-crash-logger-strip-target ALL - DEPENDS linux-crash-logger-stripped) diff --git a/indra/linux_crash_logger/linux_crash_logger.cpp b/indra/linux_crash_logger/linux_crash_logger.cpp deleted file mode 100644 index 97eec851b..000000000 --- a/indra/linux_crash_logger/linux_crash_logger.cpp +++ /dev/null @@ -1,45 +0,0 @@ -/** - * @file linux_crash_logger.cpp - * @brief Linux crash logger implementation - * - * $LicenseInfo:firstyear=2003&license=viewergpl$ - * - * Copyright (c) 2003-2009, Linden Research, Inc. - * - * Second Life Viewer Source Code - * The source code in this file ("Source Code") is provided by Linden Lab - * to you under the terms of the GNU General Public License, version 2.0 - * ("GPL"), unless you have obtained a separate licensing agreement - * ("Other License"), formally executed by you and Linden Lab. Terms of - * the GPL can be found in doc/GPL-license.txt in this distribution, or - * online at http://secondlifegrid.net/programs/open_source/licensing/gplv2 - * - * There are special exceptions to the terms and conditions of the GPL as - * it is applied to this Source Code. View the full text of the exception - * in the file doc/FLOSS-exception.txt in this software distribution, or - * online at - * http://secondlifegrid.net/programs/open_source/licensing/flossexception - * - * By copying, modifying or distributing this software, you acknowledge - * that you have read and understood your obligations described above, - * and agree to abide by those obligations. - * - * ALL LINDEN LAB SOURCE CODE IS PROVIDED "AS IS." LINDEN LAB MAKES NO - * WARRANTIES, EXPRESS, IMPLIED OR OTHERWISE, REGARDING ITS ACCURACY, - * COMPLETENESS OR PERFORMANCE. - * $/LicenseInfo$ - */ - -#include "llcrashloggerlinux.h" - -int main(int argc, char **argv) -{ - LLCrashLoggerLinux app; - app.parseCommandOptions(argc, argv); - app.init(); - app.mainLoop(); - app.cleanup(); - return 0; -} - - diff --git a/indra/linux_crash_logger/llcrashloggerlinux.cpp b/indra/linux_crash_logger/llcrashloggerlinux.cpp deleted file mode 100644 index 039b70ec4..000000000 --- a/indra/linux_crash_logger/llcrashloggerlinux.cpp +++ /dev/null @@ -1,148 +0,0 @@ -/** - * @file llcrashloggerlinux.cpp - * @brief Linux crash logger implementation - * - * $LicenseInfo:firstyear=2003&license=viewergpl$ - * - * Copyright (c) 2003-2009, Linden Research, Inc. - * - * Second Life Viewer Source Code - * The source code in this file ("Source Code") is provided by Linden Lab - * to you under the terms of the GNU General Public License, version 2.0 - * ("GPL"), unless you have obtained a separate licensing agreement - * ("Other License"), formally executed by you and Linden Lab. Terms of - * the GPL can be found in doc/GPL-license.txt in this distribution, or - * online at http://secondlifegrid.net/programs/open_source/licensing/gplv2 - * - * There are special exceptions to the terms and conditions of the GPL as - * it is applied to this Source Code. View the full text of the exception - * in the file doc/FLOSS-exception.txt in this software distribution, or - * online at - * http://secondlifegrid.net/programs/open_source/licensing/flossexception - * - * By copying, modifying or distributing this software, you acknowledge - * that you have read and understood your obligations described above, - * and agree to abide by those obligations. - * - * ALL LINDEN LAB SOURCE CODE IS PROVIDED "AS IS." LINDEN LAB MAKES NO - * WARRANTIES, EXPRESS, IMPLIED OR OTHERWISE, REGARDING ITS ACCURACY, - * COMPLETENESS OR PERFORMANCE. - * $/LicenseInfo$ - */ - -#include "llcrashloggerlinux.h" - -#include - -#include "linden_common.h" - -#include "boost/tokenizer.hpp" - -#include "indra_constants.h" // CRASH_BEHAVIOR_ASK, CRASH_SETTING_NAME -#include "llerror.h" -#include "llfile.h" -#include "lltimer.h" -#include "llstring.h" -#include "lldir.h" -#include "llsdserialize.h" - -#if LL_GTK -# include "gtk/gtk.h" -#endif // LL_GTK - -#define MAX_LOADSTRING 100 - -// These need to be localized. -static const char dialog_text[] = -"Second Life appears to have crashed or frozen last time it ran.\n" -"This crash reporter collects information about your computer's hardware, operating system, and some Second Life logs, all of which are used for debugging purposes only.\n" -"\n" -"Send crash report?"; - -static const char dialog_title[] = -"Second Life Crash Logger"; - -#if LL_GTK -static void response_callback (GtkDialog *dialog, - gint arg1, - gpointer user_data) -{ - gint *response = (gint*)user_data; - *response = arg1; - gtk_widget_destroy(GTK_WIDGET(dialog)); - gtk_main_quit(); -} -#endif // LL_GTK - -static BOOL do_ask_dialog(void) -{ -#if LL_GTK - gtk_disable_setlocale(); - if (!gtk_init_check(NULL, NULL)) { - llinfos << "Could not initialize GTK for 'ask to send crash report' dialog; not sending report." << llendl; - return FALSE; - } - - GtkWidget *win = NULL; - GtkDialogFlags flags = GTK_DIALOG_MODAL; - GtkMessageType messagetype = GTK_MESSAGE_QUESTION; - GtkButtonsType buttons = GTK_BUTTONS_YES_NO; - gint response = GTK_RESPONSE_NONE; - - win = gtk_message_dialog_new(NULL, - flags, messagetype, buttons, - "%s", dialog_text); - gtk_window_set_type_hint(GTK_WINDOW(win), - GDK_WINDOW_TYPE_HINT_DIALOG); - gtk_window_set_title(GTK_WINDOW(win), dialog_title); - g_signal_connect (win, - "response", - G_CALLBACK (response_callback), - &response); - gtk_widget_show_all (win); - gtk_main(); - - return (GTK_RESPONSE_OK == response || - GTK_RESPONSE_YES == response || - GTK_RESPONSE_APPLY == response); -#else - return FALSE; -#endif // LL_GTK -} - -LLCrashLoggerLinux::LLCrashLoggerLinux(void) -{ -} - -LLCrashLoggerLinux::~LLCrashLoggerLinux(void) -{ -} - -void LLCrashLoggerLinux::gatherPlatformSpecificFiles() -{ - mFileMap["CrashLog"] = gDirUtilp->getExpandedFilename(LL_PATH_LOGS,"stack_trace.log").c_str(); -} - -bool LLCrashLoggerLinux::mainLoop() -{ - bool send_logs = true; - if(CRASH_BEHAVIOR_ASK == getCrashBehavior()) - { - send_logs = do_ask_dialog(); - } - else if(CRASH_BEHAVIOR_NEVER_SEND == getCrashBehavior()) - { - send_logs = false; - } - - if(send_logs) - { - sendCrashLogs(); - } - return true; -} - -void LLCrashLoggerLinux::updateApplication(const std::string& message) -{ - LLCrashLogger::updateApplication(message); -} diff --git a/indra/linux_crash_logger/llcrashloggerlinux.h b/indra/linux_crash_logger/llcrashloggerlinux.h deleted file mode 100644 index 937d547f8..000000000 --- a/indra/linux_crash_logger/llcrashloggerlinux.h +++ /dev/null @@ -1,50 +0,0 @@ -/** - * @file llcrashloggerlinux.h - * @brief Linux crash logger definition - * - * $LicenseInfo:firstyear=2003&license=viewergpl$ - * - * Copyright (c) 2003-2009, Linden Research, Inc. - * - * Second Life Viewer Source Code - * The source code in this file ("Source Code") is provided by Linden Lab - * to you under the terms of the GNU General Public License, version 2.0 - * ("GPL"), unless you have obtained a separate licensing agreement - * ("Other License"), formally executed by you and Linden Lab. Terms of - * the GPL can be found in doc/GPL-license.txt in this distribution, or - * online at http://secondlifegrid.net/programs/open_source/licensing/gplv2 - * - * There are special exceptions to the terms and conditions of the GPL as - * it is applied to this Source Code. View the full text of the exception - * in the file doc/FLOSS-exception.txt in this software distribution, or - * online at - * http://secondlifegrid.net/programs/open_source/licensing/flossexception - * - * By copying, modifying or distributing this software, you acknowledge - * that you have read and understood your obligations described above, - * and agree to abide by those obligations. - * - * ALL LINDEN LAB SOURCE CODE IS PROVIDED "AS IS." LINDEN LAB MAKES NO - * WARRANTIES, EXPRESS, IMPLIED OR OTHERWISE, REGARDING ITS ACCURACY, - * COMPLETENESS OR PERFORMANCE. - * $/LicenseInfo$ - */ - -#ifndef LLCRASHLOGGERLINUX_H -#define LLCRASHLOGGERLINUX_H - -#include "linden_common.h" -#include "llcrashlogger.h" -#include "llstring.h" - -class LLCrashLoggerLinux : public LLCrashLogger -{ -public: - LLCrashLoggerLinux(void); - ~LLCrashLoggerLinux(void); - virtual bool mainLoop(); - virtual void updateApplication(const std::string& = LLStringUtil::null); - virtual void gatherPlatformSpecificFiles(); -}; - -#endif diff --git a/indra/llappearance/llwearabletype.cpp b/indra/llappearance/llwearabletype.cpp index 1daecdc3d..596486123 100644 --- a/indra/llappearance/llwearabletype.cpp +++ b/indra/llappearance/llwearabletype.cpp @@ -104,6 +104,7 @@ LLWearableDictionary::LLWearableDictionary() addEntry(LLWearableType::WT_PHYSICS, new WearableEntry("physics", "New Physics", LLAssetType::AT_CLOTHING, LLInventoryType::ICONNAME_CLOTHING_PHYSICS, TRUE, FALSE)); // [/SL:KB] + addEntry(LLWearableType::WT_UNKNOWN, new WearableEntry("unknown", "Clothing", LLAssetType::AT_CLOTHING, LLInventoryType::ICONNAME_CLOTHING_UNKNOWN, FALSE, TRUE)); addEntry(LLWearableType::WT_INVALID, new WearableEntry("invalid", "Invalid Wearable", LLAssetType::AT_NONE, LLInventoryType::ICONNAME_NONE, FALSE, FALSE)); addEntry(LLWearableType::WT_NONE, new WearableEntry("none", "Invalid Wearable", LLAssetType::AT_NONE, LLInventoryType::ICONNAME_NONE, FALSE, FALSE)); } diff --git a/indra/llappearance/llwearabletype.h b/indra/llappearance/llwearabletype.h index 8d34f0025..8434a4fd8 100644 --- a/indra/llappearance/llwearabletype.h +++ b/indra/llappearance/llwearabletype.h @@ -61,7 +61,10 @@ public: WT_ALPHA = 13, WT_TATTOO = 14, WT_PHYSICS = 15, - WT_COUNT = 16, + WT_UNKNOWN = 16, // Singu note: used for corrupt wearables that do not have their type set in the inventory database. + // While all the above values are serialized and stored in the database, this value is local only: + // When a new item with value 16 is added by upstream, just increase this value to 17 (and WT_COUNT to 18). + WT_COUNT = 17, WT_INVALID = 255, WT_NONE = -1, diff --git a/indra/llaudio/llaudioengine.cpp b/indra/llaudio/llaudioengine.cpp index ad0c7a583..1f7815b19 100644 --- a/indra/llaudio/llaudioengine.cpp +++ b/indra/llaudio/llaudioengine.cpp @@ -323,7 +323,7 @@ void LLAudioEngine::idle(F32 max_decode_time) //Also add sources that might be able to start playing to a priority queue. //Only sources without channels, or are waiting for a syncmaster, should be added to this queue. std::priority_queue >,SourcePriorityComparator> queue; - for (source_map::iterator iter = mAllSources.begin(); iter != mAllSources.end(); ++iter) + for (source_map::iterator iter = mAllSources.begin(); iter != mAllSources.end();) { LLAudioSource *sourcep = iter->second; @@ -339,6 +339,9 @@ void LLAudioEngine::idle(F32 max_decode_time) continue; } + // Increment iter here (it is not used anymore), so we can use continue below to move on to the next source. + ++iter; + LLAudioData *adp = sourcep->getCurrentData(); //If there is no current data at all, or if it hasn't loaded, we must skip this source. if (!adp || !adp->getBuffer()) diff --git a/indra/llcharacter/lleditingmotion.cpp b/indra/llcharacter/lleditingmotion.cpp index cb283c9ec..c2a87d80a 100644 --- a/indra/llcharacter/lleditingmotion.cpp +++ b/indra/llcharacter/lleditingmotion.cpp @@ -215,7 +215,16 @@ BOOL LLEditingMotion::onUpdate(F32 time, U8* joint_mask) if (!target.isFinite()) { llwarns << "Non finite target in editing motion with target distance of " << target_dist << - " and focus point " << focus_pt << " and pointAtPt: " << *pointAtPt << llendl; + " and focus point " << focus_pt << " and pointAtPt: "; + if (pointAtPt) + { + llcont << *pointAtPt; + } + else + { + llcont << "NULL"; + } + llcont << llendl; } mTarget.setPosition( target + mParentJoint.getPosition()); diff --git a/indra/llcharacter/llkeyframewalkmotion.cpp b/indra/llcharacter/llkeyframewalkmotion.cpp index 251ff3ed5..f9c2e4766 100644 --- a/indra/llcharacter/llkeyframewalkmotion.cpp +++ b/indra/llcharacter/llkeyframewalkmotion.cpp @@ -280,7 +280,7 @@ BOOL LLWalkAdjustMotion::onUpdate(F32 time, U8* joint_mask) avatar_movement_dir.normalize(); // planted foot speed is avatar velocity - foot slip amount along avatar movement direction - F32 foot_speed = speed - ((foot_slip_vector * avatar_movement_dir) / delta_time); + F32 foot_speed = llmax(0.f, speed - ((foot_slip_vector * avatar_movement_dir) / delta_time)); // multiply animation playback rate so that foot speed matches avatar speed F32 min_speed_multiplier = clamp_rescale(speed, 0.f, 1.f, 0.f, 0.1f); diff --git a/indra/llcommon/CMakeLists.txt b/indra/llcommon/CMakeLists.txt index 4cbd4d5f0..472831e64 100644 --- a/indra/llcommon/CMakeLists.txt +++ b/indra/llcommon/CMakeLists.txt @@ -7,11 +7,13 @@ include(00-Common) include(LLCommon) include(APR) include(Linking) +include(GoogleBreakpad) include_directories( ${EXPAT_INCLUDE_DIRS} ${LLCOMMON_INCLUDE_DIRS} ${ZLIB_INCLUDE_DIRS} + ${BREAKPAD_INCLUDE_DIRECTORIES} ) set(llcommon_SOURCE_FILES @@ -266,11 +268,13 @@ add_library (llcommon SHARED ${llcommon_SOURCE_FILES}) add_dependencies(llcommon prepare) target_link_libraries( llcommon + ${BREAKPAD_EXCEPTION_HANDLER_LIBRARIES} ${APRUTIL_LIBRARIES} ${APR_LIBRARIES} ${EXPAT_LIBRARIES} ${ZLIB_LIBRARIES} ${WINDOWS_LIBRARIES} + ${Boost_CONTEXT_LIBRARY} ${Boost_REGEX_LIBRARY} ${CORESERVICES_LIBRARY} ) diff --git a/indra/llcommon/indra_constants.h b/indra/llcommon/indra_constants.h index 3f0e8dd6c..ea8c91155 100644 --- a/indra/llcommon/indra_constants.h +++ b/indra/llcommon/indra_constants.h @@ -149,6 +149,14 @@ const char WATER_LAYER_CODE = 'W'; const char WIND_LAYER_CODE = '7'; const char CLOUD_LAYER_CODE = '8'; +// Aurora Sim +// Extended land layer for Aurora Sim +const char AURORA_LAND_LAYER_CODE = 'M'; +const char AURORA_WATER_LAYER_CODE = 'X'; +const char AURORA_WIND_LAYER_CODE = '9'; +const char AURORA_CLOUD_LAYER_CODE = ':'; +// Aurora Sim + // keys // Bit masks for various keyboard modifier keys. const MASK MASK_NONE = 0x0000; diff --git a/indra/llcommon/llalignedarray.h b/indra/llcommon/llalignedarray.h index ed8fd3120..964b6d87a 100644 --- a/indra/llcommon/llalignedarray.h +++ b/indra/llcommon/llalignedarray.h @@ -116,14 +116,14 @@ void LLAlignedArray::resize(U32 size) template T& LLAlignedArray::operator[](int idx) { - llassert(idx < mElementCount); + llassert((U32)idx < mElementCount); return mArray[idx]; } template const T& LLAlignedArray::operator[](int idx) const { - llassert(idx < mElementCount); + llassert((U32)idx < mElementCount); return mArray[idx]; } diff --git a/indra/llcommon/llapp.cpp b/indra/llcommon/llapp.cpp index a11effc15..2026a9e4d 100644 --- a/indra/llcommon/llapp.cpp +++ b/indra/llcommon/llapp.cpp @@ -27,6 +27,14 @@ #include "linden_common.h" #include "llapp.h" +#include + +#ifdef LL_DARWIN +#include +#include +#include +#endif + #include "llcommon.h" #include "llapr.h" #include "llerrorcontrol.h" @@ -35,7 +43,9 @@ #include "lllivefile.h" #include "llmemory.h" #include "llstl.h" // for DeletePointer() +#include "llstring.h" #include "lleventtimer.h" +#include "exception_handler.h" // // Signal handling @@ -43,13 +53,34 @@ // Windows uses structured exceptions, so it's handled a bit differently. // #if LL_WINDOWS +#include "windows.h" + LONG WINAPI default_windows_exception_handler(struct _EXCEPTION_POINTERS *exception_infop); BOOL ConsoleCtrlHandler(DWORD fdwCtrlType); +bool windows_post_minidump_callback(const wchar_t* dump_path, + const wchar_t* minidump_id, + void* context, + EXCEPTION_POINTERS* exinfo, + MDRawAssertionInfo* assertion, + bool succeeded); #else # include # include // for fork() void setup_signals(); void default_unix_signal_handler(int signum, siginfo_t *info, void *); + +#if LL_LINUX +#include "client/linux/handler/minidump_descriptor.h" +static bool unix_minidump_callback(const google_breakpad::MinidumpDescriptor& minidump_desc, + void* context, + bool succeeded); +#else +// Called by breakpad exception handler after the minidump has been generated. +bool unix_post_minidump_callback(const char *dump_dir, + const char *minidump_id, + void *context, bool succeeded); +#endif + # if LL_DARWIN /* OSX doesn't support SIGRT* */ S32 LL_SMACKDOWN_SIGNAL = SIGUSR1; @@ -79,7 +110,6 @@ BOOL LLApp::sLogInSignal = FALSE; // static LLApp::EAppStatus LLApp::sStatus = LLApp::APP_STATUS_STOPPED; // Keeps track of application status LLAppErrorHandler LLApp::sErrorHandler = NULL; -LLAppErrorHandler LLApp::sSyncErrorHandler = NULL; BOOL LLApp::sErrorThreadRunning = FALSE; #if !LL_WINDOWS LLApp::child_map LLApp::sChildMap; @@ -100,14 +130,6 @@ void LLApp::commonCtor() LLCommon::initClass(); -#if !LL_WINDOWS - // This must be initialized before the error handler. - sSigChildCount = new LLAtomicU32(0); -#endif - - // Setup error handling - setupErrorHandling(); - // initialize the options structure. We need to make this an array // because the structured data will not auto-allocate if we // reference an invalid location with the [] operator. @@ -118,8 +140,19 @@ void LLApp::commonCtor() mOptions.append(sd); } + // Make sure we clean up APR when we exit + // Don't need to do this if we're cleaning up APR in the destructor + //atexit(ll_cleanup_apr); + // Set the application to this instance. sApplication = this; + + mExceptionHandler = 0; + + // initialize the buffer to write the minidump filename to + // (this is used to avoid allocating memory in the crash handler) + memset(mMinidumpPath, 0, MAX_MINDUMP_PATH_LENGTH); + mCrashReportPipeStr = L"\\\\.\\pipe\\LLCrashReporterPipe"; } LLApp::LLApp(LLErrorThread *error_thread) : @@ -131,10 +164,6 @@ LLApp::LLApp(LLErrorThread *error_thread) : LLApp::~LLApp() { -#if !LL_WINDOWS - delete sSigChildCount; - sSigChildCount = NULL; -#endif // reclaim live file memory std::for_each(mLiveFiles.begin(), mLiveFiles.end(), DeletePointer()); @@ -148,6 +177,8 @@ LLApp::~LLApp() delete mThreadErrorp; mThreadErrorp = NULL; } + + if(mExceptionHandler != 0) delete mExceptionHandler; LLCommon::cleanupClass(); } @@ -207,6 +238,20 @@ bool LLApp::parseCommandOptions(int argc, char** argv) } ++ii; value.assign(argv[ii]); + +#if LL_WINDOWS + //Windows changed command line parsing. Deal with it. + S32 slen = value.length() - 1; + S32 start = 0; + S32 end = slen; + if (argv[ii][start]=='"')start++; + if (argv[ii][end]=='"')end--; + if (start!=0 || end!=slen) + { + value = value.substr (start,end); + } +#endif + commands[name] = value; } setOptionData(PRIORITY_COMMAND_LINE, commands); @@ -254,14 +299,60 @@ void LLApp::setupErrorHandling() // What we do is install an unhandled exception handler, which will try to do the right thing // in the case of an error (generate a minidump) - // Disable this until the viewer gets ported so server crashes can be JIT debugged. - //LPTOP_LEVEL_EXCEPTION_FILTER prev_filter; - //prev_filter = SetUnhandledExceptionFilter(default_windows_exception_handler); - +#if LL_SEND_CRASH_REPORTS // This sets a callback to handle w32 signals to the console window. // The viewer shouldn't be affected, sicne its a windowed app. SetConsoleCtrlHandler( (PHANDLER_ROUTINE) ConsoleCtrlHandler, TRUE); + // Install the Google Breakpad crash handler for Windows + if(mExceptionHandler == 0) + { + llwarns << "adding breakpad exception handler" << llendl; + + std::wostringstream ws; + ws << mCrashReportPipeStr << getPid(); + std::wstring wpipe_name = ws.str(); + std::string ptmp = std::string(wpipe_name.begin(), wpipe_name.end()); + + ::Sleep(2000); //HACK hopefully a static wait won't blow up in my face before google fixes their implementation. + + //HACK this for loop is ueless. Breakpad dumbly returns success when the OOP handler isn't initialized. + for (int retries=0;retries<5;++retries) + { + mExceptionHandler = new google_breakpad::ExceptionHandler( + L"", + NULL, //No filter + windows_post_minidump_callback, + 0, + google_breakpad::ExceptionHandler::HANDLER_ALL, + MiniDumpNormal, //Generate a 'normal' minidump. + (WCHAR *)wpipe_name.c_str(), + NULL); //No custom client info. + if (mExceptionHandler) + { + break; + } + else + { + ::Sleep(100); //Wait a tick and try again. + } + } + if (!mExceptionHandler) + { + llwarns << "Failed to initialize OOP exception handler. Defaulting to In Process handling" << llendl; + mExceptionHandler = new google_breakpad::ExceptionHandler( + std::wstring(mDumpPath.begin(),mDumpPath.end()), //Dump path + 0, //dump filename + windows_post_minidump_callback, + 0, + google_breakpad::ExceptionHandler::HANDLER_ALL); + } + if (mExceptionHandler) + { + mExceptionHandler->set_handle_debug_exceptions(true); + } + } +#endif #else // // Start up signal handling. @@ -271,9 +362,61 @@ void LLApp::setupErrorHandling() // setup_signals(); + + // Add google breakpad exception handler configured for Darwin/Linux. + bool installHandler = true; +#if LL_DARWIN + // For the special case of Darwin, we do not want to install the handler if + // the process is being debugged as the app will exit with value ABRT (6) if + // we do. Unfortunately, the code below which performs that test relies on + // the structure kinfo_proc which has been tagged by apple as an unstable + // API. We disable this test for shipping versions to avoid conflicts with + // future releases of Darwin. This test is really only needed for developers + // starting the app from a debugger anyway. + #ifndef LL_RELEASE_FOR_DOWNLOAD + int mib[4]; + mib[0] = CTL_KERN; + mib[1] = KERN_PROC; + mib[2] = KERN_PROC_PID; + mib[3] = getpid(); + + struct kinfo_proc info; + memset(&info, 0, sizeof(info)); + + size_t size = sizeof(info); + int result = sysctl(mib, sizeof(mib) / sizeof(*mib), &info, &size, NULL, 0); + if((result == 0) || (errno == ENOMEM)) + { + // P_TRACED flag is set, so this process is being debugged; do not install + // the handler + if(info.kp_proc.p_flag & P_TRACED) installHandler = false; + } + else + { + // Failed to discover if the process is being debugged; default to + // installing the handler. + installHandler = true; + } + #endif + if(installHandler && (mExceptionHandler == 0)) + { + mExceptionHandler = new google_breakpad::ExceptionHandler(mDumpPath, 0, &unix_post_minidump_callback, 0, true, 0); + } +#elif LL_LINUX + if(installHandler && (mExceptionHandler == 0)) + { + if (mDumpPath.empty()) + { + mDumpPath = "/tmp"; + } + google_breakpad::MinidumpDescriptor desc(mDumpPath); + //mExceptionHandler = new google_breakpad::ExceptionHandler(desc, 0, unix_minidump_callback, 0, true, 0); + mExceptionHandler = new google_breakpad::ExceptionHandler(desc, NULL, unix_minidump_callback, NULL, true, -1); + } #endif +#endif } void LLApp::startErrorThread() @@ -311,20 +454,6 @@ void LLApp::setErrorHandler(LLAppErrorHandler handler) } -void LLApp::setSyncErrorHandler(LLAppErrorHandler handler) -{ - LLApp::sSyncErrorHandler = handler; -} - -// static -void LLApp::runSyncErrorHandler() -{ - if (LLApp::sSyncErrorHandler) - { - LLApp::sSyncErrorHandler(); - } -} - // static void LLApp::runErrorHandler() { @@ -348,15 +477,46 @@ void LLApp::setStatus(EAppStatus status) // static void LLApp::setError() { - if (!isError()) - { - // perform any needed synchronous error-handling - runSyncErrorHandler(); - // set app status to ERROR so that the LLErrorThread notices - setStatus(APP_STATUS_ERROR); - } + // set app status to ERROR so that the LLErrorThread notices + setStatus(APP_STATUS_ERROR); } +void LLApp::setMiniDumpDir(const std::string &path) +{ + if (path.empty()) + { + mDumpPath = "/tmp"; + } + else + { + mDumpPath = path; + } + + if(mExceptionHandler == 0) return; +#ifdef LL_WINDOWS + wchar_t buffer[MAX_MINDUMP_PATH_LENGTH]; + mbstowcs(buffer, mDumpPath.c_str(), MAX_MINDUMP_PATH_LENGTH); + mExceptionHandler->set_dump_path(std::wstring(buffer)); +#elif LL_LINUX + //google_breakpad::MinidumpDescriptor desc("/tmp"); //path works in debug fails in production inside breakpad lib so linux gets a little less stack reporting until it is patched. + google_breakpad::MinidumpDescriptor desc(mDumpPath); //path works in debug fails in production inside breakpad lib so linux gets a little less stack reporting until it is patched. + mExceptionHandler->set_minidump_descriptor(desc); +#else + mExceptionHandler->set_dump_path(mDumpPath); +#endif +} + +void LLApp::setDebugFileNames(const std::string &path) +{ + mStaticDebugFileName = path + "static_debug_info.log"; + mDynamicDebugFileName = path + "dynamic_debug_info.log"; +} + +void LLApp::writeMiniDump() +{ + if(mExceptionHandler == 0) return; + mExceptionHandler->WriteMinidump(); +} // static void LLApp::setQuitting() @@ -413,6 +573,12 @@ bool LLApp::isExiting() void LLApp::disableCrashlogger() { // Disable Breakpad exception handler. + if (mExceptionHandler != 0) + { + delete mExceptionHandler; + mExceptionHandler = 0; + } + sDisableCrashlogger = TRUE; } @@ -787,4 +953,149 @@ void default_unix_signal_handler(int signum, siginfo_t *info, void *) } } +#if LL_LINUX +bool unix_minidump_callback(const google_breakpad::MinidumpDescriptor& minidump_desc, void* context, bool succeeded) +{ + // Copy minidump file path into fixed buffer in the app instance to avoid + // heap allocations in a crash handler. + + // path format: /.dmp + + //HACK: *path points to the buffer in getMiniDumpFilename which has already allocated space + //to avoid doing allocation during crash. + char * path = LLApp::instance()->getMiniDumpFilename(); + int dir_path_len = strlen(path); + + // The path must not be truncated. + S32 remaining = LLApp::MAX_MINDUMP_PATH_LENGTH - dir_path_len; + + llassert( (remaining - strlen(minidump_desc.path())) > 5); + + path += dir_path_len; + + if (dir_path_len > 0 && path[-1] != '/') + { + *path++ = '/'; + --remaining; + } + + strncpy(path, minidump_desc.path(), remaining); + + llinfos << "generated minidump: " << LLApp::instance()->getMiniDumpFilename() << llendl; + LLApp::runErrorHandler(); + +#ifndef LL_RELEASE_FOR_DOWNLOAD + clear_signals(); + return false; +#else + return true; +#endif + +} +#endif + + +bool unix_post_minidump_callback(const char *dump_dir, + const char *minidump_id, + void *context, bool succeeded) +{ + // Copy minidump file path into fixed buffer in the app instance to avoid + // heap allocations in a crash handler. + + // path format: /.dmp + int dirPathLength = strlen(dump_dir); + int idLength = strlen(minidump_id); + + // The path must not be truncated. + llassert((dirPathLength + idLength + 5) <= LLApp::MAX_MINDUMP_PATH_LENGTH); + + char * path = LLApp::instance()->getMiniDumpFilename(); + S32 remaining = LLApp::MAX_MINDUMP_PATH_LENGTH; + strncpy(path, dump_dir, remaining); + remaining -= dirPathLength; + path += dirPathLength; + if (remaining > 0 && dirPathLength > 0 && path[-1] != '/') + { + *path++ = '/'; + --remaining; + } + if (remaining > 0) + { + strncpy(path, minidump_id, remaining); + remaining -= idLength; + path += idLength; + strncpy(path, ".dmp", remaining); + } + + llinfos << "generated minidump: " << path << llendl; + LLApp::runErrorHandler(); + +#ifndef LL_RELEASE_FOR_DOWNLOAD + clear_signals(); + return false; +#else + return true; +#endif +} #endif // !WINDOWS + +#ifdef LL_WINDOWS +bool windows_post_minidump_callback(const wchar_t* dump_path, + const wchar_t* minidump_id, + void* context, + EXCEPTION_POINTERS* exinfo, + MDRawAssertionInfo* assertion, + bool succeeded) +{ + char * path = LLApp::instance()->getMiniDumpFilename(); + S32 remaining = LLApp::MAX_MINDUMP_PATH_LENGTH; + size_t bytesUsed; + + bytesUsed = wcstombs(path, dump_path, static_cast(remaining)); + remaining -= bytesUsed; + path += bytesUsed; + if(remaining > 0 && bytesUsed > 0 && path[-1] != '\\') + { + *path++ = '\\'; + --remaining; + } + if(remaining > 0) + { + bytesUsed = wcstombs(path, minidump_id, static_cast(remaining)); + remaining -= bytesUsed; + path += bytesUsed; + } + if(remaining > 0) + { + strncpy(path, ".dmp", remaining); + } + + llinfos << "generated minidump: " << LLApp::instance()->getMiniDumpFilename() << llendl; + // *NOTE:Mani - this code is stolen from LLApp, where its never actually used. + //OSMessageBox("Attach Debugger Now", "Error", OSMB_OK); + // *TODO: Translate the signals/exceptions into cross-platform stuff + // Windows implementation + llinfos << "Entering Windows Exception Handler..." << llendl; + + if (LLApp::isError()) + { + llwarns << "Got another fatal signal while in the error handler, die now!" << llendl; + } + + // Flag status to error, so thread_error starts its work + LLApp::setError(); + + // Block in the exception handler until the app has stopped + // This is pretty sketchy, but appears to work just fine + while (!LLApp::isStopped()) + { + ms_sleep(10); + } + +#ifndef LL_RELEASE_FOR_DOWNLOAD + return false; +#else + return true; +#endif +} +#endif diff --git a/indra/llcommon/llapp.h b/indra/llcommon/llapp.h index d56e20800..aab871799 100644 --- a/indra/llcommon/llapp.h +++ b/indra/llcommon/llapp.h @@ -37,14 +37,10 @@ template class LLAtomic32; typedef LLAtomic32 LLAtomicU32; class LLErrorThread; class LLLiveFile; - - #if LL_LINUX - #include - //typedef struct siginfo siginfo_t; //Removed as per changes in glibc 2.16 - Drake Arconis +#include #endif - typedef void (*LLAppErrorHandler)(); typedef void (*LLAppChildCallback)(int pid, bool exited, int status); @@ -64,6 +60,10 @@ public: }; #endif +namespace google_breakpad { + class ExceptionHandler; // See exception_handler.h +} + class LL_COMMON_API LLApp : public LLOptionInterface { friend class LLErrorThread; @@ -212,11 +212,43 @@ public: #endif static int getPid(); - // - // Error handling methods - // + /** @name Error handling methods */ + //@{ + /** + * @brief Do our generic platform-specific error-handling setup -- + * signals on unix, structured exceptions on windows. + * + * DO call this method if your app will either spawn children or be + * spawned by a launcher. + * Call just after app object construction. + * (Otherwise your app will crash when getting signals, + * and will not core dump.) + * + * DO NOT call this method if your application has specialized + * error handling code. + */ + void setupErrorHandling(); + void setErrorHandler(LLAppErrorHandler handler); - void setSyncErrorHandler(LLAppErrorHandler handler); + static void runErrorHandler(); // run shortly after we detect an error, ran in the relatively robust context of the LLErrorThread - preferred. + //@} + + // the maximum length of the minidump filename returned by getMiniDumpFilename() + static const U32 MAX_MINDUMP_PATH_LENGTH = 256; + + // change the directory where Breakpad minidump files are written to + void setMiniDumpDir(const std::string &path); + void setDebugFileNames(const std::string &path); + + // Return the Google Breakpad minidump filename after a crash. + char *getMiniDumpFilename() { return mMinidumpPath; } + std::string* getStaticDebugFile() { return &mStaticDebugFileName; } + std::string* getDynamicDebugFile() { return &mDynamicDebugFileName; } + + // Write out a Google Breakpad minidump file. + void writeMiniDump(); + + #if !LL_WINDOWS // // Child process handling (Unix only for now) @@ -236,6 +268,7 @@ public: pid_t fork(); #endif + public: typedef std::map string_map; string_map mOptionMap; // Contains all command-line options and arguments in a map @@ -246,6 +279,9 @@ protected: static EAppStatus sStatus; // Reflects current application status static BOOL sErrorThreadRunning; // Set while the error thread is running static BOOL sDisableCrashlogger; // Let the OS handle crashes for us. + std::wstring mCrashReportPipeStr; //Name of pipe to use for crash reporting. + + std::string mDumpPath; //output path for google breakpad. Dependency workaround. #if !LL_WINDOWS static LLAtomicU32* sSigChildCount; // Number of SIGCHLDs received. @@ -254,26 +290,25 @@ protected: static LLAppChildCallback sDefaultChildCallback; #endif - /** - * @ brief This method is called once as soon as logging is initialized. - */ void startErrorThread(); + /** * @brief This method is called at the end, just prior to deinitializing curl. */ void stopErrorThread(); private: - void setupErrorHandling(); // Do platform-specific error-handling setup (signals, structured exceptions) - static void runErrorHandler(); // run shortly after we detect an error, ran in the relatively robust context of the LLErrorThread - preferred. - static void runSyncErrorHandler(); // run IMMEDIATELY when we get an error, ran in the context of the faulting thread. + // Contains the filename of the minidump file after a crash. + char mMinidumpPath[MAX_MINDUMP_PATH_LENGTH]; + + std::string mStaticDebugFileName; + std::string mDynamicDebugFileName; // *NOTE: On Windows, we need a routine to reset the structured // exception handler when some evil driver has taken it over for // their own purposes typedef int(*signal_handler_func)(int signum); static LLAppErrorHandler sErrorHandler; - static LLAppErrorHandler sSyncErrorHandler; // Default application threads LLErrorThread* mThreadErrorp; // Waits for app to go to status ERROR, then runs the error callback @@ -291,6 +326,7 @@ private: private: // the static application instance if it was created. static LLApp* sApplication; + google_breakpad::ExceptionHandler * mExceptionHandler; #if !LL_WINDOWS diff --git a/indra/llcommon/llavatarname.cpp b/indra/llcommon/llavatarname.cpp index cce8d33b4..c05ac09d5 100644 --- a/indra/llcommon/llavatarname.cpp +++ b/indra/llcommon/llavatarname.cpp @@ -80,7 +80,7 @@ void LLAvatarName::fromLLSD(const LLSD& sd) mDisplayName = sd[DISPLAY_NAME].asString(); mLegacyFirstName = sd[LEGACY_FIRST_NAME].asString(); mLegacyLastName = sd[LEGACY_LAST_NAME].asString(); - mIsDisplayNameDefault = sd[IS_DISPLAY_NAME_DEFAULT].asBoolean(); + mIsDisplayNameDefault = sd[IS_DISPLAY_NAME_DEFAULT].asBoolean() || mUsername == mDisplayName; LLDate expires = sd[DISPLAY_NAME_EXPIRES]; mExpires = expires.secondsSinceEpoch(); LLDate next_update = sd[DISPLAY_NAME_NEXT_UPDATE]; diff --git a/indra/llcommon/llcoros.cpp b/indra/llcommon/llcoros.cpp index 0b5829eb7..baaddcaed 100644 --- a/indra/llcommon/llcoros.cpp +++ b/indra/llcommon/llcoros.cpp @@ -39,7 +39,12 @@ #include "llerror.h" #include "stringize.h" -LLCoros::LLCoros() +LLCoros::LLCoros(): + // MAINT-2724: default coroutine stack size too small on Windows. + // Previously we used + // boost::context::guarded_stack_allocator::default_stacksize(); + // empirically this is 64KB on Windows and Linux. Try quadrupling. + mStackSize(256*1024) { // Register our cleanup() method for "mainloop" ticks LLEventPumps::instance().obtain("mainloop").listen( @@ -55,7 +60,7 @@ bool LLCoros::cleanup(const LLSD&) // since last tick? if (mi->second->exited()) { - LL_INFOS("LLCoros") << "LLCoros: cleaning up coroutine " << mi->first << LL_ENDL; + LL_INFOS("LLCoros") << "LLCoros: cleaning up coroutine " << mi->first << LL_ENDL; // The erase() call will invalidate its passed iterator value -- // so increment mi FIRST -- but pass its original value to // erase(). This is what postincrement is all about. @@ -89,7 +94,7 @@ std::string LLCoros::generateDistinctName(const std::string& prefix) const { if (mCoros.find(name) == mCoros.end()) { - LL_INFOS("LLCoros") << "LLCoros: launching coroutine " << name << LL_ENDL; + LL_INFOS("LLCoros") << "LLCoros: launching coroutine " << name << LL_ENDL; return name; } } @@ -115,7 +120,7 @@ std::string LLCoros::getNameByID(const void* self_id) const // passed to us comes. for (CoroMap::const_iterator mi(mCoros.begin()), mend(mCoros.end()); mi != mend; ++mi) { - namespace coro_private = boost::coroutines::detail; + namespace coro_private = boost::dcoroutines::detail; if (static_cast(coro_private::coroutine_accessor::get_impl(const_cast(*mi->second)).get()) == self_id) { @@ -125,6 +130,12 @@ std::string LLCoros::getNameByID(const void* self_id) const return ""; } +void LLCoros::setStackSize(S32 stacksize) +{ + LL_INFOS("LLCoros") << "Setting coroutine stack size to " << stacksize << LL_ENDL; + mStackSize = stacksize; +} + /***************************************************************************** * MUST BE LAST *****************************************************************************/ diff --git a/indra/llcommon/llcoros.h b/indra/llcommon/llcoros.h index d75f28ec1..01ee11da1 100644 --- a/indra/llcommon/llcoros.h +++ b/indra/llcommon/llcoros.h @@ -29,7 +29,7 @@ #if ! defined(LL_LLCOROS_H) #define LL_LLCOROS_H -#include +#include #include "llsingleton.h" #include #include @@ -78,8 +78,8 @@ class LL_COMMON_API LLCoros: public LLSingleton { public: - /// Canonical boost::coroutines::coroutine signature we use - typedef boost::coroutines::coroutine coro; + /// Canonical boost::dcoroutines::coroutine signature we use + typedef boost::dcoroutines::coroutine coro; /// Canonical 'self' type typedef coro::self self; @@ -125,7 +125,7 @@ public: template std::string launch(const std::string& prefix, const CALLABLE& callable) { - return launchImpl(prefix, new coro(callable)); + return launchImpl(prefix, new coro(callable, mStackSize)); } /** @@ -152,6 +152,9 @@ public: /// getName() by self.get_id() std::string getNameByID(const void* self_id) const; + /// for delayed initialization + void setStackSize(S32 stacksize); + private: friend class LLSingleton; LLCoros(); @@ -159,6 +162,7 @@ private: std::string generateDistinctName(const std::string& prefix) const; bool cleanup(const LLSD&); + S32 mStackSize; typedef boost::ptr_map CoroMap; CoroMap mCoros; }; diff --git a/indra/llcommon/lleventcoro.h b/indra/llcommon/lleventcoro.h index 88a5e6ec7..a42af63b6 100644 --- a/indra/llcommon/lleventcoro.h +++ b/indra/llcommon/lleventcoro.h @@ -29,8 +29,8 @@ #if ! defined(LL_LLEVENTCORO_H) #define LL_LLEVENTCORO_H -#include -#include +#include +#include #include #include #include @@ -206,13 +206,13 @@ LLSD postAndWait(SELF& self, const LLSD& event, const LLEventPumpOrPumpName& req const LLEventPumpOrPumpName& replyPump, const LLSD& replyPumpNamePath=LLSD()) { // declare the future - boost::coroutines::future future(self); + boost::dcoroutines::future future(self); // make a callback that will assign a value to the future, and listen on // the specified LLEventPump with that callback std::string listenerName(LLEventDetail::listenerNameForCoro(self)); LLTempBoundListener connection( replyPump.getPump().listen(listenerName, - voidlistener(boost::coroutines::make_callback(future)))); + voidlistener(boost::dcoroutines::make_callback(future)))); // skip the "post" part if requestPump is default-constructed if (requestPump) { @@ -257,7 +257,7 @@ namespace LLEventDetail * This helper is specifically for the two-pump version of waitForEventOn(). * We use a single future object, but we want to listen on two pumps with it. * Since we must still adapt from (the callable constructed by) - * boost::coroutines::make_callback() (void return) to provide an event + * boost::dcoroutines::make_callback() (void return) to provide an event * listener (bool return), we've adapted LLVoidListener for the purpose. The * basic idea is that we construct a distinct instance of WaitForEventOnHelper * -- binding different instance data -- for each of the pumps. Then, when a @@ -331,16 +331,16 @@ LLEventWithID postAndWait2(SELF& self, const LLSD& event, const LLSD& replyPump1NamePath=LLSD()) { // declare the future - boost::coroutines::future future(self); + boost::dcoroutines::future future(self); // either callback will assign a value to this future; listen on // each specified LLEventPump with a callback std::string name(LLEventDetail::listenerNameForCoro(self)); LLTempBoundListener connection0( replyPump0.getPump().listen(name + "a", - LLEventDetail::wfeoh(boost::coroutines::make_callback(future), 0))); + LLEventDetail::wfeoh(boost::dcoroutines::make_callback(future), 0))); LLTempBoundListener connection1( replyPump1.getPump().listen(name + "b", - LLEventDetail::wfeoh(boost::coroutines::make_callback(future), 1))); + LLEventDetail::wfeoh(boost::dcoroutines::make_callback(future), 1))); // skip the "post" part if requestPump is default-constructed if (requestPump) { diff --git a/indra/llcommon/llframetimer.h b/indra/llcommon/llframetimer.h index b09937895..2813150c5 100644 --- a/indra/llcommon/llframetimer.h +++ b/indra/llcommon/llframetimer.h @@ -127,6 +127,7 @@ public: mRunning = false; } + void resetWithExpiry(F32 expiration) { reset(); setTimerExpirySec(expiration); } void pause(); // Mark elapsed time so far. void unpause(); // Move 'start' time in order to decrement time between pause and unpause from ElapsedTime. diff --git a/indra/llcommon/llinstancetracker.h b/indra/llcommon/llinstancetracker.h index ecaf55586..3c096abe1 100644 --- a/indra/llcommon/llinstancetracker.h +++ b/indra/llcommon/llinstancetracker.h @@ -86,6 +86,7 @@ class LLInstanceTracker : public LLInstanceTrackerBase { typedef LLInstanceTracker MyT; typedef typename std::map InstanceMap; + typedef typename InstanceMap::iterator::difference_type difference_type; struct StaticData: public StaticBase { InstanceMap sMap; @@ -115,6 +116,11 @@ public: friend class boost::iterator_core_access; void increment() { mIterator++; } + void decrement() { --mIterator; } + difference_type distance_to(instance_iter const& other) const + { + return std::distance(mIterator, other.mIterator); + } bool equal(instance_iter const& other) const { return mIterator == other.mIterator; @@ -155,6 +161,11 @@ public: friend class boost::iterator_core_access; void increment() { mIterator++; } + void decrement() { --mIterator; } + difference_type distance_to(instance_iter const& other) const + { + return std::distance(mIterator, other.mIterator); + } bool equal(key_iter const& other) const { return mIterator == other.mIterator; diff --git a/indra/llcommon/llmemory.cpp b/indra/llcommon/llmemory.cpp index 05809d20b..0207e749e 100644 --- a/indra/llcommon/llmemory.cpp +++ b/indra/llcommon/llmemory.cpp @@ -176,7 +176,7 @@ void LLMemory::logMemoryInfo(BOOL update) llinfos << "Current allocated physical memory(KB): " << sAllocatedMemInKB << llendl ; llinfos << "Current allocated page size (KB): " << sAllocatedPageSizeInKB << llendl ; - llinfos << "Current availabe physical memory(KB): " << sAvailPhysicalMemInKB << llendl ; + llinfos << "Current available physical memory(KB): " << sAvailPhysicalMemInKB << llendl ; llinfos << "Current max usable memory(KB): " << sMaxPhysicalMemInKB << llendl ; llinfos << "--- private pool information -- " << llendl ; diff --git a/indra/llcommon/llversionviewer.h.in b/indra/llcommon/llversionviewer.h.in index e1fa1cab3..f97e2acd0 100644 --- a/indra/llcommon/llversionviewer.h.in +++ b/indra/llcommon/llversionviewer.h.in @@ -35,7 +35,7 @@ const S32 LL_VERSION_MAJOR = 1; const S32 LL_VERSION_MINOR = 8; -const S32 LL_VERSION_PATCH = 0; +const S32 LL_VERSION_PATCH = 3; const S32 LL_VERSION_BUILD = ${vBUILD}; const char * const LL_CHANNEL = "${VIEWER_CHANNEL}"; diff --git a/indra/llcrashlogger/CMakeLists.txt b/indra/llcrashlogger/CMakeLists.txt deleted file mode 100644 index a20e42a8d..000000000 --- a/indra/llcrashlogger/CMakeLists.txt +++ /dev/null @@ -1,36 +0,0 @@ -# -*- cmake -*- - -project(llcrashlogger) - -include(00-Common) -include(LLCommon) -include(LLMath) -include(LLMessage) -include(LLVFS) -include(LLXML) - -include_directories( - ${LLCOMMON_INCLUDE_DIRS} - ${LLMATH_INCLUDE_DIRS} - ${LLMESSAGE_INCLUDE_DIRS} - ${LLVFS_INCLUDE_DIRS} - ${LLXML_INCLUDE_DIRS} - ) - -set(llcrashlogger_SOURCE_FILES - llcrashlogger.cpp - ) - -set(llcrashlogger_HEADER_FILES - CMakeLists.txt - - llcrashlogger.h - ) - -set_source_files_properties(${llcrashlogger_HEADER_FILES} - PROPERTIES HEADER_FILE_ONLY TRUE) - -list(APPEND llcrashlogger_SOURCE_FILES ${llcrashlogger_HEADER_FILES}) - -add_library(llcrashlogger ${llcrashlogger_SOURCE_FILES}) -add_dependencies(llcrashlogger prepare) diff --git a/indra/llcrashlogger/llcrashlogger.cpp b/indra/llcrashlogger/llcrashlogger.cpp deleted file mode 100644 index e072b5c79..000000000 --- a/indra/llcrashlogger/llcrashlogger.cpp +++ /dev/null @@ -1,425 +0,0 @@ - /** -* @file llcrashlogger.cpp -* @brief Crash logger implementation -* -* $LicenseInfo:firstyear=2003&license=viewergpl$ -* -* Copyright (c) 2003-2009, Linden Research, Inc. -* -* Second Life Viewer Source Code -* The source code in this file ("Source Code") is provided by Linden Lab -* to you under the terms of the GNU General Public License, version 2.0 -* ("GPL"), unless you have obtained a separate licensing agreement -* ("Other License"), formally executed by you and Linden Lab. Terms of -* the GPL can be found in doc/GPL-license.txt in this distribution, or -* online at http://secondlifegrid.net/programs/open_source/licensing/gplv2 -* -* There are special exceptions to the terms and conditions of the GPL as -* it is applied to this Source Code. View the full text of the exception -* in the file doc/FLOSS-exception.txt in this software distribution, or -* online at -* http://secondlifegrid.net/programs/open_source/licensing/flossexception -* -* By copying, modifying or distributing this software, you acknowledge -* that you have read and understood your obligations described above, -* and agree to abide by those obligations. -* -* ALL LINDEN LAB SOURCE CODE IS PROVIDED "AS IS." LINDEN LAB MAKES NO -* WARRANTIES, EXPRESS, IMPLIED OR OTHERWISE, REGARDING ITS ACCURACY, -* COMPLETENESS OR PERFORMANCE. -* $/LicenseInfo$ -*/ - -#include "linden_common.h" - -#include -#include -#include -#include - -#include "llcrashlogger.h" -#include "llstring.h" -#include "indra_constants.h" // CRASH_BEHAVIOR_ASK, CRASH_SETTING_NAME -#include "llerror.h" -#include "lltimer.h" -#include "lldir.h" -#include "llsdserialize.h" -#include "lliopipe.h" -#include "llpumpio.h" -#include "llhttpclient.h" -#include "llsdserialize.h" -#include "llcurl.h" -#include "aistatemachine.h" - -LLPumpIO* gServicePump; -BOOL gBreak = false; -BOOL gSent = false; - -class AIHTTPTimeoutPolicy; -extern AIHTTPTimeoutPolicy crashLoggerResponder_timeout; -extern void startEngineThread(void); - -class LLCrashLoggerResponder : public LLHTTPClient::ResponderWithResult -{ -public: - LLCrashLoggerResponder() - { - } - - /*virtual*/ void error(U32 status, const std::string& reason) - { - gBreak = true; - } - - /*virtual*/ void result(const LLSD& content) - { - gBreak = true; - gSent = true; - } - - /*virtual*/ AIHTTPTimeoutPolicy const& getHTTPTimeoutPolicy(void) const { return crashLoggerResponder_timeout; } - /*virtual*/ char const* getName(void) const { return "LLCrashLoggerResponder"; } -}; - -bool LLCrashLoggerText::mainLoop() -{ - std::cout << "Entering main loop" << std::endl; - sendCrashLogs(); - return true; -} - -void LLCrashLoggerText::updateApplication(const std::string& message) -{ - LLCrashLogger::updateApplication(message); - std::cout << message << std::endl; -} - -LLCrashLogger::LLCrashLogger() : - mCrashBehavior(CRASH_BEHAVIOR_ASK), - mCrashInPreviousExec(false), - mSentCrashLogs(false), - mCrashHost(""), - mCrashSettings("CrashSettings") -{ - -} - -LLCrashLogger::~LLCrashLogger() -{ - -} - -// TRIM_SIZE must remain larger than LINE_SEARCH_SIZE. -const int TRIM_SIZE = 128000; -const int LINE_SEARCH_DIST = 500; -const std::string SKIP_TEXT = "\n ...Skipping... \n"; -void trimSLLog(std::string& sllog) -{ - if(sllog.length() > TRIM_SIZE * 2) - { - std::string::iterator head = sllog.begin() + TRIM_SIZE; - std::string::iterator tail = sllog.begin() + sllog.length() - TRIM_SIZE; - std::string::iterator new_head = std::find(head, head - LINE_SEARCH_DIST, '\n'); - if(new_head != head - LINE_SEARCH_DIST) - { - head = new_head; - } - - std::string::iterator new_tail = std::find(tail, tail + LINE_SEARCH_DIST, '\n'); - if(new_tail != tail + LINE_SEARCH_DIST) - { - tail = new_tail; - } - - sllog.erase(head, tail); - sllog.insert(head, SKIP_TEXT.begin(), SKIP_TEXT.end()); - } -} - -std::string getStartupStateFromLog(std::string& sllog) -{ - std::string startup_state = "STATE_FIRST"; - std::string startup_token = "Startup state changing from "; - - int index = sllog.rfind(startup_token); - if (index < 0 || index + startup_token.length() > sllog.length()) { - return startup_state; - } - - // find new line - char cur_char = sllog[index + startup_token.length()]; - std::string::size_type newline_loc = index + startup_token.length(); - while(cur_char != '\n' && newline_loc < sllog.length()) - { - newline_loc++; - cur_char = sllog[newline_loc]; - } - - // get substring and find location of " to " - std::string state_line = sllog.substr(index, newline_loc - index); - std::string::size_type state_index = state_line.find(" to "); - startup_state = state_line.substr(state_index + 4, state_line.length() - state_index - 4); - - return startup_state; -} - -void LLCrashLogger::gatherFiles() -{ - - /* - //TODO:This function needs to be reimplemented somewhere in here... - if(!previous_crash && is_crash_log) - { - // Make sure the file isn't too old. - double age = difftime(gLaunchTime, stat_data.st_mtimespec.tv_sec); - - // llinfos << "age is " << age << llendl; - - if(age > 60.0) - { - // The file was last modified more than 60 seconds before the crash reporter was launched. Assume it's stale. - llwarns << "File " << mFilename << " is too old!" << llendl; - return; - } - } - */ - - updateApplication("Gathering logs..."); - - // Figure out the filename of the debug log - std::string db_file_name = gDirUtilp->getExpandedFilename(LL_PATH_LOGS,"debug_info.log"); - std::ifstream debug_log_file(db_file_name.c_str()); - - // Look for it in the debug_info.log file - if (debug_log_file.is_open()) - { - LLSDSerialize::fromXML(mDebugLog, debug_log_file); - - mCrashInPreviousExec = mDebugLog["CrashNotHandled"].asBoolean(); - - mFileMap["SecondLifeLog"] = mDebugLog["SLLog"].asString(); - mFileMap["SettingsXml"] = mDebugLog["SettingsFilename"].asString(); - if(mDebugLog.has("CAFilename")) - { - LLCurl::setCAFile(mDebugLog["CAFilename"].asString()); - } - else - { - LLCurl::setCAFile(gDirUtilp->getCAFile()); - } - - llinfos << "Using log file from debug log " << mFileMap["SecondLifeLog"] << llendl; - llinfos << "Using settings file from debug log " << mFileMap["SettingsXml"] << llendl; - } - else - { - // Figure out the filename of the second life log - LLCurl::setCAFile(gDirUtilp->getCAFile()); - mFileMap["SecondLifeLog"] = gDirUtilp->getExpandedFilename(LL_PATH_LOGS,"SecondLife.log"); - mFileMap["SettingsXml"] = gDirUtilp->getExpandedFilename(LL_PATH_USER_SETTINGS,"settings.xml"); - } - -#if !LL_DARWIN - if(mCrashInPreviousExec) -#else -#endif - { - // Replace the log file ext with .old, since the - // instance that launched this process has overwritten - // SecondLife.log - std::string log_filename = mFileMap["SecondLifeLog"]; - log_filename.replace(log_filename.size() - 4, 4, ".old"); - mFileMap["SecondLifeLog"] = log_filename; - } - - gatherPlatformSpecificFiles(); - - //Use the debug log to reconstruct the URL to send the crash report to - if(mDebugLog.has("CurrentSimHost")) - { - mCrashHost = "https://"; - mCrashHost += mDebugLog["CurrentSimHost"].asString(); - mCrashHost += ":12043/crash/report"; - } - else if(mDebugLog.has("GridName")) - { - // This is a 'little' hacky, but its the best simple solution. - std::string grid_host = mDebugLog["GridName"].asString(); - LLStringUtil::toLower(grid_host); - - mCrashHost = "https://login."; - mCrashHost += grid_host; - mCrashHost += ".lindenlab.com:12043/crash/report"; - } - - // Use login servers as the alternate, since they are already load balanced and have a known name - mAltCrashHost = "https://login.agni.lindenlab.com:12043/crash/report"; - - mCrashInfo["DebugLog"] = mDebugLog; - mFileMap["StatsLog"] = gDirUtilp->getExpandedFilename(LL_PATH_LOGS,"stats.log"); - mFileMap["StackTrace"] = gDirUtilp->getExpandedFilename(LL_PATH_LOGS,"stack_trace.log"); - - updateApplication("Encoding files..."); - - for(std::map::iterator itr = mFileMap.begin(); itr != mFileMap.end(); ++itr) - { - std::ifstream f((*itr).second.c_str()); - if(!f.is_open()) - { - std::cout << "Can't find file " << (*itr).second << std::endl; - continue; - } - std::stringstream s; - s << f.rdbuf(); - - std::string crash_info = s.str(); - if(itr->first == "SecondLifeLog") - { - if(!mCrashInfo["DebugLog"].has("StartupState")) - { - mCrashInfo["DebugLog"]["StartupState"] = getStartupStateFromLog(crash_info); - } - trimSLLog(crash_info); - } - - mCrashInfo[(*itr).first] = rawstr_to_utf8(crash_info); - } -} - -LLSD LLCrashLogger::constructPostData() -{ - LLSD ret; - return mCrashInfo; -} - -S32 LLCrashLogger::loadCrashBehaviorSetting() -{ - std::string filename = gDirUtilp->getExpandedFilename(LL_PATH_USER_SETTINGS, CRASH_SETTINGS_FILE); - - mCrashSettings.loadFromFile(filename); - - S32 value = mCrashSettings.getS32(CRASH_BEHAVIOR_SETTING); - - if (value < CRASH_BEHAVIOR_ASK || CRASH_BEHAVIOR_NEVER_SEND < value) return CRASH_BEHAVIOR_ASK; - - return value; -} - -bool LLCrashLogger::saveCrashBehaviorSetting(S32 crash_behavior) -{ - if (crash_behavior != CRASH_BEHAVIOR_ASK && crash_behavior != CRASH_BEHAVIOR_ALWAYS_SEND) return false; - - mCrashSettings.setS32(CRASH_BEHAVIOR_SETTING, crash_behavior); - std::string filename = gDirUtilp->getExpandedFilename(LL_PATH_USER_SETTINGS, CRASH_SETTINGS_FILE); - - mCrashSettings.saveToFile(filename, FALSE); - - return true; -} - -bool LLCrashLogger::runCrashLogPost(std::string host, LLSD data, std::string msg, int retries) -{ - gBreak = false; - std::string status_message; - for(int i = 0; i < retries; ++i) - { - status_message = llformat("%s, try %d...", msg.c_str(), i+1); - LLHTTPClient::post(host, data, new LLCrashLoggerResponder); - while(!gBreak) - { - updateApplication(status_message); - } - if(gSent) - { - return gSent; - } - } - return gSent; -} - -bool LLCrashLogger::sendCrashLogs() -{ - gatherFiles(); - - LLSD post_data; - post_data = constructPostData(); - - updateApplication("Sending reports..."); - - std::string dump_path = gDirUtilp->getExpandedFilename(LL_PATH_LOGS, - "SecondLifeCrashReport"); - std::string report_file = dump_path + ".log"; - - std::ofstream out_file(report_file.c_str()); - LLSDSerialize::toPrettyXML(post_data, out_file); - out_file.close(); - - bool sent = false; - - // *TODO: Translate - if(mCrashHost != "") - { - sent = runCrashLogPost(mCrashHost, post_data, std::string("Sending to server"), 3); - } - - if(!sent) - { - sent = runCrashLogPost(mAltCrashHost, post_data, std::string("Sending to alternate server"), 3); - } - - mSentCrashLogs = sent; - - return true; -} - -void LLCrashLogger::updateApplication(const std::string& message) -{ - gServicePump->pump(); - gServicePump->callback(); - gMainThreadEngine.mainloop(); -} - -bool LLCrashLogger::init() -{ - // Initialize curl - AICurlInterface::initCurl(); - - // Initialize state machine engines. - AIEngine::setMaxCount(100); // StateMachineMaxTime - - // Start state machine thread. - startEngineThread(); - - // We assume that all the logs we're looking for reside on the current drive - gDirUtilp->initAppDirs("SecondLife"); - - // Default to the product name "Second Life" (this is overridden by the -name argument) - mProductName = "Second Life"; - - mCrashSettings.declareS32(CRASH_BEHAVIOR_SETTING, CRASH_BEHAVIOR_ASK, "Controls behavior when viewer crashes " - "(0 = ask before sending crash report, 1 = always send crash report, 2 = never send crash report)"); - - llinfos << "Loading crash behavior setting" << llendl; - mCrashBehavior = loadCrashBehaviorSetting(); - - // If user doesn't want to send, bail out - if (mCrashBehavior == CRASH_BEHAVIOR_NEVER_SEND) - { - llinfos << "Crash behavior is never_send, quitting" << llendl; - return false; - } - - // Start curl thread. - AICurlInterface::startCurlThread(&mCrashSettings); - - gServicePump = new LLPumpIO; - - //If we've opened the crash logger, assume we can delete the marker file if it exists - if( gDirUtilp ) - { - std::string marker_file = gDirUtilp->getExpandedFilename(LL_PATH_LOGS,"SecondLife.exec_marker"); - LLAPRFile::remove( marker_file ); - } - - return true; -} diff --git a/indra/llcrashlogger/llcrashlogger.h b/indra/llcrashlogger/llcrashlogger.h deleted file mode 100644 index 08e4a5f9f..000000000 --- a/indra/llcrashlogger/llcrashlogger.h +++ /dev/null @@ -1,88 +0,0 @@ -/** -* @file llcrashlogger.h -* @brief Crash Logger Definition -* -* $LicenseInfo:firstyear=2003&license=viewergpl$ -* -* Copyright (c) 2003-2009, Linden Research, Inc. -* -* Second Life Viewer Source Code -* The source code in this file ("Source Code") is provided by Linden Lab -* to you under the terms of the GNU General Public License, version 2.0 -* ("GPL"), unless you have obtained a separate licensing agreement -* ("Other License"), formally executed by you and Linden Lab. Terms of -* the GPL can be found in doc/GPL-license.txt in this distribution, or -* online at http://secondlifegrid.net/programs/open_source/licensing/gplv2 -* -* There are special exceptions to the terms and conditions of the GPL as -* it is applied to this Source Code. View the full text of the exception -* in the file doc/FLOSS-exception.txt in this software distribution, or -* online at -* http://secondlifegrid.net/programs/open_source/licensing/flossexception -* -* By copying, modifying or distributing this software, you acknowledge -* that you have read and understood your obligations described above, -* and agree to abide by those obligations. -* -* ALL LINDEN LAB SOURCE CODE IS PROVIDED "AS IS." LINDEN LAB MAKES NO -* WARRANTIES, EXPRESS, IMPLIED OR OTHERWISE, REGARDING ITS ACCURACY, -* COMPLETENESS OR PERFORMANCE. -* $/LicenseInfo$ -*/ -#ifndef LLCRASHLOGGER_H -#define LLCRASHLOGGER_H - -#include "linden_common.h" - -#include - -#include "llapp.h" -#include "llsd.h" -#include "llcontrol.h" - -class AIHTTPTimeoutPolicy; - -class LLCrashLogger : public LLApp -{ -public: - LLCrashLogger(); - virtual ~LLCrashLogger(); - S32 loadCrashBehaviorSetting(); - void gatherFiles(); - virtual void gatherPlatformSpecificFiles() {} - bool saveCrashBehaviorSetting(S32 crash_behavior); - bool sendCrashLogs(); - LLSD constructPostData(); - virtual void updateApplication(const std::string& message = LLStringUtil::null); - virtual bool init(); - virtual bool mainLoop() = 0; - virtual bool cleanup() { return true; } - void setUserText(const std::string& text) { mCrashInfo["UserNotes"] = text; } - S32 getCrashBehavior() { return mCrashBehavior; } - bool runCrashLogPost(std::string host, LLSD data, std::string msg, int retries); -protected: - S32 mCrashBehavior; - BOOL mCrashInPreviousExec; - std::map mFileMap; - std::string mGridName; - LLControlGroup mCrashSettings; - std::string mProductName; - LLSD mCrashInfo; - std::string mCrashHost; - std::string mAltCrashHost; - LLSD mDebugLog; - bool mSentCrashLogs; -}; - -class LLCrashLoggerText : public LLCrashLogger -{ -public: - LLCrashLoggerText(void) {} - ~LLCrashLoggerText(void) {} - - virtual bool mainLoop(); - virtual void updateApplication(const std::string& message = LLStringUtil::null); -}; - - -#endif //LLCRASHLOGGER_H diff --git a/indra/llinventory/llinventory.cpp b/indra/llinventory/llinventory.cpp index 7a1baada0..5e8b9e22a 100644 --- a/indra/llinventory/llinventory.cpp +++ b/indra/llinventory/llinventory.cpp @@ -1150,6 +1150,40 @@ bool LLInventoryItem::fromLLSD(const LLSD& sd) { mFlags = sd[w].asInteger(); } + + // + // Define a few magic constants that are not accessible otherwise, from here. + // mInventoryType: + static U32 IT_WEARABLE = 18; // LLInventoryType::IT_WEARABLE + // mType, these are the two asset types that are IT_WEARABLE: + static U32 AT_BODYPART = 13; // LLAssetType::AT_BODYPART + // Viewer local values: + static U32 WT_UNKNOWN = 16; // LLWearableType::WT_UNKNOWN + static U32 WT_COUNT = 17; // LLWearableType::WT_COUNT + // The last 8 bits of mFlags contain the wearable type. + static U32 II_FLAGS_WEARABLES_MASK = 0xff; // LLInventoryItemFlags::II_FLAGS_WEARABLES_MASK + + // The wearable type is stored in the lower 8 bits of mFlags. + U32 wt = mFlags & II_FLAGS_WEARABLES_MASK; + + // Because WT_UNKNOWN now has locally a special meaning, make sure we don't receive it from the server. + if (wt == WT_UNKNOWN) + { + llwarns << "Received inventory item with wearable type WT_UNKNOWN from server! You should upgrade your viewer." << llendl; + // Change this new wearable type to WT_COUNT, as if when we had not inserted WT_UNKNOWN locally. + mFlags += 1; + wt = WT_COUNT; + } + + // Detect possible problematic items. + if (wt == 0 && mInventoryType == IT_WEARABLE && mType != AT_BODYPART) + { + // This is not possible, and therefore is probably an item creatd by a pre-multiwear viewer (or Second Inventory, etc). + // The wearable type is NOT a shape (0) in that case of course, but we don't know what it is without downloading the + // asset. + mFlags |= WT_UNKNOWN; + } + // } w = INV_NAME_LABEL; if (sd.has(w)) diff --git a/indra/llinventory/llinventorytype.h b/indra/llinventory/llinventorytype.h index 36f3ce264..b444ecfa5 100644 --- a/indra/llinventory/llinventorytype.h +++ b/indra/llinventory/llinventorytype.h @@ -108,6 +108,7 @@ public: ICONNAME_LINKFOLDER, ICONNAME_MESH, + ICONNAME_CLOTHING_UNKNOWN, ICONNAME_INVALID, ICONNAME_COUNT, ICONNAME_NONE = -1 diff --git a/indra/llinventory/llpermissions.cpp b/indra/llinventory/llpermissions.cpp index 07aa44db3..fb5359a88 100644 --- a/indra/llinventory/llpermissions.cpp +++ b/indra/llinventory/llpermissions.cpp @@ -1099,8 +1099,11 @@ LLPermissions ll_permissions_from_sd(const LLSD& sd_perm) return rv; } -bool LLPermissions::allowExportBy(LLUUID const& requester, bool supports_export) const +bool LLPermissions::allowExportBy(LLUUID const& requester, ExportPolicy export_policy) const { - return !mIsGroupOwned && requester == mOwner && (requester == mCreator || (supports_export && (mMaskEveryone & PERM_EXPORT))); + return !mIsGroupOwned && requester == mOwner && // Must be owner. + (requester == mCreator || // Export is allowed for all export policies when creator. + (export_policy == ep_export_bit && (mMaskEveryone & PERM_EXPORT)) || // If not creator, only allow export when PERM_EXPORT bit is set. + (export_policy == ep_full_perm && (mMaskOwner & PERM_ITEM_UNRESTRICTED) == PERM_ITEM_UNRESTRICTED)); // If not creator, only allow export when item is full perm. } diff --git a/indra/llinventory/llpermissions.h b/indra/llinventory/llpermissions.h index d4f736dc3..e6284e542 100644 --- a/indra/llinventory/llpermissions.h +++ b/indra/llinventory/llpermissions.h @@ -40,6 +40,12 @@ extern void mask_to_string(U32 mask, char* str); extern std::string mask_to_string(U32 mask); template class LLMetaClassT; +enum ExportPolicy { + ep_creator_only, // Used for SecondLife: only allow export when being creator. + ep_full_perm, // Used on non-SL grids that do not support the PERM_EXPORT bit: allow exporting of full perm objects. + ep_export_bit // Used on opensim grids that support the PERM_EXPORT bit. +}; + //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ // Class LLPermissions // @@ -280,7 +286,7 @@ public: // has that bit set and allow exporting even when this function returns false, // or pass supports_export as true, which causes to perform that check using // these permissions. - bool allowExportBy(LLUUID const& requester, bool supports_export = false) const; + bool allowExportBy(LLUUID const& requester, ExportPolicy export_policy) const; // This somewhat specialized function is meant for testing if the // current owner is allowed to transfer to the specified agent id. diff --git a/indra/llmath/lloctree.h b/indra/llmath/lloctree.h index b5252d055..981e2176f 100644 --- a/indra/llmath/lloctree.h +++ b/indra/llmath/lloctree.h @@ -623,6 +623,9 @@ public: child->insert(data); } } +// Singu note: now that we allow wider range in octree, discard them here +// if they fall out of range +#if 0 else { //it's not in here, give it to the root @@ -641,6 +644,7 @@ public: node->insert(data); } } +#endif return false; } @@ -1010,7 +1014,7 @@ public: } LLVector4a MAX_MAG; - MAX_MAG.splat(1024.f*1024.f); + MAX_MAG.splat(1024.f * 1024.f); const LLVector4a& v = data->getPositionGroup(); diff --git a/indra/llmessage/aicurl.cpp b/indra/llmessage/aicurl.cpp index 04b9c5a16..246371aab 100644 --- a/indra/llmessage/aicurl.cpp +++ b/indra/llmessage/aicurl.cpp @@ -1262,7 +1262,8 @@ std::string CurlEasyRequest::getLowercaseHostname(void) const //----------------------------------------------------------------------------- // BufferedCurlEasyRequest -static int const HTTP_REDIRECTS_DEFAULT = 10; +static int const HTTP_REDIRECTS_DEFAULT = 16; // Singu note: I've seen up to 10 redirects, so setting the limit to 10 is cutting it. + // This limit is only here to avoid a redirect loop (infinite redirections). LLChannelDescriptors const BufferedCurlEasyRequest::sChannels; LLMutex BufferedCurlEasyRequest::sResponderCallbackMutex; @@ -1411,8 +1412,8 @@ void BufferedCurlEasyRequest::prepRequest(AICurlEasyRequest_wat& curl_easy_reque curl_easy_request_w->setHeaderCallback(&curlHeaderCallback, lockobj); bool allow_cookies = headers.hasHeader("Cookie"); - // Allow up to ten redirects. - if (responder->followRedir()) + // Allow up to sixteen redirects. + if (!responder->pass_redirect_status()) { curl_easy_request_w->setopt(CURLOPT_FOLLOWLOCATION, 1); curl_easy_request_w->setopt(CURLOPT_MAXREDIRS, HTTP_REDIRECTS_DEFAULT); @@ -1436,6 +1437,7 @@ void BufferedCurlEasyRequest::prepRequest(AICurlEasyRequest_wat& curl_easy_reque mResponder = responder; // Cache capability type, because it will be needed even after the responder was removed. mCapabilityType = responder->capability_type(); + mIsEventPoll = responder->is_event_poll(); // Send header events to responder if needed. if (mResponder->needsHeaders()) diff --git a/indra/llmessage/aicurleasyrequeststatemachine.cpp b/indra/llmessage/aicurleasyrequeststatemachine.cpp index ed2bf820d..0437055f5 100644 --- a/indra/llmessage/aicurleasyrequeststatemachine.cpp +++ b/indra/llmessage/aicurleasyrequeststatemachine.cpp @@ -116,6 +116,15 @@ void AICurlEasyRequestStateMachine::multiplex_impl(state_type run_state) { set_state(AICurlEasyRequestStateMachine_waitAdded); idle(); // Wait till AICurlEasyRequestStateMachine::added_to_multi_handle() is called. + + // This is a work around for the case that this request had a bad url, in order to avoid a crash later on. + bool empty_url = AICurlEasyRequest_rat(*mCurlEasyRequest)->getLowercaseServicename().empty(); + if (empty_url) + { + abort(); + break; + } + // Only AFTER going idle, add request to curl thread; this is needed because calls to set_state() are // ignored when the statemachine is not idle, and theoretically the callbacks could be called // immediately after this call. diff --git a/indra/llmessage/aicurlperservice.cpp b/indra/llmessage/aicurlperservice.cpp index 8a58e2c98..570a7e5b2 100644 --- a/indra/llmessage/aicurlperservice.cpp +++ b/indra/llmessage/aicurlperservice.cpp @@ -75,6 +75,7 @@ AIPerService::AIPerService(void) : mConcurrentConnections(CurlConcurrentConnectionsPerService), mApprovedRequests(0), mTotalAdded(0), + mEventPolls(0), mEstablishedConnections(0), mUsedCT(0), mCTInUse(0) @@ -214,7 +215,7 @@ std::string AIPerService::extract_canonical_servicename(std::string const& url) } ++p; } - // Strip of any trailing ":80". + // Strip off any trailing ":80". if (p - 3 == port_colon && p[-1] == '0' && p[-2] == '8') { return servicename.substr(0, p - hostname - 3); @@ -335,24 +336,70 @@ bool AIPerService::throttled(AICapabilityType capability_type) const mCapabilityType[capability_type].mAdded >= mCapabilityType[capability_type].mConcurrentConnections; } -void AIPerService::added_to_multi_handle(AICapabilityType capability_type) +void AIPerService::added_to_multi_handle(AICapabilityType capability_type, bool event_poll) { + if (event_poll) + { + llassert(capability_type == cap_other); + // We want to mark this service as unused when only long polls have been added, because they + // are not counted towards the maximum number of connection for this service and therefore + // should not cause another capability type to get less connections. + // For example, if - like on opensim - Textures and Other capability types use the same + // service then it is nonsense to reserve 4 connections Other and only give 4 connections + // to Textures, only because there is a long poll connection (or any number of long poll + // connections). What we want is to see: 0-0-0,{0/7,0} for textures when Other is ONLY in + // use for the Event Poll. + // + // This translates to that, since we're adding an event_poll and are about to remove it from + // either the command queue OR the request queue, that when mAdded == 1 at the end of this function + // (and the rest of the pipeline is empty) we want to mark this capability type as unused. + // + // If mEventPolls > 0 at this point then mAdded will not be incremented. + // If mEventPolls == 0 then mAdded will be incremented and thus should be 0 now. + // In other words, if the number of mAdded requests is equal to the number of (counted) + // mEventPoll requests right now, then that will still be the case after we added another + // event poll request (the transition from used to unused only being necessary because + // event poll requests in the pipe line ARE counted; not because that is necessary but + // because it would be more complex to not do so). + // + // Moreover, when we get here then the request that is being added is still counted as being in + // the command queue, or the request queue, so that pipelined_requests() will return 1 more than + // the actual count. + U16 counted_event_polls = (mEventPolls == 0) ? 0 : 1; + if (mCapabilityType[capability_type].mAdded == counted_event_polls && + mCapabilityType[capability_type].pipelined_requests() == counted_event_polls + 1) + { + mark_unused(capability_type); + } + if (++mEventPolls > 1) + { + // This only happens on megaregions. Do not count the additional long poll connections against the maximum handles for this service. + return; + } + } ++mCapabilityType[capability_type].mAdded; ++mTotalAdded; } -void AIPerService::removed_from_multi_handle(AICapabilityType capability_type, bool downloaded_something, bool success) +void AIPerService::removed_from_multi_handle(AICapabilityType capability_type, bool event_poll, bool downloaded_something, bool success) { CapabilityType& ct(mCapabilityType[capability_type]); - llassert(mTotalAdded > 0 && ct.mAdded > 0); - bool done = --ct.mAdded == 0; + llassert(mTotalAdded > 0 && ct.mAdded > 0 && (!event_poll || mEventPolls)); + if (!event_poll || --mEventPolls == 0) + { + --ct.mAdded; + --mTotalAdded; + } if (downloaded_something) { llassert(ct.mDownloading > 0); --ct.mDownloading; } - --mTotalAdded; - if (done && ct.pipelined_requests() == 0) + // If the number of added request handles is equal to the number of counted event poll handles, + // in other words, when there are only long poll connections left, then mark the capability type + // as unused. + U16 counted_event_polls = (capability_type != cap_other || mEventPolls == 0) ? 0 : 1; + if (ct.mAdded == counted_event_polls && ct.pipelined_requests() == counted_event_polls) { mark_unused(capability_type); } @@ -467,6 +514,9 @@ void AIPerService::add_queued_to(curlthread::MultiHandle* multi_handle, bool onl break; } // Request was added, remove it from the queue. + // Note: AIPerService::added_to_multi_handle (called from add_easy_request above) relies on the fact that + // we first add the easy handle and then remove it from the request queue (which is necessary to avoid + // that another thread adds one just in between). ct.mQueuedRequests.pop_front(); // Mark that at least one request of this CT was successfully added. success |= mask; diff --git a/indra/llmessage/aicurlperservice.h b/indra/llmessage/aicurlperservice.h index 188d383bf..9ecec8c72 100644 --- a/indra/llmessage/aicurlperservice.h +++ b/indra/llmessage/aicurlperservice.h @@ -145,7 +145,8 @@ class AIPerService { queued_request_type mQueuedRequests; // Waiting (throttled) requests. U16 mApprovedRequests; // The number of approved requests for this CT by approveHTTPRequestFor that were not added to the command queue yet. - U16 mQueuedCommands; // Number of add commands (minus remove commands), for this service, in the command queue. + S16 mQueuedCommands; // Number of add commands (minus remove commands), for this service, in the command queue. + // This value can temporarily become negative when remove commands are added to the queue for add requests that were already processed. U16 mAdded; // Number of active easy handles with this service. U16 mFlags; // ctf_empty: Set to true when the queue becomes precisely empty. // ctf_full : Set to true when the queue is popped and then still isn't empty; @@ -169,6 +170,7 @@ class AIPerService { int mConcurrentConnections; // The maximum number of allowed concurrent connections to this service. int mApprovedRequests; // The number of approved requests for this service by approveHTTPRequestFor that were not added to the command queue yet. int mTotalAdded; // Number of active easy handles with this service. + int mEventPolls; // Number of active event poll handles with this service. int mEstablishedConnections; // Number of connected sockets to this service. U32 mUsedCT; // Bit mask with one bit per capability type. A '1' means the capability was in use since the last resetUsedCT(). @@ -267,9 +269,10 @@ class AIPerService { public: void added_to_command_queue(AICapabilityType capability_type) { ++mCapabilityType[capability_type].mQueuedCommands; mark_inuse(capability_type); } - void removed_from_command_queue(AICapabilityType capability_type) { --mCapabilityType[capability_type].mQueuedCommands; llassert(mCapabilityType[capability_type].mQueuedCommands >= 0); } - void added_to_multi_handle(AICapabilityType capability_type); // Called when an easy handle for this service has been added to the multi handle. - void removed_from_multi_handle(AICapabilityType capability_type, bool downloaded_something, bool success); // Called when an easy handle for this service is removed again from the multi handle. + void removed_from_command_queue(AICapabilityType capability_type) { --mCapabilityType[capability_type].mQueuedCommands; } + void added_to_multi_handle(AICapabilityType capability_type, bool event_poll); // Called when an easy handle for this service has been added to the multi handle. + void removed_from_multi_handle(AICapabilityType capability_type, bool event_poll, + bool downloaded_something, bool success); // Called when an easy handle for this service is removed again from the multi handle. void download_started(AICapabilityType capability_type) { ++mCapabilityType[capability_type].mDownloading; } bool throttled(AICapabilityType capability_type) const; // Returns true if the maximum number of allowed requests for this service/capability type have been added to the multi handle. bool nothing_added(AICapabilityType capability_type) const { return mCapabilityType[capability_type].mAdded == 0; } diff --git a/indra/llmessage/aicurlprivate.h b/indra/llmessage/aicurlprivate.h index cbb9a293d..c5e3514a7 100644 --- a/indra/llmessage/aicurlprivate.h +++ b/indra/llmessage/aicurlprivate.h @@ -418,6 +418,7 @@ class BufferedCurlEasyRequest : public CurlEasyRequest { buffer_ptr_t mOutput; LLHTTPClient::ResponderPtr mResponder; AICapabilityType mCapabilityType; + bool mIsEventPoll; //U32 mBodyLimit; // From the old LLURLRequestDetail::mBodyLimit, but never used. U32 mStatus; // HTTP status, decoded from the first header line. std::string mReason; // The "reason" from the same header line. @@ -466,6 +467,7 @@ class BufferedCurlEasyRequest : public CurlEasyRequest { // Return the capability type of this request. AICapabilityType capability_type(void) const { llassert(mCapabilityType != number_of_capability_types); return mCapabilityType; } + bool is_event_poll(void) const { return mIsEventPoll; } // Return true if any data was received. bool received_data(void) const { return mTotalRawBytes > 0; } diff --git a/indra/llmessage/aicurlthread.cpp b/indra/llmessage/aicurlthread.cpp index 64a6b69fe..0375f8bc3 100644 --- a/indra/llmessage/aicurlthread.cpp +++ b/indra/llmessage/aicurlthread.cpp @@ -1312,7 +1312,7 @@ void AICurlThread::process_commands(AICurlMultiHandle_wat const& multi_handle_w) *command_being_processed_w = command_queue_w->commands.front(); command = command_being_processed_w->command(); } - // Update the size: the number netto number of pending requests in the command queue. + // Update the size: the netto number of pending requests in the command queue. command_queue_w->commands.pop_front(); if (command == cmd_add) { @@ -1340,6 +1340,9 @@ void AICurlThread::process_commands(AICurlMultiHandle_wat const& multi_handle_w) break; case cmd_add: { + // Note: AIPerService::added_to_multi_handle (called from add_easy_request) relies on the fact that + // we first add the easy handle and then remove it from the command queue (which is necessary to + // avoid that another thread adds one just in between). multi_handle_w->add_easy_request(AICurlEasyRequest(command_being_processed_r->easy_request()), false); PerService_wat(*per_service)->removed_from_command_queue(capability_type); break; @@ -1747,10 +1750,12 @@ bool MultiHandle::add_easy_request(AICurlEasyRequest const& easy_request, bool f { bool throttled = true; // Default. AICapabilityType capability_type; + bool event_poll; AIPerServicePtr per_service; { AICurlEasyRequest_wat curl_easy_request_w(*easy_request); capability_type = curl_easy_request_w->capability_type(); + event_poll = curl_easy_request_w->is_event_poll(); per_service = curl_easy_request_w->getPerServicePtr(); if (!from_queue) { @@ -1782,7 +1787,7 @@ bool MultiHandle::add_easy_request(AICurlEasyRequest const& easy_request, bool f curl_easy_request_w->set_timeout_opts(); if (curl_easy_request_w->add_handle_to_multi(curl_easy_request_w, mMultiHandle) == CURLM_OK) { - per_service_w->added_to_multi_handle(capability_type); // (About to be) added to mAddedEasyRequests. + per_service_w->added_to_multi_handle(capability_type, event_poll); // (About to be) added to mAddedEasyRequests. throttled = false; // Fall through... } } @@ -1841,6 +1846,7 @@ CURLMcode MultiHandle::remove_easy_request(addedEasyRequests_type::iterator cons { CURLMcode res; AICapabilityType capability_type; + bool event_poll; AIPerServicePtr per_service; { AICurlEasyRequest_wat curl_easy_request_w(**iter); @@ -1848,8 +1854,9 @@ CURLMcode MultiHandle::remove_easy_request(addedEasyRequests_type::iterator cons bool success = curl_easy_request_w->success(); res = curl_easy_request_w->remove_handle_from_multi(curl_easy_request_w, mMultiHandle); capability_type = curl_easy_request_w->capability_type(); + event_poll = curl_easy_request_w->is_event_poll(); per_service = curl_easy_request_w->getPerServicePtr(); - PerService_wat(*per_service)->removed_from_multi_handle(capability_type, downloaded_something, success); // (About to be) removed from mAddedEasyRequests. + PerService_wat(*per_service)->removed_from_multi_handle(capability_type, event_poll, downloaded_something, success); // (About to be) removed from mAddedEasyRequests. #ifdef SHOW_ASSERT curl_easy_request_w->mRemovedPerCommand = as_per_command; #endif @@ -2062,7 +2069,7 @@ void BufferedCurlEasyRequest::setStatusAndReason(U32 status, std::string const& // Sanity check. If the server replies with a redirect status then we better have that option turned on! if ((status >= 300 && status < 400) && mResponder && !mResponder->redirect_status_ok()) { - llerrs << "Received " << status << " (" << reason << ") for responder \"" << mResponder->getName() << "\" which has no followRedir()!" << llendl; + llerrs << "Received " << status << " (" << reason << ") for responder \"" << mResponder->getName() << "\" which does not allow redirection!" << llendl; } } diff --git a/indra/llmessage/aihttptimeoutpolicy.cpp b/indra/llmessage/aihttptimeoutpolicy.cpp index aaf5bf8e1..019750efc 100644 --- a/indra/llmessage/aihttptimeoutpolicy.cpp +++ b/indra/llmessage/aihttptimeoutpolicy.cpp @@ -922,7 +922,6 @@ P(charactersResponder); P(checkAgentAppearanceServiceResponder); P(classifiedStatsResponder); P(consoleResponder); -P2(crashLoggerResponder, transfer_22s_connect_10s); P(createInventoryCategoryResponder); P(emeraldDicDownloader); P(environmentApplyResponder); @@ -993,4 +992,4 @@ P(webProfileResponders); P(wholeModelFeeResponder); P(wholeModelUploadResponder); P2(XMLRPCResponder, connect_40s); - +P2(crashLoggerResponder, transfer_300s); \ No newline at end of file diff --git a/indra/llmessage/llhost.cpp b/indra/llmessage/llhost.cpp index 61a84de8e..9bf94ef3f 100644 --- a/indra/llmessage/llhost.cpp +++ b/indra/llmessage/llhost.cpp @@ -59,11 +59,12 @@ LLHost::LLHost(const std::string& ip_and_port) mIP = ip_string_to_u32(ip_str.c_str()); mPort = atol(port_str.c_str()); } + mHostNotFound = 0; } std::string LLHost::getString() const { - return llformat("%s:%u", u32_to_ip_string(mIP), mPort); + return llformat("%s:%hu", u32_to_ip_string(mIP), mPort); } @@ -87,16 +88,27 @@ std::string LLHost::getHostName() const llwarns << "LLHost::getHostName() : Invalid IP address" << llendl; return std::string(); } + if (mHostNotFound) + { + // We already checked this... avoid freezing the viewer 5 seconds again and again. + llwarns << "LLHost::getHostName() : Returning cached HOST_NOT_FOUND." << llendl; + return std::string(); + } he = gethostbyaddr((char *)&mIP, sizeof(mIP), AF_INET); if (!he) { #if LL_WINDOWS - llwarns << "LLHost::getHostName() : Couldn't find host name for address " << mIP << ", Error: " - << WSAGetLastError() << llendl; + int err = WSAGetLastError(); + int err_host_not_found = WSAHOST_NOT_FOUND; #else - llwarns << "LLHost::getHostName() : Couldn't find host name for address " << mIP << ", Error: " - << h_errno << llendl; + int err = h_errno; + int err_host_not_found = HOST_NOT_FOUND; #endif + llwarns << "LLHost::getHostName() : Couldn't find host name for address " << mIP << ", Error: " << err << llendl; + if (err == err_host_not_found) + { + mHostNotFound = 1; + } return std::string(); } else @@ -125,6 +137,7 @@ BOOL LLHost::setHostByName(const std::string& hostname) if (he) { mIP = *(U32 *)he->h_addr_list[0]; + mHostNotFound = 0; return TRUE; } else diff --git a/indra/llmessage/llhost.h b/indra/llmessage/llhost.h index 0cf52a415..8d7f6be63 100644 --- a/indra/llmessage/llhost.h +++ b/indra/llmessage/llhost.h @@ -38,7 +38,8 @@ const U32 INVALID_HOST_IP_ADDRESS = 0x0; class LLHost { protected: - U32 mPort; + U16 mPort; + mutable U16 mHostNotFound; // Singularity addition; caches a failed IP -> hostname lookup. U32 mIP; public: @@ -47,17 +48,20 @@ public: // CREATORS LLHost() : mPort(INVALID_PORT), + mHostNotFound(1), mIP(INVALID_HOST_IP_ADDRESS) { } // STL's hash_map expect this T() LLHost( U32 ipv4_addr, U32 port ) - : mPort( port ) + : mPort(port), + mHostNotFound(0) { mIP = ipv4_addr; } LLHost( const std::string& ipv4_addr, U32 port ) - : mPort( port ) + : mPort(port), + mHostNotFound(0) { mIP = ip_string_to_u32(ipv4_addr.c_str()); } @@ -68,6 +72,7 @@ public: U32 port = (U32)(ip_port & (U64)0xFFFFFFFF); mIP = ip; mPort = port; + mHostNotFound = 0; } explicit LLHost(const std::string& ip_and_port); @@ -76,15 +81,15 @@ public: { } // MANIPULATORS - void set( U32 ip, U32 port ) { mIP = ip; mPort = port; } - void set( const std::string& ipstr, U32 port ) { mIP = ip_string_to_u32(ipstr.c_str()); mPort = port; } - void setAddress( const std::string& ipstr ) { mIP = ip_string_to_u32(ipstr.c_str()); } - void setAddress( U32 ip ) { mIP = ip; } + void set( U32 ip, U32 port ) { mIP = ip; mPort = port; mHostNotFound = 0; } + void set( const std::string& ipstr, U32 port ) { mIP = ip_string_to_u32(ipstr.c_str()); mPort = port; mHostNotFound = 0; } + void setAddress( const std::string& ipstr ) { mIP = ip_string_to_u32(ipstr.c_str()); mHostNotFound = 0; } + void setAddress( U32 ip ) { mIP = ip; mHostNotFound = 0; } void setPort( U32 port ) { mPort = port; } BOOL setHostByName(const std::string& hname); LLHost& operator=(const LLHost &rhs); - void invalidate() { mIP = INVALID_HOST_IP_ADDRESS; mPort = INVALID_PORT;}; + void invalidate() { mIP = INVALID_HOST_IP_ADDRESS; mPort = INVALID_PORT; mHostNotFound = 1; } // READERS U32 getAddress() const { return mIP; } diff --git a/indra/llmessage/llhttpclient.h b/indra/llmessage/llhttpclient.h index b4ce6facc..a366811d6 100644 --- a/indra/llmessage/llhttpclient.h +++ b/indra/llmessage/llhttpclient.h @@ -221,12 +221,15 @@ public: // The default is to keep connections open for possible reuse. virtual bool forbidReuse(void) const { return false; } - // A derived class should return true if curl should follow redirections. - // The default is not to follow redirections. - virtual bool followRedir(void) const { return false; } + // A derived class should return true if curl should not follow redirections, but instead pass redirection status codes to the responder. + // The default is to follow redirections and not pass them to the responder. + virtual bool pass_redirect_status(void) const { return false; } // If this function returns false then we generate an error when a redirect status (300..399) is received. - virtual bool redirect_status_ok(void) const { return followRedir(); } + virtual bool redirect_status_ok(void) const { return true; } + + // Overridden by LLEventPollResponder to return true. + virtual bool is_event_poll(void) const { return false; } // Returns the capability type used by this responder. virtual AICapabilityType capability_type(void) const { return cap_other; } @@ -259,7 +262,6 @@ public: class ResponderHeadersOnly : public ResponderBase { private: /*virtual*/ bool needsHeaders(void) const { return true; } - /*virtual*/ bool followRedir(void) const { return true; } protected: // ResponderBase event diff --git a/indra/llmessage/message_prehash.cpp b/indra/llmessage/message_prehash.cpp index e279f781d..8544b37e1 100644 --- a/indra/llmessage/message_prehash.cpp +++ b/indra/llmessage/message_prehash.cpp @@ -37,8 +37,6 @@ F32 const gPrehashVersionNumber = 2.000f; char const* const _PREHASH_X = LLMessageStringTable::getInstance()->getString("X"); char const* const _PREHASH_Y = LLMessageStringTable::getInstance()->getString("Y"); char const* const _PREHASH_Z = LLMessageStringTable::getInstance()->getString("Z"); -char const* const _PREHASH_SizeX = LLMessageStringTable::getInstance()->getString("SizeX"); -char const* const _PREHASH_SizeY = LLMessageStringTable::getInstance()->getString("SizeY"); char const* const _PREHASH_AddFlags = LLMessageStringTable::getInstance()->getString("AddFlags"); char const* const _PREHASH_FailureInfo = LLMessageStringTable::getInstance()->getString("FailureInfo"); char const* const _PREHASH_MapData = LLMessageStringTable::getInstance()->getString("MapData"); @@ -1386,3 +1384,10 @@ char const* const _PREHASH_GroupAVSounds = LLMessageStringTable::getInstance()-> char const* const _PREHASH_AppearanceData = LLMessageStringTable::getInstance()->getString("AppearanceData"); char const* const _PREHASH_AppearanceVersion = LLMessageStringTable::getInstance()->getString("AppearanceVersion"); char const* const _PREHASH_CofVersion = LLMessageStringTable::getInstance()->getString("CofVersion"); + +// Aurora Sim +char const* const _PREHASH_RegionSizeX = LLMessageStringTable::getInstance()->getString("RegionSizeX"); +char const* const _PREHASH_RegionSizeY = LLMessageStringTable::getInstance()->getString("RegionSizeY"); +char const* const _PREHASH_SizeX = LLMessageStringTable::getInstance()->getString("SizeX"); +char const* const _PREHASH_SizeY = LLMessageStringTable::getInstance()->getString("SizeY"); +// Aurora Sim diff --git a/indra/llmessage/message_prehash.h b/indra/llmessage/message_prehash.h index 1c1d6e224..9a11ca02b 100644 --- a/indra/llmessage/message_prehash.h +++ b/indra/llmessage/message_prehash.h @@ -37,8 +37,6 @@ extern F32 const gPrehashVersionNumber; extern char const* const _PREHASH_X; extern char const* const _PREHASH_Y; extern char const* const _PREHASH_Z; -extern char const* const _PREHASH_SizeX; -extern char const* const _PREHASH_SizeY; extern char const* const _PREHASH_AddFlags; extern char const* const _PREHASH_FailureInfo; extern char const* const _PREHASH_MapData; @@ -1386,4 +1384,11 @@ extern char const* const _PREHASH_GroupAVSounds; extern char const* const _PREHASH_AppearanceData; extern char const* const _PREHASH_AppearanceVersion; extern char const* const _PREHASH_CofVersion; + +// Aurora Sim +extern char const* const _PREHASH_RegionSizeX; +extern char const* const _PREHASH_RegionSizeY; +extern char const* const _PREHASH_SizeX; +extern char const* const _PREHASH_SizeY; +// Aurora Sim #endif diff --git a/indra/llmessage/patch_code.cpp b/indra/llmessage/patch_code.cpp index e5d7f1944..3bcd70944 100644 --- a/indra/llmessage/patch_code.cpp +++ b/indra/llmessage/patch_code.cpp @@ -229,7 +229,10 @@ void decode_patch_group_header(LLBitPack &bitpack, LLGroupHeader *gopp) gPatchSize = gopp->patch_size; } -void decode_patch_header(LLBitPack &bitpack, LLPatchHeader *ph) +// Aurora Sim +//void decode_patch_header(LLBitPack &bitpack, LLPatchHeader *ph) +void decode_patch_header(LLBitPack &bitpack, LLPatchHeader *ph, bool b_large_patch) +// Aurora Sim { U8 retvalu8; @@ -268,15 +271,33 @@ void decode_patch_header(LLBitPack &bitpack, LLPatchHeader *ph) #endif ph->range = retvalu16; - retvalu16 = 0; +// Aurora Sim + //retvalu16 = 0; + retvalu32 = 0; #ifdef LL_BIG_ENDIAN - ret = (U8 *)&retvalu16; - bitpack.bitUnpack(&(ret[1]), 8); - bitpack.bitUnpack(&(ret[0]), 2); + //ret = (U8 *)&retvalu16; + ret = (U8*)&retvalu32; +// Aurora Sim + if (b_large_patch) + { + bitpack.bitUnpack(&(ret[3]), 8); + bitpack.bitUnpack(&(ret[2]), 8); + bitpack.bitUnpack(&(ret[1]), 8); + bitpack.bitUnpack(&(ret[0]), 8); + } + else + { + bitpack.bitUnpack(&(ret[1]), 8); + bitpack.bitUnpack(&(ret[0]), 2); + } #else - bitpack.bitUnpack((U8 *)&retvalu16, 10); +// Aurora Sim + //bitpack.bitUnpack((U8 *)&retvalu16, 10); + bitpack.bitUnpack((U8*)&retvalu32, b_large_patch ? 32 : 10); #endif - ph->patchids = retvalu16; + //ph->patchids = retvalu16; + ph->patchids = retvalu32; +// Aurora Sim gWordBits = (ph->quant_wbits & 0xf) + 2; } diff --git a/indra/llmessage/patch_code.h b/indra/llmessage/patch_code.h index 4c87c9808..a3361daf3 100644 --- a/indra/llmessage/patch_code.h +++ b/indra/llmessage/patch_code.h @@ -40,7 +40,10 @@ void end_patch_coding(LLBitPack &bitpack); void init_patch_decoding(LLBitPack &bitpack); void decode_patch_group_header(LLBitPack &bitpack, LLGroupHeader *gopp); -void decode_patch_header(LLBitPack &bitpack, LLPatchHeader *ph); +// Aurora Sim +//void decode_patch_header(LLBitPack &bitpack, LLPatchHeader *ph); +void decode_patch_header(LLBitPack &bitpack, LLPatchHeader *ph, bool b_large_patch = false); +// Aurora Sim void decode_patch(LLBitPack &bitpack, S32 *patches); #endif diff --git a/indra/llmessage/patch_dct.h b/indra/llmessage/patch_dct.h index 101231ec8..d9c3ec7a5 100644 --- a/indra/llmessage/patch_dct.h +++ b/indra/llmessage/patch_dct.h @@ -73,7 +73,10 @@ public: F32 dc_offset; // 4 bytes U16 range; // 2 = 7 ((S16) FP range (breaks if we need > 32K meters in 1 patch) U8 quant_wbits; // 1 = 8 (upper 4 bits is quant - 2, lower 4 bits is word bits - 2) - U16 patchids; // 2 = 10 (actually only uses 10 bits, 5 for each) +// Aurora Sim + //U16 patchids; // 2 = 10 (actually only uses 10 bits, 5 for each) + U32 patchids; +// Aurora Sim }; // Compression routines diff --git a/indra/llplugin/slplugin/slplugin.cpp b/indra/llplugin/slplugin/slplugin.cpp index 7b894c457..1c11b30e1 100644 --- a/indra/llplugin/slplugin/slplugin.cpp +++ b/indra/llplugin/slplugin/slplugin.cpp @@ -174,6 +174,8 @@ bool checkExceptionHandler() } #endif +bool self_test = false; + // If this application on Windows platform is a console application, a console is always // created which is bad. Making it a Windows "application" via CMake settings but not // adding any code to explicitly create windows does the right thing. @@ -220,21 +222,29 @@ int main(int argc, char **argv) LL_ERRS("slplugin") << "usage: " << argv[0] << " launcher_port" << LL_ENDL; } - U32 port = 0; - if(!LLStringUtil::convertToU32(argv[1], port)) + U32 port = 61916; // Test port. + if (strcmp(argv[1], "TESTPLUGIN") == 0) + { + std::cout << "Running self test..." << std::endl; + self_test = true; + } + else if (!LLStringUtil::convertToU32(argv[1], port)) { LL_ERRS("slplugin") << "port number must be numeric" << LL_ENDL; } - // Catch signals that most kinds of crashes will generate, and exit cleanly so the system crash dialog isn't shown. - signal(SIGILL, &crash_handler); // illegal instruction + if (!self_test) + { + // Catch signals that most kinds of crashes will generate, and exit cleanly so the system crash dialog isn't shown. + signal(SIGILL, &crash_handler); // illegal instruction # if LL_DARWIN - signal(SIGEMT, &crash_handler); // emulate instruction executed + signal(SIGEMT, &crash_handler); // emulate instruction executed # endif // LL_DARWIN - signal(SIGFPE, &crash_handler); // floating-point exception - signal(SIGBUS, &crash_handler); // bus error - signal(SIGSEGV, &crash_handler); // segmentation violation - signal(SIGSYS, &crash_handler); // non-existent system call invoked + signal(SIGFPE, &crash_handler); // floating-point exception + signal(SIGBUS, &crash_handler); // bus error + signal(SIGSEGV, &crash_handler); // segmentation violation + signal(SIGSYS, &crash_handler); // non-existent system call invoked + } #endif #if LL_DARWIN @@ -247,7 +257,7 @@ int main(int argc, char **argv) plugin->init(port); #if LL_DARWIN - deleteAutoReleasePool(); + deleteAutoReleasePool(); #endif LLTimer timer; diff --git a/indra/llprimitive/llmodel.cpp b/indra/llprimitive/llmodel.cpp index 653b0f5cb..7312209da 100644 --- a/indra/llprimitive/llmodel.cpp +++ b/indra/llprimitive/llmodel.cpp @@ -630,25 +630,41 @@ LLModel::EModelStatus load_face_from_dom_polygons(std::vector& fac if (v) { U32 v_idx = idx[j*stride+v_offset]*3; + v_idx = llclamp(v_idx, (U32) 0, (U32) v->getCount()); vert.getPosition().set(v->get(v_idx), v->get(v_idx+1), v->get(v_idx+2)); } - if (n) + //bounds check n and t lookups because some FBX to DAE converters + //use negative indices and empty arrays to indicate data does not exist + //for a particular channel + if (n && n->getCount() > 0) { U32 n_idx = idx[j*stride+n_offset]*3; + n_idx = llclamp(n_idx, (U32) 0, (U32) n->getCount()); vert.getNormal().set(n->get(n_idx), n->get(n_idx+1), n->get(n_idx+2)); } + else + { + vert.getNormal().clear(); + } - if (t) + + if (t && t->getCount() > 0) { U32 t_idx = idx[j*stride+t_offset]*2; + t_idx = llclamp(t_idx, (U32) 0, (U32) t->getCount()); vert.mTexCoord.setVec(t->get(t_idx), t->get(t_idx+1)); } + else + { + vert.mTexCoord.clear(); + } + verts.push_back(vert); } diff --git a/indra/llrender/llimagegl.cpp b/indra/llrender/llimagegl.cpp index 3bccad5e3..9dddf8b38 100644 --- a/indra/llrender/llimagegl.cpp +++ b/indra/llrender/llimagegl.cpp @@ -565,7 +565,7 @@ void LLImageGL::setSize(S32 width, S32 height, S32 ncomponents, S32 discard_leve // Check if dimensions are a power of two! if (!checkSize(width,height)) { - llerrs << llformat("Texture has non power of two dimension: %dx%d",width,height) << llendl; + llwarns << llformat("Texture has non power of two dimension: %dx%d",width,height) << " Unless on Aurora-Sim, beware." << llendl; } if (mTexName) diff --git a/indra/llrender/llshadermgr.cpp b/indra/llrender/llshadermgr.cpp index b3e9b55c9..006e0e4c9 100644 --- a/indra/llrender/llshadermgr.cpp +++ b/indra/llrender/llshadermgr.cpp @@ -56,14 +56,7 @@ LLShaderMgr::LLShaderMgr() { { const std::string dumpdir = gDirUtilp->getExpandedFilename(LL_PATH_LOGS,"shader_dump")+gDirUtilp->getDirDelimiter(); - try - { - boost::filesystem::remove_all(dumpdir); - } - catch(const boost::filesystem::filesystem_error& e) - { - llinfos << "boost::filesystem::remove_all(\""+dumpdir+"\") failed: '" + e.code().message() + "'" << llendl; - } + gDirUtilp->deleteDirAndContents(dumpdir); } } diff --git a/indra/llui/llfloater.h b/indra/llui/llfloater.h index bd826a936..0aeb11501 100644 --- a/indra/llui/llfloater.h +++ b/indra/llui/llfloater.h @@ -218,7 +218,6 @@ public: virtual BOOL canSaveAs() const { return FALSE; } virtual void saveAs() {} - virtual void saveAsType(BOOL type=false) {} void setSnapTarget(LLHandle handle) { mSnappedTo = handle; } void clearSnapTarget() { mSnappedTo.markDead(); } diff --git a/indra/llui/lllineeditor.cpp b/indra/llui/lllineeditor.cpp index 15b387cbc..79ccb6469 100644 --- a/indra/llui/lllineeditor.cpp +++ b/indra/llui/lllineeditor.cpp @@ -860,6 +860,32 @@ void LLLineEditor::removeChar() } } +// Remove a word (set of characters up to next space/punctuation) from the text +void LLLineEditor::removeWord(bool prev) +{ + const U32 pos(getCursor()); + if (prev ? pos > 0 : static_cast(pos) < getLength()) + { + U32 new_pos(prev ? prevWordPos(pos) : nextWordPos(pos)); + if (new_pos == pos) // Other character we don't jump over + new_pos = prev ? prevWordPos(new_pos-1) : nextWordPos(new_pos+1); + + const U32 diff(labs(pos - new_pos)); + if (prev) + { + mText.erase(new_pos, diff); + setCursor(new_pos); + } + else + { + mText.erase(pos, diff); + } + } + else + { + reportBadKeystroke(); + } +} void LLLineEditor::addChar(const llwchar uni_char) { @@ -1318,7 +1344,10 @@ BOOL LLLineEditor::handleSpecialKey(KEY key, MASK mask) else if( 0 < getCursor() ) { - removeChar(); + if (mask == MASK_CONTROL) + removeWord(true); + else + removeChar(); } else { @@ -1328,6 +1357,14 @@ BOOL LLLineEditor::handleSpecialKey(KEY key, MASK mask) handled = TRUE; break; + case KEY_DELETE: + if (!mReadOnly && mask == MASK_CONTROL) + { + removeWord(false); + handled = true; + } + break; + case KEY_PAGE_UP: case KEY_HOME: if (!mIgnoreArrowKeys) diff --git a/indra/llui/lllineeditor.h b/indra/llui/lllineeditor.h index c665ad96c..bc6df16f3 100644 --- a/indra/llui/lllineeditor.h +++ b/indra/llui/lllineeditor.h @@ -266,6 +266,7 @@ private: void pasteHelper(bool is_primary); void removeChar(); + void removeWord(bool prev); void addChar(const llwchar c); void setCursorAtLocalPos(S32 local_mouse_x); S32 calculateCursorFromMouse(S32 local_mouse_x); diff --git a/indra/llui/llscrolllistcell.cpp b/indra/llui/llscrolllistcell.cpp index 83479888f..dba472842 100644 --- a/indra/llui/llscrolllistcell.cpp +++ b/indra/llui/llscrolllistcell.cpp @@ -174,7 +174,7 @@ U32 LLScrollListText::sCount = 0; LLScrollListText::LLScrollListText(const LLScrollListCell::Params& p) : LLScrollListCell(p), mText(p.value().asString()), - mFont(p.font.isProvided() ? LLResMgr::getInstance()->getRes(p.font) : LLFontGL::getFontSansSerifSmall()), + mFont(LLFontGL::getFontSansSerifSmall()), mColor(p.color), mUseColor(p.color.isProvided()), mFontStyle(LLFontGL::getStyleFromString(p.font_style)), @@ -187,6 +187,19 @@ LLScrollListText::LLScrollListText(const LLScrollListCell::Params& p) mTextWidth = getWidth(); + if (p.font.isProvided()) + { + if (const LLFontGL* font = LLResMgr::getInstance()->getRes(p.font)) // Common CAPITALIZED font name? + mFont = font; + else // Less common camelCase font? + { + LLFontDescriptor font_desc; + font_desc.setName(p.font); + if (const LLFontGL* font = LLFontGL::getFont(font_desc)) + mFont = font; + } + } + // initialize rounded rect image if (!mRoundedRectImage) { @@ -225,8 +238,11 @@ BOOL LLScrollListText::needsToolTip() const if (LLScrollListCell::needsToolTip()) return LLScrollListCell::needsToolTip(); + /* Singu Note: To maintain legacy behavior, show tooltips for any text // ...otherwise, show tooltips for truncated text return mFont->getWidth(mText.getString()) > getWidth(); + */ + return !mText.empty(); } //virtual @@ -422,13 +438,14 @@ void LLScrollListCheck::setEnabled(BOOL enable) LLScrollListDate::LLScrollListDate( const LLScrollListCell::Params& p) : LLScrollListText(p), + mFormat(p.format), mDate(p.value().asDate()) {} void LLScrollListDate::setValue(const LLSD& value) { mDate = value.asDate(); - LLScrollListText::setValue(mDate.asRFC1123()); + LLScrollListText::setValue(mFormat.empty() ? mDate.asRFC1123() : mDate.toHTTPDateString(mFormat)); } const LLSD LLScrollListDate::getValue() const diff --git a/indra/llui/llscrolllistcell.h b/indra/llui/llscrolllistcell.h index 3e4a9cd06..84c196a05 100644 --- a/indra/llui/llscrolllistcell.h +++ b/indra/llui/llscrolllistcell.h @@ -61,6 +61,7 @@ public: Optional userdata; Optional value; Optional tool_tip; + Optional format; Optional font; Optional font_color; @@ -77,6 +78,7 @@ public: visible("visible", true), value("value"), tool_tip("tool_tip", ""), + format("format", ""), font("font"/*, LLFontGL::getFontSansSerifSmall()*/), font_color("font_color", LLColor4::black), font_style("font-style"), @@ -230,6 +232,7 @@ public: virtual const LLSD getValue() const; private: + std::string mFormat; LLDate mDate; }; diff --git a/indra/llui/lltexteditor.cpp b/indra/llui/lltexteditor.cpp index e6049f843..4a65879f8 100644 --- a/indra/llui/lltexteditor.cpp +++ b/indra/llui/lltexteditor.cpp @@ -1814,6 +1814,33 @@ void LLTextEditor::removeChar() } } +// Remove a word (set of characters up to next space/punctuation) from the text +void LLTextEditor::removeWord(bool prev) +{ + const U32 pos(mCursorPos); + if (prev ? pos > 0 : static_cast(pos) < getLength()) + { + U32 new_pos(prev ? prevWordPos(pos) : nextWordPos(pos)); + if (new_pos == pos) // Other character we don't jump over + new_pos = prev ? prevWordPos(new_pos-1) : nextWordPos(new_pos+1); + + const U32 diff(labs(pos - new_pos)); + if (prev) + { + remove(new_pos, diff, false); + setCursorPos(new_pos); + } + else + { + remove(pos, diff, false); + } + } + else + { + reportBadKeystroke(); + } +} + // Add a single character to the text S32 LLTextEditor::addChar(S32 pos, llwchar wc) { @@ -2447,7 +2474,10 @@ BOOL LLTextEditor::handleSpecialKey(const KEY key, const MASK mask, BOOL* return else if( 0 < mCursorPos ) { - removeCharOrTab(); + if (mask == MASK_CONTROL) + removeWord(true); + else + removeCharOrTab(); } else { @@ -2455,6 +2485,12 @@ BOOL LLTextEditor::handleSpecialKey(const KEY key, const MASK mask, BOOL* return } break; + case KEY_DELETE: + if (getEnabled() && mask == MASK_CONTROL) + { + removeWord(false); + } + break; case KEY_RETURN: if (mask == MASK_NONE) diff --git a/indra/llui/lltexteditor.h b/indra/llui/lltexteditor.h index 51300450d..6016b7e94 100644 --- a/indra/llui/lltexteditor.h +++ b/indra/llui/lltexteditor.h @@ -408,6 +408,7 @@ protected: S32 overwriteChar(S32 pos, llwchar wc); void removeChar(); S32 removeChar(S32 pos); + void removeWord(bool prev); S32 insert(const S32 pos, const LLWString &wstr, const BOOL group_with_next_op); S32 remove(const S32 pos, const S32 length, const BOOL group_with_next_op); S32 append(const LLWString &wstr, const BOOL group_with_next_op); diff --git a/indra/llvfs/lldir.cpp b/indra/llvfs/lldir.cpp index d2d5fa585..a93c833ba 100644 --- a/indra/llvfs/lldir.cpp +++ b/indra/llvfs/lldir.cpp @@ -1,3 +1,4 @@ + /** * @file lldir.cpp * @brief implementation of directory utilities base class @@ -42,6 +43,7 @@ #include "lldiriterator.h" #include "stringize.h" +#include #include #include #include @@ -69,6 +71,8 @@ LLDir_Linux gDirUtil; LLDir *gDirUtilp = (LLDir *)&gDirUtil; +static const char* const empty = ""; +std::string LLDir::sDumpDir = ""; LLDir::LLDir() : mAppName(""), mExecutablePathAndName(""), @@ -89,7 +93,32 @@ LLDir::~LLDir() { } - +std::vector LLDir::getFilesInDir(const std::string &dirname) +{ + //Returns a vector of fullpath filenames. + + boost::filesystem::path p (dirname); + std::vector v; + + if (exists(p)) + { + if (is_directory(p)) + { + boost::filesystem::directory_iterator end_iter; + for (boost::filesystem::directory_iterator dir_itr(p); + dir_itr != end_iter; + ++dir_itr) + { + if (boost::filesystem::is_regular_file(dir_itr->status())) + { + v.push_back(dir_itr->path().filename().string()); + } + } + } + } + return v; +} + S32 LLDir::deleteFilesInDir(const std::string &dirname, const std::string &mask) { S32 count = 0; @@ -104,50 +133,76 @@ S32 LLDir::deleteFilesInDir(const std::string &dirname, const std::string &mask) llassert(!"Invalid file mask"); } - LLDirIterator iter(dirname, mask); - while (iter.next(filename)) + try { - fullpath = add(dirname, filename); - - if(LLFile::isdir(fullpath)) + LLDirIterator iter(dirname, mask); + while (iter.next(filename)) { - // skipping directory traversal filenames - count++; - continue; - } + fullpath = add(dirname, filename); - S32 retry_count = 0; - while (retry_count < 5) - { - if (0 != LLFile::remove(fullpath)) + if(LLFile::isdir(fullpath)) { - retry_count++; - result = errno; - llwarns << "Problem removing " << fullpath << " - errorcode: " + // skipping directory traversal filenames + count++; + continue; + } + + S32 retry_count = 0; + while (retry_count < 5) + { + if (0 != LLFile::remove(fullpath)) + { + retry_count++; + result = errno; + llwarns << "Problem removing " << fullpath << " - errorcode: " << result << " attempt " << retry_count << llendl; - if(retry_count >= 5) - { - llwarns << "Failed to remove " << fullpath << llendl ; - return count ; - } + if(retry_count >= 5) + { + llwarns << "Failed to remove " << fullpath << llendl ; + return count ; + } - ms_sleep(100); - } - else - { - if (retry_count) - { - llwarns << "Successfully removed " << fullpath << llendl; + ms_sleep(100); } - break; - } + else + { + if (retry_count) + { + llwarns << "Successfully removed " << fullpath << llendl; + } + break; + } + } + count++; } - count++; } + catch(...) + { + llwarns << "Unable to remove some files from " + dirname << llendl; + } + return count; } +U32 LLDir::deleteDirAndContents(const std::string& dir_name) +{ + //Removes the directory and its contents. Returns number of files removed. + // Singu Note: boost::filesystem throws exceptions + S32 res = 0; + + try + { + res = boost::filesystem::remove_all(dir_name); + } + catch(const boost::filesystem::filesystem_error& e) + { + llwarns << "boost::filesystem::remove_all(\"" + dir_name + "\") failed: '" + e.code().message() + "'" << llendl; + } + + return res; +} + const std::string LLDir::findFile(const std::string &filename, const std::string& searchPath1, const std::string& searchPath2, @@ -235,6 +290,34 @@ const std::string &LLDir::getChatLogsDir() const return mChatLogsDir; } +void LLDir::setDumpDir( const std::string& path ) +{ + LLDir::sDumpDir = path; + if (! sDumpDir.empty() && sDumpDir.rbegin() == mDirDelimiter.rbegin() ) + { + sDumpDir.erase(sDumpDir.size() -1); + } +} + +const std::string &LLDir::getDumpDir() const +{ + if (sDumpDir.empty() ) + { + /* Singu Note: don't generate a different dump dir each time + LLUUID uid; + uid.generate(); + + sDumpDir = gDirUtilp->getExpandedFilename(LL_PATH_LOGS, "") + + "dump-" + uid.asString(); + */ + + sDumpDir = gDirUtilp->getExpandedFilename(LL_PATH_LOGS, "") + "singularity-debug"; + dir_exists_or_crash(sDumpDir); + } + + return LLDir::sDumpDir; +} + const std::string &LLDir::getPerAccountChatLogsDir() const { return mPerAccountChatLogsDir; @@ -396,12 +479,29 @@ std::string LLDir::getExpandedFilename(ELLPath location, const std::string& subd prefix = getCacheDir(); break; + case LL_PATH_DUMP: + prefix=getDumpDir(); + break; + case LL_PATH_USER_SETTINGS: prefix = add(getOSUserAppDir(), "user_settings"); break; case LL_PATH_PER_SL_ACCOUNT: prefix = getLindenUserDir(); + if (prefix.empty()) + { + // if we're asking for the per-SL-account directory but we haven't + // logged in yet (or otherwise don't know the account name from + // which to build this string), then intentionally return a blank + // string to the caller and skip the below warning about a blank + // prefix. + LL_DEBUGS("LLDir") << "getLindenUserDir() not yet set: " + << ELLPathToString(location) + << ", '" << subdir1 << "', '" << subdir2 << "', '" << in_filename + << "' => ''" << LL_ENDL; + return std::string(); + } break; case LL_PATH_CHAT_LOGS: diff --git a/indra/llvfs/lldir.h b/indra/llvfs/lldir.h index 23f84bb41..5058b5479 100644 --- a/indra/llvfs/lldir.h +++ b/indra/llvfs/lldir.h @@ -53,6 +53,7 @@ typedef enum ELLPath LL_PATH_EXECUTABLE = 16, LL_PATH_DEFAULT_SKIN = 17, LL_PATH_FONTS = 18, + LL_PATH_DUMP = 19, LL_PATH_LAST } ELLPath; @@ -71,7 +72,8 @@ class LLDir const std::string& app_read_only_data_dir = "") = 0; virtual S32 deleteFilesInDir(const std::string &dirname, const std::string &mask); - + U32 deleteDirAndContents(const std::string& dir_name); + std::vector getFilesInDir(const std::string &dirname); // pure virtual functions virtual U32 countFilesInDir(const std::string &dirname, const std::string &mask) = 0; @@ -94,6 +96,7 @@ class LLDir const std::string &getOSUserAppDir() const; // Location of the os-specific user app dir const std::string &getLindenUserDir(bool empty_ok = false) const; // Location of the Linden user dir. const std::string &getChatLogsDir() const; // Location of the chat logs dir. + const std::string &getDumpDir() const; // Location of the per-run dump dir. const std::string &getPerAccountChatLogsDir() const; // Location of the per account chat logs dir. const std::string &getTempDir() const; // Common temporary directory const std::string getCacheDir(bool get_default = false) const; // Location of the cache. @@ -128,6 +131,7 @@ class LLDir // For producing safe download file names from potentially unsafe ones static std::string getScrubbedFileName(const std::string uncleanFileName); static std::string getForbiddenFileChars(); + void setDumpDir( const std::string& path ); virtual void setChatLogsDir(const std::string &path); // Set the chat logs dir to this user's dir virtual void setPerAccountChatLogsDir(const std::string &grid, const std::string &first, const std::string &last); // Set the per user chat log directory. @@ -173,6 +177,7 @@ protected: std::string mDefaultSkinDir; // Location for default skin info. std::string mUserSkinDir; // Location for user-modified skin info. std::string mLLPluginDir; // Location for plugins and plugin shell + static std::string sDumpDir; // Per-run crash report subdir of log directory. }; void dir_exists_or_crash(const std::string &dir_name); diff --git a/indra/llwindow/glh/glh_linear.h b/indra/llwindow/glh/glh_linear.h index 04ae1bd06..c46b81531 100644 --- a/indra/llwindow/glh/glh_linear.h +++ b/indra/llwindow/glh/glh_linear.h @@ -71,10 +71,10 @@ glh_linear.h #define GLH_EPSILON GLH_REAL(10e-6) #define GLH_PI GLH_REAL(3.1415926535897932384626433832795) -#define equivalent(a,b) (((a < b + GLH_EPSILON) && (a > b - GLH_EPSILON)) ? true : false) namespace glh { + inline bool equivalent(GLH_REAL a, GLH_REAL b) { return b - GLH_EPSILON < a && a < b + GLH_EPSILON; } inline GLH_REAL to_degrees(GLH_REAL radians) { return radians*GLH_RAD_TO_DEG; } inline GLH_REAL to_radians(GLH_REAL degrees) { return degrees*GLH_DEG_TO_RAD; } diff --git a/indra/llwindow/llwindowsdl.cpp b/indra/llwindow/llwindowsdl.cpp index e1fa498fa..10bcf816a 100644 --- a/indra/llwindow/llwindowsdl.cpp +++ b/indra/llwindow/llwindowsdl.cpp @@ -75,6 +75,9 @@ static bool ATIbug = false; #if LL_X11 # include +#include +#include +#include #endif //LL_X11 // TOFU HACK -- (*exactly* the same hack as LLWindowMacOSX for a similar @@ -270,57 +273,41 @@ static SDL_Surface *Load_BMP_Resource(const char *basename) } #if LL_X11 -// This is an XFree86/XOrg-specific hack for detecting the amount of Video RAM -// on this machine. It works by searching /var/log/var/log/Xorg.?.log or -// /var/log/XFree86.?.log for a ': (VideoRAM ?|Memory): (%d+) kB' regex, where -// '?' is the X11 display number derived from $DISPLAY -static int x11_detect_VRAM_kb_fp(FILE *fp, const char *prefix_str) -{ - const int line_buf_size = 1000; - char line_buf[line_buf_size]; - while (fgets(line_buf, line_buf_size, fp)) - { - //lldebugs << "XLOG: " << line_buf << llendl; - - // Why the ad-hoc parser instead of using a regex? Our - // favourite regex implementation - libboost_regex - is - // quite a heavy and troublesome dependency for the client, so - // it seems a shame to introduce it for such a simple task. - // *FIXME: libboost_regex is a dependency now anyway, so we may - // as well use it instead of this hand-rolled nonsense. - const char *part1_template = prefix_str; - const char part2_template[] = " kB"; - char *part1 = strstr(line_buf, part1_template); - if (part1) // found start of matching line - { - part1 = &part1[strlen(part1_template)]; // -> after - char *part2 = strstr(part1, part2_template); - if (part2) // found end of matching line - { - // now everything between part1 and part2 is - // supposed to be numeric, describing the - // number of kB of Video RAM supported - int rtn = 0; - for (; part1 < part2; ++part1) - { - if (*part1 < '0' || *part1 > '9') - { - // unexpected char, abort parse - rtn = 0; - break; - } - rtn *= 10; - rtn += (*part1) - '0'; - } - if (rtn > 0) - { - // got the kB number. return it now. - return rtn; - } - } - } - } - return 0; // 'could not detect' +// This function scrapes the Xorg log to determine the amount of VRAM available to the system. +// Believe it or not, this is the most reliable way at present to detect VRAM on Linux (until +// some angelic being ports the whole viewer to SDL 2.0 or something). +// +// Returns -1 if it couldn't open the file, +// 0 if it could open the file but couldn't detect the amount of VRAM, or +// >0 if it open the file and detect the amount of VRAM present. +// In that case, the number will be the amount of available VRAM in kilobytes. +// +// +static int x11_detect_VRAM_kb_br(std::string filename) { + boost::regex pattern(".*?(VRAM|Memory|Video\\s?RAM)\\D*(\\d+)\\s?([kK]B?)"); + std::string line; + std::ifstream in(filename.c_str()); + int matched = -1; + if(in.is_open()) { + matched = 0; + while (getline(in, line)) + { + // lldebugs << "Processing line: " << line << llendl; + boost::cmatch match; + if(boost::regex_search(line.c_str(), match, pattern)) + { + matched = atoi(std::string(match[2]).c_str()); + lldebugs << "VRAM found: " << matched << llendl; + lldebugs << "Line matched: " << line << llendl; + } + } + in.close(); + } + else // We couldn't open the file, so bow out. + { + lldebugs << "Couldn't open logfile " << filename << llendl; + } + return matched; } static int x11_detect_VRAM_kb() @@ -335,9 +322,16 @@ static int x11_detect_VRAM_kb() std::string fname; int rtn = 0; // 'could not detect' int display_num = 0; - FILE *fp; - char *display_env = getenv("DISPLAY"); // e.g. :0 or :0.0 or :1.0 etc - // parse DISPLAY number so we can go grab the right log file + char *display_env = getenv("VGL_DISPLAY"); // e.g. :0 or :0.0 or :1.0 etc + // We parse $VGL_DISPLAY first so we can grab the right Xorg filename + // if we're using VirtualGL (like Optimus systems do). + + if (display_env == NULL) { + // if $VGL_DISPLAY doesn't exist, then we're in a single-card setup + display_env = getenv("DISPLAY"); + } + + // parse display number so we can go grab the right log file if (display_env[0] == ':' && display_env[1] >= '0' && display_env[1] <= '9') { @@ -345,40 +339,16 @@ static int x11_detect_VRAM_kb() } // *TODO: we could be smarter and see which of Xorg/XFree86 has the - // freshest time-stamp. + // freshest time-stamp. (...but would it work with VirtualGL?) // Try Xorg log first fname = x_log_location; fname += "Xorg."; fname += ('0' + display_num); fname += ".log"; - fp = fopen(fname.c_str(), "r"); - if (fp) - { - llinfos << "Looking in " << fname - << " for VRAM info..." << llendl; - rtn = x11_detect_VRAM_kb_fp(fp, ": VideoRAM: "); - fclose(fp); - if (0 == rtn) - { - fp = fopen(fname.c_str(), "r"); - if (fp) - { - rtn = x11_detect_VRAM_kb_fp(fp, ": Video RAM: "); - fclose(fp); - if (0 == rtn) - { - fp = fopen(fname.c_str(), "r"); - if (fp) - { - rtn = x11_detect_VRAM_kb_fp(fp, ": Memory: "); - fclose(fp); - } - } - } - } - } - else + llinfos << "Looking in " << fname << " for VRAM info..." << llendl; + rtn = x11_detect_VRAM_kb_br(fname); + if(rtn == -1) // we couldn't read the Xorg file { llinfos << "Could not open " << fname << " - skipped." << llendl; @@ -387,29 +357,17 @@ static int x11_detect_VRAM_kb() fname += "XFree86."; fname += ('0' + display_num); fname += ".log"; - fp = fopen(fname.c_str(), "r"); - if (fp) - { - llinfos << "Looking in " << fname - << " for VRAM info..." << llendl; - rtn = x11_detect_VRAM_kb_fp(fp, ": VideoRAM: "); - fclose(fp); - if (0 == rtn) - { - fp = fopen(fname.c_str(), "r"); - if (fp) - { - rtn = x11_detect_VRAM_kb_fp(fp, ": Memory: "); - fclose(fp); - } - } - } - else + llinfos << "Looking in " << fname << " for VRAM info..." << llendl; + rtn = x11_detect_VRAM_kb_br(fname); + if(rtn == -1) // couldn't read old X log file either { llinfos << "Could not open " << fname << " - skipped." << llendl; + //stumped here, return 0 + rtn = 0; } } + llinfos << "Amount of VRAM detected: "<< rtn << " KB" << llendl; return rtn; #endif // LL_SOLARIS } diff --git a/indra/mac_crash_logger/CMakeLists.txt b/indra/mac_crash_logger/CMakeLists.txt deleted file mode 100644 index daf3e1085..000000000 --- a/indra/mac_crash_logger/CMakeLists.txt +++ /dev/null @@ -1,76 +0,0 @@ -# -*- cmake -*- - -project(mac_crash_logger) - -include(00-Common) -include(LLCommon) -include(LLCrashLogger) -include(LLMath) -include(LLMessage) -include(LLVFS) -include(LLXML) -include(Linking) - -include_directories( - ${LLCOMMON_INCLUDE_DIRS} - ${LLCRASHLOGGER_INCLUDE_DIRS} - ${LLMATH_INCLUDE_DIRS} - ${LLVFS_INCLUDE_DIRS} - ${LLXML_INCLUDE_DIRS} - ) - -set(mac_crash_logger_SOURCE_FILES - mac_crash_logger.cpp - llcrashloggermac.cpp - ) - -set(mac_crash_logger_HEADER_FILES - CMakeLists.txt - - llcrashloggermac.h - ) - -set_source_files_properties(${mac_crash_logger_HEADER_FILES} - PROPERTIES HEADER_FILE_ONLY TRUE) -list(APPEND mac_crash_logger_SOURCE_FILES ${mac_crash_logger_HEADER_FILES}) - -set(mac_crash_logger_RESOURCE_FILES - CrashReporter.nib/ - ) -set_source_files_properties( - ${mac_crash_logger_RESOURCE_FILES} - PROPERTIES - HEADER_FILE_ONLY TRUE - ) -SOURCE_GROUP("Resources" FILES ${mac_crash_logger_RESOURCE_FILES}) -list(APPEND mac_crash_logger_SOURCE_FILES ${mac_crash_logger_RESOURCE_FILES}) - -add_executable(mac-crash-logger - MACOSX_BUNDLE - ${mac_crash_logger_SOURCE_FILES}) - -set_target_properties(mac-crash-logger - PROPERTIES - MACOSX_BUNDLE_INFO_PLIST ${CMAKE_CURRENT_SOURCE_DIR}/Info.plist - ) - -target_link_libraries(mac-crash-logger - ${LLCRASHLOGGER_LIBRARIES} - ${LLVFS_LIBRARIES} - ${LLXML_LIBRARIES} - ${LLMESSAGE_LIBRARIES} - ${LLVFS_LIBRARIES} - ${LLMATH_LIBRARIES} - ${LLCOMMON_LIBRARIES} - ) - -add_custom_command( - TARGET mac-crash-logger POST_BUILD - COMMAND ${CMAKE_COMMAND} - ARGS - -E - copy_directory - ${CMAKE_CURRENT_SOURCE_DIR}/CrashReporter.nib - ${CMAKE_CURRENT_BINARY_DIR}/${CMAKE_CFG_INTDIR}/mac-crash-logger.app/Contents/Resources/CrashReporter.nib - ) - diff --git a/indra/mac_crash_logger/CrashReporter.nib/classes.nib b/indra/mac_crash_logger/CrashReporter.nib/classes.nib deleted file mode 100644 index c4b887e72..000000000 --- a/indra/mac_crash_logger/CrashReporter.nib/classes.nib +++ /dev/null @@ -1,8 +0,0 @@ - - - - - IBVersion - 1 - - diff --git a/indra/mac_crash_logger/CrashReporter.nib/info.nib b/indra/mac_crash_logger/CrashReporter.nib/info.nib deleted file mode 100644 index 06805c0e4..000000000 --- a/indra/mac_crash_logger/CrashReporter.nib/info.nib +++ /dev/null @@ -1,18 +0,0 @@ - - - - - IBFramework Version - 629 - IBLastKnownRelativeProjectPath - ../../build-darwin-i386/SecondLife.xcodeproj - IBOldestOS - 5 - IBOpenObjects - - IBSystem Version - 9E17 - targetFramework - IBCarbonFramework - - diff --git a/indra/mac_crash_logger/CrashReporter.nib/objects.xib b/indra/mac_crash_logger/CrashReporter.nib/objects.xib deleted file mode 100644 index 634d1c532..000000000 --- a/indra/mac_crash_logger/CrashReporter.nib/objects.xib +++ /dev/null @@ -1,68 +0,0 @@ - - - - - - - ok - Send Report - 414 273 434 378 - - - not! - 2 - Don't Send - 414 390 434 487 - - - Second Life appears to have crashed or frozen the last time it ran. This crash reporter collects information about your computer's hardware configuration, operating system, and some Second Life logs, all of which are used for debugging purposes only. In the space below, please briefly describe what you were doing or trying to do just prior to the crash. Thank you for your help! This report is NOT read by Customer Support. If you have billing or other questions, please go to: http://www.secondlife.com/support/ If you don't wish to send Linden Lab a crash report, press Cancel. - 20 20 231 487 - - - 2 - 3 - 7 - Second Life Crash Logger - - - - - - - text - TRUE - 242 23 391 484 - - - remb - Remember This Choice - 415 20 433 186 - - - 0 0 454 507 - - 257 653 711 1160 - 0 0 768 1024 - - - - - - - - - - - - - - - - CrashReporter - - File's Owner - - - IBCarbonFramework - 194 - diff --git a/indra/mac_crash_logger/Info.plist b/indra/mac_crash_logger/Info.plist deleted file mode 100644 index f48293e82..000000000 --- a/indra/mac_crash_logger/Info.plist +++ /dev/null @@ -1,26 +0,0 @@ - - - - - CFBundleDevelopmentRegion - English - CFBundleExecutable - mac-crash-logger - CFBundleGetInfoString - - CFBundleIconFile - - CFBundleIdentifier - com.secondlife.indra.crashreporter - CFBundleInfoDictionaryVersion - 6.0 - CFBundlePackageType - APPL - CFBundleShortVersionString - - CFBundleSignature - ???? - CFBundleVersion - 1.0.0 - - diff --git a/indra/mac_crash_logger/llcrashloggermac.cpp b/indra/mac_crash_logger/llcrashloggermac.cpp deleted file mode 100644 index 16efa4fe2..000000000 --- a/indra/mac_crash_logger/llcrashloggermac.cpp +++ /dev/null @@ -1,345 +0,0 @@ -/** - * @file llcrashloggermac.cpp - * @brief Mac OSX crash logger implementation - * - * $LicenseInfo:firstyear=2003&license=viewergpl$ - * - * Copyright (c) 2003-2009, Linden Research, Inc. - * - * Second Life Viewer Source Code - * The source code in this file ("Source Code") is provided by Linden Lab - * to you under the terms of the GNU General Public License, version 2.0 - * ("GPL"), unless you have obtained a separate licensing agreement - * ("Other License"), formally executed by you and Linden Lab. Terms of - * the GPL can be found in doc/GPL-license.txt in this distribution, or - * online at http://secondlifegrid.net/programs/open_source/licensing/gplv2 - * - * There are special exceptions to the terms and conditions of the GPL as - * it is applied to this Source Code. View the full text of the exception - * in the file doc/FLOSS-exception.txt in this software distribution, or - * online at - * http://secondlifegrid.net/programs/open_source/licensing/flossexception - * - * By copying, modifying or distributing this software, you acknowledge - * that you have read and understood your obligations described above, - * and agree to abide by those obligations. - * - * ALL LINDEN LAB SOURCE CODE IS PROVIDED "AS IS." LINDEN LAB MAKES NO - * WARRANTIES, EXPRESS, IMPLIED OR OTHERWISE, REGARDING ITS ACCURACY, - * COMPLETENESS OR PERFORMANCE. - * $/LicenseInfo$ - */ - - -#include "llcrashloggermac.h" - -#include -#include -#include - -#include "boost/tokenizer.hpp" - -#include "indra_constants.h" // CRASH_BEHAVIOR_ASK, CRASH_SETTING_NAME -#include "llerror.h" -#include "llfile.h" -#include "lltimer.h" -#include "llstring.h" -#include "lldir.h" -#include "llsdserialize.h" - -#define MAX_LOADSTRING 100 -const char* const SETTINGS_FILE_HEADER = "version"; -const S32 SETTINGS_FILE_VERSION = 101; - -// Windows Message Handlers - -BOOL gFirstDialog = TRUE; // Are we currently handling the Send/Don't Send dialog? -LLFILE *gDebugFile = NULL; - -WindowRef gWindow = NULL; -EventHandlerRef gEventHandler = NULL; -std::string gUserNotes = ""; -bool gSendReport = false; -bool gRememberChoice = false; -IBNibRef nib = NULL; - -OSStatus dialogHandler(EventHandlerCallRef handler, EventRef event, void *userdata) -{ - OSStatus result = eventNotHandledErr; - OSStatus err; - UInt32 evtClass = GetEventClass(event); - UInt32 evtKind = GetEventKind(event); - if((evtClass == kEventClassCommand) && (evtKind == kEventCommandProcess)) - { - HICommand cmd; - err = GetEventParameter(event, kEventParamDirectObject, typeHICommand, NULL, sizeof(cmd), NULL, &cmd); - - - - if(err == noErr) - { - //Get the value of the checkbox - ControlID id; - ControlRef checkBox = NULL; - id.signature = 'remb'; - id.id = 0; - err = GetControlByID(gWindow, &id, &checkBox); - - if(err == noErr) - { - if(GetControl32BitValue(checkBox) == kControlCheckBoxCheckedValue) - { - gRememberChoice = true; - } - else - { - gRememberChoice = false; - } - } - switch(cmd.commandID) - { - case kHICommandOK: - { - char buffer[65535]; /* Flawfinder: ignore */ - Size size = sizeof(buffer) - 1; - ControlRef textField = NULL; - - id.signature = 'text'; - id.id = 0; - - err = GetControlByID(gWindow, &id, &textField); - if(err == noErr) - { - // Get the user response text - err = GetControlData(textField, kControlNoPart, kControlEditTextTextTag, size, (Ptr)buffer, &size); - } - if(err == noErr) - { - // Make sure the string is terminated. - buffer[size] = 0; - gUserNotes = buffer; - - llinfos << buffer << llendl; - } - - // Send the report. - - QuitAppModalLoopForWindow(gWindow); - gSendReport = true; - result = noErr; - } - break; - - case kHICommandCancel: - QuitAppModalLoopForWindow(gWindow); - result = noErr; - break; - default: - result = eventNotHandledErr; - } - } - } - - return(result); -} - - -LLCrashLoggerMac::LLCrashLoggerMac(void) -{ -} - -LLCrashLoggerMac::~LLCrashLoggerMac(void) -{ -} - -bool LLCrashLoggerMac::init(void) -{ - bool ok = LLCrashLogger::init(); - if(!ok) return false; - if(mCrashBehavior != CRASH_BEHAVIOR_ASK) return true; - - // Real UI... - OSStatus err; - - err = CreateNibReference(CFSTR("CrashReporter"), &nib); - - if(err == noErr) - { - err = CreateWindowFromNib(nib, CFSTR("CrashReporter"), &gWindow); - } - - if(err == noErr) - { - // Set focus to the edit text area - ControlRef textField = NULL; - ControlID id; - - id.signature = 'text'; - id.id = 0; - - // Don't set err if any of this fails, since it's non-critical. - if(GetControlByID(gWindow, &id, &textField) == noErr) - { - SetKeyboardFocus(gWindow, textField, kControlFocusNextPart); - } - } - - if(err == noErr) - { - ShowWindow(gWindow); - } - - if(err == noErr) - { - // Set up an event handler for the window. - EventTypeSpec handlerEvents[] = - { - { kEventClassCommand, kEventCommandProcess } - }; - - InstallWindowEventHandler( - gWindow, - NewEventHandlerUPP(dialogHandler), - GetEventTypeCount (handlerEvents), - handlerEvents, - 0, - &gEventHandler); - } - return true; -} - -void LLCrashLoggerMac::gatherPlatformSpecificFiles() -{ - updateApplication("Gathering hardware information..."); - char path[MAX_PATH]; - FSRef folder; - - if(FSFindFolder(kUserDomain, kLogsFolderType, false, &folder) == noErr) - { - // folder is an FSRef to ~/Library/Logs/ - if(FSRefMakePath(&folder, (UInt8*)&path, sizeof(path)) == noErr) - { - struct stat dw_stat; - std::string mBuf; - bool isLeopard = false; - // Try the 10.3 path first... - std::string dw_file_name = std::string(path) + std::string("/CrashReporter/Second Life.crash.log"); - int res = stat(dw_file_name.c_str(), &dw_stat); - - if (res) - { - // Try the 10.2 one next... - dw_file_name = std::string(path) + std::string("/Second Life.crash.log"); - res = stat(dw_file_name.c_str(), &dw_stat); - } - - if(res) - { - //10.5: Like 10.3+, except it puts the crash time in the file instead of dividing it up - //using asterisks. Get a directory listing, search for files starting with second life, - //use the last one found. - std::string old_file_name, current_file_name, pathname, mask; - pathname = std::string(path) + std::string("/CrashReporter/"); - mask = "Second Life*"; - while(gDirUtilp->getNextFileInDir(pathname, mask, current_file_name, false)) - { - old_file_name = current_file_name; - } - if(old_file_name != "") - { - dw_file_name = pathname + old_file_name; - res=stat(dw_file_name.c_str(), &dw_stat); - isLeopard = true; - } - } - - if (!res) - { - std::ifstream fp(dw_file_name.c_str()); - std::stringstream str; - if(!fp.is_open()) return; - str << fp.rdbuf(); - mBuf = str.str(); - - if(!isLeopard) - { - // Crash logs consist of a number of entries, one per crash. - // Each entry is preceeded by "**********" on a line by itself. - // We want only the most recent (i.e. last) one. - const char *sep = "**********"; - const char *start = mBuf.c_str(); - const char *cur = start; - const char *temp = strstr(cur, sep); - - while(temp != NULL) - { - // Skip past the marker we just found - cur = temp + strlen(sep); /* Flawfinder: ignore */ - - // and try to find another - temp = strstr(cur, sep); - } - - // If there's more than one entry in the log file, strip all but the last one. - if(cur != start) - { - mBuf.erase(0, cur - start); - } - } - mCrashInfo["CrashLog"] = mBuf; - } - else - { - llwarns << "Couldn't find any CrashReporter files..." << llendl; - } - } - } -} - -bool LLCrashLoggerMac::mainLoop() -{ - OSStatus err = noErr; - - if(err == noErr && mCrashBehavior == CRASH_BEHAVIOR_ASK) - { - RunAppModalLoopForWindow(gWindow); - } - else if (mCrashBehavior == CRASH_BEHAVIOR_ALWAYS_SEND) - { - gSendReport = true; - } - - if(gRememberChoice) - { - if(gSendReport) saveCrashBehaviorSetting(CRASH_BEHAVIOR_ALWAYS_SEND); - else saveCrashBehaviorSetting(CRASH_BEHAVIOR_NEVER_SEND); - } - - if(gSendReport) - { - setUserText(gUserNotes); - sendCrashLogs(); - } - - if(gWindow != NULL) - { - DisposeWindow(gWindow); - } - - if(nib != NULL) - { - DisposeNibReference(nib); - } - - return true; -} - -void LLCrashLoggerMac::updateApplication(const std::string& message) -{ - LLCrashLogger::updateApplication(); -} - -bool LLCrashLoggerMac::cleanup() -{ - return true; -} diff --git a/indra/mac_crash_logger/llcrashloggermac.h b/indra/mac_crash_logger/llcrashloggermac.h deleted file mode 100644 index a76535afe..000000000 --- a/indra/mac_crash_logger/llcrashloggermac.h +++ /dev/null @@ -1,52 +0,0 @@ -/** - * @file llcrashloggermac.h - * @brief Mac OSX crash logger definition - * - * $LicenseInfo:firstyear=2003&license=viewergpl$ - * - * Copyright (c) 2003-2009, Linden Research, Inc. - * - * Second Life Viewer Source Code - * The source code in this file ("Source Code") is provided by Linden Lab - * to you under the terms of the GNU General Public License, version 2.0 - * ("GPL"), unless you have obtained a separate licensing agreement - * ("Other License"), formally executed by you and Linden Lab. Terms of - * the GPL can be found in doc/GPL-license.txt in this distribution, or - * online at http://secondlifegrid.net/programs/open_source/licensing/gplv2 - * - * There are special exceptions to the terms and conditions of the GPL as - * it is applied to this Source Code. View the full text of the exception - * in the file doc/FLOSS-exception.txt in this software distribution, or - * online at - * http://secondlifegrid.net/programs/open_source/licensing/flossexception - * - * By copying, modifying or distributing this software, you acknowledge - * that you have read and understood your obligations described above, - * and agree to abide by those obligations. - * - * ALL LINDEN LAB SOURCE CODE IS PROVIDED "AS IS." LINDEN LAB MAKES NO - * WARRANTIES, EXPRESS, IMPLIED OR OTHERWISE, REGARDING ITS ACCURACY, - * COMPLETENESS OR PERFORMANCE. - * $/LicenseInfo$ - */ - -#ifndef LLCRASHLOGGERMAC_H -#define LLCRASHLOGGERMAC_H - -#include "linden_common.h" -#include "llcrashlogger.h" -#include "llstring.h" - -class LLCrashLoggerMac : public LLCrashLogger -{ -public: - LLCrashLoggerMac(void); - ~LLCrashLoggerMac(void); - virtual bool init(); - virtual bool mainLoop(); - virtual void updateApplication(const std::string& message = LLStringUtil::null); - virtual bool cleanup(); - virtual void gatherPlatformSpecificFiles(); -}; - -#endif diff --git a/indra/mac_crash_logger/mac_crash_logger.cpp b/indra/mac_crash_logger/mac_crash_logger.cpp deleted file mode 100644 index 1f5663d8a..000000000 --- a/indra/mac_crash_logger/mac_crash_logger.cpp +++ /dev/null @@ -1,52 +0,0 @@ -/** - * @file mac_crash_logger.cpp - * @brief Mac OSX crash logger implementation - * - * $LicenseInfo:firstyear=2003&license=viewergpl$ - * - * Copyright (c) 2003-2009, Linden Research, Inc. - * - * Second Life Viewer Source Code - * The source code in this file ("Source Code") is provided by Linden Lab - * to you under the terms of the GNU General Public License, version 2.0 - * ("GPL"), unless you have obtained a separate licensing agreement - * ("Other License"), formally executed by you and Linden Lab. Terms of - * the GPL can be found in doc/GPL-license.txt in this distribution, or - * online at http://secondlifegrid.net/programs/open_source/licensing/gplv2 - * - * There are special exceptions to the terms and conditions of the GPL as - * it is applied to this Source Code. View the full text of the exception - * in the file doc/FLOSS-exception.txt in this software distribution, or - * online at - * http://secondlifegrid.net/programs/open_source/licensing/flossexception - * - * By copying, modifying or distributing this software, you acknowledge - * that you have read and understood your obligations described above, - * and agree to abide by those obligations. - * - * ALL LINDEN LAB SOURCE CODE IS PROVIDED "AS IS." LINDEN LAB MAKES NO - * WARRANTIES, EXPRESS, IMPLIED OR OTHERWISE, REGARDING ITS ACCURACY, - * COMPLETENESS OR PERFORMANCE. - * $/LicenseInfo$ - */ - -#include "linden_common.h" - -#include "llcrashloggermac.h" - -int main(int argc, char **argv) -{ - //time(&gLaunchTime); - - llinfos << "Starting Second Life Viewer Crash Reporter" << llendl; - - LLCrashLoggerMac app; - app.parseCommandOptions(argc, argv); - if(!app.init()) - { - return 0; - } - app.mainLoop(); - - return 0; -} diff --git a/indra/mac_updater/AutoUpdater.nib/classes.nib b/indra/mac_updater/AutoUpdater.nib/classes.nib deleted file mode 100644 index ea58db118..000000000 --- a/indra/mac_updater/AutoUpdater.nib/classes.nib +++ /dev/null @@ -1,4 +0,0 @@ -{ -IBClasses = (); -IBVersion = 1; -} diff --git a/indra/mac_updater/AutoUpdater.nib/info.nib b/indra/mac_updater/AutoUpdater.nib/info.nib deleted file mode 100644 index a49a92385..000000000 --- a/indra/mac_updater/AutoUpdater.nib/info.nib +++ /dev/null @@ -1,14 +0,0 @@ - - - - - IBDocumentLocation - 103 138 356 240 0 0 1280 1002 - IBFramework Version - 362.0 - IBSystem Version - 7D24 - targetFramework - IBCarbonFramework - - diff --git a/indra/mac_updater/AutoUpdater.nib/objects.xib b/indra/mac_updater/AutoUpdater.nib/objects.xib deleted file mode 100644 index 310411b71..000000000 --- a/indra/mac_updater/AutoUpdater.nib/objects.xib +++ /dev/null @@ -1,56 +0,0 @@ - - - IBCarbonFramework - - NSApplication - - - - 405 222 533 663 - Second Life Updater - - 0 0 128 441 - - - 20 20 44 421 - what - Initializing… - - - 88 351 108 421 - Cancel - not! - 2 - - - 51 19 70 422 - prog - 50 - - - - FALSE - 2 - 3 - 7 - - - - - - - - - - - - - - - File's Owner - - Updater - - - 194 - diff --git a/indra/mac_updater/CMakeLists.txt b/indra/mac_updater/CMakeLists.txt deleted file mode 100644 index b769a2e17..000000000 --- a/indra/mac_updater/CMakeLists.txt +++ /dev/null @@ -1,66 +0,0 @@ -# -*- cmake -*- - -project(mac_updater) - -include(00-Common) -include(CURL) -include(LLCommon) -include(LLVFS) -include(Linking) - -include_directories( - ${LLCOMMON_INCLUDE_DIRS} - ${LLVFS_INCLUDE_DIRS} - ) - -set(mac_updater_SOURCE_FILES - mac_updater.cpp - ) - -set(mac_updater_HEADER_FILES - CMakeLists.txt - ) - -set_source_files_properties(${mac_updater_HEADER_FILES} - PROPERTIES HEADER_FILE_ONLY TRUE) - -list(APPEND mac_updater_SOURCE_FILES ${mac_updater_HEADER_FILES}) - - -set(mac_updater_RESOURCE_FILES - AutoUpdater.nib/ - ) -set_source_files_properties( - ${mac_updater_RESOURCE_FILES} - PROPERTIES - HEADER_FILE_ONLY TRUE - ) -SOURCE_GROUP("Resources" FILES ${mac_updater_RESOURCE_FILES}) -list(APPEND mac_updater_SOURCE_FILES ${mac_updater_RESOURCE_FILES}) - -add_executable(mac-updater - MACOSX_BUNDLE - ${mac_updater_SOURCE_FILES}) - -set_target_properties(mac-updater - PROPERTIES - MACOSX_BUNDLE_INFO_PLIST ${CMAKE_CURRENT_SOURCE_DIR}/Info.plist - ) - -target_link_libraries(mac-updater - ${LLVFS_LIBRARIES} - ${CURL_LIBRARIES} - ${OPENSSL_LIBRARIES} - ${LLCOMMON_LIBRARIES} - ) - -add_custom_command( - TARGET mac-updater POST_BUILD - COMMAND ${CMAKE_COMMAND} - ARGS - -E - copy_directory - ${CMAKE_CURRENT_SOURCE_DIR}/AutoUpdater.nib - ${CMAKE_CURRENT_BINARY_DIR}/${CMAKE_CFG_INTDIR}/mac-updater.app/Contents/Resources/AutoUpdater.nib - ) - diff --git a/indra/mac_updater/Info.plist b/indra/mac_updater/Info.plist deleted file mode 100644 index bb27fddb0..000000000 --- a/indra/mac_updater/Info.plist +++ /dev/null @@ -1,26 +0,0 @@ - - - - - CFBundleDevelopmentRegion - English - CFBundleExecutable - mac-updater - CFBundleGetInfoString - - CFBundleIconFile - - CFBundleIdentifier - com.secondlife.indra.autoupdater - CFBundleInfoDictionaryVersion - 6.0 - CFBundlePackageType - APPL - CFBundleShortVersionString - - CFBundleSignature - ???? - CFBundleVersion - 1.0.0 - - diff --git a/indra/mac_updater/mac_updater.cpp b/indra/mac_updater/mac_updater.cpp deleted file mode 100644 index 0fd4615b4..000000000 --- a/indra/mac_updater/mac_updater.cpp +++ /dev/null @@ -1,1204 +0,0 @@ -/** - * @file mac_updater.cpp - * @brief - * - * $LicenseInfo:firstyear=2006&license=viewergpl$ - * - * Copyright (c) 2006-2009, Linden Research, Inc. - * - * Second Life Viewer Source Code - * The source code in this file ("Source Code") is provided by Linden Lab - * to you under the terms of the GNU General Public License, version 2.0 - * ("GPL"), unless you have obtained a separate licensing agreement - * ("Other License"), formally executed by you and Linden Lab. Terms of - * the GPL can be found in doc/GPL-license.txt in this distribution, or - * online at http://secondlifegrid.net/programs/open_source/licensing/gplv2 - * - * There are special exceptions to the terms and conditions of the GPL as - * it is applied to this Source Code. View the full text of the exception - * in the file doc/FLOSS-exception.txt in this software distribution, or - * online at - * http://secondlifegrid.net/programs/open_source/licensing/flossexception - * - * By copying, modifying or distributing this software, you acknowledge - * that you have read and understood your obligations described above, - * and agree to abide by those obligations. - * - * ALL LINDEN LAB SOURCE CODE IS PROVIDED "AS IS." LINDEN LAB MAKES NO - * WARRANTIES, EXPRESS, IMPLIED OR OTHERWISE, REGARDING ITS ACCURACY, - * COMPLETENESS OR PERFORMANCE. - * $/LicenseInfo$ - */ - -#include "linden_common.h" - -#include -#include -#include - -#include -#include - -#include "llerror.h" -#include "lltimer.h" -#include "lldir.h" -#include "llfile.h" - -#include "llstring.h" - -#include - -#include "llerrorcontrol.h" - -enum -{ - kEventClassCustom = 'Cust', - kEventCustomProgress = 'Prog', - kEventParamCustomCurValue = 'Cur ', - kEventParamCustomMaxValue = 'Max ', - kEventParamCustomText = 'Text', - kEventCustomDone = 'Done', -}; - -WindowRef gWindow = NULL; -EventHandlerRef gEventHandler = NULL; -OSStatus gFailure = noErr; -Boolean gCancelled = false; - -const char *gUpdateURL; -const char *gProductName; -const char *gBundleID; - -void *updatethreadproc(void*); - -pthread_t updatethread; - -OSStatus setProgress(int cur, int max) -{ - OSStatus err; - ControlRef progressBar = NULL; - ControlID id; - - id.signature = 'prog'; - id.id = 0; - - err = GetControlByID(gWindow, &id, &progressBar); - if(err == noErr) - { - Boolean indeterminate; - - if(max == 0) - { - indeterminate = true; - err = SetControlData(progressBar, kControlEntireControl, kControlProgressBarIndeterminateTag, sizeof(Boolean), (Ptr)&indeterminate); - } - else - { - double percentage = (double)cur / (double)max; - SetControlMinimum(progressBar, 0); - SetControlMaximum(progressBar, 100); - SetControlValue(progressBar, (SInt16)(percentage * 100)); - - indeterminate = false; - err = SetControlData(progressBar, kControlEntireControl, kControlProgressBarIndeterminateTag, sizeof(Boolean), (Ptr)&indeterminate); - - Draw1Control(progressBar); - } - } - - return(err); -} - -OSStatus setProgressText(CFStringRef text) -{ - OSStatus err; - ControlRef progressText = NULL; - ControlID id; - - id.signature = 'what'; - id.id = 0; - - err = GetControlByID(gWindow, &id, &progressText); - if(err == noErr) - { - err = SetControlData(progressText, kControlEntireControl, kControlStaticTextCFStringTag, sizeof(CFStringRef), (Ptr)&text); - Draw1Control(progressText); - } - - return(err); -} - -OSStatus sendProgress(long cur, long max, CFStringRef text = NULL) -{ - OSStatus result; - EventRef evt; - - result = CreateEvent( - NULL, - kEventClassCustom, - kEventCustomProgress, - 0, - kEventAttributeNone, - &evt); - - // This event needs to be targeted at the window so it goes to the window's handler. - if(result == noErr) - { - EventTargetRef target = GetWindowEventTarget(gWindow); - result = SetEventParameter ( - evt, - kEventParamPostTarget, - typeEventTargetRef, - sizeof(target), - &target); - } - - if(result == noErr) - { - result = SetEventParameter ( - evt, - kEventParamCustomCurValue, - typeLongInteger, - sizeof(cur), - &cur); - } - - if(result == noErr) - { - result = SetEventParameter ( - evt, - kEventParamCustomMaxValue, - typeLongInteger, - sizeof(max), - &max); - } - - if(result == noErr) - { - if(text != NULL) - { - result = SetEventParameter ( - evt, - kEventParamCustomText, - typeCFStringRef, - sizeof(text), - &text); - } - } - - if(result == noErr) - { - // Send the event - PostEventToQueue( - GetMainEventQueue(), - evt, - kEventPriorityStandard); - - } - - return(result); -} - -OSStatus sendDone(void) -{ - OSStatus result; - EventRef evt; - - result = CreateEvent( - NULL, - kEventClassCustom, - kEventCustomDone, - 0, - kEventAttributeNone, - &evt); - - // This event needs to be targeted at the window so it goes to the window's handler. - if(result == noErr) - { - EventTargetRef target = GetWindowEventTarget(gWindow); - result = SetEventParameter ( - evt, - kEventParamPostTarget, - typeEventTargetRef, - sizeof(target), - &target); - } - - if(result == noErr) - { - // Send the event - PostEventToQueue( - GetMainEventQueue(), - evt, - kEventPriorityStandard); - - } - - return(result); -} - -OSStatus dialogHandler(EventHandlerCallRef handler, EventRef event, void *userdata) -{ - OSStatus result = eventNotHandledErr; - OSStatus err; - UInt32 evtClass = GetEventClass(event); - UInt32 evtKind = GetEventKind(event); - - if((evtClass == kEventClassCommand) && (evtKind == kEventCommandProcess)) - { - HICommand cmd; - err = GetEventParameter(event, kEventParamDirectObject, typeHICommand, NULL, sizeof(cmd), NULL, &cmd); - - if(err == noErr) - { - switch(cmd.commandID) - { - case kHICommandCancel: - gCancelled = true; -// QuitAppModalLoopForWindow(gWindow); - result = noErr; - break; - } - } - } - else if((evtClass == kEventClassCustom) && (evtKind == kEventCustomProgress)) - { - // Request to update the progress dialog - long cur = 0; - long max = 0; - CFStringRef text = NULL; - (void) GetEventParameter(event, kEventParamCustomCurValue, typeLongInteger, NULL, sizeof(cur), NULL, &cur); - (void) GetEventParameter(event, kEventParamCustomMaxValue, typeLongInteger, NULL, sizeof(max), NULL, &max); - (void) GetEventParameter(event, kEventParamCustomText, typeCFStringRef, NULL, sizeof(text), NULL, &text); - - err = setProgress(cur, max); - if(err == noErr) - { - if(text != NULL) - { - setProgressText(text); - } - } - - result = noErr; - } - else if((evtClass == kEventClassCustom) && (evtKind == kEventCustomDone)) - { - // We're done. Exit the modal loop. - QuitAppModalLoopForWindow(gWindow); - result = noErr; - } - - return(result); -} - -#if 0 -size_t curl_download_callback(void *data, size_t size, size_t nmemb, - void *user_data) -{ - S32 bytes = size * nmemb; - char *cdata = (char *) data; - for (int i =0; i < bytes; i += 1) - { - gServerResponse.append(cdata[i]); - } - return bytes; -} -#endif - -int curl_progress_callback_func(void *clientp, - double dltotal, - double dlnow, - double ultotal, - double ulnow) -{ - int max = (int)(dltotal / 1024.0); - int cur = (int)(dlnow / 1024.0); - sendProgress(cur, max); - - if(gCancelled) - return(1); - - return(0); -} - -int parse_args(int argc, char **argv) -{ - int j; - - for (j = 1; j < argc; j++) - { - if ((!strcmp(argv[j], "-url")) && (++j < argc)) - { - gUpdateURL = argv[j]; - } - else if ((!strcmp(argv[j], "-name")) && (++j < argc)) - { - gProductName = argv[j]; - } - else if ((!strcmp(argv[j], "-bundleid")) && (++j < argc)) - { - gBundleID = argv[j]; - } - } - - return 0; -} - -int main(int argc, char **argv) -{ - // We assume that all the logs we're looking for reside on the current drive - gDirUtilp->initAppDirs("SecondLife"); - - LLError::initForApplication( gDirUtilp->getExpandedFilename(LL_PATH_APP_SETTINGS, "")); - - // Rename current log file to ".old" - std::string old_log_file = gDirUtilp->getExpandedFilename(LL_PATH_LOGS, "updater.log.old"); - std::string log_file = gDirUtilp->getExpandedFilename(LL_PATH_LOGS, "updater.log"); - LLFile::rename(log_file.c_str(), old_log_file.c_str()); - - // Set the log file to updater.log - LLError::logToFile(log_file); - - ///////////////////////////////////////// - // - // Process command line arguments - // - gUpdateURL = NULL; - gProductName = NULL; - gBundleID = NULL; - parse_args(argc, argv); - if (!gUpdateURL) - { - llinfos << "Usage: mac_updater -url [-name ] [-program ]" << llendl; - exit(1); - } - else - { - llinfos << "Update url is: " << gUpdateURL << llendl; - if (gProductName) - { - llinfos << "Product name is: " << gProductName << llendl; - } - else - { - gProductName = "Second Life"; - } - if (gBundleID) - { - llinfos << "Bundle ID is: " << gBundleID << llendl; - } - else - { - gBundleID = "com.secondlife.indra.viewer"; - } - } - - llinfos << "Starting " << gProductName << " Updater" << llendl; - - // Real UI... - OSStatus err; - IBNibRef nib = NULL; - - err = CreateNibReference(CFSTR("AutoUpdater"), &nib); - - char windowTitle[MAX_PATH]; /* Flawfinder: ignore */ - snprintf(windowTitle, sizeof(windowTitle), "%s Updater", gProductName); - CFStringRef windowTitleRef = NULL; - windowTitleRef = CFStringCreateWithCString(NULL, windowTitle, kCFStringEncodingUTF8); - - if(err == noErr) - { - err = CreateWindowFromNib(nib, CFSTR("Updater"), &gWindow); - } - - if (err == noErr) - { - err = SetWindowTitleWithCFString(gWindow, windowTitleRef); - } - CFRelease(windowTitleRef); - - if(err == noErr) - { - // Set up an event handler for the window. - EventTypeSpec handlerEvents[] = - { - { kEventClassCommand, kEventCommandProcess }, - { kEventClassCustom, kEventCustomProgress }, - { kEventClassCustom, kEventCustomDone } - }; - InstallStandardEventHandler(GetWindowEventTarget(gWindow)); - InstallWindowEventHandler( - gWindow, - NewEventHandlerUPP(dialogHandler), - GetEventTypeCount (handlerEvents), - handlerEvents, - 0, - &gEventHandler); - } - - if(err == noErr) - { - ShowWindow(gWindow); - SelectWindow(gWindow); - } - - if(err == noErr) - { - pthread_create(&updatethread, - NULL, - &updatethreadproc, - NULL); - - } - - if(err == noErr) - { - RunAppModalLoopForWindow(gWindow); - } - - void *threadresult; - - pthread_join(updatethread, &threadresult); - - if(!gCancelled && (gFailure != noErr)) - { - // Something went wrong. Since we always just tell the user to download a new version, we don't really care what. - AlertStdCFStringAlertParamRec params; - SInt16 retval_mac = 1; - DialogRef alert = NULL; - OSStatus err; - - params.version = kStdCFStringAlertVersionOne; - params.movable = false; - params.helpButton = false; - params.defaultText = (CFStringRef)kAlertDefaultOKText; - params.cancelText = 0; - params.otherText = 0; - params.defaultButton = 1; - params.cancelButton = 0; - params.position = kWindowDefaultPosition; - params.flags = 0; - - err = CreateStandardAlert( - kAlertStopAlert, - CFSTR("Error"), - CFSTR("An error occurred while updating Second Life. Please download the latest version from www.secondlife.com."), - ¶ms, - &alert); - - if(err == noErr) - { - err = RunStandardAlert( - alert, - NULL, - &retval_mac); - } - - } - - // Don't dispose of things, just exit. This keeps the update thread from potentially getting hosed. - exit(0); - - if(gWindow != NULL) - { - DisposeWindow(gWindow); - } - - if(nib != NULL) - { - DisposeNibReference(nib); - } - - return 0; -} - -bool isDirWritable(FSRef &dir) -{ - bool result = false; - - // Test for a writable directory by creating a directory, then deleting it again. - // This is kinda lame, but will pretty much always give the right answer. - - OSStatus err = noErr; - char temp[PATH_MAX] = ""; /* Flawfinder: ignore */ - - err = FSRefMakePath(&dir, (UInt8*)temp, sizeof(temp)); - - if(err == noErr) - { - strncat(temp, "/.test_XXXXXX", (sizeof(temp) - strlen(temp)) - 1); - - if(mkdtemp(temp) != NULL) - { - // We were able to make the directory. This means the directory is writable. - result = true; - - // Clean up. - rmdir(temp); - } - } - -#if 0 - // This seemed like a good idea, but won't tell us if we're on a volume mounted read-only. - UInt8 perm; - err = FSGetUserPrivilegesPermissions(&targetParentRef, &perm, NULL); - if(err == noErr) - { - if(perm & kioACUserNoMakeChangesMask) - { - // Parent directory isn't writable. - llinfos << "Target parent directory not writable." << llendl; - err = -1; - replacingTarget = false; - } - } -#endif - - return result; -} - -static std::string HFSUniStr255_to_utf8str(const HFSUniStr255* src) -{ - llutf16string string16((U16*)&(src->unicode), src->length); - std::string result = utf16str_to_utf8str(string16); - return result; -} - -int restoreObject(const char* aside, const char* target, const char* path, const char* object) -{ - char source[PATH_MAX] = ""; /* Flawfinder: ignore */ - char dest[PATH_MAX] = ""; /* Flawfinder: ignore */ - snprintf(source, sizeof(source), "%s/%s/%s", aside, path, object); - snprintf(dest, sizeof(dest), "%s/%s", target, path); - FSRef sourceRef; - FSRef destRef; - OSStatus err; - err = FSPathMakeRef((UInt8 *)source, &sourceRef, NULL); - if(err != noErr) return false; - err = FSPathMakeRef((UInt8 *)dest, &destRef, NULL); - if(err != noErr) return false; - - llinfos << "Copying " << source << " to " << dest << llendl; - - err = FSCopyObjectSync( - &sourceRef, - &destRef, - NULL, - NULL, - kFSFileOperationOverwrite); - - if(err != noErr) return false; - return true; -} - -// Replace any mention of "Second Life" with the product name. -void filterFile(const char* filename) -{ - char temp[PATH_MAX] = ""; /* Flawfinder: ignore */ - // First copy the target's version, so we can run it through sed. - snprintf(temp, sizeof(temp), "cp '%s' '%s.tmp'", filename, filename); - system(temp); /* Flawfinder: ignore */ - - // Now run it through sed. - snprintf(temp, sizeof(temp), - "sed 's/Second Life/%s/g' '%s.tmp' > '%s'", gProductName, filename, filename); - system(temp); /* Flawfinder: ignore */ -} - -static bool isFSRefViewerBundle(FSRef *targetRef) -{ - bool result = false; - CFURLRef targetURL = NULL; - CFBundleRef targetBundle = NULL; - CFStringRef targetBundleID = NULL; - CFStringRef sourceBundleID = NULL; - - targetURL = CFURLCreateFromFSRef(NULL, targetRef); - - if(targetURL == NULL) - { - llinfos << "Error creating target URL." << llendl; - } - else - { - targetBundle = CFBundleCreate(NULL, targetURL); - } - - if(targetBundle == NULL) - { - llinfos << "Failed to create target bundle." << llendl; - } - else - { - targetBundleID = CFBundleGetIdentifier(targetBundle); - } - - if(targetBundleID == NULL) - { - llinfos << "Couldn't retrieve target bundle ID." << llendl; - } - else - { - sourceBundleID = CFStringCreateWithCString(NULL, gBundleID, kCFStringEncodingUTF8); - if(CFStringCompare(sourceBundleID, targetBundleID, 0) == kCFCompareEqualTo) - { - // This is the bundle we're looking for. - result = true; - } - else - { - llinfos << "Target bundle ID mismatch." << llendl; - } - } - - // Don't release targetBundleID -- since we don't retain it, it's released when targetBundle is released. - if(targetURL != NULL) - CFRelease(targetURL); - if(targetBundle != NULL) - CFRelease(targetBundle); - - return result; -} - -// Search through the directory specified by 'parent' for an item that appears to be a Second Life viewer. -static OSErr findAppBundleOnDiskImage(FSRef *parent, FSRef *app) -{ - FSIterator iterator; - bool found = false; - - OSErr err = FSOpenIterator( parent, kFSIterateFlat, &iterator ); - if(!err) - { - do - { - ItemCount actualObjects = 0; - Boolean containerChanged = false; - FSCatalogInfo info; - FSRef ref; - HFSUniStr255 unicodeName; - err = FSGetCatalogInfoBulk( - iterator, - 1, - &actualObjects, - &containerChanged, - kFSCatInfoNodeFlags, - &info, - &ref, - NULL, - &unicodeName ); - - if(actualObjects == 0) - break; - - if(!err) - { - // Call succeeded and not done with the iteration. - std::string name = HFSUniStr255_to_utf8str(&unicodeName); - - llinfos << "Considering \"" << name << "\"" << llendl; - - if(info.nodeFlags & kFSNodeIsDirectoryMask) - { - // This is a directory. See if it's a .app - if(name.find(".app") != std::string::npos) - { - // Looks promising. Check to see if it has the right bundle identifier. - if(isFSRefViewerBundle(&ref)) - { - // This is the one. Return it. - *app = ref; - found = true; - } - } - } - } - } - while(!err && !found); - - FSCloseIterator(iterator); - } - - if(!err && !found) - err = fnfErr; - - return err; -} - -void *updatethreadproc(void*) -{ - char tempDir[PATH_MAX] = ""; /* Flawfinder: ignore */ - FSRef tempDirRef; - char temp[PATH_MAX] = ""; /* Flawfinder: ignore */ - // *NOTE: This buffer length is used in a scanf() below. - char deviceNode[1024] = ""; /* Flawfinder: ignore */ - LLFILE *downloadFile = NULL; - OSStatus err; - ProcessSerialNumber psn; - char target[PATH_MAX] = ""; /* Flawfinder: ignore */ - FSRef targetRef; - FSRef targetParentRef; - FSVolumeRefNum targetVol; - FSRef trashFolderRef; - Boolean replacingTarget = false; - - memset(&tempDirRef, 0, sizeof(tempDirRef)); - memset(&targetRef, 0, sizeof(targetRef)); - memset(&targetParentRef, 0, sizeof(targetParentRef)); - - try - { - // Attempt to get a reference to the Second Life application bundle containing this updater. - // Any failures during this process will cause us to default to updating /Applications/Second Life.app - { - FSRef myBundle; - - err = GetCurrentProcess(&psn); - if(err == noErr) - { - err = GetProcessBundleLocation(&psn, &myBundle); - } - - if(err == noErr) - { - // Sanity check: Make sure the name of the item referenced by targetRef is "Second Life.app". - FSRefMakePath(&myBundle, (UInt8*)target, sizeof(target)); - - llinfos << "Updater bundle location: " << target << llendl; - } - - // Our bundle should be in Second Life.app/Contents/Resources/AutoUpdater.app - // so we need to go up 3 levels to get the path to the main application bundle. - if(err == noErr) - { - err = FSGetCatalogInfo(&myBundle, kFSCatInfoNone, NULL, NULL, NULL, &targetRef); - } - if(err == noErr) - { - err = FSGetCatalogInfo(&targetRef, kFSCatInfoNone, NULL, NULL, NULL, &targetRef); - } - if(err == noErr) - { - err = FSGetCatalogInfo(&targetRef, kFSCatInfoNone, NULL, NULL, NULL, &targetRef); - } - - // And once more to get the parent of the target - if(err == noErr) - { - err = FSGetCatalogInfo(&targetRef, kFSCatInfoNone, NULL, NULL, NULL, &targetParentRef); - } - - if(err == noErr) - { - FSRefMakePath(&targetRef, (UInt8*)target, sizeof(target)); - llinfos << "Path to target: " << target << llendl; - } - - // Sanity check: make sure the target is a bundle with the right identifier - if(err == noErr) - { - // Assume the worst... - err = -1; - - if(isFSRefViewerBundle(&targetRef)) - { - // This is the bundle we're looking for. - err = noErr; - replacingTarget = true; - } - } - - // Make sure the target's parent directory is writable. - if(err == noErr) - { - if(!isDirWritable(targetParentRef)) - { - // Parent directory isn't writable. - llinfos << "Target parent directory not writable." << llendl; - err = -1; - replacingTarget = false; - } - } - - if(err != noErr) - { - Boolean isDirectory; - llinfos << "Target search failed, defaulting to /Applications/" << gProductName << ".app." << llendl; - - // Set up the parent directory - err = FSPathMakeRef((UInt8*)"/Applications", &targetParentRef, &isDirectory); - if((err != noErr) || (!isDirectory)) - { - // We're so hosed. - llinfos << "Applications directory not found, giving up." << llendl; - throw 0; - } - - snprintf(target, sizeof(target), "/Applications/%s.app", gProductName); - - memset(&targetRef, 0, sizeof(targetRef)); - err = FSPathMakeRef((UInt8*)target, &targetRef, NULL); - if(err == fnfErr) - { - // This is fine, just means we're not replacing anything. - err = noErr; - replacingTarget = false; - } - else - { - replacingTarget = true; - } - - // Make sure the target's parent directory is writable. - if(err == noErr) - { - if(!isDirWritable(targetParentRef)) - { - // Parent directory isn't writable. - llinfos << "Target parent directory not writable." << llendl; - err = -1; - replacingTarget = false; - } - } - - } - - // If we haven't fixed all problems by this point, just bail. - if(err != noErr) - { - llinfos << "Unable to pick a target, giving up." << llendl; - throw 0; - } - } - - // Find the volID of the volume the target resides on - { - FSCatalogInfo info; - err = FSGetCatalogInfo( - &targetParentRef, - kFSCatInfoVolume, - &info, - NULL, - NULL, - NULL); - - if(err != noErr) - throw 0; - - targetVol = info.volume; - } - - // Find the temporary items and trash folders on that volume. - err = FSFindFolder( - targetVol, - kTrashFolderType, - true, - &trashFolderRef); - - if(err != noErr) - throw 0; - -#if 0 // *HACK for DEV-11935 see below for details. - - FSRef tempFolderRef; - - err = FSFindFolder( - targetVol, - kTemporaryFolderType, - true, - &tempFolderRef); - - if(err != noErr) - throw 0; - - err = FSRefMakePath(&tempFolderRef, (UInt8*)temp, sizeof(temp)); - - if(err != noErr) - throw 0; - -#else - - // *HACK for DEV-11935 the above kTemporaryFolderType query was giving - // back results with path names that seem to be too long to be used as - // mount points. I suspect this incompatibility was introduced in the - // Leopard 10.5.2 update, but I have not verified this. - char const HARDCODED_TMP[] = "/tmp"; - strncpy(temp, HARDCODED_TMP, sizeof(HARDCODED_TMP)); - -#endif // 0 *HACK for DEV-11935 - - strncat(temp, "/SecondLifeUpdate_XXXXXX", (sizeof(temp) - strlen(temp)) - 1); - if(mkdtemp(temp) == NULL) - { - throw 0; - } - - strncpy(tempDir, temp, sizeof(tempDir)); - temp[sizeof(tempDir) - 1] = '\0'; - - llinfos << "tempDir is " << tempDir << llendl; - - err = FSPathMakeRef((UInt8*)tempDir, &tempDirRef, NULL); - - if(err != noErr) - throw 0; - - chdir(tempDir); - - snprintf(temp, sizeof(temp), "SecondLife.dmg"); - - downloadFile = LLFile::fopen(temp, "wb"); /* Flawfinder: ignore */ - if(downloadFile == NULL) - { - throw 0; - } - - { - CURL *curl = curl_easy_init(); - - curl_easy_setopt(curl, CURLOPT_NOSIGNAL, 1); - // curl_easy_setopt(curl, CURLOPT_WRITEFUNCTION, &curl_download_callback); - curl_easy_setopt(curl, CURLOPT_FILE, downloadFile); - curl_easy_setopt(curl, CURLOPT_NOPROGRESS, 0); - curl_easy_setopt(curl, CURLOPT_PROGRESSFUNCTION, &curl_progress_callback_func); - curl_easy_setopt(curl, CURLOPT_URL, gUpdateURL); - curl_easy_setopt(curl, CURLOPT_FOLLOWLOCATION, 1); - - sendProgress(0, 1, CFSTR("Downloading...")); - - CURLcode result = curl_easy_perform(curl); - - curl_easy_cleanup(curl); - - if(gCancelled) - { - llinfos << "User cancel, bailing out."<< llendl; - throw 0; - } - - if(result != CURLE_OK) - { - llinfos << "Error " << result << " while downloading disk image."<< llendl; - throw 0; - } - - fclose(downloadFile); - downloadFile = NULL; - } - - sendProgress(0, 0, CFSTR("Mounting image...")); - LLFile::mkdir("mnt", 0700); - - // NOTE: we could add -private at the end of this command line to keep the image from showing up in the Finder, - // but if our cleanup fails, this makes it much harder for the user to unmount the image. - std::string mountOutput; - FILE* mounter = popen("hdiutil attach SecondLife.dmg -mountpoint mnt", "r"); /* Flawfinder: ignore */ - - if(mounter == NULL) - { - llinfos << "Failed to mount disk image, exiting."<< llendl; - throw 0; - } - - // We need to scan the output from hdiutil to find the device node it uses to attach the disk image. - // If we don't have this information, we can't detach it later. - while(mounter != NULL) - { - size_t len = fread(temp, 1, sizeof(temp)-1, mounter); - temp[len] = 0; - mountOutput.append(temp); - if(len < sizeof(temp)-1) - { - // End of file or error. - int result = pclose(mounter); - if(result != 0) - { - // NOTE: We used to abort here, but pclose() started returning - // -1, possibly when the size of the DMG passed a certain point - llinfos << "Unexpected result closing pipe: " << result << llendl; - } - mounter = NULL; - } - } - - if(!mountOutput.empty()) - { - const char *s = mountOutput.c_str(); - const char *prefix = "/dev/"; - char *sub = strstr(s, prefix); - - if(sub != NULL) - { - sub += strlen(prefix); /* Flawfinder: ignore */ - sscanf(sub, "%1023s", deviceNode); /* Flawfinder: ignore */ - } - } - - if(deviceNode[0] != 0) - { - llinfos << "Disk image attached on /dev/" << deviceNode << llendl; - } - else - { - llinfos << "Disk image device node not found!" << llendl; - throw 0; - } - - // Get an FSRef to the new application on the disk image - FSRef sourceRef; - FSRef mountRef; - snprintf(temp, sizeof(temp), "%s/mnt", tempDir); - - llinfos << "Disk image mount point is: " << temp << llendl; - - err = FSPathMakeRef((UInt8 *)temp, &mountRef, NULL); - if(err != noErr) - { - llinfos << "Couldn't make FSRef to disk image mount point." << llendl; - throw 0; - } - - err = findAppBundleOnDiskImage(&mountRef, &sourceRef); - if(err != noErr) - { - llinfos << "Couldn't find application bundle on mounted disk image." << llendl; - throw 0; - } - - FSRef asideRef; - char aside[MAX_PATH]; /* Flawfinder: ignore */ - - // this will hold the name of the destination target - CFStringRef appNameRef; - - if(replacingTarget) - { - // Get the name of the target we're replacing - HFSUniStr255 appNameUniStr; - err = FSGetCatalogInfo(&targetRef, 0, NULL, &appNameUniStr, NULL, NULL); - if(err != noErr) - throw 0; - appNameRef = FSCreateStringFromHFSUniStr(NULL, &appNameUniStr); - - // Move aside old version (into work directory) - err = FSMoveObject(&targetRef, &tempDirRef, &asideRef); - if(err != noErr) - throw 0; - - // Grab the path for later use. - err = FSRefMakePath(&asideRef, (UInt8*)aside, sizeof(aside)); - } - else - { - // Construct the name of the target based on the product name - char appName[MAX_PATH]; /* Flawfinder: ignore */ - snprintf(appName, sizeof(appName), "%s.app", gProductName); - appNameRef = CFStringCreateWithCString(NULL, appName, kCFStringEncodingUTF8); - } - - sendProgress(0, 0, CFSTR("Copying files...")); - - llinfos << "Starting copy..." << llendl; - - // Copy the new version from the disk image to the target location. - err = FSCopyObjectSync( - &sourceRef, - &targetParentRef, - appNameRef, - &targetRef, - kFSFileOperationDefaultOptions); - - // Grab the path for later use. - err = FSRefMakePath(&targetRef, (UInt8*)target, sizeof(target)); - if(err != noErr) - throw 0; - - llinfos << "Copy complete. Target = " << target << llendl; - - if(err != noErr) - { - // Something went wrong during the copy. Attempt to put the old version back and bail. - (void)FSDeleteObject(&targetRef); - if(replacingTarget) - { - (void)FSMoveObject(&asideRef, &targetParentRef, NULL); - } - throw 0; - } - else - { - // The update has succeeded. Clear the cache directory. - - sendProgress(0, 0, CFSTR("Clearing cache...")); - - llinfos << "Clearing cache..." << llendl; - - gDirUtilp->deleteFilesInDir(gDirUtilp->getExpandedFilename(LL_PATH_CACHE,""),"*.*"); - - llinfos << "Clear complete." << llendl; - - } - } - catch(...) - { - if(!gCancelled) - if(gFailure == noErr) - gFailure = -1; - } - - // Failures from here on out are all non-fatal and not reported. - sendProgress(0, 3, CFSTR("Cleaning up...")); - - // Close disk image file if necessary - if(downloadFile != NULL) - { - llinfos << "Closing download file." << llendl; - - fclose(downloadFile); - downloadFile = NULL; - } - - sendProgress(1, 3); - // Unmount image - if(deviceNode[0] != 0) - { - llinfos << "Detaching disk image." << llendl; - - snprintf(temp, sizeof(temp), "hdiutil detach '%s'", deviceNode); - system(temp); /* Flawfinder: ignore */ - } - - sendProgress(2, 3); - - // Move work directory to the trash - if(tempDir[0] != 0) - { -// chdir("/"); -// FSDeleteObjects(tempDirRef); - - llinfos << "Moving work directory to the trash." << llendl; - - err = FSMoveObject(&tempDirRef, &trashFolderRef, NULL); - -// snprintf(temp, sizeof(temp), "rm -rf '%s'", tempDir); -// printf("%s\n", temp); -// system(temp); - } - - if(!gCancelled && !gFailure && (target[0] != 0)) - { - llinfos << "Touching application bundle." << llendl; - - snprintf(temp, sizeof(temp), "touch '%s'", target); - system(temp); /* Flawfinder: ignore */ - - llinfos << "Launching updated application." << llendl; - - snprintf(temp, sizeof(temp), "open '%s'", target); - system(temp); /* Flawfinder: ignore */ - } - - sendDone(); - - return(NULL); -} diff --git a/indra/newview/CMakeLists.txt b/indra/newview/CMakeLists.txt index fee36a2be..d7dbce179 100644 --- a/indra/newview/CMakeLists.txt +++ b/indra/newview/CMakeLists.txt @@ -101,6 +101,7 @@ set(viewer_SOURCE_FILES hippopanelgrids.cpp importtracker.cpp jcfloaterareasearch.cpp + lffloaterinvpanel.cpp lfsimfeaturehandler.cpp lggdicdownload.cpp lgghunspell_wrapper.cpp @@ -139,6 +140,7 @@ set(viewer_SOURCE_FILES llcompilequeue.cpp llconfirmationmanager.cpp llconsole.cpp + llcrashlogger.cpp llcurrencyuimanager.cpp llcylinder.cpp lldaycyclemanager.cpp @@ -615,6 +617,7 @@ set(viewer_HEADER_FILES hippopanelgrids.h importtracker.h jcfloaterareasearch.h + lffloaterinvpanel.h lfsimfeaturehandler.h lggdicdownload.h lgghunspell_wrapper.h @@ -654,6 +657,7 @@ set(viewer_HEADER_FILES llcompilequeue.h llconfirmationmanager.h llconsole.h + llcrashlogger.h llcurrencyuimanager.h llcylinder.h lldaycyclemanager.h @@ -1526,11 +1530,33 @@ if (WINDOWS) ${CMAKE_CURRENT_SOURCE_DIR}/viewer_manifest.py ) + add_custom_command( + OUTPUT ${CMAKE_CFG_INTDIR}/copy_touched.bat + COMMAND ${PYTHON_EXECUTABLE} + ARGS + ${CMAKE_CURRENT_SOURCE_DIR}/viewer_manifest.py + --artwork=${ARTWORK_DIR} + --actions=copy + --branding_id=${VIEWER_BRANDING_ID} + --build=${CMAKE_CURRENT_BINARY_DIR} + --channel=${VIEWER_CHANNEL} + --configuration=${CMAKE_CFG_INTDIR} + --dest=${CMAKE_CURRENT_BINARY_DIR}/${CMAKE_CFG_INTDIR} + --grid=${GRID} + --login_channel=${VIEWER_LOGIN_CHANNEL} + --source=${CMAKE_CURRENT_SOURCE_DIR} + --touch=${CMAKE_CURRENT_BINARY_DIR}/${CMAKE_CFG_INTDIR}/copy_touched.bat + ${MANIFEST_LIBRARIES} + DEPENDS + ${VIEWER_BINARY_NAME} + ${CMAKE_CURRENT_SOURCE_DIR}/viewer_manifest.py + COMMENT "Performing viewer_manifest copy" + ) + add_dependencies(${VIEWER_BINARY_NAME} SLPlugin media_plugin_quicktime media_plugin_webkit basic_plugin_filepicker winmm_shim) if (PACKAGE) add_custom_target(package ALL DEPENDS ${CMAKE_CFG_INTDIR}/touched.bat) - add_dependencies(package windows-updater windows-crash-logger) endif (PACKAGE) endif (WINDOWS) @@ -1563,6 +1589,7 @@ target_link_libraries(${VIEWER_BINARY_NAME} ${LLCOMMON_LIBRARIES} ${NDOF_LIBRARY} ${viewer_LIBRARIES} + ${Boost_CONTEXT_LIBRARY} ${Boost_FILESYSTEM_LIBRARY} ${Boost_PROGRAM_OPTIONS_LIBRARY} ${Boost_REGEX_LIBRARY} @@ -1628,11 +1655,36 @@ if (LINUX) ${CMAKE_CURRENT_SOURCE_DIR}/viewer_manifest.py ) + add_custom_command( + OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/${CMAKE_CFG_INTDIR}/.${product}.copy_touched + COMMAND ${PYTHON_EXECUTABLE} + ARGS + ${CMAKE_CURRENT_SOURCE_DIR}/viewer_manifest.py + --arch=${ARCH} + --actions=copy + --artwork=${ARTWORK_DIR} + --branding_id=${VIEWER_BRANDING_ID} + --build=${CMAKE_CURRENT_BINARY_DIR} + --buildtype=${CMAKE_BUILD_TYPE} + --channel=${VIEWER_CHANNEL} + --dest=${CMAKE_CURRENT_BINARY_DIR}/packaged + --grid=${GRID} + --installer_name=${product} + --login_channel=${VIEWER_LOGIN_CHANNEL} + --source=${CMAKE_CURRENT_SOURCE_DIR} + --standalone=${STANDALONE} + ${MANIFEST_LIBRARIES} + DEPENDS + secondlife-stripped + ${CMAKE_CURRENT_SOURCE_DIR}/viewer_manifest.py + ) + add_dependencies(${VIEWER_BINARY_NAME} SLPlugin media_plugin_gstreamer010 media_plugin_webkit basic_plugin_filepicker) + add_custom_target(copy_l_viewer_manifest ALL DEPENDS ${CMAKE_CURRENT_BINARY_DIR}/${CMAKE_CFG_INTDIR}/.${product}.copy_touched) if (PACKAGE) add_custom_target(package ALL DEPENDS ${product}.tar.bz2) - add_dependencies(package linux-crash-logger-strip-target) + add_dependencies(package copy_l_viewer_manifest) endif (PACKAGE) endif (LINUX) @@ -1682,7 +1734,6 @@ if (DARWIN) if (PACKAGE) add_custom_target(package ALL DEPENDS ${VIEWER_BINARY_NAME}) - add_dependencies(package mac-updater mac-crash-logger) add_custom_command( TARGET package POST_BUILD @@ -1732,6 +1783,64 @@ if (INSTALL) include(${CMAKE_CURRENT_SOURCE_DIR}/ViewerInstall.cmake) endif (INSTALL) +if (PACKAGE) + + set(SYMBOL_SEARCH_DIRS "") + if (WINDOWS) + list(APPEND SYMBOL_SEARCH_DIRS "${CMAKE_CURRENT_BINARY_DIR}/${CMAKE_CFG_INTDIR}") + set(VIEWER_SYMBOL_FILE "${CMAKE_CURRENT_BINARY_DIR}/${CMAKE_CFG_INTDIR}/secondlife-symbols-windows.tar.bz2") + # slplugin.exe failing symbols dump - need to debug, might have to do with updated version of google breakpad + # set(VIEWER_EXE_GLOBS "${VIEWER_BINARY_NAME}${CMAKE_EXECUTABLE_SUFFIX} slplugin.exe") + set(VIEWER_EXE_GLOBS "${VIEWER_BINARY_NAME}${CMAKE_EXECUTABLE_SUFFIX}") + set(VIEWER_LIB_GLOB "*${CMAKE_SHARED_MODULE_SUFFIX}") + set(VIEWER_COPY_MANIFEST copy_w_viewer_manifest) + endif (WINDOWS) + if (DARWIN) + list(APPEND SYMBOL_SEARCH_DIRS "${CMAKE_CURRENT_BINARY_DIR}/${CMAKE_CFG_INTDIR}") + # *TODO: Generate these search dirs in the cmake files related to each binary. + list(APPEND SYMBOL_SEARCH_DIRS "${CMAKE_BINARY_DIR}/llplugin/slplugin/${CMAKE_CFG_INTDIR}") + list(APPEND SYMBOL_SEARCH_DIRS "${CMAKE_BINARY_DIR}/media_plugins/gstreamer010/${CMAKE_CFG_INTDIR}") + list(APPEND SYMBOL_SEARCH_DIRS "${CMAKE_BINARY_DIR}/media_plugins/quicktime/${CMAKE_CFG_INTDIR}") + list(APPEND SYMBOL_SEARCH_DIRS "${CMAKE_BINARY_DIR}/media_plugins/webkit/${CMAKE_CFG_INTDIR}") + set(VIEWER_SYMBOL_FILE "${CMAKE_CURRENT_BINARY_DIR}/${CMAKE_CFG_INTDIR}/secondlife-symbols-darwin.tar.bz2") + set(VIEWER_EXE_GLOBS "'Singularity' SLPlugin") + set(VIEWER_LIB_GLOB "*.dylib") + endif (DARWIN) + if (LINUX) + list(APPEND SYMBOL_SEARCH_DIRS "${CMAKE_CURRENT_BINARY_DIR}/packaged") + set(VIEWER_SYMBOL_FILE "${CMAKE_CURRENT_BINARY_DIR}/${CMAKE_CFG_INTDIR}/secondlife-symbols-linux.tar.bz2") + set(VIEWER_EXE_GLOBS "singularity-do-not-run-directly SLPlugin") + set(VIEWER_LIB_GLOB "*${CMAKE_SHARED_MODULE_SUFFIX}*") + set(VIEWER_COPY_MANIFEST copy_l_viewer_manifest) + endif (LINUX) + + if(RELEASE_CRASH_REPORTING OR NON_RELEASE_CRASH_REPORTING) + if(CMAKE_CFG_INTDIR STREQUAL ".") + set(LLBUILD_CONFIG ${CMAKE_BUILD_TYPE}) + else(CMAKE_CFG_INTDIR STREQUAL ".") + # set LLBUILD_CONFIG to be a shell variable evaluated at build time + # reflecting the configuration we are currently building. + set(LLBUILD_CONFIG ${CMAKE_CFG_INTDIR}) + endif(CMAKE_CFG_INTDIR STREQUAL ".") + add_custom_command(OUTPUT "${VIEWER_SYMBOL_FILE}" + COMMAND "${PYTHON_EXECUTABLE}" + ARGS + "${CMAKE_CURRENT_SOURCE_DIR}/generate_breakpad_symbols.py" + "${LLBUILD_CONFIG}" + "${SYMBOL_SEARCH_DIRS}" + "${VIEWER_EXE_GLOBS}" + "${VIEWER_LIB_GLOB}" + "${LIBS_PREBUILT_DIR}/${LL_ARCH_DIR}/bin/dump_syms" + "${VIEWER_SYMBOL_FILE}" + DEPENDS generate_breakpad_symbols.py + VERBATIM) + + add_custom_target(generate_breakpad_symbols DEPENDS "${VIEWER_SYMBOL_FILE}") + add_dependencies(generate_breakpad_symbols "${VIEWER_BINARY_NAME}" "${VIEWER_COPY_MANIFEST}") + add_dependencies(package generate_breakpad_symbols) + endif(RELEASE_CRASH_REPORTING OR NON_RELEASE_CRASH_REPORTING) +endif (PACKAGE) + # Add tests if (LL_TESTS) ADD_VIEWER_BUILD_TEST(llagentaccess viewer) diff --git a/indra/newview/aihttpview.cpp b/indra/newview/aihttpview.cpp index 58bc2f689..3bc6b18f7 100644 --- a/indra/newview/aihttpview.cpp +++ b/indra/newview/aihttpview.cpp @@ -80,6 +80,7 @@ void AIServiceBar::draw() U32 is_used; U32 is_inuse; int total_added; + int event_polls; int established_connections; int concurrent_connections; size_t bandwidth; @@ -88,6 +89,7 @@ void AIServiceBar::draw() is_used = per_service_r->is_used(); is_inuse = per_service_r->is_inuse(); total_added = per_service_r->mTotalAdded; + event_polls = per_service_r->mEventPolls; established_connections = per_service_r->mEstablishedConnections; concurrent_connections = per_service_r->mConcurrentConnections; bandwidth = per_service_r->bandwidth().truncateData(AIHTTPView::getTime_40ms()); @@ -107,14 +109,14 @@ void AIServiceBar::draw() { if (col < 2) { - text = llformat(" | %hu-%hu-%lu,{%hu/%hu,%u}/%u", + text = llformat(" | %hu-%hd-%lu,{%hu/%hu,%u}/%u", ct.mApprovedRequests, ct.mQueuedCommands, ct.mQueuedRequests.size(), ct.mAdded, ct.mConcurrentConnections, ct.mDownloading, ct.mMaxPipelinedRequests); } else { - text = llformat(" | --%hu-%lu,{%hu/%hu,%u}", + text = llformat(" | --%hd-%lu,{%hu/%hu,%u}", ct.mQueuedCommands, ct.mQueuedRequests.size(), ct.mAdded, ct.mConcurrentConnections, ct.mDownloading); } @@ -148,7 +150,7 @@ void AIServiceBar::draw() } start = mHTTPView->updateColumn(mc_col, start); #if defined(CWDEBUG) || defined(DEBUG_CURLIO) - text = llformat(" | %d,%d/%d", total_added, established_connections, concurrent_connections); + text = llformat(" | %d,%d,%d/%d", total_added, event_polls, established_connections, concurrent_connections); #else text = llformat(" | %d/%d", total_added, concurrent_connections); #endif @@ -227,6 +229,7 @@ void AIGLHTTPHeaderBar::draw(void) height -= sLineHeight; start = h_offset; text = "Service (host:port)"; + // This must match AICapabilityType! static char const* caption[number_of_capability_types] = { " | Textures", " | Inventory", " | Mesh", " | Other" }; @@ -288,9 +291,14 @@ AIHTTPView::~AIHTTPView() mGLHTTPHeaderBar = NULL; } -U32 AIHTTPView::updateColumn(int col, U32 start) +U32 AIHTTPView::updateColumn(U32 col, U32 start) { - llassert(col <= mStartColumn.size()); + if (col > mStartColumn.size()) + { + // This happens when AIGLHTTPHeaderBar::draw is called before AIServiceBar::draw, which + // happens when there are no services (visible) at the moment the HTTP console is opened. + return start; + } if (col == mStartColumn.size()) { mStartColumn.push_back(start); diff --git a/indra/newview/aihttpview.h b/indra/newview/aihttpview.h index 767d37e54..3fb80ea03 100644 --- a/indra/newview/aihttpview.h +++ b/indra/newview/aihttpview.h @@ -52,7 +52,7 @@ class AIHTTPView : public LLContainerView /*virtual*/ BOOL handleMouseUp(S32 x, S32 y, MASK mask); /*virtual*/ BOOL handleKey(KEY key, MASK mask, BOOL called_from_parent); - U32 updateColumn(int col, U32 start); + U32 updateColumn(U32 col, U32 start); void setWidth(S32 width) { mWidth = width; } private: diff --git a/indra/newview/app_settings/keywords.ini b/indra/newview/app_settings/keywords.ini index 503242ade..f6033d87d 100644 --- a/indra/newview/app_settings/keywords.ini +++ b/indra/newview/app_settings/keywords.ini @@ -2,128 +2,128 @@ llkeywords version 2 # sections [word .5, .1, .3] -default Name of default state that all scripts must have -state Keyword to indicate state block or state transition +default Name of default state that all scripts must have +state Keyword to indicate state block or state transition # data types [word .1, .3, .1] -integer Integer type -float Floating-point type -string String type -key Key type. Use NULL_KEY to test for empty keys -vector Vector type of 3 floats. Used to represent 3D motion, Euler angles, and color.:Access components by .x, .y. or .z -rotation Rotation type of 4 floats. Used to represent rotation.:Access components by .x, .y., .z, or .w -list List of various data types -quaternion Rotation type of 4 floats. Used to represent rotation.:Access components by .x, .y, .z, or .w +integer Integer type +float Floating-point type +string String type +key Key type. Use NULL_KEY to test for empty keys +vector Vector type of 3 floats. Used to represent 3D motion, Euler angles, and color.:Access components by .x, .y. or .z +rotation Rotation type of 4 floats. Used to represent rotation.:Access components by .x, .y., .z, or .w +list List of various data types +quaternion Rotation type of 4 floats. Used to represent rotation.:Access components by .x, .y, .z, or .w # events [word 0, .3, .5] -state_entry state_entry():Triggered on any state transition and startup -state_exit state_exit():Triggered on any state transition -touch_start touch_start(integer num_detected):Triggered by the start of agent clicking on task -touch touch(integer num_detected):Triggered while agent is clicking on task -touch_end touch_end(integer num_detected):Triggered when agent stops clicking on task -collision_start collision_start(integer num_detected):Triggered when task starts colliding with another task -collision collision(integer num_detected):Triggered while task is colliding with another task -collision_end collision_end(integer num_detected):Triggered when task stops colliding with another task -land_collision_start land_collision_start(vector pos):Triggered when task starts colliding with land -land_collision land_collision(vector pos):Triggered when task is colliding with land -land_collision_end land_collision_end(vector pos):Triggered when task stops colliding with land -timer timer():Result of the llSetTimerEvent library function call -listen listen(integer channel, string name, key id, string message):Result of the llListen library function call -sensor sensor(integer num_detected):Result of the llSensor library function call -no_sensor no_sensor():Result of the llSensor library function call -control control(key id, integer level, integer edge):Result of llTakeControls library function call -at_target at_target(integer tnum, vector targetpos, vector ourpos):Result of llTarget library function call -not_at_target not_at_target():Result of llTarget library function call -at_rot_target at_rot_target(integer tnum, rotation targetrot, rotation ourrot):Result of LLRotTarget library function call -not_at_rot_target not_at_rot_target():Result of LLRotTarget library function call -money money(key id, integer amount):Triggered when L$ is given to task -email email(string time, string address, string subj, string message, integer num_left):Triggered when task receives email -run_time_permissions run_time_permissions(integer perm):Triggered when an agent grants run time permissions to task -attach attach(key id):Triggered when task attaches or detaches from agent -dataserver dataserver(key queryid, string data):Triggered when task receives asynchronous data -moving_start moving_start():Triggered when task begins moving -moving_end moving_end():Triggered when task stops moving -on_rez on_rez(integer start_param):Triggered when task is rezzed in from inventory or another task -object_rez object_rez(key id):Triggered when task rezzes in another task -link_message link_message(integer sender_num, integer num, string str, key id):Triggered when task receives a link message via LLMessageLinked library function call -changed changed( integer change ):Triggered various event change the task:(test change with CHANGED_INVENTORY, CHANGED_COLOR, CHANGED_SHAPE, CHANGED_SCALE, CHANGED_TEXTURE, CHANGED_LINK, CHANGED_ALLOWED_DROP, CHANGED_OWNER, CHANGED_REGION, CHANGED_TELEPORT, CHANGED_REGION_START, CHANGED_MEDIA) -remote_data remote_data(integer event_type, key channel, key message_id, string sender,integer idata, string sdata):Triggered by various XML-RPC calls (event_type will be one of REMOTE_DATA_CHANNEL, REMOTE_DATA_REQUEST, REMOTE_DATA_REPLY) -http_response http_response(key request_id, integer status, list metadata, string body):Triggered when task receives a response to one of its llHTTPRequests -http_request http_request(key id, string method, string body):Triggered when task receives an http request against a public URL -transaction_result transaction_result(key id, integer success, string data): Triggered when currency is given to task -path_update path_update(integer type, list reserved):Triggered when the state of a pathfinder character changes. Note; "list reserved" is not currently used +state_entry state_entry():Triggered on any state transition and startup +state_exit state_exit():Triggered on any state transition +touch_start touch_start(integer num_detected):Triggered by the start of agent clicking on task +touch touch(integer num_detected):Triggered while agent is clicking on task +touch_end touch_end(integer num_detected):Triggered when agent stops clicking on task +collision_start collision_start(integer num_detected):Triggered when task starts colliding with another task +collision collision(integer num_detected):Triggered while task is colliding with another task +collision_end collision_end(integer num_detected):Triggered when task stops colliding with another task +land_collision_start land_collision_start(vector pos):Triggered when task starts colliding with land +land_collision land_collision(vector pos):Triggered when task is colliding with land +land_collision_end land_collision_end(vector pos):Triggered when task stops colliding with land +timer timer():Result of the llSetTimerEvent library function call +listen listen(integer channel, string name, key id, string message):Result of the llListen library function call +sensor sensor(integer num_detected):Result of the llSensor library function call +no_sensor no_sensor():Result of the llSensor library function call +control control(key id, integer level, integer edge):Result of llTakeControls library function call +at_target at_target(integer tnum, vector targetpos, vector ourpos):Result of llTarget library function call +not_at_target not_at_target():Result of llTarget library function call +at_rot_target at_rot_target(integer tnum, rotation targetrot, rotation ourrot):Result of LLRotTarget library function call +not_at_rot_target not_at_rot_target():Result of LLRotTarget library function call +money money(key id, integer amount):Triggered when L$ is given to task +email email(string time, string address, string subj, string message, integer num_left):Triggered when task receives email +run_time_permissions run_time_permissions(integer perm):Triggered when an agent grants run time permissions to task +attach attach(key id):Triggered when task attaches or detaches from agent +dataserver dataserver(key queryid, string data):Triggered when task receives asynchronous data +moving_start moving_start():Triggered when task begins moving +moving_end moving_end():Triggered when task stops moving +on_rez on_rez(integer start_param):Triggered when task is rezzed in from inventory or another task +object_rez object_rez(key id):Triggered when task rezzes in another task +link_message link_message(integer sender_num, integer num, string str, key id):Triggered when task receives a link message via LLMessageLinked library function call +changed changed( integer change ):Triggered various event change the task:(test change with CHANGED_INVENTORY, CHANGED_COLOR, CHANGED_SHAPE, CHANGED_SCALE, CHANGED_TEXTURE, CHANGED_LINK, CHANGED_ALLOWED_DROP, CHANGED_OWNER, CHANGED_REGION, CHANGED_TELEPORT, CHANGED_REGION_START, CHANGED_MEDIA) +remote_data remote_data(integer event_type, key channel, key message_id, string sender,integer idata, string sdata):Triggered by various XML-RPC calls (event_type will be one of REMOTE_DATA_CHANNEL, REMOTE_DATA_REQUEST, REMOTE_DATA_REPLY) +http_response http_response(key request_id, integer status, list metadata, string body):Triggered when task receives a response to one of its llHTTPRequests +http_request http_request(key id, string method, string body):Triggered when task receives an http request against a public URL +transaction_result transaction_result(key id, integer success, string data): Triggered when currency is given to task +path_update path_update(integer type, list reserved):Triggered when the state of a pathfinder character changes. Note; "list reserved" is not currently used # integer constants [word .1, .1, .5] -TRUE Integer constant for Boolean operations -FALSE Integer constant for Boolean operations -STATUS_PHYSICS Passed in the llSetStatus library function. If TRUE, object moves physically -STATUS_PHANTOM Passed in the llSetStatus library function. If TRUE, object doesn't collide with other objects -STATUS_ROTATE_X Passed in the llSetStatus library function. If FALSE, object doesn't rotate around local X axis -STATUS_ROTATE_Y Passed in the llSetStatus library function. If FALSE, object doesn't rotate around local Y axis -STATUS_ROTATE_Z Passed in the llSetStatus library function. If FALSE, object doesn't rotate around local Z axis -STATUS_SANDBOX Passed in the llSetStatus library function. If TRUE, object can't cross region boundaries or move more than 10 meters from its start location -STATUS_BLOCK_GRAB Passed in the llSetStatus library function. If TRUE, object can't be grabbed and physically dragged +TRUE Integer constant for Boolean operations +FALSE Integer constant for Boolean operations +STATUS_PHYSICS Passed in the llSetStatus library function. If TRUE, object moves physically +STATUS_PHANTOM Passed in the llSetStatus library function. If TRUE, object doesn't collide with other objects +STATUS_ROTATE_X Passed in the llSetStatus library function. If FALSE, object doesn't rotate around local X axis +STATUS_ROTATE_Y Passed in the llSetStatus library function. If FALSE, object doesn't rotate around local Y axis +STATUS_ROTATE_Z Passed in the llSetStatus library function. If FALSE, object doesn't rotate around local Z axis +STATUS_SANDBOX Passed in the llSetStatus library function. If TRUE, object can't cross region boundaries or move more than 10 meters from its start location +STATUS_BLOCK_GRAB Passed in the llSetStatus library function. If TRUE, object can't be grabbed and physically dragged STATUS_BLOCK_GRAB_OBJECT This status flag keeps the object from being moved by grabs. This flag applies to the entire linkset -STATUS_DIE_AT_EDGE Passed in the llSetStatus library function. If TRUE, objects that reach the edge of the world just die:rather than teleporting back to the owner -STATUS_RETURN_AT_EDGE Passed in the llSetStatus library function. If TRUE, script rezzed objects that reach the edge of the world:are returned rather than killed:STATUS_RETURN_AT_EDGE trumps STATUS_DIE_AT_EDGE if both are set -STATUS_CAST_SHADOWS Passed in the llSetStatus library function. If TRUE, object casts shadows on other objects +STATUS_DIE_AT_EDGE Passed in the llSetStatus library function. If TRUE, objects that reach the edge of the world just die:rather than teleporting back to the owner +STATUS_RETURN_AT_EDGE Passed in the llSetStatus library function. If TRUE, script rezzed objects that reach the edge of the world:are returned rather than killed:STATUS_RETURN_AT_EDGE trumps STATUS_DIE_AT_EDGE if both are set +STATUS_CAST_SHADOWS Passed in the llSetStatus library function. If TRUE, object casts shadows on other objects -AGENT Passed in llSensor library function to look for other Agents; DEPRECATED: Use AGENT_BY_LEGACY_NAME -AGENT_BY_LEGACY_NAME Passed in llSensor library function to look for other Agents by legacy name -AGENT_BY_USERNAME Passed in llSensor library function to look for other Agents by username -ACTIVE Passed in llSensor library function to look for moving objects -PASSIVE Passed in llSensor library function to look for objects that aren't moving -SCRIPTED Passed in llSensor library function to look for scripted objects -CONTROL_FWD Passed to llTakeControls library function and used control event handler to test for agent forward control -CONTROL_BACK Passed to llTakeControls library function and used control event handler to test for agent back control -CONTROL_LEFT Passed to llTakeControls library function and used control event handler to test for agent left control -CONTROL_RIGHT Passed to llTakeControls library function and used control event handler to test for agent right control -CONTROL_ROT_LEFT Passed to llTakeControls library function and used control event handler to test for agent rotate left control -CONTROL_ROT_RIGHT Passed to llTakeControls library function and used control event handler to test for agent rotate right control -CONTROL_UP Passed to llTakeControls library function and used control event handler to test for agent up control -CONTROL_DOWN Passed to llTakeControls library function and used control event handler to test for agent down control -CONTROL_LBUTTON Passed to llTakeControls library function and used control event handler to test for agent left button control -CONTROL_ML_LBUTTON Passed to llTakeControls library function and used control event handler to test for agent left button control with the agent in mouse look -PERMISSION_DEBIT Passed to llRequestPermissions library function to request permission to take L$ from agent's account -PERMISSION_TAKE_CONTROLS Passed to llRequestPermissions library function to request permission to take agent's controls -# PERMISSION_REMAP_CONTROLS Passed to llRequestPermissions library function to request permission to remap agent's controls (not implemented yet) -PERMISSION_TRIGGER_ANIMATION Passed to llRequestPermissions library function to request permission to trigger animation on agent -PERMISSION_ATTACH Passed to llRequestPermissions library function to request permission to attach/detach from agent -# PERMISSION_RELEASE_OWNERSHIP Passed to llRequestPermissions library function to request permission to release ownership (not implemented) -PERMISSION_CHANGE_LINKS Passed to llRequestPermissions library function to request permission to change links -# PERMISSION_CHANGE_JOINTS Passed to llRequestPermissions library function to request permission to change joints (not implemented) +AGENT Passed in llSensor library function to look for other Agents; DEPRECATED: Use AGENT_BY_LEGACY_NAME +AGENT_BY_LEGACY_NAME Passed in llSensor library function to look for other Agents by legacy name +AGENT_BY_USERNAME Passed in llSensor library function to look for other Agents by username +ACTIVE Passed in llSensor library function to look for moving objects +PASSIVE Passed in llSensor library function to look for objects that aren't moving +SCRIPTED Passed in llSensor library function to look for scripted objects +CONTROL_FWD Passed to llTakeControls library function and used control event handler to test for agent forward control +CONTROL_BACK Passed to llTakeControls library function and used control event handler to test for agent back control +CONTROL_LEFT Passed to llTakeControls library function and used control event handler to test for agent left control +CONTROL_RIGHT Passed to llTakeControls library function and used control event handler to test for agent right control +CONTROL_ROT_LEFT Passed to llTakeControls library function and used control event handler to test for agent rotate left control +CONTROL_ROT_RIGHT Passed to llTakeControls library function and used control event handler to test for agent rotate right control +CONTROL_UP Passed to llTakeControls library function and used control event handler to test for agent up control +CONTROL_DOWN Passed to llTakeControls library function and used control event handler to test for agent down control +CONTROL_LBUTTON Passed to llTakeControls library function and used control event handler to test for agent left button control +CONTROL_ML_LBUTTON Passed to llTakeControls library function and used control event handler to test for agent left button control with the agent in mouse look +PERMISSION_DEBIT Passed to llRequestPermissions library function to request permission to take L$ from agent's account +PERMISSION_TAKE_CONTROLS Passed to llRequestPermissions library function to request permission to take agent's controls +# PERMISSION_REMAP_CONTROLS Passed to llRequestPermissions library function to request permission to remap agent's controls (not implemented yet) +PERMISSION_TRIGGER_ANIMATION Passed to llRequestPermissions library function to request permission to trigger animation on agent +PERMISSION_ATTACH Passed to llRequestPermissions library function to request permission to attach/detach from agent +# PERMISSION_RELEASE_OWNERSHIP Passed to llRequestPermissions library function to request permission to release ownership (not implemented) +PERMISSION_CHANGE_LINKS Passed to llRequestPermissions library function to request permission to change links +# PERMISSION_CHANGE_JOINTS Passed to llRequestPermissions library function to request permission to change joints (not implemented) # PERMISSION_CHANGE_PERMISSIONS Passed to llRequestPermissions library function to request permission to change permissions -PERMISSION_TRACK_CAMERA Passed to llRequestPermissions library function to request permission to track agent's camera -PERMISSION_CONTROL_CAMERA Passed to llRequestPermissions library function to request permission to change agent's camera -PERMISSION_TELEPORT Passed to llRequestPermissions library function to request permission to teleport agent -SCRIPT_PERMISSION_SILENT_ESTATE_MANAGEMENT Passed to llRequestPermissions library function to request permission to silently modify estate access lists -PERMISSION_OVERRIDE_ANIMATIONS Passed to llRequestPermissions library function to request permission to override animations on agent -PERMISSION_RETURN_OBJECTS Passed to llRequestPermissions library function to request permission to return objects +PERMISSION_TRACK_CAMERA Passed to llRequestPermissions library function to request permission to track agent's camera +PERMISSION_CONTROL_CAMERA Passed to llRequestPermissions library function to request permission to change agent's camera +PERMISSION_TELEPORT Passed to llRequestPermissions library function to request permission to teleport agent +SCRIPT_PERMISSION_SILENT_ESTATE_MANAGEMENT Passed to llRequestPermissions library function to request permission to silently modify estate access lists +PERMISSION_OVERRIDE_ANIMATIONS Passed to llRequestPermissions library function to request permission to override animations on agent +PERMISSION_RETURN_OBJECTS Passed to llRequestPermissions library function to request permission to return objects -DEBUG_CHANNEL Chat channel reserved for debug and error messages from scripts -PUBLIC_CHANNEL Chat channel that broadcasts to all nearby users +DEBUG_CHANNEL Chat channel reserved for debug and error messages from scripts +PUBLIC_CHANNEL Chat channel that broadcasts to all nearby users -AGENT_FLYING Returned by llGetAgentInfo if the Agent is flying -AGENT_ATTACHMENTS Returned by llGetAgentInfo if the Agent has attachments -AGENT_SCRIPTED Returned by llGetAgentInfo if the Agent has scripted attachments -AGENT_SITTING Returned by llGetAgentInfo if the Agent is sitting -AGENT_ON_OBJECT Returned by llGetAgentInfo if the Agent is sitting on an object -AGENT_MOUSELOOK Returned by llGetAgentInfo if the Agent is in mouselook -AGENT_AWAY Returned by llGetAgentInfo if the Agent is in away mode -AGENT_WALKING Returned by llGetAgentInfo if the Agent is walking -AGENT_IN_AIR Returned by llGetAgentInfo if the Agent is in the air -AGENT_TYPING Returned by llGetAgentInfo if the Agent is typing -AGENT_CROUCHING Returned by llGetAgentInfo if the Agent is crouching -AGENT_BUSY Returned by llGetAgentInfo if the Agent is busy -AGENT_ALWAYS_RUN Returned by llGetAgentInfo if the Agent has 'Always Run' enabled -AGENT_AUTOPILOT Returned by llGetAgentInfo if the Agent is under autopilot control +AGENT_FLYING Returned by llGetAgentInfo if the Agent is flying +AGENT_ATTACHMENTS Returned by llGetAgentInfo if the Agent has attachments +AGENT_SCRIPTED Returned by llGetAgentInfo if the Agent has scripted attachments +AGENT_SITTING Returned by llGetAgentInfo if the Agent is sitting +AGENT_ON_OBJECT Returned by llGetAgentInfo if the Agent is sitting on an object +AGENT_MOUSELOOK Returned by llGetAgentInfo if the Agent is in mouselook +AGENT_AWAY Returned by llGetAgentInfo if the Agent is in away mode +AGENT_WALKING Returned by llGetAgentInfo if the Agent is walking +AGENT_IN_AIR Returned by llGetAgentInfo if the Agent is in the air +AGENT_TYPING Returned by llGetAgentInfo if the Agent is typing +AGENT_CROUCHING Returned by llGetAgentInfo if the Agent is crouching +AGENT_BUSY Returned by llGetAgentInfo if the Agent is busy +AGENT_ALWAYS_RUN Returned by llGetAgentInfo if the Agent has 'Always Run' enabled +AGENT_AUTOPILOT Returned by llGetAgentInfo if the Agent is under autopilot control -AGENT_LIST_PARCEL Passed to llGetAgentList to return only agents on the same parcel where the script is running +AGENT_LIST_PARCEL Passed to llGetAgentList to return only agents on the same parcel where the script is running AGENT_LIST_PARCEL_OWNER Passed to llGetAgentList to return only agents on any parcel in the region where the parcel owner is the same as the owner of the parcel under the scripted object -AGENT_LIST_REGION Passed to llGetAgentList to return any/all agents in the region +AGENT_LIST_REGION Passed to llGetAgentList to return any/all agents in the region PSYS_PART_FLAGS PSYS_PART_START_COLOR @@ -160,8 +160,8 @@ PSYS_PART_BF_SOURCE_ALPHA PSYS_PART_BF_ONE_MINUS_SOURCE_ALPHA PSYS_SRC_PATTERN -PSYS_SRC_INNERANGLE Deprecated -- Use PSYS_SRC_ANGLE_BEGIN -PSYS_SRC_OUTERANGLE Deprecated -- Use PSYS_SRC_ANGLE_END +PSYS_SRC_INNERANGLE Deprecated -- Use PSYS_SRC_ANGLE_BEGIN +PSYS_SRC_OUTERANGLE Deprecated -- Use PSYS_SRC_ANGLE_END PSYS_SRC_ANGLE_BEGIN PSYS_SRC_ANGLE_END PSYS_SRC_BURST_RATE @@ -181,408 +181,408 @@ PSYS_SRC_PATTERN_ANGLE PSYS_SRC_PATTERN_ANGLE_CONE PSYS_SRC_PATTERN_ANGLE_CONE_EMPTY -OBJECT_UNKNOWN_DETAIL Returned by llGetObjectDetails when passed an invalid object parameter type -OBJECT_NAME Used with llGetObjectDetails to get an object's name -OBJECT_DESC Used with llGetObjectDetails to get an object's description -OBJECT_POS Used with llGetObjectDetails to get an object's position -OBJECT_ROT Used with llGetObjectDetails to get an object's rotation -OBJECT_VELOCITY Used with llGetObjectDetails to get an object's velocity -OBJECT_OWNER Used with llGetObjectDetails to get an object's owner's key. Will be NULL_KEY if group owned -OBJECT_GROUP Used with llGetObjectDetails to get an object's group's key -OBJECT_CREATOR Used with llGetObjectDetails to get an object's creator's key -OBJECT_RUNNING_SCRIPT_COUNT Gets the number of running scripts attached to the object or agent -OBJECT_TOTAL_SCRIPT_COUNT Gets the number of scripts, both running and stopped, attached to the object or agent. -OBJECT_SCRIPT_MEMORY Gets the total amount of script memory allocated to the object or agent, in bytes. -OBJECT_SCRIPT_TIME Gets the total amount of average script CPU time used by the object or agent, in seconds. -OBJECT_PRIM_EQUIVALENCE Gets the prim equivalence of the object. -OBJECT_SERVER_COST Used with llGetObjectDetails to get the server cost. -OBJECT_STREAMING_COST Used with llGetObjectDetails to get the streaming (download) cost. -OBJECT_PHYSICS_COST Used with llGetObjectDetails to get the physics cost. -OBJECT_PATHFINDING_TYPE Used with llGetObjectDetails to get an object's pathfinding settings. -OBJECT_CHARACTER_TIME Used with llGetObjectDetails to get an object's average CPU time (in seconds) used by the object for navigation, if the object is a pathfinding character. Returns 0 for non-characters. -OBJECT_ROOT Used with llGetObjectDetails to get an object's root prim ID. -OBJECT_ATTACHED_POINT Used with llGetObjectDetails to get an object's attachment point. -OBJECT_RETURN_PARCEL Used with llReturnObjectsByOwner to return all objects on the same parcel as the script which are owned by 'owner'. -OBJECT_RETURN_PARCEL_OWNER Used with llReturnObjectsByOwner to return all objects owned by 'owner' which are over parcels owned by the owner of the script. -OBJECT_RETURN_REGION Used with llReturnObjectsByOwner to return all objects in the region owned by 'owner' - only works when the script is owned by the estate owner or an estate manager. +OBJECT_UNKNOWN_DETAIL Returned by llGetObjectDetails when passed an invalid object parameter type +OBJECT_NAME Used with llGetObjectDetails to get an object's name +OBJECT_DESC Used with llGetObjectDetails to get an object's description +OBJECT_POS Used with llGetObjectDetails to get an object's position +OBJECT_ROT Used with llGetObjectDetails to get an object's rotation +OBJECT_VELOCITY Used with llGetObjectDetails to get an object's velocity +OBJECT_OWNER Used with llGetObjectDetails to get an object's owner's key. Will be NULL_KEY if group owned +OBJECT_GROUP Used with llGetObjectDetails to get an object's group's key +OBJECT_CREATOR Used with llGetObjectDetails to get an object's creator's key +OBJECT_RUNNING_SCRIPT_COUNT Gets the number of running scripts attached to the object or agent +OBJECT_TOTAL_SCRIPT_COUNT Gets the number of scripts, both running and stopped, attached to the object or agent. +OBJECT_SCRIPT_MEMORY Gets the total amount of script memory allocated to the object or agent, in bytes. +OBJECT_SCRIPT_TIME Gets the total amount of average script CPU time used by the object or agent, in seconds. +OBJECT_PRIM_EQUIVALENCE Gets the prim equivalence of the object. +OBJECT_SERVER_COST Used with llGetObjectDetails to get the server cost. +OBJECT_STREAMING_COST Used with llGetObjectDetails to get the streaming (download) cost. +OBJECT_PHYSICS_COST Used with llGetObjectDetails to get the physics cost. +OBJECT_PATHFINDING_TYPE Used with llGetObjectDetails to get an object's pathfinding settings. +OBJECT_CHARACTER_TIME Used with llGetObjectDetails to get an object's average CPU time (in seconds) used by the object for navigation, if the object is a pathfinding character. Returns 0 for non-characters. +OBJECT_ROOT Used with llGetObjectDetails to get an object's root prim ID. +OBJECT_ATTACHED_POINT Used with llGetObjectDetails to get an object's attachment point. +OBJECT_RETURN_PARCEL Used with llReturnObjectsByOwner to return all objects on the same parcel as the script which are owned by 'owner'. +OBJECT_RETURN_PARCEL_OWNER Used with llReturnObjectsByOwner to return all objects owned by 'owner' which are over parcels owned by the owner of the script. +OBJECT_RETURN_REGION Used with llReturnObjectsByOwner to return all objects in the region owned by 'owner' - only works when the script is owned by the estate owner or an estate manager. -OPT_UNKNOWN Returned object pathfinding type by llGetObjectDetails for attachments, Linden trees and grass. -OPT_LEGACY_LINKSET Returned object pathfinding type by llGetObjectDetails for movable obstacles, movable phantoms, physical, and volumedetect objects. -OPT_AVATAR Returned object pathfinding type by llGetObjectDetails for avatars. -OPT_PATHFINDING_CHARACTER Returned object pathfinding type by llGetObjectDetails for pathfinding characters. -OPT_WALKABLE Returned object pathfinding type by llGetObjectDetails for walkable objects. -OPT_STATIC_OBSTACLE Returned object pathfinding type by llGetObjectDetails for static obstacles. -OPT_MATERIAL_VOLUME Returned object pathfinding type by llGetObjectDetails for material volumes. -OPT_EXCLUSION_VOLUME Returned object pathfinding type by llGetObjectDetails for exclusion volumes. +OPT_UNKNOWN Returned object pathfinding type by llGetObjectDetails for attachments, Linden trees and grass. +OPT_LEGACY_LINKSET Returned object pathfinding type by llGetObjectDetails for movable obstacles, movable phantoms, physical, and volumedetect objects. +OPT_AVATAR Returned object pathfinding type by llGetObjectDetails for avatars. +OPT_PATHFINDING_CHARACTER Returned object pathfinding type by llGetObjectDetails for pathfinding characters. +OPT_WALKABLE Returned object pathfinding type by llGetObjectDetails for walkable objects. +OPT_STATIC_OBSTACLE Returned object pathfinding type by llGetObjectDetails for static obstacles. +OPT_MATERIAL_VOLUME Returned object pathfinding type by llGetObjectDetails for material volumes. +OPT_EXCLUSION_VOLUME Returned object pathfinding type by llGetObjectDetails for exclusion volumes. # some vehicle params -VEHICLE_TYPE_NONE Used with llSetVehicleType to turn off vehicle support -VEHICLE_TYPE_SLED Used with llSetVehicleType to make a simple vehicle that bumps along the ground, and likes to move along its local x-axis -VEHICLE_TYPE_CAR Used with llSetVehicleType to make a vehicle that bounces along the ground but needs the motors to be driven from external controls or timer events -VEHICLE_TYPE_BOAT Used with llSetVehicleType to make a vehicle that hovers over water with lots of friction and some angular deflection -VEHICLE_TYPE_AIRPLANE Used with llSetVehicleType to make a vehicle that uses linear deflection for lift, and banking to turn, but doesn't hover -VEHICLE_TYPE_BALLOON Used with llSetVehicleType to make a vehicle that uses hover, and friction, but doesn't use deflection +VEHICLE_TYPE_NONE Used with llSetVehicleType to turn off vehicle support +VEHICLE_TYPE_SLED Used with llSetVehicleType to make a simple vehicle that bumps along the ground, and likes to move along its local x-axis +VEHICLE_TYPE_CAR Used with llSetVehicleType to make a vehicle that bounces along the ground but needs the motors to be driven from external controls or timer events +VEHICLE_TYPE_BOAT Used with llSetVehicleType to make a vehicle that hovers over water with lots of friction and some angular deflection +VEHICLE_TYPE_AIRPLANE Used with llSetVehicleType to make a vehicle that uses linear deflection for lift, and banking to turn, but doesn't hover +VEHICLE_TYPE_BALLOON Used with llSetVehicleType to make a vehicle that uses hover, and friction, but doesn't use deflection -VEHICLE_REFERENCE_FRAME Rotation of vehicle axes relative to local frame +VEHICLE_REFERENCE_FRAME Rotation of vehicle axes relative to local frame -VEHICLE_LINEAR_FRICTION_TIMESCALE A vector of timescales for exponential decay of linear velocity along the three vehicle axes -VEHICLE_ANGULAR_FRICTION_TIMESCALE A vector of timescales for exponential decay of angular velocity about the three vehicle axes -VEHICLE_LINEAR_MOTOR_DIRECTION The linear velocity that the vehicle will try to achieve -VEHICLE_LINEAR_MOTOR_OFFSET An offset from the center of mass of the vehicle where the linear motor is applied -VEHICLE_ANGULAR_MOTOR_DIRECTION The angular velocity that the vehicle will try to achieve +VEHICLE_LINEAR_FRICTION_TIMESCALE A vector of timescales for exponential decay of linear velocity along the three vehicle axes +VEHICLE_ANGULAR_FRICTION_TIMESCALE A vector of timescales for exponential decay of angular velocity about the three vehicle axes +VEHICLE_LINEAR_MOTOR_DIRECTION The linear velocity that the vehicle will try to achieve +VEHICLE_LINEAR_MOTOR_OFFSET An offset from the center of mass of the vehicle where the linear motor is applied +VEHICLE_ANGULAR_MOTOR_DIRECTION The angular velocity that the vehicle will try to achieve -VEHICLE_HOVER_HEIGHT The height the vehicle will try to hover -VEHICLE_HOVER_EFFICIENCY A slider between 0 (bouncy) and 1 (critically damped) hover behavior -VEHICLE_HOVER_TIMESCALE The period of time for the vehicle to achieve its hover height -VEHICLE_BUOYANCY A slider between 0 (no anti-gravity) and 1 (full anti-gravity) +VEHICLE_HOVER_HEIGHT The height the vehicle will try to hover +VEHICLE_HOVER_EFFICIENCY A slider between 0 (bouncy) and 1 (critically damped) hover behavior +VEHICLE_HOVER_TIMESCALE The period of time for the vehicle to achieve its hover height +VEHICLE_BUOYANCY A slider between 0 (no anti-gravity) and 1 (full anti-gravity) -VEHICLE_LINEAR_DEFLECTION_EFFICIENCY A slider between 0 (no deflection) and 1 (maximum strength) -VEHICLE_LINEAR_DEFLECTION_TIMESCALE The exponential timescale for the vehicle to redirect its velocity to be along its x-axis +VEHICLE_LINEAR_DEFLECTION_EFFICIENCY A slider between 0 (no deflection) and 1 (maximum strength) +VEHICLE_LINEAR_DEFLECTION_TIMESCALE The exponential timescale for the vehicle to redirect its velocity to be along its x-axis -VEHICLE_LINEAR_MOTOR_TIMESCALE The exponential timescale for the vehicle to achive its full linear motor velocity -VEHICLE_LINEAR_MOTOR_DECAY_TIMESCALE The exponential timescale for the linear motor's effectiveness to decay toward zero +VEHICLE_LINEAR_MOTOR_TIMESCALE The exponential timescale for the vehicle to achive its full linear motor velocity +VEHICLE_LINEAR_MOTOR_DECAY_TIMESCALE The exponential timescale for the linear motor's effectiveness to decay toward zero -VEHICLE_ANGULAR_DEFLECTION_EFFICIENCY A slider between 0 (no deflection) and 1 (maximum strength) -VEHICLE_ANGULAR_DEFLECTION_TIMESCALE The exponential timescale for the vehicle to achieve full angular deflection +VEHICLE_ANGULAR_DEFLECTION_EFFICIENCY A slider between 0 (no deflection) and 1 (maximum strength) +VEHICLE_ANGULAR_DEFLECTION_TIMESCALE The exponential timescale for the vehicle to achieve full angular deflection -VEHICLE_ANGULAR_MOTOR_TIMESCALE The exponential timescale for the vehicle to achive its full angular motor velocity -VEHICLE_ANGULAR_MOTOR_DECAY_TIMESCALE The exponential timescale for the angular motor's effectiveness to decay toward zero +VEHICLE_ANGULAR_MOTOR_TIMESCALE The exponential timescale for the vehicle to achive its full angular motor velocity +VEHICLE_ANGULAR_MOTOR_DECAY_TIMESCALE The exponential timescale for the angular motor's effectiveness to decay toward zero -VEHICLE_VERTICAL_ATTRACTION_EFFICIENCY A slider between 0 (bouncy) and 1 (critically damped) attraction of vehicle z-axis to world z-axis (vertical) -VEHICLE_VERTICAL_ATTRACTION_TIMESCALE The exponential timescale for the vehicle to align its z-axis to the world z-axis (vertical) +VEHICLE_VERTICAL_ATTRACTION_EFFICIENCY A slider between 0 (bouncy) and 1 (critically damped) attraction of vehicle z-axis to world z-axis (vertical) +VEHICLE_VERTICAL_ATTRACTION_TIMESCALE The exponential timescale for the vehicle to align its z-axis to the world z-axis (vertical) -VEHICLE_BANKING_EFFICIENCY A slider between -1 (leans out of turns), 0 (no banking), and +1 (leans into turns) -VEHICLE_BANKING_MIX A slider between 0 (static banking) and 1 (dynamic banking) -VEHICLE_BANKING_TIMESCALE The exponential timescale for the banking behavior to take full effect +VEHICLE_BANKING_EFFICIENCY A slider between -1 (leans out of turns), 0 (no banking), and +1 (leans into turns) +VEHICLE_BANKING_MIX A slider between 0 (static banking) and 1 (dynamic banking) +VEHICLE_BANKING_TIMESCALE The exponential timescale for the banking behavior to take full effect -VEHICLE_FLAG_NO_DEFLECTION_UP Prevents linear deflection along world-z axis -VEHICLE_FLAG_LIMIT_ROLL_ONLY Removes vertical attraction for changes in vehicle pitch -VEHICLE_FLAG_HOVER_WATER_ONLY Hover only pays attention to water level -VEHICLE_FLAG_HOVER_TERRAIN_ONLY Hover only pays attention to terrain height -VEHICLE_FLAG_HOVER_GLOBAL_HEIGHT Hover only pays attention to global height -VEHICLE_FLAG_HOVER_UP_ONLY Hover only pushes up -VEHICLE_FLAG_LIMIT_MOTOR_UP Prevents ground vehicles from motoring into the sky -VEHICLE_FLAG_MOUSELOOK_STEER Makes vehicle try to turn toward mouselook direction -VEHICLE_FLAG_MOUSELOOK_BANK Makes vehicle try to turn toward mouselook direction assuming banking is enabled -VEHICLE_FLAG_CAMERA_DECOUPLED Causes the camera look-at axis to NOT move when the vehicle rotates +VEHICLE_FLAG_NO_DEFLECTION_UP Prevents linear deflection along world-z axis +VEHICLE_FLAG_LIMIT_ROLL_ONLY Removes vertical attraction for changes in vehicle pitch +VEHICLE_FLAG_HOVER_WATER_ONLY Hover only pays attention to water level +VEHICLE_FLAG_HOVER_TERRAIN_ONLY Hover only pays attention to terrain height +VEHICLE_FLAG_HOVER_GLOBAL_HEIGHT Hover only pays attention to global height +VEHICLE_FLAG_HOVER_UP_ONLY Hover only pushes up +VEHICLE_FLAG_LIMIT_MOTOR_UP Prevents ground vehicles from motoring into the sky +VEHICLE_FLAG_MOUSELOOK_STEER Makes vehicle try to turn toward mouselook direction +VEHICLE_FLAG_MOUSELOOK_BANK Makes vehicle try to turn toward mouselook direction assuming banking is enabled +VEHICLE_FLAG_CAMERA_DECOUPLED Causes the camera look-at axis to NOT move when the vehicle rotates -CAMERA_PITCH (-45 to 80) (Adjusts the angular amount that the camera aims straight ahead vs. straight down, maintaining the same distance. Analogous to 'incidence'.") -CAMERA_FOCUS_OFFSET (-10 to 10) A vector that adjusts the position of the camera focus position relative to the subject -CAMERA_POSITION_LAG (0.0 to 3.0) How much the camera lags as it tries to move towards its 'ideal' position -CAMERA_FOCUS_LAG (0.0 to 3.0) How much the camera lags as it tries to aim towards the subject -CAMERA_DISTANCE (0.5 to 10) Sets how far away the camera wants to be from its subject -CAMERA_BEHINDNESS_ANGLE (0 to 180) Sets the angle in degrees within which the camera is not constrained by changes in subject rotation -CAMERA_BEHINDNESS_LAG (0.0 to 3.0) Sets how strongly the camera is forced to stay behind the target if outside of behindness angle -CAMERA_POSITION_THRESHOLD (0.0 to 4.0) Sets the radius of a sphere around the camera's ideal position within which it is not affected by subject motion -CAMERA_FOCUS_THRESHOLD (0.0 to 4.0) Sets the radius of a sphere around the camera's subject position within which its focus is not affected by subject motion -CAMERA_ACTIVE (0 or 1) Turns on or off scripted control of the camera -CAMERA_POSITION Sets the position of the camera -CAMERA_FOCUS Sets the focus (target position) of the camera -CAMERA_POSITION_LOCKED (0 or 1) Locks the camera position so it will not move -CAMERA_FOCUS_LOCKED (0 or 1) Locks the camera focus so it will not move +CAMERA_PITCH (-45 to 80) (Adjusts the angular amount that the camera aims straight ahead vs. straight down, maintaining the same distance. Analogous to 'incidence'.") +CAMERA_FOCUS_OFFSET (-10 to 10) A vector that adjusts the position of the camera focus position relative to the subject +CAMERA_POSITION_LAG (0.0 to 3.0) How much the camera lags as it tries to move towards its 'ideal' position +CAMERA_FOCUS_LAG (0.0 to 3.0) How much the camera lags as it tries to aim towards the subject +CAMERA_DISTANCE (0.5 to 10) Sets how far away the camera wants to be from its subject +CAMERA_BEHINDNESS_ANGLE (0 to 180) Sets the angle in degrees within which the camera is not constrained by changes in subject rotation +CAMERA_BEHINDNESS_LAG (0.0 to 3.0) Sets how strongly the camera is forced to stay behind the target if outside of behindness angle +CAMERA_POSITION_THRESHOLD (0.0 to 4.0) Sets the radius of a sphere around the camera's ideal position within which it is not affected by subject motion +CAMERA_FOCUS_THRESHOLD (0.0 to 4.0) Sets the radius of a sphere around the camera's subject position within which its focus is not affected by subject motion +CAMERA_ACTIVE (0 or 1) Turns on or off scripted control of the camera +CAMERA_POSITION Sets the position of the camera +CAMERA_FOCUS Sets the focus (target position) of the camera +CAMERA_POSITION_LOCKED (0 or 1) Locks the camera position so it will not move +CAMERA_FOCUS_LOCKED (0 or 1) Locks the camera focus so it will not move -INVENTORY_TEXTURE Passed to task inventory library functions to reference textures -INVENTORY_SOUND Passed to task inventory library functions to reference sounds -INVENTORY_OBJECT Passed to task inventory library functions to reference objects -INVENTORY_SCRIPT Passed to task inventory library functions to reference scripts -INVENTORY_LANDMARK Passed to task inventory library functions to reference landmarks -INVENTORY_CLOTHING Passed to task inventory library functions to reference clothing -INVENTORY_NOTECARD Passed to task inventory library functions to reference notecards -INVENTORY_BODYPART Passed to task inventory library functions to reference body parts -INVENTORY_ANIMATION Passed to task inventory library functions to reference animations -INVENTORY_GESTURE Passed to task inventory library functions to reference gestures -INVENTORY_ALL Passed to task inventory library functions to reference all inventory items -INVENTORY_NONE Returned by llGetInventoryType when no item is found +INVENTORY_TEXTURE Passed to task inventory library functions to reference textures +INVENTORY_SOUND Passed to task inventory library functions to reference sounds +INVENTORY_OBJECT Passed to task inventory library functions to reference objects +INVENTORY_SCRIPT Passed to task inventory library functions to reference scripts +INVENTORY_LANDMARK Passed to task inventory library functions to reference landmarks +INVENTORY_CLOTHING Passed to task inventory library functions to reference clothing +INVENTORY_NOTECARD Passed to task inventory library functions to reference notecards +INVENTORY_BODYPART Passed to task inventory library functions to reference body parts +INVENTORY_ANIMATION Passed to task inventory library functions to reference animations +INVENTORY_GESTURE Passed to task inventory library functions to reference gestures +INVENTORY_ALL Passed to task inventory library functions to reference all inventory items +INVENTORY_NONE Returned by llGetInventoryType when no item is found -ATTACH_CHEST Passed to llAttachToAvatar to attach task to chest -ATTACH_HEAD Passed to llAttachToAvatar to attach task to head -ATTACH_LSHOULDER Passed to llAttachToAvatar to attach task to left shoulder -ATTACH_RSHOULDER Passed to llAttachToAvatar to attach task to right shoulder -ATTACH_LHAND Passed to llAttachToAvatar to attach task to left hand -ATTACH_RHAND Passed to llAttachToAvatar to attach task to right hand -ATTACH_LFOOT Passed to llAttachToAvatar to attach task to left foot -ATTACH_RFOOT Passed to llAttachToAvatar to attach task to right foot -ATTACH_BACK Passed to llAttachToAvatar to attach task to back -ATTACH_PELVIS Passed to llAttachToAvatar to attach task to pelvis -ATTACH_MOUTH Passed to llAttachToAvatar to attach task to mouth -ATTACH_CHIN Passed to llAttachToAvatar to attach task to chin -ATTACH_LEAR Passed to llAttachToAvatar to attach task to left ear -ATTACH_REAR Passed to llAttachToAvatar to attach task to right ear -ATTACH_LEYE Passed to llAttachToAvatar to attach task to left eye -ATTACH_REYE Passed to llAttachToAvatar to attach task to right eye -ATTACH_NOSE Passed to llAttachToAvatar to attach task to nose -ATTACH_RUARM Passed to llAttachToAvatar to attach task to right upper arm -ATTACH_RLARM Passed to llAttachToAvatar to attach task to right lower arm -ATTACH_LUARM Passed to llAttachToAvatar to attach task to left upper arm -ATTACH_LLARM Passed to llAttachToAvatar to attach task to left lower arm -ATTACH_RHIP Passed to llAttachToAvatar to attach task to right hip -ATTACH_RULEG Passed to llAttachToAvatar to attach task to right upper leg -ATTACH_RLLEG Passed to llAttachToAvatar to attach task to right lower leg -ATTACH_LHIP Passed to llAttachToAvatar to attach task to left hip -ATTACH_LULEG Passed to llAttachToAvatar to attach task to left upper leg -ATTACH_LLLEG Passed to llAttachToAvatar to attach task to left lower leg -ATTACH_BELLY Passed to llAttachToAvatar to attach task to belly -ATTACH_LEFT_PEC Passed to llAttachToAvatar to attach task to left pectoral -ATTACH_RIGHT_PEC Passed to llAttachToAvatar to attach task to right pectoral -ATTACH_HUD_BOTTOM Passed to llAttachToAvatar to attach task to bottom hud area -ATTACH_HUD_BOTTOM_LEFT Passed to llAttachToAvatar to attach task to bottom left hud area -ATTACH_HUD_BOTTOM_RIGHT Passed to llAttachToAvatar to attach task to bottom right hud area -ATTACH_HUD_CENTER_1 Passed to llAttachToAvatar to attach task to center 1 hud area -ATTACH_HUD_CENTER_2 Passed to llAttachToAvatar to attach task to center 2 hud area -ATTACH_HUD_TOP_CENTER Passed to llAttachToAvatar to attach task to top center hud area -ATTACH_HUD_TOP_LEFT Passed to llAttachToAvatar to attach task to top left hud area -ATTACH_HUD_TOP_RIGHT Passed to llAttachToAvatar to attach task to top right hud area -ATTACH_NECK Passed to llAttachToAvatar to attach task to neck -ATTACH_AVATAR_CENTER Passed to llAttachToAvatar to attach task to avatar center +ATTACH_CHEST Passed to llAttachToAvatar to attach task to chest +ATTACH_HEAD Passed to llAttachToAvatar to attach task to head +ATTACH_LSHOULDER Passed to llAttachToAvatar to attach task to left shoulder +ATTACH_RSHOULDER Passed to llAttachToAvatar to attach task to right shoulder +ATTACH_LHAND Passed to llAttachToAvatar to attach task to left hand +ATTACH_RHAND Passed to llAttachToAvatar to attach task to right hand +ATTACH_LFOOT Passed to llAttachToAvatar to attach task to left foot +ATTACH_RFOOT Passed to llAttachToAvatar to attach task to right foot +ATTACH_BACK Passed to llAttachToAvatar to attach task to back +ATTACH_PELVIS Passed to llAttachToAvatar to attach task to pelvis +ATTACH_MOUTH Passed to llAttachToAvatar to attach task to mouth +ATTACH_CHIN Passed to llAttachToAvatar to attach task to chin +ATTACH_LEAR Passed to llAttachToAvatar to attach task to left ear +ATTACH_REAR Passed to llAttachToAvatar to attach task to right ear +ATTACH_LEYE Passed to llAttachToAvatar to attach task to left eye +ATTACH_REYE Passed to llAttachToAvatar to attach task to right eye +ATTACH_NOSE Passed to llAttachToAvatar to attach task to nose +ATTACH_RUARM Passed to llAttachToAvatar to attach task to right upper arm +ATTACH_RLARM Passed to llAttachToAvatar to attach task to right lower arm +ATTACH_LUARM Passed to llAttachToAvatar to attach task to left upper arm +ATTACH_LLARM Passed to llAttachToAvatar to attach task to left lower arm +ATTACH_RHIP Passed to llAttachToAvatar to attach task to right hip +ATTACH_RULEG Passed to llAttachToAvatar to attach task to right upper leg +ATTACH_RLLEG Passed to llAttachToAvatar to attach task to right lower leg +ATTACH_LHIP Passed to llAttachToAvatar to attach task to left hip +ATTACH_LULEG Passed to llAttachToAvatar to attach task to left upper leg +ATTACH_LLLEG Passed to llAttachToAvatar to attach task to left lower leg +ATTACH_BELLY Passed to llAttachToAvatar to attach task to belly +ATTACH_LEFT_PEC Passed to llAttachToAvatar to attach task to left pectoral +ATTACH_RIGHT_PEC Passed to llAttachToAvatar to attach task to right pectoral +ATTACH_HUD_BOTTOM Passed to llAttachToAvatar to attach task to bottom hud area +ATTACH_HUD_BOTTOM_LEFT Passed to llAttachToAvatar to attach task to bottom left hud area +ATTACH_HUD_BOTTOM_RIGHT Passed to llAttachToAvatar to attach task to bottom right hud area +ATTACH_HUD_CENTER_1 Passed to llAttachToAvatar to attach task to center 1 hud area +ATTACH_HUD_CENTER_2 Passed to llAttachToAvatar to attach task to center 2 hud area +ATTACH_HUD_TOP_CENTER Passed to llAttachToAvatar to attach task to top center hud area +ATTACH_HUD_TOP_LEFT Passed to llAttachToAvatar to attach task to top left hud area +ATTACH_HUD_TOP_RIGHT Passed to llAttachToAvatar to attach task to top right hud area +ATTACH_NECK Passed to llAttachToAvatar to attach task to neck +ATTACH_AVATAR_CENTER Passed to llAttachToAvatar to attach task to avatar center -LAND_LEVEL Passed to llModifyLand to level terrain -LAND_RAISE Passed to llModifyLand to raise terrain -LAND_LOWER Passed to llModifyLand to lower terrain -LAND_SMOOTH Passed to llModifyLand to smooth terrain -LAND_NOISE Passed to llModifyLand to randomize terrain -LAND_REVERT Passed to llModifyLand to revert terrain toward original state -LAND_SMALL_BRUSH Passed to llModifyLand to modify small land areas -LAND_MEDIUM_BRUSH Passed to llModifyLand to modify medium land areas -LAND_LARGE_BRUSH Passed to llModifyLand to modify large land areas +LAND_LEVEL Passed to llModifyLand to level terrain +LAND_RAISE Passed to llModifyLand to raise terrain +LAND_LOWER Passed to llModifyLand to lower terrain +LAND_SMOOTH Passed to llModifyLand to smooth terrain +LAND_NOISE Passed to llModifyLand to randomize terrain +LAND_REVERT Passed to llModifyLand to revert terrain toward original state +LAND_SMALL_BRUSH Passed to llModifyLand to modify small land areas +LAND_MEDIUM_BRUSH Passed to llModifyLand to modify medium land areas +LAND_LARGE_BRUSH Passed to llModifyLand to modify large land areas -DATA_PAYINFO Passed to llRequestAgentData to get payment status of an agent -DATA_ONLINE Passed to llRequestAgentData to determine if agent is online -DATA_NAME Passed to llRequestAgentData to get full agent name -DATA_BORN Passed to llRequestAgentData to get born on date as a string -DATA_RATING Passed to llRequestAgentData to get a comma separated sting of integer ratings -DATA_SIM_POS Passed to llRequestSimulatorData to get a string (cast to vector) of a simulator's global position -DATA_SIM_STATUS Passed to llRequestSimulatorData to get the status of a simulator -DATA_SIM_RATING Passed to llRequestSimulatorData to get the rating of a simulator +DATA_PAYINFO Passed to llRequestAgentData to get payment status of an agent +DATA_ONLINE Passed to llRequestAgentData to determine if agent is online +DATA_NAME Passed to llRequestAgentData to get full agent name +DATA_BORN Passed to llRequestAgentData to get born on date as a string +DATA_RATING Passed to llRequestAgentData to get a comma separated sting of integer ratings +DATA_SIM_POS Passed to llRequestSimulatorData to get a string (cast to vector) of a simulator's global position +DATA_SIM_STATUS Passed to llRequestSimulatorData to get the status of a simulator +DATA_SIM_RATING Passed to llRequestSimulatorData to get the rating of a simulator -PAYMENT_INFO_ON_FILE Used with llRequestAgentData to tell if Agent is of "Payment Info On File" status -PAYMENT_INFO_USED Used with llRequestAgentData to tell if Agent is of "Payment Info Used" status +PAYMENT_INFO_ON_FILE Used with llRequestAgentData to tell if Agent is of "Payment Info On File" status +PAYMENT_INFO_USED Used with llRequestAgentData to tell if Agent is of "Payment Info Used" status -ANIM_ON Enable texture animation -LOOP Loop when animating textures -REVERSE Animate in the reverse direction -PING_PONG Animate forward, then reverse -SMOOTH Textures slides, instead of stepping -ROTATE Rotates the texture, instead of using frames -SCALE Scales the texture, instead of using frames +ANIM_ON Enable texture animation +LOOP Loop when animating textures +REVERSE Animate in the reverse direction +PING_PONG Animate forward, then reverse +SMOOTH Textures slides, instead of stepping +ROTATE Rotates the texture, instead of using frames +SCALE Scales the texture, instead of using frames -ALL_SIDES Passed to various texture and color library functions to modify all sides +ALL_SIDES Passed to various texture and color library functions to modify all sides -LINK_SET Passed to various link functions to modify all blocks in the object -LINK_ROOT Passed to various link functions to modify only the root block (no effect on single block objects) -LINK_ALL_OTHERS Passed to various link functions to modify all other blocks in the object -LINK_ALL_CHILDREN Passed to various link functions to modify all child blocks in the object -LINK_THIS Passed to various link functions to modify only the calling block +LINK_SET Passed to various link functions to modify all blocks in the object +LINK_ROOT Passed to various link functions to modify only the root block (no effect on single block objects) +LINK_ALL_OTHERS Passed to various link functions to modify all other blocks in the object +LINK_ALL_CHILDREN Passed to various link functions to modify all child blocks in the object +LINK_THIS Passed to various link functions to modify only the calling block -CHANGED_INVENTORY Parameter of changed event handler used to indicate change to task's inventory -CHANGED_COLOR Parameter of changed event handler used to indicate change to task's color -CHANGED_SHAPE Parameter of changed event handler used to indicate change to task's shape parameters -CHANGED_SCALE Parameter of changed event handler used to indicate change to task's scale -CHANGED_TEXTURE Parameter of changed event handler used to indicate change to task's texture -CHANGED_LINK Parameter of changed event handler used to indicate change to task's link status -CHANGED_ALLOWED_DROP Parameter of changed event handler used to indicate a user dropped an inventory item:onto task that was allowed only by llAllowInventoryDrop function call -CHANGED_OWNER Parameter of changed event handler used to indicate change to task's owner ONLY when an object is sold as original or deeded to group -CHANGED_REGION Parameter of changed event handler used to indicate the region has changed -CHANGED_TELEPORT Parameter of changed event handler used to indicate teleport has completed -CHANGED_REGION_START Parameter of changed event handler used to indicate the region has been restarted -CHANGED_MEDIA Parameter of changed event handler used to indicate that media has changed on a face of the task +CHANGED_INVENTORY Parameter of changed event handler used to indicate change to task's inventory +CHANGED_COLOR Parameter of changed event handler used to indicate change to task's color +CHANGED_SHAPE Parameter of changed event handler used to indicate change to task's shape parameters +CHANGED_SCALE Parameter of changed event handler used to indicate change to task's scale +CHANGED_TEXTURE Parameter of changed event handler used to indicate change to task's texture +CHANGED_LINK Parameter of changed event handler used to indicate change to task's link status +CHANGED_ALLOWED_DROP Parameter of changed event handler used to indicate a user dropped an inventory item:onto task that was allowed only by llAllowInventoryDrop function call +CHANGED_OWNER Parameter of changed event handler used to indicate change to task's owner ONLY when an object is sold as original or deeded to group +CHANGED_REGION Parameter of changed event handler used to indicate the region has changed +CHANGED_TELEPORT Parameter of changed event handler used to indicate teleport has completed +CHANGED_REGION_START Parameter of changed event handler used to indicate the region has been restarted +CHANGED_MEDIA Parameter of changed event handler used to indicate that media has changed on a face of the task -TYPE_INTEGER Indicates that the list entry is holding an integer -TYPE_FLOAT Indicates that the list entry is holding an float -TYPE_STRING Indicates that the list entry is holding an string -TYPE_KEY Indicates that the list entry is holding an key -TYPE_VECTOR Indicates that the list entry is holding an vector -TYPE_ROTATION Indicates that the list entry is holding an rotation -TYPE_INVALID Indicates that this wasn't a valid list entry +TYPE_INTEGER Indicates that the list entry is holding an integer +TYPE_FLOAT Indicates that the list entry is holding an float +TYPE_STRING Indicates that the list entry is holding an string +TYPE_KEY Indicates that the list entry is holding an key +TYPE_VECTOR Indicates that the list entry is holding an vector +TYPE_ROTATION Indicates that the list entry is holding an rotation +TYPE_INVALID Indicates that this wasn't a valid list entry -REMOTE_DATA_CHANNEL Value of event_type in remote_event after successful llOpenRemoteDataChannel -REMOTE_DATA_REQUEST Value of event_type in remote_event if XML-RPC request is received -REMOTE_DATA_REPLY Value of event_type in remote_event if XML-RPC reply is received +REMOTE_DATA_CHANNEL Value of event_type in remote_event after successful llOpenRemoteDataChannel +REMOTE_DATA_REQUEST Value of event_type in remote_event if XML-RPC request is received +REMOTE_DATA_REPLY Value of event_type in remote_event if XML-RPC reply is received -PRIM_NAME Sets the prim's name -PRIM_DESC Sets the prim's description -PRIM_TYPE Followed by PRIM_TYPE_BOX, PRIM_TYPE_CYLINDER, PRIM_TYPE_PRISM, PRIM_TYPE_SPHERE, PRIM_TYPE_TORUS, PRIM_TYPE_TUBE, or PRIM_TYPE_SCULPT and their arguments -PRIM_MATERIAL Followed by PRIM_MATERIAL_STONE, PRIM_MATERIAL_METAL, PRIM_MATERIAL_GLASS, PRIM_MATERIAL_WOOD, PRIM_MATERIAL_FLESH, PRIM_MATERIAL_PLASTIC, or PRIM_MATERIAL_RUBBER -PRIM_PHYSICS Sets physics to TRUE or FALSE -PRIM_FLEXIBLE Followed by TRUE or FALSE, integer softness, float gravity, float friction, float wind, float tension, and vector force -PRIM_POINT_LIGHT Followed by TRUE or FALSE, vector color, float intensity, float radius, float falloff -PRIM_TEMP_ON_REZ Sets temporary on rez to TRUE or FALSE -PRIM_PHANTOM Sets phantom to TRUE or FALSE -PRIM_CAST_SHADOWS DEPRECATED. Takes 1 parameter, an integer, but has no effect when set and always returns 0 if used in llGetPrimitiveParams -PRIM_POSITION Sets primitive position to a vector position -PRIM_SIZE Sets primitive size to a vector size -PRIM_ROTATION Sets primitive rotation -PRIM_TEXT Used to get or set the object's floating text. -PRIM_TEXTURE Followed by an integer face, key id, vector repeats, vector offsets,:and float rotation in radians -PRIM_COLOR Followed by an integer face, vector color, and float alpha -PRIM_BUMP_SHINY Followed by an integer face, one of PRIM_SHINY_NONE, PRIM_SHINY_LOW,:PRIM_SHINY_MEDIUM, or PRIM_SHINY_HIGH,:and one of PRIM_BUMP_NONE, PRIM_BUMP_BRIGHT, PRIM_BUMP_DARK, etc -PRIM_FULLBRIGHT Followed by an integer face, and TRUE or FALSE -PRIM_TEXGEN Followed by an integer face, and one of PRIM_TEXGEN_DEFAULT or PRIM_TEXGEN_PLANAR -PRIM_GLOW Followed by an integer face, and a float from 0.0 to 1.0 specifying glow amount -PRIM_POS_LOCAL Sets the prim's local position -PRIM_ROT_LOCAL Sets the prim's local rotation -PRIM_OMEGA Makes the object spin at the specified axis and rate -PRIM_LINK_TARGET Used to get or set multiple links with a single PrimParameters call. -PRIM_SLICE Get and set the 'slice' parameter of all shapes. Takes a vector parameter of the form +PRIM_NAME Sets the prim's name +PRIM_DESC Sets the prim's description +PRIM_TYPE Followed by PRIM_TYPE_BOX, PRIM_TYPE_CYLINDER, PRIM_TYPE_PRISM, PRIM_TYPE_SPHERE, PRIM_TYPE_TORUS, PRIM_TYPE_TUBE, or PRIM_TYPE_SCULPT and their arguments +PRIM_MATERIAL Followed by PRIM_MATERIAL_STONE, PRIM_MATERIAL_METAL, PRIM_MATERIAL_GLASS, PRIM_MATERIAL_WOOD, PRIM_MATERIAL_FLESH, PRIM_MATERIAL_PLASTIC, or PRIM_MATERIAL_RUBBER +PRIM_PHYSICS Sets physics to TRUE or FALSE +PRIM_FLEXIBLE Followed by TRUE or FALSE, integer softness, float gravity, float friction, float wind, float tension, and vector force +PRIM_POINT_LIGHT Followed by TRUE or FALSE, vector color, float intensity, float radius, float falloff +PRIM_TEMP_ON_REZ Sets temporary on rez to TRUE or FALSE +PRIM_PHANTOM Sets phantom to TRUE or FALSE +PRIM_CAST_SHADOWS DEPRECATED. Takes 1 parameter, an integer, but has no effect when set and always returns 0 if used in llGetPrimitiveParams +PRIM_POSITION Sets primitive position to a vector position +PRIM_SIZE Sets primitive size to a vector size +PRIM_ROTATION Sets primitive rotation +PRIM_TEXT Used to get or set the object's floating text. +PRIM_TEXTURE Followed by an integer face, key id, vector repeats, vector offsets,:and float rotation in radians +PRIM_COLOR Followed by an integer face, vector color, and float alpha +PRIM_BUMP_SHINY Followed by an integer face, one of PRIM_SHINY_NONE, PRIM_SHINY_LOW,:PRIM_SHINY_MEDIUM, or PRIM_SHINY_HIGH,:and one of PRIM_BUMP_NONE, PRIM_BUMP_BRIGHT, PRIM_BUMP_DARK, etc +PRIM_FULLBRIGHT Followed by an integer face, and TRUE or FALSE +PRIM_TEXGEN Followed by an integer face, and one of PRIM_TEXGEN_DEFAULT or PRIM_TEXGEN_PLANAR +PRIM_GLOW Followed by an integer face, and a float from 0.0 to 1.0 specifying glow amount +PRIM_POS_LOCAL Sets the prim's local position +PRIM_ROT_LOCAL Sets the prim's local rotation +PRIM_OMEGA Makes the object spin at the specified axis and rate +PRIM_LINK_TARGET Used to get or set multiple links with a single PrimParameters call. +PRIM_SLICE Get and set the 'slice' parameter of all shapes. Takes a vector parameter of the form -PRIM_TYPE_BOX Followed by integer hole shape, vector cut, float hollow, vector twist,:vector top size, and vector top shear -PRIM_TYPE_CYLINDER Followed by integer hole shape, vector cut, float hollow, vector twist,:vector top size, and vector top shear -PRIM_TYPE_PRISM Followed by integer hole shape, vector cut, float hollow, vector twist,:vector top size, and vector top shear -PRIM_TYPE_SPHERE Followed by integer hole shape, vector cut, float hollow, vector twist,:and vector dimple -PRIM_TYPE_TORUS Followed by integer hole shape, vector cut, float hollow, vector twist,:vector hole size, vector top shear, vector advanced cut, vector taper,:float revolutions, float radius offset, and float skew -PRIM_TYPE_TUBE Followed by integer hole shape, vector cut, float hollow, vector twist,:vector hole size, vector top shear, vector advanced cut, vector taper,:float revolutions, float radius offset, and float skew -PRIM_TYPE_RING Followed by integer hole shape, vector cut, float hollow, vector twist,:vector hole size, vector top shear, vector advanced cut, vector taper,:float revolutions, float radius offset, and float skew -PRIM_TYPE_SCULPT Followed by a key/string texture uuid, and one of PRIM_SCULPT_TYPE_SPHERE, PRIM_SCULPT_TYPE_TORUS, PRIM_SCULPT_TYPE_PLANE, or PRIM_SCULPT_TYPE_CYLINDER +PRIM_TYPE_BOX Followed by integer hole shape, vector cut, float hollow, vector twist,:vector top size, and vector top shear +PRIM_TYPE_CYLINDER Followed by integer hole shape, vector cut, float hollow, vector twist,:vector top size, and vector top shear +PRIM_TYPE_PRISM Followed by integer hole shape, vector cut, float hollow, vector twist,:vector top size, and vector top shear +PRIM_TYPE_SPHERE Followed by integer hole shape, vector cut, float hollow, vector twist,:and vector dimple +PRIM_TYPE_TORUS Followed by integer hole shape, vector cut, float hollow, vector twist,:vector hole size, vector top shear, vector advanced cut, vector taper,:float revolutions, float radius offset, and float skew +PRIM_TYPE_TUBE Followed by integer hole shape, vector cut, float hollow, vector twist,:vector hole size, vector top shear, vector advanced cut, vector taper,:float revolutions, float radius offset, and float skew +PRIM_TYPE_RING Followed by integer hole shape, vector cut, float hollow, vector twist,:vector hole size, vector top shear, vector advanced cut, vector taper,:float revolutions, float radius offset, and float skew +PRIM_TYPE_SCULPT Followed by a key/string texture uuid, and one of PRIM_SCULPT_TYPE_SPHERE, PRIM_SCULPT_TYPE_TORUS, PRIM_SCULPT_TYPE_PLANE, or PRIM_SCULPT_TYPE_CYLINDER -PRIM_HOLE_DEFAULT Sets hole type to match the prim type -PRIM_HOLE_SQUARE Sets hole type to square -PRIM_HOLE_CIRCLE Sets hole type to circle -PRIM_HOLE_TRIANGLE Sets hole type to triangle +PRIM_HOLE_DEFAULT Sets hole type to match the prim type +PRIM_HOLE_SQUARE Sets hole type to square +PRIM_HOLE_CIRCLE Sets hole type to circle +PRIM_HOLE_TRIANGLE Sets hole type to triangle -PRIM_MATERIAL_STONE Sets material to stone -PRIM_MATERIAL_METAL Sets material to metal -PRIM_MATERIAL_GLASS Sets material to glass -PRIM_MATERIAL_WOOD Sets material to wood -PRIM_MATERIAL_FLESH Sets material to flesh -PRIM_MATERIAL_PLASTIC Sets material to plastic -PRIM_MATERIAL_RUBBER Sets material to rubber -PRIM_MATERIAL_LIGHT Sets material to light +PRIM_MATERIAL_STONE Sets material to stone +PRIM_MATERIAL_METAL Sets material to metal +PRIM_MATERIAL_GLASS Sets material to glass +PRIM_MATERIAL_WOOD Sets material to wood +PRIM_MATERIAL_FLESH Sets material to flesh +PRIM_MATERIAL_PLASTIC Sets material to plastic +PRIM_MATERIAL_RUBBER Sets material to rubber +PRIM_MATERIAL_LIGHT Sets material to light -PRIM_SHINY_NONE No shininess -PRIM_SHINY_LOW Low shininess -PRIM_SHINY_MEDIUM Medium shininess -PRIM_SHINY_HIGH High shininess +PRIM_SHINY_NONE No shininess +PRIM_SHINY_LOW Low shininess +PRIM_SHINY_MEDIUM Medium shininess +PRIM_SHINY_HIGH High shininess -PRIM_BUMP_NONE No bump map -PRIM_BUMP_BRIGHT Generate bump map from highlights -PRIM_BUMP_DARK Generate bump map from lowlights -PRIM_BUMP_WOOD Wood bump map -PRIM_BUMP_BARK Bark bump map -PRIM_BUMP_BRICKS Brick bump map -PRIM_BUMP_CHECKER Checker bump map -PRIM_BUMP_CONCRETE Concrete bump map -PRIM_BUMP_TILE Tile bump map -PRIM_BUMP_STONE Stone bump map -PRIM_BUMP_DISKS Disk bump map -PRIM_BUMP_GRAVEL Gravel bump map -PRIM_BUMP_BLOBS Blob bump map -PRIM_BUMP_SIDING Siding bump map -PRIM_BUMP_LARGETILE Large tile bump map -PRIM_BUMP_STUCCO Stucco bump map -PRIM_BUMP_SUCTION Suction cup bump map -PRIM_BUMP_WEAVE Weave bump map +PRIM_BUMP_NONE No bump map +PRIM_BUMP_BRIGHT Generate bump map from highlights +PRIM_BUMP_DARK Generate bump map from lowlights +PRIM_BUMP_WOOD Wood bump map +PRIM_BUMP_BARK Bark bump map +PRIM_BUMP_BRICKS Brick bump map +PRIM_BUMP_CHECKER Checker bump map +PRIM_BUMP_CONCRETE Concrete bump map +PRIM_BUMP_TILE Tile bump map +PRIM_BUMP_STONE Stone bump map +PRIM_BUMP_DISKS Disk bump map +PRIM_BUMP_GRAVEL Gravel bump map +PRIM_BUMP_BLOBS Blob bump map +PRIM_BUMP_SIDING Siding bump map +PRIM_BUMP_LARGETILE Large tile bump map +PRIM_BUMP_STUCCO Stucco bump map +PRIM_BUMP_SUCTION Suction cup bump map +PRIM_BUMP_WEAVE Weave bump map -PRIM_TEXGEN_DEFAULT Default texture mapping -PRIM_TEXGEN_PLANAR Planar texture mapping +PRIM_TEXGEN_DEFAULT Default texture mapping +PRIM_TEXGEN_PLANAR Planar texture mapping -PRIM_SCULPT_TYPE_SPHERE Stitch edges in a sphere-like way -PRIM_SCULPT_TYPE_TORUS Stitch edges in a torus-like way -PRIM_SCULPT_TYPE_PLANE Do not stitch edges -PRIM_SCULPT_TYPE_CYLINDER Stitch edges in a cylinder-like way -PRIM_SCULPT_TYPE_MASK Mask used to determine stitching type -PRIM_SCULPT_FLAG_INVERT Flag to specify that the surface normals should be inverted -PRIM_SCULPT_FLAG_MIRROR Flag to specify that the prim should be reflected along X axis +PRIM_SCULPT_TYPE_SPHERE Stitch edges in a sphere-like way +PRIM_SCULPT_TYPE_TORUS Stitch edges in a torus-like way +PRIM_SCULPT_TYPE_PLANE Do not stitch edges +PRIM_SCULPT_TYPE_CYLINDER Stitch edges in a cylinder-like way +PRIM_SCULPT_TYPE_MASK Mask used to determine stitching type +PRIM_SCULPT_FLAG_INVERT Flag to specify that the surface normals should be inverted +PRIM_SCULPT_FLAG_MIRROR Flag to specify that the prim should be reflected along X axis -PRIM_PHYSICS_SHAPE_TYPE For primitive physics shape type. Followed with either PRIM_PHYSICS_SHAPE_PRIM, PRIM_PHYSICS_SHAPE_NONE or PRIM_PHYSICS_SHAPE_CONVEX. -PRIM_PHYSICS_SHAPE_PRIM Use the normal prim shape for physics (this is the default for all non-mesh objects) -PRIM_PHYSICS_SHAPE_NONE Use the convex hull of the prim shape for physics (this is the default for mesh objects) -PRIM_PHYSICS_SHAPE_CONVEX Ignore this prim in the physics shape. This cannot be applied to the root prim. +PRIM_PHYSICS_SHAPE_TYPE For primitive physics shape type. Followed with either PRIM_PHYSICS_SHAPE_PRIM, PRIM_PHYSICS_SHAPE_NONE or PRIM_PHYSICS_SHAPE_CONVEX. +PRIM_PHYSICS_SHAPE_PRIM Use the normal prim shape for physics (this is the default for all non-mesh objects) +PRIM_PHYSICS_SHAPE_NONE Use the convex hull of the prim shape for physics (this is the default for mesh objects) +PRIM_PHYSICS_SHAPE_CONVEX Ignore this prim in the physics shape. This cannot be applied to the root prim. -MASK_BASE Base permissions -MASK_OWNER Owner permissions -MASK_GROUP Group permissions -MASK_EVERYONE Everyone permissions -MASK_NEXT Next owner permissions +MASK_BASE Base permissions +MASK_OWNER Owner permissions +MASK_GROUP Group permissions +MASK_EVERYONE Everyone permissions +MASK_NEXT Next owner permissions -PERM_TRANSFER Transfer permission -PERM_MODIFY Modify permission -PERM_COPY Copy permission -PERM_MOVE Move permission -PERM_ALL Move/Modify/Copy/Transfer permissions +PERM_TRANSFER Transfer permission +PERM_MODIFY Modify permission +PERM_COPY Copy permission +PERM_MOVE Move permission +PERM_ALL Move/Modify/Copy/Transfer permissions -PARCEL_MEDIA_COMMAND_STOP Stop media stream -PARCEL_MEDIA_COMMAND_PAUSE Pause media stream -PARCEL_MEDIA_COMMAND_PLAY Play media stream -PARCEL_MEDIA_COMMAND_LOOP Loop media stream -PARCEL_MEDIA_COMMAND_LOOP_SET Used to get or set the parcel's media loop duration -PARCEL_MEDIA_COMMAND_TEXTURE Get or set the parcel's media texture -PARCEL_MEDIA_COMMAND_URL Get or set the parcel's media url -PARCEL_MEDIA_COMMAND_TYPE Get or set the parcel's media mimetype -PARCEL_MEDIA_COMMAND_DESC Get or set the parcel's media description -PARCEL_MEDIA_COMMAND_TIME Set media stream to specific time -PARCEL_MEDIA_COMMAND_SIZE Get or set the parcel's media pixel resolution -PARCEL_MEDIA_COMMAND_AGENT Allows media stream commands to apply to only one agent -PARCEL_MEDIA_COMMAND_UNLOAD Unloads the media stream -PARCEL_MEDIA_COMMAND_AUTO_ALIGN Auto aligns the media stream to the texture size. May cause a performance hit and loss of some visual quality +PARCEL_MEDIA_COMMAND_STOP Stop media stream +PARCEL_MEDIA_COMMAND_PAUSE Pause media stream +PARCEL_MEDIA_COMMAND_PLAY Play media stream +PARCEL_MEDIA_COMMAND_LOOP Loop media stream +PARCEL_MEDIA_COMMAND_LOOP_SET Used to get or set the parcel's media loop duration +PARCEL_MEDIA_COMMAND_TEXTURE Get or set the parcel's media texture +PARCEL_MEDIA_COMMAND_URL Get or set the parcel's media url +PARCEL_MEDIA_COMMAND_TYPE Get or set the parcel's media mimetype +PARCEL_MEDIA_COMMAND_DESC Get or set the parcel's media description +PARCEL_MEDIA_COMMAND_TIME Set media stream to specific time +PARCEL_MEDIA_COMMAND_SIZE Get or set the parcel's media pixel resolution +PARCEL_MEDIA_COMMAND_AGENT Allows media stream commands to apply to only one agent +PARCEL_MEDIA_COMMAND_UNLOAD Unloads the media stream +PARCEL_MEDIA_COMMAND_AUTO_ALIGN Auto aligns the media stream to the texture size. May cause a performance hit and loss of some visual quality -PAY_HIDE Used with llSetPayPrice to hide a button -PAY_DEFAULT Used with llSetPayPrice to use the default price for a button +PAY_HIDE Used with llSetPayPrice to hide a button +PAY_DEFAULT Used with llSetPayPrice to use the default price for a button -LIST_STAT_MAX Used with llListStatistics to find the largest number in a list -LIST_STAT_MIN Used with llListStatistics to find the smallest number in a list -LIST_STAT_MEAN Used with llListStatistics to find the mean of the numbers in a list -LIST_STAT_MEDIAN Used with llListStatistics to find the median of the numbers in a list -LIST_STAT_STD_DEV Used with llListStatistics to find the standard deviation of the numbers in a list -LIST_STAT_SUM Used with llListStatistics to find the sum of the numbers in a list -LIST_STAT_SUM_SQUARES Used with llListStatistics to find the sum of the squares of the numbers in a list -LIST_STAT_NUM_COUNT Used with llListStatistics to find how many numbers are in a list -LIST_STAT_GEOMETRIC_MEAN Used with llListStatistics to find the geometric mean of the numbers in a list (all numbers must be > 0) -LIST_STAT_RANGE Used with llListStatistics to find the range of the numbers in a list +LIST_STAT_MAX Used with llListStatistics to find the largest number in a list +LIST_STAT_MIN Used with llListStatistics to find the smallest number in a list +LIST_STAT_MEAN Used with llListStatistics to find the mean of the numbers in a list +LIST_STAT_MEDIAN Used with llListStatistics to find the median of the numbers in a list +LIST_STAT_STD_DEV Used with llListStatistics to find the standard deviation of the numbers in a list +LIST_STAT_SUM Used with llListStatistics to find the sum of the numbers in a list +LIST_STAT_SUM_SQUARES Used with llListStatistics to find the sum of the squares of the numbers in a list +LIST_STAT_NUM_COUNT Used with llListStatistics to find how many numbers are in a list +LIST_STAT_GEOMETRIC_MEAN Used with llListStatistics to find the geometric mean of the numbers in a list (all numbers must be > 0) +LIST_STAT_RANGE Used with llListStatistics to find the range of the numbers in a list -PARCEL_FLAG_ALLOW_FLY Used with llGetParcelFlags to find if a parcel allows flying -PARCEL_FLAG_ALLOW_GROUP_SCRIPTS Used with llGetParcelFlags to find if a parcel allows group scripts -PARCEL_FLAG_ALLOW_SCRIPTS Used with llGetParcelFlags to find if a parcel allows outside scripts -PARCEL_FLAG_ALLOW_LANDMARK Used with llGetParcelFlags to find if a parcel allows landmarks to be created -PARCEL_FLAG_ALLOW_TERRAFORM Used with llGetParcelFlags to find if a parcel allows anyone to terraform the land -PARCEL_FLAG_ALLOW_DAMAGE Used with llGetParcelFlags to find if a parcel allows damage -PARCEL_FLAG_ALLOW_CREATE_OBJECTS Used with llGetParcelFlags to find if a parcel allows anyone to create objects -PARCEL_FLAG_ALLOW_CREATE_GROUP_OBJECTS Used with llGetParcelFlags to find if a parcel allows group members or objects to create objects -PARCEL_FLAG_USE_ACCESS_GROUP Used with llGetParcelFlags to find if a parcel limits access to a group -PARCEL_FLAG_USE_ACCESS_LIST Used with llGetParcelFlags to find if a parcel limits access to a list of residents -PARCEL_FLAG_USE_BAN_LIST Used with llGetParcelFlags to find if a parcel uses a ban list -PARCEL_FLAG_USE_LAND_PASS_LIST Used with llGetParcelFlags to find if a parcel allows passes to be purchased -PARCEL_FLAG_LOCAL_SOUND_ONLY Used with llGetParcelFlags to find if a parcel restricts spacialized sound to the parcel -PARCEL_FLAG_RESTRICT_PUSHOBJECT Used with llGetParcelFlags to find if a parcel restricts llPushObject() calls -PARCEL_FLAG_ALLOW_ALL_OBJECT_ENTRY Used with llGetParcelFlags to find if a parcel allows all objects to enter -PARCEL_FLAG_ALLOW_GROUP_OBJECT_ENTRY Used with llGetParcelFlags to find if a parcel only allows group (and owner) objects to enter +PARCEL_FLAG_ALLOW_FLY Used with llGetParcelFlags to find if a parcel allows flying +PARCEL_FLAG_ALLOW_GROUP_SCRIPTS Used with llGetParcelFlags to find if a parcel allows group scripts +PARCEL_FLAG_ALLOW_SCRIPTS Used with llGetParcelFlags to find if a parcel allows outside scripts +PARCEL_FLAG_ALLOW_LANDMARK Used with llGetParcelFlags to find if a parcel allows landmarks to be created +PARCEL_FLAG_ALLOW_TERRAFORM Used with llGetParcelFlags to find if a parcel allows anyone to terraform the land +PARCEL_FLAG_ALLOW_DAMAGE Used with llGetParcelFlags to find if a parcel allows damage +PARCEL_FLAG_ALLOW_CREATE_OBJECTS Used with llGetParcelFlags to find if a parcel allows anyone to create objects +PARCEL_FLAG_ALLOW_CREATE_GROUP_OBJECTS Used with llGetParcelFlags to find if a parcel allows group members or objects to create objects +PARCEL_FLAG_USE_ACCESS_GROUP Used with llGetParcelFlags to find if a parcel limits access to a group +PARCEL_FLAG_USE_ACCESS_LIST Used with llGetParcelFlags to find if a parcel limits access to a list of residents +PARCEL_FLAG_USE_BAN_LIST Used with llGetParcelFlags to find if a parcel uses a ban list +PARCEL_FLAG_USE_LAND_PASS_LIST Used with llGetParcelFlags to find if a parcel allows passes to be purchased +PARCEL_FLAG_LOCAL_SOUND_ONLY Used with llGetParcelFlags to find if a parcel restricts spacialized sound to the parcel +PARCEL_FLAG_RESTRICT_PUSHOBJECT Used with llGetParcelFlags to find if a parcel restricts llPushObject() calls +PARCEL_FLAG_ALLOW_ALL_OBJECT_ENTRY Used with llGetParcelFlags to find if a parcel allows all objects to enter +PARCEL_FLAG_ALLOW_GROUP_OBJECT_ENTRY Used with llGetParcelFlags to find if a parcel only allows group (and owner) objects to enter -REGION_FLAG_ALLOW_DAMAGE Used with llGetRegionFlags to find if a region is entirely damage enabled -REGION_FLAG_FIXED_SUN Used with llGetRegionFlags to find if a region has a fixed sun position -REGION_FLAG_BLOCK_TERRAFORM Used with llGetRegionFlags to find if a region terraforming disabled -REGION_FLAG_SANDBOX Used with llGetRegionFlags to find if a region is a sandbox -REGION_FLAG_DISABLE_COLLISIONS Used with llGetRegionFlags to find if a region has disabled collisions -REGION_FLAG_DISABLE_PHYSICS Used with llGetRegionFlags to find if a region has disabled physics -REGION_FLAG_BLOCK_FLY Used with llGetRegionFlags to find if a region blocks flying -REGION_FLAG_ALLOW_DIRECT_TELEPORT Used with llGetRegionFlags to find if a region allows direct teleports -REGION_FLAG_RESTRICT_PUSHOBJECT Used with llGetRegionFlags to find if a region restricts llPushObject() calls +REGION_FLAG_ALLOW_DAMAGE Used with llGetRegionFlags to find if a region is entirely damage enabled +REGION_FLAG_FIXED_SUN Used with llGetRegionFlags to find if a region has a fixed sun position +REGION_FLAG_BLOCK_TERRAFORM Used with llGetRegionFlags to find if a region terraforming disabled +REGION_FLAG_SANDBOX Used with llGetRegionFlags to find if a region is a sandbox +REGION_FLAG_DISABLE_COLLISIONS Used with llGetRegionFlags to find if a region has disabled collisions +REGION_FLAG_DISABLE_PHYSICS Used with llGetRegionFlags to find if a region has disabled physics +REGION_FLAG_BLOCK_FLY Used with llGetRegionFlags to find if a region blocks flying +REGION_FLAG_ALLOW_DIRECT_TELEPORT Used with llGetRegionFlags to find if a region allows direct teleports +REGION_FLAG_RESTRICT_PUSHOBJECT Used with llGetRegionFlags to find if a region restricts llPushObject() calls -HTTP_METHOD Used with llHTTPRequest to specify the method, "GET", "POST", "PUT", or "DELETE" -HTTP_MIMETYPE Used with llHTTPRequest to specify the MIME type, defaults to "text/plain" -HTTP_BODY_MAXLENGTH Used with llHTTPRequest to specify the maximum response body to return -HTTP_VERIFY_CERT Used with llHTTPRequest to specify SSL certificate verification -HTTP_BODY_TRUNCATED Used with http_response to indicate truncation point in bytes -HTTP_VERBOSE_THROTTLE Used with llHTTPRequest to shout error messages to DEBUG_CHANNEL if the outgoing request rate exceeds the server limit. -HTTP_BODY_MAXLENGTH Used with llHTTPRequest to specify the maximum body size for the date returned from the request. Mono scripts can request from 1byte to 16k, non-mono scripts can request from 1byte to 4k. The default is 2k. +HTTP_METHOD Used with llHTTPRequest to specify the method, "GET", "POST", "PUT", or "DELETE" +HTTP_MIMETYPE Used with llHTTPRequest to specify the MIME type, defaults to "text/plain" +HTTP_BODY_MAXLENGTH Used with llHTTPRequest to specify the maximum response body to return +HTTP_VERIFY_CERT Used with llHTTPRequest to specify SSL certificate verification +HTTP_BODY_TRUNCATED Used with http_response to indicate truncation point in bytes +HTTP_VERBOSE_THROTTLE Used with llHTTPRequest to shout error messages to DEBUG_CHANNEL if the outgoing request rate exceeds the server limit. +HTTP_BODY_MAXLENGTH Used with llHTTPRequest to specify the maximum body size for the date returned from the request. Mono scripts can request from 1byte to 16k, non-mono scripts can request from 1byte to 4k. The default is 2k. -PARCEL_COUNT_TOTAL Used with llGetParcelPrimCount to get the total number of prims on the parcel -PARCEL_COUNT_OWNER Used with llGetParcelPrimCount to get the number of prims on the parcel owned by the owner -PARCEL_COUNT_GROUP Used with llGetParcelPrimCount to get the number of prims on the parcel owned by the group -PARCEL_COUNT_OTHER Used with llGetParcelPrimCount to get the number of prims on the parcel owned by others -PARCEL_COUNT_SELECTED Used with llGetParcelPrimCount to get the number of prims on the parcel currently selected or sat upon -PARCEL_COUNT_TEMP Used with llGetParcelPrimCount to get the number of prims on the parcel that are temp on rez +PARCEL_COUNT_TOTAL Used with llGetParcelPrimCount to get the total number of prims on the parcel +PARCEL_COUNT_OWNER Used with llGetParcelPrimCount to get the number of prims on the parcel owned by the owner +PARCEL_COUNT_GROUP Used with llGetParcelPrimCount to get the number of prims on the parcel owned by the group +PARCEL_COUNT_OTHER Used with llGetParcelPrimCount to get the number of prims on the parcel owned by others +PARCEL_COUNT_SELECTED Used with llGetParcelPrimCount to get the number of prims on the parcel currently selected or sat upon +PARCEL_COUNT_TEMP Used with llGetParcelPrimCount to get the number of prims on the parcel that are temp on rez -PARCEL_DETAILS_NAME Used with llGetParcelDetails to get the parcel name -PARCEL_DETAILS_DESC Used with llGetParcelDetails to get the parcel description -PARCEL_DETAILS_OWNER Used with llGetParcelDetails to get the parcel owner id -PARCEL_DETAILS_GROUP Used with llGetParcelDetails to get the parcel group id -PARCEL_DETAILS_AREA Used with llGetParcelDetails to get the parcel area in square meters -PARCEL_DETAILS_ID Used with llGetParcelDetails to get the parcel id -PARCEL_DETAILS_SEE_AVATARS Used with llGetParcelDetails to get the avatars visibility setting +PARCEL_DETAILS_NAME Used with llGetParcelDetails to get the parcel name +PARCEL_DETAILS_DESC Used with llGetParcelDetails to get the parcel description +PARCEL_DETAILS_OWNER Used with llGetParcelDetails to get the parcel owner id +PARCEL_DETAILS_GROUP Used with llGetParcelDetails to get the parcel group id +PARCEL_DETAILS_AREA Used with llGetParcelDetails to get the parcel area in square meters +PARCEL_DETAILS_ID Used with llGetParcelDetails to get the parcel id +PARCEL_DETAILS_SEE_AVATARS Used with llGetParcelDetails to get the avatars visibility setting -STRING_TRIM_HEAD Used with llStringTrim to trim leading spaces from a string -STRING_TRIM_TAIL Used with llStringTrim to trim trailing spaces from a string -STRING_TRIM Used with llStringTrim to trim both leading and trailing spaces from a string +STRING_TRIM_HEAD Used with llStringTrim to trim leading spaces from a string +STRING_TRIM_TAIL Used with llStringTrim to trim trailing spaces from a string +STRING_TRIM Used with llStringTrim to trim both leading and trailing spaces from a string CLICK_ACTION_NONE Used with llSetClickAction to disable the click action CLICK_ACTION_TOUCH Used with llSetClickAction to set touch as the default action when object is clicked @@ -641,77 +641,77 @@ STATUS_WHITELIST_FAILED URL failed to pass whitelist PROFILE_NONE Disables profiling PROFILE_SCRIPT_MEMORY Enables memory profiling -RC_DATA_FLAGS Option for llCastRay() followed with a bitwise combination of RC_GET_NORMAL, RC_GET_ROOT_KEY and RC_GET_LINK_NUM. -RC_DETECT_PHANTOM Option for llCastRay() followed with TRUE to detect phantom AND volume detect objects, FASLE otherwise. -RC_GET_LINK_NUM Flag used in the RC_DATA_FLAGS mask to get link numbers in llCastRay() results. -RC_GET_NORMAL Flag used in the RC_DATA_FLAGS mask to get hit normals in llCastRay() results. -RC_GET_ROOT_KEY Flag used in the RC_DATA_FLAGS mask to get root keys in llCastRay() results. -RC_MAX_HITS Option for llCastRay() followed with an integer specifying the maximum number of hits to return (must be <= 256). -RC_REJECT_TYPES Option for llCastRay() used to ignore specific types of objects, followed with a bitwise combination of RC_REJECT_AGENTS, RC_REJECT_PHYSICAL, RC_REJECT_NONPHYSICAL and RC_REJECT_LAND. -RC_REJECT_AGENTS Flag used in the RC_REJECT_TYPES mask to reject agents in llCastRay(). -RC_REJECT_PHYSICAL Flag used in the RC_REJECT_TYPES mask to reject physical objects in llCastRay(). -RC_REJECT_NONPHYSICAL Flag used in the RC_REJECT_TYPES mask to reject non-physical objects in llCastRay(). -RC_REJECT_LAND Flag used in the RC_REJECT_TYPES mask to reject land in llCastRay(). +RC_DATA_FLAGS Option for llCastRay() followed with a bitwise combination of RC_GET_NORMAL, RC_GET_ROOT_KEY and RC_GET_LINK_NUM. +RC_DETECT_PHANTOM Option for llCastRay() followed with TRUE to detect phantom AND volume detect objects, FASLE otherwise. +RC_GET_LINK_NUM Flag used in the RC_DATA_FLAGS mask to get link numbers in llCastRay() results. +RC_GET_NORMAL Flag used in the RC_DATA_FLAGS mask to get hit normals in llCastRay() results. +RC_GET_ROOT_KEY Flag used in the RC_DATA_FLAGS mask to get root keys in llCastRay() results. +RC_MAX_HITS Option for llCastRay() followed with an integer specifying the maximum number of hits to return (must be <= 256). +RC_REJECT_TYPES Option for llCastRay() used to ignore specific types of objects, followed with a bitwise combination of RC_REJECT_AGENTS, RC_REJECT_PHYSICAL, RC_REJECT_NONPHYSICAL and RC_REJECT_LAND. +RC_REJECT_AGENTS Flag used in the RC_REJECT_TYPES mask to reject agents in llCastRay(). +RC_REJECT_PHYSICAL Flag used in the RC_REJECT_TYPES mask to reject physical objects in llCastRay(). +RC_REJECT_NONPHYSICAL Flag used in the RC_REJECT_TYPES mask to reject non-physical objects in llCastRay(). +RC_REJECT_LAND Flag used in the RC_REJECT_TYPES mask to reject land in llCastRay(). -RCERR_CAST_TIME_EXCEEDED Returned by llCastRay() when the raycast failed because the parcel or agent has exceeded the maximum time allowed for raycasting. -RCERR_SIM_PERF_LOW Returned by llCastRay() when the raycast failed because simulator performance is low. -RCERR_UNKNOWN Returned by llCastRay() when the raycast failed for an unspecified reason. +RCERR_CAST_TIME_EXCEEDED Returned by llCastRay() when the raycast failed because the parcel or agent has exceeded the maximum time allowed for raycasting. +RCERR_SIM_PERF_LOW Returned by llCastRay() when the raycast failed because simulator performance is low. +RCERR_UNKNOWN Returned by llCastRay() when the raycast failed for an unspecified reason. -ESTATE_ACCESS_ALLOWED_AGENT_ADD Used with llManageEstateAccess to add an agent to this estate's allowed residents list. -ESTATE_ACCESS_ALLOWED_AGENT_REMOVE Used with llManageEstateAccess to remove an agent from this estate's allowed residents list. -ESTATE_ACCESS_ALLOWED_GROUP_ADD Used with llManageEstateAccess to add a group to this estate's allowed groups list. -ESTATE_ACCESS_ALLOWED_GROUP_REMOVE Used with llManageEstateAccess to remove a group from this estate's allowed groups list. -ESTATE_ACCESS_BANNED_AGENT_ADD Used with llManageEstateAccess to add an agent to this estate's banned residents list. -ESTATE_ACCESS_BANNED_AGENT_REMOVE Used with llManageEstateAccess to remove an agent from this estate's banned residents list. +ESTATE_ACCESS_ALLOWED_AGENT_ADD Used with llManageEstateAccess to add an agent to this estate's allowed residents list. +ESTATE_ACCESS_ALLOWED_AGENT_REMOVE Used with llManageEstateAccess to remove an agent from this estate's allowed residents list. +ESTATE_ACCESS_ALLOWED_GROUP_ADD Used with llManageEstateAccess to add a group to this estate's allowed groups list. +ESTATE_ACCESS_ALLOWED_GROUP_REMOVE Used with llManageEstateAccess to remove a group from this estate's allowed groups list. +ESTATE_ACCESS_BANNED_AGENT_ADD Used with llManageEstateAccess to add an agent to this estate's banned residents list. +ESTATE_ACCESS_BANNED_AGENT_REMOVE Used with llManageEstateAccess to remove an agent from this estate's banned residents list. -DENSITY For use with llSetPhysicsMaterial() as a bitwise value in its material_bits parameter, to set the density. -FRICTION For use with llSetPhysicsMaterial() as a bitwise value in its material_bits parameter, to set the friction. -RESTITUTION For use with llSetPhysicsMaterial() as a bitwise value in its material_bits parameter, to set the restitution. -GRAVITY_MULTIPLIER For use with llSetPhysicsMaterial() as a bitwise value in its material_bits parameter, to set the gravity multiplier. +DENSITY For use with llSetPhysicsMaterial() as a bitwise value in its material_bits parameter, to set the density. +FRICTION For use with llSetPhysicsMaterial() as a bitwise value in its material_bits parameter, to set the friction. +RESTITUTION For use with llSetPhysicsMaterial() as a bitwise value in its material_bits parameter, to set the restitution. +GRAVITY_MULTIPLIER For use with llSetPhysicsMaterial() as a bitwise value in its material_bits parameter, to set the gravity multiplier. -SIM_STAT_PCT_CHARS_STEPPED Option for llGetSimStats() to return the % of pathfinding characters skipped each frame, averaged over the last minute. +SIM_STAT_PCT_CHARS_STEPPED Option for llGetSimStats() to return the % of pathfinding characters skipped each frame, averaged over the last minute. -KFM_COMMAND Option for llSetKeyframedMotion(), followed by one of KFM_CMD_STOP, KFM_CMD_PLAY, KFM_CMD_PAUSE. Note that KFM_COMMAND must be the only option in the list, and cannot be specified in the same function call that sets the keyframes list. -KFM_CMD_PLAY Option for llSetKeyframedMotion(), used after KFM_COMMAND to play the motion. -KFM_CMD_STOP Option for llSetKeyframedMotion(), used after KFM_COMMAND to stop the motion. -KFM_CMD_PAUSE Option for llSetKeyframedMotion(), used after KFM_COMMAND to pause the motion. -KFM_MODE Option for llSetKeyframedMotion(), used to specify the playback mode, followed by one of KFM_FORWARD, KFM_LOOP, KFM_PING_PONG or KFM_REVERSE. -KFM_FORWARD Option for llSetKeyframedMotion(), used after KFM_MODE to specify the forward playback mode. -KFM_LOOP Option for llSetKeyframedMotion(), used after KFM_MODE to specify the loop playback mode. -KFM_PING_PONG Option for llSetKeyframedMotion(), used after KFM_MODE to specify the ping pong playback mode. -KFM_REVERSE Option for llSetKeyframedMotion(), used after KFM_MODE to specify the reverse playback mode. -KFM_DATA Option for llSetKeyframedMotion(), followed by a bitwise combination of KFM_TRANSLATION and KFM_ROTATION. If you specify one or the other, you should only include translations or rotations in your keyframe list. -KFM_ROTATION Option for llSetKeyframedMotion(), used after KFM_DATA, possibly as a bitwise combination with KFM_TRANSLATION. -KFM_TRANSLATION Option for llSetKeyframedMotion(), used after KFM_DATA, possibly as a bitwise combination with KFM_ROTATION. +KFM_COMMAND Option for llSetKeyframedMotion(), followed by one of KFM_CMD_STOP, KFM_CMD_PLAY, KFM_CMD_PAUSE. Note that KFM_COMMAND must be the only option in the list, and cannot be specified in the same function call that sets the keyframes list. +KFM_CMD_PLAY Option for llSetKeyframedMotion(), used after KFM_COMMAND to play the motion. +KFM_CMD_STOP Option for llSetKeyframedMotion(), used after KFM_COMMAND to stop the motion. +KFM_CMD_PAUSE Option for llSetKeyframedMotion(), used after KFM_COMMAND to pause the motion. +KFM_MODE Option for llSetKeyframedMotion(), used to specify the playback mode, followed by one of KFM_FORWARD, KFM_LOOP, KFM_PING_PONG or KFM_REVERSE. +KFM_FORWARD Option for llSetKeyframedMotion(), used after KFM_MODE to specify the forward playback mode. +KFM_LOOP Option for llSetKeyframedMotion(), used after KFM_MODE to specify the loop playback mode. +KFM_PING_PONG Option for llSetKeyframedMotion(), used after KFM_MODE to specify the ping pong playback mode. +KFM_REVERSE Option for llSetKeyframedMotion(), used after KFM_MODE to specify the reverse playback mode. +KFM_DATA Option for llSetKeyframedMotion(), followed by a bitwise combination of KFM_TRANSLATION and KFM_ROTATION. If you specify one or the other, you should only include translations or rotations in your keyframe list. +KFM_ROTATION Option for llSetKeyframedMotion(), used after KFM_DATA, possibly as a bitwise combination with KFM_TRANSLATION. +KFM_TRANSLATION Option for llSetKeyframedMotion(), used after KFM_DATA, possibly as a bitwise combination with KFM_ROTATION. -CHARACTER_CMD_STOP Used with llExecCharacterCmd(). Makes the character jump. -CHARACTER_CMD_SMOOTH_STOP Used with llExecCharacterCmd(). Stops any current pathfinding operation in a smooth like fashion. -CHARACTER_CMD_JUMP Used with llExecCharacterCmd(). Stops any current pathfinding operation. +CHARACTER_CMD_STOP Used with llExecCharacterCmd(). Makes the character jump. +CHARACTER_CMD_SMOOTH_STOP Used with llExecCharacterCmd(). Stops any current pathfinding operation in a smooth like fashion. +CHARACTER_CMD_JUMP Used with llExecCharacterCmd(). Stops any current pathfinding operation. -CHARACTER_DESIRED_SPEED Speed of pursuit in meters per second. -CHARACTER_RADIUS Set collision capsule radius. -CHARACTER_LENGTH Set collision capsule length. -CHARACTER_ORIENTATION Set the character orientation. -CHARACTER_AVOIDANCE_MODE Allows you to specify that a character should not try to avoid other characters, should not try to avoid dynamic obstacles (relatively fast moving objects and avatars), or both. -CHARACTER_ACCOUNT_FOR_SKIPPED_FRAMES Defines if a character will attempt to catch up lost time if pathfinding performance is low. -PURSUIT_OFFSET Used with llPursue(). Go to a position offset from the target. -REQUIRE_LINE_OF_SIGHT Used with llPursue(). Define whether the character needs a physical line-of-sight to give chase. When enabled, the character will not pick a new target position while there is a something solid between the character and the target object/agent. -PURSUIT_FUZZ_FACTOR Used with llPursue(). Selects a random destination near the PURSUIT_OFFSET. The valid fuzz factor range is from 0 to 1, where 1 is most random. This option requires a nonzero PURSUIT_OFFSET. -PURSUIT_INTERCEPT Used with llPursue(). Define whether the character attempts to predict the target's future location. -PURSUIT_GOAL_TOLERANCE Used with llPursue(). Defines approximately how close the character must be to the current goal to consider itself to be at the desired position. The valid range is from 0.25 to 10m. -FORCE_DIRECT_PATH Used with llNavigateTo(). Makes character navigate in a straight line toward pos. May be set to TRUE or FALSE. -VERTICAL Constant to indicate that the orientation of the capsule for a Pathfinding character is vertical. -HORIZONTAL Constant to indicate that the orientation of the capsule for a Pathfinding character is horizontal. -AVOID_CHARACTERS TODO: add documentation -AVOID_DYNAMIC_OBSTACLES TODO: add documentation -AVOID_NONE TODO: add documentation +CHARACTER_DESIRED_SPEED Speed of pursuit in meters per second. +CHARACTER_RADIUS Set collision capsule radius. +CHARACTER_LENGTH Set collision capsule length. +CHARACTER_ORIENTATION Set the character orientation. +CHARACTER_AVOIDANCE_MODE Allows you to specify that a character should not try to avoid other characters, should not try to avoid dynamic obstacles (relatively fast moving objects and avatars), or both. +CHARACTER_ACCOUNT_FOR_SKIPPED_FRAMES Defines if a character will attempt to catch up lost time if pathfinding performance is low. +PURSUIT_OFFSET Used with llPursue(). Go to a position offset from the target. +REQUIRE_LINE_OF_SIGHT Used with llPursue(). Define whether the character needs a physical line-of-sight to give chase. When enabled, the character will not pick a new target position while there is a something solid between the character and the target object/agent. +PURSUIT_FUZZ_FACTOR Used with llPursue(). Selects a random destination near the PURSUIT_OFFSET. The valid fuzz factor range is from 0 to 1, where 1 is most random. This option requires a nonzero PURSUIT_OFFSET. +PURSUIT_INTERCEPT Used with llPursue(). Define whether the character attempts to predict the target's future location. +PURSUIT_GOAL_TOLERANCE Used with llPursue(). Defines approximately how close the character must be to the current goal to consider itself to be at the desired position. The valid range is from 0.25 to 10m. +FORCE_DIRECT_PATH Used with llNavigateTo(). Makes character navigate in a straight line toward pos. May be set to TRUE or FALSE. +VERTICAL Constant to indicate that the orientation of the capsule for a Pathfinding character is vertical. +HORIZONTAL Constant to indicate that the orientation of the capsule for a Pathfinding character is horizontal. +AVOID_CHARACTERS TODO: add documentation +AVOID_DYNAMIC_OBSTACLES TODO: add documentation +AVOID_NONE TODO: add documentation PU_EVADE_HIDDEN Triggered when an llEvade character thinks it has hidden from its pursuer. PU_EVADE_SPOTTED Triggered when an llEvade character switches from hiding to running PU_FAILURE_INVALID_GOAL Goal is not on the navigation-mesh and cannot be reached. PU_FAILURE_INVALID_START Character cannot navigate from the current location - e.g., the character is off the navmesh or too high above it. PU_FAILURE_NO_VALID_DESTINATION There's no good place for the character to go - e.g., it is patrolling and all the patrol points are now unreachable. -PU_FAILURE_OTHER Unknown failure +PU_FAILURE_OTHER Unknown failure PU_FAILURE_TARGET_GONE Target (for llPursue or llEvade) can no longer be tracked - e.g., it left the region or is an avatar that is now more than about 30m outside the region. PU_FAILURE_UNREACHABLE Goal is no longer reachable for some reason - e.g., an obstacle blocks the path. PU_GOAL_REACHED Character has reached the goal and will stop or choose a new goal (if wandering). @@ -720,56 +720,56 @@ PU_FAILURE_NO_NAVMESH Triggered if no navmesh is available for the re PU_FAILURE_DYNAMIC_PATHFINDING_DISABLED Triggered when a character enters a region with dynamic pathfinding disabled. PU_FAILURE_PARCEL_UNREACHABLE Triggered when a character failed to enter a parcel because it is not allowed to enter, e.g. because the parcel is already full or because object entry was disabled after the navmesh was baked. -CHARACTER_TYPE Specifies which walkability coefficient will be used by this character. -CHARACTER_TYPE_A Used for character types that you prefer move in a way consistent with humanoids. -CHARACTER_TYPE_B Used for character types that you prefer move in a way consistent with wild animals or off road vehicles. -CHARACTER_TYPE_C Used for mechanical character types or road going vehicles. -CHARACTER_TYPE_D Used for character types that are not consistent with the A, B, or C type. -CHARACTER_TYPE_NONE Used to set no specific character type. +CHARACTER_TYPE Specifies which walkability coefficient will be used by this character. +CHARACTER_TYPE_A Used for character types that you prefer move in a way consistent with humanoids. +CHARACTER_TYPE_B Used for character types that you prefer move in a way consistent with wild animals or off road vehicles. +CHARACTER_TYPE_C Used for mechanical character types or road going vehicles. +CHARACTER_TYPE_D Used for character types that are not consistent with the A, B, or C type. +CHARACTER_TYPE_NONE Used to set no specific character type. -TRAVERSAL_TYPE Controls the speed at which characters moves on terrain that is less than 100% walkable will move faster (e.g., a cat crossing a street) or slower (e.g., a car driving in a swamp). -TRAVERSAL_TYPE_SLOW TODO: add documentation -TRAVERSAL_TYPE_FAST TODO: add documentation -TRAVERSAL_TYPE_NONE TODO: add documentation +TRAVERSAL_TYPE Controls the speed at which characters moves on terrain that is less than 100% walkable will move faster (e.g., a cat crossing a street) or slower (e.g., a car driving in a swamp). +TRAVERSAL_TYPE_SLOW TODO: add documentation +TRAVERSAL_TYPE_FAST TODO: add documentation +TRAVERSAL_TYPE_NONE TODO: add documentation -CHARACTER_MAX_ACCEL The character's maximum acceleration rate. -CHARACTER_MAX_DECEL The character's maximum deceleration rate. -CHARACTER_MAX_ANGULAR_SPEED TODO: add documentation -CHARACTER_MAX_ANGULAR_ACCEL TODO: add documentation -CHARACTER_TURN_SPEED_MULTIPLIER TODO: add documentation -CHARACTER_DESIRED_TURN_SPEED The character's maximum speed while turning--note that this is only loosely enforced (i.e., a character may turn at higher speeds under certain conditions) -CHARACTER_MAX_TURN_RADIUS The character's turn radius when traveling at CHARACTER_DESIRED_TURN_SPEED. -CHARACTER_MAX_SPEED The character's maximum speed. Affects speed when avoiding dynamic obstacles and when traversing low-walkability objects in TRAVERSAL_TYPE_FAST mode. -CHARACTER_STAY_WITHIN_PARCEL Characters which have CHARACTER_STAY_WITHIN_PARCEL set to TRUE treat the parcel boundaries as one-way obstacles. +CHARACTER_MAX_ACCEL The character's maximum acceleration rate. +CHARACTER_MAX_DECEL The character's maximum deceleration rate. +CHARACTER_MAX_ANGULAR_SPEED TODO: add documentation +CHARACTER_MAX_ANGULAR_ACCEL TODO: add documentation +CHARACTER_TURN_SPEED_MULTIPLIER TODO: add documentation +CHARACTER_DESIRED_TURN_SPEED The character's maximum speed while turning--note that this is only loosely enforced (i.e., a character may turn at higher speeds under certain conditions) +CHARACTER_MAX_TURN_RADIUS The character's turn radius when traveling at CHARACTER_DESIRED_TURN_SPEED. +CHARACTER_MAX_SPEED The character's maximum speed. Affects speed when avoiding dynamic obstacles and when traversing low-walkability objects in TRAVERSAL_TYPE_FAST mode. +CHARACTER_STAY_WITHIN_PARCEL Characters which have CHARACTER_STAY_WITHIN_PARCEL set to TRUE treat the parcel boundaries as one-way obstacles. -PATROL_PAUSE_AT_WAYPOINTS Used with llPatrolPoints(). Defines if characters slow down and momentarily pause at each waypoint. -WANDER_PAUSE_AT_WAYPOINTS Used with llWanderWithin(). Defines if characters should pause after reaching each wander waypoint. +PATROL_PAUSE_AT_WAYPOINTS Used with llPatrolPoints(). Defines if characters slow down and momentarily pause at each waypoint. +WANDER_PAUSE_AT_WAYPOINTS Used with llWanderWithin(). Defines if characters should pause after reaching each wander waypoint. -CONTENT_TYPE_TEXT text/plain -CONTENT_TYPE_HTML text/html -CONTENT_TYPE_XML application/xml -CONTENT_TYPE_XHTML application/xhtml+xml -CONTENT_TYPE_ATOM application/atom+xml -CONTENT_TYPE_JSON application/json -CONTENT_TYPE_LLSD application/llsd+xml -CONTENT_TYPE_FORM application/x-www-form-urlencoded -CONTENT_TYPE_RSS application/rss+xml +CONTENT_TYPE_TEXT text/plain +CONTENT_TYPE_HTML text/html +CONTENT_TYPE_XML application/xml +CONTENT_TYPE_XHTML application/xhtml+xml +CONTENT_TYPE_ATOM application/atom+xml +CONTENT_TYPE_JSON application/json +CONTENT_TYPE_LLSD application/llsd+xml +CONTENT_TYPE_FORM application/x-www-form-urlencoded +CONTENT_TYPE_RSS application/rss+xml -JSON_INVALID Returned by llJsonGetValue and llJsonValueType if the specifiers to do specify a valid in the json value. -JSON_OBJECT Represents a json datatype represented in LSL as a strided list of name/value pairs -JSON_ARRAY Represents a json datatype mappable to the LSL datatype "list" -JSON_NUMBER Represents a json datatype mappable to the LSL datatypes "integer" and "float" -JSON_STRING Represents a json datatype mappable to the LSL datatype "string" -JSON_TRUE Represents the constant "true" of a json value. -JSON_FALSE Represents the constant "false" of a json value. -JSON_NULL Represents the constant "null" of a json value. -JSON_APPEND Used with llJsonSetValue as a specifier to indicate appending the value to the end of the array at that level. +JSON_INVALID Returned by llJsonGetValue and llJsonValueType if the specifiers to do specify a valid in the json value. +JSON_OBJECT Represents a json datatype represented in LSL as a strided list of name/value pairs +JSON_ARRAY Represents a json datatype mappable to the LSL datatype "list" +JSON_NUMBER Represents a json datatype mappable to the LSL datatypes "integer" and "float" +JSON_STRING Represents a json datatype mappable to the LSL datatype "string" +JSON_TRUE Represents the constant "true" of a json value. +JSON_FALSE Represents the constant "false" of a json value. +JSON_NULL Represents the constant "null" of a json value. +JSON_APPEND Used with llJsonSetValue as a specifier to indicate appending the value to the end of the array at that level. -ERR_GENERIC Returned by llReturnObjectsByID and llReturnObjectsByOwner in case of a general error. -ERR_PARCEL_PERMISSIONS Returned by llReturnObjectsByID and llReturnObjectsByOwner in case of a parcel owner permission error. -ERR_MALFORMED_PARAMS Returned by llReturnObjectsByID and llReturnObjectsByOwner in case of malformed parameters. -ERR_RUNTIME_PERMISSIONS Returned by llReturnObjectsByID and llReturnObjectsByOwner in case of a runtime permission error. -ERR_THROTTLED Returned by llReturnObjectsByID and llReturnObjectsByOwner in case of being throttled. +ERR_GENERIC Returned by llReturnObjectsByID and llReturnObjectsByOwner in case of a general error. +ERR_PARCEL_PERMISSIONS Returned by llReturnObjectsByID and llReturnObjectsByOwner in case of a parcel owner permission error. +ERR_MALFORMED_PARAMS Returned by llReturnObjectsByID and llReturnObjectsByOwner in case of malformed parameters. +ERR_RUNTIME_PERMISSIONS Returned by llReturnObjectsByID and llReturnObjectsByOwner in case of a runtime permission error. +ERR_THROTTLED Returned by llReturnObjectsByID and llReturnObjectsByOwner in case of being throttled. # --- OpenSim and Aurora-Sim constants Below --- # OpenSim Constants (\OpenSim\Region\ScriptEngine\Shared\Api\Runtime\LSL_Constants.cs) @@ -793,26 +793,26 @@ OS_ATTACH_MSG_SCRIPT_CREATOR Used with osMessageAttachements PARCEL_DETAILS_CLAIMDATE Used with osSetParcelDetails # osGetRegionStats STATS_TIME_DILATION returned value from osGetRegionStats(), 1st of 21 items in returned list. -STATS_SIM_FPS returned value from osGetRegionStats(), 2nd of 21 items in returned list. -STATS_PHYSICS_FPS returned value from osGetRegionStats(), 3rd of 21 items in returned list. +STATS_SIM_FPS returned value from osGetRegionStats(), 2nd of 21 items in returned list. +STATS_PHYSICS_FPS returned value from osGetRegionStats(), 3rd of 21 items in returned list. STATS_AGENT_UPDATES returned value from osGetRegionStats(), 4th of 21 items in returned list. -STATS_ROOT_AGENTS returned value from osGetRegionStats(), 5th of 21 items in returned list. -STATS_CHILD_AGENTS returned value from osGetRegionStats(), 6th of 21 items in returned list. -STATS_TOTAL_PRIMS returned value from osGetRegionStats(), 7th of 21 items in returned list. -STATS_ACTIVE_PRIMS returned value from osGetRegionStats(), 8th of 21 items in returned list. +STATS_ROOT_AGENTS returned value from osGetRegionStats(), 5th of 21 items in returned list. +STATS_CHILD_AGENTS returned value from osGetRegionStats(), 6th of 21 items in returned list. +STATS_TOTAL_PRIMS returned value from osGetRegionStats(), 7th of 21 items in returned list. +STATS_ACTIVE_PRIMS returned value from osGetRegionStats(), 8th of 21 items in returned list. STATS_FRAME_MS returned value from osGetRegionStats(), 9th of 21 items in returned list. STATS_NET_MS returned value from osGetRegionStats(), 10th of 21 items in returned list. -STATS_PHYSICS_MS returned value from osGetRegionStats(), 11th of 21 items in returned list. +STATS_PHYSICS_MS returned value from osGetRegionStats(), 11th of 21 items in returned list. STATS_IMAGE_MS returned value from osGetRegionStats(), 12th of 21 items in returned list. STATS_OTHER_MS returned value from osGetRegionStats(), 13th of 21 items in returned list. STATS_IN_PACKETS_PER_SECOND returned value from osGetRegionStats(), 14th of 21 items in returned list. STATS_OUT_PACKETS_PER_SECOND returned value from osGetRegionStats(), 15th of 21 items in returned list. STATS_UNACKED_BYTES returned value from osGetRegionStats(), 16th of 21 items in returned list. -STATS_AGENT_MS returned value from osGetRegionStats(), 17th of 21 items in returned list. +STATS_AGENT_MS returned value from osGetRegionStats(), 17th of 21 items in returned list. STATS_PENDING_DOWNLOADS returned value from osGetRegionStats(), 18th of 21 items in returned list. STATS_PENDING_UPLOADS returned value from osGetRegionStats(), 19th of 21 items in returned list. -STATS_ACTIVE_SCRIPTS returned value from osGetRegionStats(), 20th of 21 items in returned list. -STATS_SCRIPT_LPS returned value from osGetRegionStats(), 21st of 21 items in returned list. +STATS_ACTIVE_SCRIPTS returned value from osGetRegionStats(), 20th of 21 items in returned list. +STATS_SCRIPT_LPS returned value from osGetRegionStats(), 21st of 21 items in returned list. # OpenSim NPC OS_NPC used by osNPC. Value 0x01000000 OS_NPC_FLY used by osNPC. Value 0 @@ -824,43 +824,43 @@ OS_NPC_NOT_OWNED used by osNPC. Value 0x2 OS_NPC_SENSE_AS_AGENT used by osNPC. Value 0x4 OS_NPC_RUNNING used by osNPC. Value 4 # Windlight/Lightshare -WL_WATER_COLOR Windlight Water Colour -WL_WATER_FOG_DENSITY_EXPONENT Windlight Water Fog Density Exponent -WL_UNDERWATER_FOG_MODIFIER Windlight Underwater Fog Modifier -WL_REFLECTION_WAVELET_SCALE Windlight Reflection Wavelet Scale -WL_FRESNEL_SCALE Windlight Fresnel Scale -WL_FRESNEL_OFFSET Windlight Fresnel Offset -WL_REFRACT_SCALE_ABOVE Windlight Refract Scale Above -WL_REFRACT_SCALE_BELOW Windlight Refract Scale Below -WL_BLUR_MULTIPLIER Windlight Blur Multiplier -WL_BIG_WAVE_DIRECTION Windlight Big Wave Direction -WL_LITTLE_WAVE_DIRECTION Windlight Little Wave Direction -WL_NORMAL_MAP_TEXTURE Windlight Normal Map Texture -WL_HORIZON Windlight Horizon Colour -WL_HAZE_HORIZON Windlight Haze Horizon -WL_BLUE_DENSITY Windlight Blue Density -WL_HAZE_DENSITY Windlight Haze Density -WL_DENSITY_MULTIPLIER Windlight Density Multiplier -WL_DISTANCE_MULTIPLIER Windlight Distance Multiplier -WL_MAX_ALTITUDE Windlight Max Altitude -WL_SUN_MOON_COLOR Windlight Sun/Moon Colour -WL_SUN_MOON_POSITION Windlight Sun/Moon Position -WL_AMBIENT Windlight Ambient Colour -WL_EAST_ANGLE Windlight Sun/Position East -WL_SUN_GLOW_FOCUS Windlight Sun Glow Focus -WL_SUN_GLOW_SIZE Windlight Sun Glow Size -WL_SCENE_GAMMA Windlight Scene Gamma -WL_STAR_BRIGHTNESS Windlight Star Brightness -WL_CLOUD_COLOR Windlight Cloud Colour -WL_CLOUD_XY_DENSITY Windlight Cloud X/Y/Density -WL_CLOUD_COVERAGE Windlight Cloud Coverage -WL_CLOUD_SCALE Windlight Cloud Scale -WL_CLOUD_DETAIL_XY_DENSITY Windlight Cloud Detail X/Y/Density -WL_CLOUD_SCROLL_X Windlight Cloud Scroll X -WL_CLOUD_SCROLL_Y Windlight Cloud Scroll Y -WL_CLOUD_SCROLL_Y_LOCK Windlight Cloud Scroll Y Lock -WL_CLOUD_SCROLL_X_LOCK Windlight Cloud Scroll X Lock -WL_DRAW_CLASSIC_CLOUDS Windlight Draw Classic Clouds +WL_WATER_COLOR Windlight Water Colour +WL_WATER_FOG_DENSITY_EXPONENT Windlight Water Fog Density Exponent +WL_UNDERWATER_FOG_MODIFIER Windlight Underwater Fog Modifier +WL_REFLECTION_WAVELET_SCALE Windlight Reflection Wavelet Scale +WL_FRESNEL_SCALE Windlight Fresnel Scale +WL_FRESNEL_OFFSET Windlight Fresnel Offset +WL_REFRACT_SCALE_ABOVE Windlight Refract Scale Above +WL_REFRACT_SCALE_BELOW Windlight Refract Scale Below +WL_BLUR_MULTIPLIER Windlight Blur Multiplier +WL_BIG_WAVE_DIRECTION Windlight Big Wave Direction +WL_LITTLE_WAVE_DIRECTION Windlight Little Wave Direction +WL_NORMAL_MAP_TEXTURE Windlight Normal Map Texture +WL_HORIZON Windlight Horizon Colour +WL_HAZE_HORIZON Windlight Haze Horizon +WL_BLUE_DENSITY Windlight Blue Density +WL_HAZE_DENSITY Windlight Haze Density +WL_DENSITY_MULTIPLIER Windlight Density Multiplier +WL_DISTANCE_MULTIPLIER Windlight Distance Multiplier +WL_MAX_ALTITUDE Windlight Max Altitude +WL_SUN_MOON_COLOR Windlight Sun/Moon Colour +WL_SUN_MOON_POSITION Windlight Sun/Moon Position +WL_AMBIENT Windlight Ambient Colour +WL_EAST_ANGLE Windlight Sun/Position East +WL_SUN_GLOW_FOCUS Windlight Sun Glow Focus +WL_SUN_GLOW_SIZE Windlight Sun Glow Size +WL_SCENE_GAMMA Windlight Scene Gamma +WL_STAR_BRIGHTNESS Windlight Star Brightness +WL_CLOUD_COLOR Windlight Cloud Colour +WL_CLOUD_XY_DENSITY Windlight Cloud X/Y/Density +WL_CLOUD_COVERAGE Windlight Cloud Coverage +WL_CLOUD_SCALE Windlight Cloud Scale +WL_CLOUD_DETAIL_XY_DENSITY Windlight Cloud Detail X/Y/Density +WL_CLOUD_SCROLL_X Windlight Cloud Scroll X +WL_CLOUD_SCROLL_Y Windlight Cloud Scroll Y +WL_CLOUD_SCROLL_Y_LOCK Windlight Cloud Scroll Y Lock +WL_CLOUD_SCROLL_X_LOCK Windlight Cloud Scroll X Lock +WL_DRAW_CLASSIC_CLOUDS Windlight Draw Classic Clouds # WL Constants added unique to Aurora-Sim WL_OK Value -1 WL_ERROR Value -2 @@ -874,74 +874,74 @@ ENABLE_GRAVITY enable_gravity. GRAVITY_FORCE_X gravity_force_x. GRAVITY_FORCE_Y gravity_force_y. GRAVITY_FORCE_Z gravity_force_z. -ADD_GRAVITY_POINT add_gravity_point. -ADD_GRAVITY_FORCE add_gravity_force. -START_TIME_REVERSAL_SAVING start_time_reversal_saving. -STOP_TIME_REVERSAL_SAVING stop_time_reversal_saving. -START_TIME_REVERSAL start_time_reversal. -STOP_TIME_REVERSAL stop_time_reversal. +ADD_GRAVITY_POINT add_gravity_point. +ADD_GRAVITY_FORCE add_gravity_force. +START_TIME_REVERSAL_SAVING start_time_reversal_saving. +STOP_TIME_REVERSAL_SAVING stop_time_reversal_saving. +START_TIME_REVERSAL start_time_reversal. +STOP_TIME_REVERSAL stop_time_reversal. # Aurora botFunctions -BOT_FOLLOW_FLAG_NONE value 0. +BOT_FOLLOW_FLAG_NONE value 0. BOT_FOLLOW_FLAG_INDEFINITELY value 1. -BOT_TAG_FIND_ALL value AllBots. +BOT_TAG_FIND_ALL value AllBots. BOT_FOLLOW_WALK value 0. BOT_FOLLOW_RUN value 1. BOT_FOLLOW_FLY value 2. -BOT_FOLLOW_TELEPORT value 3. +BOT_FOLLOW_TELEPORT value 3. BOT_FOLLOW_WAIT value 4. -BOT_FOLLOW_TRIGGER_HERE_EVENT value 1. +BOT_FOLLOW_TRIGGER_HERE_EVENT value 1. BOT_FOLLOW_FLAG_FORCEDIRECTPATH value 4. # string constants [word .1, .3, .5] -NULL_KEY Indicates an empty key -EOF Indicates the last line of a notecard was read -TEXTURE_BLANK UUID for the "Blank" texture -TEXTURE_DEFAULT Alias for TEXTURE_PLYWOOD -TEXTURE_MEDIA UUID for the "Default Media" texture -TEXTURE_PLYWOOD UUID for the default "Plywood" texture -TEXTURE_TRANSPARENT UUID for the "White - Transparent" texture +NULL_KEY Indicates an empty key +EOF Indicates the last line of a notecard was read +TEXTURE_BLANK UUID for the "Blank" texture +TEXTURE_DEFAULT Alias for TEXTURE_PLYWOOD +TEXTURE_MEDIA UUID for the "Default Media" texture +TEXTURE_PLYWOOD UUID for the default "Plywood" texture +TEXTURE_TRANSPARENT UUID for the "White - Transparent" texture -URL_REQUEST_GRANTED Used with http_request when a public URL is successfully granted -URL_REQUEST_DENIED Used with http_request when a public URL is not available +URL_REQUEST_GRANTED Used with http_request when a public URL is successfully granted +URL_REQUEST_DENIED Used with http_request when a public URL is not available # float constants [word .3, .1, .5] -PI 3.1415926535897932384626433832795 -TWO_PI 6.283185307179586476925286766559 -PI_BY_TWO 1.5707963267948966192313216916398 -DEG_TO_RAD To convert from degrees to radians -RAD_TO_DEG To convert from radians to degrees -SQRT2 1.4142135623730950488016887242097 +PI 3.1415926535897932384626433832795 +TWO_PI 6.283185307179586476925286766559 +PI_BY_TWO 1.5707963267948966192313216916398 +DEG_TO_RAD To convert from degrees to radians +RAD_TO_DEG To convert from radians to degrees +SQRT2 1.4142135623730950488016887242097 # compound constants [word .4, .2, .4] -ZERO_VECTOR <0.0, 0.0, 0.0> -ZERO_ROTATION <0.0, 0.0, 0.0, 1.0> +ZERO_VECTOR <0.0, 0.0, 0.0> +ZERO_ROTATION <0.0, 0.0, 0.0, 1.0> # flow control keywords [word 0, 0, .8] -for for loop:for (initializer; test; iteration):{: statements:} -do do loop:do:{: statements:} while (test); -while while loop:while (test):{ statements:} -if if statement:if (test):{ statements:} -else else clause:if (test):{ statements:}:else:{ statements:} -jump jump statement:jump label;: -return Leave current function or event handler +for for loop:for (initializer; test; iteration):{: statements:} +do do loop:do:{: statements:} while (test); +while while loop:while (test):{ statements:} +if if statement:if (test):{ statements:} +else else clause:if (test):{ statements:}:else:{ statements:} +jump jump statement:jump label;: +return Leave current function or event handler # flow control label [line 0, 0, .8] -@ Label:Target for jump statement +@ Label:Target for jump statement # Comment [one_sided_delimiter .8, .3, .15] -// Comment:Non-functional commentary or disabled code +// Comment:Non-functional commentary or disabled code [two_sided_delimiter .8, .3, .15] -/* */ Comment:Non-functional commentary or disabled code +/* */ Comment:Non-functional commentary or disabled code # String literals [double_quotation_marks 0, .2, 0] -" String literal +" String literal #functions are supplied by the program now diff --git a/indra/newview/app_settings/low_graphics.xml b/indra/newview/app_settings/low_graphics.xml index 9e9be14bb..0e589e602 100644 --- a/indra/newview/app_settings/low_graphics.xml +++ b/indra/newview/app_settings/low_graphics.xml @@ -25,7 +25,7 @@ - + diff --git a/indra/newview/app_settings/mid_graphics.xml b/indra/newview/app_settings/mid_graphics.xml index 4c1ec5494..3e22920b9 100644 --- a/indra/newview/app_settings/mid_graphics.xml +++ b/indra/newview/app_settings/mid_graphics.xml @@ -25,7 +25,7 @@ - + diff --git a/indra/newview/app_settings/settings.xml b/indra/newview/app_settings/settings.xml index aa457f772..c1f005aba 100644 --- a/indra/newview/app_settings/settings.xml +++ b/indra/newview/app_settings/settings.xml @@ -674,10 +674,34 @@ Value 0 + LiruGridInTitle + + Comment + Show grid name in the viewer window title (takes effect upon next login) + Persist + 1 + Type + Boolean + Value + 0 + IsCOA + 1 + + LiruGroupNoticeTimes + + Comment + Append timestamp to date in the lists of past group notices + Persist + 1 + Type + Boolean + Value + 0 + LiruItalicizeActions Comment - When enabled, /me chat will be italicized. + When enabled, /me chat will be italicized. Persist 1 Type @@ -707,6 +731,17 @@ Value 1 + LiruLegacyLogLaunch + + Comment + When opening a chat log, open in an external text editor instead of a browser floater(Windows Only). + Persist + 1 + Type + Boolean + Value + 0 + LiruLegacyOutfitStoreObjChanges Comment @@ -718,6 +753,28 @@ Value 1 + LiruLegacySpeakerNames + + Comment + Whether all lists of speakers use legacy names, or your desired way of displaying names. + Persist + 1 + Type + Boolean + Value + 0 + + LiruLocalTime + + Comment + Whether or not to display system time in the top bar instead of server time. + Persist + 1 + Type + Boolean + Value + 0 + LiruMapShowAvCount Comment @@ -740,6 +797,32 @@ Value 20000 + LiruNewMessageSound + + Comment + Sound ID to play when ding is on for an IM session and an IM comes in. + Persist + 1 + Type + String + Value + 67cc2844-00f3-2b3c-b991-6418d01e1bb7 + IsCOA + 1 + + LiruNewMessageSoundForSystemMessages + + Comment + Sound ID to play when ding is on for an IM session and a system message comes through, like when the correspondent starts typing or logs off. (Defaults to off) + Persist + 1 + Type + String + Value + + IsCOA + 1 + LiruNoTransactionClutter Comment @@ -785,6 +868,41 @@ Found in Advanced->Rendering->Info Displays Value 0 + SLBShowFPS + + Comment + Show FPS + Persist + 1 + Type + Boolean + Value + 0 + + SLBDisplayClientTagOnNewLine + + Comment + Display the client tag on a new line + Persist + 1 + Type + Boolean + Value + 1 + + LogShowHistoryLines + + Comment + Lines of history to load from log file if LogShowHistory is true. + Persist + 1 + Type + U32 + Value + 32 + IsCOA + 1 + ContactsUseHorizontalButtons Comment @@ -918,6 +1036,28 @@ This should be as low as possible, but too low may break functionality Value 60.0 + NewIMsPerConversation + + Comment + The New IMs button in the bottom left will show the count of unread conversations instead of the total count of unread IMs if this is true. + Persist + 1 + Type + Boolean + Value + 0 + + NewIMsPerConversationReset + + Comment + When NewIMsPerConversation is on, this determines when the New IMs button becomes visible while the communicate floater is closed. True will wait until a new IM is received, false displays as long as a conversation is unread. + Persist + 1 + Type + Boolean + Value + 1 + ResetFocusOnSelfClick Comment @@ -929,6 +1069,17 @@ This should be as low as possible, but too low may break functionality Value 1 + ResetViewTurnsAvatar + + Comment + When true, resetting view by hitting escape or using the menu entry will turn your avatar to the direction the camera was pointed + Persist + 1 + Type + Boolean + Value + 0 + ShowDisplayNameChanges Comment @@ -951,6 +1102,17 @@ This should be as low as possible, but too low may break functionality Value 0 + ShowUnreadIMsCounts + + Comment + Show the count of unread IMs in the communicate flyout list + Persist + 1 + Type + Boolean + Value + 1 + StatusBarPositionBeforeParcel Comment @@ -962,16 +1124,16 @@ This should be as low as possible, but too low may break functionality Value 0 - MoyFastMiniMap + ShowMiniMapObjects Comment - Don't show buildings on mini-map + Show buildings and megaprims on the mini-map Persist 1 Type Boolean Value - 0 + 1 BeauchampFloaterGroupTitlesRect @@ -1308,6 +1470,28 @@ This should be as low as possible, but too low may break functionality Value 0 + AntiSpamNotFriend + + Comment + When true, dialogs from friends will not be blocked unless the _NACL_Antispam is true. + Persist + 1 + Type + Boolean + Value + 0 + + AntiSpamNotMine + + Comment + When true, dialogs from your own objects will not be blocked unless the _NACL_Antispam is true. + Persist + 1 + Type + Boolean + Value + 0 + AntiSpamNotify Comment @@ -2017,6 +2201,17 @@ This should be as low as possible, but too low may break functionality 1 + CrashHostUrl + + Comment + A URL pointing to a crash report handler; overrides cluster negotiation to locate crash handler. + Persist + 1 + Type + String + Value + http://crash.singularityviewer.org/report.php> + AFKTimeout Comment @@ -5728,6 +5923,17 @@ This should be as low as possible, but too low may break functionality Value 0 + DoubleClickTeleportMap + + Comment + Enable double-click-teleport for the map + Persist + 1 + Type + Boolean + Value + 1 + DoubleClickTeleportMiniMap Comment @@ -5896,7 +6102,7 @@ This should be as low as possible, but too low may break functionality EnableGestureSoundsSelf Comment - Play sounds from your gestures when EnableGestureSounds is false. (Useless otherewise) + Play sounds from your gestures when EnableGestureSounds is false. (Useless otherwise) Persist 1 Type @@ -6736,22 +6942,6 @@ This should be as low as possible, but too low may break functionality 100 - FloaterIMRect - - Comment - Rectangle for IM window - Persist - 1 - Type - Rect - Value - - 0 - 160 - 500 - 0 - - FloaterInspectRect Comment @@ -6784,6 +6974,22 @@ This should be as low as possible, but too low may break functionality 0 + FloaterInvPanelRect + + Comment + Rectangle for new inventory windows a folder is opened in + Persist + 1 + Type + Rect + Value + + 0 + 400 + 300 + 0 + + FloaterJoystickRect Comment @@ -9835,6 +10041,28 @@ This should be as low as possible, but too low may break functionality Value 1 + MiniMapPrimMaxAltitudeDelta + + Comment + Max allowed altitude difference between your avatar and prims others own for them to be displayed on the minimap (0 means unlimited). + Persist + 1 + Type + U32 + Value + 256 + + MiniMapPrimMaxAltitudeDeltaOwn + + Comment + Max allowed altitude difference between your avatar and prims you own for them to be displayed on the minimap (0 means unlimited). + Persist + 1 + Type + U32 + Value + 0 + MiniMapPrimMaxRadius Comment @@ -9868,6 +10096,87 @@ This should be as low as possible, but too low may break functionality Value 1 + MiniMapWhisperRing + + Comment + Display whisper distance ring on mini map + Persist + 1 + Type + Boolean + Value + 0 + + MiniMapWhisperRingColor + + Comment + Color for whisper distance ring on mini map + Persist + 1 + Type + Color4 + Value + + 0.0 + 1.0 + 0.0 + 0.5 + + + MiniMapChatRing + + Comment + Display chat distance ring on mini map + Persist + 1 + Type + Boolean + Value + 0 + + MiniMapChatRingColor + + Comment + Color for chat distance ring on mini map + Persist + 1 + Type + Color4 + Value + + 1.0 + 1.0 + 0.0 + 0.5 + + + MiniMapShoutRing + + Comment + Display shout distance ring on mini map + Persist + 1 + Type + Boolean + Value + 0 + + MiniMapShoutRingColor + + Comment + Color for shout distance ring on mini map + Persist + 1 + Type + Color4 + Value + + 1.0 + 0.0 + 0.0 + 0.5 + + MiniMapScale Comment @@ -10529,7 +10838,7 @@ This should be as low as possible, but too low may break functionality Type Boolean Value - 1 + 0 PerAccountSettingsFile @@ -12043,7 +12352,7 @@ This should be as low as possible, but too low may break functionality 0 - + RenderNoAlpha Comment @@ -13509,7 +13818,7 @@ This should be as low as possible, but too low may break functionality Type U32 Value - 128 + 32 RunBtnState @@ -17346,6 +17655,88 @@ This should be as low as possible, but too low may break functionality Value 1280.0 + ColladaExportFloaterRect + + Comment + Collada floater position + Persist + 1 + Type + Rect + Value + + 0 + 0 + 0 + 0 + + + DAEExportConsolidateMaterials + + Comment + Combine faces with same texture + Persist + 1 + Type + Boolean + Value + 1 + + DAEExportSkipTransparent + + Comment + Skip exporting faces with default transparent texture or full transparent + Persist + 1 + Type + Boolean + Value + 0 + + DAEExportTextures + + Comment + Export textures when exporting Collada + Persist + 1 + Type + Boolean + Value + 1 + + DAEExportTextureParams + + Comment + Apply texture params suchs as repeats to the exported UV map + Persist + 1 + Type + Boolean + Value + 1 + + DAEExportTexturesType + + Comment + Image file format to use when exporting Collada + Persist + 1 + Type + S32 + Value + 0 + + CrashSubmitBehavior + + Comment + Controls behavior when viewer crashes (0 = ask before sending crash report, 1 = always send crash report, 2 = never send crash report) + Persist + 1 + Type + S32 + Value + 1 + diff --git a/indra/newview/app_settings/settings_ascent.xml b/indra/newview/app_settings/settings_ascent.xml index dc4a0498d..4bd498e04 100644 --- a/indra/newview/app_settings/settings_ascent.xml +++ b/indra/newview/app_settings/settings_ascent.xml @@ -266,7 +266,7 @@ Type Boolean Value - 1 + 0 AscentShowOthersTag @@ -620,6 +620,28 @@ Value 0 + SinguDefaultEaseIn + + Comment + Amount of time (in seconds) over which uploaded bvh animation blends in by default. + Persist + 1 + Type + F32 + Value + 0 + + SinguDefaultEaseOut + + Comment + Amount of time (in seconds) over which uploaded bvh animation blends out by default. + Persist + 1 + Type + F32 + Value + 0 + SinguMotionResetsCamera Comment diff --git a/indra/newview/app_settings/settings_ascent_coa.xml b/indra/newview/app_settings/settings_ascent_coa.xml index 2cb809679..31290185b 100644 --- a/indra/newview/app_settings/settings_ascent_coa.xml +++ b/indra/newview/app_settings/settings_ascent_coa.xml @@ -204,6 +204,24 @@ IsCOA 1 + MapAvatar + + Comment + Color for map dots of residents who don't qualify for any color else. + Persist + 1 + Type + Color4 + Value + + 0.0 + 1.0 + 0.0 + 1.0 + + IsCOA + 1 + ColorFriendChat Comment diff --git a/indra/newview/app_settings/settings_crash_behavior.xml b/indra/newview/app_settings/settings_crash_behavior.xml index 0665d86f2..74704f8ad 100644 --- a/indra/newview/app_settings/settings_crash_behavior.xml +++ b/indra/newview/app_settings/settings_crash_behavior.xml @@ -9,39 +9,6 @@ Type S32 Value - 2 - - CurlMaxTotalConcurrentConnections - - Comment - Maximum total number of simultaneous curl connections - Persist - 1 - Type - U32 - Value - 64 - - CurlConcurrentConnectionsPerService - - Comment - Maximum number of simultaneous curl connections per host:port service - Persist - 0 - Type - U32 - Value - 8 - - NoVerifySSLCert - - Comment - Do not verify SSL certificates. - Persist - 1 - Type - Boolean - Value 1 diff --git a/indra/newview/app_settings/settings_per_account.xml b/indra/newview/app_settings/settings_per_account.xml index d3521c5f0..b5d15381d 100644 --- a/indra/newview/app_settings/settings_per_account.xml +++ b/indra/newview/app_settings/settings_per_account.xml @@ -588,7 +588,7 @@ LogFileNamewithDate Comment - Add Date Stamp to chat and IM Logs with format chat-YYYY-MM-DD and 'IM file name'-YYYY-MM. To view old logs goto ..\Second Life\[login name] + Add Date Stamp to local chat log as specified by LogFileLocalChatDateFormat and IM logs as specified by LogFileIMsDateFormat. To view old logs goto ..\Second Life\[login name] Persist 1 Type @@ -596,6 +596,28 @@ Value 0 + LogFileLocalChatDateFormat + + Comment + When LogFileNamewithDate is true, this is the format used append the date to the log name for Local Chat (Default is -%Y-%m-%d resulting in chat-YYYY-MM-DD) + Persist + 1 + Type + String + Value + -%Y-%m-%d + + LogFileIMsDateFormat + + Comment + When LogFileNamewithDate is true, this is the format used append the date to the log names for IMs (Default is -%Y-%m resulting in 'IM file name'-YYYY-MM) + Persist + 1 + Type + String + Value + -%Y-%m + KeywordsChangeColor diff --git a/indra/newview/app_settings/ultra_graphics.xml b/indra/newview/app_settings/ultra_graphics.xml index 6181cbdc0..6734c6db0 100644 --- a/indra/newview/app_settings/ultra_graphics.xml +++ b/indra/newview/app_settings/ultra_graphics.xml @@ -25,7 +25,7 @@ - + diff --git a/indra/newview/ascentprefschat.cpp b/indra/newview/ascentprefschat.cpp index 8e2df4678..5def0f4bb 100644 --- a/indra/newview/ascentprefschat.cpp +++ b/indra/newview/ascentprefschat.cpp @@ -210,6 +210,10 @@ void LLPrefsAscentChat::onCommitDialogBlock(LLUICtrl* ctrl, const LLSD& value) childSetEnabled("Item Offers", !enabled); childSetEnabled("Scripts", !enabled); childSetEnabled("Teleport Offers", !enabled); + childSetEnabled("Teleport Requests", !enabled); + childSetEnabled("Except those from:", !enabled); + childSetEnabled("My objects", !enabled); + childSetEnabled("My friends", !enabled); } } @@ -293,6 +297,7 @@ void LLPrefsAscentChat::refreshValues() mOneLineConfButt = gSavedSettings.getBOOL("UseConciseConferenceButtons"); mOnlyComm = gSavedSettings.getBOOL("CommunicateSpecificShortcut"); mItalicizeActions = gSavedSettings.getBOOL("LiruItalicizeActions"); + mLegacySpeakerNames = gSavedSettings.getBOOL("LiruLegacySpeakerNames"); //Autoresponse ------------------------------------------------------------------------ mIMResponseAnyoneItemID = gSavedPerAccountSettings.getString("AutoresponseAnyoneItemID"); @@ -329,6 +334,8 @@ void LLPrefsAscentChat::refreshValues() mBlockGroupFeeInviteSpam = gSavedSettings.getBOOL("AntiSpamGroupFeeInvites"); mBlockGroupNoticeSpam = gSavedSettings.getBOOL("AntiSpamGroupNotices"); mBlockItemOfferSpam = gSavedSettings.getBOOL("AntiSpamItemOffers"); + mBlockNotFriendSpam = gSavedSettings.getBOOL("AntiSpamNotFriend"); + mBlockNotMineSpam = gSavedSettings.getBOOL("AntiSpamNotMine"); mBlockScriptSpam = gSavedSettings.getBOOL("AntiSpamScripts"); mBlockTeleportSpam = gSavedSettings.getBOOL("AntiSpamTeleports"); mBlockTeleportRequestSpam = gSavedSettings.getBOOL("AntiSpamTeleportRequests"); @@ -528,6 +535,7 @@ void LLPrefsAscentChat::cancel() gSavedSettings.setBOOL("UseConciseConferenceButtons", mOneLineConfButt); gSavedSettings.setBOOL("CommunicateSpecificShortcut", mOnlyComm); gSavedSettings.setBOOL("LiruItalicizeActions", mItalicizeActions); + gSavedSettings.setBOOL("LiruLegacySpeakerNames", mLegacySpeakerNames); //Autoresponse ------------------------------------------------------------------------ gSavedPerAccountSettings.setString("AutoresponseAnyoneItemID", mIMResponseAnyoneItemID); @@ -547,6 +555,8 @@ void LLPrefsAscentChat::cancel() gSavedSettings.setBOOL("AntiSpamGroupInvites", mBlockGroupInviteSpam); gSavedSettings.setBOOL("AntiSpamGroupFeeInvites", mBlockGroupFeeInviteSpam); gSavedSettings.setBOOL("AntiSpamItemOffers", mBlockItemOfferSpam); + gSavedSettings.setBOOL("AntiSpamNotFriend", mBlockNotFriendSpam); + gSavedSettings.setBOOL("AntiSpamNotMine", mBlockNotMineSpam); gSavedSettings.setBOOL("AntiSpamScripts", mBlockScriptSpam); gSavedSettings.setBOOL("AntiSpamTeleports", mBlockTeleportSpam); gSavedSettings.setBOOL("AntiSpamTeleportRequests", mBlockTeleportRequestSpam); diff --git a/indra/newview/ascentprefschat.h b/indra/newview/ascentprefschat.h index 476f82551..5e0ecd707 100644 --- a/indra/newview/ascentprefschat.h +++ b/indra/newview/ascentprefschat.h @@ -86,6 +86,7 @@ protected: bool mOneLineConfButt; bool mOnlyComm; bool mItalicizeActions; + bool mLegacySpeakerNames; //Autoresponse ------------------------------------------------------------------------ std::string mIMResponseAnyoneItemID; @@ -105,6 +106,8 @@ protected: BOOL mBlockGroupInviteSpam; BOOL mBlockGroupFeeInviteSpam; BOOL mBlockItemOfferSpam; + bool mBlockNotMineSpam; + bool mBlockNotFriendSpam; BOOL mBlockScriptSpam; BOOL mBlockTeleportSpam; bool mBlockTeleportRequestSpam; diff --git a/indra/newview/ascentprefsvan.cpp b/indra/newview/ascentprefsvan.cpp index 869b4026a..0166c951b 100644 --- a/indra/newview/ascentprefsvan.cpp +++ b/indra/newview/ascentprefsvan.cpp @@ -174,6 +174,7 @@ void LLPrefsAscentVan::refreshValues() mShowSelfClientTag = gSavedSettings.getBOOL("AscentShowSelfTag"); mShowSelfClientTagColor = gSavedSettings.getBOOL("AscentShowSelfTagColor"); mShowFriendsTag = gSavedSettings.getBOOL("AscentShowFriendsTag"); + mDisplayClientTagOnNewLine = gSavedSettings.getBOOL("SLBDisplayClientTagOnNewLine"); mCustomTagOn = gSavedSettings.getBOOL("AscentUseCustomTag"); mCustomTagLabel = gSavedSettings.getString("AscentCustomTagLabel"); mCustomTagColor = gSavedSettings.getColor4("AscentCustomTagColor"); @@ -187,6 +188,7 @@ void LLPrefsAscentVan::refreshValues() mEstateOwnerColor = gSavedSettings.getColor4("AscentEstateOwnerColor"); mLindenColor = gSavedSettings.getColor4("AscentLindenColor"); mMutedColor = gSavedSettings.getColor4("AscentMutedColor"); + mMapAvatarColor = gSavedSettings.getColor4("MapAvatar"); mCustomColor = gSavedSettings.getColor4("MoyMiniMapCustomColor"); mColorFriendChat = gSavedSettings.getBOOL("ColorFriendChat"); mColorEOChat = gSavedSettings.getBOOL("ColorEstateOwnerChat"); @@ -245,6 +247,7 @@ void LLPrefsAscentVan::cancel() gSavedSettings.setBOOL("AscentShowSelfTag", mShowSelfClientTag); gSavedSettings.setBOOL("AscentShowSelfTagColor", mShowSelfClientTagColor); gSavedSettings.setBOOL("AscentShowFriendsTag", mShowFriendsTag); + gSavedSettings.setBOOL("SLBDisplayClientTagOnNewLine", mDisplayClientTagOnNewLine); gSavedSettings.setBOOL("AscentUseCustomTag", mCustomTagOn); gSavedSettings.setString("AscentCustomTagLabel", mCustomTagLabel); gSavedSettings.setColor4("AscentCustomTagColor", mCustomTagColor); @@ -258,6 +261,7 @@ void LLPrefsAscentVan::cancel() gSavedSettings.setColor4("AscentEstateOwnerColor", mEstateOwnerColor); gSavedSettings.setColor4("AscentLindenColor", mLindenColor); gSavedSettings.setColor4("AscentMutedColor", mMutedColor); + gSavedSettings.setColor4("MapAvatar", mMapAvatarColor); gSavedSettings.setColor4("MoyMiniMapCustomColor", mCustomColor); gSavedSettings.setBOOL("ColorFriendChat", mColorFriendChat); gSavedSettings.setBOOL("ColorEstateOwnerChat", mColorEOChat); diff --git a/indra/newview/ascentprefsvan.h b/indra/newview/ascentprefsvan.h index 5ec08c605..77285b23d 100644 --- a/indra/newview/ascentprefsvan.h +++ b/indra/newview/ascentprefsvan.h @@ -71,6 +71,7 @@ protected: BOOL mShowSelfClientTag; BOOL mShowSelfClientTagColor; BOOL mShowFriendsTag; + BOOL mDisplayClientTagOnNewLine; BOOL mCustomTagOn; std::string mCustomTagLabel; LLColor4 mCustomTagColor; @@ -84,6 +85,7 @@ protected: LLColor4 mEstateOwnerColor; LLColor4 mLindenColor; LLColor4 mMutedColor; + LLColor4 mMapAvatarColor; LLColor4 mCustomColor; bool mColorFriendChat; bool mColorEOChat; diff --git a/indra/newview/awavefront.cpp b/indra/newview/awavefront.cpp index 635d9b9a9..4af106c12 100644 --- a/indra/newview/awavefront.cpp +++ b/indra/newview/awavefront.cpp @@ -35,6 +35,9 @@ #include "llface.h" #include "llvoavatar.h" #include "llvovolume.h" +#include "llviewerinventory.h" +#include "llinventorymodel.h" +#include "llinventoryfunctions.h" // menu includes #include "llevent.h" @@ -221,13 +224,51 @@ void WavefrontSaver::Add(const LLViewerObject* some_vo) namespace { // Identical to the one in daeexport.cpp. - bool can_export_node(const LLSelectNode* node) + bool can_export_node(LLSelectNode* node) { LLPermissions* perms = node->mPermissions; // Is perms ever NULL? // This tests the PERM_EXPORT bit too, which is not really necessary (just checking if it's set // on the root prim would suffice), but also isn't hurting. - return perms && perms->allowExportBy(gAgentID, LFSimFeatureHandler::instance().simSupportsExport()); + if (!(perms && perms->allowExportBy(gAgentID, LFSimFeatureHandler::instance().exportPolicy()))) + { + return false; + } + + // Additionally chack if this is a sculpt + LLViewerObject* obj = node->getObject(); + if (obj->isSculpted() && !obj->isMesh()) + { + LLSculptParams *sculpt_params = (LLSculptParams *)obj->getParameterEntry(LLNetworkData::PARAMS_SCULPT); + LLUUID sculpt_id = sculpt_params->getSculptTexture(); + + // Find inventory items with asset id of the sculpt map + LLViewerInventoryCategory::cat_array_t cats; + LLViewerInventoryItem::item_array_t items; + LLAssetIDMatches asset_id_matches(sculpt_id); + gInventory.collectDescendentsIf(LLUUID::null, + cats, + items, + LLInventoryModel::INCLUDE_TRASH, + asset_id_matches); + + // See if any of the inventory items matching this sculpt id are exportable + for (S32 i = 0; i < items.count(); i++) + { + const LLPermissions item_permissions = items[i]->getPermissions(); + if (item_permissions.allowExportBy(gAgentID, LFSimFeatureHandler::instance().exportPolicy())) + { + return true; + } + } + + return false; + } + else // not sculpt, we already checked generic permissions + { + return true; + } } + class LFSaveSelectedObjects : public view_listener_t { bool handleEvent(LLPointer event, const LLSD& userdata) @@ -323,7 +364,7 @@ void WavefrontSaver::Add(const LLVOAvatar* av_vo) //adds attachments, too! { const LLViewerObject* c = *iterc; if (!c) continue; - if (const LLSelectNode* n = LLSelectMgr::getInstance()->getSelection()->findNode(const_cast(c))) + if (LLSelectNode* n = LLSelectMgr::getInstance()->getSelection()->findNode(const_cast(c))) { if (!can_export_node(n)) continue; } diff --git a/indra/newview/chatbar_as_cmdline.cpp b/indra/newview/chatbar_as_cmdline.cpp index 83b1f3709..4b8bd598b 100644 --- a/indra/newview/chatbar_as_cmdline.cpp +++ b/indra/newview/chatbar_as_cmdline.cpp @@ -444,6 +444,7 @@ bool cmd_line_chat(std::string revised_text, EChatType type) { gChatBar->sendChatFromViewer(text, CHAT_TYPE_STOP, FALSE); } + return false; } else if(command == utf8str_tolower(sAscentCmdLineClearChat)) { @@ -460,6 +461,7 @@ bool cmd_line_chat(std::string revised_text, EChatType type) else if(command == "invrepair") { invrepair(); + return false; } #ifdef PROF_CTRL_CALLS else if(command == "dumpcalls") diff --git a/indra/newview/daeexport.cpp b/indra/newview/daeexport.cpp index 44bde7816..8c8aa3641 100644 --- a/indra/newview/daeexport.cpp +++ b/indra/newview/daeexport.cpp @@ -1,81 +1,70 @@ /** - * @file daeexport.cpp - * @brief A system which allows saving in-world objects to Collada .DAE files for offline texturizing/shading. - * @authors Latif Khalifa - * - * $LicenseInfo:firstyear=2013&license=LGPLV2.1$ - * Copyright (C) 2013 Latif Khalifa - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2.1 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General - * Public License along with this library; if not, write to the - * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, - * Boston, MA 02110-1301 USA - */ +* @file daeexport.cpp +* @brief A system which allows saving in-world objects to Collada .DAE files for offline texturizing/shading. +* @authors Latif Khalifa +* +* $LicenseInfo:firstyear=2013&license=LGPLV2.1$ +* Copyright (C) 2013 Latif Khalifa +* +* This library is free software; you can redistribute it and/or +* modify it under the terms of the GNU Lesser General Public +* License as published by the Free Software Foundation; either +* version 2.1 of the License, or (at your option) any later version. +* +* This library is distributed in the hope that it will be useful, +* but WITHOUT ANY WARRANTY; without even the implied warranty of +* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +* Lesser General Public License for more details. +* +* You should have received a copy of the GNU Lesser General +* Public License along with this library; if not, write to the +* Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, +* Boston, MA 02110-1301 USA +*/ #include "llviewerprecompiledheaders.h" #include "daeexport.h" //colladadom includes -#if LL_MSVC -#pragma warning (disable : 4018) -#pragma warning (push) -#pragma warning (disable : 4068) -#pragma warning (disable : 4263) -#pragma warning (disable : 4264) -#endif -#pragma GCC diagnostic ignored "-Woverloaded-virtual" #include "dae.h" -//#include "dom.h" -#include "dom/domAsset.h" -#include "dom/domBind_material.h" #include "dom/domCOLLADA.h" -#include "dom/domConstants.h" -#include "dom/domController.h" -#include "dom/domEffect.h" -#include "dom/domGeometry.h" -#include "dom/domInstance_geometry.h" -#include "dom/domInstance_material.h" -#include "dom/domInstance_node.h" -#include "dom/domInstance_effect.h" -#include "dom/domMaterial.h" #include "dom/domMatrix.h" -#include "dom/domNode.h" -#include "dom/domProfile_COMMON.h" -#include "dom/domRotate.h" -#include "dom/domScale.h" -#include "dom/domTranslate.h" -#include "dom/domVisual_scene.h" -#if LL_MSVC -#pragma warning (pop) -#endif // library includes #include "aifilepicker.h" #include "llnotificationsutil.h" -#include "boost/date_time/posix_time/posix_time.hpp" // newview includes #include "lfsimfeaturehandler.h" #include "llface.h" #include "llvovolume.h" +#include "llviewerinventory.h" +#include "llinventorymodel.h" +#include "llinventoryfunctions.h" // menu includes #include "llevent.h" #include "llmemberlistener.h" -#include "llview.h" #include "llselectmgr.h" -#define ANY_FACE -1 +// Floater and UI +#include "llfloater.h" +#include "lluictrlfactory.h" +#include "llscrollcontainer.h" +#include "lltexturectrl.h" + +// Files and cache +#include "llcallbacklist.h" +#include "lldir.h" +#include "lltexturecache.h" +#include "llimage.h" +#include "llimagej2c.h" +#include "llimagepng.h" +#include "llimagetga.h" +#include "llimagebmp.h" +#include "llimagejpeg.h" + +#define TEXTURE_DOWNLOAD_TIMEOUT 60.0f extern LLUUID gAgentID; @@ -84,105 +73,496 @@ typedef LLMemberListener view_listener_t; namespace DAEExportUtil { - void saveImpl(DAESaver* daesaver, AIFilePicker* filepicker) + static LLUUID LL_TEXTURE_PLYWOOD = LLUUID("89556747-24cb-43ed-920b-47caed15465f"); + static LLUUID LL_TEXTURE_BLANK = LLUUID("5748decc-f629-461c-9a36-a35a221fe21f"); + static LLUUID LL_TEXTURE_INVISIBLE = LLUUID("38b86f85-2575-52a9-a531-23108d8da837"); + static LLUUID LL_TEXTURE_TRANSPARENT = LLUUID("8dcd4a48-2d37-4909-9f78-f7a9eb4ef903"); + static LLUUID LL_TEXTURE_MEDIA = LLUUID("8b5fec65-8d8d-9dc5-cda8-8fdf2716e361"); + + enum image_format_type { - if (filepicker->hasFilename()) + ft_tga, + ft_png, + ft_j2c, + ft_bmp, + ft_jpg + }; + + static const std::string image_format_ext[] = { "tga", "png", "j2c", "bmp", "jpg" }; + + static bool canExportTexture(const LLUUID& id, std::string* name = NULL) + { + // Find inventory items with asset id of the sculpt map + LLViewerInventoryCategory::cat_array_t cats; + LLViewerInventoryItem::item_array_t items; + LLAssetIDMatches asset_id_matches(id); + gInventory.collectDescendentsIf(LLUUID::null, + cats, + items, + LLInventoryModel::INCLUDE_TRASH, + asset_id_matches); + + // See if any of the inventory items matching this texture id are exportable + ExportPolicy policy = LFSimFeatureHandler::instance().exportPolicy(); + for (S32 i = 0; i < items.count(); i++) { - const std::string selected_filename = filepicker->getFilename(); - - daesaver->saveDAE(selected_filename); - LLNotificationsUtil::add("WavefrontExportSuccess", LLSD().with("FILENAME", selected_filename)); + const LLPermissions item_permissions = items[i]->getPermissions(); + if (item_permissions.allowExportBy(gAgentID, policy)) + { + if (name != NULL) + { + (*name) = items[i]->getName(); + } + return true; + } } - else llwarns << "No file; bailing" << llendl; - delete daesaver; + if (name != NULL) + { + (*name) = id.getString(); + } + + return (policy & ep_full_perm) == ep_full_perm; } - void filePicker(DAESaver* daesaver, std::string name) - { - AIFilePicker* filepicker = AIFilePicker::create(); - filepicker->open(name); - filepicker->run(boost::bind(&saveImpl, daesaver, filepicker)); - } - - void onPatialExportConfirm(const LLSD& notification, const LLSD& response, DAESaver* daesaver, std::string name) - { - if (LLNotificationsUtil::getSelectedOption(notification, response) == 0) // 0 - Proceed, first choice - { - filePicker(daesaver, name); - } - else - { - delete daesaver; - } - } - - // Identical to the one in awavefront.cpp - bool can_export_node(const LLSelectNode* node) + static bool canExportNode(LLSelectNode* node) { LLPermissions* perms = node->mPermissions; // Is perms ever NULL? // This tests the PERM_EXPORT bit too, which is not really necessary (just checking if it's set // on the root prim would suffice), but also isn't hurting. - return perms && perms->allowExportBy(gAgentID, LFSimFeatureHandler::instance().simSupportsExport()); + if (!(perms && perms->allowExportBy(gAgentID, LFSimFeatureHandler::instance().exportPolicy()))) + { + return false; + } + + // Additionally chack if this is a sculpt + LLViewerObject* obj = node->getObject(); + if (obj->isSculpted() && !obj->isMesh()) + { + LLSculptParams *sculpt_params = (LLSculptParams *)obj->getParameterEntry(LLNetworkData::PARAMS_SCULPT); + LLUUID sculpt_id = sculpt_params->getSculptTexture(); + return canExportTexture(sculpt_id); + } + else // not sculpt, we already checked generic permissions + { + return true; + } + } +} + + +class ColladaExportFloater + : public LLFloater +{ +private: + typedef std::map texture_list_t; + LLView* mExportBtn; + LLView* mFileName; + LLView* mTextureTypeCombo; + + DAESaver mSaver; + texture_list_t mTexturesToSave; + S32 mTotal; + S32 mNumTextures; + S32 mNumExportableTextures; + std::string mObjectName; + LLTimer mTimer; + LLUIString mTitleProgress; + +public: + ColladaExportFloater() + : LLFloater(std::string("Collada Export"), std::string("ColladaExportFloaterRect"), LLStringUtil::null) + { + mCommitCallbackRegistrar.add("ColladaExport.FilePicker", boost::bind(&ColladaExportFloater::onClickBrowse, this)); + mCommitCallbackRegistrar.add("ColladaExport.Export", boost::bind(&ColladaExportFloater::onClickExport, this)); + mCommitCallbackRegistrar.add("ColladaExport.TextureTypeCombo", boost::bind(&ColladaExportFloater::onTextureTypeCombo, this, boost::bind(&LLUICtrl::getControlName, _1), _2)); + mCommitCallbackRegistrar.add("ColladaExport.TextureExport", boost::bind(&ColladaExportFloater::onTextureExportCheck, this, _2)); + LLUICtrlFactory::getInstance()->buildFloater(this, "floater_dae_export.xml"); + + addSelectedObjects(); + if (LLUICtrl* ctrl = findChild("Object Name")) + { + ctrl->setTextArg("[NAME]", mObjectName); + } + if (LLUICtrl* ctrl = findChild("Exportable Prims")) + { + ctrl->setTextArg("[COUNT]", llformat("%d", mSaver.mObjects.size())); + ctrl->setTextArg("[TOTAL]", llformat("%d", mTotal)); + } + if (LLUICtrl* ctrl = findChild("Exportable Textures")) + { + ctrl->setTextArg("[COUNT]", llformat("%d", mNumExportableTextures)); + ctrl->setTextArg("[TOTAL]", llformat("%d", mNumTextures)); + } + addTexturePreview(); } - void saveSelectedObject() + virtual ~ColladaExportFloater() + { + if (gIdleCallbacks.containsFunction(saveTexturesWorker, this)) + { + gIdleCallbacks.deleteFunction(saveTexturesWorker, this); + } + } + + BOOL postBuild() + { + mFileName = getChildView("file name editor"); + mExportBtn = getChildView("export button"); + mTextureTypeCombo = getChildView("texture type combo"); + mTitleProgress = getString("texture_progress"); + + mTextureTypeCombo->setValue(gSavedSettings.getS32(mTextureTypeCombo->getControlName())); + onTextureExportCheck(getChildView("texture export check")->getValue()); + return TRUE; + } + + void updateTitleProgress() + { + mTitleProgress.setArg("COUNT", llformat("%d", mTexturesToSave.size())); + setTitle(mTitleProgress); + } + + void onTextureExportCheck(const LLSD& value) + { + mTextureTypeCombo->setEnabled(value); + } + + void onTextureTypeCombo(const std::string& control_name, const LLSD& value) + { + gSavedSettings.setS32(control_name, value); + } + + void onClickBrowse() { static const std::string file_ext = ".dae"; + AIFilePicker* filepicker = AIFilePicker::create(); + filepicker->open(mObjectName + file_ext); + filepicker->run(boost::bind(&ColladaExportFloater::onFilePicker, this, filepicker)); + } + void onFilePicker(AIFilePicker* filepicker) + { + if (filepicker->hasFilename()) + { + mFileName->setValue(filepicker->getFilename()); + mExportBtn->setEnabled(TRUE); + } + } + + void onClickExport() + { + if (gSavedSettings.getBOOL("DAEExportTextures")) + { + saveTextures(); + } + else + { + onTexturesSaved(); + } + } + + void onTexturesSaved() + { + std::string selected_filename = mFileName->getValue(); + mSaver.saveDAE(selected_filename); + LLNotificationsUtil::add("WavefrontExportSuccess", LLSD().with("FILENAME", selected_filename)); + close(); + } + + void addSelectedObjects() + { if (LLObjectSelectionHandle selection = LLSelectMgr::getInstance()->getSelection()) { - DAESaver* daesaver = new DAESaver; // deleted in callback - daesaver->mOffset = -selection->getFirstRootObject()->getRenderPosition(); - S32 total = 0; - S32 included = 0; + mSaver.mOffset = -selection->getFirstRootObject()->getRenderPosition(); + mObjectName = selection->getFirstRootNode()->mName; + mTotal = 0; for (LLObjectSelection::iterator iter = selection->begin(); iter != selection->end(); ++iter) { - total++; + mTotal++; LLSelectNode* node = *iter; - if (!can_export_node(node) || !node->getObject()->getVolume()) continue; - included++; - daesaver->Add(node->getObject(), node->mName); + if (!node->getObject()->getVolume() || !DAEExportUtil::canExportNode(node)) continue; + mSaver.add(node->getObject(), node->mName); } - if (daesaver->mObjects.empty()) + if (mSaver.mObjects.empty()) { LLNotificationsUtil::add("ExportFailed"); - delete daesaver; + close(); return; } - if (total != included) - { - LLSD args; - args["TOTAL"] = total; - args["FAILED"] = total - included; - LLNotificationsUtil::add("WavefrontExportPartial", args, LLSD(), boost::bind(&onPatialExportConfirm, _1, _2, daesaver, selection->getFirstNode()->mName.c_str() + file_ext)); - return; - } - - filePicker(daesaver, selection->getFirstNode()->mName.c_str() + file_ext); + mSaver.updateTextureInfo(); + mNumTextures = mSaver.mTextures.size(); + mNumExportableTextures = getNumExportableTextures(); } - return; } - class DAESaveSelectedObjects : public view_listener_t + S32 getNumExportableTextures() { - bool handleEvent(LLPointer event, const LLSD& userdata) + S32 res = 0; + + for (DAESaver::string_list_t::const_iterator t = mSaver.mTextureNames.begin(); t != mSaver.mTextureNames.end(); ++t) { - saveSelectedObject(); - return true; + std::string name = *t; + if (!name.empty()) + { + ++res; + } + } + + return res; + } + + void addTexturePreview() + { + S32 num_text = mNumExportableTextures; + if (num_text == 0) return; + + S32 img_width = 100; + S32 img_height = img_width + 15; + S32 panel_height = (num_text / 3 + 1) * (img_height) + 10; + LLScrollContainer* scroll_container = getChild("textures container"); + LLPanel* panel = new LLPanel(std::string(), LLRect(0, panel_height, 350, 0), false); + scroll_container->setScrolledView(panel); + scroll_container->addChild(panel); + panel->setEnabled(FALSE); + S32 img_nr = 0; + for (U32 i=0; i < mSaver.mTextures.size(); i++) + { + if (mSaver.mTextureNames[i].empty()) continue; + + S32 left = 16 + (img_nr % 3) * (img_width + 13); + S32 bottom = panel_height - (10 + (img_nr / 3 + 1) * (img_height)); + + LLRect rect(left, bottom + img_height, left + img_width, bottom); + LLTextureCtrl* img = new LLTextureCtrl(std::string(), rect, std::string(), mSaver.mTextures[i], LLUUID(), std::string()); + panel->addChild(img); + img_nr++; + } + } + + void saveTextures() + { + mTexturesToSave.clear(); + for (U32 i=0; i < mSaver.mTextures.size(); i++) + { + if (mSaver.mTextureNames[i].empty()) continue; + mTexturesToSave[mSaver.mTextures[i]] = mSaver.mTextureNames[i]; + } + + mSaver.mImageFormat = DAEExportUtil::image_format_ext[(S32)mTextureTypeCombo->getValue()]; + + LL_INFOS("ColladaExport") << "Starting to save textures" << LL_ENDL; + mTimer.setTimerExpirySec(TEXTURE_DOWNLOAD_TIMEOUT); + mTimer.start(); + updateTitleProgress(); + gIdleCallbacks.addFunction(saveTexturesWorker, this); + } + + class CacheReadResponder : public LLTextureCache::ReadResponder + { + private: + LLPointer mFormattedImage; + LLUUID mID; + std::string mName; + S32 mImageType; + + public: + CacheReadResponder(const LLUUID& id, LLImageFormatted* image, std::string name, S32 img_type) + : mFormattedImage(image), mID(id), mName(name), mImageType(img_type) + { + setImage(image); + } + + void setData(U8* data, S32 datasize, S32 imagesize, S32 imageformat, BOOL imagelocal) + { + if (imageformat == IMG_CODEC_TGA && mFormattedImage->getCodec() == IMG_CODEC_J2C) + { + LL_WARNS("ColladaExport") << "FAILED: texture " << mID << " is formatted as TGA. Not saving." << LL_ENDL; + mFormattedImage = NULL; + mImageSize = 0; + return; + } + + if (mFormattedImage.notNull()) + { + if (mFormattedImage->getCodec() == imageformat) + { + mFormattedImage->appendData(data, datasize); + } + else + { + LL_WARNS("ColladaExport") << "FAILED: texture " << mID << " in wrong format." << LL_ENDL; + mFormattedImage = NULL; + mImageSize = 0; + return; + } + } + else + { + mFormattedImage = LLImageFormatted::createFromType(imageformat); + mFormattedImage->setData(data, datasize); + } + mImageSize = imagesize; + mImageLocal = imagelocal; + } + + virtual void completed(bool success) + { + if (success && mFormattedImage.notNull() && mImageSize > 0) + { + bool ok = false; + + // If we are saving jpeg2000, no need to do anything, just write to disk + if (mImageType == DAEExportUtil::ft_j2c) + { + mName += "." + mFormattedImage->getExtension(); + ok = mFormattedImage->save(mName); + } + else + { + // For other formats we need to decode first + if (mFormattedImage->updateData() && (mFormattedImage->getWidth() * mFormattedImage->getHeight() * mFormattedImage->getComponents())) + { + LLPointer raw = new LLImageRaw; + raw->resize(mFormattedImage->getWidth(), mFormattedImage->getHeight(), mFormattedImage->getComponents()); + + if (mFormattedImage->decode(raw, 0)) + { + LLPointer img = NULL; + switch (mImageType) + { + case DAEExportUtil::ft_tga: + img = new LLImageTGA; + break; + case DAEExportUtil::ft_png: + img = new LLImagePNG; + break; + case DAEExportUtil::ft_bmp: + img = new LLImageBMP; + break; + case DAEExportUtil::ft_jpg: + img = new LLImageJPEG; + break; + } + + if (!img.isNull()) + { + if (img->encode(raw, 0)) + { + mName += "." + img->getExtension(); + ok = img->save(mName); + } + } + } + } + } + + if (ok) + { + LL_INFOS("ColladaExport") << "Saved texture to " << mName << LL_ENDL; + } + else + { + LL_WARNS("ColladaExport") << "FAILED to save texture " << mID << LL_ENDL; + } + } + else + { + LL_WARNS("ColladaExport") << "FAILED to save texture " << mID << LL_ENDL; + } } }; -} + static void saveTexturesWorker(void* data) + { + ColladaExportFloater* me = (ColladaExportFloater *)data; + if (me->mTexturesToSave.size() == 0) + { + LL_INFOS("ColladaExport") << "Done saving textures" << LL_ENDL; + me->updateTitleProgress(); + gIdleCallbacks.deleteFunction(saveTexturesWorker, me); + me->mTimer.stop(); + me->onTexturesSaved(); + return; + } -void DAESaver::Add(const LLViewerObject* prim, const std::string name) + LLUUID id = me->mTexturesToSave.begin()->first; + LLViewerTexture* imagep = LLViewerTextureManager::findTexture(id); + if (!imagep) + { + me->mTexturesToSave.erase(id); + me->updateTitleProgress(); + me->mTimer.reset(); + } + else + { + if (imagep->getDiscardLevel() == 0) // image download is complete + { + LL_INFOS("ColladaExport") << "Saving texture " << id << LL_ENDL; + LLImageFormatted* img = new LLImageJ2C; + S32 img_type = me->mTextureTypeCombo->getValue(); + std::string name = gDirUtilp->getDirName(me->mFileName->getValue()); + name += gDirUtilp->getDirDelimiter() + me->mTexturesToSave[id]; + CacheReadResponder* responder = new CacheReadResponder(id, img, name, img_type); + LLAppViewer::getTextureCache()->readFromCache(id, LLWorkerThread::PRIORITY_HIGH, 0, 999999, responder); + me->mTexturesToSave.erase(id); + me->updateTitleProgress(); + me->mTimer.reset(); + } + else if (me->mTimer.hasExpired()) + { + LL_WARNS("ColladaExport") << "Timed out downloading texture " << id << LL_ENDL; + me->mTexturesToSave.erase(id); + me->updateTitleProgress(); + me->mTimer.reset(); + } + } + } + +}; + +void DAESaver::add(const LLViewerObject* prim, const std::string name) { mObjects.push_back(std::pair((LLViewerObject*)prim, name)); } +void DAESaver::updateTextureInfo() +{ + mTextures.clear(); + mTextureNames.clear(); + + for (obj_info_t::iterator obj_iter = mObjects.begin(); obj_iter != mObjects.end(); ++obj_iter) + { + LLViewerObject* obj = obj_iter->first; + S32 num_faces = obj->getVolume()->getNumVolumeFaces(); + for (S32 face_num = 0; face_num < num_faces; ++face_num) + { + LLTextureEntry* te = obj->getTE(face_num); + const LLUUID id = te->getID(); + if (std::find(mTextures.begin(), mTextures.end(), id) != mTextures.end()) + { + continue; + } + mTextures.push_back(id); + std::string name; + if (id != DAEExportUtil::LL_TEXTURE_BLANK && DAEExportUtil::canExportTexture(id, &name)) + { + std::string safe_name = gDirUtilp->getScrubbedFileName(name); + std::replace(safe_name.begin(), safe_name.end(), ' ', '_'); + mTextureNames.push_back(safe_name); + } + else + { + mTextureNames.push_back(std::string()); + } + } + } +} + + class v4adapt { private: @@ -204,7 +584,7 @@ void DAESaver::addSource(daeElement* mesh, const char* src_id, std::string param src_array->setAttribute("id", llformat("%s-%s", src_id, "array").c_str()); src_array->setAttribute("count", llformat("%d", vals.size()).c_str()); - for (S32 i = 0; i < vals.size(); i++) + for (U32 i = 0; i < vals.size(); i++) { ((domFloat_array*)src_array)->getValue().append(vals[i]); } @@ -222,7 +602,7 @@ void DAESaver::addSource(daeElement* mesh, const char* src_id, std::string param } } -void DAESaver::addPolygons(daeElement* mesh, const char* geomID, const char* materialID, LLViewerObject* obj, int face_to_include) +void DAESaver::addPolygons(daeElement* mesh, const char* geomID, const char* materialID, LLViewerObject* obj, int_list_t* faces_to_include) { domPolylist* polylist = daeSafeCast(mesh->add("polylist")); polylist->setMaterial(materialID); @@ -258,9 +638,11 @@ void DAESaver::addPolygons(daeElement* mesh, const char* geomID, const char* mat S32 num_tris = 0; for (S32 face_num = 0; face_num < obj->getVolume()->getNumVolumeFaces(); face_num++) { + if (skipFace(obj->getTE(face_num))) continue; + const LLVolumeFace* face = (LLVolumeFace*)&obj->getVolume()->getVolumeFace(face_num); - if (face_to_include == ANY_FACE || face_to_include == face_num) + if (faces_to_include == NULL || (std::find(faces_to_include->begin(), faces_to_include->end(), face_num) != faces_to_include->end())) { for (S32 i = 0; i < face->mNumIndices; i++) { @@ -278,8 +660,54 @@ void DAESaver::addPolygons(daeElement* mesh, const char* geomID, const char* mat polylist->setCount(num_tris); } +void DAESaver::transformTexCoord(S32 num_vert, LLVector2* coord, LLVector3* positions, LLVector3* normals, LLTextureEntry* te, LLVector3 scale) +{ + F32 cosineAngle = cos(te->getRotation()); + F32 sinAngle = sin(te->getRotation()); + + for (S32 ii=0; iigetTexGen()) + { + LLVector3 normal = normals[ii]; + LLVector3 pos = positions[ii]; + LLVector3 binormal; + F32 d = normal * LLVector3::x_axis; + if (d >= 0.5f || d <= -0.5f) + { + binormal = LLVector3::y_axis; + if (normal.mV[0] < 0) binormal *= -1.0f; + } + else + { + binormal = LLVector3::x_axis; + if (normal.mV[1] > 0) binormal *= -1.0f; + } + LLVector3 tangent = binormal % normal; + LLVector3 scaledPos = pos.scaledVec(scale); + coord[ii].mV[0] = 1.f + ((binormal * scaledPos) * 2.f - 0.5f); + coord[ii].mV[1] = -((tangent * scaledPos) * 2.f - 0.5f); + } + + F32 repeatU; + F32 repeatV; + te->getScale(&repeatU, &repeatV); + F32 tX = coord[ii].mV[0] - 0.5f; + F32 tY = coord[ii].mV[1] - 0.5f; + + F32 offsetU; + F32 offsetV; + te->getOffset(&offsetU, &offsetV); + + coord[ii].mV[0] = (tX * cosineAngle + tY * sinAngle) * repeatU + offsetU + 0.5f; + coord[ii].mV[1] = (-tX * sinAngle + tY * cosineAngle) * repeatV + offsetV + 0.5f; + } +} + bool DAESaver::saveDAE(std::string filename) { + mAllMaterials.clear(); + mTotalNumMaterials = 0; DAE dae; // First set the filename to save daeElement* root = dae.add(filename); @@ -287,7 +715,10 @@ bool DAESaver::saveDAE(std::string filename) // Obligatory elements in header daeElement* asset = root->add("asset"); // Get ISO format time - std::string date = boost::posix_time::to_iso_extended_string(boost::posix_time::second_clock::local_time()); + time_t rawtime; + time(&rawtime); + struct tm* utc_time = gmtime(&rawtime); + std::string date = llformat("%04d-%02d-%02dT%02d:%02d:%02d", utc_time->tm_year + 1900, utc_time->tm_mon + 1, utc_time->tm_mday, utc_time->tm_hour, utc_time->tm_min, utc_time->tm_sec); daeElement* created = asset->add("created"); created->setCharData(date); daeElement* modified = asset->add("modified"); @@ -300,9 +731,10 @@ bool DAESaver::saveDAE(std::string filename) // File creator daeElement* contributor = asset->add("contributor"); - contributor->add("author")->setCharData("Singularity User"); - contributor->add("authoring_tool")->setCharData("Singularity Viewer Collada Export"); + contributor->add("author")->setCharData(LLAppViewer::instance()->getSecondLifeTitle() + " User"); + contributor->add("authoring_tool")->setCharData(LLAppViewer::instance()->getSecondLifeTitle() + " Collada Export"); + daeElement* images = root->add("library_images"); daeElement* geomLib = root->add("library_geometries"); daeElement* effects = root->add("library_effects"); daeElement* materials = root->add("library_materials"); @@ -310,6 +742,11 @@ bool DAESaver::saveDAE(std::string filename) scene->setAttribute("id", "Scene"); scene->setAttribute("name", "Scene"); + if (gSavedSettings.getBOOL("DAEExportTextures")) + { + generateImagesSection(images); + } + S32 prim_nr = 0; for (obj_info_t::iterator obj_iter = mObjects.begin(); obj_iter != mObjects.end(); ++obj_iter) @@ -329,16 +766,37 @@ bool DAESaver::saveDAE(std::string filename) std::vector position_data; std::vector normal_data; std::vector uv_data; + bool applyTexCoord = gSavedSettings.getBOOL("DAEExportTextureParams"); S32 num_faces = obj->getVolume()->getNumVolumeFaces(); - for (S32 face_num = 0; face_num < num_faces; face_num++) { + if (skipFace(obj->getTE(face_num))) continue; + const LLVolumeFace* face = (LLVolumeFace*)&obj->getVolume()->getVolumeFace(face_num); total_num_vertices += face->mNumVertices; v4adapt verts(face->mPositions); v4adapt norms(face->mNormals); + + LLVector2* newCoord = NULL; + + if (applyTexCoord) + { + newCoord = new LLVector2[face->mNumVertices]; + LLVector3* newPos = new LLVector3[face->mNumVertices]; + LLVector3* newNormal = new LLVector3[face->mNumVertices]; + for (S32 i = 0; i < face->mNumVertices; i++) + { + newPos[i] = verts[i]; + newNormal[i] = norms[i]; + newCoord[i] = face->mTexCoords[i]; + } + transformTexCoord(face->mNumVertices, newCoord, newPos, newNormal, obj->getTE(face_num), obj->getScale()); + delete[] newPos; + delete[] newNormal; + } + for (S32 i=0; i < face->mNumVertices; i++) { const LLVector3 v = verts[i]; @@ -351,13 +809,19 @@ bool DAESaver::saveDAE(std::string filename) normal_data.push_back(n.mV[VY]); normal_data.push_back(n.mV[VZ]); - const LLVector2 uv = face->mTexCoords[i]; + const LLVector2 uv = applyTexCoord ? newCoord[i] : face->mTexCoords[i]; + uv_data.push_back(uv.mV[VX]); uv_data.push_back(uv.mV[VY]); } + + if (applyTexCoord) + { + delete[] newCoord; + } } - - + + addSource(mesh, llformat("%s-%s", geomID, "positions").c_str(), "XYZ", position_data); addSource(mesh, llformat("%s-%s", geomID, "normals").c_str(), "XYZ", normal_data); addSource(mesh, llformat("%s-%s", geomID, "map0").c_str(), "ST", uv_data); @@ -371,33 +835,31 @@ bool DAESaver::saveDAE(std::string filename) verticesInput->setAttribute("source", llformat("#%s-%s", geomID, "positions").c_str()); } + material_list_t objMaterials; + getMaterials(obj, &objMaterials); + // Add triangles - for (S32 face_num = 0; face_num < num_faces; face_num++) + if (gSavedSettings.getBOOL("DAEExportConsolidateMaterials")) { - addPolygons(mesh, geomID, llformat("%s-f%d-%s", geomID, face_num, "material").c_str(), obj, face_num); + for (U32 objMaterial = 0; objMaterial < objMaterials.size(); objMaterial++) + { + int_list_t faces; + getFacesWithMaterial(obj, objMaterials[objMaterial], &faces); + std::string matName = objMaterials[objMaterial].name; + addPolygons(mesh, geomID, (matName + "-material").c_str(), obj, &faces); + } } - - // Effects (face color, alpha) - for (S32 face_num = 0; face_num < num_faces; face_num++) + else { - LLTextureEntry* te = obj->getTE(face_num); - LLColor4 color = te->getColor(); - domEffect* effect = (domEffect*)effects->add("effect"); - effect->setId(llformat("%s-f%d-%s", geomID, face_num, "fx").c_str()); - daeElement* t = effect->add("profile_COMMON technique"); - t->setAttribute("sid", "common"); - domElement* phong = t->add("phong"); - phong->add("diffuse color")->setCharData(llformat("%f %f %f %f", color.mV[0], color.mV[1], color.mV[2], color.mV[3]).c_str()); - phong->add("transparency float")->setCharData(llformat("%f", color.mV[3]).c_str()); - } - - // Materials - for (S32 face_num = 0; face_num < num_faces; face_num++) - { - domMaterial* mat = (domMaterial*)materials->add("material"); - mat->setId(llformat("%s-f%d-%s", geomID, face_num, "material").c_str()); - domElement* matEffect = mat->add("instance_effect"); - matEffect->setAttribute("url", llformat("#%s-f%d-%s", geomID, face_num, "fx").c_str()); + S32 mat_nr = 0; + for (S32 face_num = 0; face_num < num_faces; face_num++) + { + if (skipFace(obj->getTE(face_num))) continue; + int_list_t faces; + faces.push_back(face_num); + std::string matName = objMaterials[mat_nr++].name; + addPolygons(mesh, geomID, (matName + "-material").c_str(), obj, &faces); + } } daeElement* node = scene->add("node"); @@ -422,16 +884,30 @@ bool DAESaver::saveDAE(std::string filename) // Bind materials daeElement* tq = nodeGeometry->add("bind_material technique_common"); - for (S32 face_num = 0; face_num < num_faces; face_num++) + for (U32 objMaterial = 0; objMaterial < objMaterials.size(); objMaterial++) { + std::string matName = objMaterials[objMaterial].name; daeElement* instanceMaterial = tq->add("instance_material"); - instanceMaterial->setAttribute("symbol", llformat("%s-f%d-%s", geomID, face_num, "material").c_str()); - instanceMaterial->setAttribute("target", llformat("#%s-f%d-%s", geomID, face_num, "material").c_str()); + instanceMaterial->setAttribute("symbol", (matName + "-material").c_str()); + instanceMaterial->setAttribute("target", ("#" + matName + "-material").c_str()); } nodeGeometry->setAttribute("url", llformat("#%s-%s", geomID, "mesh").c_str()); } + + // Effects (face texture, color, alpha) + generateEffects(effects); + + // Materials + for (U32 objMaterial = 0; objMaterial < mAllMaterials.size(); objMaterial++) + { + daeElement* mat = materials->add("material"); + mat->setAttribute("id", (mAllMaterials[objMaterial].name + "-material").c_str()); + daeElement* matEffect = mat->add("instance_effect"); + matEffect->setAttribute("url", ("#" + mAllMaterials[objMaterial].name + "-fx").c_str()); + } + root->add("scene instance_visual_scene")->setAttribute("url", "#Scene"); return dae.writeAll(); @@ -440,8 +916,152 @@ bool DAESaver::saveDAE(std::string filename) DAESaver::DAESaver() {} +bool DAESaver::skipFace(LLTextureEntry *te) +{ + return (gSavedSettings.getBOOL("DAEExportSkipTransparent") + && (te->getColor().mV[3] < 0.01f || te->getID() == DAEExportUtil::LL_TEXTURE_TRANSPARENT)); +} + +DAESaver::MaterialInfo DAESaver::getMaterial(LLTextureEntry* te) +{ + if (gSavedSettings.getBOOL("DAEExportConsolidateMaterials")) + { + for (U32 i=0; i < mAllMaterials.size(); i++) + { + if (mAllMaterials[i].matches(te)) + { + return mAllMaterials[i]; + } + } + } + + MaterialInfo ret; + ret.textureID = te->getID(); + ret.color = te->getColor(); + ret.name = llformat("Material%d", mAllMaterials.size()); + mAllMaterials.push_back(ret); + return mAllMaterials[mAllMaterials.size() - 1]; +} + +void DAESaver::getMaterials(LLViewerObject* obj, material_list_t* ret) +{ + S32 num_faces = obj->getVolume()->getNumVolumeFaces(); + for (S32 face_num = 0; face_num < num_faces; ++face_num) + { + LLTextureEntry* te = obj->getTE(face_num); + + if (skipFace(te)) + { + continue; + } + + MaterialInfo mat = getMaterial(te); + + if (!gSavedSettings.getBOOL("DAEExportConsolidateMaterials") || std::find(ret->begin(), ret->end(), mat) == ret->end()) + { + ret->push_back(mat); + } + } +} + +void DAESaver::getFacesWithMaterial(LLViewerObject* obj, MaterialInfo& mat, int_list_t* ret) +{ + S32 num_faces = obj->getVolume()->getNumVolumeFaces(); + for (S32 face_num = 0; face_num < num_faces; ++face_num) + { + if (mat == getMaterial(obj->getTE(face_num))) + { + ret->push_back(face_num); + } + } +} + +void DAESaver::generateEffects(daeElement *effects) +{ + // Effects (face color, alpha) + bool export_textures = gSavedSettings.getBOOL("DAEExportTextures"); + + for (U32 mat = 0; mat < mAllMaterials.size(); mat++) + { + LLColor4 color = mAllMaterials[mat].color; + domEffect* effect = (domEffect*)effects->add("effect"); + effect->setId((mAllMaterials[mat].name + "-fx").c_str()); + daeElement* profile = effect->add("profile_COMMON"); + std::string colladaName; + + if (export_textures) + { + LLUUID textID; + U32 i = 0; + for (; i < mTextures.size(); i++) + { + if (mAllMaterials[mat].textureID == mTextures[i]) + { + textID = mTextures[i]; + break; + } + } + + if (!textID.isNull() && !mTextureNames[i].empty()) + { + colladaName = mTextureNames[i] + "_" + mImageFormat; + daeElement* newparam = profile->add("newparam"); + newparam->setAttribute("sid", (colladaName + "-surface").c_str()); + daeElement* surface = newparam->add("surface"); + surface->setAttribute("type", "2D"); + surface->add("init_from")->setCharData(colladaName.c_str()); + newparam = profile->add("newparam"); + newparam->setAttribute("sid", (colladaName + "-sampler").c_str()); + newparam->add("sampler2D source")->setCharData((colladaName + "-surface").c_str()); + } + } + + daeElement* t = profile->add("technique"); + t->setAttribute("sid", "common"); + domElement* phong = t->add("phong"); + domElement* diffuse = phong->add("diffuse"); + // Only one or can appear inside diffuse element + if (!colladaName.empty()) + { + daeElement* txtr = diffuse->add("texture"); + txtr->setAttribute("texture", (colladaName + "-sampler").c_str()); + txtr->setAttribute("texcoord", colladaName.c_str()); + } + else + { + daeElement* diffuseColor = diffuse->add("color"); + diffuseColor->setAttribute("sid", "diffuse"); + diffuseColor->setCharData(llformat("%f %f %f %f", color.mV[0], color.mV[1], color.mV[2], color.mV[3]).c_str()); + phong->add("transparency float")->setCharData(llformat("%f", color.mV[3]).c_str()); + } + } +} + +void DAESaver::generateImagesSection(daeElement* images) +{ + for (U32 i=0; i < mTextureNames.size(); i++) + { + std::string name = mTextureNames[i]; + if (name.empty()) continue; + std::string colladaName = name + "_" + mImageFormat; + daeElement* image = images->add("image"); + image->setAttribute("id", colladaName.c_str()); + image->setAttribute("name", colladaName.c_str()); + image->add("init_from")->setCharData(LLURI::escape(name + "." + mImageFormat)); + } +} + +class DAESaveSelectedObjects : public view_listener_t +{ + bool handleEvent(LLPointer event, const LLSD& userdata) + { + (new ColladaExportFloater())->open(); + return true; + } +}; + void addMenu(view_listener_t* menu, const std::string& name); void add_dae_listeners() // Called in llviewermenu with other addMenu calls, function linked against { - addMenu(new DAEExportUtil::DAESaveSelectedObjects(), "Object.SaveAsDAE"); + addMenu(new DAESaveSelectedObjects(), "Object.SaveAsDAE"); } diff --git a/indra/newview/daeexport.h b/indra/newview/daeexport.h index 3bfcf2ec6..fbdd5b84c 100644 --- a/indra/newview/daeexport.h +++ b/indra/newview/daeexport.h @@ -1,48 +1,110 @@ /** - * @file daeexport.h - * @brief A system which allows saving in-world objects to Collada .DAE files for offline texturizing/shading. - * @authors Latif Khalifa - * - * $LicenseInfo:firstyear=2013&license=LGPLV2.1$ - * Copyright (C) 2013 Latif Khalifa - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2.1 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General - * Public License along with this library; if not, write to the - * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, - * Boston, MA 02110-1301 USA - */ +* @file daeexport.h +* @brief A system which allows saving in-world objects to Collada .DAE files for offline texturizing/shading. +* @authors Latif Khalifa +* +* $LicenseInfo:firstyear=2013&license=LGPLV2.1$ +* Copyright (C) 2013 Latif Khalifa +* +* This library is free software; you can redistribute it and/or +* modify it under the terms of the GNU Lesser General Public +* License as published by the Free Software Foundation; either +* version 2.1 of the License, or (at your option) any later version. +* +* This library is distributed in the hope that it will be useful, +* but WITHOUT ANY WARRANTY; without even the implied warranty of +* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +* Lesser General Public License for more details. +* +* You should have received a copy of the GNU Lesser General +* Public License along with this library; if not, write to the +* Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, +* Boston, MA 02110-1301 USA +*/ #ifndef DAEEXPORT_H_ #define DAEEXPORT_H_ #include +#include "lltextureentry.h" class LLViewerObject; class DAESaver { - typedef std::vector > obj_info_t; - public: + class MaterialInfo + { + public: + LLUUID textureID; + LLColor4 color; + std::string name; + + bool matches(LLTextureEntry* te) + { + return (textureID == te->getID()) && (color == te->getColor()); + } + + bool operator== (const MaterialInfo& rhs) + { + return (textureID == rhs.textureID) && (color == rhs.color) && (name == rhs.name); + } + + bool operator!= (const MaterialInfo& rhs) + { + return !(*this == rhs); + } + + MaterialInfo() + { + } + + MaterialInfo(const MaterialInfo& rhs) + { + textureID = rhs.textureID; + color = rhs.color; + name = rhs.name; + } + + MaterialInfo& operator= (const MaterialInfo& rhs) + { + textureID = rhs.textureID; + color = rhs.color; + name = rhs.name; + return *this; + } + + }; + + typedef std::vector > obj_info_t; + typedef std::vector id_list_t; + typedef std::vector string_list_t; + typedef std::vector int_list_t; + typedef std::vector material_list_t; + + material_list_t mAllMaterials; + id_list_t mTextures; + string_list_t mTextureNames; obj_info_t mObjects; LLVector3 mOffset; + std::string mImageFormat; + S32 mTotalNumMaterials; + DAESaver(); - void Add(const LLViewerObject* prim, const std::string name); + void updateTextureInfo(); + void add(const LLViewerObject* prim, const std::string name); bool saveDAE(std::string filename); private: + void transformTexCoord(S32 num_vert, LLVector2* coord, LLVector3* positions, LLVector3* normals, LLTextureEntry* te, LLVector3 scale); void addSource(daeElement* mesh, const char* src_id, std::string params, const std::vector &vals); - void addPolygons(daeElement* mesh, const char* geomID, const char* materialID, LLViewerObject* obj, int face_to_include); + void addPolygons(daeElement* mesh, const char* geomID, const char* materialID, LLViewerObject* obj, int_list_t* faces_to_include); + bool skipFace(LLTextureEntry *te); + MaterialInfo getMaterial(LLTextureEntry* te); + void getMaterials(LLViewerObject* obj, material_list_t* ret); + void getFacesWithMaterial(LLViewerObject* obj, MaterialInfo& mat, int_list_t* ret); + void generateEffects(daeElement *effects); + void generateImagesSection(daeElement* images); }; #endif // DAEEXPORT_H_ diff --git a/indra/newview/featuretable.txt b/indra/newview/featuretable.txt index fc9a175d9..111c7a431 100644 --- a/indra/newview/featuretable.txt +++ b/indra/newview/featuretable.txt @@ -90,7 +90,7 @@ RenderTerrainDetail 1 0 RenderTerrainScale 1 12.0 RenderTerrainLODFactor 1 1 RenderTransparentWater 1 0 -RenderTreeLODFactor 1 0 +RenderTreeLODFactor 1 0.125 RenderUseImpostors 1 1 RenderVolumeLODFactor 1 1.125 VertexShaderEnable 1 0 @@ -155,7 +155,7 @@ RenderTerrainDetail 1 1 RenderTerrainScale 1 7.0 RenderTerrainLODFactor 1 2.0 RenderTransparentWater 1 1 -RenderTreeLODFactor 1 0.5 +RenderTreeLODFactor 1 1.0 RenderUseImpostors 1 1 RenderVolumeLODFactor 1 1.125 VertexShaderEnable 1 1 @@ -186,7 +186,7 @@ RenderTerrainDetail 1 1 RenderTerrainScale 1 5.0 RenderTerrainLODFactor 1 2.0 RenderTransparentWater 1 1 -RenderTreeLODFactor 1 1.0 +RenderTreeLODFactor 1 2.0 RenderUseImpostors 1 1 RenderVolumeLODFactor 1 2.0 VertexShaderEnable 1 1 diff --git a/indra/newview/featuretable_linux.txt b/indra/newview/featuretable_linux.txt index bc464b0fd..bcc930a44 100644 --- a/indra/newview/featuretable_linux.txt +++ b/indra/newview/featuretable_linux.txt @@ -87,7 +87,7 @@ RenderTerrainDetail 1 0 RenderTerrainScale 1 12.0 RenderTerrainLODFactor 1 1 RenderTransparentWater 1 0 -RenderTreeLODFactor 1 0 +RenderTreeLODFactor 1 0.125 RenderUseImpostors 1 1 RenderVolumeLODFactor 1 0.5 VertexShaderEnable 1 0 @@ -151,7 +151,7 @@ RenderTerrainDetail 1 1 RenderTerrainScale 1 7.0 RenderTerrainLODFactor 1 2.0 RenderTransparentWater 1 1 -RenderTreeLODFactor 1 0.5 +RenderTreeLODFactor 1 1.0 RenderUseImpostors 1 1 RenderVolumeLODFactor 1 1.125 VertexShaderEnable 1 1 @@ -184,7 +184,7 @@ RenderTerrainDetail 1 1 RenderTerrainScale 1 5.0 RenderTerrainLODFactor 1 2.0 RenderTransparentWater 1 1 -RenderTreeLODFactor 1 1.0 +RenderTreeLODFactor 1 2.0 RenderUseImpostors 1 1 RenderVolumeLODFactor 1 2.0 VertexShaderEnable 1 1 diff --git a/indra/newview/featuretable_mac.txt b/indra/newview/featuretable_mac.txt index 16e50377e..874254439 100644 --- a/indra/newview/featuretable_mac.txt +++ b/indra/newview/featuretable_mac.txt @@ -90,7 +90,7 @@ RenderTerrainDetail 1 0 RenderTerrainScale 1 12.0 RenderTerrainLODFactor 1 1 RenderTransparentWater 1 0 -RenderTreeLODFactor 1 0 +RenderTreeLODFactor 1 0.125 RenderUseImpostors 1 1 RenderVolumeLODFactor 1 0.5 VertexShaderEnable 1 0 @@ -155,7 +155,7 @@ RenderTerrainDetail 1 1 RenderTerrainScale 1 7.0 RenderTerrainLODFactor 1 2.0 RenderTransparentWater 1 1 -RenderTreeLODFactor 1 0.5 +RenderTreeLODFactor 1 1.0 RenderUseImpostors 1 1 RenderVolumeLODFactor 1 1.125 VertexShaderEnable 1 1 @@ -188,7 +188,7 @@ RenderTerrainDetail 1 1 RenderTerrainScale 1 5.0 RenderTerrainLODFactor 1 2.0 RenderTransparentWater 1 1 -RenderTreeLODFactor 1 1.0 +RenderTreeLODFactor 1 2.0 RenderUseImpostors 1 1 RenderVolumeLODFactor 1 2.0 VertexShaderEnable 1 1 diff --git a/indra/newview/floatervoicelicense.cpp b/indra/newview/floatervoicelicense.cpp index 101398006..288704d83 100644 --- a/indra/newview/floatervoicelicense.cpp +++ b/indra/newview/floatervoicelicense.cpp @@ -103,7 +103,7 @@ class LLIamHereVoice : public LLHTTPClient::ResponderWithResult }; /*virtual*/ AIHTTPTimeoutPolicy const& getHTTPTimeoutPolicy(void) const { return iamHereVoice_timeout; } - /*virtual*/ bool redirect_status_ok(void) const { return true; } + /*virtual*/ bool pass_redirect_status(void) const { return true; } /*virtual*/ char const* getName(void) const { return "LLIamHereVoice"; } }; diff --git a/indra/newview/generate_breakpad_symbols.py b/indra/newview/generate_breakpad_symbols.py new file mode 100644 index 000000000..4181e4ebb --- /dev/null +++ b/indra/newview/generate_breakpad_symbols.py @@ -0,0 +1,167 @@ +#!/usr/bin/env python +"""\ +@file generate_breakpad_symbols.py +@author Brad Kittenbrink +@brief Simple tool for generating google_breakpad symbol information + for the crash reporter. + +$LicenseInfo:firstyear=2010&license=viewerlgpl$ +Second Life Viewer Source Code +Copyright (C) 2010-2011, Linden Research, Inc. + +This library is free software; you can redistribute it and/or +modify it under the terms of the GNU Lesser General Public +License as published by the Free Software Foundation; +version 2.1 of the License only. + +This library is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +Lesser General Public License for more details. + +You should have received a copy of the GNU Lesser General Public +License along with this library; if not, write to the Free Software +Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + +Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA +$/LicenseInfo$ +""" + + +import collections +import fnmatch +import itertools +import operator +import os +import re +import sys +import shlex +import subprocess +import tarfile +import StringIO +import pprint + +DEBUG=False + +def usage(): + print >>sys.stderr, "usage: %s search_dirs viewer_exes libs_suffix dump_syms_tool viewer_symbol_file" % sys.argv[0] + +class MissingModuleError(Exception): + def __init__(self, modules): + Exception.__init__(self, "Failed to find required modules: %r" % modules) + self.modules = modules + +def main(configuration, search_dirs, viewer_exes, libs_suffix, dump_syms_tool, viewer_symbol_file): + print "generate_breakpad_symbols run with args: %s" % str((configuration, search_dirs, viewer_exes, libs_suffix, dump_syms_tool, viewer_symbol_file)) + + if not re.match("release", configuration, re.IGNORECASE): + print "skipping breakpad symbol generation for non-release build." + return 0 + + # split up list of viewer_exes + # "'Second Life' SLPlugin" becomes ['Second Life', 'SLPlugin'] + viewer_exes = shlex.split(viewer_exes) + + found_required = dict([(module, False) for module in viewer_exes]) + + def matches(f): + if f in viewer_exes: + found_required[f] = True + return True + return fnmatch.fnmatch(f, libs_suffix) + + search_dirs = search_dirs.split(";") + + def list_files(): + for search_dir in search_dirs: + for (dirname, subdirs, filenames) in os.walk(search_dir): + if DEBUG: + print "scanning '%s' for modules..." % dirname + for f in itertools.ifilter(matches, filenames): + yield os.path.join(dirname, f) + + def dump_module(m): + print "dumping module '%s' with '%s'..." % (m, dump_syms_tool) + dsym_full_path = m + child = subprocess.Popen([dump_syms_tool, dsym_full_path] , stdout=subprocess.PIPE) + out, err = child.communicate() + return (m,child.returncode, out, err) + + + modules = {} + + for m in list_files(): + if DEBUG: + print "examining module '%s' ... " % m, + filename=os.path.basename(m) + if -1 != m.find("DWARF"): + # Just use this module; it has the symbols we want. + modules[filename] = m + if DEBUG: + print "found dSYM entry" + elif filename not in modules: + # Only use this if we don't already have a (possibly better) entry. + modules[filename] = m + if DEBUG: + print "found new entry" + elif DEBUG: + print "ignoring entry" + + + print "Found these following modules:" + pprint.pprint( modules ) + + out = tarfile.open(viewer_symbol_file, 'w:bz2') + for (filename,status,symbols,err) in itertools.imap(dump_module, modules.values()): + if status == 0: + module_line = symbols[:symbols.index('\n')] + module_line = module_line.split() + hash_id = module_line[3] + module = ' '.join(module_line[4:]) + if sys.platform in ['win32', 'cygwin']: + mod_name = module[:module.rindex('.pdb')] + else: + mod_name = module + symbolfile = StringIO.StringIO(symbols) + info = tarfile.TarInfo("%(module)s/%(hash_id)s/%(mod_name)s.sym" % dict(module=module, hash_id=hash_id, mod_name=mod_name)) + info.size = symbolfile.len + out.addfile(info, symbolfile) + else: + print >>sys.stderr, "warning: failed to dump symbols for '%s': %s" % (filename, err) + + out.close() + + missing_modules = [m for (m,_) in + itertools.ifilter(lambda (k,v): not v, found_required.iteritems()) + ] + if missing_modules: + print >> sys.stderr, "failed to generate %s" % viewer_symbol_file + os.remove(viewer_symbol_file) + raise MissingModuleError(missing_modules) + + symbols = tarfile.open(viewer_symbol_file, 'r:bz2') + tarfile_members = symbols.getnames() + symbols.close() + + for required_module in viewer_exes: + def match_module_basename(m): + return os.path.splitext(required_module)[0].lower() \ + == os.path.splitext(os.path.basename(m))[0].lower() + # there must be at least one .sym file in tarfile_members that matches + # each required module (ignoring file extensions) + if not reduce(operator.or_, itertools.imap(match_module_basename, tarfile_members)): + print >> sys.stderr, "failed to find required %s in generated %s" \ + % (required_module, viewer_symbol_file) + os.remove(viewer_symbol_file) + raise MissingModuleError([required_module]) + + print "successfully generated %s including required modules '%s'" % (viewer_symbol_file, viewer_exes) + + return 0 + +if __name__ == "__main__": + if len(sys.argv) != 7: + usage() + sys.exit(1) + sys.exit(main(*sys.argv[1:])) + diff --git a/indra/newview/gpu_table.txt b/indra/newview/gpu_table.txt index ce8e013f0..7fa0e9531 100644 --- a/indra/newview/gpu_table.txt +++ b/indra/newview/gpu_table.txt @@ -76,9 +76,6 @@ ATI FirePro M5800 .*ATI.*FirePro.*M58.* 3 1 ATI FirePro M7740 .*ATI.*FirePro.*M77.* 3 1 ATI FirePro M7820 .*ATI.*FirePro.*M78.* 3 1 ATI FireMV .*ATI.*FireMV.* 0 1 -ATI Geforce 9500 GT .*ATI.*Geforce 9500 *GT.* 2 1 -ATI Geforce 9600 GT .*ATI.*Geforce 9600 *GT.* 2 1 -ATI Geforce 9800 GT .*ATI.*Geforce 9800 *GT.* 2 1 ATI Generic .*ATI.*Generic.* 0 0 ATI Hercules 9800 .*ATI.*Hercules.*9800.* 1 1 ATI IGP 340M .*ATI.*IGP.*340M.* 0 0 diff --git a/indra/newview/hippolimits.cpp b/indra/newview/hippolimits.cpp index 2ee9a7344..ea7a0a184 100644 --- a/indra/newview/hippolimits.cpp +++ b/indra/newview/hippolimits.cpp @@ -33,7 +33,7 @@ void HippoLimits::setOpenSimLimits() { mMaxAgentGroups = gHippoGridManager->getConnectedGrid()->getMaxAgentGroups(); if (mMaxAgentGroups < 0) mMaxAgentGroups = 50; - mMaxPrimScale = 256.0f; + mMaxPrimScale = 8192.0f; mMaxHeight = 10000.0f; if (gHippoGridManager->getConnectedGrid()->isRenderCompat()) { llinfos << "Using rendering compatible OpenSim limits." << llendl; diff --git a/indra/newview/lffloaterinvpanel.cpp b/indra/newview/lffloaterinvpanel.cpp new file mode 100644 index 000000000..522762080 --- /dev/null +++ b/indra/newview/lffloaterinvpanel.cpp @@ -0,0 +1,90 @@ +/* @file lffloaterinvpanel.cpp + * @brief Simple floater displaying an inventory panel with any category as its root + * + * Copyright (C) 2013 Liru Færs + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General + * Public License along with this library; if not, write to the + * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + * Boston, MA 02110-1301 USA */ + +#include "llviewerprecompiledheaders.h" + +#include "lffloaterinvpanel.h" + +#include "llinventorypanel.h" +#include "lluictrlfactory.h" + + +LFFloaterInvPanel::LFFloaterInvPanel(const LLUUID& cat_id, LLInventoryModel* model, const std::string& name) +: LLInstanceTracker(cat_id) +{ + mCommitCallbackRegistrar.add("InvPanel.Search", boost::bind(&LFFloaterInvPanel::onSearch, this, _2)); + LLUICtrlFactory::getInstance()->buildFloater(this, "floater_inv_panel.xml"); + LLPanel* panel = getChild("placeholder_panel"); + mPanel = new LLInventoryPanel("inv_panel", LLInventoryPanel::DEFAULT_SORT_ORDER, cat_id.asString(), panel->getRect(), model, true); + mPanel->postBuild(); + mPanel->setFollows(FOLLOWS_ALL); + mPanel->setEnabled(true); + addChild(mPanel); + removeChild(panel); + setTitle(name); +} + +LFFloaterInvPanel::~LFFloaterInvPanel() +{ + delete mPanel; +} + +// static +void LFFloaterInvPanel::show(const LLUUID& cat_id, LLInventoryModel* model, const std::string& name) +{ + LFFloaterInvPanel* floater = LFFloaterInvPanel::getInstance(cat_id); + if (!floater) floater = new LFFloaterInvPanel(cat_id, model, name); + floater->open(); +} + +// static +void LFFloaterInvPanel::closeAll() +{ + // We must make a copy first, because LLInstanceTracker doesn't allow destruction while having iterators to it. + std::vector cache; + for (instance_iter i = beginInstances(); i != endInstances(); ++i) + { + cache.push_back(&*i); + } + // Now close all panels, without using instance_iter iterators. + for (std::vector::iterator i = cache.begin(); i != cache.end(); ++i) + { + (*i)->close(); + } +} + +// virtual +BOOL LFFloaterInvPanel::handleKeyHere(KEY key, MASK mask) +{ + if (!mPanel->hasFocus() && mask == MASK_NONE && (key == KEY_RETURN || key == KEY_DOWN)) + { + mPanel->setFocus(true); + if (LLFolderView* root = mPanel->getRootFolder()) + root->scrollToShowSelection(); + return true; + } + + return LLFloater::handleKeyHere(key, mask); +} + +void LFFloaterInvPanel::onSearch(const LLSD& val) +{ + mPanel->setFilterSubString(val.asString()); +} diff --git a/indra/newview/lffloaterinvpanel.h b/indra/newview/lffloaterinvpanel.h new file mode 100644 index 000000000..24ae089fd --- /dev/null +++ b/indra/newview/lffloaterinvpanel.h @@ -0,0 +1,44 @@ +/* @file lffloaterinvpanel.h + * @brief Simple floater displaying an inventory panel with any category as its root + * + * Copyright (C) 2013 Liru Færs + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General + * Public License along with this library; if not, write to the + * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + * Boston, MA 02110-1301 USA */ + +#ifndef LFFLOATERINVPANEL_H +#define LFFLOATERINVPANEL_H + +#include "llfloater.h" +#include "llinstancetracker.h" + + +class LFFloaterInvPanel : public LLFloater, public LLInstanceTracker +{ + LFFloaterInvPanel(const LLUUID& cat_id, class LLInventoryModel* model, const std::string& name); + ~LFFloaterInvPanel(); + +public: + static void show(const LLUUID& cat_id, LLInventoryModel* model, const std::string& name); // Show the floater for cat_id (create with other params if necessary) + static void closeAll(); // Called when not allowed to have inventory open + + /*virtual*/ BOOL handleKeyHere(KEY key, MASK mask); + void onSearch(const LLSD& val); + +private: + class LLInventoryPanel* mPanel; +}; + +#endif //LFFLOATERINVPANEL_H diff --git a/indra/newview/lfsimfeaturehandler.cpp b/indra/newview/lfsimfeaturehandler.cpp index 178fbb50e..e4b6408e2 100644 --- a/indra/newview/lfsimfeaturehandler.cpp +++ b/indra/newview/lfsimfeaturehandler.cpp @@ -26,11 +26,19 @@ LFSimFeatureHandler::LFSimFeatureHandler() : mSupportsExport(false) +, mSayRange(20) +, mShoutRange(100) +, mWhisperRange(10) { if (!gHippoGridManager->getCurrentGrid()->isSecondLife()) // Remove this line if we ever handle SecondLife sim features LLEnvManagerNew::instance().setRegionChangeCallback(boost::bind(&LFSimFeatureHandler::handleRegionChange, this)); } +ExportPolicy LFSimFeatureHandler::exportPolicy() const +{ + return gHippoGridManager->getCurrentGrid()->isSecondLife() ? ep_creator_only : (mSupportsExport ? ep_export_bit : ep_full_perm); +} + void LFSimFeatureHandler::handleRegionChange() { if (LLViewerRegion* region = gAgent.getRegion()) @@ -56,15 +64,22 @@ void LFSimFeatureHandler::setSupportedFeatures() { // For definition of OpenSimExtras please see // http://opensimulator.org/wiki/SimulatorFeatures_Extras - mSupportsExport = info["OpenSimExtras"].has("ExportSupported") ? info["OpenSimExtras"]["ExportSupported"].asBoolean() : false; - mMapServerURL = info["OpenSimExtras"].has("map-server-url") ? info["OpenSimExtras"]["map-server-url"].asString() : ""; - mSearchURL = info["OpenSimExtras"].has("search-server-url") ? info["OpenSimExtras"]["search-server-url"].asString() : ""; + const LLSD& extras(info["OpenSimExtras"]); + mSupportsExport = extras.has("ExportSupported") ? extras["ExportSupported"].asBoolean() : false; + mMapServerURL = extras.has("map-server-url") ? extras["map-server-url"].asString() : ""; + mSearchURL = extras.has("search-server-url") ? extras["search-server-url"].asString() : ""; + mSayRange = extras.has("say-range") ? extras["say-range"].asInteger() : 20; + mShoutRange = extras.has("shout-range") ? extras["shout-range"].asInteger() : 100; + mWhisperRange = extras.has("whisper-range") ? extras["whisper-range"].asInteger() : 10; } else // OpenSim specifics are unsupported reset all to default { mSupportsExport = false; mMapServerURL = ""; mSearchURL = ""; + mSayRange = 20; + mShoutRange = 100; + mWhisperRange = 10; } } } @@ -79,3 +94,17 @@ boost::signals2::connection LFSimFeatureHandler::setSearchURLCallback(const boos return mSearchURL.connect(slot); } +boost::signals2::connection LFSimFeatureHandler::setSayRangeCallback(const boost::signals2::signal::slot_type& slot) +{ + return mSayRange.connect(slot); +} + +boost::signals2::connection LFSimFeatureHandler::setShoutRangeCallback(const boost::signals2::signal::slot_type& slot) +{ + return mShoutRange.connect(slot); +} + +boost::signals2::connection LFSimFeatureHandler::setWhisperRangeCallback(const boost::signals2::signal::slot_type& slot) +{ + return mWhisperRange.connect(slot); +} diff --git a/indra/newview/lfsimfeaturehandler.h b/indra/newview/lfsimfeaturehandler.h index 83acdd95a..d26983fcd 100644 --- a/indra/newview/lfsimfeaturehandler.h +++ b/indra/newview/lfsimfeaturehandler.h @@ -19,16 +19,16 @@ #define LFSIMFEATUREHANDLER_H #include "llsingleton.h" +#include "llpermissions.h" // ExportPolicy -template +template > class SignaledType { public: SignaledType() : mValue() {} SignaledType(Type b) : mValue(b) {} - template - boost::signals2::connection connect(Slot slot) { return mSignal.connect(slot); } + boost::signals2::connection connect(const typename Signal::slot_type& slot) { return mSignal.connect(slot); } SignaledType& operator =(Type val) { @@ -42,7 +42,7 @@ public: operator Type() const { return mValue; } private: - boost::signals2::signal mSignal; + Signal mSignal; Type mValue; }; @@ -59,17 +59,27 @@ public: // Connection setters boost::signals2::connection setSupportsExportCallback(const boost::signals2::signal::slot_type& slot); boost::signals2::connection setSearchURLCallback(const boost::signals2::signal::slot_type& slot); + boost::signals2::connection setSayRangeCallback(const boost::signals2::signal::slot_type& slot); + boost::signals2::connection setShoutRangeCallback(const boost::signals2::signal::slot_type& slot); + boost::signals2::connection setWhisperRangeCallback(const boost::signals2::signal::slot_type& slot); // Accessors bool simSupportsExport() const { return mSupportsExport; } std::string mapServerURL() const { return mMapServerURL; } std::string searchURL() const { return mSearchURL; } + U32 sayRange() const { return mSayRange; } + U32 shoutRange() const { return mShoutRange; } + U32 whisperRange() const { return mWhisperRange; } + ExportPolicy exportPolicy() const; private: // SignaledTypes SignaledType mSupportsExport; std::string mMapServerURL; SignaledType mSearchURL; + SignaledType mSayRange; + SignaledType mShoutRange; + SignaledType mWhisperRange; }; #endif //LFSIMFEATUREHANDLER_H diff --git a/indra/newview/linux_tools/wrapper.sh b/indra/newview/linux_tools/wrapper.sh index d6a266240..6bd4acf33 100755 --- a/indra/newview/linux_tools/wrapper.sh +++ b/indra/newview/linux_tools/wrapper.sh @@ -148,7 +148,13 @@ else SL_ENV+='LD_LIBRARY_PATH="`pwd`/lib:$LD_LIBRARY_PATH"' fi export SL_CMD='$LL_WRAPPER bin/$VIEWER_BINARY' -export SL_OPT="`cat gridargs.dat` $@" + +if [ -n "$AITESTPLUGIN" ]; then + SL_CMD="$LL_WRAPPER bin/SLPlugin" + SL_OPT="TESTPLUGIN" +else + SL_OPT="`cat gridargs.dat` $@" +fi # Run the program. eval ${SL_ENV} ${SL_CMD} ${SL_OPT} || LL_RUN_ERR=runerr diff --git a/indra/newview/llagent.cpp b/indra/newview/llagent.cpp index f42739b20..d6188bcc0 100644 --- a/indra/newview/llagent.cpp +++ b/indra/newview/llagent.cpp @@ -2319,7 +2319,10 @@ void LLAgent::setStartPosition( U32 location_id ) // this simulator. Clamp it to the region the agent is // in, a little bit in on each side. const F32 INSET = 0.5f; //meters - const F32 REGION_WIDTH = LLWorld::getInstance()->getRegionWidthInMeters(); +// Aurora Sim + //const F32 REGION_WIDTH = LLWorld::getInstance()->getRegionWidthInMeters(); + const F32 REGION_WIDTH = getRegion()->getWidth(); +// Aurora Sim LLVector3 agent_pos = getPositionAgent(); @@ -3309,12 +3312,6 @@ void update_group_floaters(const LLUUID& group_id) fa->resetGroupList(); } - if (gIMMgr) - { - // update the talk view - gIMMgr->refresh(); - } - gAgent.fireEvent(new LLOldEvents::LLEvent(&gAgent, "new group"), ""); } @@ -4233,8 +4230,10 @@ void LLAgent::doTeleportViaLocation(const LLVector3d& pos_global) (F32)(pos_global.mdV[VX] - region_origin.mdV[VX]), (F32)(pos_global.mdV[VY] - region_origin.mdV[VY]), (F32)(pos_global.mdV[VZ])); - pos_local += offset; - teleportRequest(handle, pos_local); +// Aurora-sim var region teleports + //teleportRequest(handle, pos_local); + teleportRequest(info->getHandle(), pos_local); +// } else if(regionp && teleportCore(regionp->getHandle() == to_region_handle_global((F32)pos_global.mdV[VX], (F32)pos_global.mdV[VY]))) @@ -4289,6 +4288,13 @@ void LLAgent::doTeleportViaLocationLookAt(const LLVector3d& pos_global) mbTeleportKeepsLookAt = true; gAgentCamera.setFocusOnAvatar(FALSE, ANIMATE); // detach camera form avatar, so it keeps direction U64 region_handle = to_region_handle(pos_global); +// Aurora-sim var region teleports + LLSimInfo* simInfo = LLWorldMap::instance().simInfoFromHandle(region_handle); + if (simInfo) + { + region_handle = simInfo->getHandle(); + } +// LLVector3 pos_local = (LLVector3)(pos_global - from_region_handle(region_handle)); teleportRequest(region_handle, pos_local, getTeleportKeepsLookAt()); } diff --git a/indra/newview/llagentcamera.cpp b/indra/newview/llagentcamera.cpp index 9d4179621..05b3bd6df 100644 --- a/indra/newview/llagentcamera.cpp +++ b/indra/newview/llagentcamera.cpp @@ -1474,7 +1474,7 @@ void LLAgentCamera::updateCamera() LLVector3 torso_scale = torso_joint->getScale(); LLVector3 chest_scale = chest_joint->getScale(); - // shorten avatar skeleton to avoid foot interpenetration + /*// shorten avatar skeleton to avoid foot interpenetration if (!gAgentAvatarp->mInAir) { LLVector3 chest_offset = LLVector3(0.f, 0.f, chest_joint->getPosition().mV[VZ]) * torso_joint->getWorldRotation(); @@ -1487,7 +1487,7 @@ void LLAgentCamera::updateCamera() scale_factor = llclamp(1.f - ((z_compensate * 0.5f) / neck_offset.mV[VZ]), 0.5f, 1.2f); chest_joint->setScale(LLVector3(1.f, 1.f, scale_factor)); diff.mV[VZ] = 0.f; - } + }*/ gAgentAvatarp->mPelvisp->setPosition(gAgentAvatarp->mPelvisp->getPosition() + diff); diff --git a/indra/newview/llagentui.cpp b/indra/newview/llagentui.cpp index 0fcc5fb2b..d8ab02436 100644 --- a/indra/newview/llagentui.cpp +++ b/indra/newview/llagentui.cpp @@ -56,7 +56,8 @@ void LLAgentUI::buildSLURL(LLSLURL& slurl, const bool escaped /*= true*/) LLViewerRegion *regionp = gAgent.getRegion(); if (regionp) { - return_slurl = LLSLURL(regionp->getName(), gAgent.getPositionGlobal()); + // Singu Note: Not Global, get correct SLURL for Variable Regions + return_slurl = LLSLURL(regionp->getName(), gAgent.getPositionAgent()); } slurl = return_slurl; } diff --git a/indra/newview/llappearancemgr.cpp b/indra/newview/llappearancemgr.cpp index 2877c50e2..b840c63fc 100644 --- a/indra/newview/llappearancemgr.cpp +++ b/indra/newview/llappearancemgr.cpp @@ -1163,11 +1163,41 @@ void LLWearableHoldingPattern::onWearableAssetFetch(LLViewerWearable *wearable) if(wearable->getAssetID() == data.mAssetID) { // Failing this means inventory or asset server are corrupted in a way we don't handle. - if ((data.mWearableType >= LLWearableType::WT_COUNT) || (wearable->getType() != data.mWearableType)) + if (data.mWearableType >= LLWearableType::WT_COUNT || + wearable->getType() >= LLWearableType::WT_UNKNOWN || + (data.mWearableType != wearable->getType() && + data.mWearableType != LLWearableType::WT_UNKNOWN && + data.mWearableType != LLWearableType::WT_SHAPE)) { llwarns << self_av_string() << "recovered wearable but type invalid. inventory wearable type: " << data.mWearableType << " asset wearable type: " << wearable->getType() << llendl; break; } + else if (data.mWearableType == LLWearableType::WT_UNKNOWN || + (data.mWearableType == LLWearableType::WT_SHAPE && + data.mWearableType != wearable->getType())) + { + if (data.mWearableType == LLWearableType::WT_UNKNOWN) + { + llinfos << "Wearing wearable '" << wearable->getName() << "' with an unknown inventory wearable type. Fixing inventory to have type " << wearable->getType() << llendl; + } + else + { + // This probably means that the inventory contains an item without wearable type information. + // We can still fix the type here, but we also have to fix that in the mean time we took off our real shape because of this! + llwarns << "Wearing wearable '" << wearable->getName() << "' with incorrect wearable type 'shape'! Trying to recover from this..." << llendl; + } + // Fix it! + data.mWearableType = wearable->getType(); + LLViewerInventoryItem* item = gInventory.getItem(data.mItemID); + if (!item) + { + llwarns << "Can't find the broken item in the inventory?!" << llendl; + break; + } + llassert(item->getUUID() == data.mItemID); + item->setWearableType(wearable->getType()); + gInventory.updateItem(item); + } data.mWearable = wearable; } diff --git a/indra/newview/llappviewer.cpp b/indra/newview/llappviewer.cpp index 30fb206e0..6be1d5c96 100644 --- a/indra/newview/llappviewer.cpp +++ b/indra/newview/llappviewer.cpp @@ -86,7 +86,7 @@ #include "llvocache.h" #include "llvopartgroup.h" #include "llfloaterteleporthistory.h" - +#include "llcrashlogger.h" #include "llweb.h" #include "llsecondlifeurls.h" @@ -558,6 +558,11 @@ LLAppViewer::LLAppViewer() : llerrs << "Oh no! An instance of LLAppViewer already exists! LLAppViewer is sort of like a singleton." << llendl; } + mDumpPath =""; + + // Need to do this initialization before we do anything else, since anything + // that touches files should really go through the lldir API + gDirUtilp->initAppDirs("SecondLife"); sInstance = this; } @@ -580,7 +585,9 @@ public: }; bool LLAppViewer::init() -{ +{ + setupErrorHandling(); + // // Start of the application // @@ -605,9 +612,6 @@ bool LLAppViewer::init() //initialize particle index pool LLVOPartGroup::initClass(); - // Need to do this initialization before we do anything else, since anything - // that touches files should really go through the lldir API - gDirUtilp->initAppDirs("SecondLife"); // set skin search path to default, will be overridden later // this allows simple skinned file lookups to work gDirUtilp->setSkinFolder("default"); @@ -637,8 +641,6 @@ bool LLAppViewer::init() LLPrivateMemoryPoolManager::initClass((BOOL)gSavedSettings.getBOOL("MemoryPrivatePoolEnabled"), (U32)gSavedSettings.getU32("MemoryPrivatePoolSize")) ; - mAlloc.setProfilingEnabled(gSavedSettings.getBOOL("MemProfiling")); - AIEngine::setMaxCount(gSavedSettings.getU32("StateMachineMaxTime")); { @@ -654,6 +656,19 @@ bool LLAppViewer::init() ); AIHTTPTimeoutPolicy::setDefaultCurlTimeout(policy_tmp); } + + // Check if we have a crash report to send + LLCrashLogger crashLogger; + crashLogger.checkCrashDump(); + + // write Google Breakpad minidump files to a per-run dump directory to avoid multiple viewer issues. + std::string logdir = gDirUtilp->getExpandedFilename(LL_PATH_DUMP, ""); + mDumpPath = logdir; + setMiniDumpDir(logdir); + logdir += gDirUtilp->getDirDelimiter(); + setDebugFileNames(logdir); + + mAlloc.setProfilingEnabled(gSavedSettings.getBOOL("MemProfiling")); { // Viewer metrics initialization //static LLCachedControl metrics_submode(gSavedSettings, @@ -1196,7 +1211,7 @@ bool LLAppViewer::mainLoop() // Scan keyboard for movement keys. Command keys and typing // are handled by windows callbacks. Don't do this until we're // done initializing. JC - if (gViewerWindow->mWindow->getVisible() + if (gViewerWindow->getWindow()->getVisible() && gViewerWindow->getActive() && !gViewerWindow->getWindow()->getMinimized() && LLStartUp::getStartupState() == STATE_STARTED @@ -1282,7 +1297,7 @@ bool LLAppViewer::mainLoop() // yield cooperatively when not running as foreground window if ( gNoRender - || (gViewerWindow && !gViewerWindow->mWindow->getVisible()) + || (gViewerWindow && !gViewerWindow->getWindow()->getVisible()) || !gFocusMgr.getAppHasFocus()) { // Sleep if we're not rendering, or the window is minimized. @@ -1448,6 +1463,14 @@ bool LLAppViewer::cleanup() { //ditch LLVOAvatarSelf instance gAgentAvatarp = NULL; + + // remove any old breakpad minidump files from the log directory + if (! isError()) + { + std::string logdir = gDirUtilp->getExpandedFilename(LL_PATH_LOGS, ""); + gDirUtilp->deleteFilesInDir(logdir, "*-*-*-*-*.dmp"); + } + cleanup_pose_stand(); //flag all elements as needing to be destroyed immediately @@ -1698,6 +1721,7 @@ bool LLAppViewer::cleanup() } // + removeDumpDir(); writeDebugInfo(); if(!gDirUtilp->getLindenUserDir(true).empty()) @@ -2422,7 +2446,6 @@ bool LLAppViewer::initConfiguration() initMarkerFile(); - checkForCrash(); } else { @@ -2442,10 +2465,6 @@ bool LLAppViewer::initConfiguration() initMarkerFile(); - if(!mSecondInstance) - { - checkForCrash(); - } } // need to do this here - need to have initialized global settings first @@ -2461,62 +2480,6 @@ bool LLAppViewer::initConfiguration() return true; // Config was successful. } - -void LLAppViewer::checkForCrash(void) -{ -#if LL_SEND_CRASH_REPORTS - // *NOTE:Mani The current state of the crash handler has the MacOSX - // sending all crash reports as freezes, in order to let - // the MacOSX CrashRepoter generate stacks before spawning the - // SL crash logger. - // The Linux and Windows clients generate their own stacks and - // spawn the SL crash logger immediately. This may change in the future. -#if LL_DARWIN - if(gLastExecEvent != LAST_EXEC_NORMAL) -#else - if (gLastExecEvent == LAST_EXEC_FROZE) -#endif - { - llinfos << "Last execution froze, requesting to send crash report." << llendl; - // - // Pop up a freeze or crash warning dialog - // - S32 choice; - const S32 cb = gCrashSettings.getS32(CRASH_BEHAVIOR_SETTING); - if(cb == CRASH_BEHAVIOR_ASK) - { - std::ostringstream msg; - msg << LLTrans::getString("MBFrozenCrashed"); - std::string alert = LLTrans::getString("APP_NAME") + " " + LLTrans::getString("MBAlert"); - choice = OSMessageBox(msg.str(), - alert, - OSMB_YESNO); - } - else if(cb == CRASH_BEHAVIOR_NEVER_SEND) - { - choice = OSBTN_NO; - } - else - { - choice = OSBTN_YES; - } - - if (OSBTN_YES == choice) - { - llinfos << "Sending crash report." << llendl; - - bool report_freeze = true; - handleCrashReporting(report_freeze); - } - else - { - llinfos << "Not sending crash report." << llendl; - } - } -#endif // LL_SEND_CRASH_REPORTS - -} - bool LLAppViewer::initWindow() { LL_INFOS("AppInit") << "Initializing window..." << LL_ENDL; @@ -2542,7 +2505,7 @@ bool LLAppViewer::initWindow() if (gSavedSettings.getBOOL("WindowMaximized")) { - gViewerWindow->mWindow->maximize(); + gViewerWindow->getWindow()->maximize(); gViewerWindow->getWindow()->setNativeAspectRatio(gSavedSettings.getF32("FullScreenAspectRatio")); } @@ -2580,18 +2543,27 @@ bool LLAppViewer::initWindow() gViewerWindow->initBase(); // show viewer window - //gViewerWindow->mWindow->show(); + //gViewerWindow->getWindow()->show(); LL_INFOS("AppInit") << "Window initialization done." << LL_ENDL; return true; } -void LLAppViewer::writeDebugInfo() +void LLAppViewer::writeDebugInfo(bool isStatic) { - std::string debug_filename = gDirUtilp->getExpandedFilename(LL_PATH_LOGS,"debug_info.log"); - llinfos << "Opening debug file " << debug_filename << llendl; - llofstream out_file(debug_filename); - LLSDSerialize::toPrettyXML(gDebugInfo, out_file); + //Try to do the minimum when writing data during a crash. + std::string* debug_filename; + debug_filename = ( isStatic + ? getStaticDebugFile() + : getDynamicDebugFile() ); + + llinfos << "Opening debug file " << *debug_filename << llendl; + llofstream out_file(*debug_filename); + + isStatic ? LLSDSerialize::toPrettyXML(gDebugInfo, out_file) + : LLSDSerialize::toPrettyXML(gDebugInfo["Dynamic"], out_file); + + out_file.close(); } @@ -2612,13 +2584,13 @@ void LLAppViewer::cleanupSavedSettings() // save window position if not fullscreen // as we don't track it in callbacks - BOOL fullscreen = gViewerWindow->mWindow->getFullscreen(); - BOOL maximized = gViewerWindow->mWindow->getMaximized(); + BOOL fullscreen = gViewerWindow->getWindow()->getFullscreen(); + BOOL maximized = gViewerWindow->getWindow()->getMaximized(); if (!fullscreen && !maximized) { LLCoordScreen window_pos; - if (gViewerWindow->mWindow->getPosition(&window_pos)) + if (gViewerWindow->getWindow()->getPosition(&window_pos)) { gSavedSettings.setS32("WindowX", window_pos.mX); gSavedSettings.setS32("WindowY", window_pos.mY); @@ -2642,6 +2614,10 @@ void LLAppViewer::removeCacheFiles(const std::string& file_mask) void LLAppViewer::writeSystemInfo() { + + if (! gDebugInfo.has("Dynamic") ) + gDebugInfo["Dynamic"] = LLSD::emptyMap(); + gDebugInfo["SLLog"] = LLError::logFileName(); gDebugInfo["ClientInfo"]["Name"] = gVersionChannel; @@ -2679,6 +2655,15 @@ void LLAppViewer::writeSystemInfo() // If the crash is handled by LLAppViewer::handleViewerCrash, ie not a freeze, // then the value of "CrashNotHandled" will be set to true. gDebugInfo["CrashNotHandled"] = (LLSD::Boolean)true; + + // Insert crash host url (url to post crash log to) if configured. This insures + // that the crash report will go to the proper location in the case of a + // prior freeze. + std::string crashHostUrl = gSavedSettings.get("CrashHostUrl"); + if(crashHostUrl != "") + { + gDebugInfo["CrashHostUrl"] = crashHostUrl; + } // Dump some debugging info LL_INFOS("SystemInfo") << LLTrans::getString("APP_NAME") @@ -2703,13 +2688,6 @@ void LLAppViewer::writeSystemInfo() writeDebugInfo(); // Save out debug_info.log early, in case of crash. } -void LLAppViewer::handleSyncViewerCrash() -{ - LLAppViewer* pApp = LLAppViewer::instance(); - // Call to pure virtual, handled by platform specific llappviewer instance. - pApp->handleSyncCrashTrace(); -} - void LLAppViewer::handleViewerCrash() { llinfos << "Handle viewer crash entry." << llendl; @@ -2741,8 +2719,12 @@ void LLAppViewer::handleViewerCrash() } pApp->mReportedCrash = TRUE; - // Make sure the watchdog gets turned off... -// pApp->destroyMainloopTimeout(); // SJB: Bah. This causes the crash handler to hang, not sure why. + // Insert crash host url (url to post crash log to) if configured. + std::string crashHostUrl = gSavedSettings.get("CrashHostUrl"); + if(crashHostUrl != "") + { + gDebugInfo["Dynamic"]["CrashHostUrl"] = crashHostUrl; + } //We already do this in writeSystemInfo(), but we do it again here to make /sure/ we have a version //to check against no matter what @@ -2756,11 +2738,11 @@ void LLAppViewer::handleViewerCrash() LLParcel* parcel = LLViewerParcelMgr::getInstance()->getAgentParcel(); if ( parcel && parcel->getMusicURL()[0]) { - gDebugInfo["ParcelMusicURL"] = parcel->getMusicURL(); + gDebugInfo["Dynamic"]["ParcelMusicURL"] = parcel->getMusicURL(); } if ( parcel && parcel->getMediaURL()[0]) { - gDebugInfo["ParcelMediaURL"] = parcel->getMediaURL(); + gDebugInfo["Dynamic"]["ParcelMediaURL"] = parcel->getMediaURL(); } @@ -2768,15 +2750,15 @@ void LLAppViewer::handleViewerCrash() gDebugInfo["CAFilename"] = gDirUtilp->getCAFile(); gDebugInfo["ViewerExePath"] = gDirUtilp->getExecutablePathAndName(); gDebugInfo["CurrentPath"] = gDirUtilp->getCurPath(); - gDebugInfo["SessionLength"] = F32(LLFrameTimer::getElapsedSeconds()); + gDebugInfo["Dynamic"]["SessionLength"] = F32(LLFrameTimer::getElapsedSeconds()); gDebugInfo["StartupState"] = LLStartUp::getStartupStateString(); - gDebugInfo["RAMInfo"]["Allocated"] = (LLSD::Integer) LLMemory::getCurrentRSS() >> 10; + gDebugInfo["Dynamic"]["RAMInfo"]["Allocated"] = (LLSD::Integer) LLMemory::getCurrentRSS() >> 10; gDebugInfo["FirstLogin"] = (LLSD::Boolean) gAgent.isFirstLogin(); gDebugInfo["FirstRunThisInstall"] = gSavedSettings.getBOOL("FirstRunThisInstall"); if(gLogoutInProgress) { - gDebugInfo["LastExecEvent"] = LAST_EXEC_LOGOUT_CRASH; + gDebugInfo["Dynamic"]["LastExecEvent"] = LAST_EXEC_LOGOUT_CRASH; } else { @@ -2785,23 +2767,23 @@ void LLAppViewer::handleViewerCrash() if(gAgent.getRegion()) { - gDebugInfo["CurrentSimHost"] = gAgent.getRegionHost().getHostName(); - gDebugInfo["CurrentRegion"] = gAgent.getRegion()->getName(); + gDebugInfo["Dynamic"]["CurrentSimHost"] = gAgent.getRegionHost().getHostName(); + gDebugInfo["Dynamic"]["CurrentRegion"] = gAgent.getRegion()->getName(); const LLVector3& loc = gAgent.getPositionAgent(); - gDebugInfo["CurrentLocationX"] = loc.mV[0]; - gDebugInfo["CurrentLocationY"] = loc.mV[1]; - gDebugInfo["CurrentLocationZ"] = loc.mV[2]; + gDebugInfo["Dynamic"]["CurrentLocationX"] = loc.mV[0]; + gDebugInfo["Dynamic"]["CurrentLocationY"] = loc.mV[1]; + gDebugInfo["Dynamic"]["CurrentLocationZ"] = loc.mV[2]; } if(LLAppViewer::instance()->mMainloopTimeout) { - gDebugInfo["MainloopTimeoutState"] = LLAppViewer::instance()->mMainloopTimeout->getState(); + gDebugInfo["Dynamic"]["MainloopTimeoutState"] = LLAppViewer::instance()->mMainloopTimeout->getState(); } // The crash is being handled here so set this value to false. // Otherwise the crash logger will think this crash was a freeze. - gDebugInfo["CrashNotHandled"] = (LLSD::Boolean)false; + gDebugInfo["Dynamic"]["CrashNotHandled"] = (LLSD::Boolean)false; //Write out the crash status file //Use marker file style setup, as that's the simplest, especially since @@ -2823,11 +2805,18 @@ void LLAppViewer::handleViewerCrash() LL_WARNS("MarkerFile") << "Cannot create error marker file " << crash_file_name << LL_ENDL; } } + char *minidump_file = pApp->getMiniDumpFilename(); + if(minidump_file && minidump_file[0] != 0) + { + gDebugInfo["Dynamic"]["MinidumpPath"] = minidump_file; + } + + gDebugInfo["Dynamic"]["CrashType"]="crash"; if (gMessageSystem && gDirUtilp) { std::string filename; - filename = gDirUtilp->getExpandedFilename(LL_PATH_LOGS, "stats.log"); + filename = gDirUtilp->getExpandedFilename(LL_PATH_DUMP, "stats.log"); llofstream file(filename, llofstream::binary); if(file.good()) { @@ -2843,19 +2832,15 @@ void LLAppViewer::handleViewerCrash() gMessageSystem->stopLogging(); } - if (LLWorld::instanceExists()) LLWorld::getInstance()->getInfo(gDebugInfo); + if (LLWorld::instanceExists()) LLWorld::getInstance()->getInfo(gDebugInfo["Dynamic"]); // Close the debug file - pApp->writeDebugInfo(); + pApp->writeDebugInfo(false); //false answers the isStatic question with the least overhead. LLError::logToFile(""); -// On Mac, we send the report on the next run, since we need macs crash report -// for a stack trace, so we have to let it the app fail. -#if !LL_DARWIN - // Remove the marker file, since otherwise we'll spawn a process that'll keep it locked - if(gDebugInfo["LastExecEvent"].asInteger() == LAST_EXEC_LOGOUT_CRASH) + if(gDebugInfo["Dynamic"]["LastExecEvent"].asInteger() == LAST_EXEC_LOGOUT_CRASH) { pApp->removeMarkerFile(true); } @@ -2864,11 +2849,6 @@ void LLAppViewer::handleViewerCrash() pApp->removeMarkerFile(false); } - // Call to pure virtual, handled by platform specific llappviewer instance. - pApp->handleCrashReporting(); - -#endif //!LL_DARWIN - return; } @@ -2993,6 +2973,18 @@ void LLAppViewer::removeMarkerFile(bool leave_logout_marker) LLAPRFile::remove( mLogoutMarkerFileName ); mLogoutMarkerFile = NULL; } + else + { + LL_WARNS("MarkerFile") << "leaving markers because this is a second instance" << LL_ENDL; + } +} + +void LLAppViewer::removeDumpDir() +{ + //Call this routine only on clean exit. Crash reporter will clean up + //its locking table for us. + std::string dump_dir = gDirUtilp->getExpandedFilename(LL_PATH_DUMP, ""); + gDirUtilp->deleteDirAndContents(dump_dir); } void LLAppViewer::forceQuit() @@ -3565,13 +3557,6 @@ void LLAppViewer::badNetworkHandler() mPurgeOnExit = TRUE; -#if LL_WINDOWS - // Generates the minidump. - LLWinDebug::generateCrashStacks(NULL); -#endif - LLAppViewer::handleSyncViewerCrash(); - LLAppViewer::handleViewerCrash(); - std::string grid_support_msg = ""; if (!gHippoGridManager->getCurrentGrid()->getSupportUrl().empty()) { @@ -3590,6 +3575,8 @@ void LLAppViewer::badNetworkHandler() "If the problem continues, please report the issue at: \n" "http://www.singularityviewer.org" << grid_support_msg; forceDisconnect(message.str()); + + LLApp::instance()->writeMiniDump(); } // This routine may get called more than once during the shutdown process. diff --git a/indra/newview/llappviewer.h b/indra/newview/llappviewer.h index af192fbfa..f461c259b 100644 --- a/indra/newview/llappviewer.h +++ b/indra/newview/llappviewer.h @@ -77,7 +77,7 @@ public: bool quitRequested() { return mQuitRequested; } bool logoutRequestSent() { return mLogoutRequestSent; } - void writeDebugInfo(); + void writeDebugInfo(bool isStatic=true); const LLOSInfo& getOSInfo() const { return mSysOSInfo; } @@ -86,11 +86,8 @@ public: virtual bool restoreErrorTrap() = 0; // Require platform specific override to reset error handling mechanism. // return false if the error trap needed restoration. - virtual void handleCrashReporting(bool reportFreeze = false) = 0; // What to do with crash report? - virtual void handleSyncCrashTrace() = 0; // any low-level crash-prep that has to happen in the context of the crashing thread before the crash report is delivered. + virtual void initCrashReporting(bool reportFreeze = false) = 0; // What to do with crash report? static void handleViewerCrash(); // Hey! The viewer crashed. Do this, soon. - static void handleSyncViewerCrash(); // Hey! The viewer crashed. Do this right NOW in the context of the crashing thread. - void checkForCrash(); // Thread accessors static LLTextureCache* getTextureCache() { return sTextureCache; } @@ -118,6 +115,7 @@ public: void removeMarkerFile(bool leave_logout_marker = false); + void removeDumpDir(); // LLAppViewer testing helpers. // *NOTE: These will potentially crash the viewer. Only for debugging. virtual void forceErrorLLError(); diff --git a/indra/newview/llappviewerlinux.cpp b/indra/newview/llappviewerlinux.cpp index ce64710fa..c923462fd 100644 --- a/indra/newview/llappviewerlinux.cpp +++ b/indra/newview/llappviewerlinux.cpp @@ -46,27 +46,6 @@ #include -#if LL_LINUX -# include // RTLD_LAZY -# include // backtrace - glibc only -# include -# include -# include -# include -#elif LL_SOLARIS -# include -# include -# include -# include -#endif - -#ifdef LL_ELFBIN -# ifdef __GNUC__ -# include // for symbol demangling -# endif -# include "ELFIO/ELFIO.h" // for better backtraces -#endif - #if LL_DBUS_ENABLED # include "llappviewerlinux_api_dbus.h" @@ -90,8 +69,9 @@ static void exceptionTerminateHandler() // reinstall default terminate() handler in case we re-terminate. if (gOldTerminateHandler) std::set_terminate(gOldTerminateHandler); // treat this like a regular viewer crash, with nice stacktrace etc. - LLAppViewer::handleSyncViewerCrash(); - LLAppViewer::handleViewerCrash(); + long *null_ptr; + null_ptr = 0; + *null_ptr = 0xDEADBEEF; //Force an exception that will trigger breakpad. // we've probably been killed-off before now, but... gOldTerminateHandler(); // call old terminate() handler } @@ -114,7 +94,6 @@ int main( int argc, char **argv ) gOldTerminateHandler = std::set_terminate(exceptionTerminateHandler); // install crash handlers viewer_app_ptr->setErrorHandler(LLAppViewer::handleViewerCrash); - viewer_app_ptr->setSyncErrorHandler(LLAppViewer::handleSyncViewerCrash); bool ok = viewer_app_ptr->init(); if(!ok) @@ -144,201 +123,6 @@ int main( int argc, char **argv ) return 0; } -#ifdef LL_SOLARIS -static inline BOOL do_basic_glibc_backtrace() -{ - BOOL success = FALSE; - - std::string strace_filename = gDirUtilp->getExpandedFilename(LL_PATH_LOGS,"stack_trace.log"); - llinfos << "Opening stack trace file " << strace_filename << llendl; - LLFILE* StraceFile = LLFile::fopen(strace_filename, "w"); - if (!StraceFile) - { - llinfos << "Opening stack trace file " << strace_filename << " failed. Using stderr." << llendl; - StraceFile = stderr; - } - - printstack(fileno(StraceFile)); - - if (StraceFile != stderr) - fclose(StraceFile); - - return success; -} -#else -#define MAX_STACK_TRACE_DEPTH 40 -// This uses glibc's basic built-in stack-trace functions for a not very -// amazing backtrace. -static inline BOOL do_basic_glibc_backtrace() -{ - void *stackarray[MAX_STACK_TRACE_DEPTH]; - size_t size; - char **strings; - size_t i; - BOOL success = FALSE; - - size = backtrace(stackarray, MAX_STACK_TRACE_DEPTH); - strings = backtrace_symbols(stackarray, size); - - std::string strace_filename = gDirUtilp->getExpandedFilename(LL_PATH_LOGS,"stack_trace.log"); - llinfos << "Opening stack trace file " << strace_filename << llendl; - LLFILE* StraceFile = LLFile::fopen(strace_filename, "w"); // Flawfinder: ignore - if (!StraceFile) - { - llinfos << "Opening stack trace file " << strace_filename << " failed. Using stderr." << llendl; - StraceFile = stderr; - } - - if (size) - { - for (i = 0; i < size; i++) - { - // the format of the StraceFile is very specific, to allow (kludgy) machine-parsing - fprintf(StraceFile, "%-3lu ", (unsigned long)i); - fprintf(StraceFile, "%-32s\t", "unknown"); - fprintf(StraceFile, "%p ", stackarray[i]); - fprintf(StraceFile, "%s\n", strings[i]); - } - - success = TRUE; - } - - if (StraceFile != stderr) - fclose(StraceFile); - - free (strings); - return success; -} - -#if LL_ELFBIN -// This uses glibc's basic built-in stack-trace functions together with -// ELFIO's ability to parse the .symtab ELF section for better symbol -// extraction without exporting symbols (which'd cause subtle, fatal bugs). -static inline BOOL do_elfio_glibc_backtrace() -{ - void *stackarray[MAX_STACK_TRACE_DEPTH]; - size_t btsize; - char **strings; - BOOL success = FALSE; - - std::string appfilename = gDirUtilp->getExecutablePathAndName(); - - std::string strace_filename = gDirUtilp->getExpandedFilename(LL_PATH_LOGS,"stack_trace.log"); - llinfos << "Opening stack trace file " << strace_filename << llendl; - LLFILE* StraceFile = LLFile::fopen(strace_filename, "w"); // Flawfinder: ignore - if (!StraceFile) - { - llinfos << "Opening stack trace file " << strace_filename << " failed. Using stderr." << llendl; - StraceFile = stderr; - } - - // get backtrace address list and basic symbol info - btsize = backtrace(stackarray, MAX_STACK_TRACE_DEPTH); - strings = backtrace_symbols(stackarray, btsize); - - // create ELF reader for our app binary - IELFI* pReader; - const IELFISection* pSec = NULL; - IELFISymbolTable* pSymTbl = 0; - if (ERR_ELFIO_NO_ERROR != ELFIO::GetInstance()->CreateELFI(&pReader) || - ERR_ELFIO_NO_ERROR != pReader->Load(appfilename.c_str()) || - // find symbol table, create reader-object - NULL == (pSec = pReader->GetSection( ".symtab" )) || - ERR_ELFIO_NO_ERROR != pReader->CreateSectionReader(IELFI::ELFI_SYMBOL, pSec, (void**)&pSymTbl) ) - { - // Failed to open our binary and read its symbol table somehow - llinfos << "Could not initialize ELF symbol reading - doing basic backtrace." << llendl; - if (StraceFile != stderr) - fclose(StraceFile); - // note that we may be leaking some of the above ELFIO - // objects now, but it's expected that we'll be dead soon - // and we want to tread delicately until we get *some* kind - // of useful backtrace. - return do_basic_glibc_backtrace(); - } - - // iterate over trace and symtab, looking for plausible symbols - std::string name; - Elf32_Addr value; - Elf32_Word ssize; - unsigned char bind; - unsigned char type; - Elf32_Half section; - int nSymNo = pSymTbl->GetSymbolNum(); - size_t btpos; - for (btpos = 0; btpos < btsize; ++btpos) - { - // the format of the StraceFile is very specific, to allow (kludgy) machine-parsing - fprintf(StraceFile, "%-3ld ", (long)btpos); - int symidx; - for (symidx = 0; symidx < nSymNo; ++symidx) - { - if (ERR_ELFIO_NO_ERROR == - pSymTbl->GetSymbol(symidx, name, value, ssize, - bind, type, section)) - { - // check if trace address within symbol range - if (uintptr_t(stackarray[btpos]) >= value && - uintptr_t(stackarray[btpos]) < value+ssize) - { - // symbol is inside viewer - fprintf(StraceFile, "%-32s\t", "com.secondlife.indra.viewer"); - fprintf(StraceFile, "%p ", stackarray[btpos]); - - char *demangled_str = NULL; - int demangle_result = 1; - demangled_str = - abi::__cxa_demangle - (name.c_str(), NULL, NULL, - &demangle_result); - if (0 == demangle_result && - NULL != demangled_str) { - fprintf(StraceFile, - "%s", demangled_str); - free(demangled_str); - } - else // failed demangle; print it raw - { - fprintf(StraceFile, - "%s", name.c_str()); - } - // print offset from symbol start - fprintf(StraceFile, - " + %lu\n", - uintptr_t(stackarray[btpos]) - - value); - goto got_sym; // early escape - } - } - } - // Fallback: - // Didn't find a suitable symbol in the binary - it's probably - // a symbol in a DSO; use glibc's idea of what it should be. - fprintf(StraceFile, "%-32s\t", "unknown"); - fprintf(StraceFile, "%p ", stackarray[btpos]); - fprintf(StraceFile, "%s\n", strings[btpos]); - got_sym:; - } - - if (StraceFile != stderr) - fclose(StraceFile); - - pSymTbl->Release(); - pSec->Release(); - pReader->Release(); - - free(strings); - - llinfos << "Finished generating stack trace." << llendl; - - success = TRUE; - return success; -} -#endif // LL_ELFBIN - -#endif // LL_SOLARIS - - LLAppViewerLinux::LLAppViewerLinux() { } @@ -355,7 +139,17 @@ bool LLAppViewerLinux::init() // really early in app startup! if (!g_thread_supported ()) g_thread_init (NULL); - return LLAppViewer::init(); + bool success = LLAppViewer::init(); + +#if LL_SEND_CRASH_REPORTS + if (success) + { + LLAppViewer* pApp = LLAppViewer::instance(); + pApp->initCrashReporting(); + } +#endif + + return success; } bool LLAppViewerLinux::restoreErrorTrap() @@ -547,102 +341,10 @@ bool LLAppViewerLinux::sendURLToOtherInstance(const std::string& url) } #endif // LL_DBUS_ENABLED -void LLAppViewerLinux::handleSyncCrashTrace() +void LLAppViewerLinux::initCrashReporting(bool reportFreeze) { - // This backtrace writes into stack_trace.log -# if LL_ELFBIN - do_elfio_glibc_backtrace(); // more useful backtrace -# else - do_basic_glibc_backtrace(); // only slightly useful backtrace -# endif // LL_ELFBIN -} - -void LLAppViewerLinux::handleCrashReporting(bool reportFreeze) -{ - std::string cmd =gDirUtilp->getAppRODataDir(); - cmd += gDirUtilp->getDirDelimiter(); -#if LL_LINUX - cmd += "linux-crash-logger.bin"; -#elif LL_SOLARIS - cmd += "solaris-crash-logger"; -#else -# error Unknown platform -#endif - - if(reportFreeze) - { - char* const cmdargv[] = - {(char*)cmd.c_str(), - (char*)"-previous", - NULL}; - - fflush(NULL); // flush all buffers before the child inherits them - pid_t pid = fork(); - if (pid == 0) - { // child - execv(cmd.c_str(), cmdargv); /* Flawfinder: Ignore */ - llwarns << "execv failure when trying to start " << cmd << llendl; - _exit(1); // avoid atexit() - } else { - if (pid > 0) - { - // wait for child proc to die - int childExitStatus; - waitpid(pid, &childExitStatus, 0); - } else { - llwarns << "fork failure." << llendl; - } - } - } - else - { - const S32 cb = gCrashSettings.getS32(CRASH_BEHAVIOR_SETTING); - - // Always generate the report, have the logger do the asking, and - // don't wait for the logger before exiting (-> total cleanup). - if (CRASH_BEHAVIOR_NEVER_SEND != cb) - { - // launch the actual crash logger - const char* ask_dialog = "-dialog"; - if (CRASH_BEHAVIOR_ASK != cb) - ask_dialog = ""; // omit '-dialog' option - const char * cmdargv[] = - {cmd.c_str(), - ask_dialog, - "-user", - (char*)LLViewerLogin::getInstance()->getGridLabel().c_str(), - "-name", - LLAppViewer::instance()->getSecondLifeTitle().c_str(), - NULL}; - fflush(NULL); - pid_t pid = fork(); - if (pid == 0) - { // child - execv(cmd.c_str(), (char* const*) cmdargv); /* Flawfinder: ignore */ - llwarns << "execv failure when trying to start " << cmd << llendl; - _exit(1); // avoid atexit() - } - else - { - if (pid > 0) - { - // DO NOT wait for child proc to die; we want - // the logger to outlive us while we quit to - // free up the screen/keyboard/etc. - ////int childExitStatus; - ////waitpid(pid, &childExitStatus, 0); - } - else - { - llwarns << "fork failure." << llendl; - } - } - } - // Sometimes signals don't seem to quit the viewer. Also, we may - // have been called explicitly instead of from a signal handler. - // Make sure we exit so as to not totally confuse the user. - _exit(1); // avoid atexit(), else we may re-crash in dtors. - } + // Singu Note: this is where original code forks crash logger process. + // Singularity doesn't need it } bool LLAppViewerLinux::beingDebugged() @@ -676,7 +378,6 @@ bool LLAppViewerLinux::beingDebugged() base += 1; } - //should valgrind be added here? if (strcmp(base, "gdb") == 0) { debugged = yes; @@ -693,6 +394,8 @@ bool LLAppViewerLinux::beingDebugged() bool LLAppViewerLinux::initLogging() { // Remove the last stack trace, if any + // This file is no longer created, since the move to Google Breakpad + // The code is left here to clean out any old state in the log dir std::string old_stack_file = gDirUtilp->getExpandedFilename(LL_PATH_LOGS,"stack_trace.log"); LLFile::remove(old_stack_file); @@ -739,6 +442,7 @@ std::string LLAppViewerLinux::generateSerialNumber() // trawl /dev/disk/by-uuid looking for a good-looking UUID to grab std::string this_name; + LLDirIterator iter(uuiddir, "*"); while (iter.next(this_name)) { diff --git a/indra/newview/llappviewerlinux.h b/indra/newview/llappviewerlinux.h index 365fcfeb6..6de13b81c 100644 --- a/indra/newview/llappviewerlinux.h +++ b/indra/newview/llappviewerlinux.h @@ -64,8 +64,7 @@ protected: virtual bool beingDebugged(); virtual bool restoreErrorTrap(); - virtual void handleCrashReporting(bool reportFreeze); - virtual void handleSyncCrashTrace(); + virtual void initCrashReporting(bool reportFreeze); virtual bool initLogging(); virtual bool initParseCommandLine(LLCommandLineParser& clp); diff --git a/indra/newview/llappviewermacosx.cpp b/indra/newview/llappviewermacosx.cpp index 029b0953e..af400e766 100644 --- a/indra/newview/llappviewermacosx.cpp +++ b/indra/newview/llappviewermacosx.cpp @@ -57,8 +57,6 @@ namespace int gArgC; char** gArgV; - bool sCrashReporterIsRunning = false; - OSErr AEQuitHandler(const AppleEvent *messagein, AppleEvent *reply, long refIn) { OSErr result = noErr; @@ -262,154 +260,10 @@ bool LLAppViewerMacOSX::restoreErrorTrap() return reset_count == 0; } -void LLAppViewerMacOSX::handleSyncCrashTrace() +void LLAppViewerMacOSX::initCrashReporting(bool reportFreeze) { - // do nothing -} - -static OSStatus CarbonEventHandler(EventHandlerCallRef inHandlerCallRef, - EventRef inEvent, - void* inUserData) -{ - ProcessSerialNumber psn; - - GetEventParameter(inEvent, - kEventParamProcessID, - typeProcessSerialNumber, - NULL, - sizeof(psn), - NULL, - &psn); - - if( GetEventKind(inEvent) == kEventAppTerminated ) - { - Boolean matching_psn = FALSE; - OSErr os_result = SameProcess(&psn, (ProcessSerialNumber*)inUserData, &matching_psn); - if(os_result >= 0 && matching_psn) - { - sCrashReporterIsRunning = false; - QuitApplicationEventLoop(); - } - } - return noErr; -} - -void LLAppViewerMacOSX::handleCrashReporting(bool reportFreeze) -{ - // This used to use fork&exec, but is switched to LSOpenApplication to - // Make sure the crash reporter launches in front of the SL window. - - std::string command_str; - //command_str = "open Second Life.app/Contents/Resources/mac-crash-logger.app"; - command_str = "mac-crash-logger.app/Contents/MacOS/mac-crash-logger"; - - FSRef appRef; - Boolean isDir = 0; - OSStatus os_result = FSPathMakeRef((UInt8*)command_str.c_str(), - &appRef, - &isDir); - if(os_result >= 0) - { - LSApplicationParameters appParams; - memset(&appParams, 0, sizeof(appParams)); - appParams.version = 0; - appParams.flags = kLSLaunchNoParams | kLSLaunchStartClassic; - appParams.application = &appRef; - - if(reportFreeze) - { - // Make sure freeze reporting launches the crash logger synchronously, lest - // Log files get changed by SL while the logger is running. - - // *NOTE:Mani A better way - make a copy of the data that the crash reporter will send - // and let SL go about its business. This way makes the mac work like windows and linux - // and is the smallest patch for the issue. - sCrashReporterIsRunning = false; - ProcessSerialNumber o_psn; - - static EventHandlerRef sCarbonEventsRef = NULL; - static const EventTypeSpec kEvents[] = - { - { kEventClassApplication, kEventAppTerminated } - }; - - // Install the handler to detect crash logger termination - InstallEventHandler(GetApplicationEventTarget(), - (EventHandlerUPP) CarbonEventHandler, - GetEventTypeCount(kEvents), - kEvents, - &o_psn, - &sCarbonEventsRef - ); - - // Remove, temporarily the quit handler - which has *crash* behavior before - // the mainloop gets running! - AERemoveEventHandler(kCoreEventClass, - kAEQuitApplication, - NewAEEventHandlerUPP(AEQuitHandler), - false); - - // Launch the crash reporter. - os_result = LSOpenApplication(&appParams, &o_psn); - - if(os_result >= 0) - { - sCrashReporterIsRunning = true; - } - - while(sCrashReporterIsRunning) - { - RunApplicationEventLoop(); - } - - // Re-install the apps quit handler. - AEInstallEventHandler(kCoreEventClass, - kAEQuitApplication, - NewAEEventHandlerUPP(AEQuitHandler), - 0, - false); - - // Remove the crash reporter quit handler. - RemoveEventHandler(sCarbonEventsRef); - } - else - { - appParams.flags |= kLSLaunchAsync; - clear_signals(); - - ProcessSerialNumber o_psn; - os_result = LSOpenApplication(&appParams, &o_psn); - } - - } - - if(!reportFreeze) - { - _exit(1); - } - - // TODO:palmer REMOVE THIS VERY SOON. THIS WILL NOT BE IN VIEWER 2.0 - // Remove the crash stack log from previous executions. - // Since we've started logging a new instance of the app, we can assume - // The old crash stack is invalid for the next crash report. - char path[MAX_PATH]; - FSRef folder; - if(FSFindFolder(kUserDomain, kLogsFolderType, false, &folder) == noErr) - { - // folder is an FSRef to ~/Library/Logs/ - if(FSRefMakePath(&folder, (UInt8*)&path, sizeof(path)) == noErr) - { - std::string pathname = std::string(path) + std::string("/CrashReporter/"); - std::string mask = "Second Life*"; - std::string file_name; - LLDirIterator iter(pathname, mask); - while(iter.next(file_name)) - { - LLFile::remove(pathname + file_name); - } - } - } - + // Singu Note: this is where original code forks crash logger process. + // Singularity doesn't need it } std::string LLAppViewerMacOSX::generateSerialNumber() diff --git a/indra/newview/llappviewermacosx.h b/indra/newview/llappviewermacosx.h index bc841fc3a..e94b297be 100644 --- a/indra/newview/llappviewermacosx.h +++ b/indra/newview/llappviewermacosx.h @@ -51,8 +51,7 @@ public: protected: virtual bool restoreErrorTrap(); - virtual void handleCrashReporting(bool reportFreeze); - virtual void handleSyncCrashTrace(); + virtual void initCrashReporting(bool reportFreeze); std::string generateSerialNumber(); virtual bool initParseCommandLine(LLCommandLineParser& clp); diff --git a/indra/newview/llappviewerwin32.cpp b/indra/newview/llappviewerwin32.cpp index 5ccb1f7e6..5758fb5c4 100644 --- a/indra/newview/llappviewerwin32.cpp +++ b/indra/newview/llappviewerwin32.cpp @@ -79,50 +79,6 @@ extern "C" { const std::string LLAppViewerWin32::sWindowClass = "Second Life"; -LONG WINAPI viewer_windows_exception_handler(struct _EXCEPTION_POINTERS *exception_infop) -{ - // *NOTE:Mani - this code is stolen from LLApp, where its never actually used. - //OSMessageBox("Attach Debugger Now", "Error", OSMB_OK); - // Translate the signals/exceptions into cross-platform stuff - // Windows implementation - _tprintf( _T("Entering Windows Exception Handler...\n") ); - llinfos << "Entering Windows Exception Handler..." << llendl; - - // Make sure the user sees something to indicate that the app crashed. - LONG retval; - - if (LLApp::isError()) - { - _tprintf( _T("Got another fatal signal while in the error handler, die now!\n") ); - llwarns << "Got another fatal signal while in the error handler, die now!" << llendl; - - retval = EXCEPTION_EXECUTE_HANDLER; - return retval; - } - - // Generate a minidump if we can. - // Before we wake the error thread... - // Which will start the crash reporting. - LLWinDebug::generateCrashStacks(exception_infop); - - // Flag status to error, so thread_error starts its work - LLApp::setError(); - - // Block in the exception handler until the app has stopped - // This is pretty sketchy, but appears to work just fine - while (!LLApp::isStopped()) - { - ms_sleep(10); - } - - // - // At this point, we always want to exit the app. There's no graceful - // recovery for an unhandled exception. - // - // Just kill the process. - retval = EXCEPTION_EXECUTE_HANDLER; - return retval; -} // Create app mutex creates a unique global windows object. // If the object can be created it returns true, otherwise @@ -187,8 +143,6 @@ int APIENTRY WINMAIN(HINSTANCE hInstance, gIconResource = MAKEINTRESOURCE(IDI_LL_ICON); LLAppViewerWin32* viewer_app_ptr = new LLAppViewerWin32(lpCmdLine); - - LLWinDebug::initExceptionHandler(viewer_windows_exception_handler); viewer_app_ptr->setErrorHandler(LLAppViewer::handleViewerCrash); @@ -407,10 +361,25 @@ bool LLAppViewerWin32::init() // (Don't send our data to Microsoft--at least until we are Logo approved and have a way // of getting the data back from them.) // - llinfos << "Turning off Windows error reporting." << llendl; + // llinfos << "Turning off Windows error reporting." << llendl; disableWinErrorReporting(); - return LLAppViewer::init(); +#ifndef LL_RELEASE_FOR_DOWNLOAD + LLWinDebug::instance().init(); +#endif + +#if LL_WINDOWS +#if LL_SEND_CRASH_REPORTS + + LLAppViewer* pApp = LLAppViewer::instance(); + pApp->initCrashReporting(); + +#endif +#endif + + bool success = LLAppViewer::init(); + + return success; } bool LLAppViewerWin32::cleanup() @@ -424,12 +393,6 @@ bool LLAppViewerWin32::cleanup() bool LLAppViewerWin32::initLogging() { - // Remove the crash stack log from previous executions. - // Since we've started logging a new instance of the app, we can assume - // *NOTE: This should happen before the we send a 'previous instance froze' - // crash report, but it must happen after we initialize the DirUtil. - LLWinDebug::clearCrashStacks(); - return LLAppViewer::initLogging(); } @@ -552,39 +515,68 @@ bool LLAppViewerWin32::initParseCommandLine(LLCommandLineParser& clp) } bool LLAppViewerWin32::restoreErrorTrap() -{ - return LLWinDebug::checkExceptionHandler(); +{ + return true; + //return LLWinDebug::checkExceptionHandler(); } -void LLAppViewerWin32::handleSyncCrashTrace() -{ - // do nothing -} - -void LLAppViewerWin32::handleCrashReporting(bool reportFreeze) +void LLAppViewerWin32::initCrashReporting(bool reportFreeze) { + /* Singu Note: don't fork the crash logger on start const char* logger_name = "win_crash_logger.exe"; std::string exe_path = gDirUtilp->getExecutableDir(); exe_path += gDirUtilp->getDirDelimiter(); exe_path += logger_name; - const char* arg_str = logger_name; + std::stringstream pid_str; + pid_str << LLApp::getPid(); + std::string logdir = gDirUtilp->getExpandedFilename(LL_PATH_DUMP, ""); + std::string appname = gDirUtilp->getExecutableFilename(); - // *NOTE:Mani - win_crash_logger.exe no longer parses command line options. - if(reportFreeze) + S32 slen = logdir.length() -1; + S32 end = slen; + while (logdir.at(end) == '/' || logdir.at(end) == '\\') end--; + + if (slen !=end) { - // Spawn crash logger. - // NEEDS to wait until completion, otherwise log files will get smashed. - _spawnl(_P_WAIT, exe_path.c_str(), arg_str, NULL); + logdir = logdir.substr(0,end+1); } - else + std::string arg_str = "\"" + exe_path + "\" -dumpdir \"" + logdir + "\" -procname \"" + appname + "\" -pid " + pid_str.str(); + llinfos << "spawning " << arg_str << llendl; + _spawnl(_P_NOWAIT, exe_path.c_str(), arg_str.c_str(), NULL); + */ + +/* STARTUPINFO siStartupInfo; + + std::string arg_str = "-dumpdir \"" + logdir + "\" -procname \"" + appname + "\" -pid " + pid_str.str(); + + memset(&siStartupInfo, 0, sizeof(siStartupInfo)); + memset(&mCrashReporterProcessInfo, 0, sizeof(mCrashReporterProcessInfo)); + + siStartupInfo.cb = sizeof(siStartupInfo); + + std::wstring exe_wstr; + exe_wstr.assign(exe_path.begin(), exe_path.end()); + + std::wstring arg_wstr; + arg_wstr.assign(arg_str.begin(), arg_str.end()); + + if(CreateProcess(&exe_wstr[0], + &arg_wstr[0], // Application arguments + 0, + 0, + FALSE, + CREATE_DEFAULT_ERROR_MODE, + 0, + 0, // Working directory + &siStartupInfo, + &mCrashReporterProcessInfo) == FALSE) + // Could not start application -> call 'GetLastError()' { - S32 cb = gCrashSettings.getS32(CRASH_BEHAVIOR_SETTING); - if(cb != CRASH_BEHAVIOR_NEVER_SEND) - { - _spawnl(_P_NOWAIT, exe_path.c_str(), arg_str, NULL); - } - } + //llinfos << "CreateProcess failed " << GetLastError() << llendl; + return; + } + */ } //virtual diff --git a/indra/newview/llappviewerwin32.h b/indra/newview/llappviewerwin32.h index 13454edee..757f6ea0c 100644 --- a/indra/newview/llappviewerwin32.h +++ b/indra/newview/llappviewerwin32.h @@ -56,13 +56,13 @@ protected: virtual bool initParseCommandLine(LLCommandLineParser& clp); virtual bool restoreErrorTrap(); - virtual void handleCrashReporting(bool reportFreeze); - virtual void handleSyncCrashTrace(); + virtual void initCrashReporting(bool reportFreeze); virtual bool sendURLToOtherInstance(const std::string& url); std::string generateSerialNumber(); + static const std::string sWindowClass; private: diff --git a/indra/newview/llavataractions.cpp b/indra/newview/llavataractions.cpp index 8baff17bc..42f2e73d8 100644 --- a/indra/newview/llavataractions.cpp +++ b/indra/newview/llavataractions.cpp @@ -898,5 +898,5 @@ void LLAvatarActions::copyUUIDs(const uuid_vec_t& ids) } if (!ids_string.empty()) - gViewerWindow->mWindow->copyTextToClipboard(utf8str_to_wstring(ids_string)); + gViewerWindow->getWindow()->copyTextToClipboard(utf8str_to_wstring(ids_string)); } diff --git a/indra/newview/llchatbar.cpp b/indra/newview/llchatbar.cpp index 95e39ee89..9a31e0d6f 100644 --- a/indra/newview/llchatbar.cpp +++ b/indra/newview/llchatbar.cpp @@ -404,6 +404,63 @@ LLWString LLChatBar::stripChannelNumber(const LLWString &mesg, S32* channel) } } +// Returns whether or not this is an action +bool convert_roleplay_text(std::string& utf8text) +{ + bool action(true); // Using /me with autoclose /me ((does something ooc)) + // Allow CAPSlock /me here + if (utf8text.find("/ME'") == 0 || utf8text.find("/ME ") == 0) + { + utf8text.replace(1, 2, "me"); + } + // Convert MU*s style poses into IRC emotes here. + else if (gSavedSettings.getBOOL("AscentAllowMUpose") && utf8text.length() > 3 && utf8text.find(":") == 0) + { + if (utf8text[1] == '\'') + utf8text.replace(0, 1, "/me"); + else if (isalpha(utf8text[1])) // Do not prevent smileys and such. + utf8text.replace(0, 1, "/me "); + else + action = false; + } + else if (utf8text.find("/me'") != 0 && utf8text.find("/me ") != 0) + { + action = false; + } + + if (gSavedSettings.getBOOL("AscentAutoCloseOOC") && (utf8text.length() > 3)) + { + const U32 pos(action ? 4 : 0); + //Check if it needs the end-of-chat brackets -HgB + if (utf8text.find("((") == pos && utf8text.find("))") == std::string::npos) + { + if (*utf8text.rbegin() == ')') + utf8text += " "; + utf8text += "))"; + } + else if (utf8text.find("[[") == pos && utf8text.find("]]") == std::string::npos) + { + if (*utf8text.rbegin() == ']') + utf8text += " "; + utf8text += "]]"; + } + // Check if it needs start-of-chat brackets + else if (utf8text.find("((") == std::string::npos && utf8text.find("))") == (utf8text.length() - 2)) + { + if (utf8text.at(pos) == '(') + utf8text.insert(pos, " "); + utf8text.insert(pos, "(("); + } + else if (utf8text.find("[[") == std::string::npos && utf8text.find("]]") == (utf8text.length() - 2)) + { + if (utf8text.at(pos) == '[') + utf8text.insert(pos, " "); + utf8text.insert(pos, "[["); + } + } + return action; +} + // void LLChatBar::sendChat( EChatType type ) { @@ -423,47 +480,7 @@ void LLChatBar::sendChat( EChatType type ) std::string utf8_revised_text; if (0 == channel) { - if (gSavedSettings.getBOOL("AscentAutoCloseOOC") && (utf8text.length() > 1)) - { - //Check if it needs the end-of-chat brackets -HgB - if (utf8text.find("((") == 0 && utf8text.find("))") == -1) - { - if(utf8text.at(utf8text.length() - 1) == ')') - utf8text+=" "; - utf8text+="))"; - } - else if(utf8text.find("[[") == 0 && utf8text.find("]]") == -1) - { - if(utf8text.at(utf8text.length() - 1) == ']') - utf8text+=" "; - utf8text+="]]"; - } - - if (utf8text.find("((") == -1 && utf8text.find("))") == (utf8text.length() - 2)) - { - if(utf8text.at(0) == '(') - utf8text.insert(0," "); - utf8text.insert(0,"(("); - } - else if (utf8text.find("[[") == -1 && utf8text.find("]]") == (utf8text.length() - 2)) - { - if(utf8text.at(0) == '[') - utf8text.insert(0," "); - utf8text.insert(0,"[["); - } - } - // Convert MU*s style poses into IRC emotes here. - if (gSavedSettings.getBOOL("AscentAllowMUpose") && utf8text.find(":") == 0 && utf8text.length() > 3) - { - if (utf8text.find(":'") == 0) - { - utf8text.replace(0, 1, "/me"); - } - else if (isalpha(utf8text.at(1))) // Do not prevent smileys and such. - { - utf8text.replace(0, 1, "/me "); - } - } + convert_roleplay_text(utf8text); // discard returned "found" boolean LLGestureMgr::instance().triggerAndReviseString(utf8text, &utf8_revised_text); } @@ -473,11 +490,7 @@ void LLChatBar::sendChat( EChatType type ) } utf8_revised_text = utf8str_trim(utf8_revised_text); - EChatType nType; - if(type == CHAT_TYPE_OOC) - nType=CHAT_TYPE_NORMAL; - else - nType=type; + EChatType nType(type == CHAT_TYPE_OOC ? CHAT_TYPE_NORMAL : type); if (!utf8_revised_text.empty() && cmd_line_chat(utf8_revised_text, nType)) { // Chat with animation diff --git a/indra/newview/llchatbar.h b/indra/newview/llchatbar.h index b031e312a..71440d8bb 100644 --- a/indra/newview/llchatbar.h +++ b/indra/newview/llchatbar.h @@ -84,7 +84,6 @@ public: // callbacks void onClickSay(LLUICtrl* ctrl); - static void onTabClick( void* userdata ); void onInputEditorKeystroke(); static void onInputEditorFocusLost(); static void onInputEditorGainFocus(); diff --git a/indra/newview/llcrashlogger.cpp b/indra/newview/llcrashlogger.cpp new file mode 100644 index 000000000..ad96ba19c --- /dev/null +++ b/indra/newview/llcrashlogger.cpp @@ -0,0 +1,369 @@ + /** +* @file llcrashlogger.cpp +* @brief Crash logger implementation +* +* $LicenseInfo:firstyear=2003&license=viewerlgpl$ +* Second Life Viewer Source Code +* Copyright (C) 2010, Linden Research, Inc. +* +* This library is free software; you can redistribute it and/or +* modify it under the terms of the GNU Lesser General Public +* License as published by the Free Software Foundation; +* version 2.1 of the License only. +* +* This library is distributed in the hope that it will be useful, +* but WITHOUT ANY WARRANTY; without even the implied warranty of +* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +* Lesser General Public License for more details. +* +* You should have received a copy of the GNU Lesser General Public +* License along with this library; if not, write to the Free Software +* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA +* +* Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA +* $/LicenseInfo$ +*/ +#include "llviewerprecompiledheaders.h" + +#include "llcrashlogger.h" +#include "linden_common.h" +#include "llstring.h" +#include "indra_constants.h" // CRASH_BEHAVIOR_... +#include "llerror.h" +#include "llerrorcontrol.h" +#include "lltimer.h" +#include "lldir.h" +#include "llfile.h" +#include "llsdserialize.h" +#include "lliopipe.h" +#include "llpumpio.h" +#include "llhttpclient.h" +#include "llsdserialize.h" +#include "llproxy.h" +#include "aistatemachine.h" + +class AIHTTPTimeoutPolicy; +extern AIHTTPTimeoutPolicy crashLoggerResponder_timeout; + +class LLCrashLoggerResponder : public LLHTTPClient::ResponderWithResult +{ +public: + LLCrashLoggerResponder() + { + } + + virtual void error(U32 status, const std::string& reason) + { + llwarns << "Crash report sending failed: " << reason << llendl; + } + + virtual void result(const LLSD& content) + { + std::string msg = "Crash report successfully sent"; + if (content.has("message")) + { + msg += ": " + content["message"].asString(); + } + llinfos << msg << llendl; + } + + virtual AIHTTPTimeoutPolicy const& getHTTPTimeoutPolicy(void) const + { + return crashLoggerResponder_timeout; + } + + virtual char const* getName(void) const + { + return "LLCrashLoggerResponder"; + } +}; + +LLCrashLogger::LLCrashLogger() : + mCrashBehavior(CRASH_BEHAVIOR_ALWAYS_SEND), + mCrashInPreviousExec(false), + mCrashHost("") +{ +} + +LLCrashLogger::~LLCrashLogger() +{ + +} + +// TRIM_SIZE must remain larger than LINE_SEARCH_SIZE. +const int TRIM_SIZE = 128000; +const int LINE_SEARCH_DIST = 500; +const std::string SKIP_TEXT = "\n ...Skipping... \n"; +void trimSLLog(std::string& sllog) +{ + if(sllog.length() > TRIM_SIZE * 2) + { + std::string::iterator head = sllog.begin() + TRIM_SIZE; + std::string::iterator tail = sllog.begin() + sllog.length() - TRIM_SIZE; + std::string::iterator new_head = std::find(head, head - LINE_SEARCH_DIST, '\n'); + if(new_head != head - LINE_SEARCH_DIST) + { + head = new_head; + } + + std::string::iterator new_tail = std::find(tail, tail + LINE_SEARCH_DIST, '\n'); + if(new_tail != tail + LINE_SEARCH_DIST) + { + tail = new_tail; + } + + sllog.erase(head, tail); + sllog.insert(head, SKIP_TEXT.begin(), SKIP_TEXT.end()); + } +} + +std::string getStartupStateFromLog(std::string& sllog) +{ + std::string startup_state = "STATE_FIRST"; + std::string startup_token = "Startup state changing from "; + + int index = sllog.rfind(startup_token); + if (index < 0 || index + startup_token.length() > sllog.length()) { + return startup_state; + } + + // find new line + char cur_char = sllog[index + startup_token.length()]; + std::string::size_type newline_loc = index + startup_token.length(); + while(cur_char != '\n' && newline_loc < sllog.length()) + { + newline_loc++; + cur_char = sllog[newline_loc]; + } + + // get substring and find location of " to " + std::string state_line = sllog.substr(index, newline_loc - index); + std::string::size_type state_index = state_line.find(" to "); + startup_state = state_line.substr(state_index + 4, state_line.length() - state_index - 4); + + return startup_state; +} + +bool LLCrashLogger::readDebugFromXML(LLSD& dest, const std::string& filename ) +{ + std::string db_file_name = gDirUtilp->getExpandedFilename(LL_PATH_DUMP,filename); + std::ifstream debug_log_file(db_file_name.c_str()); + + // Look for it in the debug_info.log file + if (debug_log_file.is_open()) + { + LLSDSerialize::fromXML(dest, debug_log_file); + debug_log_file.close(); + return true; + } + return false; +} + +void LLCrashLogger::mergeLogs( LLSD src_sd ) +{ + LLSD::map_iterator iter = src_sd.beginMap(); + LLSD::map_iterator end = src_sd.endMap(); + for( ; iter != end; ++iter) + { + mDebugLog[iter->first] = iter->second; + } +} + +bool LLCrashLogger::readMinidump(std::string minidump_path) +{ + size_t length=0; + + std::ifstream minidump_stream(minidump_path.c_str(), std::ios_base::in | std::ios_base::binary); + if(minidump_stream.is_open()) + { + minidump_stream.seekg(0, std::ios::end); + length = (size_t)minidump_stream.tellg(); + minidump_stream.seekg(0, std::ios::beg); + + LLSD::Binary data; + data.resize(length); + + minidump_stream.read(reinterpret_cast(&(data[0])),length); + minidump_stream.close(); + + mCrashInfo["Minidump"] = data; + } + return (length>0?true:false); +} + +void LLCrashLogger::gatherFiles() +{ + llinfos << "Gathering logs..." << llendl; + + LLSD static_sd; + LLSD dynamic_sd; + + bool has_logs = readDebugFromXML( static_sd, "static_debug_info.log" ); + has_logs |= readDebugFromXML( dynamic_sd, "dynamic_debug_info.log" ); + + if ( has_logs ) + { + mDebugLog = static_sd; + mergeLogs(dynamic_sd); + mCrashInPreviousExec = mDebugLog["CrashNotHandled"].asBoolean(); + + mFileMap["SecondLifeLog"] = mDebugLog["SLLog"].asString(); + mFileMap["SettingsXml"] = mDebugLog["SettingsFilename"].asString(); + if(mDebugLog.has("CAFilename")) + { + LLCurl::setCAFile(mDebugLog["CAFilename"].asString()); + } + else + { + LLCurl::setCAFile(gDirUtilp->getCAFile()); + } + + llinfos << "Using log file from debug log " << mFileMap["SecondLifeLog"] << llendl; + llinfos << "Using settings file from debug log " << mFileMap["SettingsXml"] << llendl; + } + else + { + // Figure out the filename of the second life log + LLCurl::setCAFile(gDirUtilp->getCAFile()); + mFileMap["SecondLifeLog"] = gDirUtilp->getExpandedFilename(LL_PATH_LOGS,"SecondLife.log"); + mFileMap["SettingsXml"] = gDirUtilp->getExpandedFilename(LL_PATH_USER_SETTINGS,"settings.xml"); + } + + if(mCrashInPreviousExec) + { + // Restarting after freeze. + // Replace the log file ext with .old, since the + // instance that launched this process has overwritten + // SecondLife.log + std::string log_filename = mFileMap["SecondLifeLog"]; + log_filename.replace(log_filename.size() - 4, 4, ".old"); + mFileMap["SecondLifeLog"] = log_filename; + } + + gatherPlatformSpecificFiles(); + + mCrashInfo["DebugLog"] = mDebugLog; + mFileMap["StatsLog"] = gDirUtilp->getExpandedFilename(LL_PATH_DUMP,"stats.log"); + // Singu Note: we have just started again, log has been renamed + mFileMap["SecondLifeLog"] = gDirUtilp->getExpandedFilename(LL_PATH_LOGS, "Singularity.old"); + + llinfos << "Encoding files..." << llendl; + + for(std::map::iterator itr = mFileMap.begin(); itr != mFileMap.end(); ++itr) + { + std::ifstream f((*itr).second.c_str()); + if(!f.is_open()) + { + llinfos << "Can't find file " << (*itr).second << llendl; + continue; + } + std::stringstream s; + s << f.rdbuf(); + + std::string crash_info = s.str(); + if(itr->first == "SecondLifeLog") + { + if(!mCrashInfo["DebugLog"].has("StartupState")) + { + mCrashInfo["DebugLog"]["StartupState"] = getStartupStateFromLog(crash_info); + } + trimSLLog(crash_info); + } + + mCrashInfo[(*itr).first] = LLStringFn::strip_invalid_xml(rawstr_to_utf8(crash_info)); + } + + std::string minidump_path; + + // Add minidump as binary. + bool has_minidump = mDebugLog.has("MinidumpPath"); + + if (has_minidump) + minidump_path = mDebugLog["MinidumpPath"].asString(); + + + if (has_minidump) + { + has_minidump = readMinidump(minidump_path); + } + + if (!has_minidump) //Viewer was probably so hosed it couldn't write remaining data. Try brute force. + { + //Look for a filename at least 30 characters long in the dump dir which contains the characters MDMP as the first 4 characters in the file. + typedef std::vector vec; + + std::string pathname = gDirUtilp->getExpandedFilename(LL_PATH_DUMP,""); + vec file_vec = gDirUtilp->getFilesInDir(pathname); + for(vec::const_iterator iter=file_vec.begin(); iter!=file_vec.end(); ++iter) + { + if ( ( iter->length() > 30 ) && (iter->rfind(".log") != (iter->length()-4) ) ) + { + std::string fullname = pathname + *iter; + std::ifstream fdat( fullname.c_str(), std::ifstream::binary); + if (fdat) + { + char buf[5]; + fdat.read(buf,4); + fdat.close(); + if (!strncmp(buf,"MDMP",4)) + { + minidump_path = *iter; + has_minidump = readMinidump(fullname); + mDebugLog["MinidumpPath"] = fullname; + } + } + } + } + } +} + +LLSD LLCrashLogger::constructPostData() +{ + return mCrashInfo; +} + + +bool LLCrashLogger::sendCrashLog(std::string dump_dir) +{ + gDirUtilp->setDumpDir( dump_dir ); + + std::string dump_path = gDirUtilp->getExpandedFilename(LL_PATH_LOGS, + "SingularityCrashReport"); + std::string report_file = dump_path + ".log"; + + gatherFiles(); + + LLSD post_data; + post_data = constructPostData(); + + llinfos << "Sending reports..." << llendl; + + std::ofstream out_file(report_file.c_str()); + LLSDSerialize::toPrettyXML(post_data, out_file); + out_file.close(); + + LLHTTPClient::post(mCrashHost, post_data, new LLCrashLoggerResponder()); + + return true; +} + + +void LLCrashLogger::checkCrashDump() +{ + mCrashHost = gSavedSettings.getString("CrashHostUrl"); + + std::string dumpDir = gDirUtilp->getExpandedFilename(LL_PATH_LOGS, "") + "singularity-debug"; + if (gDirUtilp->fileExists(dumpDir)) + { +#if LL_SEND_CRASH_REPORTS + if (!mCrashHost.empty() && gSavedSettings.getS32("CrashSubmitBehavior") != 2) + { + sendCrashLog(dumpDir); + } +#endif + } + else + { + llinfos << "No crash dump found frome previous run, not sending report" << LL_ENDL; + } +} diff --git a/indra/newview/llcrashlogger.h b/indra/newview/llcrashlogger.h new file mode 100644 index 000000000..c510acb98 --- /dev/null +++ b/indra/newview/llcrashlogger.h @@ -0,0 +1,67 @@ +/** +* @file llcrashlogger.h +* @brief Crash Logger Definition +* +* $LicenseInfo:firstyear=2003&license=viewerlgpl$ +* Second Life Viewer Source Code +* Copyright (C) 2010, Linden Research, Inc. +* +* This library is free software; you can redistribute it and/or +* modify it under the terms of the GNU Lesser General Public +* License as published by the Free Software Foundation; +* version 2.1 of the License only. +* +* This library is distributed in the hope that it will be useful, +* but WITHOUT ANY WARRANTY; without even the implied warranty of +* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +* Lesser General Public License for more details. +* +* You should have received a copy of the GNU Lesser General Public +* License along with this library; if not, write to the Free Software +* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA +* +* Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA +* $/LicenseInfo$ +*/ +#ifndef LLCRASHLOGGER_H +#define LLCRASHLOGGER_H + +#include + +#include "linden_common.h" + +#include "llapp.h" +#include "llsd.h" +#include "llcontrol.h" + +class LLCrashLogger +{ +public: + LLCrashLogger(); + virtual ~LLCrashLogger(); + S32 loadCrashBehaviorSetting(); + bool readDebugFromXML(LLSD& dest, const std::string& filename ); + void gatherFiles(); + void mergeLogs( LLSD src_sd ); + + virtual void gatherPlatformSpecificFiles() {} + bool saveCrashBehaviorSetting(S32 crash_behavior); + bool sendCrashLog(std::string dump_dir); + LLSD constructPostData(); + void setUserText(const std::string& text) { mCrashInfo["UserNotes"] = text; } + S32 getCrashBehavior() { return mCrashBehavior; } + bool readMinidump(std::string minidump_path); + void checkCrashDump(); + +protected: + S32 mCrashBehavior; + BOOL mCrashInPreviousExec; + std::map mFileMap; + std::string mGridName; + std::string mProductName; + LLSD mCrashInfo; + std::string mCrashHost; + LLSD mDebugLog; +}; + +#endif //LLCRASHLOGGER_H diff --git a/indra/newview/lldrawpoolalpha.cpp b/indra/newview/lldrawpoolalpha.cpp index 7d65bd359..5fdedc68e 100644 --- a/indra/newview/lldrawpoolalpha.cpp +++ b/indra/newview/lldrawpoolalpha.cpp @@ -335,7 +335,7 @@ void LLDrawPoolAlpha::render(S32 pass) gPipeline.enableLightsFullbright(LLColor4(1,1,1,1)); } - gGL.diffuseColor4f(1,0,0,1); + gGL.diffuseColor4f(0.9,0,0,0.4); LLViewerFetchedTexture::sSmokeImagep->addTextureStats(1024.f*1024.f); gGL.getTexUnit(0)->bind(LLViewerFetchedTexture::sSmokeImagep, TRUE) ; diff --git a/indra/newview/lldrawpooltree.cpp b/indra/newview/lldrawpooltree.cpp index d2faca835..bb2fb09eb 100644 --- a/indra/newview/lldrawpooltree.cpp +++ b/indra/newview/lldrawpooltree.cpp @@ -104,12 +104,12 @@ 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); - /*static const LLCachedControl render_animate_trees("RenderAnimateTrees",false); - if (render_animate_trees) + static LLCachedControl sRenderAnimateTrees("RenderAnimateTrees", false); + if (sRenderAnimateTrees) { renderTree(); } - else*/ + else gGL.getTexUnit(sDiffTex)->bind(mTexturep); for (std::vector::iterator iter = mDrawFace.begin(); @@ -209,7 +209,7 @@ void LLDrawPoolTree::endShadowPass(S32 pass) gDeferredTreeShadowProgram.unbind(); } -/* +// void LLDrawPoolTree::renderTree(BOOL selecting) { LLGLState normalize(GL_NORMALIZE, TRUE); @@ -331,7 +331,7 @@ void LLDrawPoolTree::renderTree(BOOL selecting) //gGL.popMatrix(); } } -}*/ +}// BOOL LLDrawPoolTree::verify() const { diff --git a/indra/newview/lldrawpooltree.h b/indra/newview/lldrawpooltree.h index 5c63e8f4e..714dc25e1 100644 --- a/indra/newview/lldrawpooltree.h +++ b/indra/newview/lldrawpooltree.h @@ -75,8 +75,8 @@ public: static S32 sDiffTex; -//private: - //void renderTree(BOOL selecting = FALSE); +private: + void renderTree(BOOL selecting = FALSE); }; #endif // LL_LLDRAWPOOLTREE_H diff --git a/indra/newview/lldroptarget.cpp b/indra/newview/lldroptarget.cpp index c86e1f18c..22b555228 100644 --- a/indra/newview/lldroptarget.cpp +++ b/indra/newview/lldroptarget.cpp @@ -42,6 +42,7 @@ #include "lltextbox.h" #include "lltooldraganddrop.h" #include "lltrans.h" +#include "llviewborder.h" static LLRegisterWidget r("drop_target"); @@ -63,16 +64,21 @@ LLDropTarget::LLDropTarget(const LLDropTarget::Params& p) setControlName(p.control_name, NULL); mText->setOrigin(0, 0); mText->setFollows(FOLLOWS_NONE); + mText->setMouseOpaque(false); mText->setHAlign(LLFontGL::HCENTER); - mText->setBorderVisible(true); - mText->setBorderColor(LLUI::sColorsGroup->getColor("DefaultHighlightLight")); + mText->setVPad(1); + + mBorder = new LLViewBorder("drop_border", p.rect, LLViewBorder::BEVEL_IN); + addChild(mBorder); + + mBorder->setMouseOpaque(false); if (p.fill_parent) fillParent(getParent()); + if (!p.border_visible) mBorder->setBorderWidth(0); } LLDropTarget::~LLDropTarget() { - delete mText; } // static @@ -89,7 +95,9 @@ void LLDropTarget::initFromXML(LLXMLNodePtr node, LLView* parent) LLView::initFromXML(node, parent); const LLRect& rect = getRect(); - mText->setRect(LLRect(0, rect.getHeight(), rect.getWidth(), 0)); + const LLRect child_rect(0, rect.getHeight(), rect.getWidth(), 0); + mText->setRect(child_rect); + mBorder->setRect(child_rect); if (node->hasAttribute("name")) // Views can't have names, but drop targets can { @@ -111,6 +119,13 @@ void LLDropTarget::initFromXML(LLXMLNodePtr node, LLView* parent) node->getAttribute_bool("fill_parent", fill); if (fill) fillParent(parent); } + + if (node->hasAttribute("border_visible")) + { + bool border_visible; + node->getAttribute_bool("border_visible", border_visible); + if (!border_visible) mBorder->setBorderWidth(0); + } } // virtual @@ -154,7 +169,9 @@ void LLDropTarget::fillParent(const LLView* parent) } // The following block enlarges the target, but maintains the desired size for the text and border - mText->setRect(getRect()); // mText takes over the old rectangle, since the position will now be relative to the parent's rectangle for the text. + const LLRect& rect = getRect(); // Children maintain the old rectangle + mText->setRect(rect); + mBorder->setRect(rect); const LLRect& parent_rect = parent->getRect(); setRect(LLRect(0, parent_rect.getHeight(), parent_rect.getWidth(), 0)); } diff --git a/indra/newview/lldroptarget.h b/indra/newview/lldroptarget.h index e064c1b02..08026bd2a 100644 --- a/indra/newview/lldroptarget.h +++ b/indra/newview/lldroptarget.h @@ -44,11 +44,13 @@ class LLDropTarget : public LLView public: struct Params : public LLInitParam::Block { + Optional border_visible; // Whether or not to display the border Optional control_name; // Control to change on item drop (Per Account only) Optional label; // Label for the LLTextBox, used when label doesn't dynamically change on drop Optional fill_parent; // Whether or not to fill the direct parent, to have a larger drop target. If true, the next sibling must explicitly define its rect without deltas. Params() - : control_name("control_name", "") + : border_visible("border_visible", true) + , control_name("control_name", "") , label("label", "") , fill_parent("fill_parent", false) { @@ -74,6 +76,7 @@ public: protected: LLUUID mEntityID; private: + class LLViewBorder* mBorder; LLControlVariable* mControl; class LLTextBox* mText; }; diff --git a/indra/newview/lleventpoll.cpp b/indra/newview/lleventpoll.cpp index 75d3c4eda..604f8a7c8 100644 --- a/indra/newview/lleventpoll.cpp +++ b/indra/newview/lleventpoll.cpp @@ -75,6 +75,7 @@ namespace void handleMessage(const LLSD& content); /*virtual*/ void error(U32 status, const std::string& reason); /*virtual*/ void result(const LLSD& content); + /*virtual*/ bool is_event_poll(void) const { return true; } /*virtual*/ AIHTTPTimeoutPolicy const& getHTTPTimeoutPolicy(void) const { return eventPollResponder_timeout; } /*virtual*/ char const* getName(void) const { return "LLEventPollResponder"; } diff --git a/indra/newview/llface.cpp b/indra/newview/llface.cpp index 15e887519..17ac4ef1a 100644 --- a/indra/newview/llface.cpp +++ b/indra/newview/llface.cpp @@ -791,9 +791,9 @@ BOOL LLFace::genVolumeBBoxes(const LLVolume &volume, S32 f, // Catch potential badness from normalization before it happens // - llassert(mat_normal.mMatrix[0].isFinite3() && (mat_normal.mMatrix[0].dot3(mat_normal.mMatrix[0]).getF32() > F_APPROXIMATELY_ZERO)); - llassert(mat_normal.mMatrix[1].isFinite3() && (mat_normal.mMatrix[1].dot3(mat_normal.mMatrix[1]).getF32() > F_APPROXIMATELY_ZERO)); - llassert(mat_normal.mMatrix[2].isFinite3() && (mat_normal.mMatrix[2].dot3(mat_normal.mMatrix[2]).getF32() > F_APPROXIMATELY_ZERO)); + //llassert(mat_normal.mMatrix[0].isFinite3() && (mat_normal.mMatrix[0].dot3(mat_normal.mMatrix[0]).getF32() > F_APPROXIMATELY_ZERO)); + //llassert(mat_normal.mMatrix[1].isFinite3() && (mat_normal.mMatrix[1].dot3(mat_normal.mMatrix[1]).getF32() > F_APPROXIMATELY_ZERO)); + //llassert(mat_normal.mMatrix[2].isFinite3() && (mat_normal.mMatrix[2].dot3(mat_normal.mMatrix[2]).getF32() > F_APPROXIMATELY_ZERO)); mat_normal.mMatrix[0].normalize3fast(); mat_normal.mMatrix[1].normalize3fast(); diff --git a/indra/newview/llfloaterabout.cpp b/indra/newview/llfloaterabout.cpp index 8bf56b58d..944335528 100644 --- a/indra/newview/llfloaterabout.cpp +++ b/indra/newview/llfloaterabout.cpp @@ -187,17 +187,22 @@ LLFloaterAbout::LLFloaterAbout() llformat("%.1f, %.1f, %.1f ", pos.mdV[VX], pos.mdV[VY], pos.mdV[VZ])); support.append(pos_text); - std::string region_text = llformat("in %s located at ", - gAgent.getRegion()->getName().c_str()); - support.append(region_text); + if (const LLViewerRegion* region = gAgent.getRegion()) + { + const LLVector3d& coords(region->getOriginGlobal()); + std::string region_text = llformat("in %s (%.0f, %.0f) located at ", region->getName().c_str(), coords.mdV[VX]/REGION_WIDTH_METERS, coords.mdV[VY]/REGION_WIDTH_METERS); + support.append(region_text); + + std::string buffer; + buffer = region->getHost().getHostName(); + support.append(buffer); + support.append(" ("); + buffer = region->getHost().getString(); + support.append(buffer); + support.append(")"); + } + support.append("\n"); - std::string buffer; - buffer = gAgent.getRegion()->getHost().getHostName(); - support.append(buffer); - support.append(" ("); - buffer = gAgent.getRegion()->getHost().getString(); - support.append(buffer); - support.append(")\n"); support.append(gLastVersionChannel); support.append("\n"); diff --git a/indra/newview/llfloateravatarlist.cpp b/indra/newview/llfloateravatarlist.cpp index 36b7265b6..4ce5e7c18 100644 --- a/indra/newview/llfloateravatarlist.cpp +++ b/indra/newview/llfloateravatarlist.cpp @@ -61,6 +61,7 @@ #include "llviewermenu.h" #include "hippogridmanager.h" +#include "lfsimfeaturehandler.h" // [RLVa:KB] #include "rlvhandler.h" @@ -69,7 +70,7 @@ /** * @brief How long to keep people who are gone in the list and in memory. */ -const F32 DEAD_KEEP_TIME = 10.0f; +const F32 DEAD_KEEP_TIME = 0.5f; extern U32 gFrameCount; @@ -372,7 +373,7 @@ namespace { bool handleEvent(LLPointer event, const LLSD& userdata) { - LLFloaterAvatarList::instance().focusOnPrev(userdata); + LLFloaterAvatarList::instance().focusOnPrev(userdata.asInteger()); return true; } }; @@ -381,7 +382,7 @@ namespace { bool handleEvent(LLPointer event, const LLSD& userdata) { - LLFloaterAvatarList::instance().focusOnNext(userdata); + LLFloaterAvatarList::instance().focusOnNext(userdata.asInteger()); return true; } }; @@ -617,7 +618,7 @@ void LLFloaterAvatarList::updateAvatarList() // Announce position F32 dist = (F32)(position - mypos).magVec(); - entry->setPosition(position, gAgent.getRegion()->pointInRegionGlobal(position), avatarp, dist < 20.0, dist < 96.0); + entry->setPosition(position, gAgent.getRegion()->pointInRegionGlobal(position), avatarp, dist < LFSimFeatureHandler::getInstance()->sayRange(), dist < LFSimFeatureHandler::getInstance()->shoutRange()); // Mark as typing if they are typing if (avatarp && avatarp->isTyping()) entry->setActivity(LLAvatarListEntry::ACTIVITY_TYPING); @@ -747,6 +748,7 @@ void LLFloaterAvatarList::refreshAvatarList() LLVector3d posagent; posagent.setVec(gAgent.getPositionAgent()); LLVector3d simpos = mypos - posagent; + const S32 width(gAgent.getRegion() ? gAgent.getRegion()->getWidth() : 256); BOOST_FOREACH(av_list_t::value_type& entry, mAvatars) { @@ -875,10 +877,10 @@ void LLFloaterAvatarList::refreshAvatarList() } else { - if (distance <= 96.0) + if (distance <= LFSimFeatureHandler::getInstance()->shoutRange()) { snprintf(temp, sizeof(temp), "%.1f", distance); - if (distance > 20.0f) + if (distance > LFSimFeatureHandler::getInstance()->sayRange()) { color = sRadarTextShoutRange; } @@ -904,7 +906,7 @@ void LLFloaterAvatarList::refreshAvatarList() S32 x = (S32)position.mdV[VX]; S32 y = (S32)position.mdV[VY]; - if (x >= 0 && x <= 256 && y >= 0 && y <= 256) + if (x >= 0 && x <= width && y >= 0 && y <= width) { snprintf(temp, sizeof(temp), "%d, %d", x, y); } @@ -915,7 +917,7 @@ void LLFloaterAvatarList::refreshAvatarList() { strcat(temp, "S"); } - else if (y > 256) + else if (y > width) { strcat(temp, "N"); } @@ -923,7 +925,7 @@ void LLFloaterAvatarList::refreshAvatarList() { strcat(temp, "W"); } - else if (x > 256) + else if (x > width) { strcat(temp, "E"); } @@ -1296,7 +1298,7 @@ void LLFloaterAvatarList::onClickGetKey() if (NULL == item) return; - gViewerWindow->mWindow->copyTextToClipboard(utf8str_to_wstring(item->getUUID().asString())); + gViewerWindow->getWindow()->copyTextToClipboard(utf8str_to_wstring(item->getUUID().asString())); } void LLFloaterAvatarList::sendKeys() diff --git a/indra/newview/llfloaterblacklist.cpp b/indra/newview/llfloaterblacklist.cpp index 400094c3c..dd80e2138 100644 --- a/indra/newview/llfloaterblacklist.cpp +++ b/indra/newview/llfloaterblacklist.cpp @@ -198,7 +198,7 @@ void LLFloaterBlacklist::onClickCopyUUID(void* user_data) { LLFloaterBlacklist* floaterp = (LLFloaterBlacklist*)user_data; LLScrollListCtrl* list = floaterp->getChild("file_list"); - gViewerWindow->mWindow->copyTextToClipboard(utf8str_to_wstring(list->getFirstSelected()->getColumn(0)->getValue().asString())); + gViewerWindow->getWindow()->copyTextToClipboard(utf8str_to_wstring(list->getFirstSelected()->getColumn(0)->getValue().asString())); } // static void LLFloaterBlacklist::onClickRemove(void* user_data) diff --git a/indra/newview/llfloaterbump.cpp b/indra/newview/llfloaterbump.cpp index 60a842abc..29b99c1f9 100644 --- a/indra/newview/llfloaterbump.cpp +++ b/indra/newview/llfloaterbump.cpp @@ -3,31 +3,25 @@ * @brief Floater showing recent bumps, hits with objects, pushes, etc. * @author Cory Ondrejka, James Cook * - * $LicenseInfo:firstyear=2003&license=viewergpl$ - * - * Copyright (c) 2003-2009, Linden Research, Inc. - * + * $LicenseInfo:firstyear=2003&license=viewerlgpl$ * Second Life Viewer Source Code - * The source code in this file ("Source Code") is provided by Linden Lab - * to you under the terms of the GNU General Public License, version 2.0 - * ("GPL"), unless you have obtained a separate licensing agreement - * ("Other License"), formally executed by you and Linden Lab. Terms of - * the GPL can be found in doc/GPL-license.txt in this distribution, or - * online at http://secondlifegrid.net/programs/open_source/licensing/gplv2 + * Copyright (C) 2010, Linden Research, Inc. * - * There are special exceptions to the terms and conditions of the GPL as - * it is applied to this Source Code. View the full text of the exception - * in the file doc/FLOSS-exception.txt in this software distribution, or - * online at - * http://secondlifegrid.net/programs/open_source/licensing/flossexception + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; + * version 2.1 of the License only. * - * By copying, modifying or distributing this software, you acknowledge - * that you have read and understood your obligations described above, - * and agree to abide by those obligations. + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. * - * ALL LINDEN LAB SOURCE CODE IS PROVIDED "AS IS." LINDEN LAB MAKES NO - * WARRANTIES, EXPRESS, IMPLIED OR OTHERWISE, REGARDING ITS ACCURACY, - * COMPLETENESS OR PERFORMANCE. + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + * + * Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA * $/LicenseInfo$ */ @@ -44,7 +38,7 @@ ///---------------------------------------------------------------------------- /// Local function declarations, constants, enums, and typedefs ///---------------------------------------------------------------------------- -LLFloaterBump* LLFloaterBump::sInstance = NULL; +static LLFloaterBump* sInstance = NULL; ///---------------------------------------------------------------------------- /// Class LLFloaterBump @@ -54,9 +48,6 @@ LLFloaterBump* LLFloaterBump::sInstance = NULL; LLFloaterBump::LLFloaterBump() : LLFloater() { - sInstance = this; - - LLUICtrlFactory::getInstance()->buildFloater(this, "floater_bumps.xml"); } @@ -67,25 +58,28 @@ LLFloaterBump::~LLFloaterBump() } // static -void LLFloaterBump::show(void *contents) +void LLFloaterBump::show(void *) { - if (gNoRender) - { - return; - } - if (!sInstance) { sInstance = new LLFloaterBump(); + LLUICtrlFactory::getInstance()->buildFloater(sInstance, "floater_bumps.xml", NULL, false); } - - LLScrollListCtrl* list = sInstance->getChild("bump_list"); - if (!list) return; + + sInstance->open(); +} + +// virtual +void LLFloaterBump::onOpen() +{ + LLScrollListCtrl* list = getChild("bump_list"); + if (!list) + return; list->deleteAllItems(); if (gMeanCollisionList.empty()) { - std::string none_detected = sInstance->getString("none_detected"); + std::string none_detected = getString("none_detected"); LLSD row; row["columns"][0]["value"] = none_detected; row["columns"][0]["font"] = "SansSerifBold"; @@ -97,33 +91,24 @@ void LLFloaterBump::show(void *contents) iter != gMeanCollisionList.end(); ++iter) { LLMeanCollisionData *mcd = *iter; - LLFloaterBump::add(list, mcd); + add(list, mcd); } } - - sInstance->open(); /*Flawfinder: ignore*/ } void LLFloaterBump::add(LLScrollListCtrl* list, LLMeanCollisionData* mcd) { - if (!sInstance) - { - new LLFloaterBump(); - } - if (mcd->mFullName.empty() || list->getItemCount() >= 20) { return; } // There's only one internal tm buffer. - struct tm* timep; - // Convert to Pacific, based on server's opinion of whether // it's daylight savings time there. - timep = utc_to_pacific_time(mcd->mTime, gPacificDaylightTime); + tm* timep = utc_to_pacific_time(mcd->mTime, gPacificDaylightTime); - std::string time = llformat("[%d:%02d]", timep->tm_hour, timep->tm_min); + std::string timeStr = llformat("[%d:%02d]", timep->tm_hour, timep->tm_min); std::string action; switch(mcd->mType) @@ -150,8 +135,8 @@ void LLFloaterBump::add(LLScrollListCtrl* list, LLMeanCollisionData* mcd) } // All above action strings are in XML file - LLUIString text = sInstance->getString(action); - text.setArg("[TIME]", time); + LLUIString text = getString(action); + text.setArg("[TIME]", timeStr); text.setArg("[NAME]", mcd->mFullName); LLSD row; diff --git a/indra/newview/llfloaterbump.h b/indra/newview/llfloaterbump.h index eb15671d4..664e084f6 100644 --- a/indra/newview/llfloaterbump.h +++ b/indra/newview/llfloaterbump.h @@ -3,31 +3,25 @@ * @brief Floater showing recent bumps, hits with objects, pushes, etc. * @author Cory Ondrejka, James Cook * - * $LicenseInfo:firstyear=2003&license=viewergpl$ - * - * Copyright (c) 2003-2009, Linden Research, Inc. - * + * $LicenseInfo:firstyear=2003&license=viewerlgpl$ * Second Life Viewer Source Code - * The source code in this file ("Source Code") is provided by Linden Lab - * to you under the terms of the GNU General Public License, version 2.0 - * ("GPL"), unless you have obtained a separate licensing agreement - * ("Other License"), formally executed by you and Linden Lab. Terms of - * the GPL can be found in doc/GPL-license.txt in this distribution, or - * online at http://secondlifegrid.net/programs/open_source/licensing/gplv2 + * Copyright (C) 2010, Linden Research, Inc. * - * There are special exceptions to the terms and conditions of the GPL as - * it is applied to this Source Code. View the full text of the exception - * in the file doc/FLOSS-exception.txt in this software distribution, or - * online at - * http://secondlifegrid.net/programs/open_source/licensing/flossexception + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; + * version 2.1 of the License only. * - * By copying, modifying or distributing this software, you acknowledge - * that you have read and understood your obligations described above, - * and agree to abide by those obligations. + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. * - * ALL LINDEN LAB SOURCE CODE IS PROVIDED "AS IS." LINDEN LAB MAKES NO - * WARRANTIES, EXPRESS, IMPLIED OR OTHERWISE, REGARDING ITS ACCURACY, - * COMPLETENESS OR PERFORMANCE. + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + * + * Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA * $/LicenseInfo$ */ @@ -42,16 +36,15 @@ class LLScrollListCtrl; class LLFloaterBump : public LLFloater { +protected: + void add(LLScrollListCtrl* list, LLMeanCollisionData *mcd); public: static void show(void *); + /*virtual*/ void onOpen(); private: LLFloaterBump(); virtual ~LLFloaterBump(); - static void add(LLScrollListCtrl* list, LLMeanCollisionData *mcd); - -private: - static LLFloaterBump* sInstance; }; #endif diff --git a/indra/newview/llfloaterchat.cpp b/indra/newview/llfloaterchat.cpp index 22c198601..eaa563278 100644 --- a/indra/newview/llfloaterchat.cpp +++ b/indra/newview/llfloaterchat.cpp @@ -651,15 +651,12 @@ void LLFloaterChat::onClickToggleActiveSpeakers(void* userdata) //self->childSetVisible("active_speakers_panel", !self->childIsVisible("active_speakers_panel")); } +void show_log_browser(const std::string& name = "chat", const std::string& id = "chat"); + // static void LLFloaterChat::onClickChatHistoryOpen(void* userdata) { - char command[256]; - - sprintf(command, "\"%s%s%s\"", gDirUtilp->getPerAccountChatLogsDir().c_str(), gDirUtilp->getDirDelimiter().c_str(), "chat.txt"); - gViewerWindow->getWindow()->ShellEx(command); - - llinfos << command << llendl; + show_log_browser(); } //static diff --git a/indra/newview/llfloaterdirectory.cpp b/indra/newview/llfloaterdirectory.cpp index 92daa4e2b..64f721dd3 100644 --- a/indra/newview/llfloaterdirectory.cpp +++ b/indra/newview/llfloaterdirectory.cpp @@ -161,7 +161,9 @@ private: std::string mMarketplaceURL; }; -static void* createWebPanel(void* data) +namespace { + +void* createWebPanel(void* data) { struct LLPanelDirWeb : public LLPanelDirFind { @@ -175,6 +177,8 @@ static void* createWebPanel(void* data) return new LLPanelDirWeb(static_cast(data)); } +} // namespace + LLFloaterDirectory* LLFloaterDirectory::sInstance = NULL; //static S32 LLFloaterDirectory::sOldSearchCount = 0; // debug diff --git a/indra/newview/llfloatermodelpreview.cpp b/indra/newview/llfloatermodelpreview.cpp index 6c22653a3..3520b56e1 100644 --- a/indra/newview/llfloatermodelpreview.cpp +++ b/indra/newview/llfloatermodelpreview.cpp @@ -32,38 +32,10 @@ #include "llviewerprecompiledheaders.h" -#if LL_MSVC -#pragma warning (disable : 4018) -#pragma warning (push) -#pragma warning (disable : 4068) -#pragma warning (disable : 4263) -#pragma warning (disable : 4264) -#endif -#pragma GCC diagnostic ignored "-Woverloaded-virtual" #include "dae.h" -//#include "dom.h" -#include "dom/domAsset.h" -#include "dom/domBind_material.h" #include "dom/domCOLLADA.h" #include "dom/domConstants.h" -#include "dom/domController.h" -#include "dom/domEffect.h" -#include "dom/domGeometry.h" -#include "dom/domInstance_geometry.h" -#include "dom/domInstance_material.h" -#include "dom/domInstance_node.h" -#include "dom/domInstance_effect.h" -#include "dom/domMaterial.h" -#include "dom/domMatrix.h" -#include "dom/domNode.h" #include "dom/domProfile_COMMON.h" -#include "dom/domRotate.h" -#include "dom/domScale.h" -#include "dom/domTranslate.h" -#include "dom/domVisual_scene.h" -#if LL_MSVC -#pragma warning (pop) -#endif #include "llfloatermodelpreview.h" @@ -108,6 +80,7 @@ #include #include "hippogridmanager.h" +#include "hippolimits.h" const S32 SLM_SUPPORTED_VERSION = 3; @@ -268,7 +241,7 @@ bool ll_is_degenerate(const LLVector4a& a, const LLVector4a& b, const LLVector4a bool validate_face(const LLVolumeFace& face) { - for (U32 i = 0; i < face.mNumIndices; ++i) + for (S32 i = 0; i < face.mNumIndices; ++i) { if (face.mIndices[i] >= face.mNumVertices) { @@ -951,7 +924,7 @@ void LLFloaterModelPreview::onPhysicsStageExecute(LLUICtrl* ctrl, void* data) if (sInstance->mModelPreview) { - for (S32 i = 0; i < sInstance->mModelPreview->mModel[LLModel::LOD_PHYSICS].size(); ++i) + for (U32 i = 0; i < sInstance->mModelPreview->mModel[LLModel::LOD_PHYSICS].size(); ++i) { LLModel* mdl = sInstance->mModelPreview->mModel[LLModel::LOD_PHYSICS][i]; DecompRequest* request = new DecompRequest(stage, mdl); @@ -1501,7 +1474,7 @@ bool LLModelLoader::doLoadModel() //1. Basic validity check on controller U32 controllerCount = (int) db->getElementCount(NULL, "controller"); bool result = false; - for (int i = 0; i < controllerCount; ++i) + for (U32 i = 0; i < controllerCount; ++i) { domController* pController = NULL; db->getElement((daeElement**) &pController, i , NULL, "controller"); @@ -2108,7 +2081,7 @@ bool LLModelLoader::loadFromSLM(const std::string& filename) for (S32 lod = 0; lod < LLModel::NUM_LODS; ++lod) { - for (U32 i = 0; i < mesh.size(); ++i) + for (int i = 0; i < mesh.size(); ++i) { std::stringstream str(mesh[i].asString()); LLPointer loaded_model = new LLModel(volume_params, (F32) lod); @@ -2143,7 +2116,7 @@ bool LLModelLoader::loadFromSLM(const std::string& filename) LLSD& instance = data["instance"]; - for (U32 i = 0; i < instance.size(); ++i) + for (int i = 0; i < instance.size(); ++i) { //deserialize instance list instance_list.push_back(LLModelInstance(instance[i])); @@ -2873,7 +2846,7 @@ void LLModelLoader::processElement(daeElement* element, bool& badElement) std::map LLModelLoader::getMaterials(LLModel* model, domInstance_geometry* instance_geo) { std::map materials; - for (int i = 0; i < model->mMaterialList.size(); i++) + for (U32 i = 0; i < model->mMaterialList.size(); i++) { LLImportMaterial import_material; @@ -2885,7 +2858,7 @@ std::map LLModelLoader::getMaterials(LLModel* mod if (technique) { daeTArray< daeSmartRef > inst_materials = technique->getChildrenByType(); - for (int j = 0; j < inst_materials.getCount(); j++) + for (U32 j = 0; j < inst_materials.getCount(); j++) { std::string symbol(inst_materials[j]->getSymbol()); @@ -2939,7 +2912,7 @@ LLImportMaterial LLModelLoader::profileToMaterial(domProfile_COMMON* material) if (texture) { domCommon_newparam_type_Array newparams = material->getNewparam_array(); - for (S32 i = 0; i < newparams.getCount(); i++) + for (U32 i = 0; i < newparams.getCount(); i++) { domFx_surface_common* surface = newparams[i]->getSurface(); if (surface) @@ -3331,7 +3304,7 @@ void LLModelPreview::rebuildUploadData() base_model->mMetric = metric; } - S32 idx = 0; + U32 idx = 0; for (idx = 0; idx < mBaseModel.size(); ++idx) { //find reference instance for this model if (mBaseModel[idx] == base_model) @@ -3359,6 +3332,8 @@ void LLModelPreview::rebuildUploadData() } } + + const F32 DEFAULT_MAX_PRIM_SCALE(gHippoLimits->getMaxPrimScale()); F32 max_import_scale = (DEFAULT_MAX_PRIM_SCALE-0.1f)/max_scale; F32 max_axis = llmax(mPreviewScale.mV[0], mPreviewScale.mV[1]); @@ -3366,7 +3341,8 @@ void LLModelPreview::rebuildUploadData() max_axis *= 2.f; //clamp scale so that total imported model bounding box is smaller than 240m on a side - max_import_scale = llmin(max_import_scale, 240.f/max_axis); + if (gHippoGridManager->getConnectedGrid()->isSecondLife()) // on SecondLife only + max_import_scale = llmin(max_import_scale, 240.f/max_axis); scale_spinner->setMaxValue(max_import_scale); @@ -3651,7 +3627,7 @@ void LLModelPreview::loadModelCallback(S32 lod) list_iter->mModel = list_iter->mLOD[lod]; //add current model to current LoD's model list (LLModel::mLocalID makes a good vector index) - S32 idx = list_iter->mModel->mLocalID; + U32 idx = list_iter->mModel->mLocalID; if (mModel[lod].size() <= idx) { //stretch model list to fit model at given index @@ -5123,7 +5099,7 @@ BOOL LLModelPreview::render() if (textures) { - int materialCnt = instance.mModel->mMaterialList.size(); + U32 materialCnt = instance.mModel->mMaterialList.size(); if (i < materialCnt) { const std::string& binding = instance.mModel->mMaterialList[i]; @@ -5333,7 +5309,7 @@ BOOL LLModelPreview::render() LLStrider idx; buffer->getIndexStrider(idx, 0); - for (U32 i = 0; i < buffer->getNumIndices(); i += 3) + for (S32 i = 0; i < buffer->getNumIndices(); i += 3) { LLVector4a v1; v1.setMul(pos[*idx++], scale); LLVector4a v2; v2.setMul(pos[*idx++], scale); @@ -5417,7 +5393,7 @@ BOOL LLModelPreview::render() } } - for (U32 j = 0; j < buffer->getNumVerts(); ++j) + for (S32 j = 0; j < buffer->getNumVerts(); ++j) { LLMatrix4 final_mat; final_mat.mMatrix[0][0] = final_mat.mMatrix[1][1] = final_mat.mMatrix[2][2] = final_mat.mMatrix[3][3] = 0.f; diff --git a/indra/newview/llfloaterpreference.cpp b/indra/newview/llfloaterpreference.cpp index dbbd06f76..b6d3d5e81 100644 --- a/indra/newview/llfloaterpreference.cpp +++ b/indra/newview/llfloaterpreference.cpp @@ -461,7 +461,8 @@ void LLFloaterPreference::onBtnOK( void* userdata ) std::string crash_settings_filename = gDirUtilp->getExpandedFilename(LL_PATH_USER_SETTINGS, CRASH_SETTINGS_FILE); // save all settings, even if equals defaults - gCrashSettings.saveToFile(crash_settings_filename, FALSE); + // Singu Note: crash settings no longer separate + // gCrashSettings.saveToFile(crash_settings_filename, FALSE); } else { diff --git a/indra/newview/llfloaterregioninfo.cpp b/indra/newview/llfloaterregioninfo.cpp index d8e7fadd4..da8aaedd4 100644 --- a/indra/newview/llfloaterregioninfo.cpp +++ b/indra/newview/llfloaterregioninfo.cpp @@ -86,6 +86,7 @@ #include "llvlcomposition.h" #include "llwaterparammanager.h" #include "llagentui.h" +#include "hippogridmanager.h" // [RLVa:KB] #include "rlvhandler.h" // [/RLVa:KB] @@ -1300,8 +1301,8 @@ BOOL LLPanelRegionTerrainInfo::sendUpdate() // ======================================= // Assemble and send texturedetail message - // Make sure user hasn't chosen wacky textures. - if (!validateTextureSizes()) + // Make sure user hasn't chosen wacky textures on sl grids. + if (gHippoGridManager->getConnectedGrid()->isSecondLife() && !validateTextureSizes()) { return FALSE; } diff --git a/indra/newview/llfloaterscriptlimits.cpp b/indra/newview/llfloaterscriptlimits.cpp index 84c2ff953..e7bf31312 100644 --- a/indra/newview/llfloaterscriptlimits.cpp +++ b/indra/newview/llfloaterscriptlimits.cpp @@ -208,7 +208,7 @@ void fetchScriptLimitsRegionInfoResponder::result(const LLSD& content) } else { - LLFloaterScriptLimits* instance = LLFloaterScriptLimits::getInstance(); + LLFloaterScriptLimits* instance = LLFloaterScriptLimits::findInstance(); if(!instance) { llwarns << "Failed to get llfloaterscriptlimits instance" << llendl; @@ -282,7 +282,7 @@ void fetchScriptLimitsRegionSummaryResponder::result(const LLSD& content_ref) #endif - LLFloaterScriptLimits* instance = LLFloaterScriptLimits::getInstance(); + LLFloaterScriptLimits* instance = LLFloaterScriptLimits::findInstance(); if(!instance) { llwarns << "Failed to get llfloaterscriptlimits instance" << llendl; @@ -390,7 +390,7 @@ result (map) #endif - LLFloaterScriptLimits* instance = LLFloaterScriptLimits::getInstance(); + LLFloaterScriptLimits* instance = LLFloaterScriptLimits::findInstance(); if(!instance) { @@ -478,7 +478,7 @@ void fetchScriptLimitsAttachmentInfoResponder::result(const LLSD& content_ref) #endif - LLFloaterScriptLimits* instance = LLFloaterScriptLimits::getInstance(); + LLFloaterScriptLimits* instance = LLFloaterScriptLimits::findInstance(); if(!instance) { @@ -961,7 +961,7 @@ void LLPanelScriptLimitsRegionMemory::clearList() // static void LLPanelScriptLimitsRegionMemory::onClickRefresh(void* userdata) { - LLFloaterScriptLimits* instance = LLFloaterScriptLimits::getInstance(); + LLFloaterScriptLimits* instance = LLFloaterScriptLimits::findInstance(); if(instance) { LLTabContainer* tab = instance->getChild("scriptlimits_panels"); @@ -1016,7 +1016,7 @@ void LLPanelScriptLimitsRegionMemory::showBeacon() // static void LLPanelScriptLimitsRegionMemory::onClickHighlight(void* userdata) { - LLFloaterScriptLimits* instance = LLFloaterScriptLimits::getInstance(); + LLFloaterScriptLimits* instance = LLFloaterScriptLimits::findInstance(); if(instance) { LLTabContainer* tab = instance->getChild("scriptlimits_panels"); @@ -1121,7 +1121,7 @@ void LLPanelScriptLimitsRegionMemory::returnObjects() // static void LLPanelScriptLimitsRegionMemory::onClickReturn(void* userdata) { - LLFloaterScriptLimits* instance = LLFloaterScriptLimits::getInstance(); + LLFloaterScriptLimits* instance = LLFloaterScriptLimits::findInstance(); if(instance) { LLTabContainer* tab = instance->getChild("scriptlimits_panels"); @@ -1319,7 +1319,7 @@ void LLPanelScriptLimitsAttachment::setAttachmentSummary(LLSD content) // static void LLPanelScriptLimitsAttachment::onClickRefresh(void* userdata) { - LLFloaterScriptLimits* instance = LLFloaterScriptLimits::getInstance(); + LLFloaterScriptLimits* instance = LLFloaterScriptLimits::findInstance(); if(instance) { LLTabContainer* tab = instance->getChild("scriptlimits_panels"); diff --git a/indra/newview/llfloaterteleporthistory.cpp b/indra/newview/llfloaterteleporthistory.cpp index 27ad58de6..b3a6bad0c 100644 --- a/indra/newview/llfloaterteleporthistory.cpp +++ b/indra/newview/llfloaterteleporthistory.cpp @@ -351,5 +351,5 @@ void LLFloaterTeleportHistory::onCopySLURL(void* data) // get SLURL of the selected entry and copy it to the clipboard std::string SLURL = self->mPlacesList->getFirstSelected()->getColumn(LIST_SLURL)->getValue().asString(); - gViewerWindow->mWindow->copyTextToClipboard(utf8str_to_wstring(SLURL)); + gViewerWindow->getWindow()->copyTextToClipboard(utf8str_to_wstring(SLURL)); } diff --git a/indra/newview/llfloatertools.cpp b/indra/newview/llfloatertools.cpp index d63fde073..99863e103 100644 --- a/indra/newview/llfloatertools.cpp +++ b/indra/newview/llfloatertools.cpp @@ -2003,7 +2003,7 @@ void LLFloaterTools::updateTreeGrassCombo(bool visible) } mComboTreesGrass->removeall(); - mComboTreesGrass->add("Random"); + mComboTreesGrass->add(getString("Random")); int select = 0, i = 0; diff --git a/indra/newview/llfloatertos.cpp b/indra/newview/llfloatertos.cpp index 8552b881a..eb70ca59f 100644 --- a/indra/newview/llfloatertos.cpp +++ b/indra/newview/llfloatertos.cpp @@ -131,7 +131,7 @@ class LLIamHere : public LLHTTPClient::ResponderWithResult }; /*virtual*/ AIHTTPTimeoutPolicy const& getHTTPTimeoutPolicy(void) const { return iamHere_timeout; } - /*virtual*/ bool redirect_status_ok(void) const { return true; } + /*virtual*/ bool pass_redirect_status(void) const { return true; } /*virtual*/ char const* getName(void) const { return "LLIamHere"; } }; diff --git a/indra/newview/llfloaterworldmap.cpp b/indra/newview/llfloaterworldmap.cpp index fcaaa2f42..1d33194a0 100644 --- a/indra/newview/llfloaterworldmap.cpp +++ b/indra/newview/llfloaterworldmap.cpp @@ -700,8 +700,14 @@ void LLFloaterWorldMap::trackLocation(const LLVector3d& pos_global) } std::string sim_name = sim_info->getName(); - F32 region_x = (F32)fmod( pos_global.mdV[VX], (F64)REGION_WIDTH_METERS ); - F32 region_y = (F32)fmod( pos_global.mdV[VY], (F64)REGION_WIDTH_METERS ); +// Aurora-sim var region teleports + //F32 region_x = (F32)fmod( pos_global.mdV[VX], (F64)REGION_WIDTH_METERS ); + //F32 region_y = (F32)fmod( pos_global.mdV[VY], (F64)REGION_WIDTH_METERS ); + U32 locX, locY; + from_region_handle(sim_info->getHandle(), &locX, &locY); + F32 region_x = pos_global.mdV[VX] - locX; + F32 region_y = pos_global.mdV[VY] - locY; +// std::string full_name = llformat("%s (%d, %d, %d)", sim_name.c_str(), llround(region_x), @@ -754,17 +760,27 @@ void LLFloaterWorldMap::updateTeleportCoordsDisplay( const LLVector3d& pos ) { // if we're going to update their value, we should also enable them enableTeleportCoordsDisplay( true ); - + // convert global specified position to a local one F32 region_local_x = (F32)fmod( pos.mdV[VX], (F64)REGION_WIDTH_METERS ); F32 region_local_y = (F32)fmod( pos.mdV[VY], (F64)REGION_WIDTH_METERS ); - F32 region_local_z = (F32)llclamp( pos.mdV[VZ], 0.0, (F64)REGION_HEIGHT_METERS ); + F32 region_local_z = (F32)llclamp( pos.mdV[VZ], 0.0, 8192.0/*(F64)REGION_HEIGHT_METERS*/ ); + + LLSimInfo* sim_info = LLWorldMap::getInstance()->simInfoFromPosGlobal(pos); + if (sim_info) // Singu Note: Aurora var region support + { + U32 locX, locY; + from_region_handle(sim_info->getHandle(), &locX, &locY); + region_local_x = pos.mdV[VX] - locX; + region_local_y = pos.mdV[VY] - locY; + region_local_z = (F32)pos.mdV[VZ]; // write in the values childSetValue("spin x", region_local_x ); childSetValue("spin y", region_local_y ); childSetValue("spin z", region_local_z ); } +} void LLFloaterWorldMap::updateLocation() { @@ -812,7 +828,10 @@ void LLFloaterWorldMap::updateLocation() // Figure out where user is // Set the current SLURL - mSLURL = LLSLURL(agent_sim_name, gAgent.getPositionGlobal()); +// Aurora-sim var region teleports + //mSLURL = LLSLURL(agent_sim_name, gAgent.getPositionGlobal()); + mSLURL = LLSLURL(agent_sim_name, gAgent.getPositionAgent()); +// } } @@ -856,6 +875,11 @@ void LLFloaterWorldMap::updateLocation() // [/RLVa:KB] // if ( gotSimName ) { + // Singu Note: Var region support for SLURLs + const LLSimInfo* sim = LLWorldMap::getInstance()->simInfoFromPosGlobal(pos_global); + const F64 size(sim ? sim->getSizeX() : 256); + pos_global[0] = fmod(pos_global[0], size); + pos_global[1] = fmod(pos_global[1], size); mSLURL = LLSLURL(sim_name, pos_global); } else @@ -868,7 +892,7 @@ void LLFloaterWorldMap::updateLocation() void LLFloaterWorldMap::trackURL(const std::string& region_name, S32 x_coord, S32 y_coord, S32 z_coord) { LLSimInfo* sim_info = LLWorldMap::getInstance()->simInfoFromName(region_name); - z_coord = llclamp(z_coord, 0, 4096); + z_coord = llclamp(z_coord, 0, 8192/*4096*/); if (sim_info) { LLVector3 local_pos; diff --git a/indra/newview/llgivemoney.cpp b/indra/newview/llgivemoney.cpp index 6816c378a..bd9243827 100644 --- a/indra/newview/llgivemoney.cpp +++ b/indra/newview/llgivemoney.cpp @@ -136,6 +136,8 @@ LLFloaterPay::LLFloaterPay(const std::string& name, // Destroys the object LLFloaterPay::~LLFloaterPay() { + // In case this floater is currently waiting for a reply. + gMessageSystem->setHandlerFuncFast(_PREHASH_PayPriceReply, 0, 0); } // static diff --git a/indra/newview/llglsandbox.cpp b/indra/newview/llglsandbox.cpp index b40e3d471..3da03923c 100644 --- a/indra/newview/llglsandbox.cpp +++ b/indra/newview/llglsandbox.cpp @@ -297,7 +297,10 @@ void LLWind::renderVectors() S32 i,j; F32 x,y; - F32 region_width_meters = LLWorld::getInstance()->getRegionWidthInMeters(); +// Aurora Sim + //F32 region_width_meters = LLWorld::getInstance()->getRegionWidthInMeters(); + F32 region_width_meters = gAgent.getRegion()->getWidth(); +// Aurora Sim gGL.getTexUnit(0)->unbind(LLTexUnit::TT_TEXTURE); gGL.pushMatrix(); @@ -505,7 +508,10 @@ void LLViewerParcelMgr::renderOneSegment(F32 x1, F32 y1, F32 x2, F32 y2, F32 hei return; // HACK: At edge of last region of world, we need to make sure the region // resolves correctly so we can get a height value. - const F32 BORDER = REGION_WIDTH_METERS - 0.1f; +// Aurora Sim + //const F32 BORDER = REGION_WIDTH_METERS - 0.1f; + const F32 BORDER = regionp->getWidth() - 0.1f; +// Aurora Sim F32 clamped_x1 = x1; F32 clamped_y1 = y1; diff --git a/indra/newview/llgroupmgr.cpp b/indra/newview/llgroupmgr.cpp index 70eddbcdc..3bd9c3715 100644 --- a/indra/newview/llgroupmgr.cpp +++ b/indra/newview/llgroupmgr.cpp @@ -926,13 +926,18 @@ LLGroupMgrGroupData* LLGroupMgr::getGroupData(const LLUUID& id) // so that the sorter can sort by year before month before day. static void formatDateString(std::string &date_string) { - tm t; - if (sscanf(date_string.c_str(), "%u/%u/%u", &t.tm_mon, &t.tm_mday, &t.tm_year) == 3 && t.tm_year > 1900) + using namespace boost; + cmatch result; + const regex expression("([0-9]{1,2})/([0-9]{1,2})/([0-9]{4})"); + if (regex_match(date_string.c_str(), result, expression)) { - t.tm_year -= 1900; - t.tm_mon--; - t.tm_hour = t.tm_min = t.tm_sec = 0; - timeStructToFormattedString(&t, gSavedSettings.getString("ShortDateFormat"), date_string); + // convert matches to integers so that we can pad them with zeroes on Linux + S32 year = boost::lexical_cast(result[3]); + S32 month = boost::lexical_cast(result[1]); + S32 day = boost::lexical_cast(result[2]); + + // ISO 8601 date format + date_string = llformat("%04d-%02d-%02dT00:00:00Z", year, month, day); } } diff --git a/indra/newview/llimpanel.cpp b/indra/newview/llimpanel.cpp index ef503ff5c..2633f830c 100644 --- a/indra/newview/llimpanel.cpp +++ b/indra/newview/llimpanel.cpp @@ -33,50 +33,32 @@ #include "llimpanel.h" -#include "indra_constants.h" -#include "llfocusmgr.h" -#include "llfontgl.h" -#include "llrect.h" -#include "llerror.h" -#include "llstring.h" -#include "message.h" -#include "lltextbox.h" -#include "llnotificationsutil.h" - +#include "ascentkeyword.h" #include "llagent.h" #include "llavataractions.h" +#include "llavatarnamecache.h" #include "llbutton.h" -#include "llcallingcard.h" -#include "llchat.h" -#include "llconsole.h" -#include "llgroupactions.h" +#include "llcombobox.h" #include "llfloaterchat.h" +#include "llfloaterinventory.h" +#include "llfloaterwebcontent.h" // For web browser display of logs +#include "llgroupactions.h" +#include "llhttpclient.h" #include "llimview.h" #include "llinventory.h" #include "llinventoryfunctions.h" -#include "llfloaterinventory.h" -#include "llcheckboxctrl.h" -#include "llkeyboard.h" #include "lllineeditor.h" -#include "llnotify.h" +#include "llmutelist.h" +#include "llnotificationsutil.h" #include "llparticipantlist.h" -#include "llresmgr.h" #include "llspeakers.h" +#include "llstylemap.h" #include "lltrans.h" -#include "lltabcontainer.h" -#include "llviewertexteditor.h" -#include "llviewermessage.h" -#include "llviewerstats.h" -#include "llviewercontrol.h" #include "lluictrlfactory.h" +#include "llviewertexteditor.h" +#include "llviewerstats.h" #include "llviewerwindow.h" #include "llvoicechannel.h" -#include "lllogchat.h" -#include "llweb.h" -#include "llhttpclient.h" -#include "llmutelist.h" -#include "llstylemap.h" -#include "ascentkeyword.h" #include "boost/algorithm/string.hpp" @@ -234,23 +216,17 @@ bool send_start_session_messages( other_participant_id, dialog); - switch(dialog) - { - case IM_SESSION_GROUP_START: - gMessageSystem->addBinaryDataFast( - _PREHASH_BinaryBucket, - EMPTY_BINARY_BUCKET, - EMPTY_BINARY_BUCKET_SIZE); - break; - default: - break; - } + gMessageSystem->addBinaryDataFast( + _PREHASH_BinaryBucket, + EMPTY_BINARY_BUCKET, + EMPTY_BINARY_BUCKET_SIZE); gAgent.sendReliableMessage(); return true; } else if ( dialog == IM_SESSION_CONFERENCE_START ) { + if (ids.empty()) return true; LLSD agents; for (int i = 0; i < (S32) ids.size(); i++) { @@ -259,10 +235,9 @@ bool send_start_session_messages( //we have a new way of starting conference calls now LLViewerRegion* region = gAgent.getRegion(); - if (region) + std::string url(region ? region->getCapability("ChatSessionRequest") : ""); + if (!url.empty()) { - std::string url = region->getCapability( - "ChatSessionRequest"); LLSD data; data["method"] = "start conference"; data["session-id"] = temp_session_id; @@ -296,150 +271,85 @@ bool send_start_session_messages( // LLFloaterIMPanel // LLFloaterIMPanel::LLFloaterIMPanel( - const std::string& session_label, + const std::string& log_label, const LLUUID& session_id, const LLUUID& other_participant_id, - EInstantMessage dialog) : - LLFloater(session_label, LLRect(), session_label), + const EInstantMessage& dialog, + const LLDynamicArray& ids) : + LLFloater(log_label, LLRect(), log_label), + mStartCallOnInitialize(false), mInputEditor(NULL), mHistoryEditor(NULL), - mSessionUUID(session_id), - mVoiceChannel(NULL), - mSessionInitialized(FALSE), + mSessionInitialized(false), mSessionStartMsgPos(0), + mSessionType(P2P_SESSION), + mSessionUUID(session_id), + mLogLabel(log_label), + mQueuedMsgsForInit(), mOtherParticipantUUID(other_participant_id), mDialog(dialog), - mTyping(FALSE), - mOtherTyping(FALSE), + mTyping(false), mTypingLineStartIndex(0), - mSentTypingState(TRUE), + mOtherTyping(false), + mOtherTypingName(), mNumUnreadMessages(0), - mShowSpeakersOnConnect(TRUE), - mStartCallOnInitialize(false), - mTextIMPossible(TRUE), - mProfileButtonEnabled(TRUE), - mCallBackEnabled(TRUE), + mSentTypingState(true), + mShowSpeakersOnConnect(true), + mDing(false), + mRPMode(false), + mTextIMPossible(true), + mCallBackEnabled(true), mSpeakers(NULL), mSpeakerPanel(NULL), - mFirstKeystrokeTimer(), - mLastKeystrokeTimer() -{ - if(mOtherParticipantUUID.isNull()) - { - llwarns << "Other participant is NULL" << llendl; - } - - init(session_label); -} - -LLFloaterIMPanel::LLFloaterIMPanel( - const std::string& session_label, - const LLUUID& session_id, - const LLUUID& other_participant_id, - const LLDynamicArray& ids, - EInstantMessage dialog) : - LLFloater(session_label, LLRect(), session_label), - mInputEditor(NULL), - mHistoryEditor(NULL), - mSessionUUID(session_id), mVoiceChannel(NULL), - mSessionInitialized(FALSE), - mSessionStartMsgPos(0), - mOtherParticipantUUID(other_participant_id), - mDialog(dialog), - mTyping(FALSE), - mOtherTyping(FALSE), - mTypingLineStartIndex(0), - mSentTypingState(TRUE), - mShowSpeakersOnConnect(TRUE), - mStartCallOnInitialize(false), - mTextIMPossible(TRUE), - mProfileButtonEnabled(TRUE), - mCallBackEnabled(TRUE), - mSpeakers(NULL), - mSpeakerPanel(NULL), mFirstKeystrokeTimer(), mLastKeystrokeTimer() { - if(mOtherParticipantUUID.isNull()) + if (mOtherParticipantUUID.isNull()) { llwarns << "Other participant is NULL" << llendl; } - mSessionInitialTargetIDs = ids; - init(session_label); -} - - -void LLFloaterIMPanel::init(const std::string& session_label) -{ // set P2P type by default - mSessionType = P2P_SESSION; - - mSessionLabel = session_label; - - // [Ansariel: Display name support] - mProfileButtonEnabled = FALSE; - // [/Ansariel: Display name support] - static LLCachedControl concise_im("UseConciseIMButtons"); - static LLCachedControl concise_group("UseConciseGroupChatButtons"); - static LLCachedControl concise_conf("UseConciseConferenceButtons"); - std::string xml_filename; + std::string xml_filename = concise_im ? "floater_instant_message_concisebuttons.xml" : "floater_instant_message.xml"; + + switch(mDialog) { case IM_SESSION_GROUP_START: - mFactoryMap["active_speakers_panel"] = LLCallbackMap(createSpeakersPanel, this); - xml_filename = concise_group ? "floater_instant_message_group_concisebuttons.xml" : "floater_instant_message_group.xml"; - mVoiceChannel = new LLVoiceChannelGroup(mSessionUUID, mSessionLabel); - break; case IM_SESSION_INVITE: - mFactoryMap["active_speakers_panel"] = LLCallbackMap(createSpeakersPanel, this); + case IM_SESSION_CONFERENCE_START: + // determine whether it is group or conference session if (gAgent.isInGroup(mSessionUUID)) { - xml_filename = concise_group ? "floater_instant_message_group_concisebuttons.xml" : "floater_instant_message_group.xml"; + static LLCachedControl concise("UseConciseGroupChatButtons"); + xml_filename = concise ? "floater_instant_message_group_concisebuttons.xml" : "floater_instant_message_group.xml"; + mSessionType = GROUP_SESSION; } - else // must be invite to ad hoc IM + else { - xml_filename = concise_conf ? "floater_instant_message_ad_hoc_concisebuttons.xml" : "floater_instant_message_ad_hoc.xml"; + static LLCachedControl concise("UseConciseConferenceButtons"); + xml_filename = concise ? "floater_instant_message_ad_hoc_concisebuttons.xml" : "floater_instant_message_ad_hoc.xml"; + mSessionType = ADHOC_SESSION; } - mVoiceChannel = new LLVoiceChannelGroup(mSessionUUID, mSessionLabel); - break; - case IM_SESSION_P2P_INVITE: - xml_filename = concise_im ? "floater_instant_message_concisebuttons.xml" : "floater_instant_message.xml"; - mVoiceChannel = new LLVoiceChannelP2P(mSessionUUID, mSessionLabel, mOtherParticipantUUID); - break; - case IM_SESSION_CONFERENCE_START: mFactoryMap["active_speakers_panel"] = LLCallbackMap(createSpeakersPanel, this); - xml_filename = concise_conf ? "floater_instant_message_ad_hoc_concisebuttons.xml" : "floater_instant_message_ad_hoc.xml"; - mVoiceChannel = new LLVoiceChannelGroup(mSessionUUID, mSessionLabel); + mVoiceChannel = new LLVoiceChannelGroup(mSessionUUID, mLogLabel); break; // just received text from another user case IM_NOTHING_SPECIAL: - - xml_filename = concise_im ? "floater_instant_message_concisebuttons.xml" : "floater_instant_message.xml"; - mTextIMPossible = LLVoiceClient::getInstance()->isSessionTextIMPossible(mSessionUUID); - mProfileButtonEnabled = LLVoiceClient::getInstance()->isParticipantAvatar(mSessionUUID); mCallBackEnabled = LLVoiceClient::getInstance()->isSessionCallBackPossible(mSessionUUID); - - mVoiceChannel = new LLVoiceChannelP2P(mSessionUUID, mSessionLabel, mOtherParticipantUUID); + // fallthrough + case IM_SESSION_P2P_INVITE: + mVoiceChannel = new LLVoiceChannelP2P(mSessionUUID, mLogLabel, mOtherParticipantUUID); + LLAvatarTracker::instance().addParticularFriendObserver(mOtherParticipantUUID, this); break; default: llwarns << "Unknown session type" << llendl; - xml_filename = concise_im ? "floater_instant_message_concisebuttons.xml" : "floater_instant_message.xml"; break; } - if ( (IM_NOTHING_SPECIAL != mDialog) && (IM_SESSION_P2P_INVITE != mDialog) ) - { - // determine whether it is group or conference session - if (gAgent.isInGroup(mSessionUUID)) - mSessionType = GROUP_SESSION; - else - mSessionType = ADHOC_SESSION; - } - mSpeakers = new LLIMSpeakerMgr(mVoiceChannel); LLUICtrlFactory::getInstance()->buildFloater(this, @@ -447,22 +357,12 @@ void LLFloaterIMPanel::init(const std::string& session_label) &getFactoryMap(), FALSE); - setTitle(mSessionLabel); - - // [Ansariel: Display name support] - if (mProfileButtonEnabled) - { - lookupName(); - } - // [/Ansariel: Display name support] - - // enable line history support for instant message bar mInputEditor->setEnableLineHistory(TRUE); if ( gSavedPerAccountSettings.getBOOL("LogShowHistory") ) { - LLLogChat::loadHistory(mSessionLabel, + LLLogChat::loadHistory(mLogLabel, &chatFromLogFile, (void *)this); } @@ -472,13 +372,12 @@ void LLFloaterIMPanel::init(const std::string& session_label) if ( !send_start_session_messages( mSessionUUID, mOtherParticipantUUID, - mSessionInitialTargetIDs, + ids, mDialog) ) { //we don't need to need to wait for any responses //so we're already initialized - mSessionInitialized = TRUE; - mSessionStartMsgPos = 0; + mSessionInitialized = true; } else { @@ -486,8 +385,7 @@ void LLFloaterIMPanel::init(const std::string& session_label) LLUIString session_start = sSessionStartString; session_start.setArg("[NAME]", getTitle()); - mSessionStartMsgPos = - mHistoryEditor->getWText().length(); + mSessionStartMsgPos = mHistoryEditor->getWText().length(); addHistoryLine( session_start, @@ -497,20 +395,18 @@ void LLFloaterIMPanel::init(const std::string& session_label) } } -void LLFloaterIMPanel::lookupName() -{ - LLAvatarNameCache::get(mOtherParticipantUUID, boost::bind(&LLFloaterIMPanel::onAvatarNameLookup, this, _1, _2)); -} - -void LLFloaterIMPanel::onAvatarNameLookup(const LLUUID&, const LLAvatarName& avatar_name) +void LLFloaterIMPanel::onAvatarNameLookup(const LLAvatarName& avatar_name) { std::string title; LLAvatarNameCache::getPNSName(avatar_name, title); setTitle(title); + // Singu Note: We could set tab name here, too now. } LLFloaterIMPanel::~LLFloaterIMPanel() { + LLAvatarTracker::instance().removeParticularFriendObserver(mOtherParticipantUUID, this); + delete mSpeakers; mSpeakers = NULL; @@ -542,6 +438,20 @@ LLFloaterIMPanel::~LLFloaterIMPanel() mFocusLostSignal.disconnect(); } +// virtual +void LLFloaterIMPanel::changed(U32 mask) +{ + if (mask & REMOVE|ADD) // Fix remove/add friend choices + rebuildDynamics(getChild("instant_message_flyout")); + /* Singu TODO: Chat UI - Online icons? + if (mask & ONLINE) + // Show online icon here + else if (mask & NONE) + // Show offline icon here + */ +} + +// virtual BOOL LLFloaterIMPanel::postBuild() { requires("chat_editor"); @@ -549,11 +459,13 @@ BOOL LLFloaterIMPanel::postBuild() if (checkRequirements()) { - mRPMode = false; + setTitle(mLogLabel); + if (mSessionType == P2P_SESSION && LLVoiceClient::getInstance()->isParticipantAvatar(mSessionUUID)) + LLAvatarNameCache::get(mOtherParticipantUUID, boost::bind(&LLFloaterIMPanel::onAvatarNameLookup, this, _2)); mInputEditor = getChild("chat_editor"); mInputEditor->setFocusReceivedCallback( boost::bind(&LLFloaterIMPanel::onInputEditorFocusReceived, this) ); - mFocusLostSignal = mInputEditor->setFocusLostCallback( boost::bind(&LLFloaterIMPanel::onInputEditorFocusLost, this) ); + mFocusLostSignal = mInputEditor->setFocusLostCallback(boost::bind(&LLFloaterIMPanel::setTyping, this, false)); mInputEditor->setKeystrokeCallback( boost::bind(&LLFloaterIMPanel::onInputEditorKeystroke, this, _1) ); mInputEditor->setCommitCallback( boost::bind(&LLFloaterIMPanel::onSendMsg,this) ); mInputEditor->setCommitOnFocusLost( FALSE ); @@ -561,16 +473,19 @@ BOOL LLFloaterIMPanel::postBuild() mInputEditor->setReplaceNewlinesWithSpaces( FALSE ); mInputEditor->setPassDelete( TRUE ); - if (LLUICtrl* ctrl = findChild("instant_message_flyout")) + if (LLComboBox* flyout = findChild("instant_message_flyout")) { - ctrl->setCommitCallback(boost::bind(&LLFloaterIMPanel::onFlyoutCommit, this, _2)); + flyout->setCommitCallback(boost::bind(&LLFloaterIMPanel::onFlyoutCommit, this, flyout, _2)); + addDynamics(flyout); } + if (LLUICtrl* ctrl = findChild("tp_btn")) + ctrl->setCommitCallback(boost::bind(static_cast(LLAvatarActions::offerTeleport), mOtherParticipantUUID)); + if (LLUICtrl* ctrl = findChild("pay_btn")) + ctrl->setCommitCallback(boost::bind(LLAvatarActions::pay, mOtherParticipantUUID)); if (LLButton* btn = findChild("group_info_btn")) btn->setCommitCallback(boost::bind(LLGroupActions::show, mSessionUUID)); if (LLUICtrl* ctrl = findChild("history_btn")) ctrl->setCommitCallback(boost::bind(&LLFloaterIMPanel::onClickHistory, this)); - if (LLUICtrl* ctrl = findChild("rp_mode")) - ctrl->setCommitCallback(boost::bind(&LLFloaterIMPanel::onRPMode, this, _2)); getChild("start_call_btn")->setCommitCallback(boost::bind(&LLIMMgr::startCall, gIMMgr, mSessionUUID, LLVoiceChannel::OUTGOING_CALL)); getChild("end_call_btn")->setCommitCallback(boost::bind(&LLIMMgr::endCall, gIMMgr, mSessionUUID)); @@ -582,11 +497,6 @@ BOOL LLFloaterIMPanel::postBuild() mHistoryEditor->setParseHTML(TRUE); mHistoryEditor->setParseHighlights(TRUE); - if ( IM_SESSION_GROUP_START == mDialog ) - { - childSetEnabled("profile_btn", FALSE); - } - sTitleString = getString("title_string"); sTypingStartString = getString("typing_start_string"); sSessionStartString = getString("session_start_string"); @@ -642,7 +552,7 @@ void LLFloaterIMPanel::draw() { LLViewerRegion* region = gAgent.getRegion(); - BOOL enable_connect = (region && region->getCapability("ChatSessionRequest") != "") + bool enable_connect = (region && !region->getCapability("ChatSessionRequest").empty()) && mSessionInitialized && LLVoiceClient::getInstance()->voiceEnabled() && mCallBackEnabled; @@ -673,8 +583,8 @@ void LLFloaterIMPanel::draw() // show speakers window when voice first connects if (mShowSpeakersOnConnect && mVoiceChannel->isActive()) { - childSetVisible("active_speakers_panel", true); - mShowSpeakersOnConnect = FALSE; + if (mSpeakerPanel) mSpeakerPanel->setVisible(true); + mShowSpeakersOnConnect = false; } if (LLUICtrl* ctrl = findChild("toggle_active_speakers_btn")) ctrl->setValue(getChildView("active_speakers_panel")->getVisible()); @@ -684,7 +594,7 @@ void LLFloaterIMPanel::draw() // Time out if user hasn't typed for a while. if (mLastKeystrokeTimer.getElapsedTimeF32() > LLAgent::TYPING_TIMEOUT_SECS) { - setTyping(FALSE); + setTyping(false); } // If we are typing, and it's been a little while, send the @@ -692,8 +602,8 @@ void LLFloaterIMPanel::draw() if (!mSentTypingState && mFirstKeystrokeTimer.getElapsedTimeF32() > 1.f) { - sendTypingState(TRUE); - mSentTypingState = TRUE; + sendTypingState(true); + mSentTypingState = true; } } @@ -739,7 +649,7 @@ private: LLUUID mSessionID; }; -BOOL LLFloaterIMPanel::inviteToSession(const LLDynamicArray& ids) +bool LLFloaterIMPanel::inviteToSession(const LLDynamicArray& ids) { LLViewerRegion* region = gAgent.getRegion(); if (!region) @@ -797,6 +707,13 @@ void LLFloaterIMPanel::addHistoryLine(const std::string &utf8msg, LLColor4 incol incolor = mKeywordsColor; } } + + if (mDing && (!hasFocus() || !gFocusMgr.getAppHasFocus())) + { + static const LLCachedControl ding("LiruNewMessageSound"); + static const LLCachedControl dong("LiruNewMessageSoundForSystemMessages"); + LLUI::sAudioCallback(LLUUID(source.notNull() ? ding : dong)); + } } const LLColor4& color = incolor; @@ -870,19 +787,19 @@ void LLFloaterIMPanel::addHistoryLine(const std::string &utf8msg, LLColor4 incol // [Ansariel: Display name support] // Floater title contains display name -> bad idea to use that as filename - // mSessionLabel, however, should still be the old legacy name + // mLogLabel, however, is the old legacy name //LLLogChat::saveHistory(getTitle(),histstr); - LLLogChat::saveHistory(mSessionLabel, histstr); + LLLogChat::saveHistory(mLogLabel, histstr); // [/Ansariel: Display name support] } - if (!isInVisibleChain()) - { - mNumUnreadMessages++; - } - if (source.notNull()) { + if (!isInVisibleChain() || (!hasFocus() && getParent() == gFloaterView)) + { + mNumUnreadMessages++; + } + mSpeakers->speakerChatted(source); mSpeakers->setSpeakerTyping(source, FALSE); } @@ -901,38 +818,23 @@ void LLFloaterIMPanel::setVisible(BOOL b) } -void LLFloaterIMPanel::setInputFocus( BOOL b ) +void LLFloaterIMPanel::setInputFocus(bool b) { mInputEditor->setFocus( b ); } - -void LLFloaterIMPanel::selectAll() -{ - mInputEditor->selectAll(); -} - - -void LLFloaterIMPanel::selectNone() -{ - mInputEditor->deselect(); -} - - BOOL LLFloaterIMPanel::handleKeyHere( KEY key, MASK mask ) { BOOL handled = FALSE; - if( KEY_RETURN == key && mask == MASK_NONE) + if (KEY_RETURN == key) { onSendMsg(); handled = TRUE; // Close talk panels on hitting return - // but not shift-return or control-return - if ( !gSavedSettings.getBOOL("PinTalkViewOpen") && !(mask & MASK_CONTROL) && !(mask & MASK_SHIFT) ) - { - gIMMgr->toggle(NULL); - } + // without holding a modifier key + if (mask == MASK_NONE) + closeIfNotPinned(); } else if (KEY_ESCAPE == key && mask == MASK_NONE) { @@ -940,10 +842,7 @@ BOOL LLFloaterIMPanel::handleKeyHere( KEY key, MASK mask ) gFocusMgr.setKeyboardFocus(NULL); // Close talk panel with escape - if( !gSavedSettings.getBOOL("PinTalkViewOpen") ) - { - gIMMgr->toggle(NULL); - } + closeIfNotPinned(); } // May need to call base class LLPanel::handleKeyHere if not handled @@ -951,6 +850,16 @@ BOOL LLFloaterIMPanel::handleKeyHere( KEY key, MASK mask ) return handled; } +void LLFloaterIMPanel::closeIfNotPinned() +{ + if (gSavedSettings.getBOOL("PinTalkViewOpen")) return; + + if (getParent() == gFloaterView) // Just minimize, if popped out + setMinimized(true); + else + gIMMgr->toggle(); +} + BOOL LLFloaterIMPanel::handleDragAndDrop(S32 x, S32 y, MASK mask, BOOL drop, EDragAndDropType cargo_type, void* cargo_data, @@ -1038,28 +947,30 @@ BOOL LLFloaterIMPanel::dropCategory(LLInventoryCategory* category, BOOL drop) return rv; } -BOOL LLFloaterIMPanel::isInviteAllowed() const +bool LLFloaterIMPanel::isInviteAllowed() const { return ( (IM_SESSION_CONFERENCE_START == mDialog) || (IM_SESSION_INVITE == mDialog) ); } - -// static -void LLFloaterIMPanel::onTabClick(void* userdata) +void LLFloaterIMPanel::removeDynamics(LLComboBox* flyout) { - LLFloaterIMPanel* self = (LLFloaterIMPanel*) userdata; - self->setInputFocus(TRUE); + flyout->remove(mDing ? getString("ding on") : getString("ding off")); + flyout->remove(mRPMode ? getString("rp mode on") : getString("rp mode off")); + flyout->remove(LLAvatarActions::isFriend(mOtherParticipantUUID) ? getString("remove friend") : getString("add friend")); + //flyout->remove(LLAvatarActions::isBlocked(mOtherParticipantUUID) ? getString("unmute") : getString("mute")); } - -void LLFloaterIMPanel::onRPMode(const LLSD& value) +void LLFloaterIMPanel::addDynamics(LLComboBox* flyout) { - mRPMode = value.asBoolean(); + flyout->add(mDing ? getString("ding on") : getString("ding off"), 6); + flyout->add(mRPMode ? getString("rp mode on") : getString("rp mode off"), 7); + flyout->add(LLAvatarActions::isFriend(mOtherParticipantUUID) ? getString("remove friend") : getString("add friend"), 8); + //flyout->add(LLAvatarActions::isBlocked(mOtherParticipantUUID) ? getString("unmute") : getString("mute"), 9); } -void LLFloaterIMPanel::onFlyoutCommit(const LLSD& value) +void LLFloaterIMPanel::onFlyoutCommit(LLComboBox* flyout, const LLSD& value) { if (value.isUndefined()) { @@ -1073,32 +984,48 @@ void LLFloaterIMPanel::onFlyoutCommit(const LLSD& value) else if (option == 3) LLAvatarActions::teleportRequest(mOtherParticipantUUID); else if (option == 4) LLAvatarActions::pay(mOtherParticipantUUID); else if (option == 5) LLAvatarActions::inviteToGroup(mOtherParticipantUUID); + else if (option >= 6) // Options that use dynamic items + { + // First remove them all + removeDynamics(flyout); + + // Toggle as requested, adjust the strings + if (option == 6) mDing = !mDing; + else if (option == 7) mRPMode = !mRPMode; + else if (option == 8) LLAvatarActions::isFriend(mOtherParticipantUUID) ? LLAvatarActions::removeFriendDialog(mOtherParticipantUUID) : LLAvatarActions::requestFriendshipDialog(mOtherParticipantUUID); + //else if (option == 9) LLAvatarActions::toggleBlock(mOtherParticipantUUID); + + // Last add them back + addDynamics(flyout); + } +} + +void show_log_browser(const std::string& name, const std::string& id) +{ + if (gSavedSettings.getBOOL("LiruLegacyLogLaunch")) + { + gViewerWindow->getWindow()->ShellEx("\"" + LLLogChat::makeLogFileName(name) + "\""); + return; + } + LLFloaterWebContent::Params p; + p.url("file:///" + LLLogChat::makeLogFileName(name)); + p.id(id); + p.show_chrome(false); + p.trusted_content(true); + LLFloaterWebContent::showInstance("log", p); // If we passed id instead of "log", there would be no control over how many log browsers opened at once. } void LLFloaterIMPanel::onClickHistory() { if (mOtherParticipantUUID.notNull()) { - char command[256]; // [Ansariel: Display name support] - //std::string fullname(gDirUtilp->getScrubbedFileName(getTitle())); - std::string fullname(gDirUtilp->getScrubbedFileName(mSessionLabel)); + //show_log_browser(getTitle(), mOtherParticipantUUID.asString()); + show_log_browser(mLogLabel, mOtherParticipantUUID.asString()); // [/Ansariel: Display name support] - sprintf(command, "\"%s%s%s.txt\"", gDirUtilp->getPerAccountChatLogsDir().c_str(), gDirUtilp->getDirDelimiter().c_str(), fullname.c_str()); - gViewerWindow->getWindow()->ShellEx(command); - - llinfos << command << llendl; } } -// static -void LLFloaterIMPanel::onClickStartCall(void* userdata) -{ - LLFloaterIMPanel* self = (LLFloaterIMPanel*) userdata; - - self->mVoiceChannel->activate(); -} - void LLFloaterIMPanel::onClickToggleActiveSpeakers(const LLSD& value) { childSetVisible("active_speakers_panel", !value); @@ -1109,28 +1036,15 @@ void LLFloaterIMPanel::onInputEditorFocusReceived() mHistoryEditor->setCursorAndScrollToEnd(); } -void LLFloaterIMPanel::onInputEditorFocusLost() -{ - setTyping(FALSE); -} - void LLFloaterIMPanel::onInputEditorKeystroke(LLLineEditor* caller) { - std::string text = caller->getText(); - if (!text.empty()) - { - setTyping(TRUE); - } - else - { - // Deleting all text counts as stopping typing. - setTyping(FALSE); - } + // Deleting all text counts as stopping typing. + setTyping(!caller->getText().empty()); } void LLFloaterIMPanel::onClose(bool app_quitting) { - setTyping(FALSE); + setTyping(false); if(mSessionUUID.notNull()) { @@ -1231,6 +1145,8 @@ void deliver_message(const std::string& utf8_text, } } +bool convert_roleplay_text(std::string& text); // Returns true if text is an action + void LLFloaterIMPanel::onSendMsg() { if (!gAgent.isGodlike() @@ -1250,55 +1166,9 @@ void LLFloaterIMPanel::onSendMsg() if (mInputEditor) mInputEditor->updateHistory(); // Truncate and convert to UTF8 for transport std::string utf8_text = wstring_to_utf8str(text); - // Convert MU*s style poses into IRC emotes here. - if (gSavedSettings.getBOOL("AscentAllowMUpose") && utf8_text.length() > 3 && utf8_text[0] == ':') - { - if (utf8_text[1] == '\'') - { - utf8_text.replace(0, 1, "/me"); - } - else if (isalpha(utf8_text[1])) // Do not prevent smileys and such. - { - utf8_text.replace(0, 1, "/me "); - } - } - if (utf8_text.find("/ME'") == 0 || utf8_text.find("/ME ") == 0) //Allow CAPSlock /me - utf8_text.replace(1, 2, "me"); - std::string prefix = utf8_text.substr(0, 4); - if (gSavedSettings.getBOOL("AscentAutoCloseOOC") && (utf8_text.length() > 1) && !mRPMode) - { - //Check if it needs the end-of-chat brackets -HgB - if (utf8_text.find("((") == 0 && utf8_text.find("))") == std::string::npos) - { - if(*utf8_text.rbegin() == ')') - utf8_text+=" "; - utf8_text+="))"; - } - else if(utf8_text.find("[[") == 0 && utf8_text.find("]]") == std::string::npos) - { - if(*utf8_text.rbegin() == ']') - utf8_text+=" "; - utf8_text+="]]"; - } - - if (prefix != "/me " && prefix != "/me'") //Allow /me to end with )) or ]] - { - if (utf8_text.find("((") == std::string::npos && utf8_text.find("))") == (utf8_text.length() - 2)) - { - if(utf8_text[0] == '(') - utf8_text.insert(0," "); - utf8_text.insert(0,"(("); - } - else if (utf8_text.find("[[") == std::string::npos && utf8_text.find("]]") == (utf8_text.length() - 2)) - { - if(utf8_text[0] == '[') - utf8_text.insert(0," "); - utf8_text.insert(0,"[["); - } - } - } - if (mRPMode && prefix != "/me " && prefix != "/me'") - utf8_text = "[[" + utf8_text + "]]"; + bool action = convert_roleplay_text(utf8_text); + if (!action && mRPMode) + utf8_text = "((" + utf8_text + "))"; // [RLVa:KB] - Checked: 2011-09-17 (RLVa-1.1.4b) | Modified: RLVa-1.1.4b if ( (gRlvHandler.hasBehaviour(RLV_BHVR_SENDIM)) || (gRlvHandler.hasBehaviour(RLV_BHVR_SENDIMTO)) ) { @@ -1384,7 +1254,7 @@ void LLFloaterIMPanel::onSendMsg() std::string send = utf8_text.substr(pos, next_split); pos += next_split; -LL_WARNS("Splitting") << "Pos: " << pos << " next_split: " << next_split << LL_ENDL; + LL_DEBUGS("Splitting") << "Pos: " << pos << " next_split: " << next_split << LL_ENDL; deliver_message(send, mSessionUUID, @@ -1399,9 +1269,8 @@ LL_WARNS("Splitting") << "Pos: " << pos << " next_split: " << next_split << LL_E std::string name; gAgent.buildFullname(name); - // Look for IRC-style emotes here. - std::string prefix = utf8_text.substr(0, 4); - if (prefix == "/me " || prefix == "/me'") + // Look for actions here. + if (action) { utf8_text.replace(0,3,""); } @@ -1430,8 +1299,8 @@ LL_WARNS("Splitting") << "Pos: " << pos << " next_split: " << next_split << LL_E // Don't need to actually send the typing stop message, the other // client will infer it from receiving the message. - mTyping = FALSE; - mSentTypingState = TRUE; + mTyping = false; + mSentTypingState = true; } void LLFloaterIMPanel::processSessionUpdate(const LLSD& session_update) @@ -1440,15 +1309,15 @@ void LLFloaterIMPanel::processSessionUpdate(const LLSD& session_update) session_update.has("moderated_mode") && session_update["moderated_mode"].has("voice") ) { - BOOL voice_moderated = session_update["moderated_mode"]["voice"]; + bool voice_moderated = session_update["moderated_mode"]["voice"]; if (voice_moderated) { - setTitle(mSessionLabel + std::string(" ") + getString("moderated_chat_label")); + setTitle(mLogLabel + std::string(" ") + getString("moderated_chat_label")); } else { - setTitle(mSessionLabel); + setTitle(mLogLabel); } @@ -1461,18 +1330,16 @@ void LLFloaterIMPanel::sessionInitReplyReceived(const LLUUID& session_id) { mSessionUUID = session_id; mVoiceChannel->updateSessionID(session_id); - mSessionInitialized = TRUE; + mSessionInitialized = true; //we assume the history editor hasn't moved at all since //we added the starting session message //so, we count how many characters to remove - S32 chars_to_remove = mHistoryEditor->getWText().length() - - mSessionStartMsgPos; + S32 chars_to_remove = mHistoryEditor->getWText().length() - mSessionStartMsgPos; mHistoryEditor->removeTextFromEnd(chars_to_remove); //and now, send the queued msg - LLSD::array_iterator iter; - for ( iter = mQueuedMsgsForInit.beginArray(); + for (LLSD::array_iterator iter = mQueuedMsgsForInit.beginArray(); iter != mQueuedMsgsForInit.endArray(); ++iter) { @@ -1490,7 +1357,7 @@ void LLFloaterIMPanel::sessionInitReplyReceived(const LLUUID& session_id) } } -void LLFloaterIMPanel::setTyping(BOOL typing) +void LLFloaterIMPanel::setTyping(bool typing) { if (typing) { @@ -1503,7 +1370,7 @@ void LLFloaterIMPanel::setTyping(BOOL typing) mFirstKeystrokeTimer.reset(); // Will send typing state after a short delay. - mSentTypingState = FALSE; + mSentTypingState = false; } mSpeakers->setSpeakerTyping(gAgent.getID(), TRUE); @@ -1513,8 +1380,8 @@ void LLFloaterIMPanel::setTyping(BOOL typing) if (mTyping) { // you just stopped typing, send state immediately - sendTypingState(FALSE); - mSentTypingState = TRUE; + sendTypingState(false); + mSentTypingState = true; } mSpeakers->setSpeakerTyping(gAgent.getID(), FALSE); } @@ -1522,7 +1389,7 @@ void LLFloaterIMPanel::setTyping(BOOL typing) mTyping = typing; } -void LLFloaterIMPanel::sendTypingState(BOOL typing) +void LLFloaterIMPanel::sendTypingState(bool typing) { if(gSavedSettings.getBOOL("AscentHideTypingNotification")) return; @@ -1548,7 +1415,7 @@ void LLFloaterIMPanel::sendTypingState(BOOL typing) } -void LLFloaterIMPanel::processIMTyping(const LLIMInfo* im_info, BOOL typing) +void LLFloaterIMPanel::processIMTyping(const LLIMInfo* im_info, bool typing) { if (typing) { @@ -1575,7 +1442,7 @@ void LLFloaterIMPanel::addTypingIndicator(const std::string &name) typing_start.setArg("[NAME]", name); addHistoryLine(typing_start, gSavedSettings.getColor4("SystemChatColor"), false); mOtherTypingName = name; - mOtherTyping = TRUE; + mOtherTyping = true; } // MBW -- XXX -- merge from release broke this (argument to this function changed from an LLIMInfo to a name) // Richard will fix. @@ -1588,7 +1455,7 @@ void LLFloaterIMPanel::removeTypingIndicator(const LLIMInfo* im_info) if (mOtherTyping) { // Must do this first, otherwise addHistoryLine calls us again. - mOtherTyping = FALSE; + mOtherTyping = false; S32 chars_to_remove = mHistoryEditor->getWText().length() - mTypingLineStartIndex; mHistoryEditor->removeTextFromEnd(chars_to_remove); @@ -1711,7 +1578,7 @@ const bool LLFloaterIMPanel::isModerator(const LLUUID& speaker_id) LLPointer speakerp = mSpeakers->findSpeaker(speaker_id); return speakerp && speakerp->mIsModerator; } - return FALSE; + return false; } BOOL LLFloaterIMPanel::focusFirstItem(BOOL prefer_text_fields, BOOL focus_flash ) @@ -1727,6 +1594,7 @@ BOOL LLFloaterIMPanel::focusFirstItem(BOOL prefer_text_fields, BOOL focus_flash void LLFloaterIMPanel::onFocusReceived() { + mNumUnreadMessages = 0; if (getVisible() && mInputEditor->getVisible()) { setInputFocus(true); diff --git a/indra/newview/llimpanel.h b/indra/newview/llimpanel.h index 9e56ad0e7..bee650d7b 100644 --- a/indra/newview/llimpanel.h +++ b/indra/newview/llimpanel.h @@ -32,25 +32,21 @@ #ifndef LL_IMPANEL_H #define LL_IMPANEL_H -#include "llavatarnamecache.h" +#include "llcallingcard.h" #include "llfloater.h" #include "lllogchat.h" -#include "lluuid.h" -#include "lldarray.h" -#include "llinstantmessage.h" -#include "llvoiceclient.h" -#include "llstyle.h" -class LLLineEditor; -class LLViewerTextEditor; -class LLInventoryItem; -class LLInventoryCategory; +class LLAvatarName; class LLIMSpeakerMgr; +class LLIMInfo; +class LLInventoryCategory; +class LLInventoryItem; +class LLLineEditor; class LLParticipantList; -class LLButton; +class LLViewerTextEditor; class LLVoiceChannel; -class LLFloaterIMPanel : public LLFloater +class LLFloaterIMPanel : public LLFloater, public LLFriendObserver { public: @@ -59,20 +55,16 @@ public: // the default. For example, if you open a session though a // calling card, a new session id will be generated, but the // target_id will be the agent referenced by the calling card. - LLFloaterIMPanel(const std::string& session_label, + LLFloaterIMPanel(const std::string& log_label, const LLUUID& session_id, const LLUUID& target_id, - EInstantMessage dialog); - LLFloaterIMPanel(const std::string& session_label, - const LLUUID& session_id, - const LLUUID& target_id, - const LLDynamicArray& ids, - EInstantMessage dialog); + const EInstantMessage& dialog, + const LLDynamicArray& ids = LLDynamicArray()); virtual ~LLFloaterIMPanel(); - void lookupName(); - void onAvatarNameLookup(const LLUUID&, const LLAvatarName& avatar_name); + void onAvatarNameLookup(const LLAvatarName& avatar_name); + /*virtual*/ void changed(U32 mask); // From LLFriendObserver, check friend status /*virtual*/ BOOL postBuild(); // Check typing timeout timer. @@ -82,7 +74,7 @@ public: // add target ids to the session. // Return TRUE if successful, otherwise FALSE. - BOOL inviteToSession(const LLDynamicArray& agent_ids); + bool inviteToSession(const LLDynamicArray& agent_ids); void addHistoryLine(const std::string &utf8msg, LLColor4 incolor = LLColor4::white, @@ -90,12 +82,9 @@ public: const LLUUID& source = LLUUID::null, const std::string& name = LLStringUtil::null); - void setInputFocus( BOOL b ); + void setInputFocus(bool b); - void selectAll(); - void selectNone(); void setVisible(BOOL b); - BOOL mRPMode; S32 getNumUnreadMessages() { return mNumUnreadMessages; } @@ -109,32 +98,32 @@ public: void onFocusReceived(); void onInputEditorFocusReceived(); - void onInputEditorFocusLost(); void onInputEditorKeystroke(LLLineEditor* caller); - static void onTabClick( void* userdata ); void onClickHistory(); - void onRPMode(const LLSD& value); - void onFlyoutCommit(const LLSD& value); - static void onClickStartCall( void* userdata ); - static void onClickEndCall( void* userdata ); + void onFlyoutCommit(class LLComboBox* flyout, const LLSD& value); void onClickToggleActiveSpeakers(const LLSD& value); static void* createSpeakersPanel(void* data); //callbacks for P2P muting and volume control void onClickMuteVoice(); + enum SType + { + P2P_SESSION, + GROUP_SESSION, + ADHOC_SESSION + }; + const SType& getSessionType() const { return mSessionType; } const LLUUID& getSessionID() const { return mSessionUUID; } - const LLUUID& getOtherParticipantID() const { return mOtherParticipantUUID; } void processSessionUpdate(const LLSD& update); LLVoiceChannel* getVoiceChannel() { return mVoiceChannel; } LLIMSpeakerMgr* getSpeakerManager() const { return mSpeakers; } // Singu TODO: LLIMModel::getSpeakerManager - EInstantMessage getDialogType() const { return mDialog; } void sessionInitReplyReceived(const LLUUID& im_session_id); // Handle other participant in the session typing. - void processIMTyping(const LLIMInfo* im_info, BOOL typing); + void processIMTyping(const LLIMInfo* im_info, bool typing); static void chatFromLogFile(LLLogChat::ELogLineType type, std::string line, void* userdata); //show error statuses to the user @@ -146,38 +135,32 @@ public: static bool onConfirmForceCloseError(const LLSD& notification, const LLSD& response); - typedef enum e_session_type - { - P2P_SESSION, - GROUP_SESSION, - ADHOC_SESSION - } SType; - bool isP2PSessionType() const { return mSessionType == P2P_SESSION;} - bool isAdHocSessionType() const { return mSessionType == ADHOC_SESSION;} - bool isGroupSessionType() const { return mSessionType == GROUP_SESSION;} - SType mSessionType; - // LLIMModel Functionality bool getSessionInitialized() const { return mSessionInitialized; } bool mStartCallOnInitialize; private: - // called by constructors - void init(const std::string& session_label); - // Called by UI methods. void onSendMsg(); + // Build the flyout list + void rebuildDynamics(LLComboBox* flyout) { removeDynamics(flyout); addDynamics(flyout); } + void removeDynamics(LLComboBox* flyout); + void addDynamics(LLComboBox* flyout); + + // Called by handleKeyHere + void closeIfNotPinned(); + // for adding agents via the UI. Return TRUE if possible, do it if BOOL dropCallingCard(LLInventoryItem* item, BOOL drop); BOOL dropCategory(LLInventoryCategory* category, BOOL drop); // test if local agent can add agents. - BOOL isInviteAllowed() const; + bool isInviteAllowed() const; // Called whenever the user starts or stops typing. // Sends the typing state to the other user if necessary. - void setTyping(BOOL typing); + void setTyping(bool typing); // Add the "User is typing..." indicator. void addTypingIndicator(const std::string &name); @@ -185,7 +168,7 @@ private: // Remove the "User is typing..." indicator. void removeTypingIndicator(const LLIMInfo* im_info); - void sendTypingState(BOOL typing); + void sendTypingState(bool typing); const bool isModerator(const LLUUID& speaker_id); @@ -193,6 +176,13 @@ private: LLLineEditor* mInputEditor; LLViewerTextEditor* mHistoryEditor; + bool mSessionInitialized; + + // Where does the "Starting session..." line start? + S32 mSessionStartMsgPos; + + SType mSessionType; + // The value of the mSessionUUID depends on how the IM session was started: // one-on-one ==> random id // group ==> group_id @@ -200,10 +190,9 @@ private: // 911 ==> Gaurdian_Angel_Group_ID ^ gAgent.getID() LLUUID mSessionUUID; - std::string mSessionLabel; - LLVoiceChannel* mVoiceChannel; + // mLogLabel is the name of the log file before directories and extensions + std::string mLogLabel; - BOOL mSessionInitialized; LLSD mQueuedMsgsForInit; // The value mOtherParticipantUUID depends on how the IM session was started: @@ -212,36 +201,36 @@ private: // inventory folder ==> first target id in list // 911 ==> sender LLUUID mOtherParticipantUUID; - LLDynamicArray mSessionInitialTargetIDs; EInstantMessage mDialog; // Are you currently typing? - BOOL mTyping; + bool mTyping; + + // Where does the "User is typing..." line start? + S32 mTypingLineStartIndex; // Is other user currently typing? - BOOL mOtherTyping; + bool mOtherTyping; // name of other user who is currently typing std::string mOtherTypingName; - // Where does the "User is typing..." line start? - S32 mTypingLineStartIndex; - // Where does the "Starting session..." line start? - S32 mSessionStartMsgPos; - S32 mNumUnreadMessages; - BOOL mSentTypingState; + bool mSentTypingState; - BOOL mShowSpeakersOnConnect; + bool mShowSpeakersOnConnect; - BOOL mTextIMPossible; - BOOL mProfileButtonEnabled; - BOOL mCallBackEnabled; + bool mDing; // Whether or not to play a ding on new messages + bool mRPMode; + + bool mTextIMPossible; + bool mCallBackEnabled; LLIMSpeakerMgr* mSpeakers; LLParticipantList* mSpeakerPanel; + LLVoiceChannel* mVoiceChannel; // Optimization: Don't send "User is typing..." until the // user has actually been typing for a little while. Prevents @@ -255,17 +244,10 @@ private: CachedUICtrl mVolumeSlider; - CachedUICtrl mEndCallBtn; - CachedUICtrl mStartCallBtn; - CachedUICtrl mSendBtn; - CachedUICtrl mMuteBtn; - - void disableWhileSessionStarting(); - - typedef std::map styleMap; - static styleMap mStyleMap; - - static std::set sFloaterIMPanels; + CachedUICtrl mEndCallBtn; + CachedUICtrl mStartCallBtn; + CachedUICtrl mSendBtn; + CachedUICtrl mMuteBtn; }; diff --git a/indra/newview/llimview.cpp b/indra/newview/llimview.cpp index c04cd8348..48ae523b7 100644 --- a/indra/newview/llimview.cpp +++ b/indra/newview/llimview.cpp @@ -34,35 +34,25 @@ #include "llimview.h" -#include "llfontgl.h" -#include "llrect.h" -#include "llbutton.h" #include "llhttpclient.h" +#include "llhttpnode.h" +#include "llnotifications.h" +#include "llnotificationsutil.h" +#include "llsdserialize.h" #include "llsdutil_math.h" -#include "llstring.h" #include "lltrans.h" #include "lluictrlfactory.h" #include "llagent.h" #include "llagentcamera.h" #include "llavataractions.h" -#include "llcallingcard.h" -#include "llchat.h" -#include "llresmgr.h" +#include "llavatarnamecache.h" #include "llfloaterchat.h" #include "llfloaterchatterbox.h" -#include "llhttpnode.h" #include "llimpanel.h" -#include "llnotificationsutil.h" -#include "llsdserialize.h" -#include "llspeakers.h" -#include "lltabcontainer.h" #include "llmutelist.h" -#include "llviewermenu.h" -#include "llviewermessage.h" -#include "llviewerwindow.h" +#include "llspeakers.h" #include "llvoavatar.h" // For mIdleTimer reset -#include "llnotify.h" #include "llviewerregion.h" // [RLVa:KB] @@ -80,6 +70,7 @@ LLIMMgr* gIMMgr = NULL; // // Helper Functions // +std::string formatted_time(const time_t& the_time); LLVOAvatar* find_avatar_from_object(const LLUUID& id); LLColor4 agent_chat_color(const LLUUID& id, const std::string& name, bool local_chat) @@ -166,10 +157,13 @@ public: if ((mInvitiationType == LLIMMgr::INVITATION_TYPE_VOICE || mInvitiationType == LLIMMgr::INVITATION_TYPE_IMMEDIATE) - && gIMMgr->hasSession(mSessionID)) + && floater) { // always open IM window when connecting to voice - LLFloaterChatterBox::showInstance(TRUE); + if (floater->getParent() == gFloaterView) + floater->open(); + else + LLFloaterChatterBox::showInstance(TRUE); } gIMMgr->clearPendingAgentListUpdates(mSessionID); @@ -252,42 +246,6 @@ LLUUID LLIMMgr::computeSessionID( return session_id; } -//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -// LLFloaterIM -//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - -LLFloaterIM::LLFloaterIM() -{ - // autoresize=false is necessary to avoid resizing of the IM window whenever - // a session is opened or closed (it would otherwise resize the window to match - // the size of the im-sesssion when they were created. This happens in - // LLMultiFloater::resizeToContents() when called through LLMultiFloater::addFloater()) - this->mAutoResize = FALSE; - LLUICtrlFactory::getInstance()->buildFloater(this, "floater_im.xml"); -} - -//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -// Class LLIMViewFriendObserver -// -// Bridge to suport knowing when the inventory has changed. -//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - -class LLIMViewFriendObserver : public LLFriendObserver -{ -public: - LLIMViewFriendObserver(LLIMMgr* tv) : mTV(tv) {} - virtual ~LLIMViewFriendObserver() {} - virtual void changed(U32 mask) - { - if(mask & (LLFriendObserver::ADD | LLFriendObserver::REMOVE | LLFriendObserver::ONLINE)) - { - mTV->refresh(); - } - } -protected: - LLIMMgr* mTV; -}; - bool inviteUserResponse(const LLSD& notification, const LLSD& response) { @@ -387,22 +345,6 @@ bool inviteUserResponse(const LLSD& notification, const LLSD& response) // Public Static Member Functions // -// This is a helper function to determine what kind of im session -// should be used for the given agent. -// static -EInstantMessage LLIMMgr::defaultIMTypeForAgent(const LLUUID& agent_id) -{ - EInstantMessage type = IM_NOTHING_SPECIAL; - if (LLAvatarActions::isFriend(agent_id)) - { - if(LLAvatarTracker::instance().isBuddyOnline(agent_id)) - { - type = IM_SESSION_CONFERENCE_START; - } - } - return type; -} - // static //void LLIMMgr::onPinButton(void*) //{ @@ -410,14 +352,12 @@ EInstantMessage LLIMMgr::defaultIMTypeForAgent(const LLUUID& agent_id) // gSavedSettings.setBOOL( "PinTalkViewOpen", !state ); //} -// static -void LLIMMgr::toggle(void*) +void LLIMMgr::toggle() { static BOOL return_to_mouselook = FALSE; // Hide the button and show the floater or vice versa. - llassert( gIMMgr ); - BOOL old_state = gIMMgr->getFloaterOpen(); + bool old_state = getFloaterOpen(); // If we're in mouselook and we triggered the Talk View, we want to talk. if( gAgentCamera.cameraMouselook() && old_state ) @@ -448,7 +388,7 @@ void LLIMMgr::toggle(void*) return_to_mouselook = FALSE; } - gIMMgr->setFloaterOpen( new_state ); + setFloaterOpen(new_state); } // @@ -456,26 +396,14 @@ void LLIMMgr::toggle(void*) // LLIMMgr::LLIMMgr() : - mFriendObserver(NULL), - mIMReceived(FALSE), mIMUnreadCount(0) { - mFriendObserver = new LLIMViewFriendObserver(this); - LLAvatarTracker::instance().addObserver(mFriendObserver); - - // *HACK: use floater to initialize string constants from xml file - // then delete it right away - LLFloaterIM* dummy_floater = new LLFloaterIM(); - delete dummy_floater; - mPendingInvitations = LLSD::emptyMap(); mPendingAgentListUpdates = LLSD::emptyMap(); } LLIMMgr::~LLIMMgr() { - LLAvatarTracker::instance().removeObserver(mFriendObserver); - delete mFriendObserver; // Children all cleaned up by default view destructor. } @@ -502,20 +430,19 @@ void LLIMMgr::addMessage( return; } - LLFloaterIMPanel* floater; LLUUID new_session_id = session_id; if (new_session_id.isNull()) { //no session ID...compute new one new_session_id = computeSessionID(dialog, other_participant_id); } - floater = findFloaterBySession(new_session_id); + LLFloaterIMPanel* floater = findFloaterBySession(new_session_id); if (!floater) { floater = findFloaterBySession(other_participant_id); if (floater) { - llinfos << "found the IM session " << session_id + llinfos << "found the IM session " << new_session_id << " by participant " << other_participant_id << llendl; } } @@ -525,43 +452,13 @@ void LLIMMgr::addMessage( // create IM window as necessary if(!floater) { - if (gIMMgr->getIgnoreGroupListCount() > 0 && gAgent.isInGroup(session_id)) - { - // Check to see if we're blocking this group's chat - LLGroupData* group_data = NULL; - - // Search for this group in the agent's groups list - LLDynamicArray::iterator i; + // Return now if we're blocking this group's chat + if (getIgnoreGroup(session_id) && gAgent.isInGroup(session_id)) + return; - for (i = gAgent.mGroups.begin(); i != gAgent.mGroups.end(); i++) - { - if (i->mID == session_id) - { - group_data = &*i; - break; - } - } + std::string name = (session_name.size() > 1) ? session_name : from; - // If the group is in our list then return - if (group_data && gIMMgr->getIgnoreGroup(group_data->mID)) - { - return; - } - } - - std::string name = from; - if(!session_name.empty() && session_name.size()>1) - { - name = session_name; - } - - - floater = createFloater( - new_session_id, - other_participant_id, - name, - dialog, - FALSE); + floater = createFloater(new_session_id, other_participant_id, name, dialog); // When we get a new IM, and if you are a god, display a bit // of information about the source. This is to help liaisons @@ -606,26 +503,9 @@ void LLIMMgr::addMessage( } } - LLFloaterChatterBox* chat_floater = LLFloaterChatterBox::getInstance(LLSD()); - - if( !chat_floater->getVisible() && !floater->getVisible()) + if (!gIMMgr->getFloaterOpen() && floater->getParent() != gFloaterView) { - //if the IM window is not open and the floater is not visible (i.e. not torn off) - LLFloater* previouslyActiveFloater = chat_floater->getActiveFloater(); - - // select the newly added floater (or the floater with the new line added to it). - // it should be there. - chat_floater->selectFloater(floater); - - //there was a previously unseen IM, make that old tab flashing - //it is assumed that the most recently unseen IM tab is the one current selected/active - if ( previouslyActiveFloater && getIMReceived() ) - { - chat_floater->setFloaterFlashing(previouslyActiveFloater, TRUE); - } - - //notify of a new IM - notifyNewIM(); + // If the chat floater is closed and not torn off) notify of a new IM mIMUnreadCount++; } } @@ -656,25 +536,11 @@ void LLIMMgr::addSystemMessage(const LLUUID& session_id, const std::string& mess } } -void LLIMMgr::notifyNewIM() -{ - if(!gIMMgr->getFloaterOpen()) - { - mIMReceived = TRUE; - } -} - void LLIMMgr::clearNewIMNotification() { - mIMReceived = FALSE; mIMUnreadCount = 0; } -BOOL LLIMMgr::getIMReceived() const -{ - return mIMReceived; -} - int LLIMMgr::getIMUnreadCount() { return mIMUnreadCount; @@ -741,13 +607,7 @@ LLUUID LLIMMgr::addSession( LLDynamicArray ids; ids.put(other_participant_id); - floater = createFloater( - session_id, - other_participant_id, - name, - ids, - dialog, - TRUE); + floater = createFloater(session_id, other_participant_id, name, dialog, ids, true); noteOfflineUsers(floater, ids); LLFloaterChatterBox::showInstance(session_id); @@ -804,13 +664,7 @@ LLUUID LLIMMgr::addSession( { // On creation, use the first element of ids as the // "other_participant_id" - floater = createFloater( - session_id, - other_participant_id, - name, - ids, - dialog, - TRUE); + floater = createFloater(session_id, other_participant_id, name, dialog, ids, true); if ( !floater ) return LLUUID::null; @@ -963,10 +817,6 @@ void LLIMMgr::onInviteNameLookup(const LLUUID& id, const std::string& full_name, &inviteUserResponse); } -void LLIMMgr::refresh() -{ -} - void LLIMMgr::setFloaterOpen(BOOL set_open) { if (set_open) @@ -1188,52 +1038,9 @@ LLFloaterIMPanel* LLIMMgr::createFloater( const LLUUID& session_id, const LLUUID& other_participant_id, const std::string& session_label, - EInstantMessage dialog, - BOOL user_initiated) -{ - if (session_id.isNull()) - { - llwarns << "Creating LLFloaterIMPanel with null session ID" << llendl; - } - - llinfos << "LLIMMgr::createFloater: from " << other_participant_id - << " in session " << session_id << llendl; - LLFloaterIMPanel* floater = new LLFloaterIMPanel(session_label, - session_id, - other_participant_id, - dialog); - LLTabContainer::eInsertionPoint i_pt = user_initiated ? LLTabContainer::RIGHT_OF_CURRENT : LLTabContainer::END; - LLFloaterChatterBox::getInstance(LLSD())->addFloater(floater, FALSE, i_pt); - static LLCachedControl tear_off("OtherChatsTornOff"); - if (tear_off) - { - LLFloaterChatterBox::getInstance(LLSD())->removeFloater(floater); // removal sets up relationship for re-attach - gFloaterView->addChild(floater); // reparent to floater view - LLFloater* focused_floater = gFloaterView->getFocusedFloater(); // obtain the focused floater - floater->open(); // make the new chat floater appear - static LLCachedControl minimize("OtherChatsTornOffAndMinimized"); - if (focused_floater != NULL) // there was a focused floater - { - floater->setMinimized(minimize); // so minimize this one, for now, if desired - focused_floater->setFocus(true); // and work around focus being removed by focusing on the last - } - else if (minimize) - { - floater->setFocus(false); // work around focus being granted to new floater - floater->setMinimized(true); - } - } - mFloaters.insert(floater->getHandle()); - return floater; -} - -LLFloaterIMPanel* LLIMMgr::createFloater( - const LLUUID& session_id, - const LLUUID& other_participant_id, - const std::string& session_label, + const EInstantMessage& dialog, const LLDynamicArray& ids, - EInstantMessage dialog, - BOOL user_initiated) + bool user_initiated) { if (session_id.isNull()) { @@ -1242,11 +1049,7 @@ LLFloaterIMPanel* LLIMMgr::createFloater( llinfos << "LLIMMgr::createFloater: from " << other_participant_id << " in session " << session_id << llendl; - LLFloaterIMPanel* floater = new LLFloaterIMPanel(session_label, - session_id, - other_participant_id, - ids, - dialog); + LLFloaterIMPanel* floater = new LLFloaterIMPanel(session_label, session_id, other_participant_id, dialog, ids); LLTabContainer::eInsertionPoint i_pt = user_initiated ? LLTabContainer::RIGHT_OF_CURRENT : LLTabContainer::END; LLFloaterChatterBox::getInstance(LLSD())->addFloater(floater, FALSE, i_pt); static LLCachedControl tear_off("OtherChatsTornOff"); diff --git a/indra/newview/llimview.h b/indra/newview/llimview.h index 3e7bc6fff..2a2ac9dc7 100644 --- a/indra/newview/llimview.h +++ b/indra/newview/llimview.h @@ -41,7 +41,6 @@ class LLFloaterChatterBox; class LLFloaterIMPanel; -class LLFriendObserver; class LLIMMgr : public LLSingleton { @@ -125,17 +124,12 @@ public: void processIMTypingStart(const LLIMInfo* im_info); void processIMTypingStop(const LLIMInfo* im_info); - // Rebuild stuff - void refresh(); - - void notifyNewIM(); void clearNewIMNotification(); // automatically start a call once the session has initialized void autoStartCallOnStartup(const LLUUID& session_id); // IM received that you haven't seen yet - BOOL getIMReceived() const; int getIMUnreadCount(); void setFloaterOpen(BOOL open); /*Flawfinder: ignore*/ @@ -149,11 +143,7 @@ public: // good connection. void disconnectAllSessions(); - static void toggle(void*); - - // This is a helper function to determine what kind of im session - // should be used for the given agent. - static EInstantMessage defaultIMTypeForAgent(const LLUUID& agent_id); + void toggle(); BOOL hasSession(const LLUUID& session_id); @@ -202,15 +192,9 @@ private: LLFloaterIMPanel* createFloater(const LLUUID& session_id, const LLUUID& target_id, const std::string& name, - EInstantMessage dialog, - BOOL user_initiated = FALSE); - - LLFloaterIMPanel* createFloater(const LLUUID& session_id, - const LLUUID& target_id, - const std::string& name, - const LLDynamicArray& ids, - EInstantMessage dialog, - BOOL user_initiated = FALSE); + const EInstantMessage& dialog, + const LLDynamicArray& ids = LLDynamicArray(), + bool user_initiated = false); // This simple method just iterates through all of the ids, and // prints a simple message if they are not online. Used to help @@ -225,10 +209,8 @@ private: private: std::set > mFloaters; - LLFriendObserver* mFriendObserver; // An IM has been received that you haven't seen yet. - BOOL mIMReceived; int mIMUnreadCount; LLSD mPendingInvitations; @@ -241,14 +223,7 @@ public: S32 getIgnoreGroupListCount() { return mIgnoreGroupList.size(); } }; - -class LLFloaterIM : public LLMultiFloater -{ -public: - LLFloaterIM(); -}; - // Globals extern LLIMMgr *gIMMgr; -#endif // LL_LLIMView_H +#endif // LL_LLIMVIEW_H diff --git a/indra/newview/llinventorybridge.cpp b/indra/newview/llinventorybridge.cpp index e60e921b7..3dd268d60 100644 --- a/indra/newview/llinventorybridge.cpp +++ b/indra/newview/llinventorybridge.cpp @@ -34,6 +34,7 @@ #include "lluictrlfactory.h" +#include "lffloaterinvpanel.h" #include "llagent.h" #include "llagentcamera.h" #include "llagentwearables.h" @@ -78,6 +79,7 @@ #include "llviewerregion.h" #include "llviewerwindow.h" #include "llvoavatar.h" +#include "llworldmap.h" #include "llwearable.h" #include "llwearablelist.h" @@ -2770,6 +2772,14 @@ void LLFolderBridge::performAction(LLInventoryModel* model, std::string action) return; } + else if ("open_in_new_window" == action) + { + LLInventoryModel* model = getInventoryModel(); + LLViewerInventoryCategory* cat = getCategory(); + if (!model || !cat) return; + LFFloaterInvPanel::show(mUUID, model, cat->getName()); + return; + } else if ("paste" == action) { pasteFromClipboard(); @@ -3370,6 +3380,8 @@ void LLFolderBridge::buildContextMenuFolderOptions(U32 flags) if (!isAgentInventory()) return; if (isOutboxFolder()) return; + mItems.push_back(std::string("Open Folder In New Window")); + LLFolderType::EType type = category->getPreferredType(); const bool is_system_folder = LLFolderType::lookupIsProtectedType(type); // calling card related functionality for folders. @@ -3428,6 +3440,7 @@ void LLFolderBridge::buildContextMenuFolderOptions(U32 flags) mItems.push_back(std::string("Replace Outfit")); } + mItems.push_back(std::string("Replace Remove Separator")); mItems.push_back(std::string("Remove From Outfit")); if (!LLAppearanceMgr::getCanRemoveFromCOF(mUUID)) { @@ -4254,6 +4267,22 @@ void LLTextureBridge::openItem() } } +bool LLTextureBridge::canSaveTexture() +{ + const LLInventoryModel* model = getInventoryModel(); + if (!model) + { + return false; + } + + const LLViewerInventoryItem* item = model->getItem(mUUID); + if (item) + { + return item->checkPermissionsSet(PERM_ITEM_UNRESTRICTED); + } + return false; +} + void LLTextureBridge::buildContextMenu(LLMenuGL& menu, U32 flags) { lldebugs << "LLTextureBridge::buildContextMenu()" << llendl; @@ -4274,13 +4303,12 @@ void LLTextureBridge::buildContextMenu(LLMenuGL& menu, U32 flags) getClipboardEntries(true, items, disabled_items, flags); - /* Singu TODO items.push_back(std::string("Texture Separator")); items.push_back(std::string("Save As")); if (!canSaveTexture()) { disabled_items.push_back(std::string("Save As")); - }*/ + } } hide_context_entries(menu, items, disabled_items); } @@ -4288,17 +4316,18 @@ void LLTextureBridge::buildContextMenu(LLMenuGL& menu, U32 flags) // virtual void LLTextureBridge::performAction(LLInventoryModel* model, std::string action) { - /* Singu TODO if ("save_as" == action) { - LLFloaterReg::showInstance("preview_texture", LLSD(mUUID), TAKE_FOCUS_YES); - LLPreviewTexture* preview_texture = LLFloaterReg::findTypedInstance("preview_texture", mUUID); + const LLViewerInventoryItem* item(getItem()); + if (!item) return; + open_texture(mUUID, std::string("Texture: ") + item->getName(), FALSE); + LLPreview* preview_texture = LLPreview::find(mUUID); if (preview_texture) { - preview_texture->openToSave(); + preview_texture->saveAs(); } } - else*/ LLItemBridge::performAction(model, action); + else LLItemBridge::performAction(model, action); } // +=================================================+ @@ -4421,6 +4450,7 @@ void LLLandmarkBridge::buildContextMenu(LLMenuGL& menu, U32 flags) items.push_back(std::string("Landmark Separator")); items.push_back(std::string("Teleport To Landmark")); + items.push_back(std::string("Show On Map")); } // Disable "About Landmark" menu item for @@ -4429,6 +4459,7 @@ void LLLandmarkBridge::buildContextMenu(LLMenuGL& menu, U32 flags) if ((flags & FIRST_SELECTED_ITEM) == 0) { disabled_items.push_back(std::string("Teleport To Landmark")); + disabled_items.push_back(std::string("Show On Map")); } hide_context_entries(menu, items, disabled_items); @@ -4468,6 +4499,14 @@ void LLLandmarkBridge::performAction(LLInventoryModel* model, std::string action open_landmark(item, std::string(" Landmark: ") + item->getName(), FALSE); } } + else if ("show_on_map" == action) + { + if (const LLViewerInventoryItem* item = getItem()) + { + gFloaterWorldMap->trackLandmark(item->getUUID()); + LLFloaterWorldMap::show(true); + } + } else { LLItemBridge::performAction(model, action); @@ -4604,6 +4643,13 @@ void LLCallingCardBridge::performAction(LLInventoryModel* model, std::string act LLAvatarActions::teleportRequest(item->getCreatorUUID()); } } + else if ("web_profile" == action) + { + if (LLViewerInventoryItem* item = getItem()) + { + LLAvatarActions::showProfile(item->getCreatorUUID(), true); + } + } else LLItemBridge::performAction(model, action); } @@ -4686,6 +4732,8 @@ void LLCallingCardBridge::buildContextMenu(LLMenuGL& menu, U32 flags) user_online = (LLAvatarTracker::instance().isBuddyOnline(item->getCreatorUUID())); } items.push_back(std::string("Send Instant Message Separator")); + if (!gSavedSettings.getString("WebProfileURL").empty() && !gSavedSettings.getBOOL("UseWebProfiles")) + items.push_back(std::string("Web Profile")); items.push_back(std::string("Send Instant Message")); items.push_back(std::string("Offer Teleport...")); items.push_back(std::string("Request Teleport...")); diff --git a/indra/newview/llinventoryicon.cpp b/indra/newview/llinventoryicon.cpp index e2b47e687..f93dc8dd7 100644 --- a/indra/newview/llinventoryicon.cpp +++ b/indra/newview/llinventoryicon.cpp @@ -88,6 +88,7 @@ LLIconDictionary::LLIconDictionary() addEntry(LLInventoryType::ICONNAME_LINKFOLDER, new IconEntry("inv_link_folder.tga")); addEntry(LLInventoryType::ICONNAME_MESH, new IconEntry("inv_item_mesh.tga")); + addEntry(LLInventoryType::ICONNAME_CLOTHING_UNKNOWN, new IconEntry("inv_item_unknown.tga")); addEntry(LLInventoryType::ICONNAME_INVALID, new IconEntry("inv_invalid.png")); addEntry(LLInventoryType::ICONNAME_NONE, new IconEntry("NONE")); diff --git a/indra/newview/llinventorypanel.cpp b/indra/newview/llinventorypanel.cpp index 3de4fc349..6d8793a4d 100644 --- a/indra/newview/llinventorypanel.cpp +++ b/indra/newview/llinventorypanel.cpp @@ -174,6 +174,7 @@ void LLInventoryPanel::buildFolderView() { root_id = (preferred_type != LLFolderType::FT_NONE) ? gInventory.findCategoryUUIDForType(preferred_type, false, false) + : gInventory.getCategory(static_cast(mStartFolder)) ? static_cast(mStartFolder) // Singu Note: if start folder is an id of a folder, use it : LLUUID::null; } diff --git a/indra/newview/llinventorypanel.h b/indra/newview/llinventorypanel.h index e3d3c54f9..5a858143a 100644 --- a/indra/newview/llinventorypanel.h +++ b/indra/newview/llinventorypanel.h @@ -66,6 +66,7 @@ class LLInvPanelComplObserver; class LLInventoryPanel : public LLPanel { protected: + friend class LFFloaterInvPanel; LLInventoryPanel(const std::string& name, const std::string& sort_order_setting, const std::string& start_folder, diff --git a/indra/newview/lllogchat.cpp b/indra/newview/lllogchat.cpp index 192c5f531..d58e1e556 100644 --- a/indra/newview/lllogchat.cpp +++ b/indra/newview/lllogchat.cpp @@ -36,9 +36,7 @@ #include "lllogchat.h" #include "llappviewer.h" #include "llfloaterchat.h" -#include "llviewercontrol.h" -const S32 LOG_RECALL_SIZE = 2048; //static std::string LLLogChat::makeLogFileName(std::string filename) @@ -47,14 +45,16 @@ std::string LLLogChat::makeLogFileName(std::string filename) { time_t now; time(&now); - char dbuffer[20]; /* Flawfinder: ignore */ + char dbuffer[100]; /* Flawfinder: ignore */ if (filename == "chat") { - strftime(dbuffer, 20, "-%Y-%m-%d", localtime(&now)); + static const LLCachedControl local_chat_date_format(gSavedPerAccountSettings, "LogFileLocalChatDateFormat", "-%Y-%m-%d"); + strftime(dbuffer, 100, local_chat_date_format().c_str(), localtime(&now)); } else { - strftime(dbuffer, 20, "-%Y-%m", localtime(&now)); + static const LLCachedControl ims_date_format(gSavedPerAccountSettings, "LogFileIMsDateFormat", "-%Y-%m"); + strftime(dbuffer, 100, ims_date_format().c_str(), localtime(&now)); } filename += dbuffer; } @@ -92,7 +92,7 @@ std::string LLLogChat::timestamp(bool withdate) std::string text; if (withdate) if (withseconds) - text = llformat("[%d-%02d-%02d %02d:%02d:%02d] ", (timep->tm_year-100)+2000, timep->tm_mon+1, timep->tm_mday, timep->tm_hour, timep->tm_min, timep->tm_sec); + text = llformat("[%d/%02d/%02d %02d:%02d:%02d] ", (timep->tm_year-100)+2000, timep->tm_mon+1, timep->tm_mday, timep->tm_hour, timep->tm_min, timep->tm_sec); else text = llformat("[%d/%02d/%02d %02d:%02d] ", (timep->tm_year-100)+2000, timep->tm_mon+1, timep->tm_mday, timep->tm_hour, timep->tm_min); else @@ -127,55 +127,81 @@ void LLLogChat::saveHistory(std::string const& filename, std::string line) } } -void LLLogChat::loadHistory(std::string const& filename , void (*callback)(ELogLineType,std::string,void*), void* userdata) +static long const LOG_RECALL_BUFSIZ = 2048; + +void LLLogChat::loadHistory(std::string const& filename , void (*callback)(ELogLineType, std::string, void*), void* userdata) { - if(!filename.size()) + bool filename_empty = filename.empty(); + if (filename_empty) { - llwarns << "Filename is Empty!" << llendl; - return ; + llwarns << "filename is empty!" << llendl; } - - LLFILE* fptr = LLFile::fopen(makeLogFileName(filename), "r"); /*Flawfinder: ignore*/ - if (!fptr) + else while(1) // So we can use break. { - //LLUIString message = LLFloaterChat::getInstance()->getString("IM_logging_string"); - //callback(LOG_EMPTY,"IM_logging_string",userdata); - callback(LOG_EMPTY,LLStringUtil::null,userdata); - return; //No previous conversation with this name. - } - else - { - char buffer[LOG_RECALL_SIZE]; /*Flawfinder: ignore*/ - char *bptr; - S32 len; - bool firstline=TRUE; + // The number of lines to return. + static const LLCachedControl lines("LogShowHistoryLines", 32); + if (lines == 0) break; - if ( fseek(fptr, (LOG_RECALL_SIZE - 1) * -1 , SEEK_END) ) - { //File is smaller than recall size. Get it all. - firstline = FALSE; - if ( fseek(fptr, 0, SEEK_SET) ) - { - fclose(fptr); - return; - } - } + // Open the log file. + LLFILE* fptr = LLFile::fopen(makeLogFileName(filename), "rb"); + if (!fptr) break; - while ( fgets(buffer, LOG_RECALL_SIZE, fptr) && !feof(fptr) ) + // Set pos to point to the last character of the file, if any. + if (fseek(fptr, 0, SEEK_END)) break; + long pos = ftell(fptr) - 1; + if (pos < 0) break; + + char buffer[LOG_RECALL_BUFSIZ]; + bool error = false; + U32 nlines = 0; + while (pos > 0 && nlines < lines) { - len = strlen(buffer) - 1; /*Flawfinder: ignore*/ - for ( bptr = (buffer + len); (*bptr == '\n' || *bptr == '\r') && bptr>buffer; bptr--) *bptr='\0'; - - if (!firstline) + // Read the LOG_RECALL_BUFSIZ characters before pos. + size_t size = llmin(LOG_RECALL_BUFSIZ, pos); + pos -= size; + fseek(fptr, pos, SEEK_SET); + size_t len = fread(buffer, 1, size, fptr); + error = len != size; + if (error) break; + // Count the number of newlines in it and set pos to the beginning of the first line to return when we found enough. + for (char const* p = buffer + size - 1; p >= buffer; --p) { - callback(LOG_LINE,std::string(buffer),userdata); - } - else - { - firstline = FALSE; + if (*p == '\n') + { + if (++nlines == lines) + { + pos += p - buffer + 1; + break; + } + } } } - callback(LOG_END,LLStringUtil::null,userdata); - + if (error) + { + fclose(fptr); + break; + } + + // Set the file pointer at the first line to return. + fseek(fptr, pos, SEEK_SET); + + // Read lines from the file one by one until we reach the end of the file. + while (fgets(buffer, LOG_RECALL_BUFSIZ, fptr)) + { + size_t len = strlen(buffer); + int i = len - 1; + while (i >= 0 && (buffer[i] == '\r' || buffer[i] == '\n')) // strip newline chars from the end of the string + { + buffer[i] = '\0'; + i--; + } + callback(LOG_LINE, buffer, userdata); + } + fclose(fptr); + callback(LOG_END, LLStringUtil::null, userdata); + return; } + callback(LOG_EMPTY, LLStringUtil::null, userdata); } + diff --git a/indra/newview/llmakeoutfitdialog.cpp b/indra/newview/llmakeoutfitdialog.cpp index 2c607e6c7..fb47753a2 100644 --- a/indra/newview/llmakeoutfitdialog.cpp +++ b/indra/newview/llmakeoutfitdialog.cpp @@ -62,9 +62,9 @@ LLMakeOutfitDialog::LLMakeOutfitDialog(bool modal) : LLModalDialog(LLStringUtil: else { bool enabled = gAgentWearables.getWearableCount((LLWearableType::EType)i); // TODO: MULTI-WEARABLE - bool selected = enabled && (LLWearableType::WT_SHIRT <= i); // only select clothing by default + //bool selected = enabled && (LLWearableType::WT_SHIRT <= i); // only select clothing by default childSetEnabled(name, enabled); - childSetValue(name, selected); + childSetValue(name, enabled); } } @@ -81,6 +81,7 @@ LLMakeOutfitDialog::LLMakeOutfitDialog(bool modal) : LLModalDialog(LLStringUtil: std::string name = std::string("checkbox_") + attachment->getName(); mCheckBoxList.push_back(std::make_pair(name, attachment_pt)); childSetEnabled(name, object_attached); + childSetValue(name, object_attached); } } diff --git a/indra/newview/llmanip.cpp b/indra/newview/llmanip.cpp index 44ab0f9bc..f83e14e9b 100644 --- a/indra/newview/llmanip.cpp +++ b/indra/newview/llmanip.cpp @@ -47,9 +47,9 @@ #include "llviewercamera.h" #include "llviewerjoint.h" #include "llviewerobject.h" +#include "llviewerregion.h" #include "llviewerwindow.h" #include "llvoavatar.h" -#include "llworld.h" // for LLWorld::getInstance() #include "llresmgr.h" #include "pipeline.h" #include "llglheaders.h" @@ -406,7 +406,7 @@ void LLManip::renderGuidelines(BOOL draw_x, BOOL draw_y, BOOL draw_z) grid_rot.getAngleAxis(&angle_radians, &x, &y, &z); gGL.rotatef(angle_radians * RAD_TO_DEG, x, y, z); - F32 region_size = LLWorld::getInstance()->getRegionWidthInMeters(); + F32 region_size = object->getRegion()->getWidth(); const F32 LINE_ALPHA = 0.33f; diff --git a/indra/newview/llmanipscale.cpp b/indra/newview/llmanipscale.cpp index 76aa99775..c3b21429c 100644 --- a/indra/newview/llmanipscale.cpp +++ b/indra/newview/llmanipscale.cpp @@ -1344,7 +1344,7 @@ void LLManipScale::renderGuidelinesPart( const LLBBox& bbox ) guideline_end -= guideline_start; guideline_end.normVec(); - guideline_end *= LLWorld::getInstance()->getRegionWidthInMeters(); + guideline_end *= gAgent.getRegion()->getWidth(); guideline_end += guideline_start; { diff --git a/indra/newview/llmaniptranslate.cpp b/indra/newview/llmaniptranslate.cpp index c7e31fd45..7c9a0aadc 100644 --- a/indra/newview/llmaniptranslate.cpp +++ b/indra/newview/llmaniptranslate.cpp @@ -62,6 +62,7 @@ #include "llui.h" #include "pipeline.h" #include "hippogridmanager.h" +#include "hippolimits.h" // [RLVa:KB] #include "rlvhandler.h" @@ -743,9 +744,9 @@ BOOL LLManipTranslate::handleHover(S32 x, S32 y, MASK mask) } // For safety, cap heights where objects can be dragged - if (new_position_global.mdV[VZ] > MAX_OBJECT_Z) + if (new_position_global.mdV[VZ] > gHippoLimits->getMaxHeight()) { - new_position_global.mdV[VZ] = MAX_OBJECT_Z; + new_position_global.mdV[VZ] = gHippoLimits->getMaxHeight(); } // Grass is always drawn on the ground, so clamp its position to the ground diff --git a/indra/newview/llmarketplacefunctions.cpp b/indra/newview/llmarketplacefunctions.cpp index ed7c774c8..74a8ddbcf 100644 --- a/indra/newview/llmarketplacefunctions.cpp +++ b/indra/newview/llmarketplacefunctions.cpp @@ -201,7 +201,6 @@ namespace LLMarketplaceImport class LLImportGetResponder : public LLHTTPClient::ResponderWithCompleted { public: - /*virtual*/ bool followRedir(void) const { return true; } /*virtual*/ bool needsHeaders(void) const { return true; } /*virtual*/ void completedHeaders(U32 status, std::string const& reason, AIHTTPReceivedHeaders const& headers) diff --git a/indra/newview/llmeshrepository.cpp b/indra/newview/llmeshrepository.cpp index 66ed09f26..55afaecee 100644 --- a/indra/newview/llmeshrepository.cpp +++ b/indra/newview/llmeshrepository.cpp @@ -2412,7 +2412,11 @@ void LLMeshRepository::notifyLoadedMeshes() { region_name = gAgent.getRegion()->getName(); - mGetMeshCapability = gAgent.getRegion()->getCapability("GetMesh"); + mGetMeshCapability = gAgent.getRegion()->getCapability("GetMesh2"); + if (mGetMeshCapability.empty()) + { + mGetMeshCapability = gAgent.getRegion()->getCapability("GetMesh"); + } } } diff --git a/indra/newview/llnetmap.cpp b/indra/newview/llnetmap.cpp index 7094c67b1..162d036af 100644 --- a/indra/newview/llnetmap.cpp +++ b/indra/newview/llnetmap.cpp @@ -40,6 +40,7 @@ #include "lllocalcliprect.h" #include "llrender.h" +#include "lfsimfeaturehandler.h" #include "llfloateravatarlist.h" #include "llagent.h" @@ -89,6 +90,9 @@ const F32 DOT_SCALE = 0.75f; const F32 MIN_PICK_SCALE = 2.f; const S32 MOUSE_DRAG_SLOP = 2; // How far the mouse needs to move before we think it's a drag +const F32 WIDTH_PIXELS = 2.f; +const S32 CIRCLE_STEPS = 100; + LLNetMap::LLNetMap(const std::string& name) : LLPanel(name), mScale(128.f), @@ -101,7 +105,7 @@ LLNetMap::LLNetMap(const std::string& name) : mUpdateNow( FALSE ) { mScale = gSavedSettings.getF32("MiniMapScale"); - mPixelsPerMeter = mScale / LLWorld::getInstance()->getRegionWidthInMeters(); + mPixelsPerMeter = mScale / REGION_WIDTH_METERS; mDotRadius = llmax(DOT_SCALE * mPixelsPerMeter, MIN_DOT_RADIUS); mObjectImageCenterGlobal = gAgentCamera.getCameraPositionGlobal(); @@ -110,8 +114,8 @@ LLNetMap::LLNetMap(const std::string& name) : (new LLScaleMap())->registerListener(this, "MiniMap.ZoomLevel"); (new LLCenterMap())->registerListener(this, "MiniMap.Center"); (new LLCheckCenterMap())->registerListener(this, "MiniMap.CheckCenter"); - (new LLRotateMap())->registerListener(this, "MiniMap.Rotate"); - (new LLCheckRotateMap())->registerListener(this, "MiniMap.CheckRotate"); + (new LLChatRings())->registerListener(this, "MiniMap.ChatRings"); + (new LLCheckChatRings())->registerListener(this, "MiniMap.CheckChatRings"); (new LLStopTracking())->registerListener(this, "MiniMap.StopTracking"); (new LLEnableTracking())->registerListener(this, "MiniMap.EnableTracking"); (new LLShowAgentProfile())->registerListener(this, "MiniMap.ShowProfile"); @@ -124,6 +128,7 @@ LLNetMap::LLNetMap(const std::string& name) : (new mmsetcustom())->registerListener(this, "MiniMap.setcustom"); (new mmsetunmark())->registerListener(this, "MiniMap.setunmark"); (new mmenableunmark())->registerListener(this, "MiniMap.enableunmark"); + (new LLToggleControl())->registerListener(this, "MiniMap.ToggleControl"); LLUICtrlFactory::getInstance()->buildPanel(this, "panel_mini_map.xml"); @@ -157,13 +162,16 @@ void LLNetMap::setScale( F32 scale ) F32 height = (F32)(getRect().getHeight()); F32 diameter = sqrt(width * width + height * height); F32 region_widths = diameter / mScale; - F32 meters = region_widths * LLWorld::getInstance()->getRegionWidthInMeters(); +// Aurora Sim + //F32 meters = region_widths * LLWorld::getInstance()->getRegionWidthInMeters(); + F32 meters = region_widths * REGION_WIDTH_METERS; +// Aurora Sim F32 num_pixels = (F32)mObjectImagep->getWidth(); mObjectMapTPM = num_pixels / meters; mObjectMapPixels = diameter; } - mPixelsPerMeter = mScale / LLWorld::getInstance()->getRegionWidthInMeters(); + mPixelsPerMeter = mScale / REGION_WIDTH_METERS; mDotRadius = llmax(DOT_SCALE * mPixelsPerMeter, MIN_DOT_RADIUS); mUpdateNow = TRUE; @@ -191,6 +199,10 @@ void LLNetMap::draw() { static LLFrameTimer map_timer; + static const LLCachedControl map_whisper_ring_color("MiniMapWhisperRingColor", LLColor4(0.f,1.f,0.f,0.5f)); + static const LLCachedControl map_chat_ring_color("MiniMapChatRingColor", LLColor4(0.f,0.f,1.f,0.5f)); + static const LLCachedControl map_shout_ring_color("MiniMapShoutRingColor", LLColor4(1.f,0.f,0.f,0.5f)); + if (mObjectImagep.isNull()) { createObjectImage(); @@ -256,12 +268,15 @@ void LLNetMap::draw() LLColor4 this_region_color = gColors.getColor( "NetMapThisRegion" ); LLColor4 live_region_color = gColors.getColor( "NetMapLiveRegion" ); LLColor4 dead_region_color = gColors.getColor( "NetMapDeadRegion" ); +// Aurora Sim + //S32 region_width = llround(LLWorld::getInstance()->getRegionWidthInMeters()); + S32 region_width = REGION_WIDTH_UNITS; +// Aurora Sim for (LLWorld::region_list_t::const_iterator iter = LLWorld::getInstance()->getRegionList().begin(); iter != LLWorld::getInstance()->getRegionList().end(); ++iter) { LLViewerRegion* regionp = *iter; - S32 region_width = llround(regionp->getWidth()); // Find x and y position relative to camera's center. LLVector3 origin_agent = regionp->getOriginAgent(); LLVector3 rel_region_pos = origin_agent - gAgentCamera.getCameraPositionAgent(); @@ -271,8 +286,12 @@ void LLNetMap::draw() // background region rectangle F32 bottom = relative_y; F32 left = relative_x; - F32 top = bottom + mScale ; - F32 right = left + mScale ; +// Aurora Sim + //F32 top = bottom + mScale ; + //F32 right = left + mScale ; + F32 top = bottom + (regionp->getWidth() / REGION_WIDTH_METERS) * mScale ; + F32 right = left + (regionp->getWidth() / REGION_WIDTH_METERS) * mScale ; +// Aurora Sim gGL.color4fv(regionp == gAgent.getRegion() ? this_region_color.mV : live_region_color.mV); if (!regionp->isAlive()) @@ -331,18 +350,20 @@ void LLNetMap::draw() U8 *default_texture = mObjectRawImagep->getData(); memset( default_texture, 0, mObjectImagep->getWidth() * mObjectImagep->getHeight() * mObjectImagep->getComponents() ); - // Draw buildings - gObjectList.renderObjectsForMap(*this); + if (gSavedSettings.getBOOL("ShowMiniMapObjects")) + { + gObjectList.renderObjectsForMap(*this); // Draw buildings. + } mObjectImagep->setSubImage(mObjectRawImagep, 0, 0, mObjectImagep->getWidth(), mObjectImagep->getHeight()); - + map_timer.reset(); } LLVector3 map_center_agent = gAgent.getPosAgentFromGlobal(mObjectImageCenterGlobal); map_center_agent -= gAgentCamera.getCameraPositionAgent(); - map_center_agent.mV[0] *= mScale/LLWorld::getInstance()->getRegionWidthInMeters(); - map_center_agent.mV[1] *= mScale/LLWorld::getInstance()->getRegionWidthInMeters(); + map_center_agent.mV[0] *= mScale/REGION_WIDTH_METERS; + map_center_agent.mV[1] *= mScale/REGION_WIDTH_METERS; gGL.getTexUnit(0)->bind(mObjectImagep); F32 image_half_width = 0.5f*mObjectMapPixels; @@ -375,7 +396,7 @@ void LLNetMap::draw() // Draw avatars // LLColor4 mapcolor = gAvatarMapColor; - static const LLCachedControl standard_color(gColors,"MapAvatar",LLColor4(0.f,1.f,0.f,1.f)); + static const LLCachedControl standard_color("MapAvatar",LLColor4(0.f,1.f,0.f,1.f)); static const LLCachedControl friend_color_stored("AscentFriendColor",LLColor4(1.f,1.f,0.f,1.f)); static const LLCachedControl em_color("AscentEstateOwnerColor",LLColor4(1.f,0.6f,1.f,1.f)); static const LLCachedControl linden_color("AscentLindenColor",LLColor4(0.f,0.f,1.f,1.f)); @@ -478,8 +499,22 @@ void LLNetMap::draw() dot_width, dot_width); + // Draw chat range ring(s) + static LLUICachedControl whisper_ring("MiniMapWhisperRing"); + static LLUICachedControl chat_ring("MiniMapChatRing"); + static LLUICachedControl shout_ring("MiniMapShoutRing"); + if(whisper_ring) + drawRing(LFSimFeatureHandler::getInstance()->whisperRange(), pos_map, map_whisper_ring_color); + if(chat_ring) + drawRing(LFSimFeatureHandler::getInstance()->sayRange(), pos_map, map_chat_ring_color); + if(shout_ring) + drawRing(LFSimFeatureHandler::getInstance()->shoutRange(), pos_map, map_shout_ring_color); + // Draw frustum - F32 meters_to_pixels = mScale/ LLWorld::getInstance()->getRegionWidthInMeters(); +// Aurora Sim + //F32 meters_to_pixels = mScale/ LLWorld::getInstance()->getRegionWidthInMeters(); + F32 meters_to_pixels = mScale/ REGION_WIDTH_METERS; +// Aurora Sim F32 horiz_fov = LLViewerCamera::getInstance()->getView() * LLViewerCamera::getInstance()->getAspect(); F32 far_clip_meters = LLViewerCamera::getInstance()->getFar(); @@ -551,6 +586,9 @@ LLVector3 LLNetMap::globalPosToView(const LLVector3d& global_pos, BOOL rotated) LLVector3 pos_local; pos_local.setVec(relative_pos_global); // convert to floats from doubles +// Aurora Sim + mPixelsPerMeter = mScale / REGION_WIDTH_METERS; +// Aurora Sim pos_local.mV[VX] *= mPixelsPerMeter; pos_local.mV[VY] *= mPixelsPerMeter; // leave Z component in meters @@ -568,6 +606,22 @@ LLVector3 LLNetMap::globalPosToView(const LLVector3d& global_pos, BOOL rotated) return pos_local; } +void LLNetMap::drawRing(const F32 radius, const LLVector3 pos_map, const LLColor4& color) + +{ +// Aurora Sim + F32 meters_to_pixels = mScale / LLWorld::getInstance()->getRegionWidthInMeters(); + //F32 meters_to_pixels = mScale / REGION_WIDTH_METERS; +// Aurora Sim + F32 radius_pixels = radius * meters_to_pixels; + + gGL.matrixMode(LLRender::MM_MODELVIEW); + gGL.pushMatrix(); + gGL.translatef((F32)pos_map.mV[VX], (F32)pos_map.mV[VY], 0.f); + gl_ring(radius_pixels, WIDTH_PIXELS, color, color, CIRCLE_STEPS, FALSE); + gGL.popMatrix(); +} + void LLNetMap::drawTracking(const LLVector3d& pos_global, BOOL rotated, const LLColor4& color, BOOL draw_arrow ) { @@ -609,7 +663,10 @@ LLVector3d LLNetMap::viewPosToGlobal( S32 x, S32 y, BOOL rotated ) pos_local.rotVec( rot ); } - pos_local *= ( LLWorld::getInstance()->getRegionWidthInMeters() / mScale ); +// Aurora Sim + //pos_local *= ( LLWorld::getInstance()->getRegionWidthInMeters() / mScale ); + pos_local *= ( REGION_WIDTH_METERS / mScale ); +// Aurora Sim LLVector3d pos_global; pos_global.setVec( pos_local ); @@ -1102,19 +1159,29 @@ bool LLNetMap::LLCheckCenterMap::handleEvent(LLPointer event, const LLS return true; } -bool LLNetMap::LLRotateMap::handleEvent(LLPointer event, const LLSD& userdata) +bool LLNetMap::LLChatRings::handleEvent(LLPointer event, const LLSD& userdata) { - BOOL rotate = gSavedSettings.getBOOL("MiniMapRotate"); - gSavedSettings.setBOOL("MiniMapRotate", !rotate); - + BOOL whisper_enabled = gSavedSettings.getBOOL("MiniMapWhisperRing"); + BOOL chat_enabled = gSavedSettings.getBOOL("MiniMapChatRing"); + BOOL shout_enabled = gSavedSettings.getBOOL("MiniMapShoutRing"); + BOOL all_enabled = whisper_enabled && chat_enabled && shout_enabled; + + gSavedSettings.setBOOL("MiniMapWhisperRing", !all_enabled); + gSavedSettings.setBOOL("MiniMapChatRing", !all_enabled); + gSavedSettings.setBOOL("MiniMapShoutRing", !all_enabled); + return true; } -bool LLNetMap::LLCheckRotateMap::handleEvent(LLPointer event, const LLSD& userdata) +bool LLNetMap::LLCheckChatRings::handleEvent(LLPointer event, const LLSD& userdata) { + BOOL whisper_enabled = gSavedSettings.getBOOL("MiniMapWhisperRing"); + BOOL chat_enabled = gSavedSettings.getBOOL("MiniMapChatRing"); + BOOL shout_enabled = gSavedSettings.getBOOL("MiniMapShoutRing"); + BOOL all_enabled = whisper_enabled && chat_enabled && shout_enabled; + LLNetMap *self = mPtr; - BOOL enabled = gSavedSettings.getBOOL("MiniMapRotate"); - self->findControl(userdata["control"].asString())->setValue(enabled); + self->findControl(userdata["control"].asString())->setValue(all_enabled); return true; } @@ -1163,3 +1230,11 @@ bool LLNetMap::LLEnableProfile::handleEvent(LLPointer event, const LLSD //self->findControl(userdata["control"].asString())->setValue(self->isAgentUnderCursor()); return true; } + +bool LLNetMap::LLToggleControl::handleEvent(LLPointer event, const LLSD& userdata) +{ + std::string control_name = userdata.asString(); + gSavedSettings.setBOOL(control_name, !gSavedSettings.getBOOL(control_name)); + return true; +} + diff --git a/indra/newview/llnetmap.h b/indra/newview/llnetmap.h index a709761d6..82f48bc9a 100644 --- a/indra/newview/llnetmap.h +++ b/indra/newview/llnetmap.h @@ -82,6 +82,8 @@ private: LLVector3 globalPosToView(const LLVector3d& global_pos, BOOL rotated); LLVector3d viewPosToGlobal(S32 x,S32 y, BOOL rotated); + void drawRing(const F32 radius, LLVector3 pos_map, const LLColor4& color); + void drawTracking( const LLVector3d& pos_global, BOOL rotated, const LLColor4& color, @@ -145,13 +147,13 @@ private: /*virtual*/ bool handleEvent(LLPointer event, const LLSD& userdata); }; - class LLRotateMap : public LLMemberListener + class LLChatRings : public LLMemberListener { public: /*virtual*/ bool handleEvent(LLPointer event, const LLSD& userdata); }; - class LLCheckRotateMap : public LLMemberListener + class LLCheckChatRings : public LLMemberListener { public: /*virtual*/ bool handleEvent(LLPointer event, const LLSD& userdata); @@ -230,6 +232,13 @@ private: public: /*virtual*/ bool handleEvent(LLPointer event, const LLSD& userdata); }; + + class LLToggleControl : public LLMemberListener + { + public: + /*virtual*/ bool handleEvent(LLPointer event, const LLSD& userdata); + }; + }; diff --git a/indra/newview/lloverlaybar.cpp b/indra/newview/lloverlaybar.cpp index 114bc56f1..9bbf00567 100644 --- a/indra/newview/lloverlaybar.cpp +++ b/indra/newview/lloverlaybar.cpp @@ -39,20 +39,13 @@ #include "aoremotectrl.h" #include "llaudioengine.h" -#include "importtracker.h" -#include "llrender.h" #include "llagent.h" #include "llagentcamera.h" -#include "llbutton.h" #include "llchatbar.h" -#include "llfocusmgr.h" -#include "llimview.h" +#include "llfloaterchatterbox.h" #include "llmediaremotectrl.h" #include "llpanelaudiovolume.h" #include "llparcel.h" -#include "lltextbox.h" -#include "llui.h" -#include "llviewercontrol.h" #include "llviewertexturelist.h" #include "llviewerjoystick.h" #include "llviewermedia.h" @@ -61,20 +54,13 @@ #include "llviewerparcelmedia.h" #include "llviewerparcelmgr.h" #include "lluictrlfactory.h" -#include "llviewercontrol.h" -#include "llviewerwindow.h" #include "llvoiceclient.h" #include "llvoavatarself.h" #include "llvoiceremotectrl.h" -#include "llmediactrl.h" #include "llselectmgr.h" #include "wlfPanel_AdvSettings.h" #include "llpanelnearbymedia.h" - - -#include "llcontrol.h" - // [RLVa:KB] #include "rlvhandler.h" // [/RLVa:KB] @@ -308,9 +294,19 @@ void LLOverlayBar::refresh() { bool buttons_changed = FALSE; - if(LLButton* button = updateButtonVisiblity(mNewIM,gIMMgr->getIMReceived())) + int unread_count(gIMMgr->getIMUnreadCount()); + static const LLCachedControl per_conversation("NewIMsPerConversation"); + static const LLCachedControl reset_count("NewIMsPerConversationReset"); + if (per_conversation && (!reset_count || unread_count) && !LLFloaterChatterBox::instanceVisible()) + { + unread_count = 0; + for(std::set >::const_iterator it = gIMMgr->getIMFloaterHandles().begin(); it != gIMMgr->getIMFloaterHandles().end(); ++it) + if (LLFloaterIMPanel* im_floater = static_cast(it->get())) + if (im_floater->getParent() != gFloaterView && im_floater->getNumUnreadMessages()) // Only count docked IMs + ++unread_count; + } + if (LLButton* button = updateButtonVisiblity(mNewIM, unread_count)) { - int unread_count = gIMMgr->getIMUnreadCount(); if (unread_count > 0) { if (unread_count > 1) diff --git a/indra/newview/llpanelavatar.cpp b/indra/newview/llpanelavatar.cpp index 6f5dcb6af..2c6e5a057 100644 --- a/indra/newview/llpanelavatar.cpp +++ b/indra/newview/llpanelavatar.cpp @@ -46,6 +46,7 @@ #include "llagent.h" #include "llavataractions.h" +#include "llavatarpropertiesprocessor.h" #include "llcallingcard.h" #include "lldroptarget.h" #include "llfloatergroupinfo.h" @@ -183,56 +184,11 @@ void LLPanelAvatarSecondLife::processProperties(void* data, EAvatarProcessorType if (pAvatarData && (mAvatarID == pAvatarData->avatar_id) && (pAvatarData->avatar_id != LLUUID::null)) { LLStringUtil::format_map_t args; - - U8 caption_index = 0; - std::string caption_text = getString("CaptionTextAcctInfo"); - - const char* ACCT_TYPE[] = - { - "AcctTypeResident", - "AcctTypeTrial", - "AcctTypeCharterMember", - "AcctTypeEmployee" - }; - - - caption_index = llclamp(caption_index, (U8)0, (U8)(LL_ARRAY_SIZE(ACCT_TYPE)-1)); - args["[ACCTTYPE]"] = getString(ACCT_TYPE[caption_index]); + args["[ACCTTYPE]"] = LLAvatarPropertiesProcessor::accountType(pAvatarData); + args["[PAYMENTINFO]"] = LLAvatarPropertiesProcessor::paymentInfo(pAvatarData); + args["[AGEVERIFICATION]"] = " "; - std::string payment_text = " "; - const S32 DEFAULT_CAPTION_LINDEN_INDEX = 3; - if(caption_index != DEFAULT_CAPTION_LINDEN_INDEX) - { - if(pAvatarData->flags & AVATAR_TRANSACTED) - { - payment_text = "PaymentInfoUsed"; - } - else if (pAvatarData->flags & AVATAR_IDENTIFIED) - { - payment_text = "PaymentInfoOnFile"; - } - else - { - payment_text = "NoPaymentInfoOnFile"; - } - args["[PAYMENTINFO]"] = getString(payment_text); - - // Do not display age verification status at this time - Mostly because it /doesn't work/. -HgB - /*bool age_verified = (pAvatarData->flags & AVATAR_AGEVERIFIED); // Not currently getting set in dataserver/lldataavatar.cpp for privacy consideration - std::string age_text = age_verified ? "AgeVerified" : "NotAgeVerified"; - - args["[AGEVERIFICATION]"] = getString(age_text); - */ - args["[AGEVERIFICATION]"] = " "; - } - else - { - args["[PAYMENTINFO]"] = " "; - args["[AGEVERIFICATION]"] = " "; - } - LLStringUtil::format(caption_text, args); - - childSetValue("acct", caption_text); + getChild("acct")->setValue(getString("CaptionTextAcctInfo", args)); getChild("img")->setImageAssetID(pAvatarData->image_id); @@ -560,9 +516,9 @@ BOOL LLPanelAvatarWeb::postBuild(void) url_edit->setKeystrokeCallback(boost::bind(&LLPanelAvatarWeb::onURLKeystroke,this,_1)); url_edit->setCommitCallback(boost::bind(&LLPanelAvatarWeb::onCommitURL,this,_2)); - childSetAction("web_profile_help",onClickWebProfileHelp,this); + getChild("load")->setCommitCallback(boost::bind(&LLPanelAvatarWeb::onCommitLoad, this, _2)); - childSetControlName("auto_load","AutoLoadWebProfiles"); + childSetAction("web_profile_help",onClickWebProfileHelp,this); mWebBrowser = getChild("profile_html"); mWebBrowser->addObserver(this); @@ -1726,7 +1682,7 @@ void LLPanelAvatar::onClickGetKey(void *userdata) llinfos << "Copy agent id: " << agent_id << llendl; - gViewerWindow->mWindow->copyTextToClipboard(utf8str_to_wstring(agent_id.asString())); + gViewerWindow->getWindow()->copyTextToClipboard(utf8str_to_wstring(agent_id.asString())); } // static diff --git a/indra/newview/llpaneldirpeople.cpp b/indra/newview/llpaneldirpeople.cpp index 308bad48f..efe3612b3 100644 --- a/indra/newview/llpaneldirpeople.cpp +++ b/indra/newview/llpaneldirpeople.cpp @@ -33,12 +33,8 @@ #include "llviewerprecompiledheaders.h" #include "llpaneldirpeople.h" -#include "llviewerwindow.h" #include "llnotificationsutil.h" -// linden library includes -#include "message.h" - // viewer project includes #include "llqueryflags.h" @@ -90,7 +86,10 @@ void LLPanelDirPeople::performQuery() { LLNotificationsUtil::add("SeachFilteredOnShortWordsEmpty"); return; - }; + } + + // Allow searching for Account Name from account.name + LLStringUtil::replaceChar(query_string, '.', ' '); // if we filtered something out, display a popup if ( query_was_filtered ) @@ -98,7 +97,7 @@ void LLPanelDirPeople::performQuery() LLSD args; args["FINALQUERY"] = query_string; LLNotificationsUtil::add("SeachFilteredOnShortWords", args); - }; + } setupNewSearch(); diff --git a/indra/newview/llpaneldisplay.cpp b/indra/newview/llpaneldisplay.cpp index fe381e59c..0f7184757 100644 --- a/indra/newview/llpaneldisplay.cpp +++ b/indra/newview/llpaneldisplay.cpp @@ -1010,8 +1010,8 @@ void LLPanelDisplay::onCommitAutoDetectAspect(const LLSD& value) S32 denominator = 0; // clear any aspect ratio override - gViewerWindow->mWindow->setNativeAspectRatio(0.f); - fractionFromDecimal(gViewerWindow->mWindow->getNativeAspectRatio(), numerator, denominator); + gViewerWindow->getWindow()->setNativeAspectRatio(0.f); + fractionFromDecimal(gViewerWindow->getWindow()->getNativeAspectRatio(), numerator, denominator); std::string aspect; if (numerator != 0) @@ -1020,12 +1020,12 @@ void LLPanelDisplay::onCommitAutoDetectAspect(const LLSD& value) } else { - aspect = llformat("%.3f", gViewerWindow->mWindow->getNativeAspectRatio()); + aspect = llformat("%.3f", gViewerWindow->getWindow()->getNativeAspectRatio()); } mCtrlAspectRatio->setLabel(aspect); - ratio = gViewerWindow->mWindow->getNativeAspectRatio(); + ratio = gViewerWindow->getWindow()->getNativeAspectRatio(); gSavedSettings.setF32("FullScreenAspectRatio", ratio); } } diff --git a/indra/newview/llpaneleditwearable.cpp b/indra/newview/llpaneleditwearable.cpp index 81d807259..8e4f890ff 100644 --- a/indra/newview/llpaneleditwearable.cpp +++ b/indra/newview/llpaneleditwearable.cpp @@ -1424,7 +1424,7 @@ bool LLPanelEditWearable::updatePermissions() // Exporting (of slider values) is allowed when the wearable is full perm, and owned by and created by the user. // Of course, only modifiable is enough for the user to write down the values and enter them else where... but why make it easy for them to break the ToS. if (is_complete && - (item->getPermissions().allowExportBy(gAgent.getID(), LFSimFeatureHandler::instance().simSupportsExport()))) + (item->getPermissions().allowExportBy(gAgent.getID(), LFSimFeatureHandler::instance().exportPolicy()))) { can_export = true; } diff --git a/indra/newview/llpanelgeneral.cpp b/indra/newview/llpanelgeneral.cpp index 812cbc80f..cf339762a 100644 --- a/indra/newview/llpanelgeneral.cpp +++ b/indra/newview/llpanelgeneral.cpp @@ -87,7 +87,7 @@ BOOL LLPanelGeneral::postBuild() childSetValue("ui_auto_scale", gSavedSettings.getBOOL("UIAutoScale")); LLComboBox* crash_behavior_combobox = getChild("crash_behavior_combobox"); - crash_behavior_combobox->setCurrentByIndex(gCrashSettings.getS32(CRASH_BEHAVIOR_SETTING)); + crash_behavior_combobox->setCurrentByIndex(gSavedSettings.getS32(CRASH_BEHAVIOR_SETTING)); childSetValue("language_combobox", gSavedSettings.getString("Language")); @@ -174,7 +174,7 @@ void LLPanelGeneral::apply() gSavedSettings.setString("Language", childGetValue("language_combobox")); LLComboBox* crash_behavior_combobox = getChild("crash_behavior_combobox"); - gCrashSettings.setS32(CRASH_BEHAVIOR_SETTING, crash_behavior_combobox->getCurrentIndex()); + gSavedSettings.setS32(CRASH_BEHAVIOR_SETTING, crash_behavior_combobox->getCurrentIndex()); } void LLPanelGeneral::cancel() diff --git a/indra/newview/llpanelgroup.cpp b/indra/newview/llpanelgroup.cpp index 76d96fd2e..9e4ef15cc 100644 --- a/indra/newview/llpanelgroup.cpp +++ b/indra/newview/llpanelgroup.cpp @@ -131,7 +131,7 @@ void LLPanelGroupTab::handleClickHelp() static void copy_group_profile_uri(const LLUUID& id) { - gViewerWindow->mWindow->copyTextToClipboard(utf8str_to_wstring("secondlife:///app/group/"+id.asString()+"/about")); + gViewerWindow->getWindow()->copyTextToClipboard(utf8str_to_wstring("secondlife:///app/group/"+id.asString()+"/about")); } LLPanelGroup::LLPanelGroup(const LLUUID& group_id) @@ -163,7 +163,7 @@ LLPanelGroup::LLPanelGroup(const LLUUID& group_id) LLGroupMgr::getInstance()->addObserver(this); - mCommitCallbackRegistrar.add("Group.CopyURI", boost::bind(copy_group_profile_uri, group_id)); + mCommitCallbackRegistrar.add("Group.CopyURI", boost::bind(copy_group_profile_uri, boost::ref(mID))); // Pass on construction of this panel to the control factory. LLUICtrlFactory::getInstance()->buildPanel(this, "panel_group.xml", &getFactoryMap()); } diff --git a/indra/newview/llpanelgroupgeneral.cpp b/indra/newview/llpanelgroupgeneral.cpp index ac3ecd30e..2b1bbf804 100644 --- a/indra/newview/llpanelgroupgeneral.cpp +++ b/indra/newview/llpanelgroupgeneral.cpp @@ -844,7 +844,11 @@ void LLPanelGroupGeneral::addMember(LLGroupMemberData* member) item_params.columns.add().column("title").value(member->getTitle()).font/*.name*/("SANSSERIF_SMALL").font_style(style); - item_params.columns.add().column("online").value(member->getOnlineStatus()).font/*.name*/("SANSSERIF_SMALL").font_style(style); + static const LLCachedControl format(gSavedSettings, "ShortDateFormat"); + static const std::string online(LLTrans::getString("group_member_status_online")); + item_params.columns.add().column("online").value(member->getOnlineStatus()) + .format(format).type(member->getOnlineStatus() == online ? "text" : "date") + .font/*.name*/("SANSSERIF_SMALL").font_style(style); /*LLScrollListItem* member_row =*/ mListVisibleMembers->addNameItemRow(item_params); } diff --git a/indra/newview/llpanelgroupnotices.cpp b/indra/newview/llpanelgroupnotices.cpp index 87e237369..39c86e307 100644 --- a/indra/newview/llpanelgroupnotices.cpp +++ b/indra/newview/llpanelgroupnotices.cpp @@ -455,7 +455,6 @@ void LLPanelGroupNotices::processNotices(LLMessageSystem* msg) msg->getBOOL("Data","HasAttachment",has_attachment,i); msg->getU8("Data","AssetType",asset_type,i); msg->getU32("Data","Timestamp",timestamp,i); - time_t t = timestamp; LLSD row; row["id"] = id; @@ -477,9 +476,13 @@ void LLPanelGroupNotices::processNotices(LLMessageSystem* msg) row["columns"][2]["value"] = name; std::string buffer; - timeToFormattedString(t, gSavedSettings.getString("ShortDateFormat"), buffer); + std::string format(gSavedSettings.getString("ShortDateFormat")); + if (gSavedSettings.getBOOL("LiruGroupNoticeTimes")) + format += " " + gSavedSettings.getString("ShortTimeFormat"); + row["columns"][3]["type"] = "date"; + row["columns"][3]["format"] = format; row["columns"][3]["column"] = "date"; - row["columns"][3]["value"] = buffer; + row["columns"][3]["value"] = LLDate(timestamp); buffer = llformat( "%u", timestamp); row["columns"][4]["column"] = "sort"; diff --git a/indra/newview/llpanelgrouproles.cpp b/indra/newview/llpanelgrouproles.cpp index 2a540e1c1..d713ff9e8 100644 --- a/indra/newview/llpanelgrouproles.cpp +++ b/indra/newview/llpanelgrouproles.cpp @@ -50,6 +50,7 @@ #include "lltabcontainer.h" #include "lltextbox.h" #include "lltexteditor.h" +#include "lltrans.h" #include "llviewertexturelist.h" #include "llviewerwindow.h" #include "llfocusmgr.h" @@ -1536,7 +1537,10 @@ void LLPanelGroupMembersSubTab::addMemberToList(LLGroupMemberData* data) item_params.columns.add().column("donated").value(donated.getString()) .font/*.name*/("SANSSERIF_SMALL")/*.style("NORMAL")*/; + static const LLCachedControl format(gSavedSettings, "ShortDateFormat"); + static const std::string online(LLTrans::getString("group_member_status_online")); item_params.columns.add().column("online").value(data->getOnlineStatus()) + .format(format).type(data->getOnlineStatus() == online ? "text" : "date") .font/*.name*/("SANSSERIF_SMALL")/*.style("NORMAL")*/; mMembersList->addNameItemRow(item_params); diff --git a/indra/newview/llpanellogin.cpp b/indra/newview/llpanellogin.cpp index 6c8b59273..d8b8a1711 100644 --- a/indra/newview/llpanellogin.cpp +++ b/indra/newview/llpanellogin.cpp @@ -187,12 +187,12 @@ LLPanelLogin::LLPanelLogin(const LLRect &rect, reshape(rect.getWidth(), rect.getHeight()); - LLComboBox* name_combo = sInstance->getChild("name_combo"); - name_combo->setCommitCallback(boost::bind(LLPanelLogin::onSelectLoginEntry, _1, this)); - name_combo->setFocusLostCallback(boost::bind(&LLPanelLogin::onLoginComboLostFocus, this, name_combo)); - name_combo->setPrevalidate(LLLineEditor::prevalidatePrintableNotPipe); - name_combo->setSuppressTentative(true); - name_combo->setSuppressAutoComplete(true); + LLComboBox* username_combo(getChild("username_combo")); + username_combo->setCommitCallback(boost::bind(LLPanelLogin::onSelectLoginEntry, _1, this)); + username_combo->setFocusLostCallback(boost::bind(&LLPanelLogin::onLoginComboLostFocus, this, username_combo)); + username_combo->setPrevalidate(LLLineEditor::prevalidatePrintableNotPipe); + username_combo->setSuppressTentative(true); + username_combo->setSuppressAutoComplete(true); childSetCommitCallback("remember_name_check", onNameCheckChanged); @@ -215,6 +215,7 @@ LLPanelLogin::LLPanelLogin(const LLRect &rect, LLComboBox *server_choice_combo = getChild("grids_combo"); server_choice_combo->setCommitCallback(boost::bind(&LLPanelLogin::onSelectGrid, _1)); + server_choice_combo->setFocusLostCallback(boost::bind(&LLPanelLogin::onSelectGrid, server_choice_combo)); // Load all of the grids, sorted, and then add a bar and the current grid at the top updateGridCombo(); @@ -245,6 +246,15 @@ LLPanelLogin::LLPanelLogin(const LLRect &rect, childSetAction("connect_btn", onClickConnect, this); setDefaultBtn("connect_btn"); + // Also set default button for subpanels, otherwise hitting enter in text entry fields won't login + { + LLButton* connect_btn(findChild("connect_btn")); + findChild("name_panel")->setDefaultBtn(connect_btn); + findChild("password_panel")->setDefaultBtn(connect_btn); + findChild("grids_panel")->setDefaultBtn(connect_btn); + findChild("location_panel")->setDefaultBtn(connect_btn); + findChild("login_html")->setDefaultBtn(connect_btn); + } childSetAction("grids_btn", onClickGrids, this); @@ -349,7 +359,7 @@ void LLPanelLogin::setLoginHistory(LLSavedLogins const& login_history) { sInstance->mLoginHistoryData = login_history; - LLComboBox* login_combo = sInstance->getChild("name_combo"); + LLComboBox* login_combo = sInstance->getChild("username_combo"); llassert(login_combo); login_combo->clear(); @@ -531,7 +541,7 @@ void LLPanelLogin::setFields(const std::string& firstname, return; } - LLComboBox* login_combo = sInstance->getChild("name_combo"); + LLComboBox* login_combo = sInstance->getChild("username_combo"); llassert_always(firstname.find(' ') == std::string::npos); login_combo->setLabel(nameJoin(firstname, lastname, false)); @@ -572,10 +582,10 @@ void LLPanelLogin::setFields(const LLSavedLoginEntry& entry, bool takeFocus) LLCheckBoxCtrl* remember_pass_check = sInstance->getChild("remember_check"); std::string fullname = nameJoin(entry.getFirstName(), entry.getLastName(), entry.isSecondLife()); - LLComboBox* login_combo = sInstance->getChild("name_combo"); + LLComboBox* login_combo = sInstance->getChild("username_combo"); login_combo->setTextEntry(fullname); login_combo->resetTextDirty(); - //sInstance->childSetText("name_combo", fullname); + //sInstance->childSetText("username_combo", fullname); std::string grid = entry.getGrid(); //grid comes via LLSavedLoginEntry, which uses full grid names, not nicks @@ -615,7 +625,7 @@ void LLPanelLogin::getFields(std::string *firstname, return; } - nameSplit(sInstance->getChild("name_combo")->getTextEntry(), *firstname, *lastname); + nameSplit(sInstance->getChild("username_combo")->getTextEntry(), *firstname, *lastname); LLStringUtil::trim(*firstname); LLStringUtil::trim(*lastname); @@ -888,10 +898,10 @@ void LLPanelLogin::onClickConnect(void *) { // JC - Make sure the fields all get committed. - sInstance->setFocus(FALSE); + gFocusMgr.setKeyboardFocus(NULL); std::string first, last, password; - if (nameSplit(sInstance->getChild("name_combo")->getTextEntry(), first, last)) + if (nameSplit(sInstance->getChild("username_combo")->getTextEntry(), first, last)) { // has both first and last name typed sInstance->mCallback(0, sInstance->mCallbackData); @@ -1022,13 +1032,40 @@ void LLPanelLogin::refreshLoginPage() //void LLPanelLogin::onSelectServer() void LLPanelLogin::onSelectGrid(LLUICtrl *ctrl) { - gHippoGridManager->setCurrentGrid(ctrl->getValue()); + std::string grid(ctrl->getValue().asString()); + LLStringUtil::trim(grid); // Guard against copy paste + if (!gHippoGridManager->getGrid(grid)) // We can't get an input grid by name or nick, perhaps a Login URI was entered + { + HippoGridInfo* info(new HippoGridInfo("")); // Start off with empty grid name, otherwise we don't know what to name + info->setLoginUri(grid); + if (info->retrieveGridInfo()) // There's info from this URI + { + grid = info->getGridName(); + if (HippoGridInfo* nick_info = gHippoGridManager->getGrid(info->getGridNick())) // Grid of same nick exists + { + delete info; + grid = nick_info->getGridName(); + } + else // Guess not, try adding this grid + { + gHippoGridManager->addGrid(info); // deletes info if not needed (existing or no name) + } + } + else + { + delete info; + grid = gHippoGridManager->getCurrentGridName(); + } + } + gHippoGridManager->setCurrentGrid(grid); + ctrl->setValue(grid); } void LLPanelLogin::onLocationSLURL() { LLComboBox* location_combo = getChild("start_location_combo"); std::string location = location_combo->getValue().asString(); + LLStringUtil::trim(location); LL_DEBUGS("AppInit")<getChild("name_combo"); + LLComboBox* combo = sInstance->getChild("username_combo"); if (ctrl == combo) { LLSD selected_entry = combo->getSelectedValue(); diff --git a/indra/newview/llpanellogin.h b/indra/newview/llpanellogin.h index 2158105e0..b1a7ff935 100644 --- a/indra/newview/llpanellogin.h +++ b/indra/newview/llpanellogin.h @@ -78,7 +78,7 @@ public: * @brief Set the values of the displayed fields from a populated history entry. * @param entry History entry containing all necessary fields. */ - static void setFields(const LLSavedLoginEntry& entry, bool takeFocus = false); + static void setFields(const LLSavedLoginEntry& entry, bool takeFocus = true); static void getFields(std::string *firstname, std::string *lastname, std::string *password); diff --git a/indra/newview/llpanelobject.cpp b/indra/newview/llpanelobject.cpp index 7a05212a3..77363270a 100644 --- a/indra/newview/llpanelobject.cpp +++ b/indra/newview/llpanelobject.cpp @@ -552,6 +552,7 @@ void LLPanelObject::getState( ) mBtnCopySize->setEnabled( enable_scale ); mBtnPasteSize->setEnabled( enable_scale ); mBtnPasteSizeClip->setEnabled( enable_scale ); + mCtrlPosZ->setMaxValue(gHippoLimits->getMaxHeight()); mCtrlScaleX->setMaxValue(gHippoLimits->getMaxPrimScale()); mCtrlScaleY->setMaxValue(gHippoLimits->getMaxPrimScale()); mCtrlScaleZ->setMaxValue(gHippoLimits->getMaxPrimScale()); @@ -2441,7 +2442,7 @@ void LLPanelObject::onCopyPos(void* user_data) stringVec.append(shortfloat(newpos.mV[VZ])); stringVec.append(">"); - gViewerWindow->mWindow->copyTextToClipboard(utf8str_to_wstring(stringVec)); + gViewerWindow->getWindow()->copyTextToClipboard(utf8str_to_wstring(stringVec)); } void LLPanelObject::onCopySize(void* user_data) @@ -2458,7 +2459,7 @@ void LLPanelObject::onCopySize(void* user_data) stringVec.append(shortfloat(newpos.mV[VZ])); stringVec.append(">"); - gViewerWindow->mWindow->copyTextToClipboard(utf8str_to_wstring(stringVec)); + gViewerWindow->getWindow()->copyTextToClipboard(utf8str_to_wstring(stringVec)); } void LLPanelObject::onCopyRot(void* user_data) @@ -2475,7 +2476,7 @@ void LLPanelObject::onCopyRot(void* user_data) stringVec.append(shortfloat(newpos.mV[VZ])); stringVec.append(">"); - gViewerWindow->mWindow->copyTextToClipboard(utf8str_to_wstring(stringVec)); + gViewerWindow->getWindow()->copyTextToClipboard(utf8str_to_wstring(stringVec)); } namespace @@ -2483,6 +2484,7 @@ namespace bool texturePermsCheck(const LLUUID& id) { return (id.notNull() && !gInventory.isObjectDescendentOf(id, gInventory.getLibraryRootFolderID()) + && id != LLUUID(gSavedSettings.getString("DefaultObjectTexture")) && id != LLUUID(gSavedSettings.getString("UIImgWhiteUUID")) && id != LLUUID(gSavedSettings.getString("UIImgInvisibleUUID")) && id != LLUUID(std::string("8dcd4a48-2d37-4909-9f78-f7a9eb4ef903")) // alpha @@ -2566,10 +2568,10 @@ void LLPanelObject::onPastePos(void* user_data) LLPanelObject* self = (LLPanelObject*) user_data; LLCalc* calcp = LLCalc::getInstance(); - float region_width = LLWorld::getInstance()->getRegionWidthInMeters(); + float region_width = gAgent.getRegion()->getWidth(); mClipboardPos.mV[VX] = llclamp( mClipboardPos.mV[VX], -3.5f, region_width); mClipboardPos.mV[VY] = llclamp( mClipboardPos.mV[VY], -3.5f, region_width); - mClipboardPos.mV[VZ] = llclamp( mClipboardPos.mV[VZ], -3.5f, 4096.f); + mClipboardPos.mV[VZ] = llclamp( mClipboardPos.mV[VZ], -3.5f, gHippoLimits->getMaxHeight()); self->mCtrlPosX->set( mClipboardPos.mV[VX] ); self->mCtrlPosY->set( mClipboardPos.mV[VY] ); @@ -2646,9 +2648,12 @@ void LLPanelObject::onPastePosClip(void* user_data) std::string stringVec = wstring_to_utf8str(temp_string); if(!getvectorfromclip(stringVec, &mClipboardPos)) return; - mClipboardPos.mV[VX] = llclamp(mClipboardPos.mV[VX], -3.5f, 256.f); - mClipboardPos.mV[VY] = llclamp(mClipboardPos.mV[VY], -3.5f, 256.f); - mClipboardPos.mV[VZ] = llclamp(mClipboardPos.mV[VZ], -3.5f, 4096.f); + const LLViewerRegion* region(self->mObject ? self->mObject->getRegion() : NULL); + if (!region) return; + F32 region_width = region->getWidth(); + mClipboardPos.mV[VX] = llclamp(mClipboardPos.mV[VX], -3.5f, region_width); + mClipboardPos.mV[VY] = llclamp(mClipboardPos.mV[VY], -3.5f, region_width); + mClipboardPos.mV[VZ] = llclamp(mClipboardPos.mV[VZ], -3.5f, gHippoLimits->getMaxHeight()); self->mCtrlPosX->set( mClipboardPos.mV[VX] ); self->mCtrlPosY->set( mClipboardPos.mV[VY] ); diff --git a/indra/newview/llpanelobjectinventory.cpp b/indra/newview/llpanelobjectinventory.cpp index e9f46c0b4..87d6c3844 100644 --- a/indra/newview/llpanelobjectinventory.cpp +++ b/indra/newview/llpanelobjectinventory.cpp @@ -671,19 +671,34 @@ BOOL LLTaskInvFVBridge::dragOrDrop(MASK mask, BOOL drop, // llwarns << "LLTaskInvFVBridge::dropped() - not implemented" << llendl; //} +void pack_script_message(LLMessageSystem*, const LLInventoryItem*, const LLViewerObject*); + +void reset_script(const LLInventoryItem* item, const LLViewerObject* obj) +{ + if (!item || !obj) return; + gMessageSystem->newMessageFast(_PREHASH_ScriptReset); + pack_script_message(gMessageSystem, item, obj); + gMessageSystem->sendReliable(obj->getRegion()->getHost()); +} + void set_script_running(bool running, const LLInventoryItem* item, const LLViewerObject* obj) { if (!item || !obj) return; LLMessageSystem* msg = gMessageSystem; msg->newMessageFast(_PREHASH_SetScriptRunning); + pack_script_message(msg, item, obj); + msg->addBOOLFast(_PREHASH_Running, running); + msg->sendReliable(obj->getRegion()->getHost()); +} + +void pack_script_message(LLMessageSystem* msg, const LLInventoryItem* item, const LLViewerObject* obj) +{ msg->nextBlockFast(_PREHASH_AgentData); msg->addUUIDFast(_PREHASH_AgentID, gAgentID); msg->addUUIDFast(_PREHASH_SessionID, gAgentSessionID); msg->nextBlockFast(_PREHASH_Script); msg->addUUIDFast(_PREHASH_ObjectID, obj->getID()); msg->addUUIDFast(_PREHASH_ItemID, item->getUUID()); - msg->addBOOLFast(_PREHASH_Running, running); - msg->sendReliable(obj->getRegion()->getHost()); } // virtual @@ -719,6 +734,10 @@ void LLTaskInvFVBridge::performAction(LLInventoryModel* model, std::string actio { showProperties(); } + else if (action == "reset_script") + { + reset_script(findItem(), gObjectList.findObject(mPanel->getTaskUUID())); + } else if (action == "start_script") { set_script_running(true, findItem(), gObjectList.findObject(mPanel->getTaskUUID())); @@ -777,11 +796,13 @@ void LLTaskInvFVBridge::buildContextMenu(LLMenuGL& menu, U32 flags) { if (LLAssetType::AT_LSL_TEXT == item->getType()) { + items.push_back(std::string("Task Reset")); items.push_back(std::string("Task Set Running")); items.push_back(std::string("Task Set Not Running")); const LLViewerObject* obj = gObjectList.findObject(mPanel->getTaskUUID()); if (!obj || !(obj->permModify() || obj->permYouOwner())) { + disabled_items.push_back(std::string("Task Reset")); disabled_items.push_back(std::string("Task Set Running")); disabled_items.push_back(std::string("Task Set Not Running")); } diff --git a/indra/newview/llpanelpermissions.cpp b/indra/newview/llpanelpermissions.cpp index fa7f0565c..42facc56c 100644 --- a/indra/newview/llpanelpermissions.cpp +++ b/indra/newview/llpanelpermissions.cpp @@ -692,16 +692,18 @@ void LLPanelPermissions::refresh() getChild("B:")->setValue("B: " + perm_string); getChildView("B:")->setVisible( TRUE); + /* perm_string = mask_to_string(owner_mask_on); if (!supports_export && owner_mask_on & PERM_EXPORT) // Hide Export when not available perm_string.erase(perm_string.find_last_of("E")); - //getChild("O:")->setValue("O: " + perm_string); - //getChildView("O:")->setVisible( TRUE); + getChild("O:")->setValue("O: " + perm_string); + getChildView("O:")->setVisible( TRUE); + */ getChild("G:")->setValue("G: " + mask_to_string(group_mask_on)); getChildView("G:")->setVisible( TRUE); - perm_string = mask_to_string(owner_mask_on); + perm_string = mask_to_string(everyone_mask_on); if (!supports_export && everyone_mask_on & PERM_EXPORT) // Hide Export when not available perm_string.erase(perm_string.find_last_of("E")); getChild("E:")->setValue("E: " + perm_string); @@ -1135,7 +1137,7 @@ void LLPanelPermissions::onClickCopyObjKey() output.append(object->getID().asString()); } } - if (!output.empty()) gViewerWindow->mWindow->copyTextToClipboard(utf8str_to_wstring(output)); + if (!output.empty()) gViewerWindow->getWindow()->copyTextToClipboard(utf8str_to_wstring(output)); } ///---------------------------------------------------------------------------- diff --git a/indra/newview/llpanelvoicedevicesettings.cpp b/indra/newview/llpanelvoicedevicesettings.cpp index f890e55f8..883d44ecc 100644 --- a/indra/newview/llpanelvoicedevicesettings.cpp +++ b/indra/newview/llpanelvoicedevicesettings.cpp @@ -70,7 +70,11 @@ BOOL LLPanelVoiceDeviceSettings::postBuild() volume_slider->setValue(mMicVolume); mCtrlInputDevices = getChild("voice_input_device"); + mCtrlInputDevices->add(getLocalizedDeviceName(mInputDevice), mInputDevice); + mCtrlInputDevices->setValue(mInputDevice); mCtrlOutputDevices = getChild("voice_output_device"); + mCtrlOutputDevices->add(getLocalizedDeviceName(mOutputDevice), mOutputDevice); + mCtrlOutputDevices->setValue(mOutputDevice); mCtrlInputDevices->setCommitCallback( boost::bind(&LLPanelVoiceDeviceSettings::onCommitInputDevice, this)); diff --git a/indra/newview/llpatchvertexarray.cpp b/indra/newview/llpatchvertexarray.cpp index 4eab93167..2fe72ad04 100644 --- a/indra/newview/llpatchvertexarray.cpp +++ b/indra/newview/llpatchvertexarray.cpp @@ -82,7 +82,8 @@ void LLPatchVertexArray::create(U32 surface_width, U32 patch_width, F32 meters_p surface_order += 1; } - if (power_of_two == (surface_width-1)) + if (power_of_two != (surface_width-1)) + surface_width = power_of_two + 1; { mSurfaceWidth = surface_width; @@ -99,16 +100,11 @@ void LLPatchVertexArray::create(U32 surface_width, U32 patch_width, F32 meters_p power_of_two *= 2; patch_order += 1; } - if (power_of_two == patch_width) - { - mPatchWidth = patch_width; - mPatchOrder = patch_order; - } - else // patch_width is not a power of two... - { - mPatchWidth = 0; - mPatchOrder = 0; - } + if (power_of_two != patch_width) + patch_width = power_of_two; + + mPatchWidth = patch_width; + mPatchOrder = patch_order; } else // patch_width is not a factor of (surface_width - 1)... { @@ -116,12 +112,6 @@ void LLPatchVertexArray::create(U32 surface_width, U32 patch_width, F32 meters_p mPatchOrder = 0; } } - else // surface_width is not a power of two... - { - mSurfaceWidth = 0; - mPatchWidth = 0; - mPatchOrder = 0; - } // PART 2 -- Allocate memory for the render level table if (mPatchWidth > 0) diff --git a/indra/newview/llpathfindingmanager.cpp b/indra/newview/llpathfindingmanager.cpp index 7e5bec546..783c728c0 100644 --- a/indra/newview/llpathfindingmanager.cpp +++ b/indra/newview/llpathfindingmanager.cpp @@ -165,7 +165,6 @@ public: /*virtual*/ void result(const LLSD &pContent); /*virtual*/ void error(U32 pStatus, const std::string& pReason); - /*virtual*/ bool followRedir(void) const { return true; } /*virtual*/ AIHTTPTimeoutPolicy const& getHTTPTimeoutPolicy(void) const { return agentStateResponder_timeout; } /*virtual*/ char const* getName(void) const { return "AgentStateResponder"; } diff --git a/indra/newview/llprefsvoice.cpp b/indra/newview/llprefsvoice.cpp index c26fcb724..275778de4 100644 --- a/indra/newview/llprefsvoice.cpp +++ b/indra/newview/llprefsvoice.cpp @@ -41,6 +41,7 @@ #include "llkeyboard.h" #include "llmodaldialog.h" #include "llpanelvoicedevicesettings.h" +#include "lltrans.h" #include "lluictrlfactory.h" @@ -133,6 +134,12 @@ BOOL LLPrefsVoice::postBuild() childSetValue("enable_voice_check", enable); onCommitEnableVoiceChat(getChild("enable_voice_check"), this); + if (LLCheckBoxCtrl* check = getChild("enable_multivoice_check")) + { + check->setValue(gSavedSettings.getBOOL("VoiceMultiInstance")); + check->setLabel(getString("multivoice_label", LLTrans::getDefaultArgs())); + } + childSetValue("modifier_combo", gSavedSettings.getString("PushToTalkButton")); childSetValue("voice_call_friends_only_check", gSavedSettings.getBOOL("VoiceCallsFriendsOnly")); childSetValue("auto_disengage_mic_check", gSavedSettings.getBOOL("AutoDisengageMic")); @@ -151,6 +158,7 @@ void LLPrefsVoice::apply() gSavedSettings.setBOOL("PushToTalkToggle", childGetValue("push_to_talk_toggle_check")); gSavedSettings.setS32("VoiceEarLocation", childGetValue("ear_location")); gSavedSettings.setBOOL("LipSyncEnabled", childGetValue("enable_lip_sync_check")); + gSavedSettings.setBOOL("VoiceMultiInstance", childGetValue("enable_multivoice_check")); if (LLPanelVoiceDeviceSettings* voice_device_settings = getChild("device_settings_panel")) { diff --git a/indra/newview/llpreviewanim.cpp b/indra/newview/llpreviewanim.cpp index ba47526d0..09e2c61cf 100644 --- a/indra/newview/llpreviewanim.cpp +++ b/indra/newview/llpreviewanim.cpp @@ -331,7 +331,7 @@ void LLPreviewAnim::copyAnimID(void *userdata) if(item) { - gViewerWindow->mWindow->copyTextToClipboard(utf8str_to_wstring(item->getAssetUUID().asString())); + gViewerWindow->getWindow()->copyTextToClipboard(utf8str_to_wstring(item->getAssetUUID().asString())); } } // diff --git a/indra/newview/llpreviewnotecard.cpp b/indra/newview/llpreviewnotecard.cpp index 7b789fd58..3145c165d 100644 --- a/indra/newview/llpreviewnotecard.cpp +++ b/indra/newview/llpreviewnotecard.cpp @@ -159,8 +159,6 @@ LLPreviewNotecard::LLPreviewNotecard(const std::string& name, } initMenu(); - - gAgentCamera.changeCameraToDefault(); } LLPreviewNotecard::~LLPreviewNotecard() diff --git a/indra/newview/llpreviewscript.cpp b/indra/newview/llpreviewscript.cpp index 2f02bcd00..ca82b2c3b 100644 --- a/indra/newview/llpreviewscript.cpp +++ b/indra/newview/llpreviewscript.cpp @@ -1447,6 +1447,7 @@ void LLPreviewLSL::saveIfNeeded(bool sync /*= true*/) mPendingUploads = 0; mScriptEd->mErrorList->deleteAllItems(); + mScriptEd->mErrorList->setCommentText(""); mScriptEd->mEditor->makePristine(); // save off asset into file @@ -2190,6 +2191,7 @@ void LLLiveLSLEditor::saveIfNeeded(bool sync /*= true*/) mScriptEd->enableSave(FALSE); mScriptEd->mEditor->makePristine(); mScriptEd->mErrorList->deleteAllItems(); + mScriptEd->mErrorList->setCommentText(""); // set up the save on the local machine. mScriptEd->mEditor->makePristine(); diff --git a/indra/newview/llpreviewsound.cpp b/indra/newview/llpreviewsound.cpp index 6072d0c15..163ba6056 100644 --- a/indra/newview/llpreviewsound.cpp +++ b/indra/newview/llpreviewsound.cpp @@ -291,7 +291,7 @@ void LLPreviewSound::copyUUID( void *userdata ) if(item ) { - gViewerWindow->mWindow->copyTextToClipboard(utf8str_to_wstring(item->getAssetUUID().asString())); + gViewerWindow->getWindow()->copyTextToClipboard(utf8str_to_wstring(item->getAssetUUID().asString())); } } // diff --git a/indra/newview/llpreviewtexture.cpp b/indra/newview/llpreviewtexture.cpp index d2929d7a6..6d686b252 100644 --- a/indra/newview/llpreviewtexture.cpp +++ b/indra/newview/llpreviewtexture.cpp @@ -40,8 +40,7 @@ #include "llcombobox.h" #include "statemachine/aifilepicker.h" #include "llfloaterinventory.h" -#include "llimagepng.h" -#include "llimagetga.h" +#include "llimage.h" #include "llinventory.h" #include "llnotificationsutil.h" #include "llresmgr.h" @@ -377,27 +376,16 @@ BOOL LLPreviewTexture::canSaveAs() const return mIsCopyable && !mLoadingFullImage && mImage.notNull() && !mImage->isMissingAsset(); } -static bool sPng(false); - // virtual -void LLPreviewTexture::saveAsType(BOOL png) +void LLPreviewTexture::saveAs() { if( mLoadingFullImage ) return; const LLViewerInventoryItem* item = getItem() ; AIFilePicker* filepicker = AIFilePicker::create(); - sPng = png; - if(png) - { - filepicker->open(item ? LLDir::getScrubbedFileName(item->getName()) + ".png" : LLStringUtil::null, FFSAVE_PNG, "", "image"); - filepicker->run(boost::bind(&LLPreviewTexture::saveAs_continued, this, item, filepicker)); - } - else - { - filepicker->open(item ? LLDir::getScrubbedFileName(item->getName()) + ".tga" : LLStringUtil::null, FFSAVE_TGA, "", "image"); - filepicker->run(boost::bind(&LLPreviewTexture::saveAs_continued, this, item, filepicker)); - } + filepicker->open(item ? LLDir::getScrubbedFileName(item->getName()) + ".png" : LLStringUtil::null, FFSAVE_IMAGE, "", "image"); + filepicker->run(boost::bind(&LLPreviewTexture::saveAs_continued, this, item, filepicker)); } void LLPreviewTexture::saveAs_continued(LLViewerInventoryItem const* item, AIFilePicker* filepicker) @@ -446,16 +434,14 @@ void LLPreviewTexture::onFileLoadedForSave(BOOL success, if( self && final && success ) { - //FIXME: There has to be a better way - LLPointer image_png = new LLImagePNG; - LLPointer image_tga = new LLImageTGA; - if( sPng ? !image_png->encode( src, 0.0 ) : !image_tga->encode( src ) ) + LLPointer image = LLImageFormatted::createFromExtension(self->mSaveFileName); + if (!image || !image->encode(src, 0.0)) { LLSD args; args["FILE"] = self->mSaveFileName; LLNotificationsUtil::add("CannotEncodeFile", args); } - else if( sPng ? !image_png->save( self->mSaveFileName ) : !image_tga->save( self->mSaveFileName ) ) + else if (!image->save(self->mSaveFileName)) { LLSD args; args["FILE"] = self->mSaveFileName; diff --git a/indra/newview/llpreviewtexture.h b/indra/newview/llpreviewtexture.h index 02dc4f94e..073f76bfa 100644 --- a/indra/newview/llpreviewtexture.h +++ b/indra/newview/llpreviewtexture.h @@ -63,8 +63,7 @@ public: virtual void draw(); virtual BOOL canSaveAs() const; - virtual void saveAs(){ saveAsType(false); } - void saveAsType(BOOL png); + virtual void saveAs(); void saveAs_continued(LLViewerInventoryItem const* item, AIFilePicker* filepicker); virtual LLUUID getItemID(); virtual std::string getItemCreatorName(); diff --git a/indra/newview/llslurl.cpp b/indra/newview/llslurl.cpp index b1a30f78b..fdd812d65 100644 --- a/indra/newview/llslurl.cpp +++ b/indra/newview/llslurl.cpp @@ -35,6 +35,7 @@ #include "llfiltersd2xmlrpc.h" #include "curl/curl.h" #include "hippogridmanager.h" +#include "llworldmap.h" // Variable size regions const char* LLSLURL::SLURL_HTTP_SCHEME = "http"; const char* LLSLURL::SLURL_HTTPS_SCHEME = "https"; @@ -312,11 +313,11 @@ LLSLURL::LLSLURL(const std::string& slurl) mPosition = LLVector3(path_array); // this construction handles LLSD without all components (values default to 0.f) if((F32(mPosition[VX]) < 0.f) || - (mPosition[VX] > REGION_WIDTH_METERS) || + (mPosition[VX] > 8192.f/*REGION_WIDTH_METERS*/) || (F32(mPosition[VY]) < 0.f) || - (mPosition[VY] > REGION_WIDTH_METERS) || + (mPosition[VY] > 8192.f/*REGION_WIDTH_METERS*/) || (F32(mPosition[VZ]) < 0.f) || - (mPosition[VZ] > REGION_HEIGHT_METERS)) + (mPosition[VZ] > 8192.f/*REGION_HEIGHT_METERS*/)) { mType = INVALID; return; @@ -355,8 +356,8 @@ LLSLURL::LLSLURL(const std::string& grid, { mGrid = grid; mRegion = region; - S32 x = llround( (F32)fmod( position[VX], (F32)REGION_WIDTH_METERS ) ); - S32 y = llround( (F32)fmod( position[VY], (F32)REGION_WIDTH_METERS ) ); + S32 x = llround( (F32)position[VX] ); + S32 y = llround( (F32)position[VY] ); S32 z = llround( (F32)position[VZ] ); mType = LOCATION; mPosition = LLVector3(x, y, z); @@ -377,10 +378,14 @@ LLSLURL::LLSLURL(const std::string& grid, const LLVector3d& global_position) { HippoGridInfo* gridp = gHippoGridManager->getGrid(grid); + LLVector3 pos(global_position); + if (LLSimInfo* sim = LLWorldMap::getInstance()->simInfoFromPosGlobal(global_position)) // Variable size regions, we need to fmod against their proper dimensions, not 256 + { + pos[VX] = fmod(pos[VX], sim->getSizeX()); + pos[VY] = fmod(pos[VY], sim->getSizeY()); + } *this = LLSLURL(gridp ? gridp->getGridNick() : gHippoGridManager->getDefaultGridNick(), - region, LLVector3(global_position.mdV[VX], - global_position.mdV[VY], - global_position.mdV[VZ])); + region, pos); } // create a slurl from a global position diff --git a/indra/newview/llspeakers.cpp b/indra/newview/llspeakers.cpp index fa4313ebd..0f15435dc 100644 --- a/indra/newview/llspeakers.cpp +++ b/indra/newview/llspeakers.cpp @@ -88,7 +88,11 @@ void LLSpeaker::lookupName() void LLSpeaker::onNameCache(const LLAvatarName& full_name) { - LLAvatarNameCache::getPNSName(full_name, mDisplayName); + static const LLCachedControl legacy_name("LiruLegacySpeakerNames"); + if (legacy_name) + mDisplayName = gCacheName->cleanFullName(full_name.getLegacyName()); + else + LLAvatarNameCache::getPNSName(full_name, mDisplayName); } bool LLSpeaker::isInVoiceChannel() diff --git a/indra/newview/llstartup.cpp b/indra/newview/llstartup.cpp index c1762b113..43e8ca335 100644 --- a/indra/newview/llstartup.cpp +++ b/indra/newview/llstartup.cpp @@ -309,7 +309,10 @@ void init_start_screen(S32 location_id); void release_start_screen(); void reset_login(); void apply_udp_blacklist(const std::string& csv); -bool process_login_success_response(std::string &password); +// Aurora Sim +//bool process_login_success_response(std::string& password); +bool process_login_success_response(std::string& password, U32& first_sim_size_x); +// Aurora Sim void transition_back_to_login_panel(const std::string& emsg); void callback_cache_name(const LLUUID& id, const std::string& full_name, bool is_group) @@ -479,6 +482,9 @@ bool idle_startup() static std::vector requested_options; static std::string redirect_uri; +// Aurora Sim + static U32 first_sim_size_x = 256; +// Aurora Sim static LLVector3 initial_sun_direction(1.f, 0.f, 0.f); static LLVector3 agent_start_position_region(10.f, 10.f, 10.f); // default for when no space server @@ -1399,9 +1405,9 @@ bool idle_startup() message_response = response["message"].asString(); message_id = response["message_id"].asString(); { - std::stringstream dump_str; - dump_str << response; - llinfos << dump_str.str() << llendl; + std::stringstream dump_str; + dump_str << response; + LL_DEBUGS("AppInit") << dump_str.str() << LL_ENDL; } if(login_response == "true") @@ -1544,7 +1550,7 @@ bool idle_startup() if (successful_login) { // unpack login data needed by the application - if(process_login_success_response(password)) + if (process_login_success_response(password, first_sim_size_x)) { std::string name = firstname; if (!gHippoGridManager->getCurrentGrid()->isSecondLife() || @@ -1552,6 +1558,7 @@ bool idle_startup() { name += " " + lastname; } + if (gSavedSettings.getBOOL("LiruGridInTitle")) gWindowTitle += "- " + gHippoGridManager->getCurrentGrid()->getGridName() + " "; gViewerWindow->getWindow()->setTitle(gWindowTitle += "- " + name); // Pass the user information to the voice chat server interface. LLVoiceClient::getInstance()->userAuthorized(name, gAgentID); @@ -1662,6 +1669,9 @@ bool idle_startup() gAgent.initOriginGlobal(from_region_handle(gFirstSimHandle)); display_startup(); +// Aurora Sim + LLWorld::getInstance()->setRegionWidth(first_sim_size_x); +// Aurora Sim LLWorld::getInstance()->addRegion(gFirstSimHandle, gFirstSim); display_startup(); @@ -1884,7 +1894,7 @@ bool idle_startup() // Make sure agent knows correct aspect ratio // FOV limits depend upon aspect ratio so this needs to happen before initializing the FOV below LLViewerCamera::getInstance()->setViewHeightInPixels(gViewerWindow->getWindowDisplayHeight()); - if (gViewerWindow->mWindow->getFullscreen()) + if (gViewerWindow->getWindow()->getFullscreen()) { LLViewerCamera::getInstance()->setAspect(gViewerWindow->getDisplayAspectRatio()); } @@ -3434,6 +3444,9 @@ void reset_login() gLoginMenuBarView->setEnabled( TRUE ); } + // Clear the console + if (gConsole) gConsole->clear(); + // Hide any other stuff LLFloaterMap::hideInstance(); } @@ -3838,7 +3851,7 @@ void apply_udp_blacklist(const std::string& csv) } -bool process_login_success_response(std::string& password) +bool process_login_success_response(std::string& password, U32& first_sim_size_x) { LLSD response = LLUserAuth::getInstance()->getResponse(); @@ -3978,7 +3991,12 @@ bool process_login_success_response(std::string& password) U32 region_y = strtoul(region_y_str.c_str(), NULL, 10); gFirstSimHandle = to_region_handle(region_x, region_y); } - + +// Aurora Sim + text = response["region_size_x"].asString(); + if (!text.empty()) LLViewerParcelMgr::getInstance()->init(first_sim_size_x = atoi(text.c_str())); +// Aurora Sim + const std::string look_at_str = response["look_at"]; if (!look_at_str.empty()) { diff --git a/indra/newview/llstatusbar.cpp b/indra/newview/llstatusbar.cpp index fcec44e4b..1bfc7ca9e 100644 --- a/indra/newview/llstatusbar.cpp +++ b/indra/newview/llstatusbar.cpp @@ -154,6 +154,12 @@ public: static LLDispatchUPCBalance sDispatchUPCBalance; +static void toggle_time_value() +{ + LLControlVariable* control = gSavedSettings.getControl("LiruLocalTime"); + control->set(!control->get()); +} + LLStatusBar::LLStatusBar(const std::string& name, const LLRect& rect) : LLPanel(name, LLRect(), FALSE), // not mouse opaque mBalance(0), @@ -195,6 +201,7 @@ mIsNavMeshDirty(false) mTextHealth = getChild("HealthText" ); mTextTime = getChild("TimeText" ); + mTextTime->setClickedCallback(boost::bind(toggle_time_value)); if (!mUPCSupported) mTextUPC->setVisible(false); @@ -314,23 +321,28 @@ void LLStatusBar::refresh() mSGBandwidth->setThreshold(1, bwtotal); mSGBandwidth->setThreshold(2, bwtotal); - // *TODO: Localize / translate time + // Singu Note: Use system's time if the user desires, otherwise use server time + static const LLCachedControl show_local_time("LiruLocalTime"); // Get current UTC time, adjusted for the user's clock // being off. - time_t utc_time; - utc_time = time_corrected(); + time_t utc_time = show_local_time ? time(NULL) : time_corrected(); // There's only one internal tm buffer. struct tm* internal_time; // Convert to Pacific, based on server's opinion of whether // it's daylight savings time there. - internal_time = utc_to_pacific_time(utc_time, gPacificDaylightTime); + internal_time = show_local_time ? std::localtime(&utc_time) : utc_to_pacific_time(utc_time, gPacificDaylightTime); std::string t; timeStructToFormattedString(internal_time, gSavedSettings.getString("ShortTimeFormat"), t); - if (gPacificDaylightTime) + if (show_local_time) + { + static const std::string local(" " + getString("Local")); + t += local; + } + else if (gPacificDaylightTime) { t += " PDT"; } diff --git a/indra/newview/llsurface.cpp b/indra/newview/llsurface.cpp index ca4c37eff..fd7c0da59 100644 --- a/indra/newview/llsurface.cpp +++ b/indra/newview/llsurface.cpp @@ -172,6 +172,9 @@ void LLSurface::create(const S32 grids_per_edge, mNumberOfPatches = mPatchesPerEdge * mPatchesPerEdge; mMetersPerGrid = width / ((F32)(mGridsPerEdge - 1)); mMetersPerEdge = mMetersPerGrid * (mGridsPerEdge - 1); +// Aurora Sim + sTextureSize = width; +// Aurora Sim mOriginGlobal.setVec(origin_global); @@ -295,8 +298,11 @@ void LLSurface::initTextures() mWaterObjp = (LLVOWater *)gObjectList.createObjectViewer(LLViewerObject::LL_VO_WATER, mRegionp); gPipeline.createObject(mWaterObjp); LLVector3d water_pos_global = from_region_handle(mRegionp->getHandle()); - water_pos_global += LLVector3d(128.0, 128.0, DEFAULT_WATER_HEIGHT); +// Aurora Sim + //water_pos_global += LLVector3d(128.0, 128.0, DEFAULT_WATER_HEIGHT); // region doesn't have a valid water height yet + water_pos_global += LLVector3d(mRegionp->getWidth()/2, mRegionp->getWidth()/2, DEFAULT_WATER_HEIGHT); mWaterObjp->setPositionGlobal(water_pos_global); +// Aurora Sim } } @@ -325,8 +331,12 @@ void LLSurface::setOriginGlobal(const LLVector3d &origin_global) // Hack! if (mWaterObjp.notNull() && mWaterObjp->mDrawable.notNull()) { - const F64 x = origin_global.mdV[VX] + 128.0; - const F64 y = origin_global.mdV[VY] + 128.0; +// Aurora Sim + //const F64 x = origin_global.mdV[VX] + 128.0; + //const F64 y = origin_global.mdV[VY] + 128.0; + const F64 x = origin_global.mdV[VX] + (F64)mRegionp->getWidth()/2; + const F64 y = origin_global.mdV[VY] + (F64)mRegionp->getWidth()/2; +// Aurora Sim const F64 z = mWaterObjp->getPositionGlobal().mdV[VZ]; LLVector3d water_origin_global(x, y, z); @@ -364,15 +374,56 @@ void LLSurface::connectNeighbor(LLSurface *neighborp, U32 direction) { S32 i; LLSurfacePatch *patchp, *neighbor_patchp; +// Aurora Sim + S32 neighborPatchesPerEdge = neighborp->mPatchesPerEdge; +// Aurora Sim mNeighbors[direction] = neighborp; neighborp->mNeighbors[gDirOpposite[direction]] = this; +// Aurora Sim + S32 ppe[2]; + S32 own_offset[2] = {0, 0}; + S32 neighbor_offset[2] = {0, 0}; + U32 own_xpos, own_ypos, neighbor_xpos, neighbor_ypos; + + ppe[0] = (mPatchesPerEdge < neighborPatchesPerEdge) ? mPatchesPerEdge : neighborPatchesPerEdge; // used for x + ppe[1] = ppe[0]; // used for y + + from_region_handle(mRegionp->getHandle(), &own_xpos, &own_ypos); + from_region_handle(neighborp->getRegion()->getHandle(), &neighbor_xpos, &neighbor_ypos); + + if(own_ypos >= neighbor_ypos) + { + neighbor_offset[1] = (own_ypos - neighbor_ypos) / mGridsPerPatchEdge; + ppe[1] = llmin(mPatchesPerEdge, neighborPatchesPerEdge-neighbor_offset[1]); + } + else + { + own_offset[1] = (neighbor_ypos - own_ypos) / mGridsPerPatchEdge; + ppe[1] = llmin(mPatchesPerEdge-own_offset[1], neighborPatchesPerEdge); + } + + if(own_xpos >= neighbor_xpos) + { + neighbor_offset[0] = (own_xpos - neighbor_xpos) / mGridsPerPatchEdge; + ppe[0] = llmin(mPatchesPerEdge, neighborPatchesPerEdge-neighbor_offset[0]); + } + else + { + own_offset[0] = (neighbor_xpos - own_xpos) / mGridsPerPatchEdge; + ppe[0] = llmin(mPatchesPerEdge-own_offset[0], neighborPatchesPerEdge); + } +// Aurora Sim + // Connect patches if (NORTHEAST == direction) { patchp = getPatch(mPatchesPerEdge - 1, mPatchesPerEdge - 1); - neighbor_patchp = neighborp->getPatch(0, 0); +// Aurora Sim + //neighbor_patchp = neighborp->getPatch(0, 0); + neighbor_patchp = neighborp->getPatch(neighbor_offset[0], neighbor_offset[1]); +// Aurora Sim patchp->connectNeighbor(neighbor_patchp, direction); neighbor_patchp->connectNeighbor(patchp, gDirOpposite[direction]); @@ -382,8 +433,19 @@ void LLSurface::connectNeighbor(LLSurface *neighborp, U32 direction) } else if (NORTHWEST == direction) { +// Aurora Sim + S32 off = mPatchesPerEdge + neighbor_offset[1] - own_offset[1]; +// Aurora Sim patchp = getPatch(0, mPatchesPerEdge - 1); - neighbor_patchp = neighborp->getPatch(mPatchesPerEdge - 1, 0); +// Aurora Sim + //neighbor_patchp = neighborp->getPatch(mPatchesPerEdge - 1, 0); + neighbor_patchp = neighborp->getPatch(neighbor_offset[0] - 1, off); //neighborPatchesPerEdge - 1 + if (!neighbor_patchp) + { + mNeighbors[direction] = NULL; + return; + } +// Aurora Sim patchp->connectNeighbor(neighbor_patchp, direction); neighbor_patchp->connectNeighbor(patchp, gDirOpposite[direction]); @@ -391,18 +453,41 @@ void LLSurface::connectNeighbor(LLSurface *neighborp, U32 direction) else if (SOUTHWEST == direction) { patchp = getPatch(0, 0); - neighbor_patchp = neighborp->getPatch(mPatchesPerEdge - 1, mPatchesPerEdge - 1); +// Aurora Sim + //neighbor_patchp = neighborp->getPatch(mPatchesPerEdge - 1, mPatchesPerEdge - 1); + neighbor_patchp = neighborp->getPatch(neighbor_offset[0] - 1, neighbor_offset[1] - 1); + if (!neighbor_patchp) + { + mNeighbors[direction] = NULL; + return; + } +// Aurora Sim patchp->connectNeighbor(neighbor_patchp, direction); neighbor_patchp->connectNeighbor(patchp, gDirOpposite[direction]); - neighbor_patchp->updateNorthEdge(); // Only update one of north or east. +// Aurora Sim + //neighbor_patchp->updateNorthEdge(); // Only update one of north or east. + neighbor_patchp->updateEastEdge(); // Only update one of north or east. +// Aurora Sim neighbor_patchp->dirtyZ(); } else if (SOUTHEAST == direction) { +// Aurora Sim + S32 off = mPatchesPerEdge + neighbor_offset[0] - own_offset[0]; +// Aurora Sim + patchp = getPatch(mPatchesPerEdge - 1, 0); - neighbor_patchp = neighborp->getPatch(0, mPatchesPerEdge - 1); +// Aurora Sim + //neighbor_patchp = neighborp->getPatch(0, mPatchesPerEdge - 1); + neighbor_patchp = neighborp->getPatch(off, neighbor_offset[1] - 1); //0 + if (!neighbor_patchp) + { + mNeighbors[direction] = NULL; + return; + } +// Aurora Sim patchp->connectNeighbor(neighbor_patchp, direction); neighbor_patchp->connectNeighbor(patchp, gDirOpposite[direction]); @@ -410,10 +495,17 @@ void LLSurface::connectNeighbor(LLSurface *neighborp, U32 direction) else if (EAST == direction) { // Do east/west connections, first - for (i = 0; i < (S32)mPatchesPerEdge; i++) +// Aurora Sim + //for (i = 0; i < (S32)mPatchesPerEdge; i++) + for (i = 0; i < ppe[1]; i++) +// Aurora Sim { - patchp = getPatch(mPatchesPerEdge - 1, i); - neighbor_patchp = neighborp->getPatch(0, i); +// Aurora Sim + //patchp = getPatch(mPatchesPerEdge - 1, i); + //neighbor_patchp = neighborp->getPatch(0, i); + patchp = getPatch(mPatchesPerEdge - 1, i + own_offset[1]); + neighbor_patchp = neighborp->getPatch(0, i + neighbor_offset[1]); +// Aurora Sim patchp->connectNeighbor(neighbor_patchp, direction); neighbor_patchp->connectNeighbor(patchp, gDirOpposite[direction]); @@ -423,19 +515,33 @@ void LLSurface::connectNeighbor(LLSurface *neighborp, U32 direction) } // Now do northeast/southwest connections - for (i = 0; i < (S32)mPatchesPerEdge - 1; i++) +// Aurora Sim + //for (i = 0; i < (S32)mPatchesPerEdge - 1; i++) + for (i = 0; i < ppe[1] - 1; i++) +// Aurora Sim { - patchp = getPatch(mPatchesPerEdge - 1, i); - neighbor_patchp = neighborp->getPatch(0, i+1); +// Aurora Sim + //patchp = getPatch(mPatchesPerEdge - 1, i); + //neighbor_patchp = neighborp->getPatch(0, i+1); + patchp = getPatch(mPatchesPerEdge - 1, i + own_offset[1]); + neighbor_patchp = neighborp->getPatch(0, i+1 + neighbor_offset[1]); +// Aurora Sim patchp->connectNeighbor(neighbor_patchp, NORTHEAST); neighbor_patchp->connectNeighbor(patchp, SOUTHWEST); } // Now do southeast/northwest connections - for (i = 1; i < (S32)mPatchesPerEdge; i++) +// Aurora Sim + //for (i = 1; i < (S32)mPatchesPerEdge; i++) + for (i = 1; i < ppe[1]; i++) +// Aurora Sim { - patchp = getPatch(mPatchesPerEdge - 1, i); - neighbor_patchp = neighborp->getPatch(0, i-1); +// Aurora Sim + //patchp = getPatch(mPatchesPerEdge - 1, i); + //neighbor_patchp = neighborp->getPatch(0, i-1); + patchp = getPatch(mPatchesPerEdge - 1, i + own_offset[1]); + neighbor_patchp = neighborp->getPatch(0, i-1 + neighbor_offset[1]); +// Aurora Sim patchp->connectNeighbor(neighbor_patchp, SOUTHEAST); neighbor_patchp->connectNeighbor(patchp, NORTHWEST); @@ -444,10 +550,17 @@ void LLSurface::connectNeighbor(LLSurface *neighborp, U32 direction) else if (NORTH == direction) { // Do north/south connections, first - for (i = 0; i < (S32)mPatchesPerEdge; i++) +// Aurora Sim + //for (i = 0; i < (S32)mPatchesPerEdge; i++) + for (i = 0; i < ppe[0]; i++) +// Aurora Sim { - patchp = getPatch(i, mPatchesPerEdge - 1); - neighbor_patchp = neighborp->getPatch(i, 0); +// Aurora Sim + //patchp = getPatch(i, mPatchesPerEdge - 1); + //neighbor_patchp = neighborp->getPatch(i, 0); + patchp = getPatch(i + own_offset[0], mPatchesPerEdge - 1); + neighbor_patchp = neighborp->getPatch(i + neighbor_offset[0], 0); +// Aurora Sim patchp->connectNeighbor(neighbor_patchp, direction); neighbor_patchp->connectNeighbor(patchp, gDirOpposite[direction]); @@ -457,19 +570,33 @@ void LLSurface::connectNeighbor(LLSurface *neighborp, U32 direction) } // Do northeast/southwest connections - for (i = 0; i < (S32)mPatchesPerEdge - 1; i++) +// Aurora Sim + //for (i = 0; i < (S32)mPatchesPerEdge - 1; i++) + for (i = 0; i < ppe[0] - 1; i++) +// Aurora Sim { - patchp = getPatch(i, mPatchesPerEdge - 1); - neighbor_patchp = neighborp->getPatch(i+1, 0); +// Aurora Sim + //patchp = getPatch(i, mPatchesPerEdge - 1); + //neighbor_patchp = neighborp->getPatch(i+1, 0); + patchp = getPatch(i + own_offset[0], mPatchesPerEdge - 1); + neighbor_patchp = neighborp->getPatch(i+1 + neighbor_offset[0], 0); +// Aurora Sim patchp->connectNeighbor(neighbor_patchp, NORTHEAST); neighbor_patchp->connectNeighbor(patchp, SOUTHWEST); } // Do southeast/northwest connections - for (i = 1; i < (S32)mPatchesPerEdge; i++) +// Aurora Sim + //for (i = 1; i < (S32)mPatchesPerEdge; i++) + for (i = 1; i < ppe[0]; i++) +// Aurora Sim { - patchp = getPatch(i, mPatchesPerEdge - 1); - neighbor_patchp = neighborp->getPatch(i-1, 0); +// Aurora Sim + //patchp = getPatch(i, mPatchesPerEdge - 1); + //neighbor_patchp = neighborp->getPatch(i-1, 0); + patchp = getPatch(i + own_offset[0], mPatchesPerEdge - 1); + neighbor_patchp = neighborp->getPatch(i-1 + neighbor_offset[0], 0); +// Aurora Sim patchp->connectNeighbor(neighbor_patchp, NORTHWEST); neighbor_patchp->connectNeighbor(patchp, SOUTHEAST); @@ -478,10 +605,18 @@ void LLSurface::connectNeighbor(LLSurface *neighborp, U32 direction) else if (WEST == direction) { // Do east/west connections, first - for (i = 0; i < mPatchesPerEdge; i++) +// Aurora Sim + //for (i = 0; i < mPatchesPerEdge; i++) + for (i = 0; i < ppe[1]; i++) +// Aurora Sim { - patchp = getPatch(0, i); - neighbor_patchp = neighborp->getPatch(mPatchesPerEdge - 1, i); +// Aurora Sim + //patchp = getPatch(0, i); + //neighbor_patchp = neighborp->getPatch(mPatchesPerEdge - 1, i); + patchp = getPatch(0, i + own_offset[1]); + neighbor_patchp = neighborp->getPatch(neighborPatchesPerEdge - 1, i + neighbor_offset[1]); + if (!neighbor_patchp) continue; +// Aurora Sim patchp->connectNeighbor(neighbor_patchp, direction); neighbor_patchp->connectNeighbor(patchp, gDirOpposite[direction]); @@ -491,20 +626,36 @@ void LLSurface::connectNeighbor(LLSurface *neighborp, U32 direction) } // Now do northeast/southwest connections - for (i = 1; i < mPatchesPerEdge; i++) +// Aurora Sim + //for (i = 1; i < mPatchesPerEdge; i++) + for (i = 1; i < ppe[1]; i++) +// Aurora Sim { - patchp = getPatch(0, i); - neighbor_patchp = neighborp->getPatch(mPatchesPerEdge - 1, i - 1); +// Aurora Sim + //patchp = getPatch(0, i); + //neighbor_patchp = neighborp->getPatch(mPatchesPerEdge - 1, i - 1); + patchp = getPatch(0, i + own_offset[1]); + neighbor_patchp = neighborp->getPatch(neighborPatchesPerEdge - 1, i - 1 + neighbor_offset[1]); + if (!neighbor_patchp) continue; +// Aurora Sim patchp->connectNeighbor(neighbor_patchp, SOUTHWEST); neighbor_patchp->connectNeighbor(patchp, NORTHEAST); } // Now do northwest/southeast connections - for (i = 0; i < mPatchesPerEdge - 1; i++) +// Aurora Sim + //for (i = 0; i < mPatchesPerEdge - 1; i++) + for (i = 0; i < ppe[1] - 1; i++) +// Aurora Sim { - patchp = getPatch(0, i); - neighbor_patchp = neighborp->getPatch(mPatchesPerEdge - 1, i + 1); +// Aurora Sim + //patchp = getPatch(0, i); + //neighbor_patchp = neighborp->getPatch(mPatchesPerEdge - 1, i + 1); + patchp = getPatch(0, i + own_offset[1]); + neighbor_patchp = neighborp->getPatch(neighborPatchesPerEdge - 1, i + 1 + neighbor_offset[1]); + if (!neighbor_patchp) continue; +// Aurora Sim patchp->connectNeighbor(neighbor_patchp, NORTHWEST); neighbor_patchp->connectNeighbor(patchp, SOUTHEAST); @@ -513,10 +664,18 @@ void LLSurface::connectNeighbor(LLSurface *neighborp, U32 direction) else if (SOUTH == direction) { // Do north/south connections, first - for (i = 0; i < mPatchesPerEdge; i++) +// Aurora Sim + //for (i = 0; i < mPatchesPerEdge; i++) + for (i = 0; i < ppe[0]; i++) +// Aurora Sim { - patchp = getPatch(i, 0); - neighbor_patchp = neighborp->getPatch(i, mPatchesPerEdge - 1); +// Aurora Sim + //patchp = getPatch(i, 0); + //neighbor_patchp = neighborp->getPatch(i, mPatchesPerEdge - 1); + patchp = getPatch(i + own_offset[0], 0); + neighbor_patchp = neighborp->getPatch(i + neighbor_offset[0], neighborPatchesPerEdge - 1); + if (!neighbor_patchp) continue; +// Aurora Sim patchp->connectNeighbor(neighbor_patchp, direction); neighbor_patchp->connectNeighbor(patchp, gDirOpposite[direction]); @@ -526,19 +685,33 @@ void LLSurface::connectNeighbor(LLSurface *neighborp, U32 direction) } // Now do northeast/southwest connections - for (i = 1; i < mPatchesPerEdge; i++) +// Aurora Sim + //for (i = 1; i < mPatchesPerEdge; i++) + for (i = 1; i < ppe[0]; i++) +// Aurora Sim { - patchp = getPatch(i, 0); - neighbor_patchp = neighborp->getPatch(i - 1, mPatchesPerEdge - 1); +// Aurora Sim + //patchp = getPatch(i, 0); + //neighbor_patchp = neighborp->getPatch(i - 1, mPatchesPerEdge - 1); + patchp = getPatch(i + own_offset[0], 0); + neighbor_patchp = neighborp->getPatch(i - 1 + neighbor_offset[0], neighborPatchesPerEdge - 1); +// Aurora Sim patchp->connectNeighbor(neighbor_patchp, SOUTHWEST); neighbor_patchp->connectNeighbor(patchp, NORTHEAST); } // Now do northeast/southwest connections - for (i = 0; i < mPatchesPerEdge - 1; i++) +// Aurora Sim + //for (i = 0; i < mPatchesPerEdge - 1; i++) + for (i = 0; i < ppe[0] - 1; i++) +// Aurora Sim { - patchp = getPatch(i, 0); - neighbor_patchp = neighborp->getPatch(i + 1, mPatchesPerEdge - 1); +// Aurora Sim + //patchp = getPatch(i, 0); + //neighbor_patchp = neighborp->getPatch(i + 1, mPatchesPerEdge - 1); + patchp = getPatch(i + own_offset[0], 0); + neighbor_patchp = neighborp->getPatch(i + 1 + neighbor_offset[0], neighborPatchesPerEdge - 1); +// Aurora Sim patchp->connectNeighbor(neighbor_patchp, SOUTHEAST); neighbor_patchp->connectNeighbor(patchp, NORTHWEST); @@ -700,14 +873,29 @@ void LLSurface::decompressDCTPatch(LLBitPack &bitpack, LLGroupHeader *gopp, BOOL while (1) { - decode_patch_header(bitpack, &ph); +// Aurora Sim + //decode_patch_header(bitpack, &ph); + decode_patch_header(bitpack, &ph, b_large_patch); +// Aurora Sim if (ph.quant_wbits == END_OF_PATCHES) { break; } - i = ph.patchids >> 5; - j = ph.patchids & 0x1F; +// Aurora Sim + //i = ph.patchids >> 5; + //j = ph.patchids & 0x1F; + if (b_large_patch) + { + i = ph.patchids >> 16; //x + j = ph.patchids & 0xFFFF; //y + } + else + { + i = ph.patchids >> 5; //x + j = ph.patchids & 0x1F; //y + } +// Aurora Sim if ((i >= mPatchesPerEdge) || (j >= mPatchesPerEdge)) { @@ -1152,12 +1340,12 @@ LLSurfacePatch *LLSurface::getPatch(const S32 x, const S32 y) const { if ((x < 0) || (x >= mPatchesPerEdge)) { - llerrs << "Asking for patch out of bounds" << llendl; + llwarns << "Asking for patch out of bounds" << llendl; return NULL; } if ((y < 0) || (y >= mPatchesPerEdge)) { - llerrs << "Asking for patch out of bounds" << llendl; + llwarns << "Asking for patch out of bounds" << llendl; return NULL; } @@ -1229,7 +1417,10 @@ BOOL LLSurface::generateWaterTexture(const F32 x, const F32 y, LLPointer raw = new LLImageRaw(tex_width, tex_height, tex_comps); U8 *rawp = raw->getData(); - F32 scale = 256.f * getMetersPerGrid() / (F32)tex_width; +// Aurora Sim + //F32 scale = 256.f * getMetersPerGrid() / (F32)tex_width; + F32 scale = getRegion()->getWidth() * getMetersPerGrid() / (F32)tex_width; +// Aurora Sim F32 scale_inv = 1.f / scale; S32 x_begin, y_begin, x_end, y_end; diff --git a/indra/newview/llsurface.h b/indra/newview/llsurface.h index a693f6943..aedac01a3 100644 --- a/indra/newview/llsurface.h +++ b/indra/newview/llsurface.h @@ -85,6 +85,9 @@ public: void disconnectNeighbor(LLSurface *neighborp); void disconnectAllNeighbors(); +// Aurora Sim + void rebuildWater(); +// Aurora Sim virtual void decompressDCTPatch(LLBitPack &bitpack, LLGroupHeader *gopp, BOOL b_large_patch); virtual void updatePatchVisibilities(LLAgent &agent); diff --git a/indra/newview/llsurfacepatch.cpp b/indra/newview/llsurfacepatch.cpp index 3ebea883c..ff99580e6 100644 --- a/indra/newview/llsurfacepatch.cpp +++ b/indra/newview/llsurfacepatch.cpp @@ -231,8 +231,8 @@ void LLSurfacePatch::eval(const U32 x, const U32 y, const U32 stride, LLVector3 const F32 xyScaleInv = (1.f / xyScale)*(0.2222222222f); F32 vec[3] = { - (F32)fmod((F32)(mOriginGlobal.mdV[0] + x)*xyScaleInv, 256.f), - (F32)fmod((F32)(mOriginGlobal.mdV[1] + y)*xyScaleInv, 256.f), + (F32)fmod((F32)(mOriginGlobal.mdV[0] + x)*xyScaleInv, 256.f), // Added (F32) for proper array initialization + (F32)fmod((F32)(mOriginGlobal.mdV[1] + y)*xyScaleInv, 256.f), // Added (F32) for proper array initialization 0.f }; F32 rand_val = llclamp(noise2(vec)* 0.75f + 0.5f, 0.f, 1.f); @@ -249,18 +249,26 @@ void LLSurfacePatch::calcNormal(const U32 x, const U32 y, const U32 stride) const F32 mpg = mSurfacep->getMetersPerGrid() * stride; - S32 poffsets[2][2][2]; +// Aurora Sim +// Singu Note: poffsets gets an extra space each for surface stride (tag clutter removed) + //S32 poffsets[2][2][2]; + S32 poffsets[2][2][3]; poffsets[0][0][0] = x - stride; poffsets[0][0][1] = y - stride; + poffsets[0][0][2] = surface_stride; poffsets[0][1][0] = x - stride; poffsets[0][1][1] = y + stride; + poffsets[0][1][2] = surface_stride; poffsets[1][0][0] = x + stride; poffsets[1][0][1] = y - stride; + poffsets[1][0][2] = surface_stride; poffsets[1][1][0] = x + stride; poffsets[1][1][1] = y + stride; + poffsets[1][1][2] = surface_stride; +// Aurora Sim const LLSurfacePatch *ppatches[2][2]; @@ -284,8 +292,11 @@ void LLSurfacePatch::calcNormal(const U32 x, const U32 y, const U32 stride) } else { - poffsets[i][j][0] += patch_width; +// Aurora Sim ppatches[i][j] = ppatches[i][j]->getNeighborPatch(WEST); + poffsets[i][j][0] += patch_width; + poffsets[i][j][2] = ppatches[i][j]->getSurface()->getGridsPerEdge(); +// Aurora Sim } } if (poffsets[i][j][1] < 0) @@ -296,8 +307,11 @@ void LLSurfacePatch::calcNormal(const U32 x, const U32 y, const U32 stride) } else { - poffsets[i][j][1] += patch_width; +// Aurora Sim ppatches[i][j] = ppatches[i][j]->getNeighborPatch(SOUTH); + poffsets[i][j][1] += patch_width; + poffsets[i][j][2] = ppatches[i][j]->getSurface()->getGridsPerEdge(); +// CR> Aurora Sim } } if (poffsets[i][j][0] >= (S32)patch_width) @@ -308,8 +322,11 @@ void LLSurfacePatch::calcNormal(const U32 x, const U32 y, const U32 stride) } else { - poffsets[i][j][0] -= patch_width; +// Aurora Sim ppatches[i][j] = ppatches[i][j]->getNeighborPatch(EAST); + poffsets[i][j][0] -= patch_width; + poffsets[i][j][2] = ppatches[i][j]->getSurface()->getGridsPerEdge(); +// Aurora Sim } } if (poffsets[i][j][1] >= (S32)patch_width) @@ -320,8 +337,11 @@ void LLSurfacePatch::calcNormal(const U32 x, const U32 y, const U32 stride) } else { - poffsets[i][j][1] -= patch_width; +// Aurora Sim ppatches[i][j] = ppatches[i][j]->getNeighborPatch(NORTH); + poffsets[i][j][1] -= patch_width; + poffsets[i][j][2] = ppatches[i][j]->getSurface()->getGridsPerEdge(); +// Aurora Sim } } } @@ -330,19 +350,22 @@ void LLSurfacePatch::calcNormal(const U32 x, const U32 y, const U32 stride) LLVector3 p00(-mpg,-mpg, *(ppatches[0][0]->mDataZ + poffsets[0][0][0] - + poffsets[0][0][1]*surface_stride)); +// Aurora Sim +// Singu Note: multiply the y poffsets by its own surface stride (tag clutter removed) + + poffsets[0][0][1]*poffsets[0][0][2])); LLVector3 p01(-mpg,+mpg, *(ppatches[0][1]->mDataZ + poffsets[0][1][0] - + poffsets[0][1][1]*surface_stride)); + + poffsets[0][1][1]*poffsets[0][1][2])); LLVector3 p10(+mpg,-mpg, *(ppatches[1][0]->mDataZ + poffsets[1][0][0] - + poffsets[1][0][1]*surface_stride)); + + poffsets[1][0][1]*poffsets[1][0][2])); LLVector3 p11(+mpg,+mpg, *(ppatches[1][1]->mDataZ + poffsets[1][1][0] - + poffsets[1][1][1]*surface_stride)); + + poffsets[1][1][1]*poffsets[1][1][2])); +// Aurora Sim LLVector3 c1 = p11 - p00; LLVector3 c2 = p01 - p10; @@ -493,6 +516,13 @@ void LLSurfacePatch::updateNormals() // update the west edge if (mNormalsInvalid[NORTHWEST] || mNormalsInvalid[WEST] || mNormalsInvalid[SOUTHWEST]) { +// Aurora Sim + if (!getNeighborPatch(NORTH) && getNeighborPatch(NORTHWEST) && getNeighborPatch(NORTHWEST)->getHasReceivedData()) + { + *(mDataZ + grids_per_patch_edge*grids_per_edge) = *(getNeighborPatch(NORTHWEST)->mDataZ + grids_per_patch_edge); + } +// Aurora Sim + for (j = 0; j < grids_per_patch_edge; j++) { calcNormal(0, j, 2); @@ -504,6 +534,13 @@ void LLSurfacePatch::updateNormals() // update the south edge if (mNormalsInvalid[SOUTHWEST] || mNormalsInvalid[SOUTH] || mNormalsInvalid[SOUTHEAST]) { +// Aurora Sim + if (!getNeighborPatch(EAST) && getNeighborPatch(SOUTHEAST) && getNeighborPatch(SOUTHEAST)->getHasReceivedData()) + { + *(mDataZ + grids_per_patch_edge) = *(getNeighborPatch(SOUTHEAST)->mDataZ + grids_per_patch_edge * getNeighborPatch(SOUTHEAST)->getSurface()->getGridsPerEdge()); + } +// Aurora Sim + for (i = 0; i < grids_per_patch_edge; i++) { calcNormal(i, 0, 2); @@ -532,7 +569,10 @@ void LLSurfacePatch::updateNormals() { // East, but not north. Pull from your east neighbor's northwest point. *(mDataZ + grids_per_patch_edge + grids_per_patch_edge*grids_per_edge) = - *(getNeighborPatch(EAST)->mDataZ + (grids_per_patch_edge - 1)*grids_per_edge); +// Aurora Sim + //*(getNeighborPatch(EAST)->mDataZ + (grids_per_patch_edge - 1)*grids_per_edge); + *(getNeighborPatch(EAST)->mDataZ + (getNeighborPatch(EAST)->getSurface()->getGridsPerPatchEdge() - 1)*getNeighborPatch(EAST)->getSurface()->getGridsPerEdge()); +// Aurora Sim } else { @@ -557,7 +597,10 @@ void LLSurfacePatch::updateNormals() { // North, but not east. Pull from your north neighbor's southeast corner. *(mDataZ + grids_per_patch_edge + grids_per_patch_edge*grids_per_edge) = - *(getNeighborPatch(NORTH)->mDataZ + (grids_per_patch_edge - 1)); +// Aurora Sim + //*(getNeighborPatch(NORTH)->mDataZ + (grids_per_patch_edge - 1)); + *(getNeighborPatch(NORTH)->mDataZ + (getNeighborPatch(NORTH)->getSurface()->getGridsPerPatchEdge() - 1)); +// Aurora Sim } else { @@ -574,8 +617,19 @@ void LLSurfacePatch::updateNormals() && (!getNeighborPatch(EAST) || (getNeighborPatch(EAST)->mSurfacep != mSurfacep))) { +// Aurora Sim + U32 own_xpos, own_ypos, neighbor_xpos, neighbor_ypos; + S32 own_offset = 0, neighbor_offset = 0; + from_region_handle(mSurfacep->getRegion()->getHandle(), &own_xpos, &own_ypos); + from_region_handle(getNeighborPatch(NORTHEAST)->mSurfacep->getRegion()->getHandle(), &neighbor_xpos, &neighbor_ypos); + if (own_ypos >= neighbor_ypos) + neighbor_offset = own_ypos - neighbor_ypos; + else + own_offset = neighbor_ypos - own_ypos; + *(mDataZ + grids_per_patch_edge + grids_per_patch_edge*grids_per_edge) = - *(getNeighborPatch(NORTHEAST)->mDataZ); + *(getNeighborPatch(NORTHEAST)->mDataZ + (grids_per_edge + neighbor_offset - own_offset - 1) * getNeighborPatch(NORTHEAST)->getSurface()->getGridsPerEdge()); +// Aurora Sim } } else @@ -618,8 +672,12 @@ void LLSurfacePatch::updateEastEdge() { U32 grids_per_patch_edge = mSurfacep->getGridsPerPatchEdge(); U32 grids_per_edge = mSurfacep->getGridsPerEdge(); +// Aurora Sim + U32 grids_per_edge_east = grids_per_edge; - U32 j, k; + //U32 j, k; + U32 j, k, h; +// Aurora Sim F32 *west_surface, *east_surface; if (!getNeighborPatch(EAST)) @@ -631,6 +689,9 @@ void LLSurfacePatch::updateEastEdge() { west_surface = mDataZ + grids_per_patch_edge; east_surface = getNeighborPatch(EAST)->mDataZ; +// Aurora Sim + grids_per_edge_east = getNeighborPatch(EAST)->getSurface()->getGridsPerEdge(); +// Aurora Sim } else { @@ -642,7 +703,11 @@ void LLSurfacePatch::updateEastEdge() for (j=0; j < grids_per_patch_edge; j++) { k = j * grids_per_edge; - *(west_surface + k) = *(east_surface + k); // update buffer Z +// Aurora Sim + h = j * grids_per_edge_east; + *(west_surface + k) = *(east_surface + h); // update buffer Z + //*(west_surface + k) = *(east_surface + k); // update buffer Z +// Aurora Sim } } @@ -671,13 +736,12 @@ void LLSurfacePatch::updateNorthEdge() } // Update patchp's north edge ... - for (i=0; imNormalsInvalid[gDirOpposite[direction]] = TRUE; diff --git a/indra/newview/lltexturefetch.cpp b/indra/newview/lltexturefetch.cpp index 96f366fca..f291de520 100644 --- a/indra/newview/lltexturefetch.cpp +++ b/indra/newview/lltexturefetch.cpp @@ -328,13 +328,12 @@ class HTTPGetResponder : public LLHTTPClient::ResponderWithCompleted { LOG_CLASS(HTTPGetResponder); public: - HTTPGetResponder(LLTextureFetch* fetcher, const LLUUID& id, U64 startTime, S32 requestedSize, U32 offset, bool redir) + HTTPGetResponder(LLTextureFetch* fetcher, const LLUUID& id, U64 startTime, S32 requestedSize, U32 offset) : mFetcher(fetcher) , mID(id) , mMetricsStartTime(startTime) , mRequestedSize(requestedSize) , mRequestedOffset(offset) - , mFollowRedir(redir) , mReplyOffset(0) , mReplyLength(0) , mReplyFullLength(0) @@ -449,7 +448,6 @@ public: } } - /*virtual*/ bool followRedir() const { return mFollowRedir; } /*virtual*/ AICapabilityType capability_type(void) const { return cap_texture; } /*virtual*/ AIHTTPTimeoutPolicy const& getHTTPTimeoutPolicy(void) const { return HTTPGetResponder_timeout; } /*virtual*/ char const* getName(void) const { return "HTTPGetResponder"; } @@ -464,8 +462,6 @@ private: U32 mReplyOffset; U32 mReplyLength; U32 mReplyFullLength; - - bool mFollowRedir; }; ////////////////////////////////////////////////////////////////////////////// @@ -1247,7 +1243,7 @@ bool LLTextureFetchWorker::doWork(S32 param) } else if (mSentRequest == UNSENT && mCanUseNET) { - LL_WARNS("Texture") << mID << " moving to UDP fetch. mSentRequest=" << mSentRequest << " mCanUseNET = " << mCanUseNET << llendl; + LL_DEBUGS("Texture") << mID << " moving to UDP fetch. mSentRequest=" << mSentRequest << " mCanUseNET = " << mCanUseNET << llendl; setState(SEND_UDP_REQ); setPriority(LLWorkerThread::PRIORITY_HIGH | mWorkPriority); if(mWriteToCacheState != NOT_WRITE) @@ -1315,7 +1311,7 @@ bool LLTextureFetchWorker::doWork(S32 param) return true ; //abort } - LL_WARNS("Texture") << mID << " sendind to UDP fetch. mSentRequest=" << mSentRequest << " mCanUseNET = " << mCanUseNET << llendl; + LL_DEBUGS("Texture") << mID << " sending to UDP fetch. mSentRequest=" << mSentRequest << " mCanUseNET = " << mCanUseNET << llendl; mRequestedSize = mDesiredSize; mRequestedDiscard = mDesiredDiscard; @@ -1423,7 +1419,7 @@ bool LLTextureFetchWorker::doWork(S32 param) headers.addHeader("Range", llformat("bytes=%d-%d", mRequestedOffset, mRequestedOffset + mRequestedSize - 1)); } LLHTTPClient::request(mUrl, LLHTTPClient::HTTP_GET, NULL, - new HTTPGetResponder(mFetcher, mID, LLTimer::getTotalTime(), mRequestedSize, mRequestedOffset, true), + new HTTPGetResponder(mFetcher, mID, LLTimer::getTotalTime(), mRequestedSize, mRequestedOffset), headers, approved/*,*/ DEBUG_CURLIO_PARAM(debug_off), keep_alive, no_does_authentication, allow_compressed_reply, NULL, 0, NULL); } else @@ -2976,6 +2972,7 @@ bool LLTextureFetchWorker::insertPacket(S32 index, U8* data, S32 size) void LLTextureFetchWorker::setState(e_state new_state) { + /* static const char* e_state_name[] = { "INVALID", @@ -2994,6 +2991,7 @@ void LLTextureFetchWorker::setState(e_state new_state) "WAIT_ON_WRITE", "DONE" }; + */ //if(mState != new_state) // LL_INFOS("Texture") << "id: " << mID << " disc: " << mDesiredDiscard << " sz: " << mDesiredSize << " state: " << e_state_name[mState] << " => " << e_state_name[new_state] << llendl; mState = new_state; diff --git a/indra/newview/lltoolbar.cpp b/indra/newview/lltoolbar.cpp index 78d3f21bf..985d27f15 100644 --- a/indra/newview/lltoolbar.cpp +++ b/indra/newview/lltoolbar.cpp @@ -389,8 +389,26 @@ void LLToolBar::updateCommunicateList() LLFloaterIMPanel* im_floaterp = (LLFloaterIMPanel*)floater_handle_it->get(); if (im_floaterp) { - std::string floater_title = im_floaterp->getNumUnreadMessages() > 0 ? "*" : ""; + static LLCachedControl show_counts("ShowUnreadIMsCounts", true); + S32 count = im_floaterp->getNumUnreadMessages(); + std::string floater_title; + if (count > 0) floater_title = "*"; floater_title.append(im_floaterp->getShortTitle()); + if (show_counts && count > 0) + { + floater_title += " - "; + if (count > 1) + { + LLStringUtil::format_map_t args; + args["COUNT"] = llformat("%d", count); + floater_title += getString("IMs", args); + } + else + { + floater_title += getString("IM"); + } + } + itemp = communicate_button->add(floater_title, im_floaterp->getSessionID(), ADD_TOP); if (im_floaterp == frontmost_floater) { diff --git a/indra/newview/lltoolgrab.cpp b/indra/newview/lltoolgrab.cpp index 6170b7aca..22684899f 100644 --- a/indra/newview/lltoolgrab.cpp +++ b/indra/newview/lltoolgrab.cpp @@ -58,6 +58,8 @@ #include "llvoavatarself.h" #include "llworld.h" +#include "hippolimits.h" + // [RLVa:KB] #include "rlvhandler.h" // [/RLVa:KB] @@ -635,9 +637,9 @@ void LLToolGrab::handleHoverActive(S32 x, S32 y, MASK mask) } // For safety, cap heights where objects can be dragged - if (grab_point_global.mdV[VZ] > MAX_OBJECT_Z) + if (grab_point_global.mdV[VZ] > gHippoLimits->getMaxHeight()) { - grab_point_global.mdV[VZ] = MAX_OBJECT_Z; + grab_point_global.mdV[VZ] = gHippoLimits->getMaxHeight(); } grab_point_global = LLWorld::getInstance()->clipToVisibleRegions(mDragStartPointGlobal, grab_point_global); diff --git a/indra/newview/lltoolgun.cpp b/indra/newview/lltoolgun.cpp index 055236f43..1eedb7b22 100644 --- a/indra/newview/lltoolgun.cpp +++ b/indra/newview/lltoolgun.cpp @@ -62,7 +62,7 @@ void LLToolGun::handleSelect() { gViewerWindow->hideCursor(); gViewerWindow->moveCursorToCenter(); - gViewerWindow->mWindow->setMouseClipping(TRUE); + gViewerWindow->getWindow()->setMouseClipping(TRUE); mIsSelected = TRUE; } @@ -70,7 +70,7 @@ void LLToolGun::handleDeselect() { gViewerWindow->moveCursorToCenter(); gViewerWindow->showCursor(); - gViewerWindow->mWindow->setMouseClipping(FALSE); + gViewerWindow->getWindow()->setMouseClipping(FALSE); mIsSelected = FALSE; } diff --git a/indra/newview/llviewercontrol.cpp b/indra/newview/llviewercontrol.cpp index 76106bf25..23e407d40 100644 --- a/indra/newview/llviewercontrol.cpp +++ b/indra/newview/llviewercontrol.cpp @@ -642,7 +642,7 @@ void settings_setup_listeners() gSavedSettings.getControl("OctreeAlphaDistanceFactor")->getSignal()->connect(boost::bind(&handleRepartition, _2)); gSavedSettings.getControl("OctreeAttachmentSizeFactor")->getSignal()->connect(boost::bind(&handleRepartition, _2)); gSavedSettings.getControl("RenderMaxTextureIndex")->getSignal()->connect(boost::bind(&handleSetShaderChanged, _2)); - //gSavedSettings.getControl("RenderAnimateTrees")->getSignal()->connect(boost::bind(&handleResetVertexBuffersChanged, _2)); + gSavedSettings.getControl("RenderAnimateTrees")->getSignal()->connect(boost::bind(&handleResetVertexBuffersChanged, _2)); gSavedSettings.getControl("RenderAvatarVP")->getSignal()->connect(boost::bind(&handleSetShaderChanged, _2)); gSavedSettings.getControl("VertexShaderEnable")->getSignal()->connect(boost::bind(&handleSetShaderChanged, _2)); gSavedSettings.getControl("RenderDepthOfField")->getSignal()->connect(boost::bind(&handleReleaseGLBufferChanged, _2)); diff --git a/indra/newview/llviewerdisplay.cpp b/indra/newview/llviewerdisplay.cpp index b63933c41..eecabfb9f 100644 --- a/indra/newview/llviewerdisplay.cpp +++ b/indra/newview/llviewerdisplay.cpp @@ -214,7 +214,7 @@ void display_update_camera(bool tiling=false) // Write some stats to llinfos void display_stats() { - if (gNoRender || !gViewerWindow->mWindow->getVisible() || !gFocusMgr.getAppHasFocus()) + if (gNoRender || !gViewerWindow->getWindow()->getVisible() || !gFocusMgr.getAppHasFocus()) { // Do not keep FPS statistics while yielding cooperatively // (i;e. when not running as foreground window) diff --git a/indra/newview/llviewerinventory.cpp b/indra/newview/llviewerinventory.cpp index 9678a880b..de52941d1 100644 --- a/indra/newview/llviewerinventory.cpp +++ b/indra/newview/llviewerinventory.cpp @@ -311,6 +311,12 @@ void LLViewerInventoryItem::removeFromServer() void LLViewerInventoryItem::updateServer(BOOL is_new) const { + if(getWearableType() == LLWearableType::WT_UNKNOWN) + { + llwarns << "LLViewerInventoryItem::updateServer() - for item with unknown wearable type" + << llendl; + return; + } if(!mIsComplete) { // *FIX: deal with this better. @@ -1777,6 +1783,15 @@ LLWearableType::EType LLViewerInventoryItem::getWearableType() const return LLWearableType::EType(getFlags() & LLInventoryItemFlags::II_FLAGS_WEARABLES_MASK); } +void LLViewerInventoryItem::setWearableType(LLWearableType::EType type) +{ + if (getWearableType() != LLWearableType::WT_UNKNOWN) + { + llwarns << "Calling LLViewerInventoryItem::setWearableType for item that does not have an unknown wearable type!?" << llendl; + return; + } + mFlags = (mFlags & ~LLInventoryItemFlags::II_FLAGS_WEARABLES_MASK) | type; +} time_t LLViewerInventoryItem::getCreationDate() const { diff --git a/indra/newview/llviewerinventory.h b/indra/newview/llviewerinventory.h index 18c57f2a3..a8c833947 100644 --- a/indra/newview/llviewerinventory.h +++ b/indra/newview/llviewerinventory.h @@ -162,6 +162,11 @@ public: // If this is a broken link, try to fix it and any other identical link. BOOL regenerateLink(); + // + // Change WT_UNKNOWN to the type retrieved from the asset. + void setWearableType(LLWearableType::EType type); + // + public: BOOL mIsComplete; LLTransactionID mTransactionID; diff --git a/indra/newview/llviewermedia.cpp b/indra/newview/llviewermedia.cpp index 6b3aa2a21..6cd1e611f 100644 --- a/indra/newview/llviewermedia.cpp +++ b/indra/newview/llviewermedia.cpp @@ -304,7 +304,6 @@ public: LLViewerMediaWebProfileResponder(std::string host) : mHost(host) { } ~LLViewerMediaWebProfileResponder() { } - /*virtual*/ bool followRedir(void) const { return true; } /*virtual*/ bool needsHeaders(void) const { return true; } /*virtual*/ void completedHeaders(U32 status, std::string const& reason, AIHTTPReceivedHeaders const& headers) @@ -2595,6 +2594,12 @@ void LLViewerMediaImpl::unload() ////////////////////////////////////////////////////////////////////////////////////////// void LLViewerMediaImpl::navigateTo(const std::string& url, const std::string& mime_type, bool rediscover_type, bool server_request) { + if (url.empty()) + { + llwarns << "Calling LLViewerMediaImpl::navigateTo with empty url" << llendl; + return; + } + cancelMimeTypeProbe(); if(mMediaURL != url) @@ -2639,6 +2644,12 @@ void LLViewerMediaImpl::navigateInternal() // Helpful to have media urls in log file. Shouldn't be spammy. llinfos << "media id= " << mTextureId << " url=" << mMediaURL << " mime_type=" << mMimeType << llendl; + if (mMediaURL.empty()) + { + llwarns << "Calling LLViewerMediaImpl::navigateInternal() with empty mMediaURL" << llendl; + return; + } + if(mNavigateSuspended) { llwarns << "Deferring navigate." << llendl; diff --git a/indra/newview/llviewermenu.cpp b/indra/newview/llviewermenu.cpp index 3e8c9145c..787a345c8 100644 --- a/indra/newview/llviewermenu.cpp +++ b/indra/newview/llviewermenu.cpp @@ -228,6 +228,7 @@ class AIHTTPView; void add_wave_listeners(); void add_dae_listeners(); +void add_radar_listeners(); //extern BOOL gHideSelectedObjects; //extern BOOL gAllowSelectAvatar; //extern BOOL gDebugAvatarRotation; @@ -865,7 +866,7 @@ void init_client_menu(LLMenuGL* menu) /*menu->addChild(new LLMenuItemCallGL("Reload settings/colors", &handle_reload_settings, NULL, NULL));*/ menu->addChild(new LLMenuItemCallGL("Reload personal setting overrides", - &reload_personal_settings_overrides, NULL, NULL, KEY_F2, MASK_CONTROL|MASK_SHIFT)); + &reload_personal_settings_overrides)); sub_menu = new LLMenuGL("HUD Info"); { @@ -1203,6 +1204,7 @@ void init_debug_ui_menu(LLMenuGL* menu) menu->addChild(new LLMenuItemCheckGL("Show Render Info", menu_toggle_control, NULL, menu_check_control, (void*)"DebugShowRenderInfo")); menu->addChild(new LLMenuItemCheckGL("Show Matrices", menu_toggle_control, NULL, menu_check_control, (void*)"DebugShowRenderMatrices")); menu->addChild(new LLMenuItemCheckGL("Show Color Under Cursor", menu_toggle_control, NULL, menu_check_control, (void*)"DebugShowColor")); + menu->addChild(new LLMenuItemCheckGL("Show FPS", menu_toggle_control, NULL, menu_check_control, (void*)"SLBShowFPS")); menu->createJumpKeys(); } @@ -1297,38 +1299,43 @@ void init_debug_rendering_menu(LLMenuGL* menu) sub_menu = new LLMenuGL("Features"); sub_menu->setCanTearOff(TRUE); menu->addChild(sub_menu); +#ifdef LL_LINUX + #define MODIFIER MASK_SHIFT +#else + #define MODIFIER MASK_ALT +#endif sub_menu->addChild(new LLMenuItemCheckGL("UI", &LLPipeline::toggleRenderDebugFeature, NULL, &LLPipeline::toggleRenderDebugFeatureControl, - (void*)LLPipeline::RENDER_DEBUG_FEATURE_UI, KEY_F1, MASK_ALT|MASK_CONTROL)); + (void*)LLPipeline::RENDER_DEBUG_FEATURE_UI, KEY_F1, MODIFIER|MASK_CONTROL)); sub_menu->addChild(new LLMenuItemCheckGL("Selected", &LLPipeline::toggleRenderDebugFeature, NULL, &LLPipeline::toggleRenderDebugFeatureControl, - (void*)LLPipeline::RENDER_DEBUG_FEATURE_SELECTED, KEY_F2, MASK_ALT|MASK_CONTROL)); + (void*)LLPipeline::RENDER_DEBUG_FEATURE_SELECTED, KEY_F2, MODIFIER|MASK_CONTROL)); sub_menu->addChild(new LLMenuItemCheckGL("Highlighted", &LLPipeline::toggleRenderDebugFeature, NULL, &LLPipeline::toggleRenderDebugFeatureControl, - (void*)LLPipeline::RENDER_DEBUG_FEATURE_HIGHLIGHTED, KEY_F3, MASK_ALT|MASK_CONTROL)); + (void*)LLPipeline::RENDER_DEBUG_FEATURE_HIGHLIGHTED, KEY_F3, MODIFIER|MASK_CONTROL)); sub_menu->addChild(new LLMenuItemCheckGL("Dynamic Textures", &LLPipeline::toggleRenderDebugFeature, NULL, &LLPipeline::toggleRenderDebugFeatureControl, - (void*)LLPipeline::RENDER_DEBUG_FEATURE_DYNAMIC_TEXTURES, KEY_F4, MASK_ALT|MASK_CONTROL)); + (void*)LLPipeline::RENDER_DEBUG_FEATURE_DYNAMIC_TEXTURES, KEY_F4, MODIFIER|MASK_CONTROL)); sub_menu->addChild(new LLMenuItemCheckGL( "Foot Shadows", &LLPipeline::toggleRenderDebugFeature, NULL, &LLPipeline::toggleRenderDebugFeatureControl, - (void*)LLPipeline::RENDER_DEBUG_FEATURE_FOOT_SHADOWS, KEY_F5, MASK_ALT|MASK_CONTROL)); + (void*)LLPipeline::RENDER_DEBUG_FEATURE_FOOT_SHADOWS, KEY_F5, MODIFIER|MASK_CONTROL)); sub_menu->addChild(new LLMenuItemCheckGL("Fog", &LLPipeline::toggleRenderDebugFeature, NULL, &LLPipeline::toggleRenderDebugFeatureControl, - (void*)LLPipeline::RENDER_DEBUG_FEATURE_FOG, KEY_F6, MASK_ALT|MASK_CONTROL)); + (void*)LLPipeline::RENDER_DEBUG_FEATURE_FOG, KEY_F6, MODIFIER|MASK_CONTROL)); sub_menu->addChild(new LLMenuItemCheckGL("Test FRInfo", &LLPipeline::toggleRenderDebugFeature, NULL, &LLPipeline::toggleRenderDebugFeatureControl, - (void*)LLPipeline::RENDER_DEBUG_FEATURE_FR_INFO, KEY_F8, MASK_ALT|MASK_CONTROL)); + (void*)LLPipeline::RENDER_DEBUG_FEATURE_FR_INFO, KEY_F8, MODIFIER|MASK_CONTROL)); sub_menu->addChild(new LLMenuItemCheckGL( "Flexible Objects", &LLPipeline::toggleRenderDebugFeature, NULL, &LLPipeline::toggleRenderDebugFeatureControl, - (void*)LLPipeline::RENDER_DEBUG_FEATURE_FLEXIBLE, KEY_F9, MASK_ALT|MASK_CONTROL)); + (void*)LLPipeline::RENDER_DEBUG_FEATURE_FLEXIBLE, KEY_F9, MODIFIER|MASK_CONTROL)); sub_menu->createJumpKeys(); ///////////////////////////// @@ -1469,6 +1476,9 @@ void init_debug_rendering_menu(LLMenuGL* menu) menu->addChild(new LLMenuItemCallGL("Rebuild Vertex Buffers", reset_vertex_buffers, NULL, NULL, 'V', MASK_CONTROL | MASK_SHIFT)); + item = new LLMenuItemCheckGL("Animate Trees", menu_toggle_control, NULL, menu_check_control, (void*)"RenderAnimateTrees"); + menu->addChild(item); + item = new LLMenuItemCheckGL("Animate Textures", menu_toggle_control, NULL, menu_check_control, (void*)"AnimateTextures"); menu->addChild(item); @@ -2612,7 +2622,7 @@ class LLObjectCopyUUID : public view_listener_t LLViewerObject* object = LLSelectMgr::getInstance()->getSelection()->getPrimaryObject(); if(object) { - gViewerWindow->mWindow->copyTextToClipboard(utf8str_to_wstring(object->getID().asString())); + gViewerWindow->getWindow()->copyTextToClipboard(utf8str_to_wstring(object->getID().asString())); } return true; } @@ -2885,24 +2895,18 @@ class LLObjectEnableExport : public view_listener_t { bool handleEvent(LLPointer event, const LLSD& userdata) { - LLPermissions perms; - bool new_value = LLSelectMgr::getInstance()->selectGetPermissions(perms) && perms.isOwned(); // At least one object, accumulated permissions of all objects. - bool supports_export = LFSimFeatureHandler::instance().simSupportsExport(); - if (new_value && !(supports_export && (perms.getMaskEveryone() & PERM_EXPORT))) // No need to call allowExportBy if PERM_EXPORT is set on (all) root objects. + ExportPolicy export_policy = LFSimFeatureHandler::instance().exportPolicy(); + bool can_export_any = false; + LLObjectSelectionHandle selection = LLSelectMgr::getInstance()->getSelection(); + for (LLObjectSelection::iterator node = selection->begin(); node != selection->end(); ++node) { - bool can_export_any = false; - LLObjectSelectionHandle selection = LLSelectMgr::getInstance()->getSelection(); - for (LLObjectSelection::iterator node = selection->begin(); node != selection->end(); ++node) + if ((*node)->mPermissions->allowExportBy(gAgent.getID(), export_policy)) { - if ((*node)->mPermissions->allowExportBy(gAgent.getID(), supports_export)) - { - can_export_any = true; - break; - } + can_export_any = true; + break; } - new_value = can_export_any; } - gMenuHolder->findControl(userdata["control"].asString())->setValue(new_value); + gMenuHolder->findControl(userdata["control"].asString())->setValue(can_export_any); return true; } }; @@ -3260,7 +3264,7 @@ class LLAvatarCopyUUID : public view_listener_t LLVOAvatar* avatar = find_avatar_from_object( LLSelectMgr::getInstance()->getSelection()->getPrimaryObject() ); if(!avatar) return true; - gViewerWindow->mWindow->copyTextToClipboard(utf8str_to_wstring(avatar->getID().asString())); + gViewerWindow->getWindow()->copyTextToClipboard(utf8str_to_wstring(avatar->getID().asString())); return true; } }; @@ -3272,7 +3276,7 @@ class LLAvatarClientUUID : public view_listener_t LLVOAvatar* avatar = find_avatar_from_object( LLSelectMgr::getInstance()->getSelection()->getPrimaryObject() ); if(!avatar) return true; const LLUUID clientID = SHClientTagMgr::instance().getClientID(avatar); - gViewerWindow->mWindow->copyTextToClipboard(utf8str_to_wstring(clientID.asString())); + gViewerWindow->getWindow()->copyTextToClipboard(utf8str_to_wstring(clientID.asString())); return true; } }; @@ -3652,7 +3656,6 @@ void set_god_level(U8 god_level) { U8 old_god_level = gAgent.getGodLevel(); gAgent.setGodLevel( god_level ); - gIMMgr->refresh(); LLViewerParcelMgr::getInstance()->notifyObservers(); // Some classifieds change visibility on god mode @@ -4111,6 +4114,11 @@ void reset_view_final( BOOL proceed ) return; } + if (!gViewerWindow->getLeftMouseDown() && gAgentCamera.cameraThirdPerson() && gSavedSettings.getBOOL("ResetViewTurnsAvatar") && !gSavedSettings.getBOOL("FreezeTime")) + { + gAgentCamera.setFocusOnAvatar(TRUE, ANIMATE); + } + gAgentCamera.switchCameraPreset(CAMERA_PRESET_REAR_VIEW); gAgentCamera.resetView(TRUE, TRUE); gAgentCamera.setLookAt(LOOKAT_TARGET_CLEAR); @@ -9213,13 +9221,32 @@ LLScrollListCtrl* get_focused_list() return list; } +S32 get_focused_list_num_selected() +{ + if (LLScrollListCtrl* list = get_focused_list()) + return list->getNumSelected(); + return 0; +} + +const LLUUID get_focused_list_id_selected() +{ + if (LLScrollListCtrl* list = get_focused_list()) + return list->getStringUUIDSelectedItem(); + return LLUUID::null; +} + +const uuid_vec_t get_focused_list_ids_selected() +{ + if (LLScrollListCtrl* list = get_focused_list()) + return list->getSelectedIDs(); + return uuid_vec_t(); +} + class ListEnableAnySelected : public view_listener_t { bool handleEvent(LLPointer event, const LLSD& userdata) { - LLScrollListCtrl* list = get_focused_list(); - if (!list) return false; - gMenuHolder->findControl(userdata["control"].asString())->setValue(list->getNumSelected()); + gMenuHolder->findControl(userdata["control"].asString())->setValue(get_focused_list_num_selected()); return true; } }; @@ -9228,9 +9255,7 @@ class ListEnableMultipleSelected : public view_listener_t { bool handleEvent(LLPointer event, const LLSD& userdata) { - LLScrollListCtrl* list = get_focused_list(); - if (!list) return false; - gMenuHolder->findControl(userdata["control"].asString())->setValue(list->getNumSelected() > 1); + gMenuHolder->findControl(userdata["control"].asString())->setValue(get_focused_list_num_selected() > 1); return true; } }; @@ -9239,9 +9264,7 @@ class ListEnableSingleSelected : public view_listener_t { bool handleEvent(LLPointer event, const LLSD& userdata) { - LLScrollListCtrl* list = get_focused_list(); - if (!list) return false; - gMenuHolder->findControl(userdata["control"].asString())->setValue(list->getNumSelected() == 1); + gMenuHolder->findControl(userdata["control"].asString())->setValue(get_focused_list_num_selected() == 1); return true; } }; @@ -9261,9 +9284,7 @@ class ListEnableIsFriend : public view_listener_t { bool handleEvent(LLPointer event, const LLSD& userdata) { - LLScrollListCtrl* list = get_focused_list(); - if (!list) return false; - gMenuHolder->findControl(userdata["control"].asString())->setValue(LLAvatarActions::isFriend(list->getStringUUIDSelectedItem())); + gMenuHolder->findControl(userdata["control"].asString())->setValue(LLAvatarActions::isFriend(get_focused_list_id_selected())); return true; } }; @@ -9272,9 +9293,7 @@ class ListEnableIsNotFriend : public view_listener_t { bool handleEvent(LLPointer event, const LLSD& userdata) { - LLScrollListCtrl* list = get_focused_list(); - if (!list) return false; - gMenuHolder->findControl(userdata["control"].asString())->setValue(!LLAvatarActions::isFriend(list->getStringUUIDSelectedItem())); + gMenuHolder->findControl(userdata["control"].asString())->setValue(!LLAvatarActions::isFriend(get_focused_list_id_selected())); return true; } }; @@ -9283,9 +9302,7 @@ class ListEnableMute : public view_listener_t { bool handleEvent(LLPointer event, const LLSD& userdata) { - LLScrollListCtrl* list = get_focused_list(); - if (!list) return false; - uuid_vec_t ids = list->getSelectedIDs(); + const uuid_vec_t& ids = get_focused_list_ids_selected(); bool can_block = true; for (uuid_vec_t::const_iterator it = ids.begin(); can_block && it != ids.end(); ++it) can_block = LLAvatarActions::canBlock(*it); @@ -9298,9 +9315,16 @@ class ListEnableOfferTeleport : public view_listener_t { bool handleEvent(LLPointer event, const LLSD& userdata) { - LLScrollListCtrl* list = get_focused_list(); - if (!list) return false; - gMenuHolder->findControl(userdata["control"].asString())->setValue(LLAvatarActions::canOfferTeleport(list->getSelectedIDs())); + gMenuHolder->findControl(userdata["control"].asString())->setValue(LLAvatarActions::canOfferTeleport(get_focused_list_ids_selected())); + return true; + } +}; + +class ListVisibleWebProfile : public view_listener_t +{ + bool handleEvent(LLPointer event, const LLSD& userdata) + { + gMenuHolder->findControl(userdata["control"].asString())->setValue(get_focused_list_num_selected() && !(gSavedSettings.getBOOL("UseWebProfiles") || gSavedSettings.getString("WebProfileURL").empty())); return true; } }; @@ -9309,9 +9333,7 @@ class ListCopyUUIDs : public view_listener_t { bool handleEvent(LLPointer event, const LLSD& userdata) { - LLScrollListCtrl* list = get_focused_list(); - if (!list) return false; - LLAvatarActions::copyUUIDs(list->getSelectedIDs()); + LLAvatarActions::copyUUIDs(get_focused_list_ids_selected()); return true; } }; @@ -9320,9 +9342,7 @@ class ListInviteToGroup : public view_listener_t { bool handleEvent(LLPointer event, const LLSD& userdata) { - LLScrollListCtrl* list = get_focused_list(); - if (!list) return false; - LLAvatarActions::inviteToGroup(list->getStringUUIDSelectedItem()); + LLAvatarActions::inviteToGroup(get_focused_list_id_selected()); return true; } }; @@ -9331,9 +9351,7 @@ class ListOfferTeleport : public view_listener_t { bool handleEvent(LLPointer event, const LLSD& userdata) { - LLScrollListCtrl* list = get_focused_list(); - if (!list) return false; - LLAvatarActions::offerTeleport(list->getSelectedIDs()); + LLAvatarActions::offerTeleport(get_focused_list_ids_selected()); return true; } }; @@ -9342,9 +9360,7 @@ class ListPay : public view_listener_t { bool handleEvent(LLPointer event, const LLSD& userdata) { - LLScrollListCtrl* list = get_focused_list(); - if (!list) return false; - LLAvatarActions::pay(list->getStringUUIDSelectedItem()); + LLAvatarActions::pay(get_focused_list_id_selected()); return true; } }; @@ -9353,9 +9369,7 @@ class ListRemoveFriend : public view_listener_t { bool handleEvent(LLPointer event, const LLSD& userdata) { - LLScrollListCtrl* list = get_focused_list(); - if (!list) return false; - LLAvatarActions::removeFriendDialog(list->getStringUUIDSelectedItem()); + LLAvatarActions::removeFriendDialog(get_focused_list_id_selected()); return true; } }; @@ -9364,9 +9378,7 @@ class ListRequestFriendship : public view_listener_t { bool handleEvent(LLPointer event, const LLSD& userdata) { - LLScrollListCtrl* list = get_focused_list(); - if (!list) return false; - LLAvatarActions::requestFriendshipDialog(list->getStringUUIDSelectedItem()); + LLAvatarActions::requestFriendshipDialog(get_focused_list_id_selected()); return true; } }; @@ -9375,9 +9387,7 @@ class ListRequestTeleport : public view_listener_t { bool handleEvent(LLPointer event, const LLSD& userdata) { - LLScrollListCtrl* list = get_focused_list(); - if (!list) return false; - LLAvatarActions::teleportRequest(list->getStringUUIDSelectedItem()); + LLAvatarActions::teleportRequest(get_focused_list_id_selected()); return true; } }; @@ -9386,9 +9396,16 @@ class ListShowProfile : public view_listener_t { bool handleEvent(LLPointer event, const LLSD& userdata) { - LLScrollListCtrl* list = get_focused_list(); - if (!list) return false; - LLAvatarActions::showProfiles(list->getSelectedIDs()); + LLAvatarActions::showProfiles(get_focused_list_ids_selected()); + return true; + } +}; + +class ListShowWebProfile : public view_listener_t +{ + bool handleEvent(LLPointer event, const LLSD& userdata) + { + LLAvatarActions::showProfiles(get_focused_list_ids_selected(), true); return true; } }; @@ -9397,9 +9414,7 @@ class ListStartAdhocCall : public view_listener_t { bool handleEvent(LLPointer event, const LLSD& userdata) { - LLScrollListCtrl* list = get_focused_list(); - if (!list) return false; - LLAvatarActions::startAdhocCall(list->getSelectedIDs()); + LLAvatarActions::startAdhocCall(get_focused_list_ids_selected()); return true; } }; @@ -9408,9 +9423,7 @@ class ListStartCall : public view_listener_t { bool handleEvent(LLPointer event, const LLSD& userdata) { - LLScrollListCtrl* list = get_focused_list(); - if (!list) return false; - LLAvatarActions::startCall(list->getStringUUIDSelectedItem()); + LLAvatarActions::startCall(get_focused_list_id_selected()); return true; } }; @@ -9419,9 +9432,7 @@ class ListStartConference : public view_listener_t { bool handleEvent(LLPointer event, const LLSD& userdata) { - LLScrollListCtrl* list = get_focused_list(); - if (!list) return false; - LLAvatarActions::startConference(list->getSelectedIDs()); + LLAvatarActions::startConference(get_focused_list_ids_selected()); return true; } }; @@ -9430,23 +9441,21 @@ class ListStartIM : public view_listener_t { bool handleEvent(LLPointer event, const LLSD& userdata) { - LLScrollListCtrl* list = get_focused_list(); - if (!list) return false; - LLAvatarActions::startIM(list->getStringUUIDSelectedItem()); + LLAvatarActions::startIM(get_focused_list_id_selected()); return true; } }; +/* Singu TODO: Figure out why this wouldn't work class ListAbuseReport : public view_listener_t { bool handleEvent(LLPointer event, const LLSD& userdata) { - LLScrollListCtrl* list = get_focused_list(); - if (!list) return false; - LLFloaterReporter::showFromObject(list->getStringUUIDSelectedItem()); + LLFloaterReporter::showFromObject(get_focused_list_id_selected()); return true; } }; +*/ // Create the args for administrative notifications used in lists, tossing the selected names into it. LLSD create_args(const uuid_vec_t& ids, const std::string& token) @@ -9471,9 +9480,7 @@ class ListEject : public view_listener_t { bool handleEvent(LLPointer event, const LLSD& userdata) { - LLScrollListCtrl* list = get_focused_list(); - if (!list) return false; - const uuid_vec_t& ids = list->getSelectedIDs(); + const uuid_vec_t& ids = get_focused_list_ids_selected(); LLNotificationsUtil::add("EjectAvatarFullname", create_args(ids, "AVATAR_NAME"), LLSD(), boost::bind(parcel_mod_notice_callback, ids, boost::bind(LLNotificationsUtil::getSelectedOption, _1, _2), send_eject)); return true; } @@ -9484,9 +9491,7 @@ class ListFreeze : public view_listener_t { bool handleEvent(LLPointer event, const LLSD& userdata) { - LLScrollListCtrl* list = get_focused_list(); - if (!list) return false; - const uuid_vec_t& ids = list->getSelectedIDs(); + const uuid_vec_t& ids = get_focused_list_ids_selected(); LLNotificationsUtil::add("FreezeAvatarFullname", create_args(ids, "AVATAR_NAME"), LLSD(), boost::bind(parcel_mod_notice_callback, ids, boost::bind(LLNotificationsUtil::getSelectedOption, _1, _2), send_freeze)); return true; } @@ -9512,9 +9517,7 @@ class ListEstateBan : public view_listener_t { bool handleEvent(LLPointer event, const LLSD& userdata) { - LLScrollListCtrl* list = get_focused_list(); - if (!list) return false; - const uuid_vec_t& ids = list->getSelectedIDs(); + const uuid_vec_t& ids = get_focused_list_ids_selected(); LLNotificationsUtil::add("EstateBanUser", create_args(ids, "EVIL_USER"), LLSD(), boost::bind(estate_bulk_eject, ids, true, boost::bind(LLNotificationsUtil::getSelectedOption, _1, _2))); return true; } @@ -9524,9 +9527,7 @@ class ListEstateEject : public view_listener_t { bool handleEvent(LLPointer event, const LLSD& userdata) { - LLScrollListCtrl* list = get_focused_list(); - if (!list) return false; - const uuid_vec_t& ids = list->getSelectedIDs(); + const uuid_vec_t& ids = get_focused_list_ids_selected(); LLNotificationsUtil::add("EstateKickUser", create_args(ids, "EVIL_USER"), LLSD(), boost::bind(estate_bulk_eject, ids, false, boost::bind(LLNotificationsUtil::getSelectedOption, _1, _2))); return true; } @@ -9536,9 +9537,7 @@ class ListToggleMute : public view_listener_t { bool handleEvent(LLPointer event, const LLSD& userdata) { - LLScrollListCtrl* list = get_focused_list(); - if (!list) return false; - uuid_vec_t ids = list->getSelectedIDs(); + const uuid_vec_t& ids = get_focused_list_ids_selected(); for (uuid_vec_t::const_iterator it = ids.begin(); it != ids.end(); ++it) LLAvatarActions::toggleBlock(*it); return true; @@ -9857,6 +9856,7 @@ void initialize_menus() addMenu(new ListEnableIsNotFriend(), "List.EnableIsNotFriend"); addMenu(new ListEnableMute(), "List.EnableMute"); addMenu(new ListEnableOfferTeleport(), "List.EnableOfferTeleport"); + addMenu(new ListVisibleWebProfile(), "List.VisibleWebProfile"); addMenu(new ListCopyUUIDs(), "List.CopyUUIDs"); addMenu(new ListInviteToGroup(), "List.InviteToGroup"); addMenu(new ListOfferTeleport(), "List.OfferTeleport"); @@ -9865,17 +9865,20 @@ void initialize_menus() addMenu(new ListRequestFriendship(), "List.RequestFriendship"); addMenu(new ListRequestTeleport(), "List.RequestTeleport"); addMenu(new ListShowProfile(), "List.ShowProfile"); + addMenu(new ListShowWebProfile(), "List.ShowWebProfile"); addMenu(new ListStartAdhocCall(), "List.StartAdhocCall"); addMenu(new ListStartCall(), "List.StartCall"); addMenu(new ListStartConference(), "List.StartConference"); addMenu(new ListStartIM(), "List.StartIM"); - addMenu(new ListAbuseReport(), "List.AbuseReport"); + //addMenu(new ListAbuseReport(), "List.AbuseReport"); addMenu(new ListEject(), "List.ParcelEject"); addMenu(new ListFreeze(), "List.Freeze"); addMenu(new ListEstateBan(), "List.EstateBan"); addMenu(new ListEstateEject(), "List.EstateEject"); addMenu(new ListToggleMute(), "List.ToggleMute"); + add_radar_listeners(); + LLToolMgr::getInstance()->initMenu(sMenus); } diff --git a/indra/newview/llviewermenufile.cpp b/indra/newview/llviewermenufile.cpp index 46cebc7b5..5eb158997 100644 --- a/indra/newview/llviewermenufile.cpp +++ b/indra/newview/llviewermenufile.cpp @@ -541,19 +541,6 @@ class LLFileSavePreview : public view_listener_t } }; -class LLFileSavePreviewPNG : public view_listener_t -{ - bool handleEvent(LLPointer event, const LLSD& userdata) - { - LLFloater* top = gFloaterView->getFrontmost(); - if (top) - { - top->saveAsType(true); - } - return true; - } -}; - class LLFileTakeSnapshot : public view_listener_t { bool handleEvent(LLPointer event, const LLSD& userdata) @@ -1384,7 +1371,6 @@ void init_menu_file() (new LLFileLocalAssetBrowser())->registerListener(gMenuHolder, "File.LocalAssetBrowser"); // (new LLFileSavePreview())->registerListener(gMenuHolder, "File.SavePreview"); - (new LLFileSavePreviewPNG())->registerListener(gMenuHolder, "File.SavePreviewPNG"); (new LLFileTakeSnapshot())->registerListener(gMenuHolder, "File.TakeSnapshot"); (new LLFileTakeSnapshotToDisk())->registerListener(gMenuHolder, "File.TakeSnapshotToDisk"); (new LLFileQuit())->registerListener(gMenuHolder, "File.Quit"); diff --git a/indra/newview/llviewermessage.cpp b/indra/newview/llviewermessage.cpp index 95648baa0..fb0264b56 100644 --- a/indra/newview/llviewermessage.cpp +++ b/indra/newview/llviewermessage.cpp @@ -1391,6 +1391,14 @@ bool LLOfferInfo::inventory_offer_callback(const LLSD& notification, const LLSD& LLChat chat; std::string log_message; S32 button = LLNotificationsUtil::getSelectedOption(notification, response); + if (button == 4) // profile + { + LLAvatarActions::showProfile(mFromID); + LLNotification::Params p(notification["name"]); + p.substitutions(notification["substitutions"]).payload(notification["payload"]).functor(boost::bind(&LLOfferInfo::inventory_offer_callback, this, _1, _2)); + LLNotifications::instance().add(p); //Respawn! + return false; + } LLViewerInventoryCategory* catp = NULL; catp = gInventory.getCategory(mObjectID); @@ -1595,6 +1603,33 @@ bool LLOfferInfo::inventory_offer_callback(const LLSD& notification, const LLSD& } // end switch (mIM) break; + case -2: // decline silently + { + LLStringUtil::format_map_t args; + args["[DESC]"] = mDesc; + args["[NAME]"] = mFromName; + LLFloaterChat::addChatHistory(LLTrans::getString("InvOfferDeclineSilent", args)); + } + break; + case -1: // accept silently + { + LLOpenAgentOffer* open_agent_offer = new LLOpenAgentOffer(mObjectID, from_string); + open_agent_offer->startFetch(); + if(catp || (itemp && itemp->isFinished())) + { + open_agent_offer->done(); + } + else + { + opener = open_agent_offer; + } + LLStringUtil::format_map_t args; + args["[DESC]"] = mDesc; + args["[NAME]"] = mFromName; + LLFloaterChat::addChatHistory(LLTrans::getString("InvOfferAcceptSilent", args)); + } + break; + case IOR_BUSY: //Busy falls through to decline. Says to make busy message. busy=TRUE; @@ -1671,12 +1706,67 @@ bool LLOfferInfo::inventory_offer_callback(const LLSD& notification, const LLSD& return false; } +bool is_spam_filtered(const EInstantMessage& dialog, bool is_friend, bool is_owned_by_me) +{ + // First, check the master filter + static LLCachedControl antispam(gSavedSettings,"_NACL_Antispam"); + if (antispam) return true; + + // Second, check if this dialog type is even being filtered + switch(dialog) + { + case IM_GROUP_NOTICE: + case IM_GROUP_NOTICE_REQUESTED: + if (!gSavedSettings.getBOOL("AntiSpamGroupNotices")) return false; + break; + case IM_GROUP_INVITATION: + if (!gSavedSettings.getBOOL("AntiSpamGroupInvites")) return false; + break; + case IM_INVENTORY_OFFERED: + case IM_TASK_INVENTORY_OFFERED: + if (!gSavedSettings.getBOOL("AntiSpamItemOffers")) return false; + break; + case IM_FROM_TASK_AS_ALERT: + if (!gSavedSettings.getBOOL("AntiSpamAlerts")) return false; + break; + case IM_LURE_USER: + if (!gSavedSettings.getBOOL("AntiSpamTeleports")) return false; + break; + case IM_TELEPORT_REQUEST: + if (!gSavedSettings.getBOOL("AntiSpamTeleportRequests")) return false; + break; + case IM_FRIENDSHIP_OFFERED: + if (!gSavedSettings.getBOOL("AntiSpamFriendshipOffers")) return false; + break; + case IM_COUNT: + // Bit of a hack, we should never get here unless we did this on purpose, though, doesn't matter because we'd do nothing anyway + if (!gSavedSettings.getBOOL("AntiSpamScripts")) return false; + break; + default: + return false; + } + + // Third, possibly filtered, check the filter bypasses + static LLCachedControl antispam_not_mine(gSavedSettings,"AntiSpamNotMine"); + if (antispam_not_mine && is_owned_by_me) + return false; + + static LLCachedControl antispam_not_friend(gSavedSettings,"AntiSpamNotFriend"); + if (antispam_not_friend && is_friend) + return false; + + // Last, definitely filter + return true; +} + void inventory_offer_handler(LLOfferInfo* info) { // NaCl - Antispam Registry - static LLCachedControl antispam(gSavedSettings,"_NACL_Antispam"); - if(antispam || gSavedSettings.getBOOL("AntiSpamItemOffers") || NACLAntiSpamRegistry::checkQueue((U32)NACLAntiSpamRegistry::QUEUE_INVENTORY,info->mFromID)) + if (NACLAntiSpamRegistry::checkQueue((U32)NACLAntiSpamRegistry::QUEUE_INVENTORY,info->mFromID)) + { + delete info; return; + } // NaCl End //If muted, don't even go through the messaging stuff. Just curtail the offer here. if (LLMuteList::getInstance()->isMuted(info->mFromID, info->mFromName)) @@ -1851,6 +1941,11 @@ bool lure_callback(const LLSD& notification, const LLSD& response) gAgent.teleportViaLure(lure_id, godlike); } break; + case 3: + // profile + LLAvatarActions::showProfile(from_id); + LLNotificationsUtil::add(notification["name"], notification["substitutions"], notification["payload"]); //Respawn! + break; case 1: default: // decline @@ -2071,7 +2166,6 @@ void process_improved_im(LLMessageSystem *msg, void **user_data) { return; } - static LLCachedControl antispam(gSavedSettings,"_NACL_Antispam"); LLUUID from_id; BOOL from_group; LLUUID to_id; @@ -2175,11 +2269,15 @@ void process_improved_im(LLMessageSystem *msg, void **user_data) } LLViewerObject *source = gObjectList.findObject(session_id); //Session ID is probably the wrong thing. - if (source) + if (source || (source = gObjectList.findObject(from_id))) { is_owned_by_me = source->permYouOwner(); } + // NaCl - Antispam + if (is_spam_filtered(dialog, is_friend, is_owned_by_me)) return; + // NaCl End + std::string separator_string(": "); int message_offset = 0; @@ -2227,9 +2325,9 @@ void process_improved_im(LLMessageSystem *msg, void **user_data) gIMMgr->processIMTypingStop(im_info); } // [/RLVa:KB] -// else if (offline == IM_ONLINE && !is_linden && is_busy && name != SYSTEM_FROM) +// else if (offline == IM_ONLINE && !is_linden && !is_muted && is_busy && name != SYSTEM_FROM) // [RLVa:KB] - Checked: 2010-11-30 (RLVa-1.3.0c) | Modified: RLVa-1.3.0c - else if ( (offline == IM_ONLINE && !is_linden && is_busy && name != SYSTEM_FROM) && (gRlvHandler.canReceiveIM(from_id)) ) + else if ( (offline == IM_ONLINE && !is_linden && !is_muted && is_busy && name != SYSTEM_FROM) && (gRlvHandler.canReceiveIM(from_id)) ) // [/RLVa:KB] { // return a standard "busy" message, but only do it to online IM @@ -2545,10 +2643,6 @@ void process_improved_im(LLMessageSystem *msg, void **user_data) case IM_GROUP_NOTICE: case IM_GROUP_NOTICE_REQUESTED: { - // NaCl - Antispam - if(antispam || gSavedSettings.getBOOL("AntiSpamGroupNotices")) - return; - // NaCl End LL_INFOS("Messaging") << "Received IM_GROUP_NOTICE message." << LL_ENDL; // Read the binary bucket for more information. struct notice_bucket_header_t @@ -2664,13 +2758,9 @@ void process_improved_im(LLMessageSystem *msg, void **user_data) break; case IM_GROUP_INVITATION: { - // NaCl - Antispam - if (antispam || gSavedSettings.getBOOL("AntiSpamGroupInvites")) - return; - // NaCl End - //if (!is_linden && (is_busy || is_muted)) - if ((is_busy || is_muted)) + if (is_muted) return; + if (is_busy) { LLMessageSystem *msg = gMessageSystem; busy_message(msg,from_id); @@ -2718,10 +2808,6 @@ void process_improved_im(LLMessageSystem *msg, void **user_data) case IM_TASK_INVENTORY_OFFERED: // Someone has offered us some inventory. { - // NaCl - Antispam - if(antispam || gSavedSettings.getBOOL("AntiSpamItemOffers")) - return; - // NaCl End LLOfferInfo* info = new LLOfferInfo; if (IM_INVENTORY_OFFERED == dialog) { @@ -2854,7 +2940,7 @@ void process_improved_im(LLMessageSystem *msg, void **user_data) if ( (gRlvHandler.hasBehaviour(RLV_BHVR_RECVIM)) || (gRlvHandler.hasBehaviour(RLV_BHVR_RECVIMFROM)) ) { - switch (pIMFloater->mSessionType) + switch (pIMFloater->getSessionType()) { case LLFloaterIMPanel::GROUP_SESSION: // Group chat if ( (from_id != gAgent.getID()) && (!gRlvHandler.canReceiveIM(session_id)) ) @@ -2990,10 +3076,6 @@ void process_improved_im(LLMessageSystem *msg, void **user_data) } break; case IM_FROM_TASK_AS_ALERT: - // NaCl - Antispam - if(antispam || (!is_owned_by_me && gSavedSettings.getBOOL("AntiSpamAlerts"))) - return; - // NaCl End if (is_busy && !is_owned_by_me) { return; @@ -3022,7 +3104,6 @@ void process_improved_im(LLMessageSystem *msg, void **user_data) case IM_LURE_USER: case IM_TELEPORT_REQUEST: { - if (antispam || gSavedSettings.getBOOL(dialog == IM_LURE_USER ? "AntiSpamTeleports" : "AntiSpamTeleportRequests")) return; //NaCl Antispam // [RLVa:KB] - Checked: 2010-12-11 (RLVa-1.2.2c) | Added: RLVa-1.2.2c // If the lure sender is a specific @accepttp exception they will override muted and busy status bool fRlvSummon = (rlv_handler_t::isEnabled()) && (gRlvHandler.isException(RLV_BHVR_ACCEPTTP, from_id)); @@ -3268,17 +3349,13 @@ void process_improved_im(LLMessageSystem *msg, void **user_data) case IM_FRIENDSHIP_OFFERED: { - // NaCl - Antispam - if(antispam || gSavedSettings.getBOOL("AntiSpamFriendshipOffers")) - return; - // NaCl End LLSD payload; payload["from_id"] = from_id; payload["session_id"] = session_id;; payload["online"] = (offline == IM_ONLINE); payload["sender"] = msg->getSender().getIPandPort(); - if (is_busy) + if (!is_muted && is_busy) { busy_message(msg, from_id); LLNotifications::instance().forceResponse(LLNotification::Params("OfferFriendship").payload(payload), 1); @@ -3424,8 +3501,7 @@ static LLNotificationFunctorRegistration callingcard_offer_cb_reg("OfferCallingC void process_offer_callingcard(LLMessageSystem* msg, void**) { // NaCl - Antispam - static LLCachedControl antispam(gSavedSettings,"_NACL_Antispam"); - if(antispam || gSavedSettings.getBOOL("AntiSpamFriendshipOffers")) + if (is_spam_filtered(IM_FRIENDSHIP_OFFERED, false, false)) return; // NaCl End // someone has offered to form a friendship @@ -3981,7 +4057,7 @@ void process_chat_from_simulator(LLMessageSystem *msg, void **user_data) LLLocalSpeakerMgr::getInstance()->setSpeakerTyping(from_id, FALSE); static_cast(chatter)->stopTyping(); - if (!is_muted && !is_busy) + if (!is_muted /*&& !is_busy*/) { static const LLCachedControl use_chat_bubbles("UseChatBubbles",false); visible_in_chat_bubble = use_chat_bubbles; @@ -4360,8 +4436,7 @@ void process_teleport_finish(LLMessageSystem* msg, void**) msg->getU64Fast(_PREHASH_Info, _PREHASH_RegionHandle, region_handle); U32 teleport_flags; msg->getU32Fast(_PREHASH_Info, _PREHASH_TeleportFlags, teleport_flags); - - + std::string seedCap; msg->getStringFast(_PREHASH_Info, _PREHASH_SeedCapability, seedCap); @@ -4380,6 +4455,11 @@ void process_teleport_finish(LLMessageSystem* msg, void**) // Viewer trusts the simulator. gMessageSystem->enableCircuit(sim_host, TRUE); +// Aurora Sim + U32 region_size_x = 256; + msg->getU32Fast(_PREHASH_Info, _PREHASH_RegionSizeX, region_size_x); + LLWorld::getInstance()->setRegionWidth(region_size_x); +// Aurora Sim LLViewerRegion* regionp = LLWorld::getInstance()->addRegion(region_handle, sim_host); /* @@ -4514,6 +4594,21 @@ void process_agent_movement_complete(LLMessageSystem* msg, void**) gAgent.getRegion()->getOriginGlobal()); gAgent.setRegion(regionp); gObjectList.shiftObjects(shift_vector); + // Is this a really long jump? + if (shift_vector.length() > 2048.f * 256.f) + { + regionp->reInitPartitions(); + gAgent.setRegion(regionp); + // Kill objects in the regions we left behind + for (LLWorld::region_list_t::const_iterator r = LLWorld::getInstance()->getRegionList().begin(); + r != LLWorld::getInstance()->getRegionList().end(); ++r) + { + if (*r != regionp) + { + gObjectList.killObjects(*r); + } + } + } gAssetStorage->setUpstream(msg->getSender()); gCacheName->setUpstream(msg->getSender()); gViewerThrottle.sendToSim(); @@ -4690,6 +4785,11 @@ void process_crossed_region(LLMessageSystem* msg, void**) send_complete_agent_movement(sim_host); +// Aurora Sim + U32 region_size_x = 256; + msg->getU32(_PREHASH_RegionData, _PREHASH_RegionSizeX, region_size_x); + LLWorld::getInstance()->setRegionWidth(region_size_x); +// Aurora Sim LLViewerRegion* regionp = LLWorld::getInstance()->addRegion(region_handle, sim_host); regionp->setSeedCapability(seedCap); } @@ -6407,6 +6507,15 @@ bool handle_teleport_access_blocked(LLSD& llsdBlock) return returnValue; } +void home_position_set() +{ + // save the home location image to disk + std::string snap_filename = gDirUtilp->getLindenUserDir(); + snap_filename += gDirUtilp->getDirDelimiter(); + snap_filename += SCREEN_HOME_FILENAME; + gViewerWindow->saveSnapshot(snap_filename, gViewerWindow->getWindowWidthRaw(), gViewerWindow->getWindowHeightRaw(), FALSE, FALSE); +} + bool attempt_standard_notification(LLMessageSystem* msgsystem) { // if we have additional alert data @@ -6469,7 +6578,16 @@ bool attempt_standard_notification(LLMessageSystem* msgsystem) return true; } } - + // HACK -- handle callbacks for specific alerts. + if (notificationID == "HomePositionSet") + { + home_position_set(); + } + else if (notificationID == "YouDiedAndGotTPHome") + { + LLViewerStats::getInstance()->incStat(LLViewerStats::ST_KILLED_COUNT); + } + LLNotificationsUtil::add(notificationID, llsdBlock); return true; } @@ -6546,11 +6664,7 @@ void process_alert_core(const std::string& message, BOOL modal) } else if( message == "Home position set." ) { - // save the home location image to disk - std::string snap_filename = gDirUtilp->getLindenUserDir(); - snap_filename += gDirUtilp->getDirDelimiter(); - snap_filename += SCREEN_HOME_FILENAME; - gViewerWindow->saveSnapshot(snap_filename, gViewerWindow->getWindowWidthRaw(), gViewerWindow->getWindowHeightRaw(), FALSE, FALSE); + home_position_set(); } const std::string ALERT_PREFIX("ALERT: "); @@ -6978,11 +7092,6 @@ static LLNotificationFunctorRegistration script_question_cb_reg_2("ScriptQuestio void process_script_question(LLMessageSystem *msg, void **user_data) { - // NaCl - Antispam - static LLCachedControl antispam(gSavedSettings,"_NACL_Antispam"); - if(antispam || gSavedSettings.getBOOL("AntiSpamScripts")) - return; - // NaCl End // *TODO: Translate owner name -> [FIRST] [LAST] LLHost sender = msg->getSender(); @@ -7016,6 +7125,9 @@ void process_script_question(LLMessageSystem *msg, void **user_data) std::string throttle_name = owner_name; std::string self_name; LLAgentUI::buildFullname( self_name ); + // NaCl - Antispam + if (is_spam_filtered(IM_COUNT, false, owner_name == self_name)) return; + // NaCl End if( owner_name == self_name ) { throttle_name = taskid.getString(); @@ -7756,11 +7868,6 @@ static LLNotificationFunctorRegistration callback_script_dialog_reg_2("ScriptDia void process_script_dialog(LLMessageSystem* msg, void**) { - // NaCl - Antispam - static LLCachedControl antispam(gSavedSettings,"_NACL_Antispam"); - if(antispam || gSavedSettings.getBOOL("AntiSpamScripts")) - return; - // NaCl End S32 i; LLSD payload; @@ -7784,6 +7891,10 @@ void process_script_dialog(LLMessageSystem* msg, void**) // NaCl End } + // NaCl - Antispam + if (owner_id.isNull() ? is_spam_filtered(IM_COUNT, LLAvatarActions::isFriend(object_id), object_id == gAgentID) : is_spam_filtered(IM_COUNT, LLAvatarActions::isFriend(owner_id), owner_id == gAgentID)) return; + // NaCl End + if (LLMuteList::getInstance()->isMuted(object_id) || LLMuteList::getInstance()->isMuted(owner_id)) { return; @@ -7932,11 +8043,6 @@ void callback_load_url_name(const LLUUID& id, const std::string& full_name, bool void process_load_url(LLMessageSystem* msg, void**) { - // NaCl - Antispam - static LLCachedControl antispam(gSavedSettings,"_NACL_Antispam"); - if(antispam || gSavedSettings.getBOOL("AntiSpamScripts")) - return; - // NaCl End LLUUID object_id; LLUUID owner_id; BOOL owner_is_group; @@ -7948,6 +8054,10 @@ void process_load_url(LLMessageSystem* msg, void**) msg->getUUID( "Data", "ObjectID", object_id); msg->getUUID( "Data", "OwnerID", owner_id); + // NaCl - Antispam + if (owner_id.isNull() ? is_spam_filtered(IM_COUNT, LLAvatarActions::isFriend(object_id), object_id == gAgentID) : is_spam_filtered(IM_COUNT, LLAvatarActions::isFriend(owner_id), owner_id == gAgentID)) return; + // NaCl End + // NaCl - Antispam Registry if((owner_id.isNull() && NACLAntiSpamRegistry::checkQueue((U32)NACLAntiSpamRegistry::QUEUE_SCRIPT_DIALOG,object_id)) @@ -8027,12 +8137,11 @@ void process_initiate_download(LLMessageSystem* msg, void**) void process_script_teleport_request(LLMessageSystem* msg, void**) { - // NaCl - Antispam - static LLCachedControl antispam(gSavedSettings,"_NACL_Antispam"); - if(antispam || gSavedSettings.getBOOL("AntiSpamScripts")) - return; - // NaCl End if (!gSavedSettings.getBOOL("ScriptsCanShowUI")) return; + + // NaCl - Antispam + if (is_spam_filtered(IM_COUNT, false, false)) return; + // NaCl End std::string object_name; std::string sim_name; diff --git a/indra/newview/llviewerobject.cpp b/indra/newview/llviewerobject.cpp index ab7881a12..dcc8178dd 100644 --- a/indra/newview/llviewerobject.cpp +++ b/indra/newview/llviewerobject.cpp @@ -962,7 +962,10 @@ U32 LLViewerObject::processUpdateMessage(LLMessageSystem *mesgsys, U16 valswizzle[4]; #endif U16 *val; - const F32 size = LLWorld::getInstance()->getRegionWidthInMeters(); +// Aurora Sim + //const F32 size = LLWorld::getInstance()->getRegionWidthInMeters(); + const F32 size = mRegionp->getWidth(); +// Aurora Sim const F32 MAX_HEIGHT = LLWorld::getInstance()->getRegionMaxHeight(); const F32 MIN_HEIGHT = LLWorld::getInstance()->getRegionMinHeight(); S32 length; diff --git a/indra/newview/llviewerobjectbackup.cpp b/indra/newview/llviewerobjectbackup.cpp index 795426a2d..98f08007e 100644 --- a/indra/newview/llviewerobjectbackup.cpp +++ b/indra/newview/llviewerobjectbackup.cpp @@ -399,7 +399,7 @@ void LLObjectBackup::exportObject_continued(AIFilePicker* filepicker) bool LLObjectBackup::validatePerms(const LLPermissions *item_permissions) { - return item_permissions->allowExportBy(gAgent.getID(), LFSimFeatureHandler::instance().simSupportsExport()); + return item_permissions->allowExportBy(gAgent.getID(), LFSimFeatureHandler::instance().exportPolicy()); } // So far, only Second Life forces TPVs to verify the creator for textures... diff --git a/indra/newview/llviewerobjectlist.cpp b/indra/newview/llviewerobjectlist.cpp index dfe5db84b..4ae625a52 100644 --- a/indra/newview/llviewerobjectlist.cpp +++ b/indra/newview/llviewerobjectlist.cpp @@ -1714,8 +1714,8 @@ void LLViewerObjectList::renderObjectsForMap(LLNetMap &netmap) F32 max_radius = gSavedSettings.getF32("MiniMapPrimMaxRadius"); - static const F32 MAX_ALTITUDE_ABOVE_SELF = 256.f; - F32 max_altitude = gAgent.getPositionGlobal()[VZ] + MAX_ALTITUDE_ABOVE_SELF; + const F32 agent_altitude(gAgent.getPositionGlobal()[VZ]); + static const LLCachedControl delta("MiniMapPrimMaxAltitudeDelta"); for (vobj_list_t::iterator iter = mMapObjects.begin(); iter != mMapObjects.end(); ++iter) { @@ -1743,6 +1743,10 @@ void LLViewerObjectList::renderObjectsForMap(LLNetMap &netmap) LLColor4U color = above_water_color; if( objectp->permYouOwner() ) { + static const LLCachedControl delta("MiniMapPrimMaxAltitudeDeltaOwn"); + if (delta && static_cast(std::fabs(agent_altitude - pos[VZ])) > delta) + continue; + const F32 MIN_RADIUS_FOR_OWNED_OBJECTS = 2.f; if( approx_radius < MIN_RADIUS_FOR_OWNED_OBJECTS ) { @@ -1772,7 +1776,7 @@ void LLViewerObjectList::renderObjectsForMap(LLNetMap &netmap) } } } - else if ( pos[VZ] > max_altitude ) + else if (delta && static_cast(std::fabs(agent_altitude - pos[VZ])) > delta) { continue; } diff --git a/indra/newview/llviewerparcelmedia.cpp b/indra/newview/llviewerparcelmedia.cpp index 0e8e97f3a..dc62522cf 100644 --- a/indra/newview/llviewerparcelmedia.cpp +++ b/indra/newview/llviewerparcelmedia.cpp @@ -1071,7 +1071,11 @@ std::string LLViewerParcelMedia::extractDomain(std::string url) url = url.substr(pos + 1, count); } - if (url.find(gAgent.getRegion()->getHost().getHostName()) == 0 || url.find(last_region) == 0) + //Singu note: The call to getHostName() freezes the viewer for a few seconds if the region has no reverse DNS... + // Avoid calling it three times therefore -- not to mention that if it fails, it returns an empty string which + // does NOT mean that it should match the current url as if the current url contains the current regions hostname! + std::string const hostname = gAgent.getRegion()->getHost().getHostName(); + if ((!hostname.empty() && url.find(hostname) == 0) || url.find(last_region) == 0) { // This must be a scripted object rezzed in the region: // extend the concept of "domain" to encompass the @@ -1080,7 +1084,7 @@ std::string LLViewerParcelMedia::extractDomain(std::string url) // Get rid of any port number pos = url.find('/'); // We earlier made sure that there's one - url = gAgent.getRegion()->getHost().getHostName() + url.substr(pos); + url = hostname + url.substr(pos); pos = url.find('?'); if (pos != std::string::npos) @@ -1111,10 +1115,12 @@ std::string LLViewerParcelMedia::extractDomain(std::string url) } } - // Remember this region, so to cope with requests occuring just after a // TP out of it. - last_region = gAgent.getRegion()->getHost().getHostName(); + if (!hostname.empty()) // Singu note: also make sure that last_region doesn't become empty. + { + last_region = hostname; + } return url; } diff --git a/indra/newview/llviewerparcelmgr.cpp b/indra/newview/llviewerparcelmgr.cpp index 5b7c7f274..57037a871 100644 --- a/indra/newview/llviewerparcelmgr.cpp +++ b/indra/newview/llviewerparcelmgr.cpp @@ -145,7 +145,10 @@ LLViewerParcelMgr::LLViewerParcelMgr() mHoverParcel = new LLParcel(); mCollisionParcel = new LLParcel(); - mParcelsPerEdge = S32( REGION_WIDTH_METERS / PARCEL_GRID_STEP_METERS ); +// Aurora Sim + mParcelsPerEdge = S32(8192.f / PARCEL_GRID_STEP_METERS); // 8192 is the maximum region size on Aurora and solves the audio problem. + //mParcelsPerEdge = S32( REGION_WIDTH_METERS / PARCEL_GRID_STEP_METERS ); +// Aurora Sim mHighlightSegments = new U8[(mParcelsPerEdge+1)*(mParcelsPerEdge+1)]; resetSegments(mHighlightSegments); @@ -168,9 +171,19 @@ LLViewerParcelMgr::LLViewerParcelMgr() mAgentParcelOverlay[i] = 0; } +// Aurora Sim + mParcelsPerEdge = S32(REGION_WIDTH_METERS / PARCEL_GRID_STEP_METERS); +// Aurora Sim + mTeleportInProgress = TRUE; // the initial parcel update is treated like teleport } +// Aurora Sim +void LLViewerParcelMgr::init(F32 region_size) +{ + mParcelsPerEdge = S32(region_size / PARCEL_GRID_STEP_METERS); +} +// Aurora Sim LLViewerParcelMgr::~LLViewerParcelMgr() { @@ -450,9 +463,14 @@ LLParcelSelectionHandle LLViewerParcelMgr::selectParcelInRectangle() void LLViewerParcelMgr::selectCollisionParcel() { // BUG: Claim to be in the agent's region - mWestSouth = gAgent.getRegion()->getOriginGlobal(); +// Aurora Sim + //mWestSouth = gAgent.getRegion()->getOriginGlobal(); + //mEastNorth = mWestSouth; + //mEastNorth += LLVector3d(PARCEL_GRID_STEP_METERS, PARCEL_GRID_STEP_METERS, 0.0); + mWestSouth = getSelectionRegion()->getOriginGlobal(); mEastNorth = mWestSouth; - mEastNorth += LLVector3d(PARCEL_GRID_STEP_METERS, PARCEL_GRID_STEP_METERS, 0.0); + mEastNorth += LLVector3d(getSelectionRegion()->getWidth()/REGION_WIDTH_METERS * PARCEL_GRID_STEP_METERS, getSelectionRegion()->getWidth()/REGION_WIDTH_METERS * PARCEL_GRID_STEP_METERS, 0.0); +// Aurora Sim // BUG: must be in the sim you are in LLMessageSystem *msg = gMessageSystem; @@ -1410,8 +1428,11 @@ void LLViewerParcelMgr::processParcelOverlay(LLMessageSystem *msg, void **user) return; } - S32 parcels_per_edge = LLViewerParcelMgr::getInstance()->mParcelsPerEdge; - S32 expected_size = parcels_per_edge * parcels_per_edge / PARCEL_OVERLAY_CHUNKS; +// Aurora Sim + //S32 parcels_per_edge = LLViewerParcelMgr::getInstance()->mParcelsPerEdge; + //S32 expected_size = parcels_per_edge * parcels_per_edge / PARCEL_OVERLAY_CHUNKS; + S32 expected_size = 1024; +// Aurora Sim if (packed_overlay_size != expected_size) { llwarns << "Got parcel overlay size " << packed_overlay_size @@ -1474,6 +1495,13 @@ void LLViewerParcelMgr::processParcelProperties(LLMessageSystem *msg, void **use S32 other_clean_time = 0; LLViewerParcelMgr& parcel_mgr = LLViewerParcelMgr::instance(); +// Aurora Sim + LLViewerRegion* msg_region = LLWorld::getInstance()->getRegion(msg->getSender()); + if(msg_region) + parcel_mgr.mParcelsPerEdge = S32(msg_region->getWidth() / PARCEL_GRID_STEP_METERS); + else + parcel_mgr.mParcelsPerEdge = S32(gAgent.getRegion()->getWidth() / PARCEL_GRID_STEP_METERS); +// Aurora Sim msg->getS32Fast(_PREHASH_ParcelData, _PREHASH_RequestResult, request_result ); msg->getS32Fast(_PREHASH_ParcelData, _PREHASH_SequenceID, sequence_id ); diff --git a/indra/newview/llviewerparcelmgr.h b/indra/newview/llviewerparcelmgr.h index 5ae44e2d0..022465a97 100644 --- a/indra/newview/llviewerparcelmgr.h +++ b/indra/newview/llviewerparcelmgr.h @@ -89,6 +89,9 @@ public: LLViewerParcelMgr(); ~LLViewerParcelMgr(); +// Aurora Sim + void init(F32 region_size); +// Aurora Sim static void cleanupGlobals(); BOOL selectionEmpty() const; diff --git a/indra/newview/llviewerparceloverlay.cpp b/indra/newview/llviewerparceloverlay.cpp index 42bf3100c..6eb83a9f7 100644 --- a/indra/newview/llviewerparceloverlay.cpp +++ b/indra/newview/llviewerparceloverlay.cpp @@ -59,6 +59,9 @@ const U8 OVERLAY_IMG_COMPONENTS = 4; LLViewerParcelOverlay::LLViewerParcelOverlay(LLViewerRegion* region, F32 region_width_meters) : mRegion( region ), mParcelGridsPerEdge( S32( region_width_meters / PARCEL_GRID_STEP_METERS ) ), +// Aurora Sim + mRegionSize(S32(region_width_meters)), +// Aurora Sim mDirty( FALSE ), mTimeSinceLastUpdate(), mOverlayTextureIdx(-1), @@ -413,7 +416,12 @@ void LLViewerParcelOverlay::uncompressLandOverlay(S32 chunk, U8 *packed_overlay) { // Unpack the message data into the ownership array S32 size = mParcelGridsPerEdge * mParcelGridsPerEdge; - S32 chunk_size = size / PARCEL_OVERLAY_CHUNKS; + +// Aurora Sim + //S32 chunk_size = size / PARCEL_OVERLAY_CHUNKS; + S32 mParcelOverLayChunks = mRegionSize * mRegionSize / (128 * 128); + S32 chunk_size = size / mParcelOverLayChunks; +// Aurora Sim memcpy(mOwnership + chunk*chunk_size, packed_overlay, chunk_size); /*Flawfinder: ignore*/ diff --git a/indra/newview/llviewerparceloverlay.h b/indra/newview/llviewerparceloverlay.h index 794a485e6..d53a4c15f 100644 --- a/indra/newview/llviewerparceloverlay.h +++ b/indra/newview/llviewerparceloverlay.h @@ -109,6 +109,9 @@ private: LLViewerRegion* mRegion; S32 mParcelGridsPerEdge; +// Aurora Sim + S32 mRegionSize; +// Aurora Sim LLPointer mTexture; LLPointer mImageRaw; diff --git a/indra/newview/llviewerregion.cpp b/indra/newview/llviewerregion.cpp index 9571837c7..9402996b4 100644 --- a/indra/newview/llviewerregion.cpp +++ b/indra/newview/llviewerregion.cpp @@ -66,6 +66,7 @@ #include "lltrans.h" #include "llurldispatcher.h" #include "llviewerobjectlist.h" +#include "llviewerparcelmgr.h" #include "llviewerparceloverlay.h" #include "llviewerstatsrecorder.h" #include "llvlmanager.h" @@ -78,6 +79,7 @@ #include "llviewercontrol.h" #include "llsdserialize.h" +#include "llviewerparcelmgr.h" //Aurora Sim #ifdef LL_WINDOWS #pragma warning(disable:4355) #endif @@ -309,9 +311,12 @@ LLViewerRegion::LLViewerRegion(const U64 &handle, mReleaseNotesRequested(FALSE), mCapabilitiesReceived(false), mFeaturesReceived(false), - mGamingFlags(0) + mGamingFlags(0), +// Aurora Sim + mWidth(region_width_meters) { - mWidth = region_width_meters; + // Moved this up... -> mWidth = region_width_meters; +// mImpl->mOriginGlobal = from_region_handle(handle); updateRenderMatrix(); @@ -321,7 +326,10 @@ LLViewerRegion::LLViewerRegion(const U64 &handle, mImpl->mCompositionp = new LLVLComposition(mImpl->mLandp, grids_per_region_edge, - region_width_meters / grids_per_region_edge); +// Aurora Sim + //region_width_meters / grids_per_region_edge); + mWidth / grids_per_region_edge); +// Aurora Sim mImpl->mCompositionp->setSurface(mImpl->mLandp); // Create the surfaces @@ -331,14 +339,22 @@ LLViewerRegion::LLViewerRegion(const U64 &handle, mImpl->mOriginGlobal, mWidth); - mParcelOverlay = new LLViewerParcelOverlay(this, region_width_meters); +// Aurora Sim + //mParcelOverlay = new LLViewerParcelOverlay(this, region_width_meters); + mParcelOverlay = new LLViewerParcelOverlay(this, mWidth); + LLViewerParcelMgr::getInstance()->init(mWidth); +// Aurora Sim setOriginGlobal(from_region_handle(handle)); calculateCenterGlobal(); // Create the object lists initStats(); + initPartitions(); +} +void LLViewerRegion::initPartitions() +{ //create object partitions //MUST MATCH declaration of eObjectPartitions mImpl->mObjectPartition.push_back(new LLHUDPartition()); //PARTITION_HUD @@ -357,6 +373,12 @@ LLViewerRegion::LLViewerRegion(const U64 &handle, mImpl->mObjectPartition.push_back(NULL); //PARTITION_NONE } +void LLViewerRegion::reInitPartitions() +{ + std::for_each(mImpl->mObjectPartition.begin(), mImpl->mObjectPartition.end(), DeletePointer()); + mImpl->mObjectPartition.clear(); + initPartitions(); +} void LLViewerRegion::initStats() { @@ -828,11 +850,13 @@ LLVLComposition * LLViewerRegion::getComposition() const F32 LLViewerRegion::getCompositionXY(const S32 x, const S32 y) const { - if (x >= 256) +// Singu Note: The Aurora Sim patches here were too many to read the code itself, mWidth and getWidth() (-1) replace 256 (255) in this function, only the first and last tags remain +// Aurora Sim + if (x >= mWidth) { - if (y >= 256) + if (y >= mWidth) { - LLVector3d center = getCenterGlobal() + LLVector3d(256.f, 256.f, 0.f); + LLVector3d center = getCenterGlobal() + LLVector3d(mWidth, mWidth, 0.f); LLViewerRegion *regionp = LLWorld::getInstance()->getRegionFromPosGlobal(center); if (regionp) { @@ -841,8 +865,8 @@ F32 LLViewerRegion::getCompositionXY(const S32 x, const S32 y) const // If we're attempting to blend, then we want to make the fractional part of // this region match the fractional of the adjacent. For now, just minimize // the delta. - F32 our_comp = getComposition()->getValueScaled(255, 255); - F32 adj_comp = regionp->getComposition()->getValueScaled(x - 256.f, y - 256.f); + F32 our_comp = getComposition()->getValueScaled(mWidth-1.f, mWidth-1.f); + F32 adj_comp = regionp->getComposition()->getValueScaled(x - regionp->getWidth(), y - regionp->getWidth()); while (llabs(our_comp - adj_comp) >= 1.f) { if (our_comp > adj_comp) @@ -859,7 +883,7 @@ F32 LLViewerRegion::getCompositionXY(const S32 x, const S32 y) const } else { - LLVector3d center = getCenterGlobal() + LLVector3d(256.f, 0, 0.f); + LLVector3d center = getCenterGlobal() + LLVector3d(mWidth, 0.f, 0.f); LLViewerRegion *regionp = LLWorld::getInstance()->getRegionFromPosGlobal(center); if (regionp) { @@ -868,8 +892,8 @@ F32 LLViewerRegion::getCompositionXY(const S32 x, const S32 y) const // If we're attempting to blend, then we want to make the fractional part of // this region match the fractional of the adjacent. For now, just minimize // the delta. - F32 our_comp = getComposition()->getValueScaled(255.f, (F32)y); - F32 adj_comp = regionp->getComposition()->getValueScaled(x - 256.f, (F32)y); + F32 our_comp = getComposition()->getValueScaled(mWidth-1.f, (F32)y); + F32 adj_comp = regionp->getComposition()->getValueScaled(x - regionp->getWidth(), (F32)y); while (llabs(our_comp - adj_comp) >= 1.f) { if (our_comp > adj_comp) @@ -885,9 +909,9 @@ F32 LLViewerRegion::getCompositionXY(const S32 x, const S32 y) const } } } - else if (y >= 256) + else if (y >= mWidth) { - LLVector3d center = getCenterGlobal() + LLVector3d(0.f, 256.f, 0.f); + LLVector3d center = getCenterGlobal() + LLVector3d(0.f, mWidth, 0.f); LLViewerRegion *regionp = LLWorld::getInstance()->getRegionFromPosGlobal(center); if (regionp) { @@ -896,8 +920,9 @@ F32 LLViewerRegion::getCompositionXY(const S32 x, const S32 y) const // If we're attempting to blend, then we want to make the fractional part of // this region match the fractional of the adjacent. For now, just minimize // the delta. - F32 our_comp = getComposition()->getValueScaled((F32)x, 255.f); - F32 adj_comp = regionp->getComposition()->getValueScaled((F32)x, y - 256.f); + F32 our_comp = getComposition()->getValueScaled((F32)x, mWidth-1.f); + F32 adj_comp = regionp->getComposition()->getValueScaled((F32)x, y - regionp->getWidth()); +// Aurora Sim while (llabs(our_comp - adj_comp) >= 1.f) { if (our_comp > adj_comp) @@ -1650,6 +1675,7 @@ void LLViewerRegionImpl::buildCapabilityNames(LLSD& capabilityNames) capabilityNames.append("GamingData"); //Used by certain grids. capabilityNames.append("GetDisplayNames"); capabilityNames.append("GetMesh"); + capabilityNames.append("GetMesh2"); // Used on SecondLife(tm) sim versions 280647 and higher (13.09.17). capabilityNames.append("GetObjectCost"); capabilityNames.append("GetObjectPhysicsData"); capabilityNames.append("GetTexture"); @@ -2047,7 +2073,7 @@ bool LLViewerRegion::meshRezEnabled() const { if (getCapability("SimulatorFeatures").empty()) { - return !getCapability("GetMesh").empty(); + return !getCapability("GetMesh").empty() || !getCapability("GetMesh2").empty(); } else { diff --git a/indra/newview/llviewerregion.h b/indra/newview/llviewerregion.h index e22fc3907..6b0e73b49 100644 --- a/indra/newview/llviewerregion.h +++ b/indra/newview/llviewerregion.h @@ -369,10 +369,12 @@ public: }; void showReleaseNotes(); + void reInitPartitions(); protected: void disconnectAllNeighbors(); void initStats(); + void initPartitions(); public: LLWind mWind; diff --git a/indra/newview/llviewerwindow.cpp b/indra/newview/llviewerwindow.cpp index 0db6685ee..894b01b79 100644 --- a/indra/newview/llviewerwindow.cpp +++ b/indra/newview/llviewerwindow.cpp @@ -309,6 +309,13 @@ public: U32 ypos = 64; const U32 y_inc = 20; + static const LLCachedControl slb_show_fps("SLBShowFPS"); + if (slb_show_fps) + { + addText(xpos+280, ypos+5, llformat("FPS %3.1f", LLViewerStats::getInstance()->mFPSStat.getMeanPerSec())); + ypos += y_inc; + } + static const LLCachedControl debug_show_time("DebugShowTime"); if (debug_show_time) { @@ -4112,6 +4119,11 @@ LLViewerObject* LLViewerWindow::cursorIntersect(S32 mouse_x, S32 mouse_y, F32 de found = gPipeline.lineSegmentIntersectInWorld(mw_start, mw_end, pick_transparent, face_hit, intersection, uv, normal, tangent); + if (found && !pick_transparent) + { + gDebugRaycastIntersection = *intersection; + } + // [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)) ) @@ -4470,7 +4482,7 @@ void LLViewerWindow::movieSize(S32 new_width, S32 new_height) LLCoordScreen new_size(new_width + BORDERWIDTH, new_height + BORDERHEIGHT); BOOL disable_sync = gSavedSettings.getBOOL("DisableVerticalSync"); - if (gViewerWindow->mWindow->getFullscreen()) + if (gViewerWindow->getWindow()->getFullscreen()) { LLGLState::checkStates(); LLGLState::checkTextureChannels(); diff --git a/indra/newview/llviewerwindow.h b/indra/newview/llviewerwindow.h index 801f1e61f..7ec0f3ec3 100644 --- a/indra/newview/llviewerwindow.h +++ b/indra/newview/llviewerwindow.h @@ -235,7 +235,7 @@ public: S32 getCurrentMouseDX() const { return mCurrentMouseDelta.mX; } S32 getCurrentMouseDY() const { return mCurrentMouseDelta.mY; } LLCoordGL getCurrentMouseDelta() const { return mCurrentMouseDelta; } - LLStat * getMouseVelocityStat() { return &mMouseVelocityStat; } + LLStat* getMouseVelocityStat() { return &mMouseVelocityStat; } BOOL getLeftMouseDown() const { return mLeftMouseDown; } BOOL getMiddleMouseDown() const { return mMiddleMouseDown; } BOOL getRightMouseDown() const { return mRightMouseDown; } @@ -407,12 +407,12 @@ private: LLRect getChatConsoleRect(); // Get optimal cosole rect. public: - LLWindow* mWindow; // graphical window object void unblockToolTips(){mToolTipBlocked = FALSE;} //hack until LLToolTipMgr is ported. protected: - BOOL mActive; + LLWindow* mWindow; // graphical window object + bool mActive; BOOL mWantFullscreen; BOOL mShowFullscreenProgress; LLRect mWindowRectRaw; diff --git a/indra/newview/llvlcomposition.cpp b/indra/newview/llvlcomposition.cpp index 8954a2da2..94ae918be 100644 --- a/indra/newview/llvlcomposition.cpp +++ b/indra/newview/llvlcomposition.cpp @@ -164,7 +164,10 @@ BOOL LLVLComposition::generateHeights(const F32 x, const F32 y, const F32 xyScaleInv = (1.f / xyScale); const F32 zScaleInv = (1.f / zScale); - const F32 inv_width = 1.f/mWidth; +// Aurora Sim + //const F32 inv_width = 1.f/mWidth; + const F32 inv_width = 1.f/(F32)mWidth; +// Aurora Sim // OK, for now, just have the composition value equal the height at the point. for (S32 j = y_begin; j < y_end; j++) diff --git a/indra/newview/llvlmanager.cpp b/indra/newview/llvlmanager.cpp index 88afc9cc3..43b42f0ec 100644 --- a/indra/newview/llvlmanager.cpp +++ b/indra/newview/llvlmanager.cpp @@ -44,11 +44,6 @@ LLVLManager gVLManager; -// Extended land layer for Aurora Sim -const char AURORA_LAND_LAYER_CODE = 'M'; -const char AURORA_WIND_LAYER_CODE = '9'; -const char AURORA_CLOUD_LAYER_CODE = ':'; - LLVLManager::~LLVLManager() { S32 i; @@ -61,18 +56,33 @@ LLVLManager::~LLVLManager() void LLVLManager::addLayerData(LLVLData *vl_datap, const S32 mesg_size) { +// Aurora Sim + //if (LAND_LAYER_CODE == vl_datap->mType) if (LAND_LAYER_CODE == vl_datap->mType || AURORA_LAND_LAYER_CODE == vl_datap->mType) +// Aurora Sim { mLandBits += mesg_size * 8; } +// Aurora Sim + //else if (WIND_LAYER_CODE == vl_datap->mType) else if (WIND_LAYER_CODE == vl_datap->mType || AURORA_WIND_LAYER_CODE == vl_datap->mType) +// Aurora Sim { mWindBits += mesg_size * 8; } +// Aurora Sim + //else if (CLOUD_LAYER_CODE == vl_datap->mType) else if (CLOUD_LAYER_CODE == vl_datap->mType || AURORA_CLOUD_LAYER_CODE == vl_datap->mType) +// Aurora Sim { mCloudBits += mesg_size * 8; } +// Aurora Sim + else if (WATER_LAYER_CODE == vl_datap->mType || AURORA_CLOUD_LAYER_CODE == vl_datap->mType) + { + mWaterBits += mesg_size * 8; + } +// Aurora Sim else { llerrs << "Unknown layer type!" << (S32)vl_datap->mType << llendl; @@ -98,11 +108,14 @@ void LLVLManager::unpackData(const S32 num_packets) { datap->mRegionp->getLand().decompressDCTPatch(bit_pack, &goph, FALSE); } +// Aurora Sim else if (AURORA_LAND_LAYER_CODE == datap->mType) { datap->mRegionp->getLand().decompressDCTPatch(bit_pack, &goph, TRUE); } + //else if (WIND_LAYER_CODE == datap->mType) else if (WIND_LAYER_CODE == datap->mType || AURORA_WIND_LAYER_CODE == datap->mType) +// Aurora Sim { datap->mRegionp->mWind.decompress(bit_pack, &goph); diff --git a/indra/newview/llvlmanager.h b/indra/newview/llvlmanager.h index 9d64d6f24..6bf495e62 100644 --- a/indra/newview/llvlmanager.h +++ b/indra/newview/llvlmanager.h @@ -65,6 +65,9 @@ protected: U32 mLandBits; U32 mWindBits; U32 mCloudBits; +// Aurora Sim + U32 mWaterBits; +// Aurora Sim }; class LLVLData diff --git a/indra/newview/llvoavatar.cpp b/indra/newview/llvoavatar.cpp index 3076f4dc4..c587a8ccb 100644 --- a/indra/newview/llvoavatar.cpp +++ b/indra/newview/llvoavatar.cpp @@ -564,6 +564,7 @@ SHClientTagMgr::SHClientTagMgr() gSavedSettings.getControl("AscentEstateOwnerColor")->getSignal()->connect(boost::bind(&LLVOAvatar::invalidateNameTags)); gSavedSettings.getControl("AscentFriendColor")->getSignal()->connect(boost::bind(&LLVOAvatar::invalidateNameTags)); gSavedSettings.getControl("AscentMutedColor")->getSignal()->connect(boost::bind(&LLVOAvatar::invalidateNameTags)); + gSavedSettings.getControl("SLBDisplayClientTagOnNewLine")->getSignal()->connect(boost::bind(&LLVOAvatar::invalidateNameTags)); //Following group of settings all actually manipulate the tag cache for agent avatar. Even if the tag system is 'disabled', we still allow an //entry to exist for the agent avatar. @@ -2532,7 +2533,7 @@ void LLVOAvatar::idleUpdateMisc(bool detailed_update) !(attached_object->mDrawable->getSpatialBridge() && attached_object->mDrawable->getSpatialBridge()->getRadius() < 2.0)); - if (visibleAttachment && attached_object && !attached_object->isDead() && attachment->getValid()) + if (visibleAttachment && attached_object && attached_object->mDrawable && !attached_object->isDead() && attachment->getValid()) { // if selecting any attachments, update all of them as non-damped if (LLSelectMgr::getInstance()->getSelection()->getObjectCount() && LLSelectMgr::getInstance()->getSelection()->isAttachment()) @@ -3062,6 +3063,7 @@ void LLVOAvatar::idleUpdateNameTagText(BOOL new_name) LLNameValue *title = getNVPair("Title"); LLNameValue* firstname = getNVPair("FirstName"); LLNameValue* lastname = getNVPair("LastName"); + static const LLCachedControl display_client_new_line("SLBDisplayClientTagOnNewLine"); // Avatars must have a first and last name if (!firstname || !lastname) return; @@ -3284,7 +3286,12 @@ void LLVOAvatar::idleUpdateNameTagText(BOOL new_name) else if(allow_nameplate_override && !mCCSAttachmentText.empty()) tag_format=mCCSAttachmentText; else - tag_format=sRenderGroupTitles ? "%g\n%f %l %t" : "%f %l %t"; + { + if(!display_client_new_line) + tag_format=sRenderGroupTitles ? "%g\n%f %l %t" : "%f %l %t"; + else + tag_format=sRenderGroupTitles ? "%g\n%f %l\n%t" : "%f %l\n%t"; + } // replace first name, last name and title typedef boost::tokenizer > tokenizer; @@ -3770,6 +3777,23 @@ BOOL LLVOAvatar::updateCharacter(LLAgent &agent) else if (!getParent() && mIsSitting && !isMotionActive(ANIM_AGENT_SIT_GROUND_CONSTRAINED)) { getOffObject(); + // + //Singu note: this appears to be a safety catch: + // when getParent() is NULL and we're note playing ANIM_AGENT_SIT_GROUND_CONSTRAINED then we aren't sitting! + // The previous call existed in an attempt to fix this inconsistent state by standing up from an object. + // However, since getParent() is NULL that function would crash! + // Since we never got crash reports regarding to this, that apparently never happened, except, I discovered + // today, when you are ground sitting and then LLMotionController::deleteAllMotions or + // LLMotionController::deactivateAllMotions is called, which seems to only happen when previewing an + // to-be-uploaded animation on your own avatar (while ground sitting). + // Hence, we DO need this safety net but not for standing up from an object but for standing up from the ground. + // I fixed the crash in getOffObject(), so it's ok to call that. In order to make things consistent with + // the server we need to actually stand up though, or we can't move anymore afterwards. + if (isSelf()) + { + gAgent.setControlFlags(AGENT_CONTROL_STAND_UP); + } + // } //-------------------------------------------------------------------- @@ -6193,6 +6217,17 @@ void LLVOAvatar::removeChild(LLViewerObject *childp) } } +namespace +{ + boost::signals2::connection sDetachBridgeConnection; + void detach_bridge(const LLViewerObject* obj, const LLViewerObject* bridge) + { + if (obj != bridge) return; + sDetachBridgeConnection.disconnect(); + LLVOAvatarSelf::detachAttachmentIntoInventory(obj->getAttachmentItemID()); + } +} + LLViewerJointAttachment* LLVOAvatar::getTargetAttachmentPoint(LLViewerObject* viewer_object) { S32 attachmentID = ATTACHMENT_ID_FROM_STATE(viewer_object->getState()); @@ -6213,8 +6248,7 @@ LLViewerJointAttachment* LLVOAvatar::getTargetAttachmentPoint(LLViewerObject* vi if (isSelf() && attachmentID == 127 && gSavedSettings.getBOOL("SGDetachBridge")) { llinfos << "Bridge detected! detaching" << llendl; - LLVOAvatarSelf::detachAttachmentIntoInventory(viewer_object->getAttachmentItemID()); - return 0; + sDetachBridgeConnection = gAgentAvatarp->setAttachmentCallback(boost::bind(detach_bridge, _1, viewer_object)); } // attachment = get_if_there(mAttachmentPoints, 1, (LLViewerJointAttachment*)NULL); // Arbitrary using 1 (chest) // [SL:KB] - Patch: Appearance-LegacyMultiAttachment | Checked: 2010-08-28 (Catznip-2.2.0a) | Added: Catznip2.1.2a @@ -6556,7 +6590,7 @@ void LLVOAvatar::getOffObject() gAgentCamera.setSitCamera(LLUUID::null); - if (!sit_object->permYouOwner() && gSavedSettings.getBOOL("RevokePermsOnStandUp")) + if (sit_object && !sit_object->permYouOwner() && gSavedSettings.getBOOL("RevokePermsOnStandUp")) { gMessageSystem->newMessageFast(_PREHASH_RevokePermissions); gMessageSystem->nextBlockFast(_PREHASH_AgentData); diff --git a/indra/newview/llvoicechannel.cpp b/indra/newview/llvoicechannel.cpp index 1e4c68b79..2fd7bb572 100644 --- a/indra/newview/llvoicechannel.cpp +++ b/indra/newview/llvoicechannel.cpp @@ -685,6 +685,13 @@ void LLVoiceChannelProximal::activate() // we're connected to a non-spatial channel, so disconnect. LLVoiceClient::getInstance()->leaveNonSpatialChannel(); } + + // Singu Note: Mic default state is OFF for local voice + if (LLVoiceClient::getInstance()->getUserPTTState() && LLVoiceClient::getInstance()->getPTTIsToggle() && gSavedSettings.getBOOL("AutoDisengageMic")) + { + LLVoiceClient::getInstance()->inputUserControlState(true); + } + LLVoiceChannel::activate(); } diff --git a/indra/newview/llvoicevivox.cpp b/indra/newview/llvoicevivox.cpp index e0cf09e26..edfecf681 100644 --- a/indra/newview/llvoicevivox.cpp +++ b/indra/newview/llvoicevivox.cpp @@ -2564,41 +2564,44 @@ void LLVivoxVoiceClient::sendPositionalUpdate(void) stream << ""; - LLVector3d earPosition; - LLVector3 earVelocity; - LLMatrix3 earRot; - - switch(mEarLocation) + if (mEarLocation != earLocSpeaker) { - case earLocCamera: - default: - earPosition = mCameraPosition; - earVelocity = mCameraVelocity; - earRot = mCameraRot; - break; + LLVector3d earPosition; + LLVector3 earVelocity; + LLMatrix3 earRot; - case earLocAvatar: - earPosition = mAvatarPosition; - earVelocity = mAvatarVelocity; - earRot = mAvatarRot; - break; + switch(mEarLocation) + { + case earLocCamera: + default: + earPosition = mCameraPosition; + earVelocity = mCameraVelocity; + earRot = mCameraRot; + break; - case earLocMixed: - earPosition = mAvatarPosition; - earVelocity = mAvatarVelocity; - earRot = mCameraRot; - break; - } + case earLocAvatar: + earPosition = mAvatarPosition; + earVelocity = mAvatarVelocity; + earRot = mAvatarRot; + break; - l = earRot.getLeftRow(); - u = earRot.getUpRow(); - a = earRot.getFwdRow(); - pos = earPosition; - vel = earVelocity; + case earLocMixed: + earPosition = mAvatarPosition; + earVelocity = mAvatarVelocity; + earRot = mCameraRot; + break; + } + + l = earRot.getLeftRow(); + u = earRot.getUpRow(); + a = earRot.getFwdRow(); + pos = earPosition; + vel = earVelocity; // LL_DEBUGS("Voice") << "Sending listener position " << earPosition << LL_ENDL; - oldSDKTransform(l, u, a, pos, vel); + oldSDKTransform(l, u, a, pos, vel); + } stream << "" diff --git a/indra/newview/llvoicevivox.h b/indra/newview/llvoicevivox.h index 49b2132ac..e9c233993 100644 --- a/indra/newview/llvoicevivox.h +++ b/indra/newview/llvoicevivox.h @@ -786,7 +786,8 @@ private: { earLocCamera = 0, // ear at camera earLocAvatar, // ear at avatar - earLocMixed // ear at avatar location/camera direction + earLocMixed, // ear at avatar location/camera direction + earLocSpeaker // ear at speaker, speakers not affected by position }; S32 mEarLocation; diff --git a/indra/newview/llvotree.cpp b/indra/newview/llvotree.cpp index 340a9f634..847a1f128 100644 --- a/indra/newview/llvotree.cpp +++ b/indra/newview/llvotree.cpp @@ -49,6 +49,7 @@ #include "llagentcamera.h" #include "lldrawable.h" #include "llface.h" +#include "llselectmgr.h" #include "llviewercamera.h" #include "llviewertexturelist.h" #include "llviewerobjectlist.h" @@ -57,6 +58,7 @@ #include "noise.h" #include "pipeline.h" #include "llspatialpartition.h" +//#include "llviewerwindow.h" #include "llnotificationsutil.h" #include "raytrace.h" #include "llglslshader.h" @@ -356,12 +358,47 @@ U32 LLVOTree::processUpdateMessage(LLMessageSystem *mesgsys, void LLVOTree::idleUpdate(LLAgent &agent, LLWorld &world, const F64 &time) { + const U16 FRAMES_PER_WIND_UPDATE = 20; // How many frames between wind update per tree + const F32 TREE_WIND_SENSITIVITY = 0.005f; + const F32 TREE_TRUNK_STIFFNESS = 0.1f; + if (mDead || !(gPipeline.hasRenderType(LLPipeline::RENDER_TYPE_TREE))) { return; } - - S32 trunk_LOD = sMAX_NUM_TREE_LOD_LEVELS ; + + static LLCachedControl sRenderAnimateTrees(gSavedSettings, "RenderAnimateTrees"); + if (sRenderAnimateTrees) + { + F32 mass_inv; + + // For all tree objects, update the trunk bending with the current wind + // Walk sprite list in order away from viewer + if (!(mFrameCount % FRAMES_PER_WIND_UPDATE)) + { + // If needed, Get latest wind for this tree + mWind = mRegionp->mWind.getVelocity(getPositionRegion()); + } + mFrameCount++; + + mass_inv = 1.f/(5.f + mDepth*mBranches*0.2f); + mTrunkVel += (mWind * mass_inv * TREE_WIND_SENSITIVITY); // Pull in direction of wind + mTrunkVel -= (mTrunkBend * mass_inv * TREE_TRUNK_STIFFNESS); // Restoring force in direction of trunk + mTrunkBend += mTrunkVel; + mTrunkVel *= 0.99f; // Add damping + + if (mTrunkBend.length() > 1.f) + { + mTrunkBend.normalize(); + } + + if (mTrunkVel.length() > 1.f) + { + mTrunkVel.normalize(); + } + } + + S32 trunk_LOD = sMAX_NUM_TREE_LOD_LEVELS; F32 app_angle = getAppAngle()*LLVOTree::sTreeFactor; for (S32 j = 0; j < sMAX_NUM_TREE_LOD_LEVELS; j++) @@ -373,41 +410,45 @@ void LLVOTree::idleUpdate(LLAgent &agent, LLWorld &world, const F64 &time) } } - if (mReferenceBuffer.isNull()) + if (!sRenderAnimateTrees) { - gPipeline.markRebuild(mDrawable, LLDrawable::REBUILD_ALL, TRUE); - } - else if (trunk_LOD != mTrunkLOD) - { - gPipeline.markRebuild(mDrawable, LLDrawable::REBUILD_ALL, FALSE); - } - else - { - // we're not animating but we may *still* need to - // regenerate the mesh if we moved, since position - // and rotation are baked into the mesh. - // *TODO: I don't know what's so special about trees - // that they don't get REBUILD_POSITION automatically - // at a higher level. - const LLVector3 &this_position = getPositionRegion(); - if (this_position != mLastPosition) + if (mReferenceBuffer.isNull()) { - gPipeline.markRebuild(mDrawable, LLDrawable::REBUILD_POSITION); - mLastPosition = this_position; + gPipeline.markRebuild(mDrawable, LLDrawable::REBUILD_ALL, TRUE); + } + else if (trunk_LOD != mTrunkLOD) + { + gPipeline.markRebuild(mDrawable, LLDrawable::REBUILD_ALL, FALSE); } else { - const LLQuaternion &this_rotation = getRotation(); - - if (this_rotation != mLastRotation) + // we're not animating but we may *still* need to + // regenerate the mesh if we moved, since position + // and rotation are baked into the mesh. + // *TODO: I don't know what's so special about trees + // that they don't get REBUILD_POSITION automatically + // at a higher level. + const LLVector3 &this_position = getPositionRegion(); + if (this_position != mLastPosition) { gPipeline.markRebuild(mDrawable, LLDrawable::REBUILD_POSITION); - mLastRotation = this_rotation; + mLastPosition = this_position; + } + else + { + const LLQuaternion &this_rotation = getRotation(); + + if (this_rotation != mLastRotation) + { + gPipeline.markRebuild(mDrawable, LLDrawable::REBUILD_POSITION); + mLastRotation = this_rotation; + } } } } mTrunkLOD = trunk_LOD; + //return TRUE; } const F32 TREE_BLEND_MIN = 1.f; @@ -540,8 +581,9 @@ BOOL LLVOTree::updateGeometry(LLDrawable *drawable) max_indices += sLODIndexCount[lod]; max_vertices += sLODVertexCount[lod]; } - - mReferenceBuffer = new LLVertexBuffer(LLDrawPoolTree::VERTEX_DATA_MASK, 0); + + static LLCachedControl sRenderAnimateTrees(gSavedSettings, "RenderAnimateTrees"); + mReferenceBuffer = new LLVertexBuffer(LLDrawPoolTree::VERTEX_DATA_MASK, sRenderAnimateTrees ? GL_STATIC_DRAW_ARB : 0); mReferenceBuffer->allocateBuffer(max_vertices, max_indices, TRUE); LLStrider vertices; @@ -844,10 +886,18 @@ BOOL LLVOTree::updateGeometry(LLDrawable *drawable) llassert(vertex_count == max_vertices); llassert(index_count == max_indices); } - - //generate tree mesh - updateMesh(); + static LLCachedControl sRenderAnimateTrees(gSavedSettings, "RenderAnimateTrees"); + if (sRenderAnimateTrees) + { + mDrawable->getFace(0)->setVertexBuffer(mReferenceBuffer); + } + else + { + //generate tree mesh + updateMesh(); + } + return TRUE; } @@ -1317,3 +1367,110 @@ LLTreePartition::LLTreePartition() mLODPeriod = 1; } +void LLVOTree::generateSilhouetteVertices(std::vector &vertices, + std::vector &normals, + const LLVector3& obj_cam_vec, + const LLMatrix4& local_matrix, + const LLMatrix3& normal_matrix) +{ + vertices.clear(); + normals.clear(); + + F32 height = mBillboardScale; // *mBillboardRatio * 0.5; + F32 width = height * mTrunkAspect; + + LLVector3 position1 = LLVector3(-width * 0.5, 0, 0) * local_matrix; + LLVector3 position2 = LLVector3(-width * 0.5, 0, height) * local_matrix; + LLVector3 position3 = LLVector3(width * 0.5, 0, height) * local_matrix; + LLVector3 position4 = LLVector3(width * 0.5, 0, 0) * local_matrix; + + LLVector3 position5 = LLVector3(0, -width * 0.5, 0) * local_matrix; + LLVector3 position6 = LLVector3(0, -width * 0.5, height) * local_matrix; + LLVector3 position7 = LLVector3(0, width * 0.5, height) * local_matrix; + LLVector3 position8 = LLVector3(0, width * 0.5, 0) * local_matrix; + + LLVector3 normal = (position1 - position2) % (position2 - position3); + normal.normalize(); + + vertices.push_back(position1); + normals.push_back(normal); + vertices.push_back(position2); + normals.push_back(normal); + + vertices.push_back(position2); + normals.push_back(normal); + vertices.push_back(position3); + normals.push_back(normal); + + vertices.push_back(position3); + normals.push_back(normal); + vertices.push_back(position4); + normals.push_back(normal); + + vertices.push_back(position4); + normals.push_back(normal); + vertices.push_back(position1); + normals.push_back(normal); + + normal = (position5 - position6) % (position6 - position7); + normal.normalize(); + + vertices.push_back(position5); + normals.push_back(normal); + vertices.push_back(position6); + normals.push_back(normal); + + vertices.push_back(position6); + normals.push_back(normal); + vertices.push_back(position7); + normals.push_back(normal); + + vertices.push_back(position7); + normals.push_back(normal); + vertices.push_back(position8); + normals.push_back(normal); + + vertices.push_back(position8); + normals.push_back(normal); + vertices.push_back(position5); + normals.push_back(normal); +} + +void LLVOTree::generateSilhouette(LLSelectNode* nodep, const LLVector3& view_point) +{ + LLVector3 position; + LLQuaternion rotation; + + if (mDrawable->isActive()) + { + if (mDrawable->isSpatialRoot()) + { + position = LLVector3(); + rotation = LLQuaternion(); + } + else + { + position = mDrawable->getPosition(); + rotation = mDrawable->getRotation(); + } + } + else + { + position = getPosition() + getRegion()->getOriginAgent(); + rotation = getRotation(); + } + + // trees have bizzare scaling rules... because it's cool to make needless exceptions + // PS: the trees are the last remaining tidbit of Philip's code. take a look sometime. + F32 radius = getScale().length() * 0.05f; + LLVector3 scale = LLVector3(1, 1, 1) * radius; + + // compose final matrix + LLMatrix4 local_matrix; + local_matrix.initAll(scale, rotation, position); + + generateSilhouetteVertices(nodep->mSilhouetteVertices, nodep->mSilhouetteNormals, + LLVector3(0, 0, 0), local_matrix, LLMatrix3()); + + nodep->mSilhouetteExists = TRUE; +} diff --git a/indra/newview/llvotree.h b/indra/newview/llvotree.h index fc8088823..4932c25d1 100644 --- a/indra/newview/llvotree.h +++ b/indra/newview/llvotree.h @@ -39,6 +39,7 @@ class LLFace; class LLDrawPool; +class LLSelectNode; class LLViewerFetchedTexture; class LLVOTree : public LLViewerObject @@ -124,6 +125,8 @@ public: LLVector4a* normal = NULL, // return the surface normal at the intersection point LLVector4a* tangent = NULL // return the surface tangent at the intersection point ); + + void generateSilhouette(LLSelectNode* nodep, const LLVector3& view_point); static S32 sMaxTreeSpecies; @@ -162,6 +165,7 @@ public: friend class LLDrawPoolTree; protected: LLVector3 mTrunkBend; // Accumulated wind (used for blowing trees) + LLVector3 mTrunkVel; // LLVector3 mWind; LLPointer mReferenceBuffer; //reference geometry for generating tree mesh @@ -201,6 +205,13 @@ protected: static S32 sLODVertexCount[4]; static S32 sLODSlices[4]; static F32 sLODAngles[4]; + +private: + void generateSilhouetteVertices(std::vector &vertices, + std::vector &normals, + const LLVector3& view_vec, + const LLMatrix4& mat, + const LLMatrix3& norm_mat); }; #endif diff --git a/indra/newview/llvovolume.cpp b/indra/newview/llvovolume.cpp index ad0353a76..29e0c1837 100644 --- a/indra/newview/llvovolume.cpp +++ b/indra/newview/llvovolume.cpp @@ -2078,7 +2078,7 @@ LLVector3 LLVOVolume::getApproximateFaceNormal(U8 face_id) result.add(face.mNormals[i]); } - LLVector3 ret(result.getF32ptr()); + ret = LLVector3(result.getF32ptr()); ret = volumeDirectionToAgent(ret); ret.normVec(); } diff --git a/indra/newview/llvowater.cpp b/indra/newview/llvowater.cpp index 049a89d1a..c4e73d90b 100644 --- a/indra/newview/llvowater.cpp +++ b/indra/newview/llvowater.cpp @@ -74,7 +74,10 @@ LLVOWater::LLVOWater(const LLUUID &id, { // Terrain must draw during selection passes so it can block objects behind it. mbCanSelect = FALSE; - setScale(LLVector3(256.f, 256.f, 0.f)); // Hack for setting scale for bounding boxes/visibility. +// Aurora Sim + //setScale(LLVector3(256.f, 256.f, 0.f)); // Hack for setting scale for bounding boxes/visibility. + setScale(LLVector3(mRegionp->getWidth(), mRegionp->getWidth(), 0.f)); +// Aurora Sim mUseTexture = TRUE; mIsEdgePatch = FALSE; diff --git a/indra/newview/llwebprofile.cpp b/indra/newview/llwebprofile.cpp index 7286766c6..75d60f985 100644 --- a/indra/newview/llwebprofile.cpp +++ b/indra/newview/llwebprofile.cpp @@ -120,7 +120,6 @@ public: protected: /*virtual*/ AIHTTPTimeoutPolicy const& getHTTPTimeoutPolicy(void) const { return webProfileResponders_timeout; } - /*virtual*/ bool followRedir(void) const { return true; } /*virtual*/ char const* getName(void) const { return "LLWebProfileResponders::ConfigResponder"; } private: @@ -157,7 +156,6 @@ public: } protected: - /*virtual*/ bool followRedir(void) const { return true; } /*virtual*/ AIHTTPTimeoutPolicy const& getHTTPTimeoutPolicy(void) const { return webProfileResponders_timeout; } /*virtual*/ char const* getName(void) const { return "LLWebProfileResponders::PostImageRedirectResponder"; } @@ -181,7 +179,7 @@ public: // the just uploaded data, which fails // (CURLE_SEND_FAIL_REWIND: Send failed since rewinding of the data stream failed). // Handle it manually. - if (status == 303) + if (status == HTTP_SEE_OTHER) { AIHTTPHeaders headers; headers.addHeader("Accept", "*/*"); @@ -208,7 +206,7 @@ public: } protected: - /*virtual*/ bool redirect_status_ok(void) const { return true; } + /*virtual*/ bool pass_redirect_status(void) const { return true; } /*virtual*/ AIHTTPTimeoutPolicy const& getHTTPTimeoutPolicy(void) const { return webProfileResponders_timeout; } /*virtual*/ char const* getName(void) const { return "LLWebProfileResponders::PostImageResponder"; } }; diff --git a/indra/newview/llwind.cpp b/indra/newview/llwind.cpp index 2b0f0d969..d35838ed1 100644 --- a/indra/newview/llwind.cpp +++ b/indra/newview/llwind.cpp @@ -50,7 +50,7 @@ #include "noise.h" #include "v4color.h" #include "llagent.h" -#include "llworld.h" +#include "llviewerregion.h" const F32 CLOUD_DIVERGENCE_COEF = 0.5f; @@ -254,7 +254,10 @@ LLVector3 LLWind::getVelocity(const LLVector3 &pos_region) LLVector3 pos_clamped_region(pos_region); - F32 region_width_meters = LLWorld::getInstance()->getRegionWidthInMeters(); +// Aurora Sim + //F32 region_width_meters = LLWorld::getInstance()->getRegionWidthInMeters(); + F32 region_width_meters = gAgent.getRegion()->getWidth(); +// Aurora Sim if (pos_clamped_region.mV[VX] < 0.f) { @@ -321,7 +324,7 @@ LLVector3 LLWind::getCloudVelocity(const LLVector3 &pos_region) LLVector3 pos_clamped_region(pos_region); - F32 region_width_meters = LLWorld::getInstance()->getRegionWidthInMeters(); + F32 region_width_meters = gAgent.getRegion()->getWidth(); if (pos_clamped_region.mV[VX] < 0.f) { diff --git a/indra/newview/llwindebug.cpp b/indra/newview/llwindebug.cpp index 5c7ee642d..446b9b96f 100644 --- a/indra/newview/llwindebug.cpp +++ b/indra/newview/llwindebug.cpp @@ -2,98 +2,35 @@ * @file llwindebug.cpp * @brief Windows debugging functions * - * $LicenseInfo:firstyear=2004&license=viewergpl$ - * - * Copyright (c) 2004-2009, Linden Research, Inc. - * + * $LicenseInfo:firstyear=2004&license=viewerlgpl$ * Second Life Viewer Source Code - * The source code in this file ("Source Code") is provided by Linden Lab - * to you under the terms of the GNU General Public License, version 2.0 - * ("GPL"), unless you have obtained a separate licensing agreement - * ("Other License"), formally executed by you and Linden Lab. Terms of - * the GPL can be found in doc/GPL-license.txt in this distribution, or - * online at http://secondlifegrid.net/programs/open_source/licensing/gplv2 + * Copyright (C) 2010, Linden Research, Inc. * - * There are special exceptions to the terms and conditions of the GPL as - * it is applied to this Source Code. View the full text of the exception - * in the file doc/FLOSS-exception.txt in this software distribution, or - * online at - * http://secondlifegrid.net/programs/open_source/licensing/flossexception + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; + * version 2.1 of the License only. * - * By copying, modifying or distributing this software, you acknowledge - * that you have read and understood your obligations described above, - * and agree to abide by those obligations. + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. * - * ALL LINDEN LAB SOURCE CODE IS PROVIDED "AS IS." LINDEN LAB MAKES NO - * WARRANTIES, EXPRESS, IMPLIED OR OTHERWISE, REGARDING ITS ACCURACY, - * COMPLETENESS OR PERFORMANCE. + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + * + * Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA * $/LicenseInfo$ */ - #include "llviewerprecompiledheaders.h" -#include -#include #include "llwindebug.h" -#include "llviewercontrol.h" #include "lldir.h" -#include "llsd.h" -#include "llsdserialize.h" #pragma warning(disable: 4200) //nonstandard extension used : zero-sized array in struct/union #pragma warning(disable: 4100) //unreferenced formal parameter - -/* -LLSD Block for Windows Dump Information - - - Platform - - Process - - Module - - DateModified - - ExceptionCode - - ExceptionRead/WriteAddress - - Instruction - - Registers - - - EIP - ... - - - Call Stack - - - - ModuleName - - ModuleBaseAddress - - ModuleOffsetAddress - - Parameters - - - - - - - - - -*/ - - -extern void (*gCrashCallback)(void); - // based on dbghelp.h typedef BOOL (WINAPI *MINIDUMPWRITEDUMP)(HANDLE hProcess, DWORD dwPid, HANDLE hFile, MINIDUMP_TYPE DumpType, CONST PMINIDUMP_EXCEPTION_INFORMATION ExceptionParam, @@ -103,527 +40,6 @@ typedef BOOL (WINAPI *MINIDUMPWRITEDUMP)(HANDLE hProcess, DWORD dwPid, HANDLE hF MINIDUMPWRITEDUMP f_mdwp = NULL; -#undef UNICODE - -static LPTOP_LEVEL_EXCEPTION_FILTER gFilterFunc = NULL; - -HMODULE hDbgHelp; - -// Tool Help functions. -typedef HANDLE (WINAPI * CREATE_TOOL_HELP32_SNAPSHOT)(DWORD dwFlags, DWORD th32ProcessID); -typedef BOOL (WINAPI * MODULE32_FIRST)(HANDLE hSnapshot, LPMODULEENTRY32 lpme); -typedef BOOL (WINAPI * MODULE32_NEST)(HANDLE hSnapshot, LPMODULEENTRY32 lpme); - -CREATE_TOOL_HELP32_SNAPSHOT CreateToolhelp32Snapshot_; -MODULE32_FIRST Module32First_; -MODULE32_NEST Module32Next_; - -#define DUMP_SIZE_MAX 8000 //max size of our dump -#define CALL_TRACE_MAX ((DUMP_SIZE_MAX - 2000) / (MAX_PATH + 40)) //max number of traced calls -#define NL L"\r\n" //new line - - -typedef struct STACK -{ - STACK * Ebp; - PBYTE Ret_Addr; - DWORD Param[0]; -} STACK, * PSTACK; - -BOOL WINAPI Get_Module_By_Ret_Addr(PBYTE Ret_Addr, LPWSTR Module_Name, PBYTE & Module_Addr); -void WINAPI Get_Call_Stack(const EXCEPTION_RECORD* exception_record, - const CONTEXT* context_record, - LLSD& info); - -void printError( CHAR* msg ) -{ - DWORD eNum; - TCHAR sysMsg[256]; - TCHAR* p; - - eNum = GetLastError( ); - FormatMessage( FORMAT_MESSAGE_FROM_SYSTEM | FORMAT_MESSAGE_IGNORE_INSERTS, - NULL, eNum, - MAKELANGID(LANG_NEUTRAL, SUBLANG_DEFAULT), // Default language - sysMsg, 256, NULL ); - - // Trim the end of the line and terminate it with a null - p = sysMsg; - while( ( *p > 31 ) || ( *p == 9 ) ) - ++p; - do { *p-- = 0; } while( ( p >= sysMsg ) && - ( ( *p == '.' ) || ( *p < 33 ) ) ); - - // Display the message - printf( "\n WARNING: %s failed with error %d (%s)", msg, eNum, sysMsg ); -} - -BOOL GetProcessThreadIDs(DWORD process_id, std::vector& thread_ids) -{ - HANDLE hThreadSnap = INVALID_HANDLE_VALUE; - THREADENTRY32 te32; - - // Take a snapshot of all running threads - hThreadSnap = CreateToolhelp32Snapshot( TH32CS_SNAPTHREAD, 0 ); - if( hThreadSnap == INVALID_HANDLE_VALUE ) - return( FALSE ); - - // Fill in the size of the structure before using it. - te32.dwSize = sizeof(THREADENTRY32 ); - - // Retrieve information about the first thread, - // and exit if unsuccessful - if( !Thread32First( hThreadSnap, &te32 ) ) - { - printError( "Thread32First" ); // Show cause of failure - CloseHandle( hThreadSnap ); // Must clean up the snapshot object! - return( FALSE ); - } - - // Now walk the thread list of the system, - // and display information about each thread - // associated with the specified process - do - { - if( te32.th32OwnerProcessID == process_id ) - { - thread_ids.push_back(te32.th32ThreadID); - } - } while( Thread32Next(hThreadSnap, &te32 ) ); - -// Don't forget to clean up the snapshot object. - CloseHandle( hThreadSnap ); - return( TRUE ); -} - -BOOL GetThreadCallStack(DWORD thread_id, LLSD& info) -{ - if(GetCurrentThreadId() == thread_id) - { - // Early exit for the current thread. - // Suspending the current thread would be a bad idea. - // Plus you can't retrieve a valid current thread context. - return false; - } - - HANDLE thread_handle = INVALID_HANDLE_VALUE; - thread_handle = OpenThread(THREAD_ALL_ACCESS, FALSE, thread_id); - if(INVALID_HANDLE_VALUE == thread_handle) - { - return FALSE; - } - - BOOL result = false; - if(-1 != SuspendThread(thread_handle)) - { - CONTEXT context_struct; - context_struct.ContextFlags = CONTEXT_FULL; - if(GetThreadContext(thread_handle, &context_struct)) - { - Get_Call_Stack(NULL, &context_struct, info); - result = true; - } - ResumeThread(thread_handle); - } - else - { - // Couldn't suspend thread. - } - - CloseHandle(thread_handle); - return result; -} - - -//Windows Call Stack Construction idea from -//http://www.codeproject.com/tools/minidump.asp - -// **************************************************************************************** -BOOL WINAPI Get_Module_By_Ret_Addr(PBYTE Ret_Addr, LPWSTR Module_Name, PBYTE & Module_Addr) -// **************************************************************************************** -// Find module by Ret_Addr (address in the module). -// Return Module_Name (full path) and Module_Addr (start address). -// Return TRUE if found. -{ - MODULEENTRY32 M = {sizeof(M)}; - HANDLE hSnapshot; - - bool found = false; - - if (CreateToolhelp32Snapshot_) - { - hSnapshot = CreateToolhelp32Snapshot_(TH32CS_SNAPMODULE, 0); - - if ((hSnapshot != INVALID_HANDLE_VALUE) && - Module32First_(hSnapshot, &M)) - { - do - { - if (DWORD(Ret_Addr - M.modBaseAddr) < M.modBaseSize) - { - lstrcpyn(Module_Name, M.szExePath, MAX_PATH); - Module_Addr = M.modBaseAddr; - found = true; - break; - } - } while (Module32Next_(hSnapshot, &M)); - } - - CloseHandle(hSnapshot); - } - - return found; -} //Get_Module_By_Ret_Addr - -bool has_valid_call_before(PDWORD cur_stack_loc) -{ - PBYTE p_first_byte = (PBYTE)(*cur_stack_loc - 1); - PBYTE p_second_byte = (PBYTE)(*cur_stack_loc -2); - PBYTE p_fifth_byte = (PBYTE)(*cur_stack_loc - 5); - PBYTE p_sixth_byte = (PBYTE)(*cur_stack_loc - 6); - - // make sure we can read it - if(IsBadReadPtr(p_sixth_byte, 6 * sizeof(BYTE))) - { - return false; - } - - // check for 9a + 4 bytes - if(*p_fifth_byte == 0x9A) - { - return true; - } - - // Check for E8 + 4 bytes and last byte is 00 or FF - if(*p_fifth_byte == 0xE8 && (*p_first_byte == 0x00 || *p_first_byte == 0xFF)) - { - return true; - } - - // the other is six bytes - if(*p_sixth_byte == 0xFF || *p_second_byte == 0xFF) - { - return true; - } - - return false; -} - -PBYTE get_valid_frame(PBYTE esp) -{ - PDWORD cur_stack_loc = NULL; - const int max_search = 400; - WCHAR module_name[MAX_PATH]; - PBYTE module_addr = 0; - - // round to highest multiple of four - esp = (esp + (4 - ((int)esp % 4)) % 4); - - // scroll through stack a few hundred places. - for (cur_stack_loc = (PDWORD) esp; cur_stack_loc < (PDWORD)esp + max_search; cur_stack_loc += 1) - { - // if you can read the pointer, - if (IsBadReadPtr(cur_stack_loc, sizeof(PDWORD))) - { - continue; - } - - // check if it's in a module - if (!Get_Module_By_Ret_Addr((PBYTE)*cur_stack_loc, module_name, module_addr)) - { - continue; - } - - // check if the code before the instruction ptr is a call - if(!has_valid_call_before(cur_stack_loc)) - { - continue; - } - - // if these all pass, return that ebp, otherwise continue till we're dead - return (PBYTE)(cur_stack_loc - 1); - } - - return NULL; -} - -bool shouldUseStackWalker(PSTACK Ebp, int max_depth) -{ - WCHAR Module_Name[MAX_PATH]; - PBYTE Module_Addr = 0; - int depth = 0; - - while (depth < max_depth) - { - if (IsBadReadPtr(Ebp, sizeof(PSTACK)) || - IsBadReadPtr(Ebp->Ebp, sizeof(PSTACK)) || - Ebp->Ebp < Ebp || - Ebp->Ebp - Ebp > 0xFFFFFF || - IsBadCodePtr(FARPROC(Ebp->Ebp->Ret_Addr)) || - !Get_Module_By_Ret_Addr(Ebp->Ebp->Ret_Addr, Module_Name, Module_Addr)) - { - return true; - } - depth++; - Ebp = Ebp->Ebp; - } - - return false; -} - -// ****************************************************************** -void WINAPI Get_Call_Stack(const EXCEPTION_RECORD* exception_record, - const CONTEXT* context_record, - LLSD& info) -// ****************************************************************** -// Fill Str with call stack info. -// pException can be either GetExceptionInformation() or NULL. -// If pException = NULL - get current call stack. -{ - LPWSTR Module_Name = new WCHAR[MAX_PATH]; - PBYTE Module_Addr = 0; - LLSD params; - PBYTE Esp = NULL; - LLSD tmp_info; - - bool fake_frame = false; - bool ebp_used = false; - const int HEURISTIC_MAX_WALK = 20; - int heuristic_walk_i = 0; - int Ret_Addr_I = 0; - - STACK Stack = {0, 0}; - PSTACK Ebp; - - if (exception_record && context_record) //fake frame for exception address - { - Stack.Ebp = (PSTACK)(context_record->Ebp); - Stack.Ret_Addr = (PBYTE)exception_record->ExceptionAddress; - Ebp = &Stack; - Esp = (PBYTE) context_record->Esp; - fake_frame = true; - } - else if(context_record) - { - Ebp = (PSTACK)(context_record->Ebp); - Esp = (PBYTE)(context_record->Esp); - } - else - { - Ebp = (PSTACK)&exception_record - 1; //frame addr of Get_Call_Stack() - Esp = (PBYTE)&exception_record; - - // Skip frame of Get_Call_Stack(). - if (!IsBadReadPtr(Ebp, sizeof(PSTACK))) - Ebp = Ebp->Ebp; //caller ebp - } - - // Trace CALL_TRACE_MAX calls maximum - not to exceed DUMP_SIZE_MAX. - // Break trace on wrong stack frame. - for (Ret_Addr_I = 0; - heuristic_walk_i < HEURISTIC_MAX_WALK && - Ret_Addr_I < CALL_TRACE_MAX && !IsBadReadPtr(Ebp, sizeof(PSTACK)) && !IsBadCodePtr(FARPROC(Ebp->Ret_Addr)); - Ret_Addr_I++) - { - // If module with Ebp->Ret_Addr found. - if (Get_Module_By_Ret_Addr(Ebp->Ret_Addr, Module_Name, Module_Addr)) - { - // Save module's address and full path. - tmp_info["CallStack"][Ret_Addr_I]["ModuleName"] = ll_convert_wide_to_string(Module_Name,CP_ACP); - tmp_info["CallStack"][Ret_Addr_I]["ModuleAddress"] = (int)Module_Addr; - tmp_info["CallStack"][Ret_Addr_I]["CallOffset"] = (int)(Ebp->Ret_Addr - Module_Addr); - - // Save 5 params of the call. We don't know the real number of params. - if (fake_frame && !Ret_Addr_I) //fake frame for exception address - params[0] = "Exception Offset"; - else if (!IsBadReadPtr(Ebp, sizeof(PSTACK) + 5 * sizeof(DWORD))) - { - for(int j = 0; j < 5; ++j) - { - params[j] = (int)Ebp->Param[j]; - } - } - tmp_info["CallStack"][Ret_Addr_I]["Parameters"] = params; - } - - tmp_info["CallStack"][Ret_Addr_I]["ReturnAddress"] = (int)Ebp->Ret_Addr; - - // get ready for next frame - // Set ESP to just after return address. Not the real esp, but just enough after the return address - if(!fake_frame) { - Esp = (PBYTE)Ebp + 8; - } - else - { - fake_frame = false; - } - - // is next ebp valid? - // only run if we've never found a good ebp - // and make sure the one after is valid as well - if( !ebp_used && - shouldUseStackWalker(Ebp, 2)) - { - heuristic_walk_i++; - PBYTE new_ebp = get_valid_frame(Esp); - if (new_ebp != NULL) - { - Ebp = (PSTACK)new_ebp; - } - } - else - { - ebp_used = true; - Ebp = Ebp->Ebp; - } - } -/* TODO remove or turn this code back on to edit the stack after i see a few raw ones. -Palmer - // Now go back through and edit out heuristic stacks that could very well be bogus. - // Leave the top and the last 3 stack chosen by the heuristic, however. - if(heuristic_walk_i > 2) - { - info["CallStack"][0] = tmp_info["CallStack"][0]; - std::string ttest = info["CallStack"][0]["ModuleName"]; - for(int cur_frame = 1; - (cur_frame + heuristic_walk_i - 2 < Ret_Addr_I); - ++cur_frame) - { - // edit out the middle heuristic found frames - info["CallStack"][cur_frame] = tmp_info["CallStack"][cur_frame + heuristic_walk_i - 2]; - } - } - else - { - info = tmp_info; - } -*/ - info = tmp_info; - info["HeuristicWalkI"] = heuristic_walk_i; - info["EbpUsed"] = ebp_used; - -} //Get_Call_Stack - -// *********************************** -void WINAPI Get_Version_Str(LLSD& info) -// *********************************** -// Fill Str with Windows version. -{ - OSVERSIONINFOEX V = {sizeof(OSVERSIONINFOEX)}; //EX for NT 5.0 and later - - if (!GetVersionEx((POSVERSIONINFO)&V)) - { - ZeroMemory(&V, sizeof(V)); - V.dwOSVersionInfoSize = sizeof(OSVERSIONINFO); - GetVersionEx((POSVERSIONINFO)&V); - } - - if (V.dwPlatformId != VER_PLATFORM_WIN32_NT) - V.dwBuildNumber = LOWORD(V.dwBuildNumber); //for 9x HIWORD(dwBuildNumber) = 0x04xx - - info["Platform"] = llformat("Windows: %d.%d.%d, SP %d.%d, Product Type %d", //SP - service pack, Product Type - VER_NT_WORKSTATION,... - V.dwMajorVersion, V.dwMinorVersion, V.dwBuildNumber, V.wServicePackMajor, V.wServicePackMinor, V.wProductType); -} //Get_Version_Str - -// ************************************************************* -LLSD WINAPI Get_Exception_Info(PEXCEPTION_POINTERS pException) -// ************************************************************* -// Allocate Str[DUMP_SIZE_MAX] and return Str with dump, if !pException - just return call stack in Str. -{ - LLSD info; - LPWSTR Str; - int Str_Len; -// int i; - LPWSTR Module_Name = new WCHAR[MAX_PATH]; - PBYTE Module_Addr; - HANDLE hFile; - FILETIME Last_Write_Time; - FILETIME Local_File_Time; - SYSTEMTIME T; - - Str = new WCHAR[DUMP_SIZE_MAX]; - Str_Len = 0; - if (!Str) - return NULL; - - Get_Version_Str(info); - - GetModuleFileName(NULL, Str, MAX_PATH); - info["Process"] = ll_convert_wide_to_string(Str,CP_ACP); - info["ThreadID"] = (S32)GetCurrentThreadId(); - - // If exception occurred. - if (pException) - { - EXCEPTION_RECORD & E = *pException->ExceptionRecord; - CONTEXT & C = *pException->ContextRecord; - - // If module with E.ExceptionAddress found - save its path and date. - if (Get_Module_By_Ret_Addr((PBYTE)E.ExceptionAddress, Module_Name, Module_Addr)) - { - info["Module"] = ll_convert_wide_to_string(Module_Name,CP_ACP); - - if ((hFile = CreateFile(Module_Name, GENERIC_READ, FILE_SHARE_READ, NULL, OPEN_EXISTING, - FILE_ATTRIBUTE_NORMAL, NULL)) != INVALID_HANDLE_VALUE) - { - if (GetFileTime(hFile, NULL, NULL, &Last_Write_Time)) - { - FileTimeToLocalFileTime(&Last_Write_Time, &Local_File_Time); - FileTimeToSystemTime(&Local_File_Time, &T); - - info["DateModified"] = llformat("%02d/%02d/%d", T.wMonth, T.wDay, T.wYear); - } - CloseHandle(hFile); - } - } - else - { - info["ExceptionAddr"] = (int)E.ExceptionAddress; - } - - info["ExceptionCode"] = (int)E.ExceptionCode; - - /* - //TODO: Fix this - if (E.ExceptionCode == EXCEPTION_ACCESS_VIOLATION) - { - // Access violation type - Write/Read. - LLSD exception_info; - exception_info["Type"] = E.ExceptionInformation[0] ? "Write" : "Read"; - exception_info["Address"] = llformat("%08x", E.ExceptionInformation[1]); - info["Exception Information"] = exception_info; - } - */ - - - // Save instruction that caused exception. - /* - std::string str; - for (i = 0; i < 16; i++) - str += llformat(" %02X", PBYTE(E.ExceptionAddress)[i]); - info["Instruction"] = str; - */ - LLSD registers; - registers["EAX"] = (int)C.Eax; - registers["EBX"] = (int)C.Ebx; - registers["ECX"] = (int)C.Ecx; - registers["EDX"] = (int)C.Edx; - registers["ESI"] = (int)C.Esi; - registers["EDI"] = (int)C.Edi; - registers["ESP"] = (int)C.Esp; - registers["EBP"] = (int)C.Ebp; - registers["EIP"] = (int)C.Eip; - registers["EFlags"] = (int)C.EFlags; - info["Registers"] = registers; - } //if (pException) - - // Save call stack info. - Get_Call_Stack(pException->ExceptionRecord, pException->ContextRecord, info); - - return info; -} //Get_Exception_Info - -#define UNICODE - class LLMemoryReserve { public: @@ -663,66 +79,23 @@ void LLMemoryReserve::release() static LLMemoryReserve gEmergencyMemoryReserve; -#ifndef _M_IX86 - #error "The following code only works for x86!" -#endif -LPTOP_LEVEL_EXCEPTION_FILTER WINAPI MyDummySetUnhandledExceptionFilter( - LPTOP_LEVEL_EXCEPTION_FILTER lpTopLevelExceptionFilter) + +LONG NTAPI vectoredHandler(PEXCEPTION_POINTERS exception_infop) { - if(lpTopLevelExceptionFilter == gFilterFunc) - return gFilterFunc; - - llinfos << "Someone tried to set the exception filter. Listing call stack modules" << llendl; - LLSD cs_info; - Get_Call_Stack(NULL, NULL, cs_info); - - if(cs_info.has("CallStack") && cs_info["CallStack"].isArray()) - { - LLSD cs = cs_info["CallStack"]; - for(LLSD::array_iterator i = cs.beginArray(); - i != cs.endArray(); - ++i) - { - llinfos << "Module: " << (*i)["ModuleName"] << llendl; - } - } - - return gFilterFunc; -} - -BOOL PreventSetUnhandledExceptionFilter() -{ - HMODULE hKernel32 = LoadLibrary(_T("kernel32.dll")); - if (hKernel32 == NULL) - return FALSE; - - void *pOrgEntry = GetProcAddress(hKernel32, "SetUnhandledExceptionFilter"); - if(pOrgEntry == NULL) - return FALSE; - - unsigned char newJump[ 100 ]; - DWORD dwOrgEntryAddr = (DWORD)pOrgEntry; - dwOrgEntryAddr += 5; // add 5 for 5 op-codes for jmp far - void *pNewFunc = &MyDummySetUnhandledExceptionFilter; - DWORD dwNewEntryAddr = (DWORD) pNewFunc; - DWORD dwRelativeAddr = dwNewEntryAddr - dwOrgEntryAddr; - - newJump[ 0 ] = 0xE9; // JMP absolute - memcpy(&newJump[ 1 ], &dwRelativeAddr, sizeof(pNewFunc)); - SIZE_T bytesWritten; - BOOL bRet = WriteProcessMemory(GetCurrentProcess(), - pOrgEntry, newJump, sizeof(pNewFunc) + 1, &bytesWritten); - return bRet; + LLWinDebug::instance().generateMinidump(exception_infop); + return EXCEPTION_CONTINUE_SEARCH; } // static -void LLWinDebug::initExceptionHandler(LPTOP_LEVEL_EXCEPTION_FILTER filter_func) +void LLWinDebug::init() { - static bool s_first_run = true; // Load the dbghelp dll now, instead of waiting for the crash. // Less potential for stack mangling + // Don't install vectored exception handler if being debugged. + if(IsDebuggerPresent()) return; + if (s_first_run) { // First, try loading from the directory that the app resides in. @@ -753,161 +126,68 @@ void LLWinDebug::initExceptionHandler(LPTOP_LEVEL_EXCEPTION_FILTER filter_func) gEmergencyMemoryReserve.reserve(); s_first_run = false; + + // Add this exeption hanlder to save windows style minidump. + AddVectoredExceptionHandler(0, &vectoredHandler); } - - // Try to get Tool Help library functions. - HMODULE hKernel32; - hKernel32 = GetModuleHandle(_T("KERNEL32")); - CreateToolhelp32Snapshot_ = (CREATE_TOOL_HELP32_SNAPSHOT)GetProcAddress(hKernel32, "CreateToolhelp32Snapshot"); - Module32First_ = (MODULE32_FIRST)GetProcAddress(hKernel32, "Module32FirstW"); - Module32Next_ = (MODULE32_NEST)GetProcAddress(hKernel32, "Module32NextW"); - - LPTOP_LEVEL_EXCEPTION_FILTER prev_filter; - prev_filter = SetUnhandledExceptionFilter(filter_func); - - // *REMOVE:Mani - //PreventSetUnhandledExceptionFilter(); - - if(prev_filter != gFilterFunc) - { - LL_WARNS("AppInit") - << "Replacing unknown exception (" << (void *)prev_filter << ") with (" << (void *)filter_func << ") !" << LL_ENDL; - } - - gFilterFunc = filter_func; -} - -bool LLWinDebug::checkExceptionHandler() -{ - bool ok = true; - LPTOP_LEVEL_EXCEPTION_FILTER prev_filter; - prev_filter = SetUnhandledExceptionFilter(gFilterFunc); - - if (prev_filter != gFilterFunc) - { - LL_WARNS("AppInit") << "Our exception handler (" << (void *)gFilterFunc << ") replaced with " << prev_filter << "!" << LL_ENDL; - ok = false; - } - - if (prev_filter == NULL) - { - ok = FALSE; - if (gFilterFunc == NULL) - { - LL_WARNS("AppInit") << "Exception handler uninitialized." << LL_ENDL; - } - else - { - LL_WARNS("AppInit") << "Our exception handler (" << (void *)gFilterFunc << ") replaced with NULL!" << LL_ENDL; - } - } - - return ok; } void LLWinDebug::writeDumpToFile(MINIDUMP_TYPE type, MINIDUMP_EXCEPTION_INFORMATION *ExInfop, const std::string& filename) { - if(f_mdwp == NULL || gDirUtilp == NULL) + // Temporary fix to switch out the code that writes the DMP file. + // Fix coming that doesn't write a mini dump file for regular C++ exceptions. + const bool enable_write_dump_file = false; + if ( enable_write_dump_file ) { - return; - //write_debug("No way to generate a minidump, no MiniDumpWriteDump function!\n"); - } - else - { - std::string dump_path = gDirUtilp->getExpandedFilename(LL_PATH_LOGS, filename); - - HANDLE hFile = CreateFileA(dump_path.c_str(), - GENERIC_WRITE, - FILE_SHARE_WRITE, - NULL, - CREATE_ALWAYS, - FILE_ATTRIBUTE_NORMAL, - NULL); - - if (hFile != INVALID_HANDLE_VALUE) + if(f_mdwp == NULL || gDirUtilp == NULL) { - // Write the dump, ignoring the return value - f_mdwp(GetCurrentProcess(), - GetCurrentProcessId(), - hFile, - type, - ExInfop, - NULL, - NULL); - - CloseHandle(hFile); + return; } + else + { + std::string dump_path = gDirUtilp->getExpandedFilename(LL_PATH_LOGS, filename); + HANDLE hFile = CreateFileA(dump_path.c_str(), + GENERIC_WRITE, + FILE_SHARE_WRITE, + NULL, + CREATE_ALWAYS, + FILE_ATTRIBUTE_NORMAL, + NULL); + + if (hFile != INVALID_HANDLE_VALUE) + { + // Write the dump, ignoring the return value + f_mdwp(GetCurrentProcess(), + GetCurrentProcessId(), + hFile, + type, + ExInfop, + NULL, + NULL); + + CloseHandle(hFile); + } + + } } } // static -void LLWinDebug::generateCrashStacks(struct _EXCEPTION_POINTERS *exception_infop) +void LLWinDebug::generateMinidump(struct _EXCEPTION_POINTERS *exception_infop) { - // *NOTE:Mani - This method is no longer the exception handler. - // Its called from viewer_windows_exception_handler() and other places. - - // - // Let go of a bunch of reserved memory to give library calls etc - // a chance to execute normally in the case that we ran out of - // memory. - // - LLSD info; std::string dump_path = gDirUtilp->getExpandedFilename(LL_PATH_LOGS, "SecondLifeException"); - std::string log_path = dump_path + ".log"; - if (exception_infop) { // Since there is exception info... Release the hounds. gEmergencyMemoryReserve.release(); - LLControlVariable* save_minimap = gSavedSettings.getControl("SaveMinidump"); - if(save_minimap && save_minimap->getValue().asBoolean()) - { - _MINIDUMP_EXCEPTION_INFORMATION ExInfo; + _MINIDUMP_EXCEPTION_INFORMATION ExInfo; - ExInfo.ThreadId = ::GetCurrentThreadId(); - ExInfo.ExceptionPointers = exception_infop; - ExInfo.ClientPointers = NULL; - - writeDumpToFile(MiniDumpNormal, &ExInfo, "SecondLife.dmp"); - writeDumpToFile((MINIDUMP_TYPE)(MiniDumpWithDataSegs | MiniDumpWithIndirectlyReferencedMemory), &ExInfo, "SecondLifePlus.dmp"); - } - - info = Get_Exception_Info(exception_infop); + ExInfo.ThreadId = ::GetCurrentThreadId(); + ExInfo.ExceptionPointers = exception_infop; + ExInfo.ClientPointers = NULL; + writeDumpToFile((MINIDUMP_TYPE)(MiniDumpWithDataSegs | MiniDumpWithIndirectlyReferencedMemory), &ExInfo, "SecondLife.dmp"); } - - LLSD threads; - std::vector thread_ids; - GetProcessThreadIDs(GetCurrentProcessId(), thread_ids); - - for(std::vector::iterator th_itr = thread_ids.begin(); - th_itr != thread_ids.end(); - ++th_itr) - { - LLSD thread_info; - if(*th_itr != GetCurrentThreadId()) - { - GetThreadCallStack(*th_itr, thread_info); - } - - if(thread_info) - { - threads[llformat("ID %d", *th_itr)] = thread_info; - } - } - - info["Threads"] = threads; - - llofstream out_file(log_path); - LLSDSerialize::toPrettyXML(info, out_file); - out_file.close(); -} - -void LLWinDebug::clearCrashStacks() -{ - LLSD info; - std::string dump_path = gDirUtilp->getExpandedFilename(LL_PATH_LOGS, "SecondLifeException.log"); - LLFile::remove(dump_path); } diff --git a/indra/newview/llwindebug.h b/indra/newview/llwindebug.h index f4a6a2d54..3837825d3 100644 --- a/indra/newview/llwindebug.h +++ b/indra/newview/llwindebug.h @@ -2,31 +2,25 @@ * @file llwindebug.h * @brief LLWinDebug class header file * - * $LicenseInfo:firstyear=2004&license=viewergpl$ - * - * Copyright (c) 2004-2009, Linden Research, Inc. - * + * $LicenseInfo:firstyear=2004&license=viewerlgpl$ * Second Life Viewer Source Code - * The source code in this file ("Source Code") is provided by Linden Lab - * to you under the terms of the GNU General Public License, version 2.0 - * ("GPL"), unless you have obtained a separate licensing agreement - * ("Other License"), formally executed by you and Linden Lab. Terms of - * the GPL can be found in doc/GPL-license.txt in this distribution, or - * online at http://secondlifegrid.net/programs/open_source/licensing/gplv2 + * Copyright (C) 2010, Linden Research, Inc. * - * There are special exceptions to the terms and conditions of the GPL as - * it is applied to this Source Code. View the full text of the exception - * in the file doc/FLOSS-exception.txt in this software distribution, or - * online at - * http://secondlifegrid.net/programs/open_source/licensing/flossexception + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; + * version 2.1 of the License only. * - * By copying, modifying or distributing this software, you acknowledge - * that you have read and understood your obligations described above, - * and agree to abide by those obligations. + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. * - * ALL LINDEN LAB SOURCE CODE IS PROVIDED "AS IS." LINDEN LAB MAKES NO - * WARRANTIES, EXPRESS, IMPLIED OR OTHERWISE, REGARDING ITS ACCURACY, - * COMPLETENESS OR PERFORMANCE. + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + * + * Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA * $/LicenseInfo$ */ @@ -36,40 +30,14 @@ #include "stdtypes.h" #include -class LLWinDebug +class LLWinDebug: + public LLSingleton { public: - - /** - * @brief initialize the llwindebug exception filter callback - * - * Hand a windows unhandled exception filter to LLWinDebug - * This method should only be called to change the - * exception filter used by llwindebug. - * - * Setting filter_func to NULL will clear any custom filters. - **/ - static void initExceptionHandler(LPTOP_LEVEL_EXCEPTION_FILTER filter_func); - - /** - * @brief check the status of the exception filter. - * - * Resets unhandled exception filter to the filter specified - * w/ initExceptionFilter). - * Returns false if the exception filter was modified. - * - * *NOTE:Mani In the past mozlib has been accused of - * overriding the exception filter. If the mozlib filter - * is required, perhaps we can chain calls from our - * filter to mozlib's. - **/ - static bool checkExceptionHandler(); - - static void generateCrashStacks(struct _EXCEPTION_POINTERS *pExceptionInfo = NULL); - static void clearCrashStacks(); // Delete the crash stack file(s). - - static void writeDumpToFile(MINIDUMP_TYPE type, MINIDUMP_EXCEPTION_INFORMATION *ExInfop, const std::string& filename); + static void init(); + static void generateMinidump(struct _EXCEPTION_POINTERS *pExceptionInfo = NULL); private: + static void writeDumpToFile(MINIDUMP_TYPE type, MINIDUMP_EXCEPTION_INFORMATION *ExInfop, const std::string& filename); }; #endif // LL_LLWINDEBUG_H diff --git a/indra/newview/llworld.cpp b/indra/newview/llworld.cpp index 5c8c8f4a8..84ac30bf8 100644 --- a/indra/newview/llworld.cpp +++ b/indra/newview/llworld.cpp @@ -81,12 +81,18 @@ const S32 WORLD_PATCH_SIZE = 16; extern LLColor4U MAX_WATER_COLOR; -const U32 LLWorld::mWidth = 256; +// Aurora Sim +//const U32 LLWorld::mWidth = 256; +U32 LLWorld::mWidth = 256; +// Aurora Sim // meters/point, therefore mWidth * mScale = meters per edge const F32 LLWorld::mScale = 1.f; -const F32 LLWorld::mWidthInMeters = mWidth * mScale; +// Aurora Sim +//const F32 LLWorld::mWidthInMeters = mWidth * mScale; +F32 LLWorld::mWidthInMeters = mWidth * mScale; +// Aurora Sim // // Functions @@ -146,6 +152,11 @@ void LLWorld::destroyClass() } } +void LLWorld::setRegionWidth(const U32 width) +{ + mWidth = width ? width : 256; // Width of 0 is really 256 + mWidthInMeters = mWidth * mScale; +} LLViewerRegion* LLWorld::addRegion(const U64 ®ion_handle, const LLHost &host) { @@ -180,8 +191,12 @@ LLViewerRegion* LLWorld::addRegion(const U64 ®ion_handle, const LLHost &host) U32 iindex = 0; U32 jindex = 0; from_region_handle(region_handle, &iindex, &jindex); - S32 x = (S32)(iindex/mWidth); - S32 y = (S32)(jindex/mWidth); +// Aurora Sim + //S32 x = (S32)(iindex/mWidth); + //S32 y = (S32)(jindex/mWidth); + S32 x = (S32)(iindex/256); //MegaRegion + S32 y = (S32)(jindex/256); //MegaRegion +// Aurora Sim llinfos << "Adding new region (" << x << ":" << y << ")" << llendl; llinfos << "Host: " << host << llendl; @@ -231,13 +246,43 @@ LLViewerRegion* LLWorld::addRegion(const U64 ®ion_handle, const LLHost &host) { adj_x = region_x + width * gDirAxes[dir][0]; adj_y = region_y + width * gDirAxes[dir][1]; - to_region_handle(adj_x, adj_y, &adj_handle); - neighborp = getRegionFromHandle(adj_handle); - if (neighborp) + if (mWidth == 256) { - //llinfos << "Connecting " << region_x << ":" << region_y << " -> " << adj_x << ":" << adj_y << llendl; - regionp->connectNeighbor(neighborp, dir); + to_region_handle(adj_x, adj_y, &adj_handle); + neighborp = getRegionFromHandle(adj_handle); + if (neighborp) + { + //llinfos << "Connecting " << region_x << ":" << region_y << " -> " << adj_x << ":" << adj_y << llendl; + regionp->connectNeighbor(neighborp, dir); + } + } + else // Unconventional region size + { + LLViewerRegion* last_neighborp = NULL; + if(gDirAxes[dir][0] < 0) adj_x = region_x - WORLD_PATCH_SIZE; + if(gDirAxes[dir][1] < 0) adj_y = region_y - WORLD_PATCH_SIZE; + + for (S32 offset = 0; offset < width; offset += WORLD_PATCH_SIZE) + { + to_region_handle(adj_x, adj_y, &adj_handle); + neighborp = getRegionFromHandle(adj_handle); + + if (neighborp && last_neighborp != neighborp) + { + //llinfos << "Connecting " << region_x << ":" << region_y << " -> " << adj_x << ":" << adj_y << llendl; + regionp->connectNeighbor(neighborp, dir); + last_neighborp = neighborp; + } + + if (dir == NORTH || dir == SOUTH) + adj_x += WORLD_PATCH_SIZE; + else if (dir == EAST || dir == WEST) + adj_y += WORLD_PATCH_SIZE; + else if (dir == NORTHEAST || dir == NORTHWEST || dir == SOUTHWEST || dir == SOUTHEAST) + break; + + } } } @@ -409,11 +454,24 @@ LLVector3d LLWorld::clipToVisibleRegions(const LLVector3d &start_pos, const LLVe LLViewerRegion* LLWorld::getRegionFromHandle(const U64 &handle) { +// Aurora Sim + U32 x, y; + from_region_handle(handle, &x, &y); +// Aurora Sim + for (region_list_t::iterator iter = mRegionList.begin(); iter != mRegionList.end(); ++iter) { LLViewerRegion* regionp = *iter; - if (regionp->getHandle() == handle) +// Aurora Sim + //if (regionp->getHandle() == handle) + U32 checkRegionX, checkRegionY; + F32 checkRegionWidth = regionp->getWidth(); + from_region_handle(regionp->getHandle(), &checkRegionX, &checkRegionY); + + if (x >= checkRegionX && x < (checkRegionX + checkRegionWidth) && + y >= checkRegionY && y < (checkRegionY + checkRegionWidth)) +// Aurora Sim { return regionp; } @@ -862,7 +920,10 @@ F32 LLWorld::getLandFarClip() const void LLWorld::setLandFarClip(const F32 far_clip) { - static S32 const rwidth = (S32)REGION_WIDTH_U32; +// Aurora Sim + //static S32 const rwidth = (S32)REGION_WIDTH_U32; + S32 const rwidth = (S32)getRegionWidthInMeters(); +// Aurora Sim S32 const n1 = (llceil(mLandFarClip) - 1) / rwidth; S32 const n2 = (llceil(far_clip) - 1) / rwidth; bool need_water_objects_update = n1 != n2; @@ -937,8 +998,10 @@ void LLWorld::updateWaterObjects() return; } + LLViewerRegion const* regionp = gAgent.getRegion(); + // Region width in meters. - S32 const rwidth = (S32)REGION_WIDTH_U32; + S32 const rwidth = (S32)regionp->getWidth(); // The distance we might see into the void // when standing on the edge of a region, in meters. @@ -955,15 +1018,14 @@ void LLWorld::updateWaterObjects() S32 const range = nsims * rwidth; // Get South-West corner of current region. - LLViewerRegion const* regionp = gAgent.getRegion(); U32 region_x, region_y; from_region_handle(regionp->getHandle(), ®ion_x, ®ion_y); // The min. and max. coordinates of the South-West corners of the Hole water objects. S32 const min_x = (S32)region_x - range; S32 const min_y = (S32)region_y - range; - S32 const max_x = (S32)region_x + range; - S32 const max_y = (S32)region_y + range; + S32 const max_x = (S32)region_x + rwidth-256 + range; + S32 const max_y = (S32)region_y + rwidth-256 + range; // Attempt to determine a sensible water height for all the // Hole Water objects. @@ -1142,19 +1204,19 @@ void LLWorld::updateWaterObjects() // the current regions water height. F32 const box_height = 1024; F32 const water_center_z = water_height + box_height / 2; - + const S32 step = 256; // Create new Hole water objects within 'range' where there is no region. - for (S32 x = min_x; x <= max_x; x += rwidth) + for (S32 x = min_x; x <= max_x; x += step) { - for (S32 y = min_y; y <= max_y; y += rwidth) + for (S32 y = min_y; y <= max_y; y += step) { U64 region_handle = to_region_handle(x, y); if (!getRegionFromHandle(region_handle)) { LLVOWater* waterp = (LLVOWater*)gObjectList.createObjectViewer(LLViewerObject::LL_VO_VOID_WATER, gAgent.getRegion()); waterp->setUseTexture(FALSE); - waterp->setPositionGlobal(LLVector3d(x + rwidth / 2, y + rwidth / 2, water_center_z)); - waterp->setScale(LLVector3((F32)rwidth, (F32)rwidth, box_height)); + waterp->setPositionGlobal(LLVector3d(x + step / 2, y + step / 2, water_center_z)); + waterp->setScale(LLVector3((F32)step, (F32)step, box_height)); gPipeline.createObject(waterp); mHoleWaterObjects.push_back(waterp); } @@ -1162,10 +1224,10 @@ void LLWorld::updateWaterObjects() } // Center of the region. - S32 const center_x = region_x + rwidth / 2; - S32 const center_y = region_y + rwidth / 2; + S32 const center_x = region_x + step / 2; + S32 const center_y = region_y + step / 2; // Width of the area with Hole water objects. - S32 const width = rwidth + 2 * range; + S32 const width = step + 2 * range; S32 const horizon_extend = 2048 + 512 - range; // Legacy value. // The overlap is needed to get rid of sky pixels being visible between the // Edge and Hole water object at greater distances (due to floating point @@ -1296,6 +1358,11 @@ void process_enable_simulator(LLMessageSystem *msg, void **user_data) // Viewer trusts the simulator. msg->enableCircuit(sim, TRUE); +// Aurora Sim + U32 region_size_x = 256; + msg->getU32Fast(_PREHASH_SimulatorInfo, _PREHASH_RegionSizeX, region_size_x); + LLWorld::getInstance()->setRegionWidth(region_size_x); +// Aurora Sim LLWorld::getInstance()->addRegion(handle, sim); // give the simulator a message it can use to get ip and port diff --git a/indra/newview/llworld.h b/indra/newview/llworld.h index 8cdaeae4e..291159540 100644 --- a/indra/newview/llworld.h +++ b/indra/newview/llworld.h @@ -114,6 +114,9 @@ public: LLSurfacePatch * resolveLandPatchGlobal(const LLVector3d &position); LLVector3 resolveLandNormalGlobal(const LLVector3d &position); // absolute frame + // update region size + void setRegionWidth(const U32 width = 0); + U32 getRegionWidthInPoints() const { return mWidth; } F32 getRegionScale() const { return mScale; } @@ -182,12 +185,18 @@ private: region_remove_signal_t mRegionRemovedSignal; // Number of points on edge - static const U32 mWidth; +// Aurora Sim + //static const U32 mWidth; + static U32 mWidth; +// Aurora Sim // meters/point, therefore mWidth * mScale = meters per edge static const F32 mScale; - static const F32 mWidthInMeters; +// Aurora Sim + //static const F32 mWidthInMeters; + static F32 mWidthInMeters; +// Aurora Sim F32 mLandFarClip; // Far clip distance for land. LLPatchVertexArray mLandPatch; diff --git a/indra/newview/llworldmap.cpp b/indra/newview/llworldmap.cpp index b153cfafd..a5d1a9c28 100644 --- a/indra/newview/llworldmap.cpp +++ b/indra/newview/llworldmap.cpp @@ -43,6 +43,7 @@ #include "llmapresponders.h" #include "llviewercontrol.h" #include "llfloaterworldmap.h" +#include "lltexturecache.h" #include "lltracker.h" #include "llviewertexturelist.h" #include "llviewerregion.h" @@ -84,20 +85,27 @@ LLSimInfo::LLSimInfo(U64 handle) mAccess(0x0), mRegionFlags(0x0), mFirstAgentRequest(true), +// Aurora Sim mSizeX(REGION_WIDTH_UNITS), mSizeY(REGION_WIDTH_UNITS), +// Aurora Sim mAlpha(0.f) { } void LLSimInfo::setLandForSaleImage (LLUUID image_id) { + const bool is_aurora = gHippoGridManager->getConnectedGrid()->isAurora(); + if (is_aurora && mMapImageID[SIM_LAYER_OVERLAY].isNull() && image_id.notNull() && gTextureList.findImage(image_id)) + LLAppViewer::getTextureCache()->removeFromCache(image_id); + mMapImageID[SIM_LAYER_OVERLAY] = image_id; // Fetch the image if (mMapImageID[SIM_LAYER_OVERLAY].notNull()) { mLayerImage[SIM_LAYER_OVERLAY] = LLViewerTextureManager::getFetchedTexture(mMapImageID[SIM_LAYER_OVERLAY], MIPMAP_TRUE, LLGLTexture::BOOST_MAP, LLViewerTexture::LOD_TEXTURE); + if (is_aurora) mLayerImage[SIM_LAYER_OVERLAY]->forceImmediateUpdate(); mLayerImage[SIM_LAYER_OVERLAY]->setAddressMode(LLTexUnit::TAM_CLAMP); } else @@ -376,11 +384,28 @@ LLSimInfo* LLWorldMap::simInfoFromPosGlobal(const LLVector3d& pos_global) LLSimInfo* LLWorldMap::simInfoFromHandle(const U64 handle) { - sim_info_map_t::iterator it = mSimInfoMap.find(handle); + sim_info_map_t::const_iterator it = mSimInfoMap.find(handle); if (it != mSimInfoMap.end()) { return it->second; } + +// Aurora Sim + U32 x = 0, y = 0; + from_region_handle(handle, &x, &y); + for (it = mSimInfoMap.begin(); it != mSimInfoMap.end(); ++it) + { + U32 checkRegionX, checkRegionY; + from_region_handle((*it).first, &checkRegionX, &checkRegionY); + + LLSimInfo* info = (*it).second; + if (x >= checkRegionX && x < (checkRegionX + info->getSizeX()) && + y >= checkRegionY && y < (checkRegionY + info->getSizeY())) + { + return info; + } + } +// Aurora Sim return NULL; } @@ -538,7 +563,10 @@ void LLWorldMap::reloadItems(bool force) // static public // Insert a region in the region map // returns true if region inserted, false otherwise -bool LLWorldMap::insertRegion(U32 x_world, U32 y_world, U32 x_size, U32 y_size, U32 agent_flags, std::string& name, LLUUID& image_id, U32 accesscode, U32 region_flags) +// Aurora Sim +//bool LLWorldMap::insertRegion(U32 x_world, U32 y_world, std::string& name, LLUUID& image_id, U32 accesscode, U64 region_flags) +bool LLWorldMap::insertRegion(U32 x_world, U32 y_world, U16 x_size, U16 y_size, std::string& name, LLUUID& image_id, U32 accesscode, U64 region_flags) +// Aurora Sim { // This region doesn't exist if (accesscode == 255) @@ -562,17 +590,14 @@ bool LLWorldMap::insertRegion(U32 x_world, U32 y_world, U32 x_size, U32 y_size, { siminfo = LLWorldMap::getInstance()->createSimInfoFromHandle(handle); } - - siminfo->setName( name ); - siminfo->setAccess( accesscode ); - siminfo->setRegionFlags( region_flags ); - //siminfo->setWaterHeight((F32) water_height); - U32 layer = flagsToLayer(agent_flags); - if (layer == SIM_LAYER_OVERLAY) - siminfo->setLandForSaleImage(image_id); - else if(layer < SIM_LAYER_COUNT) - siminfo->setMapImageID( image_id, layer ); - siminfo->setSize( x_size, y_size ); + siminfo->setName(name); + siminfo->setAccess(accesscode); + siminfo->setRegionFlags(region_flags); + // siminfo->setWaterHeight((F32) water_height); + siminfo->setLandForSaleImage(image_id); +// Aurora Sim + siminfo->setSize(x_size, y_size); +// Aurora Sim // Handle the location tracking (for teleport, UI feedback and info display) if (LLWorldMap::getInstance()->isTrackingInRectangle( x_world, y_world, x_world + REGION_WIDTH_UNITS, y_world + REGION_WIDTH_UNITS)) diff --git a/indra/newview/llworldmap.h b/indra/newview/llworldmap.h index fd654316d..7037d9f05 100644 --- a/indra/newview/llworldmap.h +++ b/indra/newview/llworldmap.h @@ -142,9 +142,11 @@ public: // Setters void setName(std::string& name) { mName = name; } +// Aurora Sim + void setSize(U16 sizeX, U16 sizeY) { mSizeX = sizeX; mSizeY = sizeY; } +// Aurora Sim void setAccess (U32 accesscode) { mAccess = accesscode; } void setRegionFlags (U32 region_flags) { mRegionFlags = region_flags; } - void setSize(U16 sizeX, U16 sizeY) { mSizeX = sizeX; mSizeY = sizeY; } void setAlpha(F32 alpha) { mAlpha = alpha; } void setLandForSaleImage (LLUUID image_id); @@ -160,8 +162,11 @@ public: LLPointer getLandForSaleImage(); // Get the overlay image, fetch it if necessary const F32 getAlpha() const { return mAlpha; } +// Aurora Sim + const U64& getHandle() const { return mHandle; } const U16 getSizeX() const { return mSizeX; } const U16 getSizeY() const { return mSizeY; } +// Aurora Sim bool isName(const std::string& name) const; bool isDown() { return (mAccess == SIM_ACCESS_DOWN); } bool isPG() { return (mAccess <= SIM_ACCESS_PG); } @@ -193,7 +198,12 @@ public: const LLSimInfo::item_info_list_t& getAgentLocation() const { return mAgentLocations; } private: - U64 mHandle; + U64 mHandle; // This is a hash of the X and Y world coordinates of the SW corner of the sim +// Aurora Sim + U16 mSizeX; + U16 mSizeY; +// Aurora Sim + std::string mName; F64 mAgentsUpdateTime; // Time stamp giving the last time the agents information was requested for that region @@ -201,8 +211,6 @@ private: U32 mAccess; // Down/up and maturity rating of the region U32 mRegionFlags; - U16 mSizeX; - U16 mSizeY; F32 mAlpha; @@ -235,8 +243,12 @@ struct LLWorldMapLayer // We request region data on the world by "blocks" of (MAP_BLOCK_SIZE x MAP_BLOCK_SIZE) regions // This is to reduce the number of requests to the asset DB and get things in big "blocks" -const S32 MAP_MAX_SIZE = 2048; -const S32 MAP_BLOCK_SIZE = 4; +// Aurora Sim +//const S32 MAP_MAX_SIZE = 2048; +//const S32 MAP_BLOCK_SIZE = 4; +const S32 MAP_MAX_SIZE = 16384; +const S32 MAP_BLOCK_SIZE = 16; +// Aurora Sim const S32 MAP_BLOCK_RES = (MAP_MAX_SIZE / MAP_BLOCK_SIZE); class LLWorldMap : public LLSingleton @@ -262,7 +274,10 @@ public: // Insert a region and items in the map global instance // Note: x_world and y_world in world coordinates (meters) - static bool insertRegion(U32 x_world, U32 y_world, U32 x_size, U32 y_size, U32 agent_flags, std::string& name, LLUUID& image_id, U32 accesscode, U32 region_flags); +// Aurora Sim + static bool insertRegion(U32 x_world, U32 y_world, std::string& name, LLUUID& uuid, U32 accesscode, U64 region_flags); + static bool insertRegion(U32 x_world, U32 y_world, U16 x_size, U16 y_size, std::string& name, LLUUID& uuid, U32 accesscode, U64 region_flags); +// Aurora Sim static bool insertItem(U32 x_world, U32 y_world, std::string& name, LLUUID& uuid, U32 type, S32 extra, S32 extra2); // Get info on sims (region) : note that those methods only search the range of loaded sims (the one that are being browsed) diff --git a/indra/newview/llworldmapmessage.cpp b/indra/newview/llworldmapmessage.cpp index 5729bcb11..d7eaaafb6 100644 --- a/indra/newview/llworldmapmessage.cpp +++ b/indra/newview/llworldmapmessage.cpp @@ -170,8 +170,10 @@ void LLWorldMapMessage::processMapBlockReply(LLMessageSystem* msg, void**) { U16 x_regions; U16 y_regions; +// Aurora Sim U16 x_size = 256; U16 y_size = 256; +// Aurora Sim std::string name; U8 accesscode; U32 region_flags; @@ -186,6 +188,7 @@ void LLWorldMapMessage::processMapBlockReply(LLMessageSystem* msg, void**) // msg->getU8Fast(_PREHASH_Data, _PREHASH_WaterHeight, water_height, block); // msg->getU8Fast(_PREHASH_Data, _PREHASH_Agents, agents, block); msg->getUUIDFast(_PREHASH_Data, _PREHASH_MapImageID, image_id, block); +// Aurora Sim if(msg->getNumberOfBlocksFast(_PREHASH_Size) > 0) { msg->getU16Fast(_PREHASH_Size, _PREHASH_SizeX, x_size, block); @@ -196,6 +199,7 @@ void LLWorldMapMessage::processMapBlockReply(LLMessageSystem* msg, void**) x_size = 256; y_size = 256; } +// Aurora Sim U32 x_world = (U32)(x_regions) * REGION_WIDTH_UNITS; U32 y_world = (U32)(y_regions) * REGION_WIDTH_UNITS; @@ -209,7 +213,10 @@ void LLWorldMapMessage::processMapBlockReply(LLMessageSystem* msg, void**) continue; // Insert that region in the world map, if failure, flag it as a "null_sim" - if (!(LLWorldMap::getInstance()->insertRegion(x_world, y_world, x_size, y_size, agent_flags, name, image_id, (U32)accesscode, region_flags))) +// Aurora Sim + //if (!(LLWorldMap::getInstance()->insertRegion(x_world, y_world, name, image_id, (U32)accesscode, region_flags))) + if (!(LLWorldMap::getInstance()->insertRegion(x_world, y_world, x_size, y_size, name, image_id, (U32)accesscode, region_flags))) +// Aurora Sim { found_null_sim = true; } diff --git a/indra/newview/llworldmapview.cpp b/indra/newview/llworldmapview.cpp index 66c395bd6..4c02d875e 100644 --- a/indra/newview/llworldmapview.cpp +++ b/indra/newview/llworldmapview.cpp @@ -513,25 +513,7 @@ void LLWorldMapView::draw() static const LLCachedControl show_avs("LiruMapShowAvCount"); if (show_avs) mesg += llformat(" (%d)", info->getAgentCount()); - U8 access = info->getAccess(); - switch(access) - { - case SIM_ACCESS_MIN: - mesg += " (Min)"; - break; - case SIM_ACCESS_PG: - mesg += " (PG)"; - break; - case SIM_ACCESS_MATURE: - mesg += " (Mature)"; - break; - case SIM_ACCESS_ADULT: - mesg += " (Adult)"; - break; - default: - mesg += llformat(" (Access=%d)",access); - break; - } + mesg += llformat(" (%s)", info->getAccessString().c_str()); } // if (!mesg.empty()) // [RLVa:KB] - Checked: 2012-02-08 (RLVa-1.4.5) | Added: RLVa-1.4.5 @@ -1222,7 +1204,7 @@ void LLWorldMapView::drawAgents() { F32 agents_scale = (sMapScale * 0.9f) / 256.f; - LLColor4 avatar_color = gColors.getColor( "MapAvatar" ); + LLColor4 avatar_color = gSavedSettings.getColor( "MapAvatar" ); // LLColor4 friend_color = gColors.getColor( "MapFriend" ); for (handle_list_t::iterator iter = mVisibleRegions.begin(); iter != mVisibleRegions.end(); ++iter) @@ -2155,6 +2137,7 @@ BOOL LLWorldMapView::handleDoubleClick( S32 x, S32 y, MASK mask ) } default: { + if (!gSavedSettings.getBOOL("DoubleClickTeleportMap")) return true; if (LLWorldMap::getInstance()->isTracking()) { LLWorldMap::getInstance()->setTrackingDoubleClick(); diff --git a/indra/newview/noise.h b/indra/newview/noise.h index d324c52e4..0cc558a8e 100644 --- a/indra/newview/noise.h +++ b/indra/newview/noise.h @@ -316,6 +316,8 @@ static void normalize3(F32 v[3]) static void init(void) { + // we want repeatable noise (e.g. for stable terrain texturing), so seed with known value + srand(42); int i, j, k; for (i = 0 ; i < B ; i++) { @@ -346,6 +348,9 @@ static void init(void) for (j = 0 ; j < 3 ; j++) g3[B + i][j] = g3[i][j]; } + + // reintroduce entropy + srand(time(NULL)); // Flawfinder: ignore } #undef B diff --git a/indra/newview/rlvdefines.h b/indra/newview/rlvdefines.h index 9f559233e..9e000ddbd 100644 --- a/indra/newview/rlvdefines.h +++ b/indra/newview/rlvdefines.h @@ -75,7 +75,7 @@ const S32 RLV_VERSION_BUILD = 0; // Implementation version const S32 RLVa_VERSION_MAJOR = 1; const S32 RLVa_VERSION_MINOR = 4; -const S32 RLVa_VERSION_PATCH = 5; +const S32 RLVa_VERSION_PATCH = 8; const S32 RLVa_VERSION_BUILD = 0; // Uncomment before a final release diff --git a/indra/newview/rlvui.cpp b/indra/newview/rlvui.cpp index aadfc20ed..a434ad026 100644 --- a/indra/newview/rlvui.cpp +++ b/indra/newview/rlvui.cpp @@ -29,6 +29,7 @@ #include "llvoavatar.h" #include "roles_constants.h" // Group "powers" +#include "lffloaterinvpanel.h" #include "llfloaterbeacons.h" #include "llfloatertools.h" #include "llfloaterenvsettings.h" @@ -208,6 +209,7 @@ void RlvUIEnabler::onToggleShowInv(bool fQuitting) if (!fEnable) { LLInventoryView::closeAll(); + LFFloaterInvPanel::closeAll(); } } diff --git a/indra/newview/skins/apollo/keywords.ini b/indra/newview/skins/apollo/keywords.ini index cecc8631a..fd30d7cf5 100644 --- a/indra/newview/skins/apollo/keywords.ini +++ b/indra/newview/skins/apollo/keywords.ini @@ -2,128 +2,128 @@ llkeywords version 2 # sections [word .648, .882, .179] -default Name of default state that all scripts must have -state Keyword to indicate state block or state transition +default Name of default state that all scripts must have +state Keyword to indicate state block or state transition # data types [word .398, .847, .933] -integer Integer type -float Floating-point type -string String type -key Key type. Use NULL_KEY to test for empty keys -vector Vector type of 3 floats. Used to represent 3D motion, Euler angles, and color.:Access components by .x, .y. or .z -rotation Rotation type of 4 floats. Used to represent rotation.:Access components by .x, .y., .z, or .w -list List of various data types -quaternion Rotation type of 4 floats. Used to represent rotation.:Access components by .x, .y, .z, or .w +integer Integer type +float Floating-point type +string String type +key Key type. Use NULL_KEY to test for empty keys +vector Vector type of 3 floats. Used to represent 3D motion, Euler angles, and color.:Access components by .x, .y. or .z +rotation Rotation type of 4 floats. Used to represent rotation.:Access components by .x, .y., .z, or .w +list List of various data types +quaternion Rotation type of 4 floats. Used to represent rotation.:Access components by .x, .y, .z, or .w # events [word .398, .847, .933] -state_entry state_entry():Triggered on any state transition and startup -state_exit state_exit():Triggered on any state transition -touch_start touch_start(integer num_detected):Triggered by the start of agent clicking on task -touch touch(integer num_detected):Triggered while agent is clicking on task -touch_end touch_end(integer num_detected):Triggered when agent stops clicking on task -collision_start collision_start(integer num_detected):Triggered when task starts colliding with another task -collision collision(integer num_detected):Triggered while task is colliding with another task -collision_end collision_end(integer num_detected):Triggered when task stops colliding with another task -land_collision_start land_collision_start(vector pos):Triggered when task starts colliding with land -land_collision land_collision(vector pos):Triggered when task is colliding with land -land_collision_end land_collision_end(vector pos):Triggered when task stops colliding with land -timer timer():Result of the llSetTimerEvent library function call -listen listen(integer channel, string name, key id, string message):Result of the llListen library function call -sensor sensor(integer num_detected):Result of the llSensor library function call -no_sensor no_sensor():Result of the llSensor library function call -control control(key id, integer level, integer edge):Result of llTakeControls library function call -at_target at_target(integer tnum, vector targetpos, vector ourpos):Result of llTarget library function call -not_at_target not_at_target():Result of llTarget library function call -at_rot_target at_rot_target(integer tnum, rotation targetrot, rotation ourrot):Result of LLRotTarget library function call -not_at_rot_target not_at_rot_target():Result of LLRotTarget library function call -money money(key id, integer amount):Triggered when L$ is given to task -email email(string time, string address, string subj, string message, integer num_left):Triggered when task receives email -run_time_permissions run_time_permissions(integer perm):Triggered when an agent grants run time permissions to task -attach attach(key id):Triggered when task attaches or detaches from agent -dataserver dataserver(key queryid, string data):Triggered when task receives asynchronous data -moving_start moving_start():Triggered when task begins moving -moving_end moving_end():Triggered when task stops moving -on_rez on_rez(integer start_param):Triggered when task is rezzed in from inventory or another task -object_rez object_rez(key id):Triggered when task rezzes in another task -link_message link_message(integer sender_num, integer num, string str, key id):Triggered when task receives a link message via LLMessageLinked library function call -changed changed( integer change ):Triggered various event change the task:(test change with CHANGED_INVENTORY, CHANGED_COLOR, CHANGED_SHAPE, CHANGED_SCALE, CHANGED_TEXTURE, CHANGED_LINK, CHANGED_ALLOWED_DROP, CHANGED_OWNER, CHANGED_REGION, CHANGED_TELEPORT, CHANGED_REGION_START, CHANGED_MEDIA) -remote_data remote_data(integer event_type, key channel, key message_id, string sender,integer idata, string sdata):Triggered by various XML-RPC calls (event_type will be one of REMOTE_DATA_CHANNEL, REMOTE_DATA_REQUEST, REMOTE_DATA_REPLY) -http_response http_response(key request_id, integer status, list metadata, string body):Triggered when task receives a response to one of its llHTTPRequests -http_request http_request(key id, string method, string body):Triggered when task receives an http request against a public URL -transaction_result transaction_result(key id, integer success, string data): Triggered when currency is given to task -path_update path_update(integer type, list reserved):Triggered when the state of a pathfinder character changes. Note; "list reserved" is not currently used +state_entry state_entry():Triggered on any state transition and startup +state_exit state_exit():Triggered on any state transition +touch_start touch_start(integer num_detected):Triggered by the start of agent clicking on task +touch touch(integer num_detected):Triggered while agent is clicking on task +touch_end touch_end(integer num_detected):Triggered when agent stops clicking on task +collision_start collision_start(integer num_detected):Triggered when task starts colliding with another task +collision collision(integer num_detected):Triggered while task is colliding with another task +collision_end collision_end(integer num_detected):Triggered when task stops colliding with another task +land_collision_start land_collision_start(vector pos):Triggered when task starts colliding with land +land_collision land_collision(vector pos):Triggered when task is colliding with land +land_collision_end land_collision_end(vector pos):Triggered when task stops colliding with land +timer timer():Result of the llSetTimerEvent library function call +listen listen(integer channel, string name, key id, string message):Result of the llListen library function call +sensor sensor(integer num_detected):Result of the llSensor library function call +no_sensor no_sensor():Result of the llSensor library function call +control control(key id, integer level, integer edge):Result of llTakeControls library function call +at_target at_target(integer tnum, vector targetpos, vector ourpos):Result of llTarget library function call +not_at_target not_at_target():Result of llTarget library function call +at_rot_target at_rot_target(integer tnum, rotation targetrot, rotation ourrot):Result of LLRotTarget library function call +not_at_rot_target not_at_rot_target():Result of LLRotTarget library function call +money money(key id, integer amount):Triggered when L$ is given to task +email email(string time, string address, string subj, string message, integer num_left):Triggered when task receives email +run_time_permissions run_time_permissions(integer perm):Triggered when an agent grants run time permissions to task +attach attach(key id):Triggered when task attaches or detaches from agent +dataserver dataserver(key queryid, string data):Triggered when task receives asynchronous data +moving_start moving_start():Triggered when task begins moving +moving_end moving_end():Triggered when task stops moving +on_rez on_rez(integer start_param):Triggered when task is rezzed in from inventory or another task +object_rez object_rez(key id):Triggered when task rezzes in another task +link_message link_message(integer sender_num, integer num, string str, key id):Triggered when task receives a link message via LLMessageLinked library function call +changed changed( integer change ):Triggered various event change the task:(test change with CHANGED_INVENTORY, CHANGED_COLOR, CHANGED_SHAPE, CHANGED_SCALE, CHANGED_TEXTURE, CHANGED_LINK, CHANGED_ALLOWED_DROP, CHANGED_OWNER, CHANGED_REGION, CHANGED_TELEPORT, CHANGED_REGION_START, CHANGED_MEDIA) +remote_data remote_data(integer event_type, key channel, key message_id, string sender,integer idata, string sdata):Triggered by various XML-RPC calls (event_type will be one of REMOTE_DATA_CHANNEL, REMOTE_DATA_REQUEST, REMOTE_DATA_REPLY) +http_response http_response(key request_id, integer status, list metadata, string body):Triggered when task receives a response to one of its llHTTPRequests +http_request http_request(key id, string method, string body):Triggered when task receives an http request against a public URL +transaction_result transaction_result(key id, integer success, string data): Triggered when currency is given to task +path_update path_update(integer type, list reserved):Triggered when the state of a pathfinder character changes. Note; "list reserved" is not currently used # integer constants [word .679, .503, .996] -TRUE Integer constant for Boolean operations -FALSE Integer constant for Boolean operations -STATUS_PHYSICS Passed in the llSetStatus library function. If TRUE, object moves physically -STATUS_PHANTOM Passed in the llSetStatus library function. If TRUE, object doesn't collide with other objects -STATUS_ROTATE_X Passed in the llSetStatus library function. If FALSE, object doesn't rotate around local X axis -STATUS_ROTATE_Y Passed in the llSetStatus library function. If FALSE, object doesn't rotate around local Y axis -STATUS_ROTATE_Z Passed in the llSetStatus library function. If FALSE, object doesn't rotate around local Z axis -STATUS_SANDBOX Passed in the llSetStatus library function. If TRUE, object can't cross region boundaries or move more than 10 meters from its start location -STATUS_BLOCK_GRAB Passed in the llSetStatus library function. If TRUE, object can't be grabbed and physically dragged +TRUE Integer constant for Boolean operations +FALSE Integer constant for Boolean operations +STATUS_PHYSICS Passed in the llSetStatus library function. If TRUE, object moves physically +STATUS_PHANTOM Passed in the llSetStatus library function. If TRUE, object doesn't collide with other objects +STATUS_ROTATE_X Passed in the llSetStatus library function. If FALSE, object doesn't rotate around local X axis +STATUS_ROTATE_Y Passed in the llSetStatus library function. If FALSE, object doesn't rotate around local Y axis +STATUS_ROTATE_Z Passed in the llSetStatus library function. If FALSE, object doesn't rotate around local Z axis +STATUS_SANDBOX Passed in the llSetStatus library function. If TRUE, object can't cross region boundaries or move more than 10 meters from its start location +STATUS_BLOCK_GRAB Passed in the llSetStatus library function. If TRUE, object can't be grabbed and physically dragged STATUS_BLOCK_GRAB_OBJECT This status flag keeps the object from being moved by grabs. This flag applies to the entire linkset -STATUS_DIE_AT_EDGE Passed in the llSetStatus library function. If TRUE, objects that reach the edge of the world just die:rather than teleporting back to the owner -STATUS_RETURN_AT_EDGE Passed in the llSetStatus library function. If TRUE, script rezzed objects that reach the edge of the world:are returned rather than killed:STATUS_RETURN_AT_EDGE trumps STATUS_DIE_AT_EDGE if both are set -STATUS_CAST_SHADOWS Passed in the llSetStatus library function. If TRUE, object casts shadows on other objects +STATUS_DIE_AT_EDGE Passed in the llSetStatus library function. If TRUE, objects that reach the edge of the world just die:rather than teleporting back to the owner +STATUS_RETURN_AT_EDGE Passed in the llSetStatus library function. If TRUE, script rezzed objects that reach the edge of the world:are returned rather than killed:STATUS_RETURN_AT_EDGE trumps STATUS_DIE_AT_EDGE if both are set +STATUS_CAST_SHADOWS Passed in the llSetStatus library function. If TRUE, object casts shadows on other objects -AGENT Passed in llSensor library function to look for other Agents; DEPRECATED: Use AGENT_BY_LEGACY_NAME -AGENT_BY_LEGACY_NAME Passed in llSensor library function to look for other Agents by legacy name -AGENT_BY_USERNAME Passed in llSensor library function to look for other Agents by username -ACTIVE Passed in llSensor library function to look for moving objects -PASSIVE Passed in llSensor library function to look for objects that aren't moving -SCRIPTED Passed in llSensor library function to look for scripted objects -CONTROL_FWD Passed to llTakeControls library function and used control event handler to test for agent forward control -CONTROL_BACK Passed to llTakeControls library function and used control event handler to test for agent back control -CONTROL_LEFT Passed to llTakeControls library function and used control event handler to test for agent left control -CONTROL_RIGHT Passed to llTakeControls library function and used control event handler to test for agent right control -CONTROL_ROT_LEFT Passed to llTakeControls library function and used control event handler to test for agent rotate left control -CONTROL_ROT_RIGHT Passed to llTakeControls library function and used control event handler to test for agent rotate right control -CONTROL_UP Passed to llTakeControls library function and used control event handler to test for agent up control -CONTROL_DOWN Passed to llTakeControls library function and used control event handler to test for agent down control -CONTROL_LBUTTON Passed to llTakeControls library function and used control event handler to test for agent left button control -CONTROL_ML_LBUTTON Passed to llTakeControls library function and used control event handler to test for agent left button control with the agent in mouse look -PERMISSION_DEBIT Passed to llRequestPermissions library function to request permission to take L$ from agent's account -PERMISSION_TAKE_CONTROLS Passed to llRequestPermissions library function to request permission to take agent's controls -# PERMISSION_REMAP_CONTROLS Passed to llRequestPermissions library function to request permission to remap agent's controls (not implemented yet) -PERMISSION_TRIGGER_ANIMATION Passed to llRequestPermissions library function to request permission to trigger animation on agent -PERMISSION_ATTACH Passed to llRequestPermissions library function to request permission to attach/detach from agent -# PERMISSION_RELEASE_OWNERSHIP Passed to llRequestPermissions library function to request permission to release ownership (not implemented) -PERMISSION_CHANGE_LINKS Passed to llRequestPermissions library function to request permission to change links -# PERMISSION_CHANGE_JOINTS Passed to llRequestPermissions library function to request permission to change joints (not implemented) +AGENT Passed in llSensor library function to look for other Agents; DEPRECATED: Use AGENT_BY_LEGACY_NAME +AGENT_BY_LEGACY_NAME Passed in llSensor library function to look for other Agents by legacy name +AGENT_BY_USERNAME Passed in llSensor library function to look for other Agents by username +ACTIVE Passed in llSensor library function to look for moving objects +PASSIVE Passed in llSensor library function to look for objects that aren't moving +SCRIPTED Passed in llSensor library function to look for scripted objects +CONTROL_FWD Passed to llTakeControls library function and used control event handler to test for agent forward control +CONTROL_BACK Passed to llTakeControls library function and used control event handler to test for agent back control +CONTROL_LEFT Passed to llTakeControls library function and used control event handler to test for agent left control +CONTROL_RIGHT Passed to llTakeControls library function and used control event handler to test for agent right control +CONTROL_ROT_LEFT Passed to llTakeControls library function and used control event handler to test for agent rotate left control +CONTROL_ROT_RIGHT Passed to llTakeControls library function and used control event handler to test for agent rotate right control +CONTROL_UP Passed to llTakeControls library function and used control event handler to test for agent up control +CONTROL_DOWN Passed to llTakeControls library function and used control event handler to test for agent down control +CONTROL_LBUTTON Passed to llTakeControls library function and used control event handler to test for agent left button control +CONTROL_ML_LBUTTON Passed to llTakeControls library function and used control event handler to test for agent left button control with the agent in mouse look +PERMISSION_DEBIT Passed to llRequestPermissions library function to request permission to take L$ from agent's account +PERMISSION_TAKE_CONTROLS Passed to llRequestPermissions library function to request permission to take agent's controls +# PERMISSION_REMAP_CONTROLS Passed to llRequestPermissions library function to request permission to remap agent's controls (not implemented yet) +PERMISSION_TRIGGER_ANIMATION Passed to llRequestPermissions library function to request permission to trigger animation on agent +PERMISSION_ATTACH Passed to llRequestPermissions library function to request permission to attach/detach from agent +# PERMISSION_RELEASE_OWNERSHIP Passed to llRequestPermissions library function to request permission to release ownership (not implemented) +PERMISSION_CHANGE_LINKS Passed to llRequestPermissions library function to request permission to change links +# PERMISSION_CHANGE_JOINTS Passed to llRequestPermissions library function to request permission to change joints (not implemented) # PERMISSION_CHANGE_PERMISSIONS Passed to llRequestPermissions library function to request permission to change permissions -PERMISSION_TRACK_CAMERA Passed to llRequestPermissions library function to request permission to track agent's camera -PERMISSION_CONTROL_CAMERA Passed to llRequestPermissions library function to request permission to change agent's camera -PERMISSION_TELEPORT Passed to llRequestPermissions library function to request permission to teleport agent -SCRIPT_PERMISSION_SILENT_ESTATE_MANAGEMENT Passed to llRequestPermissions library function to request permission to silently modify estate access lists -PERMISSION_OVERRIDE_ANIMATIONS Passed to llRequestPermissions library function to request permission to override animations on agent -PERMISSION_RETURN_OBJECTS Passed to llRequestPermissions library function to request permission to return objects +PERMISSION_TRACK_CAMERA Passed to llRequestPermissions library function to request permission to track agent's camera +PERMISSION_CONTROL_CAMERA Passed to llRequestPermissions library function to request permission to change agent's camera +PERMISSION_TELEPORT Passed to llRequestPermissions library function to request permission to teleport agent +SCRIPT_PERMISSION_SILENT_ESTATE_MANAGEMENT Passed to llRequestPermissions library function to request permission to silently modify estate access lists +PERMISSION_OVERRIDE_ANIMATIONS Passed to llRequestPermissions library function to request permission to override animations on agent +PERMISSION_RETURN_OBJECTS Passed to llRequestPermissions library function to request permission to return objects -DEBUG_CHANNEL Chat channel reserved for debug and error messages from scripts -PUBLIC_CHANNEL Chat channel that broadcasts to all nearby users +DEBUG_CHANNEL Chat channel reserved for debug and error messages from scripts +PUBLIC_CHANNEL Chat channel that broadcasts to all nearby users -AGENT_FLYING Returned by llGetAgentInfo if the Agent is flying -AGENT_ATTACHMENTS Returned by llGetAgentInfo if the Agent has attachments -AGENT_SCRIPTED Returned by llGetAgentInfo if the Agent has scripted attachments -AGENT_SITTING Returned by llGetAgentInfo if the Agent is sitting -AGENT_ON_OBJECT Returned by llGetAgentInfo if the Agent is sitting on an object -AGENT_MOUSELOOK Returned by llGetAgentInfo if the Agent is in mouselook -AGENT_AWAY Returned by llGetAgentInfo if the Agent is in away mode -AGENT_WALKING Returned by llGetAgentInfo if the Agent is walking -AGENT_IN_AIR Returned by llGetAgentInfo if the Agent is in the air -AGENT_TYPING Returned by llGetAgentInfo if the Agent is typing -AGENT_CROUCHING Returned by llGetAgentInfo if the Agent is crouching -AGENT_BUSY Returned by llGetAgentInfo if the Agent is busy -AGENT_ALWAYS_RUN Returned by llGetAgentInfo if the Agent has 'Always Run' enabled -AGENT_AUTOPILOT Returned by llGetAgentInfo if the Agent is under autopilot control +AGENT_FLYING Returned by llGetAgentInfo if the Agent is flying +AGENT_ATTACHMENTS Returned by llGetAgentInfo if the Agent has attachments +AGENT_SCRIPTED Returned by llGetAgentInfo if the Agent has scripted attachments +AGENT_SITTING Returned by llGetAgentInfo if the Agent is sitting +AGENT_ON_OBJECT Returned by llGetAgentInfo if the Agent is sitting on an object +AGENT_MOUSELOOK Returned by llGetAgentInfo if the Agent is in mouselook +AGENT_AWAY Returned by llGetAgentInfo if the Agent is in away mode +AGENT_WALKING Returned by llGetAgentInfo if the Agent is walking +AGENT_IN_AIR Returned by llGetAgentInfo if the Agent is in the air +AGENT_TYPING Returned by llGetAgentInfo if the Agent is typing +AGENT_CROUCHING Returned by llGetAgentInfo if the Agent is crouching +AGENT_BUSY Returned by llGetAgentInfo if the Agent is busy +AGENT_ALWAYS_RUN Returned by llGetAgentInfo if the Agent has 'Always Run' enabled +AGENT_AUTOPILOT Returned by llGetAgentInfo if the Agent is under autopilot control -AGENT_LIST_PARCEL Passed to llGetAgentList to return only agents on the same parcel where the script is running +AGENT_LIST_PARCEL Passed to llGetAgentList to return only agents on the same parcel where the script is running AGENT_LIST_PARCEL_OWNER Passed to llGetAgentList to return only agents on any parcel in the region where the parcel owner is the same as the owner of the parcel under the scripted object -AGENT_LIST_REGION Passed to llGetAgentList to return any/all agents in the region +AGENT_LIST_REGION Passed to llGetAgentList to return any/all agents in the region PSYS_PART_FLAGS PSYS_PART_START_COLOR @@ -160,8 +160,8 @@ PSYS_PART_BF_SOURCE_ALPHA PSYS_PART_BF_ONE_MINUS_SOURCE_ALPHA PSYS_SRC_PATTERN -PSYS_SRC_INNERANGLE Deprecated -- Use PSYS_SRC_ANGLE_BEGIN -PSYS_SRC_OUTERANGLE Deprecated -- Use PSYS_SRC_ANGLE_END +PSYS_SRC_INNERANGLE Deprecated -- Use PSYS_SRC_ANGLE_BEGIN +PSYS_SRC_OUTERANGLE Deprecated -- Use PSYS_SRC_ANGLE_END PSYS_SRC_ANGLE_BEGIN PSYS_SRC_ANGLE_END PSYS_SRC_BURST_RATE @@ -181,408 +181,408 @@ PSYS_SRC_PATTERN_ANGLE PSYS_SRC_PATTERN_ANGLE_CONE PSYS_SRC_PATTERN_ANGLE_CONE_EMPTY -OBJECT_UNKNOWN_DETAIL Returned by llGetObjectDetails when passed an invalid object parameter type -OBJECT_NAME Used with llGetObjectDetails to get an object's name -OBJECT_DESC Used with llGetObjectDetails to get an object's description -OBJECT_POS Used with llGetObjectDetails to get an object's position -OBJECT_ROT Used with llGetObjectDetails to get an object's rotation -OBJECT_VELOCITY Used with llGetObjectDetails to get an object's velocity -OBJECT_OWNER Used with llGetObjectDetails to get an object's owner's key. Will be NULL_KEY if group owned -OBJECT_GROUP Used with llGetObjectDetails to get an object's group's key -OBJECT_CREATOR Used with llGetObjectDetails to get an object's creator's key -OBJECT_RUNNING_SCRIPT_COUNT Gets the number of running scripts attached to the object or agent -OBJECT_TOTAL_SCRIPT_COUNT Gets the number of scripts, both running and stopped, attached to the object or agent. -OBJECT_SCRIPT_MEMORY Gets the total amount of script memory allocated to the object or agent, in bytes. -OBJECT_SCRIPT_TIME Gets the total amount of average script CPU time used by the object or agent, in seconds. -OBJECT_PRIM_EQUIVALENCE Gets the prim equivalence of the object. -OBJECT_SERVER_COST Used with llGetObjectDetails to get the server cost. -OBJECT_STREAMING_COST Used with llGetObjectDetails to get the streaming (download) cost. -OBJECT_PHYSICS_COST Used with llGetObjectDetails to get the physics cost. -OBJECT_PATHFINDING_TYPE Used with llGetObjectDetails to get an object's pathfinding settings. -OBJECT_CHARACTER_TIME Used with llGetObjectDetails to get an object's average CPU time (in seconds) used by the object for navigation, if the object is a pathfinding character. Returns 0 for non-characters. -OBJECT_ROOT Used with llGetObjectDetails to get an object's root prim ID. -OBJECT_ATTACHED_POINT Used with llGetObjectDetails to get an object's attachment point. -OBJECT_RETURN_PARCEL Used with llReturnObjectsByOwner to return all objects on the same parcel as the script which are owned by 'owner'. -OBJECT_RETURN_PARCEL_OWNER Used with llReturnObjectsByOwner to return all objects owned by 'owner' which are over parcels owned by the owner of the script. -OBJECT_RETURN_REGION Used with llReturnObjectsByOwner to return all objects in the region owned by 'owner' - only works when the script is owned by the estate owner or an estate manager. +OBJECT_UNKNOWN_DETAIL Returned by llGetObjectDetails when passed an invalid object parameter type +OBJECT_NAME Used with llGetObjectDetails to get an object's name +OBJECT_DESC Used with llGetObjectDetails to get an object's description +OBJECT_POS Used with llGetObjectDetails to get an object's position +OBJECT_ROT Used with llGetObjectDetails to get an object's rotation +OBJECT_VELOCITY Used with llGetObjectDetails to get an object's velocity +OBJECT_OWNER Used with llGetObjectDetails to get an object's owner's key. Will be NULL_KEY if group owned +OBJECT_GROUP Used with llGetObjectDetails to get an object's group's key +OBJECT_CREATOR Used with llGetObjectDetails to get an object's creator's key +OBJECT_RUNNING_SCRIPT_COUNT Gets the number of running scripts attached to the object or agent +OBJECT_TOTAL_SCRIPT_COUNT Gets the number of scripts, both running and stopped, attached to the object or agent. +OBJECT_SCRIPT_MEMORY Gets the total amount of script memory allocated to the object or agent, in bytes. +OBJECT_SCRIPT_TIME Gets the total amount of average script CPU time used by the object or agent, in seconds. +OBJECT_PRIM_EQUIVALENCE Gets the prim equivalence of the object. +OBJECT_SERVER_COST Used with llGetObjectDetails to get the server cost. +OBJECT_STREAMING_COST Used with llGetObjectDetails to get the streaming (download) cost. +OBJECT_PHYSICS_COST Used with llGetObjectDetails to get the physics cost. +OBJECT_PATHFINDING_TYPE Used with llGetObjectDetails to get an object's pathfinding settings. +OBJECT_CHARACTER_TIME Used with llGetObjectDetails to get an object's average CPU time (in seconds) used by the object for navigation, if the object is a pathfinding character. Returns 0 for non-characters. +OBJECT_ROOT Used with llGetObjectDetails to get an object's root prim ID. +OBJECT_ATTACHED_POINT Used with llGetObjectDetails to get an object's attachment point. +OBJECT_RETURN_PARCEL Used with llReturnObjectsByOwner to return all objects on the same parcel as the script which are owned by 'owner'. +OBJECT_RETURN_PARCEL_OWNER Used with llReturnObjectsByOwner to return all objects owned by 'owner' which are over parcels owned by the owner of the script. +OBJECT_RETURN_REGION Used with llReturnObjectsByOwner to return all objects in the region owned by 'owner' - only works when the script is owned by the estate owner or an estate manager. -OPT_UNKNOWN Returned object pathfinding type by llGetObjectDetails for attachments, Linden trees and grass. -OPT_LEGACY_LINKSET Returned object pathfinding type by llGetObjectDetails for movable obstacles, movable phantoms, physical, and volumedetect objects. -OPT_AVATAR Returned object pathfinding type by llGetObjectDetails for avatars. -OPT_PATHFINDING_CHARACTER Returned object pathfinding type by llGetObjectDetails for pathfinding characters. -OPT_WALKABLE Returned object pathfinding type by llGetObjectDetails for walkable objects. -OPT_STATIC_OBSTACLE Returned object pathfinding type by llGetObjectDetails for static obstacles. -OPT_MATERIAL_VOLUME Returned object pathfinding type by llGetObjectDetails for material volumes. -OPT_EXCLUSION_VOLUME Returned object pathfinding type by llGetObjectDetails for exclusion volumes. +OPT_UNKNOWN Returned object pathfinding type by llGetObjectDetails for attachments, Linden trees and grass. +OPT_LEGACY_LINKSET Returned object pathfinding type by llGetObjectDetails for movable obstacles, movable phantoms, physical, and volumedetect objects. +OPT_AVATAR Returned object pathfinding type by llGetObjectDetails for avatars. +OPT_PATHFINDING_CHARACTER Returned object pathfinding type by llGetObjectDetails for pathfinding characters. +OPT_WALKABLE Returned object pathfinding type by llGetObjectDetails for walkable objects. +OPT_STATIC_OBSTACLE Returned object pathfinding type by llGetObjectDetails for static obstacles. +OPT_MATERIAL_VOLUME Returned object pathfinding type by llGetObjectDetails for material volumes. +OPT_EXCLUSION_VOLUME Returned object pathfinding type by llGetObjectDetails for exclusion volumes. # some vehicle params -VEHICLE_TYPE_NONE Used with llSetVehicleType to turn off vehicle support -VEHICLE_TYPE_SLED Used with llSetVehicleType to make a simple vehicle that bumps along the ground, and likes to move along its local x-axis -VEHICLE_TYPE_CAR Used with llSetVehicleType to make a vehicle that bounces along the ground but needs the motors to be driven from external controls or timer events -VEHICLE_TYPE_BOAT Used with llSetVehicleType to make a vehicle that hovers over water with lots of friction and some angular deflection -VEHICLE_TYPE_AIRPLANE Used with llSetVehicleType to make a vehicle that uses linear deflection for lift, and banking to turn, but doesn't hover -VEHICLE_TYPE_BALLOON Used with llSetVehicleType to make a vehicle that uses hover, and friction, but doesn't use deflection +VEHICLE_TYPE_NONE Used with llSetVehicleType to turn off vehicle support +VEHICLE_TYPE_SLED Used with llSetVehicleType to make a simple vehicle that bumps along the ground, and likes to move along its local x-axis +VEHICLE_TYPE_CAR Used with llSetVehicleType to make a vehicle that bounces along the ground but needs the motors to be driven from external controls or timer events +VEHICLE_TYPE_BOAT Used with llSetVehicleType to make a vehicle that hovers over water with lots of friction and some angular deflection +VEHICLE_TYPE_AIRPLANE Used with llSetVehicleType to make a vehicle that uses linear deflection for lift, and banking to turn, but doesn't hover +VEHICLE_TYPE_BALLOON Used with llSetVehicleType to make a vehicle that uses hover, and friction, but doesn't use deflection -VEHICLE_REFERENCE_FRAME Rotation of vehicle axes relative to local frame +VEHICLE_REFERENCE_FRAME Rotation of vehicle axes relative to local frame -VEHICLE_LINEAR_FRICTION_TIMESCALE A vector of timescales for exponential decay of linear velocity along the three vehicle axes -VEHICLE_ANGULAR_FRICTION_TIMESCALE A vector of timescales for exponential decay of angular velocity about the three vehicle axes -VEHICLE_LINEAR_MOTOR_DIRECTION The linear velocity that the vehicle will try to achieve -VEHICLE_LINEAR_MOTOR_OFFSET An offset from the center of mass of the vehicle where the linear motor is applied -VEHICLE_ANGULAR_MOTOR_DIRECTION The angular velocity that the vehicle will try to achieve +VEHICLE_LINEAR_FRICTION_TIMESCALE A vector of timescales for exponential decay of linear velocity along the three vehicle axes +VEHICLE_ANGULAR_FRICTION_TIMESCALE A vector of timescales for exponential decay of angular velocity about the three vehicle axes +VEHICLE_LINEAR_MOTOR_DIRECTION The linear velocity that the vehicle will try to achieve +VEHICLE_LINEAR_MOTOR_OFFSET An offset from the center of mass of the vehicle where the linear motor is applied +VEHICLE_ANGULAR_MOTOR_DIRECTION The angular velocity that the vehicle will try to achieve -VEHICLE_HOVER_HEIGHT The height the vehicle will try to hover -VEHICLE_HOVER_EFFICIENCY A slider between 0 (bouncy) and 1 (critically damped) hover behavior -VEHICLE_HOVER_TIMESCALE The period of time for the vehicle to achieve its hover height -VEHICLE_BUOYANCY A slider between 0 (no anti-gravity) and 1 (full anti-gravity) +VEHICLE_HOVER_HEIGHT The height the vehicle will try to hover +VEHICLE_HOVER_EFFICIENCY A slider between 0 (bouncy) and 1 (critically damped) hover behavior +VEHICLE_HOVER_TIMESCALE The period of time for the vehicle to achieve its hover height +VEHICLE_BUOYANCY A slider between 0 (no anti-gravity) and 1 (full anti-gravity) -VEHICLE_LINEAR_DEFLECTION_EFFICIENCY A slider between 0 (no deflection) and 1 (maximum strength) -VEHICLE_LINEAR_DEFLECTION_TIMESCALE The exponential timescale for the vehicle to redirect its velocity to be along its x-axis +VEHICLE_LINEAR_DEFLECTION_EFFICIENCY A slider between 0 (no deflection) and 1 (maximum strength) +VEHICLE_LINEAR_DEFLECTION_TIMESCALE The exponential timescale for the vehicle to redirect its velocity to be along its x-axis -VEHICLE_LINEAR_MOTOR_TIMESCALE The exponential timescale for the vehicle to achive its full linear motor velocity -VEHICLE_LINEAR_MOTOR_DECAY_TIMESCALE The exponential timescale for the linear motor's effectiveness to decay toward zero +VEHICLE_LINEAR_MOTOR_TIMESCALE The exponential timescale for the vehicle to achive its full linear motor velocity +VEHICLE_LINEAR_MOTOR_DECAY_TIMESCALE The exponential timescale for the linear motor's effectiveness to decay toward zero -VEHICLE_ANGULAR_DEFLECTION_EFFICIENCY A slider between 0 (no deflection) and 1 (maximum strength) -VEHICLE_ANGULAR_DEFLECTION_TIMESCALE The exponential timescale for the vehicle to achieve full angular deflection +VEHICLE_ANGULAR_DEFLECTION_EFFICIENCY A slider between 0 (no deflection) and 1 (maximum strength) +VEHICLE_ANGULAR_DEFLECTION_TIMESCALE The exponential timescale for the vehicle to achieve full angular deflection -VEHICLE_ANGULAR_MOTOR_TIMESCALE The exponential timescale for the vehicle to achive its full angular motor velocity -VEHICLE_ANGULAR_MOTOR_DECAY_TIMESCALE The exponential timescale for the angular motor's effectiveness to decay toward zero +VEHICLE_ANGULAR_MOTOR_TIMESCALE The exponential timescale for the vehicle to achive its full angular motor velocity +VEHICLE_ANGULAR_MOTOR_DECAY_TIMESCALE The exponential timescale for the angular motor's effectiveness to decay toward zero -VEHICLE_VERTICAL_ATTRACTION_EFFICIENCY A slider between 0 (bouncy) and 1 (critically damped) attraction of vehicle z-axis to world z-axis (vertical) -VEHICLE_VERTICAL_ATTRACTION_TIMESCALE The exponential timescale for the vehicle to align its z-axis to the world z-axis (vertical) +VEHICLE_VERTICAL_ATTRACTION_EFFICIENCY A slider between 0 (bouncy) and 1 (critically damped) attraction of vehicle z-axis to world z-axis (vertical) +VEHICLE_VERTICAL_ATTRACTION_TIMESCALE The exponential timescale for the vehicle to align its z-axis to the world z-axis (vertical) -VEHICLE_BANKING_EFFICIENCY A slider between -1 (leans out of turns), 0 (no banking), and +1 (leans into turns) -VEHICLE_BANKING_MIX A slider between 0 (static banking) and 1 (dynamic banking) -VEHICLE_BANKING_TIMESCALE The exponential timescale for the banking behavior to take full effect +VEHICLE_BANKING_EFFICIENCY A slider between -1 (leans out of turns), 0 (no banking), and +1 (leans into turns) +VEHICLE_BANKING_MIX A slider between 0 (static banking) and 1 (dynamic banking) +VEHICLE_BANKING_TIMESCALE The exponential timescale for the banking behavior to take full effect -VEHICLE_FLAG_NO_DEFLECTION_UP Prevents linear deflection along world-z axis -VEHICLE_FLAG_LIMIT_ROLL_ONLY Removes vertical attraction for changes in vehicle pitch -VEHICLE_FLAG_HOVER_WATER_ONLY Hover only pays attention to water level -VEHICLE_FLAG_HOVER_TERRAIN_ONLY Hover only pays attention to terrain height -VEHICLE_FLAG_HOVER_GLOBAL_HEIGHT Hover only pays attention to global height -VEHICLE_FLAG_HOVER_UP_ONLY Hover only pushes up -VEHICLE_FLAG_LIMIT_MOTOR_UP Prevents ground vehicles from motoring into the sky -VEHICLE_FLAG_MOUSELOOK_STEER Makes vehicle try to turn toward mouselook direction -VEHICLE_FLAG_MOUSELOOK_BANK Makes vehicle try to turn toward mouselook direction assuming banking is enabled -VEHICLE_FLAG_CAMERA_DECOUPLED Causes the camera look-at axis to NOT move when the vehicle rotates +VEHICLE_FLAG_NO_DEFLECTION_UP Prevents linear deflection along world-z axis +VEHICLE_FLAG_LIMIT_ROLL_ONLY Removes vertical attraction for changes in vehicle pitch +VEHICLE_FLAG_HOVER_WATER_ONLY Hover only pays attention to water level +VEHICLE_FLAG_HOVER_TERRAIN_ONLY Hover only pays attention to terrain height +VEHICLE_FLAG_HOVER_GLOBAL_HEIGHT Hover only pays attention to global height +VEHICLE_FLAG_HOVER_UP_ONLY Hover only pushes up +VEHICLE_FLAG_LIMIT_MOTOR_UP Prevents ground vehicles from motoring into the sky +VEHICLE_FLAG_MOUSELOOK_STEER Makes vehicle try to turn toward mouselook direction +VEHICLE_FLAG_MOUSELOOK_BANK Makes vehicle try to turn toward mouselook direction assuming banking is enabled +VEHICLE_FLAG_CAMERA_DECOUPLED Causes the camera look-at axis to NOT move when the vehicle rotates -CAMERA_PITCH (-45 to 80) (Adjusts the angular amount that the camera aims straight ahead vs. straight down, maintaining the same distance. Analogous to 'incidence'.") -CAMERA_FOCUS_OFFSET (-10 to 10) A vector that adjusts the position of the camera focus position relative to the subject -CAMERA_POSITION_LAG (0.0 to 3.0) How much the camera lags as it tries to move towards its 'ideal' position -CAMERA_FOCUS_LAG (0.0 to 3.0) How much the camera lags as it tries to aim towards the subject -CAMERA_DISTANCE (0.5 to 10) Sets how far away the camera wants to be from its subject -CAMERA_BEHINDNESS_ANGLE (0 to 180) Sets the angle in degrees within which the camera is not constrained by changes in subject rotation -CAMERA_BEHINDNESS_LAG (0.0 to 3.0) Sets how strongly the camera is forced to stay behind the target if outside of behindness angle -CAMERA_POSITION_THRESHOLD (0.0 to 4.0) Sets the radius of a sphere around the camera's ideal position within which it is not affected by subject motion -CAMERA_FOCUS_THRESHOLD (0.0 to 4.0) Sets the radius of a sphere around the camera's subject position within which its focus is not affected by subject motion -CAMERA_ACTIVE (0 or 1) Turns on or off scripted control of the camera -CAMERA_POSITION Sets the position of the camera -CAMERA_FOCUS Sets the focus (target position) of the camera -CAMERA_POSITION_LOCKED (0 or 1) Locks the camera position so it will not move -CAMERA_FOCUS_LOCKED (0 or 1) Locks the camera focus so it will not move +CAMERA_PITCH (-45 to 80) (Adjusts the angular amount that the camera aims straight ahead vs. straight down, maintaining the same distance. Analogous to 'incidence'.") +CAMERA_FOCUS_OFFSET (-10 to 10) A vector that adjusts the position of the camera focus position relative to the subject +CAMERA_POSITION_LAG (0.0 to 3.0) How much the camera lags as it tries to move towards its 'ideal' position +CAMERA_FOCUS_LAG (0.0 to 3.0) How much the camera lags as it tries to aim towards the subject +CAMERA_DISTANCE (0.5 to 10) Sets how far away the camera wants to be from its subject +CAMERA_BEHINDNESS_ANGLE (0 to 180) Sets the angle in degrees within which the camera is not constrained by changes in subject rotation +CAMERA_BEHINDNESS_LAG (0.0 to 3.0) Sets how strongly the camera is forced to stay behind the target if outside of behindness angle +CAMERA_POSITION_THRESHOLD (0.0 to 4.0) Sets the radius of a sphere around the camera's ideal position within which it is not affected by subject motion +CAMERA_FOCUS_THRESHOLD (0.0 to 4.0) Sets the radius of a sphere around the camera's subject position within which its focus is not affected by subject motion +CAMERA_ACTIVE (0 or 1) Turns on or off scripted control of the camera +CAMERA_POSITION Sets the position of the camera +CAMERA_FOCUS Sets the focus (target position) of the camera +CAMERA_POSITION_LOCKED (0 or 1) Locks the camera position so it will not move +CAMERA_FOCUS_LOCKED (0 or 1) Locks the camera focus so it will not move -INVENTORY_TEXTURE Passed to task inventory library functions to reference textures -INVENTORY_SOUND Passed to task inventory library functions to reference sounds -INVENTORY_OBJECT Passed to task inventory library functions to reference objects -INVENTORY_SCRIPT Passed to task inventory library functions to reference scripts -INVENTORY_LANDMARK Passed to task inventory library functions to reference landmarks -INVENTORY_CLOTHING Passed to task inventory library functions to reference clothing -INVENTORY_NOTECARD Passed to task inventory library functions to reference notecards -INVENTORY_BODYPART Passed to task inventory library functions to reference body parts -INVENTORY_ANIMATION Passed to task inventory library functions to reference animations -INVENTORY_GESTURE Passed to task inventory library functions to reference gestures -INVENTORY_ALL Passed to task inventory library functions to reference all inventory items -INVENTORY_NONE Returned by llGetInventoryType when no item is found +INVENTORY_TEXTURE Passed to task inventory library functions to reference textures +INVENTORY_SOUND Passed to task inventory library functions to reference sounds +INVENTORY_OBJECT Passed to task inventory library functions to reference objects +INVENTORY_SCRIPT Passed to task inventory library functions to reference scripts +INVENTORY_LANDMARK Passed to task inventory library functions to reference landmarks +INVENTORY_CLOTHING Passed to task inventory library functions to reference clothing +INVENTORY_NOTECARD Passed to task inventory library functions to reference notecards +INVENTORY_BODYPART Passed to task inventory library functions to reference body parts +INVENTORY_ANIMATION Passed to task inventory library functions to reference animations +INVENTORY_GESTURE Passed to task inventory library functions to reference gestures +INVENTORY_ALL Passed to task inventory library functions to reference all inventory items +INVENTORY_NONE Returned by llGetInventoryType when no item is found -ATTACH_CHEST Passed to llAttachToAvatar to attach task to chest -ATTACH_HEAD Passed to llAttachToAvatar to attach task to head -ATTACH_LSHOULDER Passed to llAttachToAvatar to attach task to left shoulder -ATTACH_RSHOULDER Passed to llAttachToAvatar to attach task to right shoulder -ATTACH_LHAND Passed to llAttachToAvatar to attach task to left hand -ATTACH_RHAND Passed to llAttachToAvatar to attach task to right hand -ATTACH_LFOOT Passed to llAttachToAvatar to attach task to left foot -ATTACH_RFOOT Passed to llAttachToAvatar to attach task to right foot -ATTACH_BACK Passed to llAttachToAvatar to attach task to back -ATTACH_PELVIS Passed to llAttachToAvatar to attach task to pelvis -ATTACH_MOUTH Passed to llAttachToAvatar to attach task to mouth -ATTACH_CHIN Passed to llAttachToAvatar to attach task to chin -ATTACH_LEAR Passed to llAttachToAvatar to attach task to left ear -ATTACH_REAR Passed to llAttachToAvatar to attach task to right ear -ATTACH_LEYE Passed to llAttachToAvatar to attach task to left eye -ATTACH_REYE Passed to llAttachToAvatar to attach task to right eye -ATTACH_NOSE Passed to llAttachToAvatar to attach task to nose -ATTACH_RUARM Passed to llAttachToAvatar to attach task to right upper arm -ATTACH_RLARM Passed to llAttachToAvatar to attach task to right lower arm -ATTACH_LUARM Passed to llAttachToAvatar to attach task to left upper arm -ATTACH_LLARM Passed to llAttachToAvatar to attach task to left lower arm -ATTACH_RHIP Passed to llAttachToAvatar to attach task to right hip -ATTACH_RULEG Passed to llAttachToAvatar to attach task to right upper leg -ATTACH_RLLEG Passed to llAttachToAvatar to attach task to right lower leg -ATTACH_LHIP Passed to llAttachToAvatar to attach task to left hip -ATTACH_LULEG Passed to llAttachToAvatar to attach task to left upper leg -ATTACH_LLLEG Passed to llAttachToAvatar to attach task to left lower leg -ATTACH_BELLY Passed to llAttachToAvatar to attach task to belly -ATTACH_LEFT_PEC Passed to llAttachToAvatar to attach task to left pectoral -ATTACH_RIGHT_PEC Passed to llAttachToAvatar to attach task to right pectoral -ATTACH_HUD_BOTTOM Passed to llAttachToAvatar to attach task to bottom hud area -ATTACH_HUD_BOTTOM_LEFT Passed to llAttachToAvatar to attach task to bottom left hud area -ATTACH_HUD_BOTTOM_RIGHT Passed to llAttachToAvatar to attach task to bottom right hud area -ATTACH_HUD_CENTER_1 Passed to llAttachToAvatar to attach task to center 1 hud area -ATTACH_HUD_CENTER_2 Passed to llAttachToAvatar to attach task to center 2 hud area -ATTACH_HUD_TOP_CENTER Passed to llAttachToAvatar to attach task to top center hud area -ATTACH_HUD_TOP_LEFT Passed to llAttachToAvatar to attach task to top left hud area -ATTACH_HUD_TOP_RIGHT Passed to llAttachToAvatar to attach task to top right hud area -ATTACH_NECK Passed to llAttachToAvatar to attach task to neck -ATTACH_AVATAR_CENTER Passed to llAttachToAvatar to attach task to avatar center +ATTACH_CHEST Passed to llAttachToAvatar to attach task to chest +ATTACH_HEAD Passed to llAttachToAvatar to attach task to head +ATTACH_LSHOULDER Passed to llAttachToAvatar to attach task to left shoulder +ATTACH_RSHOULDER Passed to llAttachToAvatar to attach task to right shoulder +ATTACH_LHAND Passed to llAttachToAvatar to attach task to left hand +ATTACH_RHAND Passed to llAttachToAvatar to attach task to right hand +ATTACH_LFOOT Passed to llAttachToAvatar to attach task to left foot +ATTACH_RFOOT Passed to llAttachToAvatar to attach task to right foot +ATTACH_BACK Passed to llAttachToAvatar to attach task to back +ATTACH_PELVIS Passed to llAttachToAvatar to attach task to pelvis +ATTACH_MOUTH Passed to llAttachToAvatar to attach task to mouth +ATTACH_CHIN Passed to llAttachToAvatar to attach task to chin +ATTACH_LEAR Passed to llAttachToAvatar to attach task to left ear +ATTACH_REAR Passed to llAttachToAvatar to attach task to right ear +ATTACH_LEYE Passed to llAttachToAvatar to attach task to left eye +ATTACH_REYE Passed to llAttachToAvatar to attach task to right eye +ATTACH_NOSE Passed to llAttachToAvatar to attach task to nose +ATTACH_RUARM Passed to llAttachToAvatar to attach task to right upper arm +ATTACH_RLARM Passed to llAttachToAvatar to attach task to right lower arm +ATTACH_LUARM Passed to llAttachToAvatar to attach task to left upper arm +ATTACH_LLARM Passed to llAttachToAvatar to attach task to left lower arm +ATTACH_RHIP Passed to llAttachToAvatar to attach task to right hip +ATTACH_RULEG Passed to llAttachToAvatar to attach task to right upper leg +ATTACH_RLLEG Passed to llAttachToAvatar to attach task to right lower leg +ATTACH_LHIP Passed to llAttachToAvatar to attach task to left hip +ATTACH_LULEG Passed to llAttachToAvatar to attach task to left upper leg +ATTACH_LLLEG Passed to llAttachToAvatar to attach task to left lower leg +ATTACH_BELLY Passed to llAttachToAvatar to attach task to belly +ATTACH_LEFT_PEC Passed to llAttachToAvatar to attach task to left pectoral +ATTACH_RIGHT_PEC Passed to llAttachToAvatar to attach task to right pectoral +ATTACH_HUD_BOTTOM Passed to llAttachToAvatar to attach task to bottom hud area +ATTACH_HUD_BOTTOM_LEFT Passed to llAttachToAvatar to attach task to bottom left hud area +ATTACH_HUD_BOTTOM_RIGHT Passed to llAttachToAvatar to attach task to bottom right hud area +ATTACH_HUD_CENTER_1 Passed to llAttachToAvatar to attach task to center 1 hud area +ATTACH_HUD_CENTER_2 Passed to llAttachToAvatar to attach task to center 2 hud area +ATTACH_HUD_TOP_CENTER Passed to llAttachToAvatar to attach task to top center hud area +ATTACH_HUD_TOP_LEFT Passed to llAttachToAvatar to attach task to top left hud area +ATTACH_HUD_TOP_RIGHT Passed to llAttachToAvatar to attach task to top right hud area +ATTACH_NECK Passed to llAttachToAvatar to attach task to neck +ATTACH_AVATAR_CENTER Passed to llAttachToAvatar to attach task to avatar center -LAND_LEVEL Passed to llModifyLand to level terrain -LAND_RAISE Passed to llModifyLand to raise terrain -LAND_LOWER Passed to llModifyLand to lower terrain -LAND_SMOOTH Passed to llModifyLand to smooth terrain -LAND_NOISE Passed to llModifyLand to randomize terrain -LAND_REVERT Passed to llModifyLand to revert terrain toward original state -LAND_SMALL_BRUSH Passed to llModifyLand to modify small land areas -LAND_MEDIUM_BRUSH Passed to llModifyLand to modify medium land areas -LAND_LARGE_BRUSH Passed to llModifyLand to modify large land areas +LAND_LEVEL Passed to llModifyLand to level terrain +LAND_RAISE Passed to llModifyLand to raise terrain +LAND_LOWER Passed to llModifyLand to lower terrain +LAND_SMOOTH Passed to llModifyLand to smooth terrain +LAND_NOISE Passed to llModifyLand to randomize terrain +LAND_REVERT Passed to llModifyLand to revert terrain toward original state +LAND_SMALL_BRUSH Passed to llModifyLand to modify small land areas +LAND_MEDIUM_BRUSH Passed to llModifyLand to modify medium land areas +LAND_LARGE_BRUSH Passed to llModifyLand to modify large land areas -DATA_PAYINFO Passed to llRequestAgentData to get payment status of an agent -DATA_ONLINE Passed to llRequestAgentData to determine if agent is online -DATA_NAME Passed to llRequestAgentData to get full agent name -DATA_BORN Passed to llRequestAgentData to get born on date as a string -DATA_RATING Passed to llRequestAgentData to get a comma separated sting of integer ratings -DATA_SIM_POS Passed to llRequestSimulatorData to get a string (cast to vector) of a simulator's global position -DATA_SIM_STATUS Passed to llRequestSimulatorData to get the status of a simulator -DATA_SIM_RATING Passed to llRequestSimulatorData to get the rating of a simulator +DATA_PAYINFO Passed to llRequestAgentData to get payment status of an agent +DATA_ONLINE Passed to llRequestAgentData to determine if agent is online +DATA_NAME Passed to llRequestAgentData to get full agent name +DATA_BORN Passed to llRequestAgentData to get born on date as a string +DATA_RATING Passed to llRequestAgentData to get a comma separated sting of integer ratings +DATA_SIM_POS Passed to llRequestSimulatorData to get a string (cast to vector) of a simulator's global position +DATA_SIM_STATUS Passed to llRequestSimulatorData to get the status of a simulator +DATA_SIM_RATING Passed to llRequestSimulatorData to get the rating of a simulator -PAYMENT_INFO_ON_FILE Used with llRequestAgentData to tell if Agent is of "Payment Info On File" status -PAYMENT_INFO_USED Used with llRequestAgentData to tell if Agent is of "Payment Info Used" status +PAYMENT_INFO_ON_FILE Used with llRequestAgentData to tell if Agent is of "Payment Info On File" status +PAYMENT_INFO_USED Used with llRequestAgentData to tell if Agent is of "Payment Info Used" status -ANIM_ON Enable texture animation -LOOP Loop when animating textures -REVERSE Animate in the reverse direction -PING_PONG Animate forward, then reverse -SMOOTH Textures slides, instead of stepping -ROTATE Rotates the texture, instead of using frames -SCALE Scales the texture, instead of using frames +ANIM_ON Enable texture animation +LOOP Loop when animating textures +REVERSE Animate in the reverse direction +PING_PONG Animate forward, then reverse +SMOOTH Textures slides, instead of stepping +ROTATE Rotates the texture, instead of using frames +SCALE Scales the texture, instead of using frames -ALL_SIDES Passed to various texture and color library functions to modify all sides +ALL_SIDES Passed to various texture and color library functions to modify all sides -LINK_SET Passed to various link functions to modify all blocks in the object -LINK_ROOT Passed to various link functions to modify only the root block (no effect on single block objects) -LINK_ALL_OTHERS Passed to various link functions to modify all other blocks in the object -LINK_ALL_CHILDREN Passed to various link functions to modify all child blocks in the object -LINK_THIS Passed to various link functions to modify only the calling block +LINK_SET Passed to various link functions to modify all blocks in the object +LINK_ROOT Passed to various link functions to modify only the root block (no effect on single block objects) +LINK_ALL_OTHERS Passed to various link functions to modify all other blocks in the object +LINK_ALL_CHILDREN Passed to various link functions to modify all child blocks in the object +LINK_THIS Passed to various link functions to modify only the calling block -CHANGED_INVENTORY Parameter of changed event handler used to indicate change to task's inventory -CHANGED_COLOR Parameter of changed event handler used to indicate change to task's color -CHANGED_SHAPE Parameter of changed event handler used to indicate change to task's shape parameters -CHANGED_SCALE Parameter of changed event handler used to indicate change to task's scale -CHANGED_TEXTURE Parameter of changed event handler used to indicate change to task's texture -CHANGED_LINK Parameter of changed event handler used to indicate change to task's link status -CHANGED_ALLOWED_DROP Parameter of changed event handler used to indicate a user dropped an inventory item:onto task that was allowed only by llAllowInventoryDrop function call -CHANGED_OWNER Parameter of changed event handler used to indicate change to task's owner ONLY when an object is sold as original or deeded to group -CHANGED_REGION Parameter of changed event handler used to indicate the region has changed -CHANGED_TELEPORT Parameter of changed event handler used to indicate teleport has completed -CHANGED_REGION_START Parameter of changed event handler used to indicate the region has been restarted -CHANGED_MEDIA Parameter of changed event handler used to indicate that media has changed on a face of the task +CHANGED_INVENTORY Parameter of changed event handler used to indicate change to task's inventory +CHANGED_COLOR Parameter of changed event handler used to indicate change to task's color +CHANGED_SHAPE Parameter of changed event handler used to indicate change to task's shape parameters +CHANGED_SCALE Parameter of changed event handler used to indicate change to task's scale +CHANGED_TEXTURE Parameter of changed event handler used to indicate change to task's texture +CHANGED_LINK Parameter of changed event handler used to indicate change to task's link status +CHANGED_ALLOWED_DROP Parameter of changed event handler used to indicate a user dropped an inventory item:onto task that was allowed only by llAllowInventoryDrop function call +CHANGED_OWNER Parameter of changed event handler used to indicate change to task's owner ONLY when an object is sold as original or deeded to group +CHANGED_REGION Parameter of changed event handler used to indicate the region has changed +CHANGED_TELEPORT Parameter of changed event handler used to indicate teleport has completed +CHANGED_REGION_START Parameter of changed event handler used to indicate the region has been restarted +CHANGED_MEDIA Parameter of changed event handler used to indicate that media has changed on a face of the task -TYPE_INTEGER Indicates that the list entry is holding an integer -TYPE_FLOAT Indicates that the list entry is holding an float -TYPE_STRING Indicates that the list entry is holding an string -TYPE_KEY Indicates that the list entry is holding an key -TYPE_VECTOR Indicates that the list entry is holding an vector -TYPE_ROTATION Indicates that the list entry is holding an rotation -TYPE_INVALID Indicates that this wasn't a valid list entry +TYPE_INTEGER Indicates that the list entry is holding an integer +TYPE_FLOAT Indicates that the list entry is holding an float +TYPE_STRING Indicates that the list entry is holding an string +TYPE_KEY Indicates that the list entry is holding an key +TYPE_VECTOR Indicates that the list entry is holding an vector +TYPE_ROTATION Indicates that the list entry is holding an rotation +TYPE_INVALID Indicates that this wasn't a valid list entry -REMOTE_DATA_CHANNEL Value of event_type in remote_event after successful llOpenRemoteDataChannel -REMOTE_DATA_REQUEST Value of event_type in remote_event if XML-RPC request is received -REMOTE_DATA_REPLY Value of event_type in remote_event if XML-RPC reply is received +REMOTE_DATA_CHANNEL Value of event_type in remote_event after successful llOpenRemoteDataChannel +REMOTE_DATA_REQUEST Value of event_type in remote_event if XML-RPC request is received +REMOTE_DATA_REPLY Value of event_type in remote_event if XML-RPC reply is received -PRIM_NAME Sets the prim's name -PRIM_DESC Sets the prim's description -PRIM_TYPE Followed by PRIM_TYPE_BOX, PRIM_TYPE_CYLINDER, PRIM_TYPE_PRISM, PRIM_TYPE_SPHERE, PRIM_TYPE_TORUS, PRIM_TYPE_TUBE, or PRIM_TYPE_SCULPT and their arguments -PRIM_MATERIAL Followed by PRIM_MATERIAL_STONE, PRIM_MATERIAL_METAL, PRIM_MATERIAL_GLASS, PRIM_MATERIAL_WOOD, PRIM_MATERIAL_FLESH, PRIM_MATERIAL_PLASTIC, or PRIM_MATERIAL_RUBBER -PRIM_PHYSICS Sets physics to TRUE or FALSE -PRIM_FLEXIBLE Followed by TRUE or FALSE, integer softness, float gravity, float friction, float wind, float tension, and vector force -PRIM_POINT_LIGHT Followed by TRUE or FALSE, vector color, float intensity, float radius, float falloff -PRIM_TEMP_ON_REZ Sets temporary on rez to TRUE or FALSE -PRIM_PHANTOM Sets phantom to TRUE or FALSE -PRIM_CAST_SHADOWS DEPRECATED. Takes 1 parameter, an integer, but has no effect when set and always returns 0 if used in llGetPrimitiveParams -PRIM_POSITION Sets primitive position to a vector position -PRIM_SIZE Sets primitive size to a vector size -PRIM_ROTATION Sets primitive rotation -PRIM_TEXT Used to get or set the object's floating text. -PRIM_TEXTURE Followed by an integer face, key id, vector repeats, vector offsets,:and float rotation in radians -PRIM_COLOR Followed by an integer face, vector color, and float alpha -PRIM_BUMP_SHINY Followed by an integer face, one of PRIM_SHINY_NONE, PRIM_SHINY_LOW,:PRIM_SHINY_MEDIUM, or PRIM_SHINY_HIGH,:and one of PRIM_BUMP_NONE, PRIM_BUMP_BRIGHT, PRIM_BUMP_DARK, etc -PRIM_FULLBRIGHT Followed by an integer face, and TRUE or FALSE -PRIM_TEXGEN Followed by an integer face, and one of PRIM_TEXGEN_DEFAULT or PRIM_TEXGEN_PLANAR -PRIM_GLOW Followed by an integer face, and a float from 0.0 to 1.0 specifying glow amount -PRIM_POS_LOCAL Sets the prim's local position -PRIM_ROT_LOCAL Sets the prim's local rotation -PRIM_OMEGA Makes the object spin at the specified axis and rate -PRIM_LINK_TARGET Used to get or set multiple links with a single PrimParameters call. -PRIM_SLICE Get and set the 'slice' parameter of all shapes. Takes a vector parameter of the form +PRIM_NAME Sets the prim's name +PRIM_DESC Sets the prim's description +PRIM_TYPE Followed by PRIM_TYPE_BOX, PRIM_TYPE_CYLINDER, PRIM_TYPE_PRISM, PRIM_TYPE_SPHERE, PRIM_TYPE_TORUS, PRIM_TYPE_TUBE, or PRIM_TYPE_SCULPT and their arguments +PRIM_MATERIAL Followed by PRIM_MATERIAL_STONE, PRIM_MATERIAL_METAL, PRIM_MATERIAL_GLASS, PRIM_MATERIAL_WOOD, PRIM_MATERIAL_FLESH, PRIM_MATERIAL_PLASTIC, or PRIM_MATERIAL_RUBBER +PRIM_PHYSICS Sets physics to TRUE or FALSE +PRIM_FLEXIBLE Followed by TRUE or FALSE, integer softness, float gravity, float friction, float wind, float tension, and vector force +PRIM_POINT_LIGHT Followed by TRUE or FALSE, vector color, float intensity, float radius, float falloff +PRIM_TEMP_ON_REZ Sets temporary on rez to TRUE or FALSE +PRIM_PHANTOM Sets phantom to TRUE or FALSE +PRIM_CAST_SHADOWS DEPRECATED. Takes 1 parameter, an integer, but has no effect when set and always returns 0 if used in llGetPrimitiveParams +PRIM_POSITION Sets primitive position to a vector position +PRIM_SIZE Sets primitive size to a vector size +PRIM_ROTATION Sets primitive rotation +PRIM_TEXT Used to get or set the object's floating text. +PRIM_TEXTURE Followed by an integer face, key id, vector repeats, vector offsets,:and float rotation in radians +PRIM_COLOR Followed by an integer face, vector color, and float alpha +PRIM_BUMP_SHINY Followed by an integer face, one of PRIM_SHINY_NONE, PRIM_SHINY_LOW,:PRIM_SHINY_MEDIUM, or PRIM_SHINY_HIGH,:and one of PRIM_BUMP_NONE, PRIM_BUMP_BRIGHT, PRIM_BUMP_DARK, etc +PRIM_FULLBRIGHT Followed by an integer face, and TRUE or FALSE +PRIM_TEXGEN Followed by an integer face, and one of PRIM_TEXGEN_DEFAULT or PRIM_TEXGEN_PLANAR +PRIM_GLOW Followed by an integer face, and a float from 0.0 to 1.0 specifying glow amount +PRIM_POS_LOCAL Sets the prim's local position +PRIM_ROT_LOCAL Sets the prim's local rotation +PRIM_OMEGA Makes the object spin at the specified axis and rate +PRIM_LINK_TARGET Used to get or set multiple links with a single PrimParameters call. +PRIM_SLICE Get and set the 'slice' parameter of all shapes. Takes a vector parameter of the form -PRIM_TYPE_BOX Followed by integer hole shape, vector cut, float hollow, vector twist,:vector top size, and vector top shear -PRIM_TYPE_CYLINDER Followed by integer hole shape, vector cut, float hollow, vector twist,:vector top size, and vector top shear -PRIM_TYPE_PRISM Followed by integer hole shape, vector cut, float hollow, vector twist,:vector top size, and vector top shear -PRIM_TYPE_SPHERE Followed by integer hole shape, vector cut, float hollow, vector twist,:and vector dimple -PRIM_TYPE_TORUS Followed by integer hole shape, vector cut, float hollow, vector twist,:vector hole size, vector top shear, vector advanced cut, vector taper,:float revolutions, float radius offset, and float skew -PRIM_TYPE_TUBE Followed by integer hole shape, vector cut, float hollow, vector twist,:vector hole size, vector top shear, vector advanced cut, vector taper,:float revolutions, float radius offset, and float skew -PRIM_TYPE_RING Followed by integer hole shape, vector cut, float hollow, vector twist,:vector hole size, vector top shear, vector advanced cut, vector taper,:float revolutions, float radius offset, and float skew -PRIM_TYPE_SCULPT Followed by a key/string texture uuid, and one of PRIM_SCULPT_TYPE_SPHERE, PRIM_SCULPT_TYPE_TORUS, PRIM_SCULPT_TYPE_PLANE, or PRIM_SCULPT_TYPE_CYLINDER +PRIM_TYPE_BOX Followed by integer hole shape, vector cut, float hollow, vector twist,:vector top size, and vector top shear +PRIM_TYPE_CYLINDER Followed by integer hole shape, vector cut, float hollow, vector twist,:vector top size, and vector top shear +PRIM_TYPE_PRISM Followed by integer hole shape, vector cut, float hollow, vector twist,:vector top size, and vector top shear +PRIM_TYPE_SPHERE Followed by integer hole shape, vector cut, float hollow, vector twist,:and vector dimple +PRIM_TYPE_TORUS Followed by integer hole shape, vector cut, float hollow, vector twist,:vector hole size, vector top shear, vector advanced cut, vector taper,:float revolutions, float radius offset, and float skew +PRIM_TYPE_TUBE Followed by integer hole shape, vector cut, float hollow, vector twist,:vector hole size, vector top shear, vector advanced cut, vector taper,:float revolutions, float radius offset, and float skew +PRIM_TYPE_RING Followed by integer hole shape, vector cut, float hollow, vector twist,:vector hole size, vector top shear, vector advanced cut, vector taper,:float revolutions, float radius offset, and float skew +PRIM_TYPE_SCULPT Followed by a key/string texture uuid, and one of PRIM_SCULPT_TYPE_SPHERE, PRIM_SCULPT_TYPE_TORUS, PRIM_SCULPT_TYPE_PLANE, or PRIM_SCULPT_TYPE_CYLINDER -PRIM_HOLE_DEFAULT Sets hole type to match the prim type -PRIM_HOLE_SQUARE Sets hole type to square -PRIM_HOLE_CIRCLE Sets hole type to circle -PRIM_HOLE_TRIANGLE Sets hole type to triangle +PRIM_HOLE_DEFAULT Sets hole type to match the prim type +PRIM_HOLE_SQUARE Sets hole type to square +PRIM_HOLE_CIRCLE Sets hole type to circle +PRIM_HOLE_TRIANGLE Sets hole type to triangle -PRIM_MATERIAL_STONE Sets material to stone -PRIM_MATERIAL_METAL Sets material to metal -PRIM_MATERIAL_GLASS Sets material to glass -PRIM_MATERIAL_WOOD Sets material to wood -PRIM_MATERIAL_FLESH Sets material to flesh -PRIM_MATERIAL_PLASTIC Sets material to plastic -PRIM_MATERIAL_RUBBER Sets material to rubber -PRIM_MATERIAL_LIGHT Sets material to light +PRIM_MATERIAL_STONE Sets material to stone +PRIM_MATERIAL_METAL Sets material to metal +PRIM_MATERIAL_GLASS Sets material to glass +PRIM_MATERIAL_WOOD Sets material to wood +PRIM_MATERIAL_FLESH Sets material to flesh +PRIM_MATERIAL_PLASTIC Sets material to plastic +PRIM_MATERIAL_RUBBER Sets material to rubber +PRIM_MATERIAL_LIGHT Sets material to light -PRIM_SHINY_NONE No shininess -PRIM_SHINY_LOW Low shininess -PRIM_SHINY_MEDIUM Medium shininess -PRIM_SHINY_HIGH High shininess +PRIM_SHINY_NONE No shininess +PRIM_SHINY_LOW Low shininess +PRIM_SHINY_MEDIUM Medium shininess +PRIM_SHINY_HIGH High shininess -PRIM_BUMP_NONE No bump map -PRIM_BUMP_BRIGHT Generate bump map from highlights -PRIM_BUMP_DARK Generate bump map from lowlights -PRIM_BUMP_WOOD Wood bump map -PRIM_BUMP_BARK Bark bump map -PRIM_BUMP_BRICKS Brick bump map -PRIM_BUMP_CHECKER Checker bump map -PRIM_BUMP_CONCRETE Concrete bump map -PRIM_BUMP_TILE Tile bump map -PRIM_BUMP_STONE Stone bump map -PRIM_BUMP_DISKS Disk bump map -PRIM_BUMP_GRAVEL Gravel bump map -PRIM_BUMP_BLOBS Blob bump map -PRIM_BUMP_SIDING Siding bump map -PRIM_BUMP_LARGETILE Large tile bump map -PRIM_BUMP_STUCCO Stucco bump map -PRIM_BUMP_SUCTION Suction cup bump map -PRIM_BUMP_WEAVE Weave bump map +PRIM_BUMP_NONE No bump map +PRIM_BUMP_BRIGHT Generate bump map from highlights +PRIM_BUMP_DARK Generate bump map from lowlights +PRIM_BUMP_WOOD Wood bump map +PRIM_BUMP_BARK Bark bump map +PRIM_BUMP_BRICKS Brick bump map +PRIM_BUMP_CHECKER Checker bump map +PRIM_BUMP_CONCRETE Concrete bump map +PRIM_BUMP_TILE Tile bump map +PRIM_BUMP_STONE Stone bump map +PRIM_BUMP_DISKS Disk bump map +PRIM_BUMP_GRAVEL Gravel bump map +PRIM_BUMP_BLOBS Blob bump map +PRIM_BUMP_SIDING Siding bump map +PRIM_BUMP_LARGETILE Large tile bump map +PRIM_BUMP_STUCCO Stucco bump map +PRIM_BUMP_SUCTION Suction cup bump map +PRIM_BUMP_WEAVE Weave bump map -PRIM_TEXGEN_DEFAULT Default texture mapping -PRIM_TEXGEN_PLANAR Planar texture mapping +PRIM_TEXGEN_DEFAULT Default texture mapping +PRIM_TEXGEN_PLANAR Planar texture mapping -PRIM_SCULPT_TYPE_SPHERE Stitch edges in a sphere-like way -PRIM_SCULPT_TYPE_TORUS Stitch edges in a torus-like way -PRIM_SCULPT_TYPE_PLANE Do not stitch edges -PRIM_SCULPT_TYPE_CYLINDER Stitch edges in a cylinder-like way -PRIM_SCULPT_TYPE_MASK Mask used to determine stitching type -PRIM_SCULPT_FLAG_INVERT Flag to specify that the surface normals should be inverted -PRIM_SCULPT_FLAG_MIRROR Flag to specify that the prim should be reflected along X axis +PRIM_SCULPT_TYPE_SPHERE Stitch edges in a sphere-like way +PRIM_SCULPT_TYPE_TORUS Stitch edges in a torus-like way +PRIM_SCULPT_TYPE_PLANE Do not stitch edges +PRIM_SCULPT_TYPE_CYLINDER Stitch edges in a cylinder-like way +PRIM_SCULPT_TYPE_MASK Mask used to determine stitching type +PRIM_SCULPT_FLAG_INVERT Flag to specify that the surface normals should be inverted +PRIM_SCULPT_FLAG_MIRROR Flag to specify that the prim should be reflected along X axis -PRIM_PHYSICS_SHAPE_TYPE For primitive physics shape type. Followed with either PRIM_PHYSICS_SHAPE_PRIM, PRIM_PHYSICS_SHAPE_NONE or PRIM_PHYSICS_SHAPE_CONVEX. -PRIM_PHYSICS_SHAPE_PRIM Use the normal prim shape for physics (this is the default for all non-mesh objects) -PRIM_PHYSICS_SHAPE_NONE Use the convex hull of the prim shape for physics (this is the default for mesh objects) -PRIM_PHYSICS_SHAPE_CONVEX Ignore this prim in the physics shape. This cannot be applied to the root prim. +PRIM_PHYSICS_SHAPE_TYPE For primitive physics shape type. Followed with either PRIM_PHYSICS_SHAPE_PRIM, PRIM_PHYSICS_SHAPE_NONE or PRIM_PHYSICS_SHAPE_CONVEX. +PRIM_PHYSICS_SHAPE_PRIM Use the normal prim shape for physics (this is the default for all non-mesh objects) +PRIM_PHYSICS_SHAPE_NONE Use the convex hull of the prim shape for physics (this is the default for mesh objects) +PRIM_PHYSICS_SHAPE_CONVEX Ignore this prim in the physics shape. This cannot be applied to the root prim. -MASK_BASE Base permissions -MASK_OWNER Owner permissions -MASK_GROUP Group permissions -MASK_EVERYONE Everyone permissions -MASK_NEXT Next owner permissions +MASK_BASE Base permissions +MASK_OWNER Owner permissions +MASK_GROUP Group permissions +MASK_EVERYONE Everyone permissions +MASK_NEXT Next owner permissions -PERM_TRANSFER Transfer permission -PERM_MODIFY Modify permission -PERM_COPY Copy permission -PERM_MOVE Move permission -PERM_ALL Move/Modify/Copy/Transfer permissions +PERM_TRANSFER Transfer permission +PERM_MODIFY Modify permission +PERM_COPY Copy permission +PERM_MOVE Move permission +PERM_ALL Move/Modify/Copy/Transfer permissions -PARCEL_MEDIA_COMMAND_STOP Stop media stream -PARCEL_MEDIA_COMMAND_PAUSE Pause media stream -PARCEL_MEDIA_COMMAND_PLAY Play media stream -PARCEL_MEDIA_COMMAND_LOOP Loop media stream -PARCEL_MEDIA_COMMAND_LOOP_SET Used to get or set the parcel's media loop duration -PARCEL_MEDIA_COMMAND_TEXTURE Get or set the parcel's media texture -PARCEL_MEDIA_COMMAND_URL Get or set the parcel's media url -PARCEL_MEDIA_COMMAND_TYPE Get or set the parcel's media mimetype -PARCEL_MEDIA_COMMAND_DESC Get or set the parcel's media description -PARCEL_MEDIA_COMMAND_TIME Set media stream to specific time -PARCEL_MEDIA_COMMAND_SIZE Get or set the parcel's media pixel resolution -PARCEL_MEDIA_COMMAND_AGENT Allows media stream commands to apply to only one agent -PARCEL_MEDIA_COMMAND_UNLOAD Unloads the media stream -PARCEL_MEDIA_COMMAND_AUTO_ALIGN Auto aligns the media stream to the texture size. May cause a performance hit and loss of some visual quality +PARCEL_MEDIA_COMMAND_STOP Stop media stream +PARCEL_MEDIA_COMMAND_PAUSE Pause media stream +PARCEL_MEDIA_COMMAND_PLAY Play media stream +PARCEL_MEDIA_COMMAND_LOOP Loop media stream +PARCEL_MEDIA_COMMAND_LOOP_SET Used to get or set the parcel's media loop duration +PARCEL_MEDIA_COMMAND_TEXTURE Get or set the parcel's media texture +PARCEL_MEDIA_COMMAND_URL Get or set the parcel's media url +PARCEL_MEDIA_COMMAND_TYPE Get or set the parcel's media mimetype +PARCEL_MEDIA_COMMAND_DESC Get or set the parcel's media description +PARCEL_MEDIA_COMMAND_TIME Set media stream to specific time +PARCEL_MEDIA_COMMAND_SIZE Get or set the parcel's media pixel resolution +PARCEL_MEDIA_COMMAND_AGENT Allows media stream commands to apply to only one agent +PARCEL_MEDIA_COMMAND_UNLOAD Unloads the media stream +PARCEL_MEDIA_COMMAND_AUTO_ALIGN Auto aligns the media stream to the texture size. May cause a performance hit and loss of some visual quality -PAY_HIDE Used with llSetPayPrice to hide a button -PAY_DEFAULT Used with llSetPayPrice to use the default price for a button +PAY_HIDE Used with llSetPayPrice to hide a button +PAY_DEFAULT Used with llSetPayPrice to use the default price for a button -LIST_STAT_MAX Used with llListStatistics to find the largest number in a list -LIST_STAT_MIN Used with llListStatistics to find the smallest number in a list -LIST_STAT_MEAN Used with llListStatistics to find the mean of the numbers in a list -LIST_STAT_MEDIAN Used with llListStatistics to find the median of the numbers in a list -LIST_STAT_STD_DEV Used with llListStatistics to find the standard deviation of the numbers in a list -LIST_STAT_SUM Used with llListStatistics to find the sum of the numbers in a list -LIST_STAT_SUM_SQUARES Used with llListStatistics to find the sum of the squares of the numbers in a list -LIST_STAT_NUM_COUNT Used with llListStatistics to find how many numbers are in a list -LIST_STAT_GEOMETRIC_MEAN Used with llListStatistics to find the geometric mean of the numbers in a list (all numbers must be > 0) -LIST_STAT_RANGE Used with llListStatistics to find the range of the numbers in a list +LIST_STAT_MAX Used with llListStatistics to find the largest number in a list +LIST_STAT_MIN Used with llListStatistics to find the smallest number in a list +LIST_STAT_MEAN Used with llListStatistics to find the mean of the numbers in a list +LIST_STAT_MEDIAN Used with llListStatistics to find the median of the numbers in a list +LIST_STAT_STD_DEV Used with llListStatistics to find the standard deviation of the numbers in a list +LIST_STAT_SUM Used with llListStatistics to find the sum of the numbers in a list +LIST_STAT_SUM_SQUARES Used with llListStatistics to find the sum of the squares of the numbers in a list +LIST_STAT_NUM_COUNT Used with llListStatistics to find how many numbers are in a list +LIST_STAT_GEOMETRIC_MEAN Used with llListStatistics to find the geometric mean of the numbers in a list (all numbers must be > 0) +LIST_STAT_RANGE Used with llListStatistics to find the range of the numbers in a list -PARCEL_FLAG_ALLOW_FLY Used with llGetParcelFlags to find if a parcel allows flying -PARCEL_FLAG_ALLOW_GROUP_SCRIPTS Used with llGetParcelFlags to find if a parcel allows group scripts -PARCEL_FLAG_ALLOW_SCRIPTS Used with llGetParcelFlags to find if a parcel allows outside scripts -PARCEL_FLAG_ALLOW_LANDMARK Used with llGetParcelFlags to find if a parcel allows landmarks to be created -PARCEL_FLAG_ALLOW_TERRAFORM Used with llGetParcelFlags to find if a parcel allows anyone to terraform the land -PARCEL_FLAG_ALLOW_DAMAGE Used with llGetParcelFlags to find if a parcel allows damage -PARCEL_FLAG_ALLOW_CREATE_OBJECTS Used with llGetParcelFlags to find if a parcel allows anyone to create objects -PARCEL_FLAG_ALLOW_CREATE_GROUP_OBJECTS Used with llGetParcelFlags to find if a parcel allows group members or objects to create objects -PARCEL_FLAG_USE_ACCESS_GROUP Used with llGetParcelFlags to find if a parcel limits access to a group -PARCEL_FLAG_USE_ACCESS_LIST Used with llGetParcelFlags to find if a parcel limits access to a list of residents -PARCEL_FLAG_USE_BAN_LIST Used with llGetParcelFlags to find if a parcel uses a ban list -PARCEL_FLAG_USE_LAND_PASS_LIST Used with llGetParcelFlags to find if a parcel allows passes to be purchased -PARCEL_FLAG_LOCAL_SOUND_ONLY Used with llGetParcelFlags to find if a parcel restricts spacialized sound to the parcel -PARCEL_FLAG_RESTRICT_PUSHOBJECT Used with llGetParcelFlags to find if a parcel restricts llPushObject() calls -PARCEL_FLAG_ALLOW_ALL_OBJECT_ENTRY Used with llGetParcelFlags to find if a parcel allows all objects to enter -PARCEL_FLAG_ALLOW_GROUP_OBJECT_ENTRY Used with llGetParcelFlags to find if a parcel only allows group (and owner) objects to enter +PARCEL_FLAG_ALLOW_FLY Used with llGetParcelFlags to find if a parcel allows flying +PARCEL_FLAG_ALLOW_GROUP_SCRIPTS Used with llGetParcelFlags to find if a parcel allows group scripts +PARCEL_FLAG_ALLOW_SCRIPTS Used with llGetParcelFlags to find if a parcel allows outside scripts +PARCEL_FLAG_ALLOW_LANDMARK Used with llGetParcelFlags to find if a parcel allows landmarks to be created +PARCEL_FLAG_ALLOW_TERRAFORM Used with llGetParcelFlags to find if a parcel allows anyone to terraform the land +PARCEL_FLAG_ALLOW_DAMAGE Used with llGetParcelFlags to find if a parcel allows damage +PARCEL_FLAG_ALLOW_CREATE_OBJECTS Used with llGetParcelFlags to find if a parcel allows anyone to create objects +PARCEL_FLAG_ALLOW_CREATE_GROUP_OBJECTS Used with llGetParcelFlags to find if a parcel allows group members or objects to create objects +PARCEL_FLAG_USE_ACCESS_GROUP Used with llGetParcelFlags to find if a parcel limits access to a group +PARCEL_FLAG_USE_ACCESS_LIST Used with llGetParcelFlags to find if a parcel limits access to a list of residents +PARCEL_FLAG_USE_BAN_LIST Used with llGetParcelFlags to find if a parcel uses a ban list +PARCEL_FLAG_USE_LAND_PASS_LIST Used with llGetParcelFlags to find if a parcel allows passes to be purchased +PARCEL_FLAG_LOCAL_SOUND_ONLY Used with llGetParcelFlags to find if a parcel restricts spacialized sound to the parcel +PARCEL_FLAG_RESTRICT_PUSHOBJECT Used with llGetParcelFlags to find if a parcel restricts llPushObject() calls +PARCEL_FLAG_ALLOW_ALL_OBJECT_ENTRY Used with llGetParcelFlags to find if a parcel allows all objects to enter +PARCEL_FLAG_ALLOW_GROUP_OBJECT_ENTRY Used with llGetParcelFlags to find if a parcel only allows group (and owner) objects to enter -REGION_FLAG_ALLOW_DAMAGE Used with llGetRegionFlags to find if a region is entirely damage enabled -REGION_FLAG_FIXED_SUN Used with llGetRegionFlags to find if a region has a fixed sun position -REGION_FLAG_BLOCK_TERRAFORM Used with llGetRegionFlags to find if a region terraforming disabled -REGION_FLAG_SANDBOX Used with llGetRegionFlags to find if a region is a sandbox -REGION_FLAG_DISABLE_COLLISIONS Used with llGetRegionFlags to find if a region has disabled collisions -REGION_FLAG_DISABLE_PHYSICS Used with llGetRegionFlags to find if a region has disabled physics -REGION_FLAG_BLOCK_FLY Used with llGetRegionFlags to find if a region blocks flying -REGION_FLAG_ALLOW_DIRECT_TELEPORT Used with llGetRegionFlags to find if a region allows direct teleports -REGION_FLAG_RESTRICT_PUSHOBJECT Used with llGetRegionFlags to find if a region restricts llPushObject() calls +REGION_FLAG_ALLOW_DAMAGE Used with llGetRegionFlags to find if a region is entirely damage enabled +REGION_FLAG_FIXED_SUN Used with llGetRegionFlags to find if a region has a fixed sun position +REGION_FLAG_BLOCK_TERRAFORM Used with llGetRegionFlags to find if a region terraforming disabled +REGION_FLAG_SANDBOX Used with llGetRegionFlags to find if a region is a sandbox +REGION_FLAG_DISABLE_COLLISIONS Used with llGetRegionFlags to find if a region has disabled collisions +REGION_FLAG_DISABLE_PHYSICS Used with llGetRegionFlags to find if a region has disabled physics +REGION_FLAG_BLOCK_FLY Used with llGetRegionFlags to find if a region blocks flying +REGION_FLAG_ALLOW_DIRECT_TELEPORT Used with llGetRegionFlags to find if a region allows direct teleports +REGION_FLAG_RESTRICT_PUSHOBJECT Used with llGetRegionFlags to find if a region restricts llPushObject() calls -HTTP_METHOD Used with llHTTPRequest to specify the method, "GET", "POST", "PUT", or "DELETE" -HTTP_MIMETYPE Used with llHTTPRequest to specify the MIME type, defaults to "text/plain" -HTTP_BODY_MAXLENGTH Used with llHTTPRequest to specify the maximum response body to return -HTTP_VERIFY_CERT Used with llHTTPRequest to specify SSL certificate verification -HTTP_BODY_TRUNCATED Used with http_response to indicate truncation point in bytes -HTTP_VERBOSE_THROTTLE Used with llHTTPRequest to shout error messages to DEBUG_CHANNEL if the outgoing request rate exceeds the server limit. -HTTP_BODY_MAXLENGTH Used with llHTTPRequest to specify the maximum body size for the date returned from the request. Mono scripts can request from 1byte to 16k, non-mono scripts can request from 1byte to 4k. The default is 2k. +HTTP_METHOD Used with llHTTPRequest to specify the method, "GET", "POST", "PUT", or "DELETE" +HTTP_MIMETYPE Used with llHTTPRequest to specify the MIME type, defaults to "text/plain" +HTTP_BODY_MAXLENGTH Used with llHTTPRequest to specify the maximum response body to return +HTTP_VERIFY_CERT Used with llHTTPRequest to specify SSL certificate verification +HTTP_BODY_TRUNCATED Used with http_response to indicate truncation point in bytes +HTTP_VERBOSE_THROTTLE Used with llHTTPRequest to shout error messages to DEBUG_CHANNEL if the outgoing request rate exceeds the server limit. +HTTP_BODY_MAXLENGTH Used with llHTTPRequest to specify the maximum body size for the date returned from the request. Mono scripts can request from 1byte to 16k, non-mono scripts can request from 1byte to 4k. The default is 2k. -PARCEL_COUNT_TOTAL Used with llGetParcelPrimCount to get the total number of prims on the parcel -PARCEL_COUNT_OWNER Used with llGetParcelPrimCount to get the number of prims on the parcel owned by the owner -PARCEL_COUNT_GROUP Used with llGetParcelPrimCount to get the number of prims on the parcel owned by the group -PARCEL_COUNT_OTHER Used with llGetParcelPrimCount to get the number of prims on the parcel owned by others -PARCEL_COUNT_SELECTED Used with llGetParcelPrimCount to get the number of prims on the parcel currently selected or sat upon -PARCEL_COUNT_TEMP Used with llGetParcelPrimCount to get the number of prims on the parcel that are temp on rez +PARCEL_COUNT_TOTAL Used with llGetParcelPrimCount to get the total number of prims on the parcel +PARCEL_COUNT_OWNER Used with llGetParcelPrimCount to get the number of prims on the parcel owned by the owner +PARCEL_COUNT_GROUP Used with llGetParcelPrimCount to get the number of prims on the parcel owned by the group +PARCEL_COUNT_OTHER Used with llGetParcelPrimCount to get the number of prims on the parcel owned by others +PARCEL_COUNT_SELECTED Used with llGetParcelPrimCount to get the number of prims on the parcel currently selected or sat upon +PARCEL_COUNT_TEMP Used with llGetParcelPrimCount to get the number of prims on the parcel that are temp on rez -PARCEL_DETAILS_NAME Used with llGetParcelDetails to get the parcel name -PARCEL_DETAILS_DESC Used with llGetParcelDetails to get the parcel description -PARCEL_DETAILS_OWNER Used with llGetParcelDetails to get the parcel owner id -PARCEL_DETAILS_GROUP Used with llGetParcelDetails to get the parcel group id -PARCEL_DETAILS_AREA Used with llGetParcelDetails to get the parcel area in square meters -PARCEL_DETAILS_ID Used with llGetParcelDetails to get the parcel id -PARCEL_DETAILS_SEE_AVATARS Used with llGetParcelDetails to get the avatars visibility setting +PARCEL_DETAILS_NAME Used with llGetParcelDetails to get the parcel name +PARCEL_DETAILS_DESC Used with llGetParcelDetails to get the parcel description +PARCEL_DETAILS_OWNER Used with llGetParcelDetails to get the parcel owner id +PARCEL_DETAILS_GROUP Used with llGetParcelDetails to get the parcel group id +PARCEL_DETAILS_AREA Used with llGetParcelDetails to get the parcel area in square meters +PARCEL_DETAILS_ID Used with llGetParcelDetails to get the parcel id +PARCEL_DETAILS_SEE_AVATARS Used with llGetParcelDetails to get the avatars visibility setting -STRING_TRIM_HEAD Used with llStringTrim to trim leading spaces from a string -STRING_TRIM_TAIL Used with llStringTrim to trim trailing spaces from a string -STRING_TRIM Used with llStringTrim to trim both leading and trailing spaces from a string +STRING_TRIM_HEAD Used with llStringTrim to trim leading spaces from a string +STRING_TRIM_TAIL Used with llStringTrim to trim trailing spaces from a string +STRING_TRIM Used with llStringTrim to trim both leading and trailing spaces from a string CLICK_ACTION_NONE Used with llSetClickAction to disable the click action CLICK_ACTION_TOUCH Used with llSetClickAction to set touch as the default action when object is clicked @@ -641,77 +641,77 @@ STATUS_WHITELIST_FAILED URL failed to pass whitelist PROFILE_NONE Disables profiling PROFILE_SCRIPT_MEMORY Enables memory profiling -RC_DATA_FLAGS Option for llCastRay() followed with a bitwise combination of RC_GET_NORMAL, RC_GET_ROOT_KEY and RC_GET_LINK_NUM. -RC_DETECT_PHANTOM Option for llCastRay() followed with TRUE to detect phantom AND volume detect objects, FASLE otherwise. -RC_GET_LINK_NUM Flag used in the RC_DATA_FLAGS mask to get link numbers in llCastRay() results. -RC_GET_NORMAL Flag used in the RC_DATA_FLAGS mask to get hit normals in llCastRay() results. -RC_GET_ROOT_KEY Flag used in the RC_DATA_FLAGS mask to get root keys in llCastRay() results. -RC_MAX_HITS Option for llCastRay() followed with an integer specifying the maximum number of hits to return (must be <= 256). -RC_REJECT_TYPES Option for llCastRay() used to ignore specific types of objects, followed with a bitwise combination of RC_REJECT_AGENTS, RC_REJECT_PHYSICAL, RC_REJECT_NONPHYSICAL and RC_REJECT_LAND. -RC_REJECT_AGENTS Flag used in the RC_REJECT_TYPES mask to reject agents in llCastRay(). -RC_REJECT_PHYSICAL Flag used in the RC_REJECT_TYPES mask to reject physical objects in llCastRay(). -RC_REJECT_NONPHYSICAL Flag used in the RC_REJECT_TYPES mask to reject non-physical objects in llCastRay(). -RC_REJECT_LAND Flag used in the RC_REJECT_TYPES mask to reject land in llCastRay(). +RC_DATA_FLAGS Option for llCastRay() followed with a bitwise combination of RC_GET_NORMAL, RC_GET_ROOT_KEY and RC_GET_LINK_NUM. +RC_DETECT_PHANTOM Option for llCastRay() followed with TRUE to detect phantom AND volume detect objects, FASLE otherwise. +RC_GET_LINK_NUM Flag used in the RC_DATA_FLAGS mask to get link numbers in llCastRay() results. +RC_GET_NORMAL Flag used in the RC_DATA_FLAGS mask to get hit normals in llCastRay() results. +RC_GET_ROOT_KEY Flag used in the RC_DATA_FLAGS mask to get root keys in llCastRay() results. +RC_MAX_HITS Option for llCastRay() followed with an integer specifying the maximum number of hits to return (must be <= 256). +RC_REJECT_TYPES Option for llCastRay() used to ignore specific types of objects, followed with a bitwise combination of RC_REJECT_AGENTS, RC_REJECT_PHYSICAL, RC_REJECT_NONPHYSICAL and RC_REJECT_LAND. +RC_REJECT_AGENTS Flag used in the RC_REJECT_TYPES mask to reject agents in llCastRay(). +RC_REJECT_PHYSICAL Flag used in the RC_REJECT_TYPES mask to reject physical objects in llCastRay(). +RC_REJECT_NONPHYSICAL Flag used in the RC_REJECT_TYPES mask to reject non-physical objects in llCastRay(). +RC_REJECT_LAND Flag used in the RC_REJECT_TYPES mask to reject land in llCastRay(). -RCERR_CAST_TIME_EXCEEDED Returned by llCastRay() when the raycast failed because the parcel or agent has exceeded the maximum time allowed for raycasting. -RCERR_SIM_PERF_LOW Returned by llCastRay() when the raycast failed because simulator performance is low. -RCERR_UNKNOWN Returned by llCastRay() when the raycast failed for an unspecified reason. +RCERR_CAST_TIME_EXCEEDED Returned by llCastRay() when the raycast failed because the parcel or agent has exceeded the maximum time allowed for raycasting. +RCERR_SIM_PERF_LOW Returned by llCastRay() when the raycast failed because simulator performance is low. +RCERR_UNKNOWN Returned by llCastRay() when the raycast failed for an unspecified reason. -ESTATE_ACCESS_ALLOWED_AGENT_ADD Used with llManageEstateAccess to add an agent to this estate's allowed residents list. -ESTATE_ACCESS_ALLOWED_AGENT_REMOVE Used with llManageEstateAccess to remove an agent from this estate's allowed residents list. -ESTATE_ACCESS_ALLOWED_GROUP_ADD Used with llManageEstateAccess to add a group to this estate's allowed groups list. -ESTATE_ACCESS_ALLOWED_GROUP_REMOVE Used with llManageEstateAccess to remove a group from this estate's allowed groups list. -ESTATE_ACCESS_BANNED_AGENT_ADD Used with llManageEstateAccess to add an agent to this estate's banned residents list. -ESTATE_ACCESS_BANNED_AGENT_REMOVE Used with llManageEstateAccess to remove an agent from this estate's banned residents list. +ESTATE_ACCESS_ALLOWED_AGENT_ADD Used with llManageEstateAccess to add an agent to this estate's allowed residents list. +ESTATE_ACCESS_ALLOWED_AGENT_REMOVE Used with llManageEstateAccess to remove an agent from this estate's allowed residents list. +ESTATE_ACCESS_ALLOWED_GROUP_ADD Used with llManageEstateAccess to add a group to this estate's allowed groups list. +ESTATE_ACCESS_ALLOWED_GROUP_REMOVE Used with llManageEstateAccess to remove a group from this estate's allowed groups list. +ESTATE_ACCESS_BANNED_AGENT_ADD Used with llManageEstateAccess to add an agent to this estate's banned residents list. +ESTATE_ACCESS_BANNED_AGENT_REMOVE Used with llManageEstateAccess to remove an agent from this estate's banned residents list. -DENSITY For use with llSetPhysicsMaterial() as a bitwise value in its material_bits parameter, to set the density. -FRICTION For use with llSetPhysicsMaterial() as a bitwise value in its material_bits parameter, to set the friction. -RESTITUTION For use with llSetPhysicsMaterial() as a bitwise value in its material_bits parameter, to set the restitution. -GRAVITY_MULTIPLIER For use with llSetPhysicsMaterial() as a bitwise value in its material_bits parameter, to set the gravity multiplier. +DENSITY For use with llSetPhysicsMaterial() as a bitwise value in its material_bits parameter, to set the density. +FRICTION For use with llSetPhysicsMaterial() as a bitwise value in its material_bits parameter, to set the friction. +RESTITUTION For use with llSetPhysicsMaterial() as a bitwise value in its material_bits parameter, to set the restitution. +GRAVITY_MULTIPLIER For use with llSetPhysicsMaterial() as a bitwise value in its material_bits parameter, to set the gravity multiplier. -SIM_STAT_PCT_CHARS_STEPPED Option for llGetSimStats() to return the % of pathfinding characters skipped each frame, averaged over the last minute. +SIM_STAT_PCT_CHARS_STEPPED Option for llGetSimStats() to return the % of pathfinding characters skipped each frame, averaged over the last minute. -KFM_COMMAND Option for llSetKeyframedMotion(), followed by one of KFM_CMD_STOP, KFM_CMD_PLAY, KFM_CMD_PAUSE. Note that KFM_COMMAND must be the only option in the list, and cannot be specified in the same function call that sets the keyframes list. -KFM_CMD_PLAY Option for llSetKeyframedMotion(), used after KFM_COMMAND to play the motion. -KFM_CMD_STOP Option for llSetKeyframedMotion(), used after KFM_COMMAND to stop the motion. -KFM_CMD_PAUSE Option for llSetKeyframedMotion(), used after KFM_COMMAND to pause the motion. -KFM_MODE Option for llSetKeyframedMotion(), used to specify the playback mode, followed by one of KFM_FORWARD, KFM_LOOP, KFM_PING_PONG or KFM_REVERSE. -KFM_FORWARD Option for llSetKeyframedMotion(), used after KFM_MODE to specify the forward playback mode. -KFM_LOOP Option for llSetKeyframedMotion(), used after KFM_MODE to specify the loop playback mode. -KFM_PING_PONG Option for llSetKeyframedMotion(), used after KFM_MODE to specify the ping pong playback mode. -KFM_REVERSE Option for llSetKeyframedMotion(), used after KFM_MODE to specify the reverse playback mode. -KFM_DATA Option for llSetKeyframedMotion(), followed by a bitwise combination of KFM_TRANSLATION and KFM_ROTATION. If you specify one or the other, you should only include translations or rotations in your keyframe list. -KFM_ROTATION Option for llSetKeyframedMotion(), used after KFM_DATA, possibly as a bitwise combination with KFM_TRANSLATION. -KFM_TRANSLATION Option for llSetKeyframedMotion(), used after KFM_DATA, possibly as a bitwise combination with KFM_ROTATION. +KFM_COMMAND Option for llSetKeyframedMotion(), followed by one of KFM_CMD_STOP, KFM_CMD_PLAY, KFM_CMD_PAUSE. Note that KFM_COMMAND must be the only option in the list, and cannot be specified in the same function call that sets the keyframes list. +KFM_CMD_PLAY Option for llSetKeyframedMotion(), used after KFM_COMMAND to play the motion. +KFM_CMD_STOP Option for llSetKeyframedMotion(), used after KFM_COMMAND to stop the motion. +KFM_CMD_PAUSE Option for llSetKeyframedMotion(), used after KFM_COMMAND to pause the motion. +KFM_MODE Option for llSetKeyframedMotion(), used to specify the playback mode, followed by one of KFM_FORWARD, KFM_LOOP, KFM_PING_PONG or KFM_REVERSE. +KFM_FORWARD Option for llSetKeyframedMotion(), used after KFM_MODE to specify the forward playback mode. +KFM_LOOP Option for llSetKeyframedMotion(), used after KFM_MODE to specify the loop playback mode. +KFM_PING_PONG Option for llSetKeyframedMotion(), used after KFM_MODE to specify the ping pong playback mode. +KFM_REVERSE Option for llSetKeyframedMotion(), used after KFM_MODE to specify the reverse playback mode. +KFM_DATA Option for llSetKeyframedMotion(), followed by a bitwise combination of KFM_TRANSLATION and KFM_ROTATION. If you specify one or the other, you should only include translations or rotations in your keyframe list. +KFM_ROTATION Option for llSetKeyframedMotion(), used after KFM_DATA, possibly as a bitwise combination with KFM_TRANSLATION. +KFM_TRANSLATION Option for llSetKeyframedMotion(), used after KFM_DATA, possibly as a bitwise combination with KFM_ROTATION. -CHARACTER_CMD_STOP Used with llExecCharacterCmd(). Makes the character jump. -CHARACTER_CMD_SMOOTH_STOP Used with llExecCharacterCmd(). Stops any current pathfinding operation in a smooth like fashion. -CHARACTER_CMD_JUMP Used with llExecCharacterCmd(). Stops any current pathfinding operation. +CHARACTER_CMD_STOP Used with llExecCharacterCmd(). Makes the character jump. +CHARACTER_CMD_SMOOTH_STOP Used with llExecCharacterCmd(). Stops any current pathfinding operation in a smooth like fashion. +CHARACTER_CMD_JUMP Used with llExecCharacterCmd(). Stops any current pathfinding operation. -CHARACTER_DESIRED_SPEED Speed of pursuit in meters per second. -CHARACTER_RADIUS Set collision capsule radius. -CHARACTER_LENGTH Set collision capsule length. -CHARACTER_ORIENTATION Set the character orientation. -CHARACTER_AVOIDANCE_MODE Allows you to specify that a character should not try to avoid other characters, should not try to avoid dynamic obstacles (relatively fast moving objects and avatars), or both. -CHARACTER_ACCOUNT_FOR_SKIPPED_FRAMES Defines if a character will attempt to catch up lost time if pathfinding performance is low. -PURSUIT_OFFSET Used with llPursue(). Go to a position offset from the target. -REQUIRE_LINE_OF_SIGHT Used with llPursue(). Define whether the character needs a physical line-of-sight to give chase. When enabled, the character will not pick a new target position while there is a something solid between the character and the target object/agent. -PURSUIT_FUZZ_FACTOR Used with llPursue(). Selects a random destination near the PURSUIT_OFFSET. The valid fuzz factor range is from 0 to 1, where 1 is most random. This option requires a nonzero PURSUIT_OFFSET. -PURSUIT_INTERCEPT Used with llPursue(). Define whether the character attempts to predict the target's future location. -PURSUIT_GOAL_TOLERANCE Used with llPursue(). Defines approximately how close the character must be to the current goal to consider itself to be at the desired position. The valid range is from 0.25 to 10m. -FORCE_DIRECT_PATH Used with llNavigateTo(). Makes character navigate in a straight line toward pos. May be set to TRUE or FALSE. -VERTICAL Constant to indicate that the orientation of the capsule for a Pathfinding character is vertical. -HORIZONTAL Constant to indicate that the orientation of the capsule for a Pathfinding character is horizontal. -AVOID_CHARACTERS TODO: add documentation -AVOID_DYNAMIC_OBSTACLES TODO: add documentation -AVOID_NONE TODO: add documentation +CHARACTER_DESIRED_SPEED Speed of pursuit in meters per second. +CHARACTER_RADIUS Set collision capsule radius. +CHARACTER_LENGTH Set collision capsule length. +CHARACTER_ORIENTATION Set the character orientation. +CHARACTER_AVOIDANCE_MODE Allows you to specify that a character should not try to avoid other characters, should not try to avoid dynamic obstacles (relatively fast moving objects and avatars), or both. +CHARACTER_ACCOUNT_FOR_SKIPPED_FRAMES Defines if a character will attempt to catch up lost time if pathfinding performance is low. +PURSUIT_OFFSET Used with llPursue(). Go to a position offset from the target. +REQUIRE_LINE_OF_SIGHT Used with llPursue(). Define whether the character needs a physical line-of-sight to give chase. When enabled, the character will not pick a new target position while there is a something solid between the character and the target object/agent. +PURSUIT_FUZZ_FACTOR Used with llPursue(). Selects a random destination near the PURSUIT_OFFSET. The valid fuzz factor range is from 0 to 1, where 1 is most random. This option requires a nonzero PURSUIT_OFFSET. +PURSUIT_INTERCEPT Used with llPursue(). Define whether the character attempts to predict the target's future location. +PURSUIT_GOAL_TOLERANCE Used with llPursue(). Defines approximately how close the character must be to the current goal to consider itself to be at the desired position. The valid range is from 0.25 to 10m. +FORCE_DIRECT_PATH Used with llNavigateTo(). Makes character navigate in a straight line toward pos. May be set to TRUE or FALSE. +VERTICAL Constant to indicate that the orientation of the capsule for a Pathfinding character is vertical. +HORIZONTAL Constant to indicate that the orientation of the capsule for a Pathfinding character is horizontal. +AVOID_CHARACTERS TODO: add documentation +AVOID_DYNAMIC_OBSTACLES TODO: add documentation +AVOID_NONE TODO: add documentation PU_EVADE_HIDDEN Triggered when an llEvade character thinks it has hidden from its pursuer. PU_EVADE_SPOTTED Triggered when an llEvade character switches from hiding to running PU_FAILURE_INVALID_GOAL Goal is not on the navigation-mesh and cannot be reached. PU_FAILURE_INVALID_START Character cannot navigate from the current location - e.g., the character is off the navmesh or too high above it. PU_FAILURE_NO_VALID_DESTINATION There's no good place for the character to go - e.g., it is patrolling and all the patrol points are now unreachable. -PU_FAILURE_OTHER Unknown failure +PU_FAILURE_OTHER Unknown failure PU_FAILURE_TARGET_GONE Target (for llPursue or llEvade) can no longer be tracked - e.g., it left the region or is an avatar that is now more than about 30m outside the region. PU_FAILURE_UNREACHABLE Goal is no longer reachable for some reason - e.g., an obstacle blocks the path. PU_GOAL_REACHED Character has reached the goal and will stop or choose a new goal (if wandering). @@ -720,56 +720,56 @@ PU_FAILURE_NO_NAVMESH Triggered if no navmesh is available for the re PU_FAILURE_DYNAMIC_PATHFINDING_DISABLED Triggered when a character enters a region with dynamic pathfinding disabled. PU_FAILURE_PARCEL_UNREACHABLE Triggered when a character failed to enter a parcel because it is not allowed to enter, e.g. because the parcel is already full or because object entry was disabled after the navmesh was baked. -CHARACTER_TYPE Specifies which walkability coefficient will be used by this character. -CHARACTER_TYPE_A Used for character types that you prefer move in a way consistent with humanoids. -CHARACTER_TYPE_B Used for character types that you prefer move in a way consistent with wild animals or off road vehicles. -CHARACTER_TYPE_C Used for mechanical character types or road going vehicles. -CHARACTER_TYPE_D Used for character types that are not consistent with the A, B, or C type. -CHARACTER_TYPE_NONE Used to set no specific character type. +CHARACTER_TYPE Specifies which walkability coefficient will be used by this character. +CHARACTER_TYPE_A Used for character types that you prefer move in a way consistent with humanoids. +CHARACTER_TYPE_B Used for character types that you prefer move in a way consistent with wild animals or off road vehicles. +CHARACTER_TYPE_C Used for mechanical character types or road going vehicles. +CHARACTER_TYPE_D Used for character types that are not consistent with the A, B, or C type. +CHARACTER_TYPE_NONE Used to set no specific character type. -TRAVERSAL_TYPE Controls the speed at which characters moves on terrain that is less than 100% walkable will move faster (e.g., a cat crossing a street) or slower (e.g., a car driving in a swamp). -TRAVERSAL_TYPE_SLOW TODO: add documentation -TRAVERSAL_TYPE_FAST TODO: add documentation -TRAVERSAL_TYPE_NONE TODO: add documentation +TRAVERSAL_TYPE Controls the speed at which characters moves on terrain that is less than 100% walkable will move faster (e.g., a cat crossing a street) or slower (e.g., a car driving in a swamp). +TRAVERSAL_TYPE_SLOW TODO: add documentation +TRAVERSAL_TYPE_FAST TODO: add documentation +TRAVERSAL_TYPE_NONE TODO: add documentation -CHARACTER_MAX_ACCEL The character's maximum acceleration rate. -CHARACTER_MAX_DECEL The character's maximum deceleration rate. -CHARACTER_MAX_ANGULAR_SPEED TODO: add documentation -CHARACTER_MAX_ANGULAR_ACCEL TODO: add documentation -CHARACTER_TURN_SPEED_MULTIPLIER TODO: add documentation -CHARACTER_DESIRED_TURN_SPEED The character's maximum speed while turning--note that this is only loosely enforced (i.e., a character may turn at higher speeds under certain conditions) -CHARACTER_MAX_TURN_RADIUS The character's turn radius when traveling at CHARACTER_DESIRED_TURN_SPEED. -CHARACTER_MAX_SPEED The character's maximum speed. Affects speed when avoiding dynamic obstacles and when traversing low-walkability objects in TRAVERSAL_TYPE_FAST mode. -CHARACTER_STAY_WITHIN_PARCEL Characters which have CHARACTER_STAY_WITHIN_PARCEL set to TRUE treat the parcel boundaries as one-way obstacles. +CHARACTER_MAX_ACCEL The character's maximum acceleration rate. +CHARACTER_MAX_DECEL The character's maximum deceleration rate. +CHARACTER_MAX_ANGULAR_SPEED TODO: add documentation +CHARACTER_MAX_ANGULAR_ACCEL TODO: add documentation +CHARACTER_TURN_SPEED_MULTIPLIER TODO: add documentation +CHARACTER_DESIRED_TURN_SPEED The character's maximum speed while turning--note that this is only loosely enforced (i.e., a character may turn at higher speeds under certain conditions) +CHARACTER_MAX_TURN_RADIUS The character's turn radius when traveling at CHARACTER_DESIRED_TURN_SPEED. +CHARACTER_MAX_SPEED The character's maximum speed. Affects speed when avoiding dynamic obstacles and when traversing low-walkability objects in TRAVERSAL_TYPE_FAST mode. +CHARACTER_STAY_WITHIN_PARCEL Characters which have CHARACTER_STAY_WITHIN_PARCEL set to TRUE treat the parcel boundaries as one-way obstacles. -PATROL_PAUSE_AT_WAYPOINTS Used with llPatrolPoints(). Defines if characters slow down and momentarily pause at each waypoint. -WANDER_PAUSE_AT_WAYPOINTS Used with llWanderWithin(). Defines if characters should pause after reaching each wander waypoint. +PATROL_PAUSE_AT_WAYPOINTS Used with llPatrolPoints(). Defines if characters slow down and momentarily pause at each waypoint. +WANDER_PAUSE_AT_WAYPOINTS Used with llWanderWithin(). Defines if characters should pause after reaching each wander waypoint. -CONTENT_TYPE_TEXT text/plain -CONTENT_TYPE_HTML text/html -CONTENT_TYPE_XML application/xml -CONTENT_TYPE_XHTML application/xhtml+xml -CONTENT_TYPE_ATOM application/atom+xml -CONTENT_TYPE_JSON application/json -CONTENT_TYPE_LLSD application/llsd+xml -CONTENT_TYPE_FORM application/x-www-form-urlencoded -CONTENT_TYPE_RSS application/rss+xml +CONTENT_TYPE_TEXT text/plain +CONTENT_TYPE_HTML text/html +CONTENT_TYPE_XML application/xml +CONTENT_TYPE_XHTML application/xhtml+xml +CONTENT_TYPE_ATOM application/atom+xml +CONTENT_TYPE_JSON application/json +CONTENT_TYPE_LLSD application/llsd+xml +CONTENT_TYPE_FORM application/x-www-form-urlencoded +CONTENT_TYPE_RSS application/rss+xml -JSON_INVALID Returned by llJsonGetValue and llJsonValueType if the specifiers to do specify a valid in the json value. -JSON_OBJECT Represents a json datatype represented in LSL as a strided list of name/value pairs -JSON_ARRAY Represents a json datatype mappable to the LSL datatype "list" -JSON_NUMBER Represents a json datatype mappable to the LSL datatypes "integer" and "float" -JSON_STRING Represents a json datatype mappable to the LSL datatype "string" -JSON_TRUE Represents the constant "true" of a json value. -JSON_FALSE Represents the constant "false" of a json value. -JSON_NULL Represents the constant "null" of a json value. -JSON_APPEND Used with llJsonSetValue as a specifier to indicate appending the value to the end of the array at that level. +JSON_INVALID Returned by llJsonGetValue and llJsonValueType if the specifiers to do specify a valid in the json value. +JSON_OBJECT Represents a json datatype represented in LSL as a strided list of name/value pairs +JSON_ARRAY Represents a json datatype mappable to the LSL datatype "list" +JSON_NUMBER Represents a json datatype mappable to the LSL datatypes "integer" and "float" +JSON_STRING Represents a json datatype mappable to the LSL datatype "string" +JSON_TRUE Represents the constant "true" of a json value. +JSON_FALSE Represents the constant "false" of a json value. +JSON_NULL Represents the constant "null" of a json value. +JSON_APPEND Used with llJsonSetValue as a specifier to indicate appending the value to the end of the array at that level. -ERR_GENERIC Returned by llReturnObjectsByID and llReturnObjectsByOwner in case of a general error. -ERR_PARCEL_PERMISSIONS Returned by llReturnObjectsByID and llReturnObjectsByOwner in case of a parcel owner permission error. -ERR_MALFORMED_PARAMS Returned by llReturnObjectsByID and llReturnObjectsByOwner in case of malformed parameters. -ERR_RUNTIME_PERMISSIONS Returned by llReturnObjectsByID and llReturnObjectsByOwner in case of a runtime permission error. -ERR_THROTTLED Returned by llReturnObjectsByID and llReturnObjectsByOwner in case of being throttled. +ERR_GENERIC Returned by llReturnObjectsByID and llReturnObjectsByOwner in case of a general error. +ERR_PARCEL_PERMISSIONS Returned by llReturnObjectsByID and llReturnObjectsByOwner in case of a parcel owner permission error. +ERR_MALFORMED_PARAMS Returned by llReturnObjectsByID and llReturnObjectsByOwner in case of malformed parameters. +ERR_RUNTIME_PERMISSIONS Returned by llReturnObjectsByID and llReturnObjectsByOwner in case of a runtime permission error. +ERR_THROTTLED Returned by llReturnObjectsByID and llReturnObjectsByOwner in case of being throttled. # --- OpenSim and Aurora-Sim constants Below --- # OpenSim Constants (\OpenSim\Region\ScriptEngine\Shared\Api\Runtime\LSL_Constants.cs) @@ -793,26 +793,26 @@ OS_ATTACH_MSG_SCRIPT_CREATOR Used with osMessageAttachements PARCEL_DETAILS_CLAIMDATE Used with osSetParcelDetails # osGetRegionStats STATS_TIME_DILATION returned value from osGetRegionStats(), 1st of 21 items in returned list. -STATS_SIM_FPS returned value from osGetRegionStats(), 2nd of 21 items in returned list. -STATS_PHYSICS_FPS returned value from osGetRegionStats(), 3rd of 21 items in returned list. +STATS_SIM_FPS returned value from osGetRegionStats(), 2nd of 21 items in returned list. +STATS_PHYSICS_FPS returned value from osGetRegionStats(), 3rd of 21 items in returned list. STATS_AGENT_UPDATES returned value from osGetRegionStats(), 4th of 21 items in returned list. -STATS_ROOT_AGENTS returned value from osGetRegionStats(), 5th of 21 items in returned list. -STATS_CHILD_AGENTS returned value from osGetRegionStats(), 6th of 21 items in returned list. -STATS_TOTAL_PRIMS returned value from osGetRegionStats(), 7th of 21 items in returned list. -STATS_ACTIVE_PRIMS returned value from osGetRegionStats(), 8th of 21 items in returned list. +STATS_ROOT_AGENTS returned value from osGetRegionStats(), 5th of 21 items in returned list. +STATS_CHILD_AGENTS returned value from osGetRegionStats(), 6th of 21 items in returned list. +STATS_TOTAL_PRIMS returned value from osGetRegionStats(), 7th of 21 items in returned list. +STATS_ACTIVE_PRIMS returned value from osGetRegionStats(), 8th of 21 items in returned list. STATS_FRAME_MS returned value from osGetRegionStats(), 9th of 21 items in returned list. STATS_NET_MS returned value from osGetRegionStats(), 10th of 21 items in returned list. -STATS_PHYSICS_MS returned value from osGetRegionStats(), 11th of 21 items in returned list. +STATS_PHYSICS_MS returned value from osGetRegionStats(), 11th of 21 items in returned list. STATS_IMAGE_MS returned value from osGetRegionStats(), 12th of 21 items in returned list. STATS_OTHER_MS returned value from osGetRegionStats(), 13th of 21 items in returned list. STATS_IN_PACKETS_PER_SECOND returned value from osGetRegionStats(), 14th of 21 items in returned list. STATS_OUT_PACKETS_PER_SECOND returned value from osGetRegionStats(), 15th of 21 items in returned list. STATS_UNACKED_BYTES returned value from osGetRegionStats(), 16th of 21 items in returned list. -STATS_AGENT_MS returned value from osGetRegionStats(), 17th of 21 items in returned list. +STATS_AGENT_MS returned value from osGetRegionStats(), 17th of 21 items in returned list. STATS_PENDING_DOWNLOADS returned value from osGetRegionStats(), 18th of 21 items in returned list. STATS_PENDING_UPLOADS returned value from osGetRegionStats(), 19th of 21 items in returned list. -STATS_ACTIVE_SCRIPTS returned value from osGetRegionStats(), 20th of 21 items in returned list. -STATS_SCRIPT_LPS returned value from osGetRegionStats(), 21st of 21 items in returned list. +STATS_ACTIVE_SCRIPTS returned value from osGetRegionStats(), 20th of 21 items in returned list. +STATS_SCRIPT_LPS returned value from osGetRegionStats(), 21st of 21 items in returned list. # OpenSim NPC OS_NPC used by osNPC. Value 0x01000000 OS_NPC_FLY used by osNPC. Value 0 @@ -824,43 +824,43 @@ OS_NPC_NOT_OWNED used by osNPC. Value 0x2 OS_NPC_SENSE_AS_AGENT used by osNPC. Value 0x4 OS_NPC_RUNNING used by osNPC. Value 4 # Windlight/Lightshare -WL_WATER_COLOR Windlight Water Colour -WL_WATER_FOG_DENSITY_EXPONENT Windlight Water Fog Density Exponent -WL_UNDERWATER_FOG_MODIFIER Windlight Underwater Fog Modifier -WL_REFLECTION_WAVELET_SCALE Windlight Reflection Wavelet Scale -WL_FRESNEL_SCALE Windlight Fresnel Scale -WL_FRESNEL_OFFSET Windlight Fresnel Offset -WL_REFRACT_SCALE_ABOVE Windlight Refract Scale Above -WL_REFRACT_SCALE_BELOW Windlight Refract Scale Below -WL_BLUR_MULTIPLIER Windlight Blur Multiplier -WL_BIG_WAVE_DIRECTION Windlight Big Wave Direction -WL_LITTLE_WAVE_DIRECTION Windlight Little Wave Direction -WL_NORMAL_MAP_TEXTURE Windlight Normal Map Texture -WL_HORIZON Windlight Horizon Colour -WL_HAZE_HORIZON Windlight Haze Horizon -WL_BLUE_DENSITY Windlight Blue Density -WL_HAZE_DENSITY Windlight Haze Density -WL_DENSITY_MULTIPLIER Windlight Density Multiplier -WL_DISTANCE_MULTIPLIER Windlight Distance Multiplier -WL_MAX_ALTITUDE Windlight Max Altitude -WL_SUN_MOON_COLOR Windlight Sun/Moon Colour -WL_SUN_MOON_POSITION Windlight Sun/Moon Position -WL_AMBIENT Windlight Ambient Colour -WL_EAST_ANGLE Windlight Sun/Position East -WL_SUN_GLOW_FOCUS Windlight Sun Glow Focus -WL_SUN_GLOW_SIZE Windlight Sun Glow Size -WL_SCENE_GAMMA Windlight Scene Gamma -WL_STAR_BRIGHTNESS Windlight Star Brightness -WL_CLOUD_COLOR Windlight Cloud Colour -WL_CLOUD_XY_DENSITY Windlight Cloud X/Y/Density -WL_CLOUD_COVERAGE Windlight Cloud Coverage -WL_CLOUD_SCALE Windlight Cloud Scale -WL_CLOUD_DETAIL_XY_DENSITY Windlight Cloud Detail X/Y/Density -WL_CLOUD_SCROLL_X Windlight Cloud Scroll X -WL_CLOUD_SCROLL_Y Windlight Cloud Scroll Y -WL_CLOUD_SCROLL_Y_LOCK Windlight Cloud Scroll Y Lock -WL_CLOUD_SCROLL_X_LOCK Windlight Cloud Scroll X Lock -WL_DRAW_CLASSIC_CLOUDS Windlight Draw Classic Clouds +WL_WATER_COLOR Windlight Water Colour +WL_WATER_FOG_DENSITY_EXPONENT Windlight Water Fog Density Exponent +WL_UNDERWATER_FOG_MODIFIER Windlight Underwater Fog Modifier +WL_REFLECTION_WAVELET_SCALE Windlight Reflection Wavelet Scale +WL_FRESNEL_SCALE Windlight Fresnel Scale +WL_FRESNEL_OFFSET Windlight Fresnel Offset +WL_REFRACT_SCALE_ABOVE Windlight Refract Scale Above +WL_REFRACT_SCALE_BELOW Windlight Refract Scale Below +WL_BLUR_MULTIPLIER Windlight Blur Multiplier +WL_BIG_WAVE_DIRECTION Windlight Big Wave Direction +WL_LITTLE_WAVE_DIRECTION Windlight Little Wave Direction +WL_NORMAL_MAP_TEXTURE Windlight Normal Map Texture +WL_HORIZON Windlight Horizon Colour +WL_HAZE_HORIZON Windlight Haze Horizon +WL_BLUE_DENSITY Windlight Blue Density +WL_HAZE_DENSITY Windlight Haze Density +WL_DENSITY_MULTIPLIER Windlight Density Multiplier +WL_DISTANCE_MULTIPLIER Windlight Distance Multiplier +WL_MAX_ALTITUDE Windlight Max Altitude +WL_SUN_MOON_COLOR Windlight Sun/Moon Colour +WL_SUN_MOON_POSITION Windlight Sun/Moon Position +WL_AMBIENT Windlight Ambient Colour +WL_EAST_ANGLE Windlight Sun/Position East +WL_SUN_GLOW_FOCUS Windlight Sun Glow Focus +WL_SUN_GLOW_SIZE Windlight Sun Glow Size +WL_SCENE_GAMMA Windlight Scene Gamma +WL_STAR_BRIGHTNESS Windlight Star Brightness +WL_CLOUD_COLOR Windlight Cloud Colour +WL_CLOUD_XY_DENSITY Windlight Cloud X/Y/Density +WL_CLOUD_COVERAGE Windlight Cloud Coverage +WL_CLOUD_SCALE Windlight Cloud Scale +WL_CLOUD_DETAIL_XY_DENSITY Windlight Cloud Detail X/Y/Density +WL_CLOUD_SCROLL_X Windlight Cloud Scroll X +WL_CLOUD_SCROLL_Y Windlight Cloud Scroll Y +WL_CLOUD_SCROLL_Y_LOCK Windlight Cloud Scroll Y Lock +WL_CLOUD_SCROLL_X_LOCK Windlight Cloud Scroll X Lock +WL_DRAW_CLASSIC_CLOUDS Windlight Draw Classic Clouds # WL Constants added unique to Aurora-Sim WL_OK Value -1 WL_ERROR Value -2 @@ -874,74 +874,74 @@ ENABLE_GRAVITY enable_gravity. GRAVITY_FORCE_X gravity_force_x. GRAVITY_FORCE_Y gravity_force_y. GRAVITY_FORCE_Z gravity_force_z. -ADD_GRAVITY_POINT add_gravity_point. -ADD_GRAVITY_FORCE add_gravity_force. -START_TIME_REVERSAL_SAVING start_time_reversal_saving. -STOP_TIME_REVERSAL_SAVING stop_time_reversal_saving. -START_TIME_REVERSAL start_time_reversal. -STOP_TIME_REVERSAL stop_time_reversal. +ADD_GRAVITY_POINT add_gravity_point. +ADD_GRAVITY_FORCE add_gravity_force. +START_TIME_REVERSAL_SAVING start_time_reversal_saving. +STOP_TIME_REVERSAL_SAVING stop_time_reversal_saving. +START_TIME_REVERSAL start_time_reversal. +STOP_TIME_REVERSAL stop_time_reversal. # Aurora botFunctions -BOT_FOLLOW_FLAG_NONE value 0. +BOT_FOLLOW_FLAG_NONE value 0. BOT_FOLLOW_FLAG_INDEFINITELY value 1. -BOT_TAG_FIND_ALL value AllBots. +BOT_TAG_FIND_ALL value AllBots. BOT_FOLLOW_WALK value 0. BOT_FOLLOW_RUN value 1. BOT_FOLLOW_FLY value 2. -BOT_FOLLOW_TELEPORT value 3. +BOT_FOLLOW_TELEPORT value 3. BOT_FOLLOW_WAIT value 4. -BOT_FOLLOW_TRIGGER_HERE_EVENT value 1. +BOT_FOLLOW_TRIGGER_HERE_EVENT value 1. BOT_FOLLOW_FLAG_FORCEDIRECTPATH value 4. # string constants [word .679, .503, .996] -NULL_KEY Indicates an empty key -EOF Indicates the last line of a notecard was read -TEXTURE_BLANK UUID for the "Blank" texture -TEXTURE_DEFAULT Alias for TEXTURE_PLYWOOD -TEXTURE_MEDIA UUID for the "Default Media" texture -TEXTURE_PLYWOOD UUID for the default "Plywood" texture -TEXTURE_TRANSPARENT UUID for the "White - Transparent" texture +NULL_KEY Indicates an empty key +EOF Indicates the last line of a notecard was read +TEXTURE_BLANK UUID for the "Blank" texture +TEXTURE_DEFAULT Alias for TEXTURE_PLYWOOD +TEXTURE_MEDIA UUID for the "Default Media" texture +TEXTURE_PLYWOOD UUID for the default "Plywood" texture +TEXTURE_TRANSPARENT UUID for the "White - Transparent" texture -URL_REQUEST_GRANTED Used with http_request when a public URL is successfully granted -URL_REQUEST_DENIED Used with http_request when a public URL is not available +URL_REQUEST_GRANTED Used with http_request when a public URL is successfully granted +URL_REQUEST_DENIED Used with http_request when a public URL is not available # float constants [word .679, .503, .996] -PI 3.1415926535897932384626433832795 -TWO_PI 6.283185307179586476925286766559 -PI_BY_TWO 1.5707963267948966192313216916398 -DEG_TO_RAD To convert from degrees to radians -RAD_TO_DEG To convert from radians to degrees -SQRT2 1.4142135623730950488016887242097 +PI 3.1415926535897932384626433832795 +TWO_PI 6.283185307179586476925286766559 +PI_BY_TWO 1.5707963267948966192313216916398 +DEG_TO_RAD To convert from degrees to radians +RAD_TO_DEG To convert from radians to degrees +SQRT2 1.4142135623730950488016887242097 # compound constants [word .679, .503, .996] -ZERO_VECTOR <0.0, 0.0, 0.0> -ZERO_ROTATION <0.0, 0.0, 0.0, 1.0> +ZERO_VECTOR <0.0, 0.0, 0.0> +ZERO_ROTATION <0.0, 0.0, 0.0, 1.0> # flow control keywords [word .972, .148, .445] -for for loop:for (initializer; test; iteration):{: statements:} -do do loop:do:{: statements:} while (test); -while while loop:while (test):{ statements:} -if if statement:if (test):{ statements:} -else else clause:if (test):{ statements:}:else:{ statements:} -jump jump statement:jump label;: -return Leave current function or event handler +for for loop:for (initializer; test; iteration):{: statements:} +do do loop:do:{: statements:} while (test); +while while loop:while (test):{ statements:} +if if statement:if (test):{ statements:} +else else clause:if (test):{ statements:}:else:{ statements:} +jump jump statement:jump label;: +return Leave current function or event handler # flow control label [line .972, .148, .445] -@ Label:Target for jump statement +@ Label:Target for jump statement # Comment [one_sided_delimiter .457, .441, .367] -// Comment:Non-functional commentary or disabled code +// Comment:Non-functional commentary or disabled code [two_sided_delimiter .457, .441, .367] -/* */ Comment:Non-functional commentary or disabled code +/* */ Comment:Non-functional commentary or disabled code # String literals [double_quotation_marks .989, .855, .453] -" String literal +" String literal #functions are supplied by the program now diff --git a/indra/newview/skins/default/textures/inv_item_unknown.tga b/indra/newview/skins/default/textures/inv_item_unknown.tga new file mode 100644 index 000000000..caaea931a Binary files /dev/null and b/indra/newview/skins/default/textures/inv_item_unknown.tga differ diff --git a/indra/newview/skins/default/xui/de/floater_about_land.xml b/indra/newview/skins/default/xui/de/floater_about_land.xml index 4b4743352..b3ffed9f9 100644 --- a/indra/newview/skins/default/xui/de/floater_about_land.xml +++ b/indra/newview/skins/default/xui/de/floater_about_land.xml @@ -1,14 +1,14 @@ - + Name: Beschreibung: Typ: Mainland / Homestead - Einstufung: + Einstuf.: Adult Eigentümer: Leyla Linden @@ -44,7 +44,7 @@ - - - - - - - + - - - - - - + + - - - - - - - - - + + + - - - - - - - - - - - - - - - - - - + + + + + + Lineal: Welt @@ -77,9 +53,7 @@ - + + + + + + + + + - - + - - + - - - - - - + + + + + - - Warning: the home page specified in the General tab fails to -pass this whitelist. It has been disabled until a valid entry -has been added. + - - - + + + + + + + + + + + - - - - - + + + + + + + Object Info + Name: [NAME] + Exportable Prims: [COUNT]/[TOTAL] + Exportable Textures: [COUNT]/[TOTAL] + + + Options + + + + + TGA + PNG + J2C + BMP + JPG + + + + + + + + diff --git a/indra/newview/skins/default/xui/en-us/floater_god_tools.xml b/indra/newview/skins/default/xui/en-us/floater_god_tools.xml index 01ec39ad0..e8f452cac 100644 --- a/indra/newview/skins/default/xui/en-us/floater_god_tools.xml +++ b/indra/newview/skins/default/xui/en-us/floater_god_tools.xml @@ -187,10 +187,10 @@ - - + mouse_opaque="true" name="billable factor" label_width="20" width="80"> + + - - + name="land cost" label_width="20" width="80"> + + - - - diff --git a/indra/newview/skins/default/xui/en-us/floater_instant_message.xml b/indra/newview/skins/default/xui/en-us/floater_instant_message.xml index d72e92a0c..53a441397 100644 --- a/indra/newview/skins/default/xui/en-us/floater_instant_message.xml +++ b/indra/newview/skins/default/xui/en-us/floater_instant_message.xml @@ -12,14 +12,21 @@ Text chat is not available for this call. Inventory item offered - - - - - + + - RP Mode -