Compare commits
137 Commits
sv-1.8.7.8
...
sv-1.8.9.8
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
788b83bff3 | ||
|
|
c201ac90ba | ||
|
|
af3c66ad08 | ||
|
|
9bffc4bb82 | ||
|
|
132db6225e | ||
|
|
257086cbfc | ||
|
|
7755f1ec52 | ||
|
|
c5f1ac808b | ||
|
|
1a8660909d | ||
|
|
e6826a4c7c | ||
|
|
801bb8a075 | ||
|
|
b2c965e22d | ||
|
|
be3cbc642b | ||
|
|
24331d3c90 | ||
|
|
8a16e6c99f | ||
|
|
f36e8fbeca | ||
|
|
718ef09adf | ||
|
|
6443849ea9 | ||
|
|
cbb7e473ba | ||
|
|
118957362f | ||
|
|
ed7f73769f | ||
|
|
ae15dcb318 | ||
|
|
c4af22481c | ||
|
|
ae17f76bb4 | ||
|
|
7e62d17fda | ||
|
|
f9185e8bc8 | ||
|
|
1361f9b57d | ||
|
|
b86eae026b | ||
|
|
79d938a4f4 | ||
|
|
23068a70a2 | ||
|
|
0aa5e0bb88 | ||
|
|
5040275969 | ||
|
|
1daccf40ee | ||
|
|
4fd302286b | ||
|
|
18f9f19e61 | ||
|
|
1de6d4461a | ||
|
|
4198f47ab6 | ||
|
|
d9049ba342 | ||
|
|
f75ac3e4c2 | ||
|
|
06698deaca | ||
|
|
445eb29bd3 | ||
|
|
cc034f6841 | ||
|
|
3c368651f1 | ||
|
|
321730e384 | ||
|
|
c2fd88670f | ||
|
|
7b03103a1f | ||
|
|
ac3e19c91a | ||
|
|
4c7d2224e3 | ||
|
|
3ab800d99e | ||
|
|
332cef0f84 | ||
|
|
9de6d7627b | ||
|
|
98b42e88c1 | ||
|
|
e642e9561a | ||
|
|
77f500cb64 | ||
|
|
d04a8fc677 | ||
|
|
6028ae7b61 | ||
|
|
347c2cbd8b | ||
|
|
919ffb314b | ||
|
|
c033d69d54 | ||
|
|
356d289972 | ||
|
|
eeabbce377 | ||
|
|
0b992fdd46 | ||
|
|
a7e56d2af9 | ||
|
|
b10619e4d8 | ||
|
|
74518f299c | ||
|
|
407b527a55 | ||
|
|
b21cc835b2 | ||
|
|
4de8c3a38e | ||
|
|
72d8b8f78c | ||
|
|
45f4f601bf | ||
|
|
731283aa0b | ||
|
|
89ce328ba5 | ||
|
|
28e5270d87 | ||
|
|
4a237de72a | ||
|
|
e91aac1dd9 | ||
|
|
7cab44a17d | ||
|
|
cf57624688 | ||
|
|
c7448f290d | ||
|
|
55f9937238 | ||
|
|
ac1ef4d1ba | ||
|
|
ee1baafb59 | ||
|
|
9522e385cd | ||
|
|
a9b047b168 | ||
|
|
8c6e6143c2 | ||
|
|
0704876dfd | ||
|
|
54b75a3219 | ||
|
|
11d59d1b00 | ||
|
|
4e042db404 | ||
|
|
0f6285b2e9 | ||
|
|
a3d2107bfd | ||
|
|
a66c91bc5a | ||
|
|
4602602a5f | ||
|
|
0511d5903a | ||
|
|
7597ce3b37 | ||
|
|
7509d929d8 | ||
|
|
c7e03600aa | ||
|
|
4871f5ed8e | ||
|
|
e5a6f1e2d9 | ||
|
|
a29491658b | ||
|
|
26976b715d | ||
|
|
8d564d6ed1 | ||
|
|
18fbac26dc | ||
|
|
9f82933149 | ||
|
|
9b7aa959b0 | ||
|
|
1c46c26e6b | ||
|
|
506c6aaa9e | ||
|
|
dd61d475cb | ||
|
|
6e5eed7957 | ||
|
|
7859c0a191 | ||
|
|
ef46d21582 | ||
|
|
5071c1e0cf | ||
|
|
ecd52a9e1a | ||
|
|
0a6a47a099 | ||
|
|
9880fe225e | ||
|
|
5d44552a60 | ||
|
|
ffa32f8c98 | ||
|
|
b7086a993d | ||
|
|
d2d172f6ec | ||
|
|
34f6ea4db2 | ||
|
|
d8c4db17f2 | ||
|
|
c340dde03d | ||
|
|
e502b87b63 | ||
|
|
d6f320fb5e | ||
|
|
e4eca079e6 | ||
|
|
68ceac3678 | ||
|
|
991d603a0c | ||
|
|
74a6f7382a | ||
|
|
9264482dc3 | ||
|
|
1a61c49fc7 | ||
|
|
c2480d7227 | ||
|
|
72b5976605 | ||
|
|
1b742aa933 | ||
|
|
9412f631fa | ||
|
|
be07df3043 | ||
|
|
8f89127900 | ||
|
|
c72059e73f | ||
|
|
2fc2b7c12b |
@@ -410,11 +410,11 @@
|
||||
<key>archive</key>
|
||||
<map>
|
||||
<key>hash</key>
|
||||
<string>4614b29cc98021cf1770a8290171602b</string>
|
||||
<string>a96fda7ad5cee967823f5c94390ba35b</string>
|
||||
<key>hash_algorithm</key>
|
||||
<string>md5</string>
|
||||
<key>url</key>
|
||||
<string>https://pkg.alchemyviewer.org/repository/autobuild-external/crashpad/windows/crashpad-ce32d093.7-windows-7.tar.bz2</string>
|
||||
<string>https://pkg.alchemyviewer.org/repository/autobuild-external/crashpad/windows/crashpad-c6d76a90.194-windows-194.tar.bz2</string>
|
||||
</map>
|
||||
<key>name</key>
|
||||
<string>windows</string>
|
||||
@@ -424,18 +424,18 @@
|
||||
<key>archive</key>
|
||||
<map>
|
||||
<key>hash</key>
|
||||
<string>d801461b7a6a40fffab828aa1e01e3e6</string>
|
||||
<string>5ff95ca1007ed2dc300b59de17453201</string>
|
||||
<key>hash_algorithm</key>
|
||||
<string>md5</string>
|
||||
<key>url</key>
|
||||
<string>https://pkg.alchemyviewer.org/repository/autobuild-external/crashpad/windows64/crashpad-ce32d093.7-windows64-7.tar.bz2</string>
|
||||
<string>https://pkg.alchemyviewer.org/repository/autobuild-external/crashpad/windows64/crashpad-c6d76a90.194-windows64-194.tar.bz2</string>
|
||||
</map>
|
||||
<key>name</key>
|
||||
<string>windows64</string>
|
||||
</map>
|
||||
</map>
|
||||
<key>version</key>
|
||||
<string>ce32d093.7</string>
|
||||
<string>c6d76a90.194</string>
|
||||
</map>
|
||||
<key>curl</key>
|
||||
<map>
|
||||
@@ -664,11 +664,11 @@
|
||||
<key>archive</key>
|
||||
<map>
|
||||
<key>hash</key>
|
||||
<string>06746b78827e9a0c6b666bd2528d36ad</string>
|
||||
<string>695efb6fc548a56dc4ff34e8d9a37bfb</string>
|
||||
<key>hash_algorithm</key>
|
||||
<string>md5</string>
|
||||
<key>url</key>
|
||||
<string>https://bitbucket.org/SingularityViewer/libraries/downloads/dullahan-1.1.1320_73.1.12%252Bgee4b49f%252Bchromium-73.0.3683.75-linux64-192030536.tar.bz2</string>
|
||||
<string>https://bitbucket.org/router_gray/3p-dullahan/downloads/dullahan-1.3.202002250830_79.1.38_gecefb59_chromium-79.0.3945.130-linux64-200580406.tar.bz2</string>
|
||||
</map>
|
||||
<key>name</key>
|
||||
<string>linux64</string>
|
||||
@@ -1933,38 +1933,6 @@
|
||||
<key>version</key>
|
||||
<string>7.11.1.297294</string>
|
||||
</map>
|
||||
<key>modernjson</key>
|
||||
<map>
|
||||
<key>copyright</key>
|
||||
<string>Copyright (c) 2013-2018 Niels Lohmann</string>
|
||||
<key>description</key>
|
||||
<string>JSON for Modern C++</string>
|
||||
<key>license</key>
|
||||
<string>MIT</string>
|
||||
<key>license_file</key>
|
||||
<string>LICENSES/modernjson.txt</string>
|
||||
<key>name</key>
|
||||
<string>modernjson</string>
|
||||
<key>platforms</key>
|
||||
<map>
|
||||
<key>common</key>
|
||||
<map>
|
||||
<key>archive</key>
|
||||
<map>
|
||||
<key>hash</key>
|
||||
<string>6f11eca7e2a6ca61f9217e949a64f026</string>
|
||||
<key>hash_algorithm</key>
|
||||
<string>md5</string>
|
||||
<key>url</key>
|
||||
<string>https://depot.alchemyviewer.org/pub/common/lib/modernjson-3.2.0-common-201809210551.tar.bz2</string>
|
||||
</map>
|
||||
<key>name</key>
|
||||
<string>common</string>
|
||||
</map>
|
||||
</map>
|
||||
<key>version</key>
|
||||
<string>3.2.0</string>
|
||||
</map>
|
||||
<key>nvapi</key>
|
||||
<map>
|
||||
<key>copyright</key>
|
||||
|
||||
@@ -1,13 +1,13 @@
|
||||
# -*- cmake -*-
|
||||
include(Prebuilt)
|
||||
|
||||
if (STANDALONE)
|
||||
if (LINUX)
|
||||
include(FindPkgConfig)
|
||||
pkg_check_modules(OGG REQUIRED ogg)
|
||||
pkg_check_modules(VORBIS REQUIRED vorbis)
|
||||
pkg_check_modules(VORBISENC REQUIRED vorbisenc)
|
||||
pkg_check_modules(VORBISFILE REQUIRED vorbisfile)
|
||||
else (STANDALONE)
|
||||
else (LINUX)
|
||||
use_prebuilt_binary(ogg_vorbis)
|
||||
set(VORBIS_INCLUDE_DIRS ${LIBS_PREBUILT_DIR}/include)
|
||||
set(VORBISENC_INCLUDE_DIRS ${VORBIS_INCLUDE_DIRS})
|
||||
@@ -32,7 +32,7 @@ else (STANDALONE)
|
||||
set(VORBISENC_LIBRARIES vorbisenc)
|
||||
set(VORBISFILE_LIBRARIES vorbisfile)
|
||||
endif (WINDOWS)
|
||||
endif (STANDALONE)
|
||||
endif (LINUX)
|
||||
|
||||
link_directories(
|
||||
${VORBIS_LIBRARY_DIRS}
|
||||
|
||||
@@ -50,7 +50,6 @@ set(cmake_SOURCE_FILES
|
||||
GooglePerfTools.cmake
|
||||
Hunspell.cmake
|
||||
JPEG.cmake
|
||||
Json.cmake
|
||||
LLAddBuildTest.cmake
|
||||
LLAppearance.cmake
|
||||
LLAudio.cmake
|
||||
|
||||
@@ -124,10 +124,10 @@ elseif(DARWIN)
|
||||
libndofdev.dylib
|
||||
)
|
||||
|
||||
if (FMODSTUDIO)
|
||||
if (USE_FMODSTUDIO)
|
||||
list(APPEND debug_files libfmodL.dylib)
|
||||
list(APPEND release_files libfmod.dylib)
|
||||
endif (FMODSTUDIO)
|
||||
endif (USE_FMODSTUDIO)
|
||||
|
||||
elseif(LINUX)
|
||||
# linux is weird, multiple side by side configurations aren't supported
|
||||
@@ -157,12 +157,9 @@ elseif(LINUX)
|
||||
set(release_files
|
||||
libapr-1.so.0
|
||||
libaprutil-1.so.0
|
||||
libatk-1.0.so
|
||||
libexpat.so
|
||||
libexpat.so.1
|
||||
libGLOD.so
|
||||
libgmodule-2.0.so
|
||||
libgobject-2.0.so
|
||||
libopenal.so
|
||||
)
|
||||
|
||||
|
||||
@@ -1,24 +1,11 @@
|
||||
# -*- cmake -*-
|
||||
include(Prebuilt)
|
||||
|
||||
if (STANDALONE)
|
||||
if (LINUX)
|
||||
include(FindPkgConfig)
|
||||
|
||||
pkg_check_modules(DBUSGLIB REQUIRED dbus-glib-1)
|
||||
|
||||
elseif (LINUX)
|
||||
use_prebuilt_binary(dbus-glib)
|
||||
set(DBUSGLIB_FOUND ON FORCE BOOL)
|
||||
set(DBUSGLIB_INCLUDE_DIRS
|
||||
${LIBS_PREBUILT_DIR}/include/dbus
|
||||
)
|
||||
# We don't need to explicitly link against dbus-glib itself, because
|
||||
# the viewer probes for the system's copy at runtime.
|
||||
set(DBUSGLIB_LIBRARIES
|
||||
gobject-2.0
|
||||
glib-2.0
|
||||
)
|
||||
endif (STANDALONE)
|
||||
endif (LINUX)
|
||||
|
||||
if (DBUSGLIB_FOUND)
|
||||
set(DBUSGLIB ON CACHE BOOL "Build with dbus-glib message bus support.")
|
||||
|
||||
@@ -7,6 +7,6 @@ set(LLAUDIO_INCLUDE_DIRS
|
||||
${LIBS_OPEN_DIR}/llaudio
|
||||
)
|
||||
|
||||
add_definitions(-DOV_EXCLUDE_STATIC_CALLBACKS)
|
||||
#add_definitions(-DOV_EXCLUDE_STATIC_CALLBACKS)
|
||||
|
||||
set(LLAUDIO_LIBRARIES llaudio ${OPENAL_LIBRARIES})
|
||||
|
||||
@@ -1,11 +1,9 @@
|
||||
# -*- cmake -*-
|
||||
include(Prebuilt)
|
||||
include(FreeType)
|
||||
|
||||
if (STANDALONE)
|
||||
if (LINUX)
|
||||
include(FindPkgConfig)
|
||||
|
||||
if (LINUX)
|
||||
|
||||
set(PKGCONFIG_PACKAGES
|
||||
atk
|
||||
cairo
|
||||
@@ -21,8 +19,8 @@ if (STANDALONE)
|
||||
pangox
|
||||
pangoxft
|
||||
sdl
|
||||
x11
|
||||
)
|
||||
endif (LINUX)
|
||||
|
||||
foreach(pkg ${PKGCONFIG_PACKAGES})
|
||||
pkg_check_modules(${pkg} REQUIRED ${pkg})
|
||||
@@ -31,39 +29,6 @@ if (STANDALONE)
|
||||
list(APPEND UI_LIBRARIES ${${pkg}_LIBRARIES})
|
||||
add_definitions(${${pkg}_CFLAGS_OTHERS})
|
||||
endforeach(pkg)
|
||||
else (STANDALONE)
|
||||
if (LINUX)
|
||||
use_prebuilt_binary(gtk-atk-pango-glib)
|
||||
set(UI_LIBRARIES
|
||||
atk-1.0
|
||||
cairo
|
||||
gdk-x11-2.0
|
||||
gdk_pixbuf-2.0
|
||||
Xinerama
|
||||
glib-2.0
|
||||
gio-2.0
|
||||
gmodule-2.0
|
||||
gobject-2.0
|
||||
gthread-2.0
|
||||
gtk-x11-2.0
|
||||
pango-1.0
|
||||
pangoft2-1.0
|
||||
pangoxft-1.0
|
||||
pangocairo-1.0
|
||||
pixman-1
|
||||
X11
|
||||
${FREETYPE_LIBRARIES}
|
||||
)
|
||||
endif (LINUX)
|
||||
|
||||
include_directories (
|
||||
${LIBS_PREBUILT_DIR}/include
|
||||
)
|
||||
foreach(include ${${LL_ARCH}_INCLUDES})
|
||||
include_directories(${LIBS_PREBUILT_DIR}/include/${include})
|
||||
endforeach(include)
|
||||
endif (STANDALONE)
|
||||
|
||||
if (LINUX)
|
||||
add_definitions(-DLL_GTK=1 -DLL_X11=1)
|
||||
endif (LINUX)
|
||||
|
||||
@@ -270,6 +270,8 @@ if (NOT VIEWER_CHANNEL_GRK)
|
||||
set(VIEWER_CHANNEL_GRK "\\u03B1") # "α"
|
||||
elseif (VIEWER_CHANNEL_TYPE MATCHES "Beta")
|
||||
set(VIEWER_CHANNEL_GRK "\\u03B2") # "β"
|
||||
else()
|
||||
set(VIEWER_CHANNEL_GRK "")
|
||||
endif ()
|
||||
endif (NOT VIEWER_CHANNEL_GRK)
|
||||
|
||||
|
||||
@@ -15,10 +15,15 @@ FetchContent_Declare(
|
||||
GIT_REPOSITORY https://github.com/fmtlib/fmt.git
|
||||
GIT_TAG 6.1.2
|
||||
)
|
||||
FetchContent_Declare(
|
||||
nlohmann_json
|
||||
GIT_REPOSITORY https://github.com/nlohmann/json.git
|
||||
GIT_TAG v3.7.3
|
||||
)
|
||||
FetchContent_Declare(
|
||||
absl
|
||||
GIT_REPOSITORY https://github.com/abseil/abseil-cpp.git
|
||||
GIT_TAG 29235139149790f5afc430c11cec8f1eb1677607
|
||||
GIT_TAG 0033c9ea91a52ade7c6b725aa2ef3cbe15463421
|
||||
)
|
||||
|
||||
# This is a hack because absl has dumb cmake
|
||||
@@ -44,5 +49,14 @@ if(WINDOWS)
|
||||
FetchContent_MakeAvailable(fmt)
|
||||
endif()
|
||||
|
||||
# Typically you don't care so much for a third party library's tests to be
|
||||
# run from your own project's code.
|
||||
set(JSON_BuildTests OFF CACHE INTERNAL "")
|
||||
|
||||
# If you only include this third party in PRIVATE source files, you do not
|
||||
# need to install it when your main project gets installed.
|
||||
set(JSON_Install OFF CACHE INTERNAL "")
|
||||
FetchContent_MakeAvailable(nlohmann_json)
|
||||
|
||||
unset(CMAKE_FOLDER)
|
||||
unset(CMAKE_POSITION_INDEPENDENT_CODE)
|
||||
|
||||
@@ -12,7 +12,6 @@ include(Linking)
|
||||
include(Boost)
|
||||
include(OpenSSL)
|
||||
include(LLSharedLibs)
|
||||
include(Json)
|
||||
include(Copy3rdPartyLibs)
|
||||
include(ZLIB)
|
||||
include(URIPARSER)
|
||||
@@ -300,6 +299,7 @@ target_link_libraries(
|
||||
${Boost_SYSTEM_LIBRARY}
|
||||
${CORESERVICES_LIBRARY}
|
||||
${URIPARSER_LIBRARY}
|
||||
nlohmann_json::nlohmann_json
|
||||
${RT_LIBRARY}
|
||||
)
|
||||
|
||||
|
||||
@@ -244,7 +244,6 @@ const U8 SIM_ACCESS_DOWN = 254;
|
||||
const U8 SIM_ACCESS_MAX = SIM_ACCESS_ADULT;
|
||||
|
||||
// attachment constants
|
||||
const U32 MAX_AGENT_ATTACHMENTS = 38;
|
||||
const U8 ATTACHMENT_ADD = 0x80;
|
||||
|
||||
// god levels
|
||||
|
||||
@@ -353,8 +353,14 @@ typedef LLError::NoClassInfo _LL_CLASS_TO_LOG;
|
||||
|
||||
// NEW Macros for debugging, allow the passing of a string tag
|
||||
|
||||
#ifdef SHOW_DEBUG
|
||||
#define DO_DEBUG_LOG
|
||||
#else
|
||||
#define DO_DEBUG_LOG if (false)
|
||||
#endif
|
||||
|
||||
// Pass comma separated list of tags (currently only supports up to 0, 1, or 2)
|
||||
#define LL_DEBUGS(...) lllog(LLError::LEVEL_DEBUG, false, false, ##__VA_ARGS__)
|
||||
#define LL_DEBUGS(...) DO_DEBUG_LOG lllog(LLError::LEVEL_DEBUG, false, false, ##__VA_ARGS__)
|
||||
#define LL_INFOS(...) lllog(LLError::LEVEL_INFO, false, false, ##__VA_ARGS__)
|
||||
#define LL_WARNS(...) lllog(LLError::LEVEL_WARN, false, false, ##__VA_ARGS__)
|
||||
#define LL_ERRS(...) lllog(LLError::LEVEL_ERROR, false, false, ##__VA_ARGS__)
|
||||
@@ -363,12 +369,12 @@ typedef LLError::NoClassInfo _LL_CLASS_TO_LOG;
|
||||
|
||||
// Only print the log message once (good for warnings or infos that would otherwise
|
||||
// spam the log file over and over, such as tighter loops).
|
||||
#define LL_DEBUGS_ONCE(...) lllog(LLError::LEVEL_DEBUG, true, false, ##__VA_ARGS__)
|
||||
#define LL_DEBUGS_ONCE(...) DO_DEBUG_LOG lllog(LLError::LEVEL_DEBUG, true, false, ##__VA_ARGS__)
|
||||
#define LL_INFOS_ONCE(...) lllog(LLError::LEVEL_INFO, true, false, ##__VA_ARGS__)
|
||||
#define LL_WARNS_ONCE(...) lllog(LLError::LEVEL_WARN, true, false, ##__VA_ARGS__)
|
||||
|
||||
// No function name
|
||||
#define LL_DEBUGS_NF(...) lllog(LLError::LEVEL_DEBUG, false, true, ##__VA_ARGS__)
|
||||
#define LL_DEBUGS_NF(...) DO_DEBUG_LOG {lllog(LLError::LEVEL_DEBUG, false, true, ##__VA_ARGS__)
|
||||
#define LL_INFOS_NF(...) lllog(LLError::LEVEL_INFO, false, true, ##__VA_ARGS__)
|
||||
#define LL_WARNS_NF(...) lllog(LLError::LEVEL_WARN, false, true, ##__VA_ARGS__)
|
||||
#define LL_ERRS_NF(...) lllog(LLError::LEVEL_ERROR, false, true, ##__VA_ARGS__)
|
||||
|
||||
@@ -182,10 +182,10 @@ public:
|
||||
bool operator! () const { return ! mListener; }
|
||||
|
||||
/// explicit accessor
|
||||
const LLEventListener& getListener() const { return *mListener; }
|
||||
const ::LLEventListener& getListener() const { return *mListener; }
|
||||
|
||||
/// implicit conversion to LLEventListener
|
||||
operator LLEventListener() const { return *mListener; }
|
||||
operator ::LLEventListener() const { return *mListener; }
|
||||
|
||||
/// allow calling directly
|
||||
bool operator()(const LLSD& event) const;
|
||||
@@ -277,7 +277,7 @@ namespace LLEventDetail
|
||||
/// Any callable capable of connecting an LLEventListener to an
|
||||
/// LLStandardSignal to produce an LLBoundListener can be mapped to this
|
||||
/// signature.
|
||||
typedef boost::function<LLBoundListener(const LLEventListener&)> ConnectFunc;
|
||||
typedef boost::function<LLBoundListener(const ::LLEventListener&)> ConnectFunc;
|
||||
|
||||
/// overload of visit_and_connect() when we have a string identifier available
|
||||
template <typename LISTENER>
|
||||
@@ -547,7 +547,7 @@ private:
|
||||
virtual void reset();
|
||||
|
||||
private:
|
||||
virtual LLBoundListener listen_impl(const std::string& name, const LLEventListener&,
|
||||
virtual LLBoundListener listen_impl(const std::string& name, const ::LLEventListener&,
|
||||
const NameList& after,
|
||||
const NameList& before);
|
||||
std::string mName;
|
||||
@@ -845,7 +845,7 @@ namespace LLEventDetail
|
||||
* Visitor binds a reference to LLEventListener so we can track() any
|
||||
* shared_ptrs we find in the argument list.
|
||||
*/
|
||||
Visitor(LLEventListener& listener):
|
||||
Visitor(::LLEventListener& listener):
|
||||
mListener(listener)
|
||||
{
|
||||
}
|
||||
@@ -988,7 +988,7 @@ namespace LLEventDetail
|
||||
|*==========================================================================*/
|
||||
|
||||
/// Bind a reference to the LLEventListener to call its track() method.
|
||||
LLEventListener& mListener;
|
||||
::LLEventListener& mListener;
|
||||
};
|
||||
|
||||
/**
|
||||
@@ -1005,7 +1005,7 @@ namespace LLEventDetail
|
||||
const ConnectFunc& connect_func)
|
||||
{
|
||||
// Capture the listener
|
||||
LLEventListener listener(raw_listener);
|
||||
::LLEventListener listener(raw_listener);
|
||||
// Define our Visitor, binding the listener so we can call
|
||||
// listener.track() if we discover any shared_ptr<Foo>.
|
||||
LLEventDetail::Visitor visitor(listener);
|
||||
|
||||
@@ -938,7 +938,7 @@ static const char *llsd_dump(const LLSD &llsd, bool useXMLFormat)
|
||||
out << LLSDNotationStreamer(llsd);
|
||||
out_string = out.str();
|
||||
}
|
||||
int len = out_string.length();
|
||||
size_t len = out_string.length();
|
||||
sStorage = new char[len + 1];
|
||||
memcpy(sStorage, out_string.c_str(), len);
|
||||
sStorage[len] = '\0';
|
||||
|
||||
@@ -17,7 +17,6 @@ include_directories(
|
||||
|
||||
set(llinventory_SOURCE_FILES
|
||||
llcategory.cpp
|
||||
lleconomy.cpp
|
||||
llfoldertype.cpp
|
||||
llinventory.cpp
|
||||
llinventorydefines.cpp
|
||||
@@ -40,7 +39,6 @@ set(llinventory_HEADER_FILES
|
||||
CMakeLists.txt
|
||||
|
||||
llcategory.h
|
||||
lleconomy.h
|
||||
llfoldertype.h
|
||||
llinventory.h
|
||||
llinventorydefines.h
|
||||
|
||||
@@ -1,288 +0,0 @@
|
||||
/**
|
||||
* @file lleconomy.cpp
|
||||
*
|
||||
* $LicenseInfo:firstyear=2002&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 "linden_common.h"
|
||||
|
||||
#include "lleconomy.h"
|
||||
#include "llerror.h"
|
||||
#include "message.h"
|
||||
#include "v3math.h"
|
||||
|
||||
|
||||
LLGlobalEconomy::LLGlobalEconomy()
|
||||
: mObjectCount( -1 ),
|
||||
mObjectCapacity( -1 ),
|
||||
mPriceObjectClaim( -1 ),
|
||||
mPricePublicObjectDecay( -1 ),
|
||||
mPricePublicObjectDelete( -1 ),
|
||||
mPriceEnergyUnit( -1 ),
|
||||
mPriceUpload( -1 ),
|
||||
mPriceRentLight( -1 ),
|
||||
mTeleportMinPrice( -1 ),
|
||||
mTeleportPriceExponent( -1 ),
|
||||
mPriceGroupCreate( -1 )
|
||||
{ }
|
||||
|
||||
LLGlobalEconomy::~LLGlobalEconomy()
|
||||
{ }
|
||||
|
||||
void LLGlobalEconomy::addObserver(LLEconomyObserver* observer)
|
||||
{
|
||||
mObservers.push_back(observer);
|
||||
}
|
||||
|
||||
void LLGlobalEconomy::removeObserver(LLEconomyObserver* observer)
|
||||
{
|
||||
std::list<LLEconomyObserver*>::iterator it =
|
||||
std::find(mObservers.begin(), mObservers.end(), observer);
|
||||
if (it != mObservers.end())
|
||||
{
|
||||
mObservers.erase(it);
|
||||
}
|
||||
}
|
||||
|
||||
void LLGlobalEconomy::notifyObservers()
|
||||
{
|
||||
for (std::list<LLEconomyObserver*>::iterator it = mObservers.begin();
|
||||
it != mObservers.end();
|
||||
++it)
|
||||
{
|
||||
(*it)->onEconomyDataChange();
|
||||
}
|
||||
}
|
||||
|
||||
// static
|
||||
void LLGlobalEconomy::processEconomyData(LLMessageSystem *msg, LLGlobalEconomy* econ_data)
|
||||
{
|
||||
S32 i;
|
||||
F32 f;
|
||||
|
||||
msg->getS32Fast(_PREHASH_Info, _PREHASH_ObjectCapacity, i);
|
||||
econ_data->setObjectCapacity(i);
|
||||
msg->getS32Fast(_PREHASH_Info, _PREHASH_ObjectCount, i);
|
||||
econ_data->setObjectCount(i);
|
||||
msg->getS32Fast(_PREHASH_Info, _PREHASH_PriceEnergyUnit, i);
|
||||
econ_data->setPriceEnergyUnit(i);
|
||||
msg->getS32Fast(_PREHASH_Info, _PREHASH_PriceObjectClaim, i);
|
||||
econ_data->setPriceObjectClaim(i);
|
||||
msg->getS32Fast(_PREHASH_Info, _PREHASH_PricePublicObjectDecay, i);
|
||||
econ_data->setPricePublicObjectDecay(i);
|
||||
msg->getS32Fast(_PREHASH_Info, _PREHASH_PricePublicObjectDelete, i);
|
||||
econ_data->setPricePublicObjectDelete(i);
|
||||
msg->getS32Fast(_PREHASH_Info, _PREHASH_PriceUpload, i);
|
||||
econ_data->setPriceUpload(i);
|
||||
#if LL_LINUX
|
||||
// We can optionally fake the received upload price for testing.
|
||||
// Note that the server is within its rights to not obey our fake
|
||||
// price. :)
|
||||
const char* fakeprice_str = getenv("LL_FAKE_UPLOAD_PRICE");
|
||||
if (fakeprice_str)
|
||||
{
|
||||
S32 fakeprice = (S32)atoi(fakeprice_str);
|
||||
LL_WARNS() << "LL_FAKE_UPLOAD_PRICE: Faking upload price as L$" << fakeprice << LL_ENDL;
|
||||
econ_data->setPriceUpload(fakeprice);
|
||||
}
|
||||
#endif
|
||||
msg->getS32Fast(_PREHASH_Info, _PREHASH_PriceRentLight, i);
|
||||
econ_data->setPriceRentLight(i);
|
||||
msg->getS32Fast(_PREHASH_Info, _PREHASH_TeleportMinPrice, i);
|
||||
econ_data->setTeleportMinPrice(i);
|
||||
msg->getF32Fast(_PREHASH_Info, _PREHASH_TeleportPriceExponent, f);
|
||||
econ_data->setTeleportPriceExponent(f);
|
||||
msg->getS32Fast(_PREHASH_Info, _PREHASH_PriceGroupCreate, i);
|
||||
econ_data->setPriceGroupCreate(i);
|
||||
|
||||
econ_data->notifyObservers();
|
||||
}
|
||||
|
||||
S32 LLGlobalEconomy::calculateTeleportCost(F32 distance) const
|
||||
{
|
||||
S32 min_cost = getTeleportMinPrice();
|
||||
F32 exponent = getTeleportPriceExponent();
|
||||
F32 divisor = 100.f * pow(3.f, exponent);
|
||||
S32 cost = (U32)(distance * pow(log10(distance), exponent) / divisor);
|
||||
if (cost < 0)
|
||||
{
|
||||
cost = 0;
|
||||
}
|
||||
else if (cost < min_cost)
|
||||
{
|
||||
cost = min_cost;
|
||||
}
|
||||
|
||||
return cost;
|
||||
}
|
||||
|
||||
S32 LLGlobalEconomy::calculateLightRent(const LLVector3& object_size) const
|
||||
{
|
||||
F32 intensity_mod = llmax(object_size.magVec(), 1.f);
|
||||
return (S32)(intensity_mod * getPriceRentLight());
|
||||
}
|
||||
|
||||
void LLGlobalEconomy::print()
|
||||
{
|
||||
LL_INFOS() << "Global Economy Settings: " << LL_ENDL;
|
||||
LL_INFOS() << "Object Capacity: " << mObjectCapacity << LL_ENDL;
|
||||
LL_INFOS() << "Object Count: " << mObjectCount << LL_ENDL;
|
||||
LL_INFOS() << "Claim Price Per Object: " << mPriceObjectClaim << LL_ENDL;
|
||||
LL_INFOS() << "Claim Price Per Public Object: " << mPricePublicObjectDecay << LL_ENDL;
|
||||
LL_INFOS() << "Delete Price Per Public Object: " << mPricePublicObjectDelete << LL_ENDL;
|
||||
LL_INFOS() << "Release Price Per Public Object: " << getPricePublicObjectRelease() << LL_ENDL;
|
||||
LL_INFOS() << "Price Per Energy Unit: " << mPriceEnergyUnit << LL_ENDL;
|
||||
LL_INFOS() << "Price Per Upload: " << mPriceUpload << LL_ENDL;
|
||||
LL_INFOS() << "Light Base Price: " << mPriceRentLight << LL_ENDL;
|
||||
LL_INFOS() << "Teleport Min Price: " << mTeleportMinPrice << LL_ENDL;
|
||||
LL_INFOS() << "Teleport Price Exponent: " << mTeleportPriceExponent << LL_ENDL;
|
||||
LL_INFOS() << "Price for group creation: " << mPriceGroupCreate << LL_ENDL;
|
||||
}
|
||||
|
||||
LLRegionEconomy::LLRegionEconomy()
|
||||
: LLGlobalEconomy(),
|
||||
mPriceObjectRent( -1.f ),
|
||||
mPriceObjectScaleFactor( -1.f ),
|
||||
mEnergyEfficiency( -1.f ),
|
||||
mBasePriceParcelClaimDefault(-1),
|
||||
mBasePriceParcelClaimActual(-1),
|
||||
mPriceParcelClaimFactor(-1.f),
|
||||
mBasePriceParcelRent(-1),
|
||||
mAreaOwned(-1.f),
|
||||
mAreaTotal(-1.f)
|
||||
{ }
|
||||
|
||||
LLRegionEconomy::~LLRegionEconomy()
|
||||
{ }
|
||||
|
||||
BOOL LLRegionEconomy::hasData() const
|
||||
{
|
||||
return (mBasePriceParcelRent != -1);
|
||||
}
|
||||
|
||||
// static
|
||||
void LLRegionEconomy::processEconomyData(LLMessageSystem *msg, void** user_data)
|
||||
{
|
||||
S32 i;
|
||||
F32 f;
|
||||
|
||||
LLRegionEconomy *this_ptr = (LLRegionEconomy*)user_data;
|
||||
|
||||
LLGlobalEconomy::processEconomyData(msg, this_ptr);
|
||||
|
||||
msg->getS32Fast(_PREHASH_Info, _PREHASH_PriceParcelClaim, i);
|
||||
this_ptr->setBasePriceParcelClaimDefault(i);
|
||||
msg->getF32(_PREHASH_Info, _PREHASH_PriceParcelClaimFactor, f);
|
||||
this_ptr->setPriceParcelClaimFactor(f);
|
||||
msg->getF32Fast(_PREHASH_Info, _PREHASH_EnergyEfficiency, f);
|
||||
this_ptr->setEnergyEfficiency(f);
|
||||
msg->getF32Fast(_PREHASH_Info, _PREHASH_PriceObjectRent, f);
|
||||
this_ptr->setPriceObjectRent(f);
|
||||
msg->getF32Fast(_PREHASH_Info, _PREHASH_PriceObjectScaleFactor, f);
|
||||
this_ptr->setPriceObjectScaleFactor(f);
|
||||
msg->getS32Fast(_PREHASH_Info, _PREHASH_PriceParcelRent, i);
|
||||
this_ptr->setBasePriceParcelRent(i);
|
||||
}
|
||||
|
||||
// static
|
||||
void LLRegionEconomy::processEconomyDataRequest(LLMessageSystem *msg, void **user_data)
|
||||
{
|
||||
LLRegionEconomy *this_ptr = (LLRegionEconomy*)user_data;
|
||||
if (!this_ptr->hasData())
|
||||
{
|
||||
LL_WARNS() << "Dropping EconomyDataRequest, because EconomyData message "
|
||||
<< "has not been processed" << LL_ENDL;
|
||||
}
|
||||
|
||||
msg->newMessageFast(_PREHASH_EconomyData);
|
||||
msg->nextBlockFast(_PREHASH_Info);
|
||||
msg->addS32Fast(_PREHASH_ObjectCapacity, this_ptr->getObjectCapacity());
|
||||
msg->addS32Fast(_PREHASH_ObjectCount, this_ptr->getObjectCount());
|
||||
msg->addS32Fast(_PREHASH_PriceEnergyUnit, this_ptr->getPriceEnergyUnit());
|
||||
msg->addS32Fast(_PREHASH_PriceObjectClaim, this_ptr->getPriceObjectClaim());
|
||||
msg->addS32Fast(_PREHASH_PricePublicObjectDecay, this_ptr->getPricePublicObjectDecay());
|
||||
msg->addS32Fast(_PREHASH_PricePublicObjectDelete, this_ptr->getPricePublicObjectDelete());
|
||||
msg->addS32Fast(_PREHASH_PriceParcelClaim, this_ptr->mBasePriceParcelClaimActual);
|
||||
msg->addF32Fast(_PREHASH_PriceParcelClaimFactor, this_ptr->mPriceParcelClaimFactor);
|
||||
msg->addS32Fast(_PREHASH_PriceUpload, this_ptr->getPriceUpload());
|
||||
msg->addS32Fast(_PREHASH_PriceRentLight, this_ptr->getPriceRentLight());
|
||||
msg->addS32Fast(_PREHASH_TeleportMinPrice, this_ptr->getTeleportMinPrice());
|
||||
msg->addF32Fast(_PREHASH_TeleportPriceExponent, this_ptr->getTeleportPriceExponent());
|
||||
|
||||
msg->addF32Fast(_PREHASH_EnergyEfficiency, this_ptr->getEnergyEfficiency());
|
||||
msg->addF32Fast(_PREHASH_PriceObjectRent, this_ptr->getPriceObjectRent());
|
||||
msg->addF32Fast(_PREHASH_PriceObjectScaleFactor, this_ptr->getPriceObjectScaleFactor());
|
||||
msg->addS32Fast(_PREHASH_PriceParcelRent, this_ptr->getPriceParcelRent());
|
||||
msg->addS32Fast(_PREHASH_PriceGroupCreate, this_ptr->getPriceGroupCreate());
|
||||
|
||||
msg->sendReliable(msg->getSender());
|
||||
}
|
||||
|
||||
|
||||
S32 LLRegionEconomy::getPriceParcelClaim() const
|
||||
{
|
||||
//return (S32)((F32)mBasePriceParcelClaim * (mAreaTotal / (mAreaTotal - mAreaOwned)));
|
||||
return (S32)((F32)mBasePriceParcelClaimActual * mPriceParcelClaimFactor);
|
||||
}
|
||||
|
||||
S32 LLRegionEconomy::getPriceParcelRent() const
|
||||
{
|
||||
return mBasePriceParcelRent;
|
||||
}
|
||||
|
||||
|
||||
void LLRegionEconomy::print()
|
||||
{
|
||||
this->LLGlobalEconomy::print();
|
||||
|
||||
LL_INFOS() << "Region Economy Settings: " << LL_ENDL;
|
||||
LL_INFOS() << "Land (square meters): " << mAreaTotal << LL_ENDL;
|
||||
LL_INFOS() << "Owned Land (square meters): " << mAreaOwned << LL_ENDL;
|
||||
LL_INFOS() << "Daily Object Rent: " << mPriceObjectRent << LL_ENDL;
|
||||
LL_INFOS() << "Daily Land Rent (per meter): " << getPriceParcelRent() << LL_ENDL;
|
||||
LL_INFOS() << "Energey Efficiency: " << mEnergyEfficiency << LL_ENDL;
|
||||
}
|
||||
|
||||
|
||||
void LLRegionEconomy::setBasePriceParcelClaimDefault(S32 val)
|
||||
{
|
||||
mBasePriceParcelClaimDefault = val;
|
||||
if(mBasePriceParcelClaimActual == -1)
|
||||
{
|
||||
mBasePriceParcelClaimActual = val;
|
||||
}
|
||||
}
|
||||
|
||||
void LLRegionEconomy::setBasePriceParcelClaimActual(S32 val)
|
||||
{
|
||||
mBasePriceParcelClaimActual = val;
|
||||
}
|
||||
|
||||
void LLRegionEconomy::setPriceParcelClaimFactor(F32 val)
|
||||
{
|
||||
mPriceParcelClaimFactor = val;
|
||||
}
|
||||
|
||||
void LLRegionEconomy::setBasePriceParcelRent(S32 val)
|
||||
{
|
||||
mBasePriceParcelRent = val;
|
||||
}
|
||||
@@ -1,159 +0,0 @@
|
||||
/**
|
||||
* @file lleconomy.h
|
||||
*
|
||||
* $LicenseInfo:firstyear=2002&license=viewerlgpl$
|
||||
* Second Life Viewer Source Code
|
||||
* Copyright (C) 2010, Linden Research, Inc.
|
||||
*
|
||||
* This library is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU Lesser General Public
|
||||
* License as published by the Free Software Foundation;
|
||||
* version 2.1 of the License only.
|
||||
*
|
||||
* This library is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
* Lesser General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Lesser General Public
|
||||
* License along with this library; if not, write to the Free Software
|
||||
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
*
|
||||
* Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA
|
||||
* $/LicenseInfo$
|
||||
*/
|
||||
|
||||
#ifndef LL_LLECONOMY_H
|
||||
#define LL_LLECONOMY_H
|
||||
|
||||
#include "llsingleton.h"
|
||||
|
||||
class LLMessageSystem;
|
||||
class LLVector3;
|
||||
|
||||
/**
|
||||
* Register an observer to be notified of economy data updates coming from server.
|
||||
*/
|
||||
class LLEconomyObserver
|
||||
{
|
||||
public:
|
||||
virtual ~LLEconomyObserver() {}
|
||||
virtual void onEconomyDataChange() = 0;
|
||||
};
|
||||
|
||||
class LLGlobalEconomy
|
||||
{
|
||||
public:
|
||||
LLGlobalEconomy();
|
||||
virtual ~LLGlobalEconomy();
|
||||
|
||||
// This class defines its singleton internally as a typedef instead of inheriting from
|
||||
// LLSingleton like most others because the LLRegionEconomy sub-class might also
|
||||
// become a singleton and this pattern will more easily disambiguate them.
|
||||
typedef LLSingleton<LLGlobalEconomy> Singleton;
|
||||
|
||||
void initSingleton() { }
|
||||
|
||||
virtual void print();
|
||||
|
||||
void addObserver(LLEconomyObserver* observer);
|
||||
void removeObserver(LLEconomyObserver* observer);
|
||||
void notifyObservers();
|
||||
|
||||
static void processEconomyData(LLMessageSystem *msg, LLGlobalEconomy* econ_data);
|
||||
|
||||
S32 calculateTeleportCost(F32 distance) const;
|
||||
S32 calculateLightRent(const LLVector3& object_size) const;
|
||||
|
||||
S32 getObjectCount() const { return mObjectCount; }
|
||||
S32 getObjectCapacity() const { return mObjectCapacity; }
|
||||
S32 getPriceObjectClaim() const { return mPriceObjectClaim; }
|
||||
S32 getPricePublicObjectDecay() const { return mPricePublicObjectDecay; }
|
||||
S32 getPricePublicObjectDelete() const { return mPricePublicObjectDelete; }
|
||||
S32 getPricePublicObjectRelease() const { return mPriceObjectClaim - mPricePublicObjectDelete; }
|
||||
S32 getPriceEnergyUnit() const { return mPriceEnergyUnit; }
|
||||
S32 getPriceUpload() const { return mPriceUpload; }
|
||||
S32 getPriceRentLight() const { return mPriceRentLight; }
|
||||
S32 getTeleportMinPrice() const { return mTeleportMinPrice; }
|
||||
F32 getTeleportPriceExponent() const { return mTeleportPriceExponent; }
|
||||
S32 getPriceGroupCreate() const { return mPriceGroupCreate; }
|
||||
|
||||
|
||||
void setObjectCount(S32 val) { mObjectCount = val; }
|
||||
void setObjectCapacity(S32 val) { mObjectCapacity = val; }
|
||||
void setPriceObjectClaim(S32 val) { mPriceObjectClaim = val; }
|
||||
void setPricePublicObjectDecay(S32 val) { mPricePublicObjectDecay = val; }
|
||||
void setPricePublicObjectDelete(S32 val) { mPricePublicObjectDelete = val; }
|
||||
void setPriceEnergyUnit(S32 val) { mPriceEnergyUnit = val; }
|
||||
void setPriceUpload(S32 val) { mPriceUpload = val; }
|
||||
void setPriceRentLight(S32 val) { mPriceRentLight = val; }
|
||||
void setTeleportMinPrice(S32 val) { mTeleportMinPrice = val; }
|
||||
void setTeleportPriceExponent(F32 val) { mTeleportPriceExponent = val; }
|
||||
void setPriceGroupCreate(S32 val) { mPriceGroupCreate = val; }
|
||||
|
||||
private:
|
||||
S32 mObjectCount;
|
||||
S32 mObjectCapacity;
|
||||
S32 mPriceObjectClaim; // per primitive
|
||||
S32 mPricePublicObjectDecay; // per primitive
|
||||
S32 mPricePublicObjectDelete; // per primitive
|
||||
S32 mPriceEnergyUnit;
|
||||
S32 mPriceUpload;
|
||||
S32 mPriceRentLight;
|
||||
S32 mTeleportMinPrice;
|
||||
F32 mTeleportPriceExponent;
|
||||
S32 mPriceGroupCreate;
|
||||
|
||||
std::list<LLEconomyObserver*> mObservers;
|
||||
};
|
||||
|
||||
|
||||
class LLRegionEconomy : public LLGlobalEconomy
|
||||
{
|
||||
public:
|
||||
LLRegionEconomy();
|
||||
~LLRegionEconomy();
|
||||
|
||||
static void processEconomyData(LLMessageSystem *msg, void **user_data);
|
||||
static void processEconomyDataRequest(LLMessageSystem *msg, void **user_data);
|
||||
|
||||
void print();
|
||||
|
||||
BOOL hasData() const;
|
||||
F32 getPriceObjectRent() const { return mPriceObjectRent; }
|
||||
F32 getPriceObjectScaleFactor() const {return mPriceObjectScaleFactor;}
|
||||
F32 getEnergyEfficiency() const { return mEnergyEfficiency; }
|
||||
S32 getPriceParcelClaim() const;
|
||||
S32 getPriceParcelRent() const;
|
||||
F32 getAreaOwned() const { return mAreaOwned; }
|
||||
F32 getAreaTotal() const { return mAreaTotal; }
|
||||
S32 getBasePriceParcelClaimActual() const { return mBasePriceParcelClaimActual; }
|
||||
|
||||
void setPriceObjectRent(F32 val) { mPriceObjectRent = val; }
|
||||
void setPriceObjectScaleFactor(F32 val) { mPriceObjectScaleFactor = val; }
|
||||
void setEnergyEfficiency(F32 val) { mEnergyEfficiency = val; }
|
||||
|
||||
void setBasePriceParcelClaimDefault(S32 val);
|
||||
void setBasePriceParcelClaimActual(S32 val);
|
||||
void setPriceParcelClaimFactor(F32 val);
|
||||
void setBasePriceParcelRent(S32 val);
|
||||
|
||||
void setAreaOwned(F32 val) { mAreaOwned = val; }
|
||||
void setAreaTotal(F32 val) { mAreaTotal = val; }
|
||||
|
||||
private:
|
||||
F32 mPriceObjectRent;
|
||||
F32 mPriceObjectScaleFactor;
|
||||
F32 mEnergyEfficiency;
|
||||
|
||||
S32 mBasePriceParcelClaimDefault;
|
||||
S32 mBasePriceParcelClaimActual;
|
||||
F32 mPriceParcelClaimFactor;
|
||||
S32 mBasePriceParcelRent;
|
||||
|
||||
F32 mAreaOwned;
|
||||
F32 mAreaTotal;
|
||||
|
||||
};
|
||||
|
||||
#endif
|
||||
@@ -126,9 +126,12 @@ public:
|
||||
// Returns true if this rotation is orthonormal with det ~= 1
|
||||
inline bool isOkRotation() const;
|
||||
} LL_ALIGN_POSTFIX(16);
|
||||
|
||||
#if !defined(LL_DEBUG)
|
||||
static_assert(std::is_trivial<LLMatrix3a>::value, "LLMatrix3a must be a trivial type");
|
||||
static_assert(std::is_standard_layout<LLMatrix3a>::value, "LLMatrix3a must be a standard layout type");
|
||||
|
||||
static_assert(std::is_trivial<LLRotation>::value, "LLRotation must be a trivial type");
|
||||
static_assert(std::is_standard_layout<LLRotation>::value, "LLRotation must be a standard layout type");
|
||||
#endif
|
||||
#endif
|
||||
|
||||
@@ -718,6 +718,8 @@ inline std::ostream& operator<<(std::ostream& s, const LLMatrix4a& m)
|
||||
|
||||
void matMulBoundBox(const LLMatrix4a &a, const LLVector4a *in_extents, LLVector4a *out_extents);
|
||||
|
||||
#if !defined(LL_DEBUG)
|
||||
static_assert(std::is_trivial<LLMatrix4a>::value, "LLMatrix4a must be a trivial type");
|
||||
static_assert(std::is_standard_layout<LLMatrix4a>::value, "LLMatrix4a must be a standard layout type");
|
||||
#endif
|
||||
#endif
|
||||
|
||||
@@ -45,6 +45,7 @@
|
||||
#endif
|
||||
|
||||
extern U32 gOctreeMaxCapacity;
|
||||
extern float gOctreeMinSize;
|
||||
extern U32 gOctreeReserveCapacity;
|
||||
#if LL_DEBUG
|
||||
#define LL_OCTREE_PARANOIA_CHECK 0
|
||||
@@ -404,7 +405,7 @@ public:
|
||||
F32 size = mSize[0];
|
||||
F32 p_size = size * 2.f;
|
||||
|
||||
return (radius <= 0.001f && size <= 0.001f) ||
|
||||
return (radius <= gOctreeMinSize && size <= gOctreeMinSize) ||
|
||||
(radius <= p_size && radius > size);
|
||||
}
|
||||
|
||||
@@ -511,7 +512,7 @@ public:
|
||||
//is it here?
|
||||
if (isInside(data->getPositionGroup()))
|
||||
{
|
||||
if (((getElementCount() < gOctreeMaxCapacity && contains(data->getBinRadius())) ||
|
||||
if ((((getElementCount() < gOctreeMaxCapacity || getSize()[0] <= gOctreeMinSize) && contains(data->getBinRadius())) ||
|
||||
(data->getBinRadius() > getSize()[0] && parent && parent->getElementCount() >= gOctreeMaxCapacity)))
|
||||
{ //it belongs here
|
||||
/*mElementCount++;
|
||||
@@ -537,7 +538,7 @@ public:
|
||||
OctreeStats::getInstance()->realloc(old_cap,mData.capacity());
|
||||
#endif
|
||||
|
||||
this->notifyAddition(data);
|
||||
LLOctreeNode<T>::notifyAddition(data);
|
||||
return true;
|
||||
}
|
||||
else
|
||||
@@ -566,8 +567,9 @@ public:
|
||||
LLVector4a val;
|
||||
val.setSub(center, getCenter());
|
||||
val.setAbs(val);
|
||||
|
||||
S32 lt = val.lessThan(LLVector4a::getEpsilon()).getGatheredBits() & 0x7;
|
||||
LLVector4a min_diff(gOctreeMinSize);
|
||||
|
||||
S32 lt = val.lessThan(min_diff).getGatheredBits() & 0x7;
|
||||
|
||||
if( lt == 0x7 )
|
||||
{
|
||||
@@ -593,7 +595,7 @@ public:
|
||||
OctreeStats::getInstance()->realloc(old_cap,mData.capacity());
|
||||
#endif
|
||||
|
||||
this->notifyAddition(data);
|
||||
LLOctreeNode<T>::notifyAddition(data);
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -616,6 +618,7 @@ public:
|
||||
}
|
||||
#endif
|
||||
|
||||
llassert(size[0] >= gOctreeMinSize*0.5f);
|
||||
//make the new kid
|
||||
child = new LLOctreeNode<T>(center, size, this);
|
||||
addChild(child);
|
||||
@@ -623,10 +626,7 @@ 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
|
||||
else if (parent)
|
||||
{
|
||||
//it's not in here, give it to the root
|
||||
OCT_ERRS << "Octree insertion failed, starting over from root!" << LL_ENDL;
|
||||
@@ -639,12 +639,15 @@ public:
|
||||
parent = node->getOctParent();
|
||||
}
|
||||
|
||||
if(node != this)
|
||||
{
|
||||
node->insert(data);
|
||||
}
|
||||
node->insert(data);
|
||||
}
|
||||
else
|
||||
{
|
||||
// It's not in here, and we are root.
|
||||
// LLOctreeRoot::insert() should have expanded
|
||||
// root by now, something is wrong
|
||||
OCT_ERRS << "Octree insertion failed! Root expansion failed." << LL_ENDL;
|
||||
}
|
||||
#endif
|
||||
|
||||
return false;
|
||||
}
|
||||
@@ -1050,10 +1053,15 @@ public:
|
||||
{
|
||||
LLOctreeNode<T>::insert(data);
|
||||
}
|
||||
else
|
||||
else if (node->isInside(data->getPositionGroup()))
|
||||
{
|
||||
node->insert(data);
|
||||
}
|
||||
else
|
||||
{
|
||||
// calling node->insert(data) will return us to root
|
||||
OCT_ERRS << "Failed to insert data at child node" << LL_ENDL;
|
||||
}
|
||||
}
|
||||
else if (this->getChildCount() == 0)
|
||||
{
|
||||
@@ -1088,6 +1096,8 @@ public:
|
||||
this->setSize(size2);
|
||||
this->updateMinMax();
|
||||
|
||||
llassert(size[0] >= gOctreeMinSize);
|
||||
|
||||
//copy our children to a new branch
|
||||
LLOctreeNode<T>* newnode = new LLOctreeNode<T>(center, size, this);
|
||||
|
||||
|
||||
@@ -104,7 +104,8 @@ private:
|
||||
LL_ALIGN_16(LLVector4a mV);
|
||||
} LL_ALIGN_POSTFIX(16);
|
||||
|
||||
#if !defined(LL_DEBUG)
|
||||
static_assert(std::is_trivial<LLPlane>::value, "LLPlane must be a trivial type");
|
||||
static_assert(std::is_standard_layout<LLPlane>::value, "LLPlane must be a standard layout type");
|
||||
|
||||
#endif
|
||||
#endif // LL_LLPLANE_H
|
||||
|
||||
@@ -105,7 +105,9 @@ protected:
|
||||
|
||||
} LL_ALIGN_POSTFIX(16);
|
||||
|
||||
#if !defined(LL_DEBUG)
|
||||
static_assert(std::is_trivial<LLQuaternion2>::value, "LLQuaternion2 must be a trivial type");
|
||||
static_assert(std::is_standard_layout<LLQuaternion2>::value, "LLQuaternion2 must be a standard layout type");
|
||||
#endif
|
||||
|
||||
#endif
|
||||
|
||||
@@ -350,6 +350,8 @@ inline std::ostream& operator<<(std::ostream& s, const LLVector4a& v)
|
||||
return s;
|
||||
}
|
||||
|
||||
#if !defined(LL_DEBUG)
|
||||
static_assert(std::is_trivial<LLVector4a>::value, "LLVector4a must be a be a trivial type");
|
||||
static_assert(std::is_standard_layout<LLVector4a>::value, "LLVector4a must be a standard layout type");
|
||||
#endif
|
||||
#endif
|
||||
|
||||
@@ -960,4 +960,5 @@ P(webProfileResponders);
|
||||
P(wholeModelFeeResponder);
|
||||
P(wholeModelUploadResponder);
|
||||
P2(XMLRPCResponder, connect_40s);
|
||||
P(getUpdateInfoResponder);
|
||||
P(getUpdateInfoResponder);
|
||||
P2(AISAPIResponder, connect_60s);
|
||||
@@ -335,7 +335,7 @@ void LLAvatarNameCache::requestNamesViaCapability()
|
||||
while(!sAskQueue.empty())
|
||||
{
|
||||
it = sAskQueue.begin();
|
||||
const LLUUID& agent_id = *it;
|
||||
const LLUUID agent_id = *it;
|
||||
sAskQueue.erase(it);
|
||||
|
||||
if (url.empty())
|
||||
|
||||
@@ -262,6 +262,8 @@ LLCacheName::~LLCacheName()
|
||||
delete &impl;
|
||||
}
|
||||
|
||||
const ReverseCache& LLCacheName::getReverseMap() const { return impl.mReverseCache; }
|
||||
|
||||
LLCacheName::Impl::Impl(LLMessageSystem* msg)
|
||||
: mMsg(msg), mUpstreamHost(LLHost::invalid)
|
||||
{
|
||||
|
||||
@@ -57,6 +57,8 @@ public:
|
||||
LLCacheName(LLMessageSystem* msg, const LLHost& upstream_host);
|
||||
~LLCacheName();
|
||||
|
||||
const std::map<std::string, LLUUID>& getReverseMap() const;
|
||||
|
||||
// registers the upstream host
|
||||
// for viewers, this is the currently connected simulator
|
||||
// for simulators, this is the data server
|
||||
|
||||
@@ -58,103 +58,6 @@ const std::string SYSTEM_FROM("Second Life");
|
||||
const std::string INTERACTIVE_SYSTEM_FROM("F387446C-37C4-45f2-A438-D99CBDBB563B");
|
||||
const S32 IM_TTL = 1;
|
||||
|
||||
|
||||
/**
|
||||
* LLIMInfo
|
||||
*/
|
||||
LLIMInfo::LLIMInfo() :
|
||||
mFromGroup(FALSE),
|
||||
mParentEstateID(0),
|
||||
mOffline(0),
|
||||
mViewerThinksToIsOnline(false),
|
||||
mIMType(IM_NOTHING_SPECIAL),
|
||||
mTimeStamp(0),
|
||||
mSource(IM_FROM_SIM),
|
||||
mTTL(IM_TTL)
|
||||
{
|
||||
}
|
||||
|
||||
LLIMInfo::LLIMInfo(
|
||||
const LLUUID& from_id,
|
||||
BOOL from_group,
|
||||
const LLUUID& to_id,
|
||||
EInstantMessage im_type,
|
||||
const std::string& name,
|
||||
const std::string& message,
|
||||
const LLUUID& id,
|
||||
U32 parent_estate_id,
|
||||
const LLUUID& region_id,
|
||||
const LLVector3& position,
|
||||
LLSD data,
|
||||
U8 offline,
|
||||
U32 timestamp,
|
||||
EIMSource source,
|
||||
S32 ttl) :
|
||||
mFromID(from_id),
|
||||
mFromGroup(from_group),
|
||||
mToID(to_id),
|
||||
mParentEstateID(0),
|
||||
mRegionID(region_id),
|
||||
mPosition(position),
|
||||
mOffline(offline),
|
||||
mViewerThinksToIsOnline(false),
|
||||
mIMType(im_type),
|
||||
mID(id),
|
||||
mTimeStamp(timestamp),
|
||||
mName(name),
|
||||
mMessage(message),
|
||||
mData(data),
|
||||
mSource(source),
|
||||
mTTL(ttl)
|
||||
{
|
||||
}
|
||||
|
||||
LLIMInfo::LLIMInfo(LLMessageSystem* msg, EIMSource source, S32 ttl) :
|
||||
mViewerThinksToIsOnline(false),
|
||||
mSource(source),
|
||||
mTTL(ttl)
|
||||
{
|
||||
unpackMessageBlock(msg);
|
||||
}
|
||||
|
||||
LLIMInfo::~LLIMInfo()
|
||||
{
|
||||
}
|
||||
|
||||
void LLIMInfo::packInstantMessage(LLMessageSystem* msg) const
|
||||
{
|
||||
LL_DEBUGS() << "LLIMInfo::packInstantMessage()" << LL_ENDL;
|
||||
msg->newMessageFast(_PREHASH_ImprovedInstantMessage);
|
||||
packMessageBlock(msg);
|
||||
}
|
||||
|
||||
void LLIMInfo::packMessageBlock(LLMessageSystem* msg) const
|
||||
{
|
||||
// Construct binary bucket
|
||||
std::vector<U8> bucket;
|
||||
if (mData.has("binary_bucket"))
|
||||
{
|
||||
bucket = mData["binary_bucket"].asBinary();
|
||||
}
|
||||
pack_instant_message_block(
|
||||
msg,
|
||||
mFromID,
|
||||
mFromGroup,
|
||||
LLUUID::null,
|
||||
mToID,
|
||||
mName,
|
||||
mMessage,
|
||||
mOffline,
|
||||
mIMType,
|
||||
mID,
|
||||
mParentEstateID,
|
||||
mRegionID,
|
||||
mPosition,
|
||||
mTimeStamp,
|
||||
&bucket[0],
|
||||
bucket.size());
|
||||
}
|
||||
|
||||
void pack_instant_message(
|
||||
LLMessageSystem* msg,
|
||||
const LLUUID& from_id,
|
||||
@@ -264,124 +167,3 @@ void pack_instant_message_block(
|
||||
}
|
||||
msg->addBinaryDataFast(_PREHASH_BinaryBucket, bb, binary_bucket_size);
|
||||
}
|
||||
|
||||
void LLIMInfo::unpackMessageBlock(LLMessageSystem* msg)
|
||||
{
|
||||
msg->getUUIDFast(_PREHASH_AgentData, _PREHASH_AgentID, mFromID);
|
||||
msg->getBOOLFast(_PREHASH_MessageBlock, _PREHASH_FromGroup, mFromGroup);
|
||||
msg->getUUIDFast(_PREHASH_MessageBlock, _PREHASH_ToAgentID, mToID);
|
||||
msg->getU32Fast(_PREHASH_MessageBlock, _PREHASH_ParentEstateID, mParentEstateID);
|
||||
msg->getUUIDFast(_PREHASH_MessageBlock, _PREHASH_RegionID, mRegionID);
|
||||
msg->getVector3Fast(_PREHASH_MessageBlock, _PREHASH_Position, mPosition);
|
||||
msg->getU8Fast(_PREHASH_MessageBlock, _PREHASH_Offline, mOffline);
|
||||
U8 dialog;
|
||||
msg->getU8Fast(_PREHASH_MessageBlock, _PREHASH_Dialog, dialog);
|
||||
mIMType = (EInstantMessage) dialog;
|
||||
msg->getUUIDFast(_PREHASH_MessageBlock, _PREHASH_ID, mID);
|
||||
msg->getU32Fast(_PREHASH_MessageBlock, _PREHASH_Timestamp, mTimeStamp);
|
||||
msg->getStringFast(_PREHASH_MessageBlock, _PREHASH_FromAgentName, mName);
|
||||
|
||||
msg->getStringFast(_PREHASH_MessageBlock, _PREHASH_Message, mMessage);
|
||||
|
||||
S32 binary_bucket_size = llmin(
|
||||
MTUBYTES,
|
||||
msg->getSizeFast(
|
||||
_PREHASH_MessageBlock,
|
||||
_PREHASH_BinaryBucket));
|
||||
if(binary_bucket_size > 0)
|
||||
{
|
||||
std::vector<U8> bucket;
|
||||
bucket.resize(binary_bucket_size);
|
||||
|
||||
msg->getBinaryDataFast(
|
||||
_PREHASH_MessageBlock,
|
||||
_PREHASH_BinaryBucket,
|
||||
&bucket[0],
|
||||
0,
|
||||
0,
|
||||
binary_bucket_size);
|
||||
mData["binary_bucket"] = bucket;
|
||||
}
|
||||
else
|
||||
{
|
||||
mData.clear();
|
||||
}
|
||||
}
|
||||
|
||||
LLSD im_info_to_llsd(LLPointer<LLIMInfo> im_info)
|
||||
{
|
||||
LLSD param_version;
|
||||
param_version["version"] = 1;
|
||||
LLSD param_message;
|
||||
param_message["from_id"] = im_info->mFromID;
|
||||
param_message["from_group"] = im_info->mFromGroup;
|
||||
param_message["to_id"] = im_info->mToID;
|
||||
param_message["from_name"] = im_info->mName;
|
||||
param_message["message"] = im_info->mMessage;
|
||||
param_message["type"] = (S32)im_info->mIMType;
|
||||
param_message["id"] = im_info->mID;
|
||||
param_message["timestamp"] = (S32)im_info->mTimeStamp;
|
||||
param_message["offline"] = (S32)im_info->mOffline;
|
||||
param_message["parent_estate_id"] = (S32)im_info->mParentEstateID;
|
||||
param_message["region_id"] = im_info->mRegionID;
|
||||
param_message["position"] = ll_sd_from_vector3(im_info->mPosition);
|
||||
param_message["data"] = im_info->mData;
|
||||
param_message["source"]= im_info->mSource;
|
||||
param_message["ttl"] = im_info->mTTL;
|
||||
|
||||
LLSD param_agent;
|
||||
param_agent["agent_id"] = im_info->mFromID;
|
||||
|
||||
LLSD params;
|
||||
params["version_params"] = param_version;
|
||||
params["message_params"] = param_message;
|
||||
params["agent_params"] = param_agent;
|
||||
|
||||
return params;
|
||||
}
|
||||
|
||||
LLPointer<LLIMInfo> llsd_to_im_info(const LLSD& im_info_sd)
|
||||
{
|
||||
LLSD param_message = im_info_sd["message_params"];
|
||||
LLSD param_agent = im_info_sd["agent_params"];
|
||||
|
||||
LLPointer<LLIMInfo> im_info = new LLIMInfo(
|
||||
param_message["from_id"].asUUID(),
|
||||
param_message["from_group"].asBoolean(),
|
||||
param_message["to_id"].asUUID(),
|
||||
(EInstantMessage) param_message["type"].asInteger(),
|
||||
param_message["from_name"].asString(),
|
||||
param_message["message"].asString(),
|
||||
param_message["id"].asUUID(),
|
||||
(U32) param_message["parent_estate_id"].asInteger(),
|
||||
param_message["region_id"].asUUID(),
|
||||
ll_vector3_from_sd(param_message["position"]),
|
||||
param_message["data"],
|
||||
(U8) param_message["offline"].asInteger(),
|
||||
(U32) param_message["timestamp"].asInteger(),
|
||||
(EIMSource)param_message["source"].asInteger(),
|
||||
param_message["ttl"].asInteger());
|
||||
|
||||
return im_info;
|
||||
}
|
||||
|
||||
LLPointer<LLIMInfo> LLIMInfo::clone()
|
||||
{
|
||||
return new LLIMInfo(
|
||||
mFromID,
|
||||
mFromGroup,
|
||||
mToID,
|
||||
mIMType,
|
||||
mName,
|
||||
mMessage,
|
||||
mID,
|
||||
mParentEstateID,
|
||||
mRegionID,
|
||||
mPosition,
|
||||
mData,
|
||||
mOffline,
|
||||
mTimeStamp,
|
||||
mSource,
|
||||
mTTL);
|
||||
}
|
||||
|
||||
|
||||
@@ -225,62 +225,6 @@ extern const std::string INTERACTIVE_SYSTEM_FROM;
|
||||
// Number of retry attempts on sending the im.
|
||||
extern const S32 IM_TTL;
|
||||
|
||||
|
||||
class LLIMInfo : public LLRefCount
|
||||
{
|
||||
protected:
|
||||
LLIMInfo();
|
||||
~LLIMInfo();
|
||||
|
||||
public:
|
||||
LLIMInfo(LLMessageSystem* msg,
|
||||
EIMSource source = IM_FROM_SIM,
|
||||
S32 ttl = IM_TTL);
|
||||
|
||||
LLIMInfo(
|
||||
const LLUUID& from_id,
|
||||
BOOL from_group,
|
||||
const LLUUID& to_id,
|
||||
EInstantMessage im_type,
|
||||
const std::string& name,
|
||||
const std::string& message,
|
||||
const LLUUID& id,
|
||||
U32 parent_estate_id,
|
||||
const LLUUID& region_id,
|
||||
const LLVector3& position,
|
||||
LLSD data,
|
||||
U8 offline,
|
||||
U32 timestamp,
|
||||
EIMSource source,
|
||||
S32 ttl = IM_TTL);
|
||||
|
||||
void packInstantMessage(LLMessageSystem* msg) const;
|
||||
void packMessageBlock(LLMessageSystem* msg) const;
|
||||
void unpackMessageBlock(LLMessageSystem* msg);
|
||||
LLPointer<LLIMInfo> clone();
|
||||
public:
|
||||
LLUUID mFromID;
|
||||
BOOL mFromGroup;
|
||||
LLUUID mToID;
|
||||
U32 mParentEstateID;
|
||||
LLUUID mRegionID;
|
||||
LLVector3 mPosition;
|
||||
U8 mOffline;
|
||||
bool mViewerThinksToIsOnline;
|
||||
EInstantMessage mIMType;
|
||||
LLUUID mID;
|
||||
U32 mTimeStamp;
|
||||
std::string mName;
|
||||
std::string mMessage;
|
||||
LLSD mData;
|
||||
|
||||
EIMSource mSource;
|
||||
S32 mTTL;
|
||||
};
|
||||
|
||||
LLPointer<LLIMInfo> llsd_to_im_info(const LLSD& im_info_sd);
|
||||
LLSD im_info_to_llsd(LLPointer<LLIMInfo> im_info);
|
||||
|
||||
void pack_instant_message(
|
||||
LLMessageSystem* msgsystem,
|
||||
const LLUUID& from_id,
|
||||
|
||||
@@ -19,7 +19,7 @@ include_directories(
|
||||
set(llplugin_SOURCE_FILES
|
||||
llpluginclassbasic.cpp
|
||||
llpluginclassmedia.cpp
|
||||
llplugincookiestore.cpp
|
||||
#llplugincookiestore.cpp
|
||||
llplugininstance.cpp
|
||||
llpluginmessage.cpp
|
||||
llpluginmessagepipe.cpp
|
||||
@@ -34,7 +34,7 @@ set(llplugin_HEADER_FILES
|
||||
llpluginclassbasic.h
|
||||
llpluginclassmedia.h
|
||||
llpluginclassmediaowner.h
|
||||
llplugincookiestore.h
|
||||
#llplugincookiestore.h
|
||||
llplugininstance.h
|
||||
llpluginmessage.h
|
||||
llpluginmessageclasses.h
|
||||
|
||||
@@ -4991,110 +4991,6 @@ void LLTextEditor::setOnScrollEndCallback(void (*callback)(void*), void* userdat
|
||||
mScrollbar->setOnScrollEndCallback(callback, userdata);
|
||||
}
|
||||
|
||||
///////////////////////////////////////////////////////////////////
|
||||
// Hack for Notecards
|
||||
|
||||
BOOL LLTextEditor::importBuffer(const char* buffer, S32 length )
|
||||
{
|
||||
std::istringstream instream(buffer);
|
||||
|
||||
// Version 1 format:
|
||||
// Linden text version 1\n
|
||||
// {\n
|
||||
// <EmbeddedItemList chunk>
|
||||
// Text length <bytes without \0>\n
|
||||
// <text without \0> (text may contain ext_char_values)
|
||||
// }\n
|
||||
|
||||
char tbuf[MAX_STRING]; /* Flawfinder: ignore */
|
||||
|
||||
S32 version = 0;
|
||||
instream.getline(tbuf, MAX_STRING);
|
||||
if( 1 != sscanf(tbuf, "Linden text version %d", &version) )
|
||||
{
|
||||
LL_WARNS() << "Invalid Linden text file header " << LL_ENDL;
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
if( 1 != version )
|
||||
{
|
||||
LL_WARNS() << "Invalid Linden text file version: " << version << LL_ENDL;
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
instream.getline(tbuf, MAX_STRING);
|
||||
if( 0 != sscanf(tbuf, "{") )
|
||||
{
|
||||
LL_WARNS() << "Invalid Linden text file format" << LL_ENDL;
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
S32 text_len = 0;
|
||||
instream.getline(tbuf, MAX_STRING);
|
||||
if( 1 != sscanf(tbuf, "Text length %d", &text_len) )
|
||||
{
|
||||
LL_WARNS() << "Invalid Linden text length field" << LL_ENDL;
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
if( text_len > mMaxTextByteLength )
|
||||
{
|
||||
LL_WARNS() << "Invalid Linden text length: " << text_len << LL_ENDL;
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
BOOL success = TRUE;
|
||||
|
||||
char* text = new char[ text_len + 1];
|
||||
if (text == NULL)
|
||||
{
|
||||
LL_ERRS() << "Memory allocation failure." << LL_ENDL;
|
||||
return FALSE;
|
||||
}
|
||||
instream.get(text, text_len + 1, '\0');
|
||||
text[text_len] = '\0';
|
||||
if( text_len != (S32)strlen(text) )/* Flawfinder: ignore */
|
||||
{
|
||||
LL_WARNS() << llformat("Invalid text length: %d != %d ",strlen(text),text_len) << LL_ENDL;/* Flawfinder: ignore */
|
||||
success = FALSE;
|
||||
}
|
||||
|
||||
instream.getline(tbuf, MAX_STRING);
|
||||
if( success && (0 != sscanf(tbuf, "}")) )
|
||||
{
|
||||
LL_WARNS() << "Invalid Linden text file format: missing terminal }" << LL_ENDL;
|
||||
success = FALSE;
|
||||
}
|
||||
|
||||
if( success )
|
||||
{
|
||||
// Actually set the text
|
||||
setText( LLStringExplicit(text) );
|
||||
}
|
||||
|
||||
delete[] text;
|
||||
|
||||
setCursorPos(0);
|
||||
deselect();
|
||||
|
||||
needsReflow();
|
||||
return success;
|
||||
}
|
||||
|
||||
BOOL LLTextEditor::exportBuffer(std::string &buffer )
|
||||
{
|
||||
std::ostringstream outstream(buffer);
|
||||
|
||||
outstream << "Linden text version 1\n";
|
||||
outstream << "{\n";
|
||||
|
||||
outstream << llformat("Text length %d\n", mWText.length() );
|
||||
outstream << getText();
|
||||
outstream << "}\n";
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
// LLTextSegment
|
||||
|
||||
|
||||
@@ -236,8 +236,8 @@ public:
|
||||
void setCommitOnFocusLost(BOOL b) { mCommitOnFocusLost = b; }
|
||||
|
||||
// Hack to handle Notecards
|
||||
virtual BOOL importBuffer(const char* buffer, S32 length );
|
||||
virtual BOOL exportBuffer(std::string& buffer );
|
||||
virtual BOOL importBuffer(const char* buffer, S32 length) { return false; }
|
||||
virtual BOOL exportBuffer(std::string& buffer) { return false; }
|
||||
|
||||
// If takes focus, will take keyboard focus on click.
|
||||
void setTakesFocus(BOOL b) { mTakesFocus = b; }
|
||||
|
||||
@@ -588,7 +588,7 @@ void LLUrlEntryAgent::onAvatarNameCache(const LLUUID& id,
|
||||
}
|
||||
mAvatarNameCacheConnections.erase(range.first, range.second);
|
||||
|
||||
std::string label = av_name.getCompleteName();
|
||||
std::string label = av_name.getNSName();
|
||||
|
||||
// received the agent name from the server - tell our observers
|
||||
callObservers(id.asString(), label, mIcon);
|
||||
@@ -666,7 +666,7 @@ std::string LLUrlEntryAgent::getLabel(const std::string &url, const LLUrlLabelCa
|
||||
LLAvatarName av_name;
|
||||
if (LLAvatarNameCache::get(agent_id, &av_name))
|
||||
{
|
||||
std::string label = av_name.getCompleteName();
|
||||
std::string label = av_name.getNSName();
|
||||
|
||||
// handle suffixes like /mute or /offerteleport
|
||||
label = localize_slapp_label(url, label);
|
||||
|
||||
@@ -235,7 +235,7 @@ private:
|
||||
|
||||
private:
|
||||
// widgets in general are not copyable
|
||||
LLView(const LLView& other) {};
|
||||
LLView(const LLView& other) = delete;
|
||||
public:
|
||||
#if LL_DEBUG
|
||||
static BOOL sIsDrawing;
|
||||
|
||||
@@ -18,7 +18,6 @@ include(FMODSTUDIO)
|
||||
include(GeneratePrecompiledHeader)
|
||||
include(GLOD)
|
||||
include(Hunspell)
|
||||
include(Json)
|
||||
include(LLAddBuildTest)
|
||||
include(LLAppearance)
|
||||
include(LLAudio)
|
||||
@@ -63,7 +62,6 @@ include_directories(
|
||||
${STATEMACHINE_INCLUDE_DIRS}
|
||||
${DBUSGLIB_INCLUDE_DIRS}
|
||||
${ZLIB_INCLUDE_DIRS}
|
||||
${JSON_INCLUDE_DIR}
|
||||
${GLOD_INCLUDE_DIR}
|
||||
${LLAUDIO_INCLUDE_DIRS}
|
||||
${LLCHARACTER_INCLUDE_DIRS}
|
||||
@@ -92,6 +90,7 @@ set(viewer_SOURCE_FILES
|
||||
aixmllindengenepool.cpp
|
||||
alfloaterregiontracker.cpp
|
||||
aoremotectrl.cpp
|
||||
aosystem.cpp
|
||||
ascentfloatercontactgroups.cpp
|
||||
ascentkeyword.cpp
|
||||
ascentprefschat.cpp
|
||||
@@ -119,6 +118,7 @@ set(viewer_SOURCE_FILES
|
||||
llaisapi.cpp
|
||||
llagent.cpp
|
||||
llagentaccess.cpp
|
||||
llagentbenefits.cpp
|
||||
llagentcamera.cpp
|
||||
llagentdata.cpp
|
||||
llagentlanguage.cpp
|
||||
@@ -636,6 +636,8 @@ set(viewer_HEADER_FILES
|
||||
aixmllindengenepool.h
|
||||
alfloaterregiontracker.h
|
||||
aoremotectrl.h
|
||||
aostate.h
|
||||
aosystem.h
|
||||
ascentfloatercontactgroups.h
|
||||
ascentkeyword.h
|
||||
ascentprefschat.h
|
||||
@@ -663,6 +665,7 @@ set(viewer_HEADER_FILES
|
||||
llaisapi.h
|
||||
llagent.h
|
||||
llagentaccess.h
|
||||
llagentbenefits.h
|
||||
llagentcamera.h
|
||||
llagentdata.h
|
||||
llagentlanguage.h
|
||||
@@ -1705,6 +1708,7 @@ target_link_libraries(${VIEWER_BINARY_NAME}
|
||||
${LLAPPEARANCE_LIBRARIES}
|
||||
absl::flat_hash_map
|
||||
absl::node_hash_map
|
||||
nlohmann_json::nlohmann_json
|
||||
${FMT_LIBRARY}
|
||||
)
|
||||
|
||||
@@ -1823,7 +1827,7 @@ if (DARWIN)
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/viewer_manifest.py
|
||||
)
|
||||
|
||||
add_dependencies(${VIEWER_BINARY_NAME} SLPlugin media_plugin_libvlc media_plugin_webkit basic_plugin_filepicker)
|
||||
add_dependencies(${VIEWER_BINARY_NAME} SLPlugin media_plugin_libvlc media_plugin_cef basic_plugin_filepicker)
|
||||
|
||||
if (PACKAGE)
|
||||
add_custom_target(llpackage ALL DEPENDS ${VIEWER_BINARY_NAME})
|
||||
|
||||
@@ -1 +1 @@
|
||||
1.8.7
|
||||
1.8.9
|
||||
|
||||
37
indra/newview/aostate.h
Normal file
37
indra/newview/aostate.h
Normal file
@@ -0,0 +1,37 @@
|
||||
#pragma once
|
||||
|
||||
enum AOState : U8
|
||||
{
|
||||
STATE_AGENT_IDLE,
|
||||
STATE_AGENT_WALK,
|
||||
STATE_AGENT_RUN,
|
||||
|
||||
STATE_AGENT_PRE_JUMP,
|
||||
STATE_AGENT_JUMP,
|
||||
STATE_AGENT_TURNLEFT,
|
||||
STATE_AGENT_TURNRIGHT,
|
||||
|
||||
STATE_AGENT_SIT,
|
||||
STATE_AGENT_SIT_GROUND,
|
||||
|
||||
STATE_AGENT_HOVER,
|
||||
STATE_AGENT_HOVER_DOWN,
|
||||
STATE_AGENT_HOVER_UP,
|
||||
|
||||
STATE_AGENT_CROUCH,
|
||||
STATE_AGENT_CROUCHWALK,
|
||||
STATE_AGENT_FALLDOWN,
|
||||
STATE_AGENT_STANDUP,
|
||||
STATE_AGENT_LAND,
|
||||
|
||||
STATE_AGENT_FLY,
|
||||
STATE_AGENT_FLYSLOW,
|
||||
|
||||
STATE_AGENT_TYPE,
|
||||
|
||||
STATE_AGENT_SWIM_DOWN,
|
||||
STATE_AGENT_SWIM_UP,
|
||||
STATE_AGENT_SWIM,
|
||||
STATE_AGENT_FLOAT,
|
||||
STATE_AGENT_END
|
||||
};
|
||||
596
indra/newview/aosystem.cpp
Normal file
596
indra/newview/aosystem.cpp
Normal file
@@ -0,0 +1,596 @@
|
||||
/**
|
||||
* @file aosystem.cpp
|
||||
* @brief clientside animation overrider
|
||||
* by Skills Hak & Liru Færs
|
||||
*/
|
||||
|
||||
#include "llviewerprecompiledheaders.h"
|
||||
|
||||
#include "aosystem.h"
|
||||
|
||||
#include "floaterao.h"
|
||||
#include "llagent.h"
|
||||
#include "llagentcamera.h"
|
||||
#include "llanimationstates.h"
|
||||
#include "llinventoryfunctions.h"
|
||||
#include "llinventorypanel.h"
|
||||
#include "llinventorymodelbackgroundfetch.h"
|
||||
#include "llmemorystream.h"
|
||||
#include "llnotecard.h"
|
||||
#include "llstartup.h"
|
||||
#include "llvoavatarself.h"
|
||||
#include "llviewerregion.h"
|
||||
#include "roles_constants.h"
|
||||
|
||||
#include <boost/regex.hpp>
|
||||
|
||||
// Uncomment and use instead if we ever add the chatbar as a command line - MC
|
||||
void cmdline_printchat(const std::string& message);
|
||||
|
||||
namespace
|
||||
{
|
||||
bool sSwimming = false;
|
||||
bool enable_swim()
|
||||
{
|
||||
static const LLCachedControl<bool> swim(gSavedSettings, "AOSwimEnabled", false);
|
||||
return swim;
|
||||
}
|
||||
bool is_underwater() { return enable_swim() && gAgentAvatarp && gAgentAvatarp->mBelowWater; }
|
||||
}
|
||||
|
||||
// -------------------------------------------------------
|
||||
void AOSystem::AOStandTimer::reset()
|
||||
{
|
||||
mPeriod = gSavedSettings.getF32("AOStandInterval");
|
||||
mEventTimer.reset();
|
||||
// LL_INFOS() << "reset" << LL_ENDL;
|
||||
}
|
||||
|
||||
// -------------------------------------------------------
|
||||
class AOInvTimer final : public LLEventTimer, public LLSingleton<AOInvTimer>
|
||||
{
|
||||
friend class LLSingleton<AOInvTimer>;
|
||||
friend class AOSystem;
|
||||
AOInvTimer() : LLEventTimer(1.0f) {}
|
||||
~AOInvTimer() {}
|
||||
static void createIfNeeded()
|
||||
{
|
||||
if (needed()) LLSingleton::getInstance();
|
||||
else AOSystem::getInstance();
|
||||
}
|
||||
public:
|
||||
static bool needed()
|
||||
{
|
||||
return LLStartUp::getStartupState() < STATE_INVENTORY_SEND // Haven't done inventory transfer yet
|
||||
|| !LLInventoryModelBackgroundFetch::instance().isEverythingFetched(); // Everything hasn't been fetched yet
|
||||
}
|
||||
BOOL tick() override
|
||||
{
|
||||
if (!gSavedSettings.getBOOL("AOEnabled")) return true; // If disabled on a tick, we don't care anymore
|
||||
if (!needed())
|
||||
{
|
||||
// cmdline_printchat("Inventory fetched, loading AO.");
|
||||
AOSystem::getInstance(); // Initializes everything
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
};
|
||||
|
||||
class ObjectNameMatches final : public LLInventoryCollectFunctor
|
||||
{
|
||||
public:
|
||||
ObjectNameMatches(const std::string& name, const LLUUID& folder) : mName(name), mFolder(folder) {}
|
||||
virtual ~ObjectNameMatches() {}
|
||||
bool operator()(LLInventoryCategory* cat, LLInventoryItem* item) override
|
||||
{
|
||||
return item && item->getParentUUID() == mFolder && item->getName() == mName;
|
||||
}
|
||||
private:
|
||||
const std::string& mName;
|
||||
const LLUUID& mFolder;
|
||||
};
|
||||
|
||||
static LLUUID invfolderid;
|
||||
LLUUID getAssetIDByName(const std::string& name)
|
||||
{
|
||||
if (name.empty()) return LLUUID::null;
|
||||
|
||||
LLViewerInventoryCategory::cat_array_t cats;
|
||||
LLViewerInventoryItem::item_array_t items;
|
||||
ObjectNameMatches matches(name, invfolderid);
|
||||
gInventory.collectDescendentsIf(LLUUID::null, cats, items, false, matches, true);
|
||||
|
||||
return items.empty() ? LLUUID(name) : items[0]->getAssetUUID();
|
||||
};
|
||||
|
||||
void AOSystem::start()
|
||||
{
|
||||
llassert(!instanceExists() && !AOInvTimer::instanceExists()); // This should only be run once!
|
||||
|
||||
auto control(gSavedSettings.getControl("AOEnabled"));
|
||||
if (control->get()) AOInvTimer::createIfNeeded(); // Start the clock
|
||||
|
||||
control->getSignal()->connect([](LLControlVariable*, const LLSD& enabled) {
|
||||
if (enabled.asBoolean()) AOInvTimer::createIfNeeded(); // Start the clock
|
||||
else deleteSingleton();
|
||||
});
|
||||
}
|
||||
|
||||
// STUFF -------------------------------------------------------
|
||||
|
||||
AOSystem::overrides::overrides(const char* setting_name)
|
||||
: setting(setting_name ? gSavedPerAccountSettings.getControl("AODefault" + std::string(setting_name)) : nullptr)
|
||||
, playing(false)
|
||||
{
|
||||
}
|
||||
|
||||
bool AOSystem::overrides::play_condition() const
|
||||
{
|
||||
// Stop stand first then play
|
||||
instance().stopCurrentStand();
|
||||
return false;
|
||||
}
|
||||
|
||||
void AOSystem::overrides::play(bool start)
|
||||
{
|
||||
if (playing == start) return;
|
||||
// LL_INFOS() << "st" << (start ? "art" : "op") << " override: " << aop->getOverride() << LL_ENDL;
|
||||
// We can always stop, but starting is particular
|
||||
if (start)
|
||||
{
|
||||
if (play_condition())
|
||||
return;
|
||||
}
|
||||
else if (playing && !isLowPriority()) // Stands were turned off if this isn't a low priority overrides
|
||||
{
|
||||
if (!isAgentAvatarValid() && !gAgentAvatarp->isSitting() && !gAgent.getFlying()) // check if sitting or hovering
|
||||
instance().stand().play();
|
||||
}
|
||||
playing = start;
|
||||
gAgent.sendAnimationRequest(ao_id, start ? ANIM_REQUEST_START : ANIM_REQUEST_STOP);
|
||||
}
|
||||
|
||||
struct override_low_priority final : public AOSystem::overrides
|
||||
{
|
||||
override_low_priority(const LLUUID& id, const char* setting_name = nullptr)
|
||||
: overrides(setting_name), orig_id(id) {}
|
||||
bool overrideAnim(bool swimming, const LLUUID& anim) const override { return orig_id == anim; }
|
||||
bool play_condition() const override { return false; }
|
||||
bool isLowPriority() const override { return true; }
|
||||
private:
|
||||
const LLUUID orig_id;
|
||||
};
|
||||
|
||||
struct override_single final : public AOSystem::overrides
|
||||
{
|
||||
override_single(const LLUUID& id, const char* setting_name = nullptr, U8 swim = 2)
|
||||
: overrides(setting_name), orig_id(id), swim(swim) {}
|
||||
bool overrideAnim(bool swimming, const LLUUID& anim) const override { return (swim == 2 || !!swim == swimming) && orig_id == anim; }
|
||||
private:
|
||||
const LLUUID orig_id;
|
||||
const U8 swim; // 2 = irrelevant, 0 = flying, 1 = swimming
|
||||
};
|
||||
|
||||
struct override_sit final : public AOSystem::overrides
|
||||
{
|
||||
override_sit(const uuid_set_t& ids, const char* setting_name = nullptr)
|
||||
: overrides(setting_name)
|
||||
, orig_ids(ids)
|
||||
{}
|
||||
bool overrideAnim(bool swimming, const LLUUID& anim) const override { return orig_ids.find(anim) != orig_ids.end(); }
|
||||
bool play_condition() const override
|
||||
{
|
||||
overrides::play_condition();
|
||||
return !gSavedSettings.getBOOL("AOSitsEnabled");
|
||||
}
|
||||
private:
|
||||
const uuid_set_t orig_ids;
|
||||
};
|
||||
|
||||
bool AOSystem::override_stand::play_condition() const
|
||||
{
|
||||
// Do not call base, stands do their own thing
|
||||
// stands have lowest priority
|
||||
return (!isAgentAvatarValid() || gAgentAvatarp->isSitting())
|
||||
&& (gAgentCamera.cameraMouselook() && gSavedSettings.getBOOL("AONoStandsInMouselook"));
|
||||
}
|
||||
|
||||
bool AOSystem::override_stand::overrideAnim(bool swimming, const LLUUID& anim) const
|
||||
{
|
||||
return anim == ANIM_AGENT_STAND;
|
||||
}
|
||||
|
||||
AOSystem::AOSystem()
|
||||
: stand_iterator(0)
|
||||
, mAOOverrides({})
|
||||
{
|
||||
// TODO: When we move to C++20 and when GCC and MSVC support it (at the time of writing, neither fully do), use __VA_OPT__ here instead.
|
||||
#define ANY_OVERRIDE(which, state, ...) mAOOverrides[STATE_AGENT_##state] = new which(ANIM_AGENT_##state, ##__VA_ARGS__)
|
||||
#define BASIC_OVERRIDE(state, ...) ANY_OVERRIDE(override_single, state, ##__VA_ARGS__)
|
||||
mAOOverrides[STATE_AGENT_IDLE] = new override_stand();
|
||||
BASIC_OVERRIDE(WALK, "Walk");
|
||||
BASIC_OVERRIDE(RUN, "Run");
|
||||
BASIC_OVERRIDE(PRE_JUMP, "PreJump");
|
||||
BASIC_OVERRIDE(JUMP, "Jump");
|
||||
BASIC_OVERRIDE(TURNLEFT);
|
||||
BASIC_OVERRIDE(TURNRIGHT);
|
||||
|
||||
#define SIT_OVERRIDE(control, state, ...) mAOOverrides[STATE_AGENT_##state] = new override_sit(uuid_set_t{ANIM_AGENT_##state, __VA_ARGS__}, control)
|
||||
SIT_OVERRIDE("Sit", SIT, ANIM_AGENT_SIT_FEMALE, ANIM_AGENT_SIT_GENERIC);
|
||||
SIT_OVERRIDE("GroundSit", SIT_GROUND, ANIM_AGENT_SIT_GROUND_CONSTRAINED);
|
||||
#undef SIT_OVERRIDE
|
||||
|
||||
BASIC_OVERRIDE(HOVER, "Hover", false);
|
||||
BASIC_OVERRIDE(HOVER_DOWN, "FlyDown", false);
|
||||
BASIC_OVERRIDE(HOVER_UP, "FlyUp", false);
|
||||
|
||||
BASIC_OVERRIDE(CROUCH, "Crouch");
|
||||
BASIC_OVERRIDE(CROUCHWALK, "CrouchWalk");
|
||||
BASIC_OVERRIDE(FALLDOWN, "Fall");
|
||||
BASIC_OVERRIDE(STANDUP, "StandUp");
|
||||
BASIC_OVERRIDE(LAND, "Land");
|
||||
|
||||
BASIC_OVERRIDE(FLY, "Fly", false);
|
||||
BASIC_OVERRIDE(FLYSLOW, "FlySlow", false);
|
||||
|
||||
ANY_OVERRIDE(override_low_priority, TYPE, "Typing");
|
||||
|
||||
mAOOverrides[STATE_AGENT_SWIM_DOWN] = new override_single(ANIM_AGENT_HOVER_DOWN, "SwimDown", true);
|
||||
mAOOverrides[STATE_AGENT_SWIM_UP] = new override_single(ANIM_AGENT_HOVER_UP, "SwimUp", true);
|
||||
mAOOverrides[STATE_AGENT_SWIM] = new override_single(ANIM_AGENT_FLY, "Swim", true);
|
||||
mAOOverrides[STATE_AGENT_FLOAT] = new override_single(ANIM_AGENT_HOVER, "Float", true);
|
||||
#undef BASIC_OVERRIDE
|
||||
#undef ANY_OVERRIDE
|
||||
|
||||
auto swim_forced = gSavedSettings.getControl("AOSwimForced");
|
||||
sSwimming = swim_forced->get().asBoolean() || is_underwater();
|
||||
mConnections[0] = gSavedSettings.getControl("AOSitsEnabled")->getSignal()->connect([this](LLControlVariable*, const LLSD& val) {
|
||||
if (!isAgentAvatarValid() || !gAgentAvatarp->isSitting()) return;
|
||||
gAgent.sendAnimationRequest(mAOOverrides[gAgentAvatarp->getParent() ? STATE_AGENT_SIT : STATE_AGENT_SIT_GROUND]->ao_id, val.asBoolean() ? ANIM_REQUEST_START : ANIM_REQUEST_STOP);
|
||||
});
|
||||
const auto& swim_cb = [=](LLControlVariable*, const LLSD&){ toggleSwim(swim_forced->get().asBoolean() || is_underwater()); };
|
||||
auto swim_enabled = gSavedSettings.getControl("AOSwimEnabled");
|
||||
mConnections[1] = swim_enabled->getSignal()->connect(swim_cb);
|
||||
mConnections[2] = swim_forced->getSignal()->connect([swim_cb, swim_enabled](LLControlVariable*, const LLSD& val) {
|
||||
if (val.asBoolean()) // Automatically enable Swim AO.
|
||||
swim_enabled->set(true);
|
||||
swim_cb(nullptr, LLSD());
|
||||
});
|
||||
}
|
||||
|
||||
AOSystem::~AOSystem()
|
||||
{
|
||||
stopAllOverrides();
|
||||
for (auto& ao : mAOOverrides)
|
||||
{
|
||||
if (ao)
|
||||
{
|
||||
delete ao;
|
||||
ao = nullptr;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void AOSystem::requestConfigNotecard(bool reload)
|
||||
{
|
||||
LLUUID configncitem = (LLUUID)gSavedPerAccountSettings.getString("AOConfigNotecardID");
|
||||
if (configncitem.notNull())
|
||||
{
|
||||
bool success = false;
|
||||
if (const LLInventoryItem* item = gInventory.getItem(configncitem))
|
||||
{
|
||||
if (gAgent.allowOperation(PERM_COPY, item->getPermissions(), GP_OBJECT_MANIPULATE) || gAgent.isGodlike())
|
||||
{
|
||||
if (item->getAssetUUID().notNull())
|
||||
{
|
||||
invfolderid = item->getParentUUID();
|
||||
gAssetStorage->getInvItemAsset(LLHost::invalid,
|
||||
gAgentID,
|
||||
gAgentSessionID,
|
||||
item->getPermissions().getOwner(),
|
||||
LLUUID::null,
|
||||
item->getUUID(),
|
||||
item->getAssetUUID(),
|
||||
item->getType(),
|
||||
[reload](LLVFS* vfs, const LLUUID& asset_uuid, LLAssetType::EType type, void* user_data, S32 status, LLExtStat ext_status)
|
||||
{
|
||||
parseNotecard(vfs, asset_uuid, type, status, reload);
|
||||
},
|
||||
nullptr,
|
||||
true);
|
||||
success = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
if (!success) cmdline_printchat("Could not read the specified Config Notecard");
|
||||
}
|
||||
}
|
||||
|
||||
void AOSystem::initSingleton()
|
||||
{
|
||||
mAOStands.clear();
|
||||
requestConfigNotecard();
|
||||
}
|
||||
|
||||
void AOSystem::typing(bool start)
|
||||
{
|
||||
uuid_vec_t anims;
|
||||
// If we're stopping, stop regardless, just in case the setting was toggled during (e.g.: keyboard shortcut)
|
||||
if (!start || gSavedSettings.getBOOL("PlayTypingAnim")) // Linden typing
|
||||
anims.push_back(ANIM_AGENT_TYPE);
|
||||
if (const auto& ao = getIfExists()) // Typing override
|
||||
anims.push_back(ao->mAOOverrides[STATE_AGENT_TYPE]->getOverride());
|
||||
if (anims.empty()) return;
|
||||
gAgent.sendAnimationRequests(anims, start ? ANIM_REQUEST_START : ANIM_REQUEST_STOP);
|
||||
}
|
||||
|
||||
AOState GetStateFromToken(const std::string& strtoken)
|
||||
{
|
||||
if (strtoken == "[ Sitting On Ground ]") return STATE_AGENT_SIT_GROUND;
|
||||
if (strtoken == "[ Sitting ]") return STATE_AGENT_SIT;
|
||||
if (strtoken == "[ Crouching ]") return STATE_AGENT_CROUCH;
|
||||
if (strtoken == "[ Crouch Walking ]") return STATE_AGENT_CROUCHWALK;
|
||||
if (strtoken == "[ Standing Up ]") return STATE_AGENT_STANDUP;
|
||||
if (strtoken == "[ Falling ]") return STATE_AGENT_FALLDOWN;
|
||||
if (strtoken == "[ Flying Down ]") return STATE_AGENT_HOVER_DOWN;
|
||||
if (strtoken == "[ Flying Up ]") return STATE_AGENT_HOVER_UP;
|
||||
if (strtoken == "[ Flying Slow ]") return STATE_AGENT_FLYSLOW;
|
||||
if (strtoken == "[ Flying ]") return STATE_AGENT_FLY;
|
||||
if (strtoken == "[ Hovering ]") return STATE_AGENT_HOVER;
|
||||
if (strtoken == "[ Jumping ]") return STATE_AGENT_JUMP;
|
||||
if (strtoken == "[ Pre Jumping ]") return STATE_AGENT_PRE_JUMP;
|
||||
if (strtoken == "[ Running ]") return STATE_AGENT_RUN;
|
||||
if (strtoken == "[ Turning Right ]") return STATE_AGENT_TURNRIGHT;
|
||||
if (strtoken == "[ Turning Left ]") return STATE_AGENT_TURNLEFT;
|
||||
if (strtoken == "[ Walking ]") return STATE_AGENT_WALK;
|
||||
if (strtoken == "[ Landing ]") return STATE_AGENT_LAND;
|
||||
if (strtoken == "[ Standing ]") return STATE_AGENT_IDLE;
|
||||
if (strtoken == "[ Swimming Down ]") return STATE_AGENT_SWIM_DOWN;
|
||||
if (strtoken == "[ Swimming Up ]") return STATE_AGENT_SWIM_UP;
|
||||
if (strtoken == "[ Swimming Forward ]") return STATE_AGENT_SWIM;
|
||||
if (strtoken == "[ Floating ]") return STATE_AGENT_FLOAT;
|
||||
if (strtoken == "[ Typing ]") return STATE_AGENT_TYPE;
|
||||
return STATE_AGENT_END;
|
||||
}
|
||||
|
||||
void AOSystem::updateStand()
|
||||
{
|
||||
auto& stand_ao = stand();
|
||||
bool is_standing = stand_ao.playing;
|
||||
if (is_standing) stand_ao.play(false); // Stop stand first
|
||||
stand_ao.update(mAOStands, stand_iterator); // Now update stand
|
||||
if (is_standing && !mAOStands.empty()) // Play stand if needed
|
||||
stand_ao.play();
|
||||
}
|
||||
|
||||
int AOSystem::cycleStand(bool next, bool random)
|
||||
{
|
||||
if (mAOStands.empty()) return -1;
|
||||
const int size = mAOStands.size();
|
||||
if (size > 1)
|
||||
{
|
||||
if (random && gSavedSettings.getBOOL("AOStandRandomize"))
|
||||
for (auto previous = stand_iterator; previous == stand_iterator;
|
||||
stand_iterator = ll_rand(size));
|
||||
else
|
||||
{
|
||||
stand_iterator += next ? 1 : -1;
|
||||
// Wrap around
|
||||
if (stand_iterator == size) stand_iterator = 0;
|
||||
else if (stand_iterator == -1) stand_iterator = size - 1;
|
||||
}
|
||||
if (auto floater = LLFloaterAO::findInstance())
|
||||
if (auto combo = floater->getComboFromState(STATE_AGENT_IDLE))
|
||||
combo->selectNthItem(stand_iterator);
|
||||
// LL_INFOS() << "changing stand to " << mAOStands[stand_iterator].anim_name << LL_ENDL;
|
||||
}
|
||||
updateStand();
|
||||
return stand_iterator;
|
||||
}
|
||||
|
||||
void AOSystem::toggleSwim(bool underwater)
|
||||
{
|
||||
sSwimming = underwater && enable_swim();
|
||||
|
||||
if (isStanding()) return; // Don't bother if we're just standing (Who pushed us?!)
|
||||
|
||||
typedef std::array<overrides*, 4> flies_t;
|
||||
// Stop all of the previous states
|
||||
#define AOO(state) mAOOverrides[STATE_AGENT_##state]
|
||||
const flies_t swims = { AOO(FLOAT), AOO(SWIM), AOO(SWIM_UP), AOO(SWIM_DOWN) };
|
||||
const flies_t flies = { AOO(HOVER), AOO(FLY), AOO(HOVER_UP), AOO(HOVER_DOWN) };
|
||||
#undef AOO
|
||||
const auto& oldaos = sSwimming ? flies : swims;
|
||||
const auto& newaos = sSwimming ? swims : flies;
|
||||
|
||||
for (auto i = 0; i < oldaos.size(); ++i)
|
||||
{
|
||||
auto& old = *oldaos[i];
|
||||
if (old.playing)
|
||||
{
|
||||
old.play(false);
|
||||
newaos[i]->play();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void AOSystem::doMotion(const LLUUID& id, bool start)
|
||||
{
|
||||
if (id.isNull() || !gAgentAvatarp) return;
|
||||
|
||||
overrides* aop = nullptr;
|
||||
AOState state = STATE_AGENT_IDLE;
|
||||
for (U8 i = STATE_AGENT_IDLE; !aop && i < STATE_AGENT_END; ++i)
|
||||
{
|
||||
auto& ao = mAOOverrides[i];
|
||||
if (ao && ao->overrideAnim(sSwimming, id))
|
||||
{
|
||||
aop = ao;
|
||||
state = (AOState)i;
|
||||
}
|
||||
}
|
||||
if (aop)
|
||||
{
|
||||
// LL_INFOS() << "st" << (start ? "art" : "op") << " anim " << id << " state " << state << LL_ENDL;
|
||||
aop->play(start);
|
||||
}
|
||||
}
|
||||
|
||||
void AOSystem::stopAllOverrides() const
|
||||
{
|
||||
if (!isAgentAvatarValid()) return;
|
||||
uuid_vec_t anims;
|
||||
for (auto& ao : mAOOverrides)
|
||||
{
|
||||
if (ao->playing)
|
||||
{
|
||||
anims.push_back(ao->getOverride());
|
||||
ao->playing = false;
|
||||
}
|
||||
}
|
||||
for (const auto& stand : mAOStands)
|
||||
anims.push_back(stand.ao_id);
|
||||
gAgent.sendAnimationRequests(anims, ANIM_REQUEST_STOP);
|
||||
}
|
||||
|
||||
void AOSystem::parseNotecard(LLVFS *vfs, const LLUUID& asset_uuid, LLAssetType::EType type, S32 status, bool reload)
|
||||
{
|
||||
if (status == LL_ERR_NOERR)
|
||||
{
|
||||
if (type == LLAssetType::AT_NOTECARD)
|
||||
{
|
||||
AOSystem* self = getIfExists();
|
||||
S32 size = vfs->getSize(asset_uuid, LLAssetType::AT_NOTECARD);
|
||||
U8* buffer = new U8[size];
|
||||
vfs->getData(asset_uuid, type, buffer, 0, size);
|
||||
LLMemoryStream str(buffer, size);
|
||||
LLNotecard nc;
|
||||
if (nc.importStream(str))
|
||||
{
|
||||
LL_INFOS() << "ao nc decode success" << LL_ENDL;
|
||||
|
||||
if (self && reload) self->stopAllOverrides();
|
||||
|
||||
auto floater = LLFloaterAO::findInstance();
|
||||
if (floater)
|
||||
for (auto& combo : floater->mCombos)
|
||||
{
|
||||
if (combo)
|
||||
{
|
||||
combo->clear();
|
||||
combo->removeall();
|
||||
}
|
||||
}
|
||||
|
||||
typedef boost::tokenizer<boost::char_separator<char> > tokenizer;
|
||||
boost::char_separator<char> sep("\n");
|
||||
tokenizer tokline(nc.getText(), sep);
|
||||
|
||||
for (const auto& strline : tokline)
|
||||
{
|
||||
// LL_INFOS() << "uncommented line: " << strline << LL_ENDL;
|
||||
boost::regex type("^(\\s*)(\\[ )(.*)( \\])");
|
||||
boost::smatch what;
|
||||
if (boost::regex_search(strline, what, type))
|
||||
{
|
||||
const std::string strtoken(what[0]);
|
||||
const AOState state = GetStateFromToken(strtoken);
|
||||
if (state == STATE_AGENT_END)
|
||||
{
|
||||
LL_WARNS() << "Invalid token: " << strtoken << LL_ENDL;
|
||||
continue;
|
||||
}
|
||||
// LL_INFOS() << "type: " << strtoken << LL_ENDL;
|
||||
LLComboBox* combo = floater ? floater->getComboFromState(state) : nullptr;
|
||||
auto aop = (reload && self) ? self->mAOOverrides[state] : nullptr;
|
||||
// LL_INFOS() << "anims in type: " << boost::regex_replace(strline, type, "") << LL_ENDL;
|
||||
|
||||
boost::char_separator<char> sep("|,");
|
||||
std::string stranimnames(boost::regex_replace(strline, type, ""));
|
||||
tokenizer tokanimnames(stranimnames, sep);
|
||||
for (const auto& stranim : tokanimnames)
|
||||
{
|
||||
if (stranim.empty()) continue;
|
||||
const auto& animid(getAssetIDByName(stranim));
|
||||
|
||||
// LL_INFOS() << invfolderid.asString().c_str() << LL_ENDL;
|
||||
// LL_INFOS() << "anim: " << stranim.c_str() << " assetid: " << animid << LL_ENDL;
|
||||
if (animid.notNull())
|
||||
{
|
||||
if (aop) // If we're reloading
|
||||
{
|
||||
if (state == STATE_AGENT_IDLE)
|
||||
self->mAOStands.push_back({ animid, stranim });
|
||||
else
|
||||
aop->ao_id = animid;
|
||||
}
|
||||
|
||||
if (combo && !combo->selectByValue(stranim)) // check if exists
|
||||
combo->add(stranim, ADD_BOTTOM, true);
|
||||
}
|
||||
else cmdline_printchat("Warning: animation '" + stranim + "' could not be found (Section: " + strtoken + ").");
|
||||
}
|
||||
}
|
||||
}
|
||||
LL_INFOS() << "ao nc read sucess" << LL_ENDL;
|
||||
|
||||
if (self)
|
||||
{
|
||||
if (auto combo = floater ? floater->getComboFromState(STATE_AGENT_IDLE) : nullptr)
|
||||
combo->selectNthItem(self->stand_iterator);
|
||||
|
||||
for (U8 i = STATE_AGENT_IDLE+1; i < STATE_AGENT_END; ++i)
|
||||
{
|
||||
auto& aop = self->mAOOverrides[i];
|
||||
if (!aop) continue;
|
||||
auto& ao = *aop;
|
||||
const auto& setting = ao.setting;
|
||||
if (!setting && ao.ao_id.isNull()) continue;
|
||||
const auto& defaultanim = setting ? setting->get().asStringRef() : ao.ao_id.asString();
|
||||
if (defaultanim.empty()) continue;
|
||||
const LLUUID& ao_id = getAssetIDByName(defaultanim);
|
||||
if (reload && ao_id.notNull()) ao.ao_id = ao_id;
|
||||
if (LLComboBox* combo = floater ? floater->getComboFromState(i) : nullptr)
|
||||
if (!combo->selectByValue(defaultanim))
|
||||
combo->add(defaultanim, ADD_BOTTOM, true);
|
||||
}
|
||||
|
||||
if (reload && isAgentAvatarValid())
|
||||
{
|
||||
// Fix the stand iter, container size may have changed
|
||||
auto& iter = self->stand_iterator;
|
||||
const auto& stands = self->mAOStands;
|
||||
iter = llmin(iter, (int)stands.size()-1);
|
||||
// Update the current stand
|
||||
self->stand().update(stands, iter);
|
||||
self->mAOStandTimer.reset();
|
||||
|
||||
const auto& anims = gAgentAvatarp->mPlayingAnimations;
|
||||
bool playing = false;
|
||||
for (auto& aop : self->mAOOverrides)
|
||||
{
|
||||
for (const auto& anim : anims)
|
||||
{
|
||||
if (aop && aop->overrideAnim(sSwimming, anim.first))
|
||||
{
|
||||
if (!aop->isLowPriority()) playing = true;
|
||||
aop->play();
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (!playing) self->stand().play(); // Play stand if nothing was being played, this sometimes happens
|
||||
|
||||
// Toggle typing AO the moment we toggle AO
|
||||
typing(gAgent.getRenderState() & AGENT_STATE_TYPING);
|
||||
}
|
||||
}
|
||||
}
|
||||
else LL_INFOS() << "ao nc decode error" << LL_ENDL;
|
||||
delete[] buffer;
|
||||
}
|
||||
}
|
||||
else LL_INFOS() << "ao nc read error" << LL_ENDL;
|
||||
}
|
||||
101
indra/newview/aosystem.h
Normal file
101
indra/newview/aosystem.h
Normal file
@@ -0,0 +1,101 @@
|
||||
#pragma once
|
||||
|
||||
#include "aostate.h"
|
||||
#include "llcontrol.h"
|
||||
#include "lleventtimer.h"
|
||||
|
||||
class AOSystem final : public LLSingleton<AOSystem>
|
||||
{
|
||||
friend class LLSingleton<AOSystem>;
|
||||
friend class AOInvTimer;
|
||||
friend class LLFloaterAO;
|
||||
AOSystem();
|
||||
~AOSystem();
|
||||
public:
|
||||
static void start(); // Runs the necessary actions to get the AOSystem ready, then initializes it.
|
||||
void initSingleton() override;
|
||||
|
||||
static void typing(bool start);
|
||||
|
||||
int stand_iterator;
|
||||
bool isStanding() const { return stand().playing; }
|
||||
void updateStand();
|
||||
int cycleStand(bool next = true, bool random = true);
|
||||
void toggleSwim(bool underwater);
|
||||
|
||||
void doMotion(const LLUUID& id, bool start);
|
||||
void startMotion(const LLUUID& id) { doMotion(id, true); }
|
||||
void stopMotion(const LLUUID& id) { doMotion(id, false); }
|
||||
void stopCurrentStand() const { stand().play(false); }
|
||||
void stopAllOverrides() const;
|
||||
|
||||
protected:
|
||||
struct struct_stands
|
||||
{
|
||||
LLUUID ao_id;
|
||||
std::string anim_name;
|
||||
};
|
||||
typedef std::vector<struct_stands> stands_vec;
|
||||
stands_vec mAOStands;
|
||||
|
||||
struct overrides
|
||||
{
|
||||
virtual bool overrideAnim(bool swimming, const LLUUID& anim) const = 0;
|
||||
virtual const LLUUID& getOverride() const { return ao_id; }
|
||||
virtual bool play_condition() const; // True if prevented from playing
|
||||
virtual bool isLowPriority() const { return false; }
|
||||
void play(bool start = true);
|
||||
LLUUID ao_id;
|
||||
LLPointer<LLControlVariable> setting;
|
||||
bool playing;
|
||||
virtual ~overrides() {}
|
||||
protected:
|
||||
overrides(const char* setting_name);
|
||||
};
|
||||
friend struct override_low_priority;
|
||||
friend struct override_single;
|
||||
friend struct override_sit;
|
||||
struct override_stand final : public overrides
|
||||
{
|
||||
override_stand() : overrides(nullptr) {}
|
||||
bool overrideAnim(bool swimming, const LLUUID& anim) const override;
|
||||
bool play_condition() const override;
|
||||
bool isLowPriority() const override { return true; }
|
||||
void update(const stands_vec& stands, const int& iter)
|
||||
{
|
||||
if (stands.empty()) ao_id.setNull();
|
||||
else ao_id = stands[iter].ao_id;
|
||||
}
|
||||
};
|
||||
std::array<overrides*, STATE_AGENT_END> mAOOverrides;
|
||||
|
||||
override_stand& stand() const { return static_cast<override_stand&>(*mAOOverrides[STATE_AGENT_IDLE]); }
|
||||
|
||||
private:
|
||||
std::array<boost::signals2::scoped_connection, 3> mConnections;
|
||||
|
||||
|
||||
class AOStandTimer final : public LLEventTimer
|
||||
{
|
||||
friend class AOSystem;
|
||||
public:
|
||||
AOStandTimer() : LLEventTimer(F32_MAX) {}
|
||||
~AOStandTimer()
|
||||
{
|
||||
// LL_INFOS() << "dead" << LL_ENDL;
|
||||
}
|
||||
BOOL tick() override
|
||||
{
|
||||
// LL_INFOS() << "tick" << LL_ENDL;
|
||||
if (auto ao = AOSystem::getIfExists())
|
||||
ao->cycleStand();
|
||||
return false;
|
||||
}
|
||||
void reset();
|
||||
};
|
||||
AOStandTimer mAOStandTimer;
|
||||
|
||||
static void requestConfigNotecard(bool reload = true);
|
||||
static void parseNotecard(LLVFS* vfs, const LLUUID& asset_uuid, LLAssetType::EType type, S32 status, bool reload);
|
||||
};
|
||||
|
||||
@@ -133,6 +133,17 @@
|
||||
media_plugin_libvlc
|
||||
</impl>
|
||||
</scheme>
|
||||
<scheme name="example">
|
||||
<label name="example_label">
|
||||
Example Plugin scheme trigger
|
||||
</label>
|
||||
<widgettype>
|
||||
movie
|
||||
</widgettype>
|
||||
<impl>
|
||||
media_plugin_example
|
||||
</impl>
|
||||
</scheme>
|
||||
<scheme name="libvlc">
|
||||
<label name="libvlc_label">
|
||||
LibVLC supported media
|
||||
@@ -474,8 +485,8 @@
|
||||
media_plugin_libvlc
|
||||
</impl>
|
||||
</mimetype>
|
||||
<mimetype menu="1" name="video/libvlc">
|
||||
<label name="video/libvlc_label">
|
||||
<mimetype menu="1" name="video/quicktime">
|
||||
<label name="video/quicktime_label">
|
||||
Movie (QuickTime)
|
||||
</label>
|
||||
<widgettype>
|
||||
@@ -515,7 +526,7 @@
|
||||
movie
|
||||
</widgettype>
|
||||
<impl>
|
||||
media_plugin_cef
|
||||
media_plugin_libvlc
|
||||
</impl>
|
||||
</mimetype>
|
||||
</mimetypes>
|
||||
|
||||
@@ -497,6 +497,19 @@
|
||||
<key>IsCOA</key>
|
||||
<integer>1</integer>
|
||||
</map>
|
||||
<key>AOSwimForced</key>
|
||||
<map>
|
||||
<key>Comment</key>
|
||||
<string>Sets AOSwimEnabled to true, and plays swims instead of flies, even if not underwater.</string>
|
||||
<key>Persist</key>
|
||||
<integer>1</integer>
|
||||
<key>Type</key>
|
||||
<string>Boolean</string>
|
||||
<key>Value</key>
|
||||
<integer>0</integer>
|
||||
<key>IsCOA</key>
|
||||
<integer>1</integer>
|
||||
</map>
|
||||
<key>AONoStandsInMouselook</key>
|
||||
<map>
|
||||
<key>Comment</key>
|
||||
@@ -12615,6 +12628,18 @@ This should be as low as possible, but too low may break functionality</string>
|
||||
<integer>128</integer>
|
||||
</map>
|
||||
|
||||
<key>OctreeMinimumNodeSize</key>
|
||||
<map>
|
||||
<key>Comment</key>
|
||||
<string>Minimum size of any octree node</string>
|
||||
<key>Persist</key>
|
||||
<integer>1</integer>
|
||||
<key>Type</key>
|
||||
<string>F32</string>
|
||||
<key>Value</key>
|
||||
<real>0.01</real>
|
||||
</map>
|
||||
|
||||
<key>OctreeReserveNodeCapacity</key>
|
||||
<map>
|
||||
<key>Comment</key>
|
||||
|
||||
@@ -984,6 +984,17 @@ RIP Latif Khalifa.</string>
|
||||
<key>Value</key>
|
||||
<boolean>1</boolean>
|
||||
</map>
|
||||
<key>SinguOwnerSayAsErrors</key>
|
||||
<map>
|
||||
<key>Comment</key>
|
||||
<string>llOwnerSay will show up in the script error console instead of in chat.</string>
|
||||
<key>Persist</key>
|
||||
<integer>1</integer>
|
||||
<key>Type</key>
|
||||
<string>Boolean</string>
|
||||
<key>Value</key>
|
||||
<boolean>0</boolean>
|
||||
</map>
|
||||
<key>SinguPostProcessDefault</key>
|
||||
<map>
|
||||
<key>Comment</key>
|
||||
|
||||
@@ -207,6 +207,7 @@ void LLPrefsAscentSys::refreshValues()
|
||||
mDisplayScriptJumps = gSavedSettings.getBOOL("AscentDisplayTotalScriptJumps");
|
||||
mNumScriptDiff = gSavedSettings.getF32("Ascentnumscriptdiff");
|
||||
mReplaceLinks = gSavedSettings.getBOOL("SinguReplaceLinks");
|
||||
mEmergencySeconds = gSavedPerAccountSettings.getU32("EmergencyTeleportSeconds");
|
||||
mLandmark = gSavedPerAccountSettings.getString("EmergencyTeleportLandmark");
|
||||
mLandmarkBackup = gSavedPerAccountSettings.getString("EmergencyTeleportLandmarkBackup");
|
||||
|
||||
@@ -353,6 +354,7 @@ void LLPrefsAscentSys::cancel()
|
||||
gSavedSettings.setBOOL("AscentDisplayTotalScriptJumps", mDisplayScriptJumps);
|
||||
gSavedSettings.setF32("Ascentnumscriptdiff", mNumScriptDiff);
|
||||
gSavedSettings.setBOOL("SinguReplaceLinks", mReplaceLinks);
|
||||
gSavedPerAccountSettings.setU32("EmergencyTeleportSeconds", mEmergencySeconds);
|
||||
gSavedPerAccountSettings.setString("EmergencyTeleportLandmark", mLandmark);
|
||||
gSavedPerAccountSettings.setString("EmergencyTeleportLandmarkBackup", mLandmarkBackup);
|
||||
|
||||
|
||||
@@ -118,6 +118,7 @@ private:
|
||||
bool mDisplayScriptJumps;
|
||||
bool mReplaceLinks;
|
||||
F32 mNumScriptDiff;
|
||||
U32 mEmergencySeconds;
|
||||
std::string mLandmark;
|
||||
std::string mLandmarkBackup;
|
||||
|
||||
|
||||
@@ -163,10 +163,11 @@ Wavefront::Wavefront(LLFace* face, LLPolyMesh* mesh, const LLXform* transform, c
|
||||
if (transform_normals) Transform(normals, transform_normals);
|
||||
|
||||
const U32 pcount = mesh ? mesh->getNumFaces() : (vb->getNumIndices()/3); //indices
|
||||
const U16 offset = face->getIndicesStart(); //indices
|
||||
const U32 offset = face->getIndicesStart(); //indices
|
||||
for (U32 i = 0; i < pcount; ++i)
|
||||
{
|
||||
triangles.push_back(tri(getIndices[i * 3 + offset] + start, getIndices[i * 3 + 1 + offset] + start, getIndices[i * 3 + 2 + offset] + start));
|
||||
const auto off = i * 3 + offset;
|
||||
triangles.push_back(tri(getIndices[off] + start, getIndices[off + 1] + start, getIndices[off + 2] + start));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -174,9 +175,9 @@ void Wavefront::Transform(vert_t& v, const LLXform* x) //recursive
|
||||
{
|
||||
LLMatrix4 m;
|
||||
x->getLocalMat4(m);
|
||||
for (vert_t::iterator iterv = v.begin(); iterv != v.end(); ++iterv)
|
||||
for (auto& i : v)
|
||||
{
|
||||
iterv->first = iterv->first * m;
|
||||
i.first = i.first * m;
|
||||
}
|
||||
|
||||
if (const LLXform* xp = x->getParent()) Transform(v, xp);
|
||||
@@ -186,9 +187,9 @@ void Wavefront::Transform(vec3_t& v, const LLXform* x) //recursive
|
||||
{
|
||||
LLMatrix4 m;
|
||||
x->getLocalMat4(m);
|
||||
for (vec3_t::iterator iterv = v.begin(); iterv != v.end(); ++iterv)
|
||||
for (auto& i : v)
|
||||
{
|
||||
*iterv = *iterv * m;
|
||||
i = i * m;
|
||||
}
|
||||
|
||||
if (const LLXform* xp = x->getParent()) Transform(v, xp);
|
||||
@@ -252,9 +253,9 @@ namespace
|
||||
asset_id_matches);
|
||||
|
||||
// See if any of the inventory items matching this sculpt id are exportable
|
||||
for (U32 i = 0; i < items.size(); i++)
|
||||
for (const auto& item : items)
|
||||
{
|
||||
const LLPermissions item_permissions = items[i]->getPermissions();
|
||||
const LLPermissions item_permissions = item->getPermissions();
|
||||
if (item_permissions.allowExportBy(gAgentID, LFSimFeatureHandler::instance().exportPolicy()))
|
||||
{
|
||||
return true;
|
||||
@@ -269,9 +270,9 @@ namespace
|
||||
}
|
||||
}
|
||||
|
||||
class LFSaveSelectedObjects : public view_listener_t
|
||||
class LFSaveSelectedObjects final : public view_listener_t
|
||||
{
|
||||
bool handleEvent(LLPointer<LLOldEvents::LLEvent> event, const LLSD& userdata)
|
||||
bool handleEvent(LLPointer<LLOldEvents::LLEvent> event, const LLSD& userdata) override
|
||||
{
|
||||
if (LLObjectSelectionHandle selection = LLSelectMgr::getInstance()->getSelection())
|
||||
{
|
||||
@@ -288,10 +289,10 @@ namespace
|
||||
S32 included = 0;
|
||||
for (LLObjectSelection::iterator iter = selection->begin(); iter != selection->end(); ++iter)
|
||||
{
|
||||
total++;
|
||||
++total;
|
||||
LLSelectNode* node = *iter;
|
||||
if (!can_export_node(node)) continue;
|
||||
included++;
|
||||
++included;
|
||||
wfsaver->Add(node->getObject());
|
||||
}
|
||||
if (wfsaver->obj_v.empty())
|
||||
@@ -322,12 +323,12 @@ void WavefrontSaver::Add(const LLVOAvatar* av_vo) //adds attachments, too!
|
||||
{
|
||||
offset = -av_vo->getRenderPosition();
|
||||
avatar_joint_list_t vjv = av_vo->mMeshLOD;
|
||||
for (avatar_joint_list_t::const_iterator itervj = vjv.begin(); itervj != vjv.end(); ++itervj)
|
||||
for (const auto& itervj : vjv)
|
||||
{
|
||||
const LLViewerJoint* vj = dynamic_cast<LLViewerJoint*>(*itervj);
|
||||
const auto* vj = dynamic_cast<const LLViewerJoint*>(itervj);
|
||||
if (!vj || vj->mMeshParts.empty()) continue;
|
||||
|
||||
LLViewerJointMesh* vjm = dynamic_cast<LLViewerJointMesh*>(vj->mMeshParts[0]); //highest LOD
|
||||
auto* vjm = dynamic_cast<LLViewerJointMesh*>(vj->mMeshParts[0]); //highest LOD
|
||||
if (!vjm) continue;
|
||||
|
||||
vjm->updateJointGeometry();
|
||||
@@ -355,21 +356,19 @@ void WavefrontSaver::Add(const LLVOAvatar* av_vo) //adds attachments, too!
|
||||
Add(Wavefront(face, pm, NULL, &normfix));
|
||||
}
|
||||
|
||||
for (LLVOAvatar::attachment_map_t::const_iterator iter = av_vo->mAttachmentPoints.begin(); iter != av_vo->mAttachmentPoints.end(); ++iter)
|
||||
for (const auto& ap : av_vo->mAttachmentPoints)
|
||||
{
|
||||
LLViewerJointAttachment* ja = iter->second;
|
||||
LLViewerJointAttachment* ja = ap.second;
|
||||
if (!ja) continue;
|
||||
|
||||
for (LLViewerJointAttachment::attachedobjs_vec_t::iterator itero = ja->mAttachedObjects.begin(); itero != ja->mAttachedObjects.end(); ++itero)
|
||||
for (const auto& o : ja->mAttachedObjects)
|
||||
{
|
||||
LLViewerObject* o = *itero;
|
||||
if (!o) continue;
|
||||
|
||||
std::vector<LLViewerObject*> prims;
|
||||
o->addThisAndAllChildren(prims);
|
||||
for (std::vector<LLViewerObject* >::iterator iterc = prims.begin(); iterc != prims.end(); ++iterc)
|
||||
for (const auto& c : prims)
|
||||
{
|
||||
const LLViewerObject* c = *iterc;
|
||||
if (!c) continue;
|
||||
if (LLSelectNode* n = LLSelectMgr::getInstance()->getSelection()->findNode(const_cast<LLViewerObject*>(c)))
|
||||
{
|
||||
@@ -400,9 +399,9 @@ void WavefrontSaver::Add(const LLVOAvatar* av_vo) //adds attachments, too!
|
||||
}
|
||||
namespace
|
||||
{
|
||||
class LFSaveSelectedAvatar : public view_listener_t
|
||||
class LFSaveSelectedAvatar final : public view_listener_t
|
||||
{
|
||||
bool handleEvent(LLPointer<LLOldEvents::LLEvent> event, const LLSD& userdata)
|
||||
bool handleEvent(LLPointer<LLOldEvents::LLEvent> event, const LLSD& userdata) override
|
||||
{
|
||||
if (const LLVOAvatar* avatar = find_avatar_from_object(LLSelectMgr::getInstance()->getSelection()->getPrimaryObject()))
|
||||
{
|
||||
@@ -446,49 +445,48 @@ bool WavefrontSaver::saveFile(LLFILE* fp)
|
||||
|
||||
int num = 0;
|
||||
int index = 0;
|
||||
for (std::vector<Wavefront>::iterator w_iter = obj_v.begin(); w_iter != obj_v.end(); ++w_iter)
|
||||
for (const auto& obj : obj_v)
|
||||
{
|
||||
int count = 0;
|
||||
|
||||
std::string name = (*w_iter).name;
|
||||
std::string name = obj.name;
|
||||
if (name.empty()) name = llformat("%d", num++);
|
||||
|
||||
vert_t vertices = (*w_iter).vertices;
|
||||
vec3_t normals = (*w_iter).normals;
|
||||
tri_t triangles = (*w_iter).triangles;
|
||||
auto& vertices = obj.vertices;
|
||||
auto& normals = obj.normals;
|
||||
auto& triangles = obj.triangles;
|
||||
|
||||
//Write Object
|
||||
write_or_bust(fp, "o " + name + "\n");
|
||||
write_or_bust(fp, "o " + name + '\n');
|
||||
|
||||
//Write vertices; swap axes if necessary
|
||||
static const LLCachedControl<bool> swapYZ("OBJExportSwapYZ", false);
|
||||
const double xm = swapYZ ? -1.0 : 1.0;
|
||||
const int y = swapYZ ? 2 : 1;
|
||||
const int z = swapYZ ? 1 : 2;
|
||||
for (vert_t::iterator v_iter = vertices.begin(); v_iter != vertices.end(); ++v_iter)
|
||||
for (const auto& vert : vertices)
|
||||
{
|
||||
++count;
|
||||
const LLVector3 v = v_iter->first + offset;
|
||||
const LLVector3 v = vert.first + offset;
|
||||
write_or_bust(fp, llformat("v %f %f %f\n",v[0] * xm, v[y], v[z]));
|
||||
}
|
||||
|
||||
for (vec3_t::iterator n_iter = normals.begin(); n_iter != normals.end(); ++n_iter)
|
||||
for (const auto& n : normals)
|
||||
{
|
||||
const LLVector3 n = *n_iter;
|
||||
write_or_bust(fp, llformat("vn %f %f %f\n",n[0] * xm, n[y], n[z]));
|
||||
}
|
||||
|
||||
for (vert_t::iterator v_iter = vertices.begin(); v_iter != vertices.end(); ++v_iter)
|
||||
for (const auto& vert : vertices)
|
||||
{
|
||||
write_or_bust(fp, llformat("vt %f %f\n", v_iter->second[0], v_iter->second[1]));
|
||||
write_or_bust(fp, llformat("vt %f %f\n", vert.second[0], vert.second[1]));
|
||||
}
|
||||
|
||||
//Write triangles
|
||||
for (tri_t::iterator t_iter = triangles.begin(); t_iter != triangles.end(); ++t_iter)
|
||||
for (const auto& triangle : triangles)
|
||||
{
|
||||
const int f1 = t_iter->v0 + index + 1;
|
||||
const int f2 = t_iter->v1 + index + 1;
|
||||
const int f3 = t_iter->v2 + index + 1;
|
||||
const int f1 = triangle.v0 + index + 1;
|
||||
const int f2 = triangle.v1 + index + 1;
|
||||
const int f3 = triangle.v2 + index + 1;
|
||||
write_or_bust(fp, llformat("f %d/%d/%d %d/%d/%d %d/%d/%d\n",
|
||||
f1,f1,f1,f2,f2,f2,f3,f3,f3));
|
||||
}
|
||||
|
||||
@@ -32,16 +32,18 @@
|
||||
|
||||
// library includes
|
||||
#include "aifilepicker.h"
|
||||
#include "llavatarnamecache.h"
|
||||
#include "llnotificationsutil.h"
|
||||
|
||||
// newview includes
|
||||
#include "lfsimfeaturehandler.h"
|
||||
#include "llface.h"
|
||||
#include "llvovolume.h"
|
||||
#include "llviewerinventory.h"
|
||||
#include "llinventorymodel.h"
|
||||
#include "llinventoryfunctions.h"
|
||||
#include "llface.h"
|
||||
#include "llversioninfo.h"
|
||||
#include "llviewerinventory.h"
|
||||
#include "llviewertexturelist.h"
|
||||
#include "llvovolume.h"
|
||||
|
||||
// menu includes
|
||||
#include "llevent.h"
|
||||
@@ -74,11 +76,11 @@ typedef LLMemberListener<LLView> view_listener_t;
|
||||
|
||||
namespace DAEExportUtil
|
||||
{
|
||||
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");
|
||||
const auto LL_TEXTURE_PLYWOOD = LLUUID("89556747-24cb-43ed-920b-47caed15465f");
|
||||
const auto LL_TEXTURE_BLANK = LLUUID("5748decc-f629-461c-9a36-a35a221fe21f");
|
||||
const auto LL_TEXTURE_INVISIBLE = LLUUID("38b86f85-2575-52a9-a531-23108d8da837");
|
||||
const auto LL_TEXTURE_TRANSPARENT = LLUUID("8dcd4a48-2d37-4909-9f78-f7a9eb4ef903");
|
||||
const auto LL_TEXTURE_MEDIA = LLUUID("8b5fec65-8d8d-9dc5-cda8-8fdf2716e361");
|
||||
|
||||
enum image_format_type
|
||||
{
|
||||
@@ -105,23 +107,17 @@ namespace DAEExportUtil
|
||||
|
||||
// See if any of the inventory items matching this texture id are exportable
|
||||
ExportPolicy policy = LFSimFeatureHandler::instance().exportPolicy();
|
||||
for (size_t i = 0; i < items.size(); i++)
|
||||
for (const auto& item : items)
|
||||
{
|
||||
const LLPermissions item_permissions = items[i]->getPermissions();
|
||||
const LLPermissions item_permissions = item->getPermissions();
|
||||
if (item_permissions.allowExportBy(gAgentID, policy))
|
||||
{
|
||||
if (name != NULL)
|
||||
{
|
||||
(*name) = items[i]->getName();
|
||||
}
|
||||
if (name) *name = item->getName();
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
if (name != NULL)
|
||||
{
|
||||
(*name) = id.getString();
|
||||
}
|
||||
if (name) *name = id.getString();
|
||||
|
||||
return (policy & ep_full_perm) == ep_full_perm;
|
||||
}
|
||||
@@ -206,7 +202,7 @@ public:
|
||||
}
|
||||
}
|
||||
|
||||
BOOL postBuild()
|
||||
BOOL postBuild() override
|
||||
{
|
||||
mFileName = getChildView("file name editor");
|
||||
mExportBtn = getChildView("export button");
|
||||
@@ -306,14 +302,9 @@ public:
|
||||
S32 getNumExportableTextures()
|
||||
{
|
||||
S32 res = 0;
|
||||
|
||||
for (DAESaver::string_list_t::const_iterator t = mSaver.mTextureNames.begin(); t != mSaver.mTextureNames.end(); ++t)
|
||||
for (const auto& name : mSaver.mTextureNames)
|
||||
{
|
||||
std::string name = *t;
|
||||
if (!name.empty())
|
||||
{
|
||||
++res;
|
||||
}
|
||||
if (!name.empty()) ++res;
|
||||
}
|
||||
|
||||
return res;
|
||||
@@ -365,7 +356,7 @@ public:
|
||||
gIdleCallbacks.addFunction(saveTexturesWorker, this);
|
||||
}
|
||||
|
||||
class CacheReadResponder : public LLTextureCache::ReadResponder
|
||||
class CacheReadResponder final : public LLTextureCache::ReadResponder
|
||||
{
|
||||
private:
|
||||
LLPointer<LLImageFormatted> mFormattedImage;
|
||||
@@ -413,7 +404,7 @@ public:
|
||||
mImageLocal = imagelocal;
|
||||
}
|
||||
|
||||
virtual void completed(bool success)
|
||||
void completed(bool success) override
|
||||
{
|
||||
if (success && mFormattedImage.notNull() && mImageSize > 0)
|
||||
{
|
||||
@@ -546,10 +537,8 @@ void DAESaver::updateTextureInfo()
|
||||
{
|
||||
LLTextureEntry* te = obj->getTE(face_num);
|
||||
const LLUUID id = te->getID();
|
||||
if (std::find(mTextures.begin(), mTextures.end(), id) != mTextures.end())
|
||||
{
|
||||
continue;
|
||||
}
|
||||
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))
|
||||
@@ -566,7 +555,6 @@ void DAESaver::updateTextureInfo()
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
class v4adapt
|
||||
{
|
||||
private:
|
||||
@@ -579,7 +567,7 @@ public:
|
||||
}
|
||||
};
|
||||
|
||||
void DAESaver::addSource(daeElement* mesh, const char* src_id, std::string params, const std::vector<F32> &vals)
|
||||
void DAESaver::addSource(daeElement* mesh, const char* src_id, const std::string& params, const std::vector<F32> &vals)
|
||||
{
|
||||
daeElement* source = mesh->add("source");
|
||||
source->setAttribute("id", src_id);
|
||||
@@ -588,9 +576,9 @@ 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 (U32 i = 0; i < vals.size(); i++)
|
||||
for (const auto& val : vals)
|
||||
{
|
||||
((domFloat_array*)src_array)->getValue().append(vals[i]);
|
||||
static_cast<domFloat_array*>(src_array)->getValue().append(val);
|
||||
}
|
||||
|
||||
domAccessor* acc = daeSafeCast<domAccessor>(source->add("technique_common accessor"));
|
||||
@@ -598,10 +586,10 @@ void DAESaver::addSource(daeElement* mesh, const char* src_id, std::string param
|
||||
acc->setCount(vals.size() / params.size());
|
||||
acc->setStride(params.size());
|
||||
|
||||
for (std::string::iterator p_iter = params.begin(); p_iter != params.end(); ++p_iter)
|
||||
for (const auto& param : params)
|
||||
{
|
||||
domElement* pX = acc->add("param");
|
||||
pX->setAttribute("name", llformat("%c", *p_iter).c_str());
|
||||
pX->setAttribute("name", (LLStringUtil::null + param).c_str());
|
||||
pX->setAttribute("type", "float");
|
||||
}
|
||||
}
|
||||
@@ -650,7 +638,7 @@ void DAESaver::addPolygons(daeElement* mesh, const char* geomID, const char* mat
|
||||
{
|
||||
for (S32 i = 0; i < face->mNumIndices; i++)
|
||||
{
|
||||
U16 index = index_offset + face->mIndices[i];
|
||||
U32 index = index_offset + face->mIndices[i];
|
||||
(p->getValue()).append(index);
|
||||
if (i % 3 == 0)
|
||||
{
|
||||
@@ -710,11 +698,21 @@ void DAESaver::transformTexCoord(S32 num_vert, LLVector2* coord, LLVector3* posi
|
||||
|
||||
bool DAESaver::saveDAE(std::string filename)
|
||||
{
|
||||
// Collada expects file and folder names to be escaped
|
||||
// Note: cdom::nativePathToUri()
|
||||
// Same as in LLDAELoader::OpenFile()
|
||||
const char* allowed =
|
||||
"ABCDEFGHIJKLMNOPQRSTUVWXYZ"
|
||||
"abcdefghijklmnopqrstuvwxyz"
|
||||
"0123456789"
|
||||
"%-._~:\"|\\/";
|
||||
std::string uri_filename = LLURI::escape(filename, allowed);
|
||||
|
||||
mAllMaterials.clear();
|
||||
mTotalNumMaterials = 0;
|
||||
DAE dae;
|
||||
// First set the filename to save
|
||||
daeElement* root = dae.add(filename);
|
||||
daeElement* root = dae.add(uri_filename);
|
||||
|
||||
// Obligatory elements in header
|
||||
daeElement* asset = root->add("asset");
|
||||
@@ -734,9 +732,13 @@ bool DAESaver::saveDAE(std::string filename)
|
||||
up_axis->setCharData("Z_UP");
|
||||
|
||||
// File creator
|
||||
std::string author;
|
||||
if (!LLAvatarNameCache::getNSName(gAgentID, author))
|
||||
author = "Unknown";
|
||||
|
||||
daeElement* contributor = asset->add("contributor");
|
||||
contributor->add("author")->setCharData(LLAppViewer::instance()->getSecondLifeTitle() + " User");
|
||||
contributor->add("authoring_tool")->setCharData(LLAppViewer::instance()->getSecondLifeTitle() + " Collada Export");
|
||||
contributor->add("author")->setCharData(author);
|
||||
contributor->add("authoring_tool")->setCharData(LLVersionInfo::getChannelAndVersion() + " Collada Export");
|
||||
|
||||
daeElement* images = root->add("library_images");
|
||||
daeElement* geomLib = root->add("library_geometries");
|
||||
@@ -825,7 +827,6 @@ bool DAESaver::saveDAE(std::string filename)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
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);
|
||||
@@ -845,12 +846,11 @@ bool DAESaver::saveDAE(std::string filename)
|
||||
// Add triangles
|
||||
if (gSavedSettings.getBOOL("DAEExportConsolidateMaterials"))
|
||||
{
|
||||
for (U32 objMaterial = 0; objMaterial < objMaterials.size(); objMaterial++)
|
||||
for (const auto& objMaterial : objMaterials)
|
||||
{
|
||||
int_list_t faces;
|
||||
getFacesWithMaterial(obj, objMaterials[objMaterial], &faces);
|
||||
std::string matName = objMaterials[objMaterial].name;
|
||||
addPolygons(mesh, geomID, (matName + "-material").c_str(), obj, &faces);
|
||||
getFacesWithMaterial(obj, objMaterial, &faces);
|
||||
addPolygons(mesh, geomID, (objMaterial.name + "-material").c_str(), obj, &faces);
|
||||
}
|
||||
}
|
||||
else
|
||||
@@ -888,12 +888,12 @@ bool DAESaver::saveDAE(std::string filename)
|
||||
|
||||
// Bind materials
|
||||
daeElement* tq = nodeGeometry->add("bind_material technique_common");
|
||||
for (U32 objMaterial = 0; objMaterial < objMaterials.size(); objMaterial++)
|
||||
for (const auto& objMaterial : objMaterials)
|
||||
{
|
||||
std::string matName = objMaterials[objMaterial].name;
|
||||
daeElement* instanceMaterial = tq->add("instance_material");
|
||||
instanceMaterial->setAttribute("symbol", (matName + "-material").c_str());
|
||||
instanceMaterial->setAttribute("target", ("#" + matName + "-material").c_str());
|
||||
std::string matName = objMaterial.name + "-material";
|
||||
instanceMaterial->setAttribute("symbol", matName.c_str());
|
||||
instanceMaterial->setAttribute("target", ('#' + matName).c_str());
|
||||
}
|
||||
|
||||
nodeGeometry->setAttribute("url", llformat("#%s-%s", geomID, "mesh").c_str());
|
||||
@@ -904,12 +904,12 @@ bool DAESaver::saveDAE(std::string filename)
|
||||
generateEffects(effects);
|
||||
|
||||
// Materials
|
||||
for (U32 objMaterial = 0; objMaterial < mAllMaterials.size(); objMaterial++)
|
||||
for (const auto& objMaterial : mAllMaterials)
|
||||
{
|
||||
daeElement* mat = materials->add("material");
|
||||
mat->setAttribute("id", (mAllMaterials[objMaterial].name + "-material").c_str());
|
||||
mat->setAttribute("id", (objMaterial.name + "-material").c_str());
|
||||
daeElement* matEffect = mat->add("instance_effect");
|
||||
matEffect->setAttribute("url", ("#" + mAllMaterials[objMaterial].name + "-fx").c_str());
|
||||
matEffect->setAttribute("url", ('#' + objMaterial.name + "-fx").c_str());
|
||||
}
|
||||
|
||||
root->add("scene instance_visual_scene")->setAttribute("url", "#Scene");
|
||||
@@ -930,11 +930,11 @@ DAESaver::MaterialInfo DAESaver::getMaterial(LLTextureEntry* te)
|
||||
{
|
||||
if (gSavedSettings.getBOOL("DAEExportConsolidateMaterials"))
|
||||
{
|
||||
for (U32 i=0; i < mAllMaterials.size(); i++)
|
||||
for (const auto& mat : mAllMaterials)
|
||||
{
|
||||
if (mAllMaterials[i].matches(te))
|
||||
if (mat.matches(te))
|
||||
{
|
||||
return mAllMaterials[i];
|
||||
return mat;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -944,7 +944,7 @@ DAESaver::MaterialInfo DAESaver::getMaterial(LLTextureEntry* te)
|
||||
ret.color = te->getColor();
|
||||
ret.name = llformat("Material%d", mAllMaterials.size());
|
||||
mAllMaterials.push_back(ret);
|
||||
return mAllMaterials[mAllMaterials.size() - 1];
|
||||
return ret;
|
||||
}
|
||||
|
||||
void DAESaver::getMaterials(LLViewerObject* obj, material_list_t* ret)
|
||||
@@ -954,10 +954,7 @@ void DAESaver::getMaterials(LLViewerObject* obj, material_list_t* ret)
|
||||
{
|
||||
LLTextureEntry* te = obj->getTE(face_num);
|
||||
|
||||
if (skipFace(te))
|
||||
{
|
||||
continue;
|
||||
}
|
||||
if (skipFace(te)) continue;
|
||||
|
||||
MaterialInfo mat = getMaterial(te);
|
||||
|
||||
@@ -968,7 +965,7 @@ void DAESaver::getMaterials(LLViewerObject* obj, material_list_t* ret)
|
||||
}
|
||||
}
|
||||
|
||||
void DAESaver::getFacesWithMaterial(LLViewerObject* obj, MaterialInfo& mat, int_list_t* ret)
|
||||
void DAESaver::getFacesWithMaterial(LLViewerObject* obj, const MaterialInfo& mat, int_list_t* ret)
|
||||
{
|
||||
S32 num_faces = obj->getVolume()->getNumVolumeFaces();
|
||||
for (S32 face_num = 0; face_num < num_faces; ++face_num)
|
||||
@@ -985,11 +982,11 @@ void DAESaver::generateEffects(daeElement *effects)
|
||||
// Effects (face color, alpha)
|
||||
bool export_textures = gSavedSettings.getBOOL("DAEExportTextures");
|
||||
|
||||
for (U32 mat = 0; mat < mAllMaterials.size(); mat++)
|
||||
for (const auto& mat : mAllMaterials)
|
||||
{
|
||||
LLColor4 color = mAllMaterials[mat].color;
|
||||
LLColor4 color = mat.color;
|
||||
domEffect* effect = (domEffect*)effects->add("effect");
|
||||
effect->setId((mAllMaterials[mat].name + "-fx").c_str());
|
||||
effect->setId((mat.name + "-fx").c_str());
|
||||
daeElement* profile = effect->add("profile_COMMON");
|
||||
std::string colladaName;
|
||||
|
||||
@@ -999,7 +996,7 @@ void DAESaver::generateEffects(daeElement *effects)
|
||||
U32 i = 0;
|
||||
for (; i < mTextures.size(); i++)
|
||||
{
|
||||
if (mAllMaterials[mat].textureID == mTextures[i])
|
||||
if (mat.textureID == mTextures[i])
|
||||
{
|
||||
textID = mTextures[i];
|
||||
break;
|
||||
@@ -1043,19 +1040,18 @@ void DAESaver::generateEffects(daeElement *effects)
|
||||
|
||||
void DAESaver::generateImagesSection(daeElement* images)
|
||||
{
|
||||
for (U32 i=0; i < mTextureNames.size(); i++)
|
||||
for (const auto& name : mTextureNames)
|
||||
{
|
||||
std::string name = mTextureNames[i];
|
||||
if (name.empty()) continue;
|
||||
std::string colladaName = name + "_" + mImageFormat;
|
||||
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));
|
||||
image->add("init_from")->setCharData(LLURI::escape(name + '.' + mImageFormat));
|
||||
}
|
||||
}
|
||||
|
||||
class DAESaveSelectedObjects : public view_listener_t
|
||||
class DAESaveSelectedObjects final : public view_listener_t
|
||||
{
|
||||
bool handleEvent(LLPointer<LLOldEvents::LLEvent> event, const LLSD& userdata)
|
||||
{
|
||||
|
||||
@@ -33,50 +33,29 @@ class LLViewerObject;
|
||||
class DAESaver
|
||||
{
|
||||
public:
|
||||
class MaterialInfo
|
||||
struct MaterialInfo
|
||||
{
|
||||
public:
|
||||
LLUUID textureID;
|
||||
LLColor4 color;
|
||||
std::string name;
|
||||
|
||||
bool matches(LLTextureEntry* te)
|
||||
bool matches(LLTextureEntry* te) const
|
||||
{
|
||||
return (textureID == te->getID()) && (color == te->getColor());
|
||||
}
|
||||
|
||||
bool operator== (const MaterialInfo& rhs)
|
||||
bool operator== (const MaterialInfo& rhs) const
|
||||
{
|
||||
return (textureID == rhs.textureID) && (color == rhs.color) && (name == rhs.name);
|
||||
}
|
||||
|
||||
bool operator!= (const MaterialInfo& rhs)
|
||||
bool operator!= (const MaterialInfo& rhs) const
|
||||
{
|
||||
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<std::pair<LLViewerObject*,std::string> > obj_info_t;
|
||||
typedef std::vector<std::pair<LLViewerObject*,std::string>> obj_info_t;
|
||||
typedef uuid_vec_t id_list_t;
|
||||
typedef std::vector<std::string> string_list_t;
|
||||
typedef std::vector<S32> int_list_t;
|
||||
@@ -97,12 +76,12 @@ public:
|
||||
|
||||
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<F32> &vals);
|
||||
void addSource(daeElement* mesh, const char* src_id, const std::string& params, const std::vector<F32> &vals);
|
||||
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 getFacesWithMaterial(LLViewerObject* obj, const MaterialInfo& mat, int_list_t* ret);
|
||||
void generateEffects(daeElement *effects);
|
||||
void generateImagesSection(daeElement* images);
|
||||
};
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -1,134 +1,30 @@
|
||||
#pragma once
|
||||
|
||||
#ifndef LL_LLFLOATERAO_H
|
||||
#define LL_LLFLOATERAO_H
|
||||
|
||||
#include "aostate.h"
|
||||
#include "llfloater.h"
|
||||
#include "llviewercontrol.h"
|
||||
#include "llagent.h"
|
||||
#include "lleventtimer.h"
|
||||
|
||||
|
||||
enum AOState
|
||||
{
|
||||
STATE_AGENT_IDLE = 0,
|
||||
STATE_AGENT_WALK = 1,
|
||||
STATE_AGENT_RUN = 2,
|
||||
STATE_AGENT_STAND = 3,
|
||||
|
||||
STATE_AGENT_PRE_JUMP = 4,
|
||||
STATE_AGENT_JUMP = 5,
|
||||
STATE_AGENT_TURNLEFT = 6,
|
||||
STATE_AGENT_TURNRIGHT = 7,
|
||||
|
||||
STATE_AGENT_SIT = 8,
|
||||
STATE_AGENT_GROUNDSIT = 9,
|
||||
|
||||
STATE_AGENT_HOVER = 10,
|
||||
STATE_AGENT_HOVER_DOWN = 11,
|
||||
STATE_AGENT_HOVER_UP = 12,
|
||||
|
||||
STATE_AGENT_CROUCH = 13,
|
||||
STATE_AGENT_CROUCHWALK = 14,
|
||||
STATE_AGENT_FALLDOWN = 15,
|
||||
STATE_AGENT_STANDUP = 16,
|
||||
STATE_AGENT_LAND = 17,
|
||||
|
||||
STATE_AGENT_FLY = 18,
|
||||
STATE_AGENT_FLYSLOW = 19,
|
||||
|
||||
STATE_AGENT_TYPING = 20,
|
||||
|
||||
STATE_AGENT_SWIM_DOWN = 21,
|
||||
STATE_AGENT_SWIM_UP = 22,
|
||||
STATE_AGENT_SWIM = 23,
|
||||
STATE_AGENT_FLOAT = 24,
|
||||
STATE_AGENT_END
|
||||
};
|
||||
|
||||
|
||||
|
||||
|
||||
class AOStandTimer : public LLEventTimer
|
||||
{
|
||||
public:
|
||||
AOStandTimer();
|
||||
~AOStandTimer();
|
||||
BOOL tick() override;
|
||||
void reset();
|
||||
};
|
||||
|
||||
class AOInvTimer : public LLEventTimer
|
||||
{
|
||||
public:
|
||||
AOInvTimer();
|
||||
~AOInvTimer();
|
||||
BOOL tick() override;
|
||||
};
|
||||
|
||||
class LLFloaterAO : public LLFloater, public LLFloaterSingleton<LLFloaterAO>
|
||||
class LLFloaterAO final : public LLFloater, public LLFloaterSingleton<LLFloaterAO>
|
||||
{
|
||||
friend class AOSystem;
|
||||
public:
|
||||
|
||||
LLFloaterAO(const LLSD&);
|
||||
LLFloaterAO(const LLSD&);
|
||||
BOOL postBuild() override;
|
||||
void onOpen() override;
|
||||
virtual ~LLFloaterAO();
|
||||
|
||||
static void init();
|
||||
|
||||
static void run();
|
||||
virtual ~LLFloaterAO();
|
||||
void updateLayout(bool advanced);
|
||||
|
||||
//static bool loadAnims();
|
||||
void onClickCycleStand(bool next) const;
|
||||
void onClickReloadCard() const;
|
||||
void onClickOpenCard() const;
|
||||
void onClickNewCard() const;
|
||||
|
||||
static void typing(bool start);
|
||||
static AOState flyToSwimState(const AOState& state);
|
||||
static AOState swimToFlyState(const AOState& state);
|
||||
static AOState getAnimationState();
|
||||
static void setAnimationState(const AOState& state);
|
||||
|
||||
static LLUUID getCurrentStandId();
|
||||
static void setCurrentStandId(const LLUUID& id);
|
||||
static int stand_iterator;
|
||||
static void ChangeStand();
|
||||
static void toggleSwim(bool underwater);
|
||||
|
||||
static void doMotion(const LLUUID& id, bool start, bool stand = false);
|
||||
static void startMotion(const LLUUID& id, bool stand = false) { doMotion(id, true, stand); }
|
||||
static void stopMotion(const LLUUID& id, bool stand = false) { doMotion(id, false, stand); }
|
||||
|
||||
static bool swimCheck(const AOState& state);
|
||||
static LLUUID GetAnimID(const LLUUID& id);
|
||||
|
||||
static AOState GetStateFromAnimID(const LLUUID& id);
|
||||
static LLUUID GetAnimIDFromState(const AOState& state);
|
||||
static AOState GetStateFromToken(std::string strtoken);
|
||||
|
||||
static void onClickCycleStand(bool next);
|
||||
static void onClickReloadCard();
|
||||
static void onClickOpenCard();
|
||||
static void onClickNewCard();
|
||||
|
||||
static LLUUID invfolderid;
|
||||
static const LLUUID& getAssetIDByName(const std::string& name);
|
||||
|
||||
private:
|
||||
|
||||
static AOState mAnimationState;
|
||||
static LLUUID mCurrentStandId;
|
||||
|
||||
static void onSpinnerCommit();
|
||||
static void onComboBoxCommit(LLUICtrl* ctrl);
|
||||
void onSpinnerCommit() const;
|
||||
void onComboBoxCommit(LLUICtrl* ctrl) const;
|
||||
std::array<class LLComboBox*, STATE_AGENT_END> mCombos;
|
||||
|
||||
protected:
|
||||
|
||||
static AOState getStateFromCombo(const class LLComboBox* combo);
|
||||
static LLComboBox* getComboFromState(const AOState& state);
|
||||
|
||||
static void onNotecardLoadComplete(LLVFS *vfs,const LLUUID& asset_uuid,LLAssetType::EType type,void* user_data, S32 status, LLExtStat ext_status);
|
||||
|
||||
LLComboBox* getComboFromState(const U8& state) const { return mCombos[state]; }
|
||||
};
|
||||
|
||||
extern AOInvTimer* gAOInvTimer;
|
||||
|
||||
#endif
|
||||
|
||||
@@ -8,7 +8,6 @@
|
||||
|
||||
#include <stdtypes.h>
|
||||
#include <lldir.h>
|
||||
#include <lleconomy.h>
|
||||
#include <llerror.h>
|
||||
#include <llfile.h>
|
||||
#include <llhttpclient.h>
|
||||
@@ -59,7 +58,6 @@ HippoGridInfo::HippoGridInfo(const std::string& gridName) :
|
||||
mRenderCompat(true),
|
||||
mAutoUpdate(false),
|
||||
mLocked(false),
|
||||
mMaxAgentGroups(-1),
|
||||
mCurrencySymbol("OS$"),
|
||||
mCurrencyText("OS Dollars"),
|
||||
mRealCurrencySymbol("US$"),
|
||||
@@ -414,37 +412,22 @@ void HippoGridInfo::getGridInfo()
|
||||
XML_ParserFree(parser);
|
||||
}
|
||||
|
||||
std::string HippoGridInfo::getUploadFee() const
|
||||
{
|
||||
std::string fee;
|
||||
formatFee(fee, LLGlobalEconomy::Singleton::getInstance()->getPriceUpload(), true);
|
||||
return fee;
|
||||
}
|
||||
|
||||
std::string HippoGridInfo::getGroupCreationFee() const
|
||||
{
|
||||
std::string fee;
|
||||
formatFee(fee, LLGlobalEconomy::Singleton::getInstance()->getPriceGroupCreate(), false);
|
||||
return fee;
|
||||
}
|
||||
|
||||
std::string HippoGridInfo::getDirectoryFee() const
|
||||
{
|
||||
std::string fee;
|
||||
formatFee(fee, mDirectoryFee, true);
|
||||
std::string fee = formatFee(mDirectoryFee, true);
|
||||
if (mDirectoryFee != 0) fee += "/" + LLTrans::getString("hippo_label_week");
|
||||
return fee;
|
||||
}
|
||||
|
||||
void HippoGridInfo::formatFee(std::string &fee, int cost, bool showFree) const
|
||||
std::string HippoGridInfo::formatFee(int cost, bool showFree) const
|
||||
{
|
||||
if (showFree && (cost == 0))
|
||||
if (showFree && (cost < 0))
|
||||
{
|
||||
fee = LLTrans::getString("hippo_label_free");
|
||||
return LLTrans::getString("hippo_label_free");
|
||||
}
|
||||
else
|
||||
{
|
||||
fee = llformat("%s%d", getCurrencySymbol().c_str(), cost);
|
||||
return llformat("%s%d", getCurrencySymbol().c_str(), cost);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -56,15 +56,13 @@ public:
|
||||
const std::string& getVoiceConnector() const { return mVoiceConnector; }
|
||||
bool isRenderCompat() const { return mRenderCompat; }
|
||||
std::string getGridNick() const;
|
||||
int getMaxAgentGroups() const { return mMaxAgentGroups; }
|
||||
|
||||
const std::string& getCurrencySymbol() const { return mCurrencySymbol; }
|
||||
const std::string& getCurrencyText() const { return mCurrencyText; }
|
||||
const std::string& getRealCurrencySymbol() const { return mRealCurrencySymbol; }
|
||||
std::string getUploadFee() const;
|
||||
std::string getGroupCreationFee() const;
|
||||
const int& getClassifiedFee() const { return mClassifiedFee; }
|
||||
std::string getDirectoryFee() const;
|
||||
std::string formatFee(S32 cost, bool showFree = true) const;
|
||||
|
||||
void setPlatform (const std::string& platform);
|
||||
void setPlatform (Platform platform);
|
||||
@@ -82,7 +80,6 @@ public:
|
||||
void setSearchUrl(const std::string& url);
|
||||
void setGridMessage(const std::string& message);
|
||||
void setRenderCompat(bool compat);
|
||||
void setMaxAgentGroups(int max) { mMaxAgentGroups = max; }
|
||||
void setVoiceConnector(const std::string& vc) { mVoiceConnector = vc; }
|
||||
void setUPCSupported(bool on);
|
||||
bool getUPCSupported();
|
||||
@@ -123,7 +120,6 @@ private:
|
||||
bool mAutoUpdate;
|
||||
bool mLocked;
|
||||
bool mUPCSupported;
|
||||
int mMaxAgentGroups;
|
||||
|
||||
std::string mCurrencySymbol;
|
||||
std::string mCurrencyText;
|
||||
@@ -143,7 +139,6 @@ private:
|
||||
|
||||
static std::string sanitizeUri(std::string const& uri_in);
|
||||
void useHttps(void);
|
||||
void formatFee(std::string &fee, int cost, bool showFree) const;
|
||||
|
||||
static void onXmlElementStart(void* userData, const XML_Char* name, const XML_Char** atts);
|
||||
static void onXmlElementEnd(void* userData, const XML_Char* name);
|
||||
|
||||
@@ -28,29 +28,8 @@ void HippoLimits::setLimits()
|
||||
}
|
||||
}
|
||||
|
||||
namespace
|
||||
{
|
||||
// gMaxAgentGroups is now sent by login.cgi, which
|
||||
// looks it up from globals.xml.
|
||||
//
|
||||
// For now we need an old default value however,
|
||||
// so the viewer can be deployed ahead of login.cgi.
|
||||
//
|
||||
constexpr S32 DEFAULT_MAX_AGENT_GROUPS = 60;
|
||||
}
|
||||
|
||||
void HippoLimits::setMaxAgentGroups()
|
||||
{
|
||||
//KC: new server defined max groups
|
||||
if (auto grid = gHippoGridManager->getConnectedGrid())
|
||||
mMaxAgentGroups = grid->getMaxAgentGroups();
|
||||
if (mMaxAgentGroups <= 0)
|
||||
mMaxAgentGroups = DEFAULT_MAX_AGENT_GROUPS;
|
||||
}
|
||||
|
||||
void HippoLimits::setOpenSimLimits()
|
||||
{
|
||||
setMaxAgentGroups();
|
||||
mMaxPrimScale = 8192.0f;
|
||||
mMaxHeight = 10000.0f;
|
||||
mMinPrimScale = 0.001f;
|
||||
@@ -67,7 +46,6 @@ void HippoLimits::setOpenSimLimits()
|
||||
|
||||
void HippoLimits::setWhiteCoreLimits()
|
||||
{
|
||||
setMaxAgentGroups();
|
||||
mMaxPrimScale = 8192.0f;
|
||||
mMinPrimScale = 0.001f;
|
||||
mMaxHeight = 10000.0f;
|
||||
@@ -78,7 +56,6 @@ void HippoLimits::setWhiteCoreLimits()
|
||||
void HippoLimits::setSecondLifeLimits()
|
||||
{
|
||||
LL_INFOS() << "Using Second Life limits." << LL_ENDL;
|
||||
setMaxAgentGroups();
|
||||
|
||||
mMinPrimScale = 0.01f;
|
||||
mMaxHeight = 4096.0f;
|
||||
|
||||
@@ -8,7 +8,6 @@ class HippoLimits
|
||||
public:
|
||||
HippoLimits();
|
||||
|
||||
int getMaxAgentGroups() const { return mMaxAgentGroups; }
|
||||
float getMaxHeight() const { return mMaxHeight; }
|
||||
float getMinHoleSize() const { return mMinHoleSize; }
|
||||
float getMaxHollow() const { return mMaxHollow; }
|
||||
@@ -18,14 +17,12 @@ public:
|
||||
void setLimits();
|
||||
|
||||
private:
|
||||
int mMaxAgentGroups;
|
||||
float mMaxHeight;
|
||||
float mMinHoleSize;
|
||||
float mMaxHollow;
|
||||
float mMaxPrimScale;
|
||||
float mMinPrimScale;
|
||||
|
||||
void setMaxAgentGroups();
|
||||
void setOpenSimLimits();
|
||||
void setWhiteCoreLimits();
|
||||
void setSecondLifeLimits();
|
||||
|
||||
@@ -17,7 +17,7 @@
|
||||
//#include "llsdserialize.h"
|
||||
#include "lltooldraganddrop.h"
|
||||
//#include "llassetuploadresponders.h"
|
||||
//#include "lleconomy.h"
|
||||
//#include "llagentbenefits.h"
|
||||
|
||||
//#include "llfloaterperms.h"
|
||||
|
||||
@@ -635,7 +635,7 @@ void ImportTracker::send_inventory(LLSD& prim)
|
||||
body["next_owner_mask"] = LLSD::Integer(U32_MAX);
|
||||
body["group_mask"] = LLSD::Integer(U32_MAX);
|
||||
body["everyone_mask"] = LLSD::Integer(U32_MAX);
|
||||
body["expected_upload_cost"] = LLSD::Integer(LLGlobalEconomy::Singleton::getInstance()->getPriceUpload());
|
||||
body["expected_upload_cost"] = LLAgentBenefits::current().getTextureUploadCost();
|
||||
//cmdline_printchat("posting "+ data->assetid.asString());
|
||||
LLHTTPClient::post(url, body, new JCImportInventoryResponder(body, data->assetid, data->type,data));
|
||||
//error = TRUE;
|
||||
|
||||
@@ -207,7 +207,7 @@
|
||||
;because this will make your installer start faster.
|
||||
|
||||
!insertmacro MUI_RESERVEFILE_LANGDLL
|
||||
ReserveFile "${NSISDIR}\Plugins\x86-unicode\NSISdl.dll"
|
||||
ReserveFile "${NSISDIR}\Plugins\x86-unicode\INetC.dll"
|
||||
ReserveFile "${NSISDIR}\Plugins\x86-unicode\nsDialogs.dll"
|
||||
ReserveFile "${NSISDIR}\Plugins\x86-unicode\StartMenu.dll"
|
||||
ReserveFile "${NSISDIR}\Plugins\x86-unicode\StdUtils.dll"
|
||||
@@ -416,9 +416,9 @@ Section "Viewer"
|
||||
|
||||
;Download LibVLC
|
||||
!ifdef WIN64_BIN_BUILD
|
||||
NSISdl::download "http://download.videolan.org/pub/videolan/vlc/3.0.8/win64/vlc-3.0.8-win64.7z" "$TEMP\AlchemyInst\libvlc.7z"
|
||||
inetc::get /RESUME "Failed to download VLC media package. Retry?" "https://videolan.mirrors.hivelocity.net/vlc/3.0.8/win64/vlc-3.0.8-win64.7z" "$TEMP\AlchemyInst\libvlc.7z" /END
|
||||
!else
|
||||
NSISdl::download "http://download.videolan.org/pub/videolan/vlc/3.0.8/win32/vlc-3.0.8-win32.7z" "$TEMP\AlchemyInst\libvlc.7z"
|
||||
inetc::get /RESUME "Failed to download VLC media package. Retry?" "https://videolan.mirrors.hivelocity.net/vlc/3.0.8/win32/vlc-3.0.8-win32.7z" "$TEMP\AlchemyInst\libvlc.7z" /END
|
||||
!endif
|
||||
Nsis7z::ExtractWithDetails "$TEMP\AlchemyInst\libvlc.7z" "Unpacking media plugins %s..."
|
||||
Rename "$TEMP\AlchemyInst\vlc-3.0.8\libvlc.dll" "$INSTDIR\llplugin\libvlc.dll"
|
||||
@@ -427,16 +427,16 @@ Section "Viewer"
|
||||
|
||||
;Download and install VC redist
|
||||
!ifdef WIN64_BIN_BUILD
|
||||
NSISdl::download "https://aka.ms/vs/16/release/vc_redist.x64.exe" "$TEMP\AlchemyInst\vc_redist_16.x64.exe"
|
||||
inetc::get /RESUME "Failed to download VS2019 redistributable package. Retry?" "https://aka.ms/vs/16/release/vc_redist.x64.exe" "$TEMP\AlchemyInst\vc_redist_16.x64.exe" /END
|
||||
ExecWait "$TEMP\AlchemyInst\vc_redist_16.x64.exe /install /passive /norestart"
|
||||
|
||||
NSISdl::download "https://aka.ms/highdpimfc2013x64enu" "$TEMP\AlchemyInst\vc_redist_12.x64.exe"
|
||||
inetc::get /RESUME "Failed to download VS2013 redistributable package. Retry?" "https://aka.ms/highdpimfc2013x64enu" "$TEMP\AlchemyInst\vc_redist_12.x64.exe" /END
|
||||
ExecWait "$TEMP\AlchemyInst\vc_redist_12.x64.exe /install /passive /norestart"
|
||||
!else
|
||||
NSISdl::download "https://aka.ms/vs/16/release/vc_redist.x86.exe" "$TEMP\AlchemyInst\vc_redist_16.x86.exe"
|
||||
inetc::get /RESUME "Failed to download VS2019 redistributable package. Retry?" "https://aka.ms/vs/16/release/vc_redist.x86.exe" "$TEMP\AlchemyInst\vc_redist_16.x86.exe" /END
|
||||
ExecWait "$TEMP\AlchemyInst\vc_redist_16.x86.exe /install /passive /norestart"
|
||||
|
||||
NSISdl::download "https://aka.ms/highdpimfc2013x86enu" "$TEMP\AlchemyInst\vc_redist_12.x86.exe"
|
||||
inetc::get /RESUME "Failed to download VS2013 redistributable package. Retry?" "https://aka.ms/highdpimfc2013x86enu" "$TEMP\AlchemyInst\vc_redist_12.x86.exe" /END
|
||||
ExecWait "$TEMP\AlchemyInst\vc_redist_12.x86.exe /install /passive /norestart"
|
||||
!endif
|
||||
|
||||
|
||||
@@ -299,6 +299,7 @@ void JCFloaterAreaSearch::processObjectPropertiesFamily(LLMessageSystem* msg, vo
|
||||
// We cache unknown objects (to avoid having to request them later)
|
||||
// and requested objects.
|
||||
msg->getUUIDFast(_PREHASH_ObjectData, _PREHASH_OwnerID, data->owner_id);
|
||||
if (auto obj = gObjectList.findObject(object_id)) obj->mOwnerID = data->owner_id; // Singu Note: Try to get Owner whenever possible
|
||||
msg->getUUIDFast(_PREHASH_ObjectData, _PREHASH_GroupID, data->group_id);
|
||||
msg->getStringFast(_PREHASH_ObjectData, _PREHASH_Name, data->name);
|
||||
msg->getStringFast(_PREHASH_ObjectData, _PREHASH_Description, data->desc);
|
||||
|
||||
@@ -31,6 +31,7 @@
|
||||
#include "pipeline.h"
|
||||
|
||||
#include "llagentaccess.h"
|
||||
#include "llagentbenefits.h"
|
||||
#include "llagentcamera.h"
|
||||
#include "llagentwearables.h"
|
||||
#include "llagentui.h"
|
||||
@@ -106,7 +107,7 @@
|
||||
|
||||
#include "lluictrlfactory.h" //For LLUICtrlFactory::getLayeredXMLNode
|
||||
|
||||
#include "floaterao.h" // for Typing override
|
||||
#include "aosystem.h" // for Typing override
|
||||
#include "hippolimits.h" // for getMaxAgentGroups
|
||||
// [RLVa:KB] - Checked: 2011-11-04 (RLVa-1.4.4a)
|
||||
#include "rlvactions.h"
|
||||
@@ -1782,9 +1783,10 @@ void LLAgent::autoPilot(F32 *delta_yaw)
|
||||
if (auto object = gObjectList.findObject(mLeaderID))
|
||||
{
|
||||
mAutoPilotTargetGlobal = object->getPositionGlobal();
|
||||
if (const auto& av = object->asAvatar()) // Fly if avatar target is flying
|
||||
if (const auto& av = object->asAvatar()) // Fly/sit if avatar target is flying
|
||||
{
|
||||
setFlying(av->mInAir);
|
||||
const auto& our_pos_global = getPositionGlobal();
|
||||
setFlying(av->mInAir && (getFlying() || mAutoPilotTargetGlobal[VZ] > our_pos_global[VZ])); // If they're in air, fly if they're higher or we were already (follow) flying
|
||||
if (av->isSitting() && (!rlv_handler_t::isEnabled() || !gRlvHandler.hasBehaviour(RLV_BHVR_SIT)))
|
||||
{
|
||||
if (auto seat = av->getParent())
|
||||
@@ -1804,7 +1806,7 @@ void LLAgent::autoPilot(F32 *delta_yaw)
|
||||
}
|
||||
else // Ground sit, but only if near enough
|
||||
{
|
||||
if (dist_vec(av->getPositionAgent(), getPositionAgent()) <= mAutoPilotStopDistance) // We're close enough, sit.
|
||||
if (dist_vec(mAutoPilotTargetGlobal, our_pos_global) <= mAutoPilotStopDistance) // We're close enough, sit.
|
||||
{
|
||||
if (!gAgentAvatarp->isSittingAvatarOnGround())
|
||||
setControlFlags(AGENT_CONTROL_SIT_ON_GROUND);
|
||||
@@ -1822,7 +1824,7 @@ void LLAgent::autoPilot(F32 *delta_yaw)
|
||||
}
|
||||
else
|
||||
{
|
||||
if (dist_vec(av->getPositionAgent(), getPositionAgent()) <= mAutoPilotStopDistance)
|
||||
if (dist_vec(mAutoPilotTargetGlobal, our_pos_global) <= mAutoPilotStopDistance)
|
||||
{
|
||||
follow = 3; // We're close enough, indicate no walking
|
||||
}
|
||||
@@ -2115,7 +2117,7 @@ void LLAgent::startTyping()
|
||||
}
|
||||
}
|
||||
|
||||
LLFloaterAO::typing(true); // Singu Note: Typing anims handled by AO/settings.
|
||||
AOSystem::typing(true); // Singu Note: Typing anims handled by AO/settings.
|
||||
gChatBar->
|
||||
sendChatFromViewer("", CHAT_TYPE_START, FALSE);
|
||||
}
|
||||
@@ -2128,7 +2130,7 @@ void LLAgent::stopTyping()
|
||||
if (mRenderState & AGENT_STATE_TYPING)
|
||||
{
|
||||
clearRenderState(AGENT_STATE_TYPING);
|
||||
LLFloaterAO::typing(false); // Singu Note: Typing anims handled by AO/settings.
|
||||
AOSystem::typing(false); // Singu Note: Typing anims handled by AO/settings.
|
||||
gChatBar->
|
||||
sendChatFromViewer("", CHAT_TYPE_STOP, FALSE);
|
||||
}
|
||||
@@ -3159,7 +3161,7 @@ BOOL LLAgent::setUserGroupFlags(const LLUUID& group_id, BOOL accept_notices, BOO
|
||||
|
||||
BOOL LLAgent::canJoinGroups() const
|
||||
{
|
||||
return (S32)mGroups.size() < gHippoLimits->getMaxAgentGroups();
|
||||
return (S32)mGroups.size() < LLAgentBenefitsMgr::current().getGroupMembershipLimit();
|
||||
}
|
||||
|
||||
LLQuaternion LLAgent::getHeadRotation()
|
||||
|
||||
260
indra/newview/llagentbenefits.cpp
Normal file
260
indra/newview/llagentbenefits.cpp
Normal file
@@ -0,0 +1,260 @@
|
||||
/**
|
||||
* @file llagentbenefits.cpp
|
||||
*
|
||||
* $LicenseInfo:firstyear=2019&license=viewerlgpl$
|
||||
* Second Life Viewer Source Code
|
||||
* Copyright (C) 2019, 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 "llagentbenefits.h"
|
||||
|
||||
LLAgentBenefits::LLAgentBenefits():
|
||||
m_initalized(false),
|
||||
m_animated_object_limit(-1),
|
||||
m_animation_upload_cost(-1),
|
||||
m_attachment_limit(-1),
|
||||
m_group_membership_limit(-1),
|
||||
m_picks_limit(-1),
|
||||
m_sound_upload_cost(-1),
|
||||
m_texture_upload_cost(-1)
|
||||
{
|
||||
}
|
||||
|
||||
LLAgentBenefits::~LLAgentBenefits()
|
||||
{
|
||||
}
|
||||
|
||||
// This could be extended to a template scheme or otherwise modified
|
||||
// to support other types, if and when needed. Currently all fields
|
||||
// the viewer cares about are integer.
|
||||
bool get_required_S32(const LLSD& sd, const LLSD::String& key, S32& value)
|
||||
{
|
||||
value = -1;
|
||||
if (sd.has(key))
|
||||
{
|
||||
value = sd[key].asInteger();
|
||||
return true;
|
||||
}
|
||||
|
||||
LL_WARNS("Benefits") << "Missing required benefit field " << key << LL_ENDL;
|
||||
return false;
|
||||
}
|
||||
|
||||
bool LLAgentBenefits::init(const LLSD& benefits_sd)
|
||||
{
|
||||
LL_DEBUGS("Benefits") << "initializing benefits from " << benefits_sd << LL_ENDL;
|
||||
|
||||
if (!get_required_S32(benefits_sd, "animated_object_limit", m_animated_object_limit))
|
||||
{
|
||||
return false;
|
||||
}
|
||||
if (!get_required_S32(benefits_sd, "animation_upload_cost", m_animation_upload_cost))
|
||||
{
|
||||
return false;
|
||||
}
|
||||
if (!get_required_S32(benefits_sd, "attachment_limit", m_attachment_limit))
|
||||
{
|
||||
return false;
|
||||
}
|
||||
if (!get_required_S32(benefits_sd, "create_group_cost", m_create_group_cost))
|
||||
{
|
||||
return false;
|
||||
}
|
||||
if (!get_required_S32(benefits_sd, "group_membership_limit", m_group_membership_limit))
|
||||
{
|
||||
return false;
|
||||
}
|
||||
if (!get_required_S32(benefits_sd, "picks_limit", m_picks_limit))
|
||||
{
|
||||
return false;
|
||||
}
|
||||
if (!get_required_S32(benefits_sd, "sound_upload_cost", m_sound_upload_cost))
|
||||
{
|
||||
return false;
|
||||
}
|
||||
if (!get_required_S32(benefits_sd, "texture_upload_cost", m_texture_upload_cost))
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
// FIXME PREMIUM - either use this field or get rid of it
|
||||
m_initalized = true;
|
||||
return true;
|
||||
}
|
||||
|
||||
void LLAgentBenefits::initNonSL(const LLSD& benefits_sd)
|
||||
{
|
||||
if (!get_required_S32(benefits_sd, "max_groups", m_group_membership_limit)
|
||||
&& !get_required_S32(benefits_sd, "max-agent-groups", m_group_membership_limit))
|
||||
m_group_membership_limit = S32_MAX;
|
||||
m_picks_limit = m_animated_object_limit = m_attachment_limit = S32_MAX;
|
||||
m_texture_upload_cost = m_sound_upload_cost = m_create_group_cost = m_animation_upload_cost = 0;
|
||||
}
|
||||
|
||||
void LLAgentBenefits::processEconomyData(LLMessageSystem* msg)
|
||||
{
|
||||
msg->getS32Fast(_PREHASH_Info, _PREHASH_PriceUpload, m_texture_upload_cost);
|
||||
m_sound_upload_cost = m_animation_upload_cost = m_texture_upload_cost;
|
||||
msg->getS32Fast(_PREHASH_Info, _PREHASH_PriceGroupCreate, m_create_group_cost);
|
||||
|
||||
LL_INFOS_ONCE("Messaging") << "EconomyData message arrived; upload cost is L$" << m_texture_upload_cost << " group cost is " << m_create_group_cost << LL_ENDL;
|
||||
}
|
||||
|
||||
S32 LLAgentBenefits::getAnimatedObjectLimit() const
|
||||
{
|
||||
return m_animated_object_limit;
|
||||
}
|
||||
|
||||
S32 LLAgentBenefits::getAnimationUploadCost() const
|
||||
{
|
||||
return m_animation_upload_cost;
|
||||
}
|
||||
|
||||
S32 LLAgentBenefits::getAttachmentLimit() const
|
||||
{
|
||||
return m_attachment_limit;
|
||||
}
|
||||
|
||||
S32 LLAgentBenefits::getCreateGroupCost() const
|
||||
{
|
||||
return m_create_group_cost;
|
||||
}
|
||||
|
||||
S32 LLAgentBenefits::getGroupMembershipLimit() const
|
||||
{
|
||||
return m_group_membership_limit;
|
||||
}
|
||||
|
||||
S32 LLAgentBenefits::getPicksLimit() const
|
||||
{
|
||||
return m_picks_limit;
|
||||
}
|
||||
|
||||
S32 LLAgentBenefits::getSoundUploadCost() const
|
||||
{
|
||||
return m_sound_upload_cost;
|
||||
}
|
||||
|
||||
S32 LLAgentBenefits::getTextureUploadCost() const
|
||||
{
|
||||
return m_texture_upload_cost;
|
||||
}
|
||||
|
||||
bool LLAgentBenefits::findUploadCost(LLAssetType::EType& asset_type, S32& cost) const
|
||||
{
|
||||
bool succ = false;
|
||||
if (asset_type == LLAssetType::AT_TEXTURE)
|
||||
{
|
||||
cost = getTextureUploadCost();
|
||||
succ = true;
|
||||
}
|
||||
else if (asset_type == LLAssetType::AT_SOUND)
|
||||
{
|
||||
cost = getSoundUploadCost();
|
||||
succ = true;
|
||||
}
|
||||
else if (asset_type == LLAssetType::AT_ANIMATION)
|
||||
{
|
||||
cost = getAnimationUploadCost();
|
||||
succ = true;
|
||||
}
|
||||
return succ;
|
||||
}
|
||||
|
||||
LLAgentBenefitsMgr::LLAgentBenefitsMgr()
|
||||
{
|
||||
}
|
||||
|
||||
LLAgentBenefitsMgr::~LLAgentBenefitsMgr()
|
||||
{
|
||||
}
|
||||
|
||||
// static
|
||||
LLAgentBenefits& LLAgentBenefitsMgr::current()
|
||||
{
|
||||
return instance().mCurrent;
|
||||
}
|
||||
|
||||
// static
|
||||
const LLAgentBenefits& LLAgentBenefitsMgr::get(const std::string& package)
|
||||
{
|
||||
if (instance().mPackageMap.find(package) != instance().mPackageMap.end())
|
||||
{
|
||||
return instance().mPackageMap[package];
|
||||
}
|
||||
else
|
||||
{
|
||||
return instance().mDefault;
|
||||
}
|
||||
}
|
||||
|
||||
// static
|
||||
bool LLAgentBenefitsMgr::init(const std::string& package, const LLSD& benefits_sd)
|
||||
{
|
||||
LLAgentBenefits benefits;
|
||||
if (!benefits.init(benefits_sd))
|
||||
{
|
||||
LL_WARNS("Benefits") << "Unable to initialize package " << package << " from sd " << benefits_sd << LL_ENDL;
|
||||
return false;
|
||||
}
|
||||
else
|
||||
{
|
||||
instance().mPackageMap[package] = benefits;
|
||||
}
|
||||
return true;
|
||||
|
||||
}
|
||||
|
||||
// static
|
||||
bool LLAgentBenefitsMgr::initCurrent(const std::string& package, const LLSD& benefits_sd)
|
||||
{
|
||||
LLAgentBenefits benefits;
|
||||
if (!benefits.init(benefits_sd))
|
||||
{
|
||||
LL_WARNS("Benefits") << "Unable to initialize package " << package << " from sd " << benefits_sd << LL_ENDL;
|
||||
return false;
|
||||
}
|
||||
else
|
||||
{
|
||||
instance().mCurrent = benefits;
|
||||
instance().mCurrentName = package;
|
||||
}
|
||||
return true;
|
||||
|
||||
}
|
||||
|
||||
void LLAgentBenefitsMgr::initNonSL(const LLSD& benefits_sd)
|
||||
{
|
||||
mCurrent.initNonSL(benefits_sd);
|
||||
mCurrentName = "NonSL";
|
||||
}
|
||||
|
||||
// static
|
||||
bool LLAgentBenefitsMgr::has(const std::string& package)
|
||||
{
|
||||
return instance().mPackageMap.find(package) != instance().mPackageMap.end();
|
||||
}
|
||||
|
||||
//static
|
||||
bool LLAgentBenefitsMgr::isCurrent(const std::string& package)
|
||||
{
|
||||
return instance().mCurrentName == package;
|
||||
}
|
||||
92
indra/newview/llagentbenefits.h
Normal file
92
indra/newview/llagentbenefits.h
Normal file
@@ -0,0 +1,92 @@
|
||||
/**
|
||||
* @file llagentbenefits.h
|
||||
*
|
||||
* $LicenseInfo:firstyear=2019&license=viewerlgpl$
|
||||
* Second Life Viewer Source Code
|
||||
* Copyright (C) 2019, Linden Research, Inc.
|
||||
*
|
||||
* This library is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU Lesser General Public
|
||||
* License as published by the Free Software Foundation;
|
||||
* version 2.1 of the License only.
|
||||
*
|
||||
* This library is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
* Lesser General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Lesser General Public
|
||||
* License along with this library; if not, write to the Free Software
|
||||
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
*
|
||||
* Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA
|
||||
* $/LicenseInfo$
|
||||
*/
|
||||
|
||||
#ifndef LL_AGENTBENEFITS_H
|
||||
#define LL_AGENTBENEFITS_H
|
||||
|
||||
#include "llsingleton.h"
|
||||
#include "llsd.h"
|
||||
#include "llassettype.h"
|
||||
|
||||
class LLAgentBenefits
|
||||
{
|
||||
public:
|
||||
LLAgentBenefits();
|
||||
~LLAgentBenefits();
|
||||
LOG_CLASS(LLAgentBenefits);
|
||||
|
||||
bool init(const LLSD& benefits_sd);
|
||||
void initNonSL(const LLSD& benefits_sd);
|
||||
void processEconomyData(LLMessageSystem*);
|
||||
|
||||
S32 getAnimatedObjectLimit() const;
|
||||
S32 getAnimationUploadCost() const;
|
||||
S32 getAttachmentLimit() const;
|
||||
S32 getCreateGroupCost() const;
|
||||
S32 getGroupMembershipLimit() const;
|
||||
S32 getPicksLimit() const;
|
||||
S32 getSoundUploadCost() const;
|
||||
S32 getTextureUploadCost() const;
|
||||
|
||||
bool findUploadCost(LLAssetType::EType& asset_type, S32& cost) const;
|
||||
|
||||
private:
|
||||
S32 m_animated_object_limit;
|
||||
S32 m_animation_upload_cost;
|
||||
S32 m_attachment_limit;
|
||||
S32 m_create_group_cost;
|
||||
S32 m_group_membership_limit;
|
||||
S32 m_picks_limit;
|
||||
S32 m_sound_upload_cost;
|
||||
S32 m_texture_upload_cost;
|
||||
|
||||
bool m_initalized;
|
||||
};
|
||||
|
||||
class LLAgentBenefitsMgr : public LLSingleton<LLAgentBenefitsMgr>
|
||||
{
|
||||
friend class LLSingleton<LLAgentBenefitsMgr>;
|
||||
LLAgentBenefitsMgr();
|
||||
~LLAgentBenefitsMgr();
|
||||
LOG_CLASS(LLAgentBenefitsMgr);
|
||||
|
||||
public:
|
||||
static LLAgentBenefits& current();
|
||||
static const LLAgentBenefits& get(const std::string& package);
|
||||
static bool init(const std::string& package, const LLSD& benefits_sd);
|
||||
static bool initCurrent(const std::string& package, const LLSD& benefits_sd);
|
||||
void initNonSL(const LLSD& benefits_sd);
|
||||
static bool has(const std::string& package);
|
||||
static bool isCurrent(const std::string& package);
|
||||
|
||||
private:
|
||||
std::string mCurrentName;
|
||||
LLAgentBenefits mCurrent;
|
||||
LLAgentBenefits mDefault;
|
||||
std::map<std::string, LLAgentBenefits> mPackageMap;
|
||||
};
|
||||
|
||||
|
||||
#endif
|
||||
@@ -29,6 +29,7 @@
|
||||
|
||||
#include "pipeline.h"
|
||||
|
||||
#include "aosystem.h" //For AOSystem
|
||||
#include "llagent.h"
|
||||
#include "llanimationstates.h"
|
||||
#include "llfloatercamera.h"
|
||||
@@ -49,7 +50,6 @@
|
||||
#include "llwindow.h"
|
||||
#include "llworld.h"
|
||||
#include "llfloatertools.h" //For gFloaterTools
|
||||
#include "floaterao.h" //For LLFloaterAO
|
||||
#include "llfloatercustomize.h" //For gFloaterCustomize
|
||||
// [RLVa:KB] - Checked: 2010-05-10 (RLVa-1.2.0g)
|
||||
#include "rlvhandler.h"
|
||||
@@ -2265,7 +2265,8 @@ void LLAgentCamera::changeCameraToMouselook(BOOL animate)
|
||||
mMouselookTimer.reset();
|
||||
|
||||
gFocusMgr.setKeyboardFocus(NULL);
|
||||
if (gSavedSettings.getBOOL("AONoStandsInMouselook")) LLFloaterAO::stopMotion(LLFloaterAO::getCurrentStandId(), true);
|
||||
auto ao = AOSystem::getIfExists();
|
||||
if (ao && gSavedSettings.getBOOL("AONoStandsInMouselook")) ao->stopCurrentStand();
|
||||
|
||||
updateLastCamera();
|
||||
mCameraMode = CAMERA_MODE_MOUSELOOK;
|
||||
|
||||
@@ -40,11 +40,21 @@
|
||||
/// Classes for AISv3 support.
|
||||
///----------------------------------------------------------------------------
|
||||
|
||||
extern AIHTTPTimeoutPolicy AISAPIResponder_timeout;
|
||||
|
||||
class AISCommand final : public LLHTTPClient::ResponderWithCompleted
|
||||
{
|
||||
public:
|
||||
typedef boost::function<void()> command_func_type;
|
||||
// AISCommand - base class for retry-able HTTP requests using the AISv3 cap.
|
||||
|
||||
// Limit max in flight requests to 2. Server was aggressively throttling otherwise.
|
||||
constexpr static U8 sMaxActiveAISCommands = 4;
|
||||
static U8 sActiveAISCommands;
|
||||
static std::queue< boost::intrusive_ptr< AISCommand > > sPendingAISCommands;
|
||||
|
||||
virtual AIHTTPTimeoutPolicy const& getHTTPTimeoutPolicy(void) const { return AISAPIResponder_timeout; }
|
||||
|
||||
AISCommand(AISAPI::COMMAND_TYPE type, const char* name, const LLUUID& targetId, AISAPI::completion_t callback) :
|
||||
mCommandFunc(NULL),
|
||||
mRetryPolicy(new LLAdaptiveRetryPolicy(1.0, 32.0, 2.0, 10)),
|
||||
@@ -53,10 +63,30 @@ public:
|
||||
mName(name),
|
||||
mType(type)
|
||||
{}
|
||||
|
||||
virtual ~AISCommand()
|
||||
{
|
||||
if (mActive)
|
||||
{
|
||||
--sActiveAISCommands;
|
||||
while (sActiveAISCommands < sMaxActiveAISCommands && !sPendingAISCommands.empty())
|
||||
{
|
||||
sPendingAISCommands.front()->dispatch();
|
||||
sPendingAISCommands.pop();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void run( command_func_type func )
|
||||
{
|
||||
(mCommandFunc = func)();
|
||||
mCommandFunc = func;
|
||||
if (sActiveAISCommands >= sMaxActiveAISCommands)
|
||||
{
|
||||
sPendingAISCommands.push(this);
|
||||
}
|
||||
else
|
||||
{
|
||||
dispatch();
|
||||
}
|
||||
}
|
||||
|
||||
char const* getName(void) const override
|
||||
@@ -64,6 +94,17 @@ public:
|
||||
return mName;
|
||||
}
|
||||
|
||||
private:
|
||||
void dispatch()
|
||||
{
|
||||
if (LLApp::isQuitting())
|
||||
{
|
||||
return;
|
||||
}
|
||||
++sActiveAISCommands;
|
||||
mActive = true;
|
||||
(mCommandFunc)();
|
||||
}
|
||||
void markComplete()
|
||||
{
|
||||
// Command func holds a reference to self, need to release it
|
||||
@@ -72,42 +113,56 @@ public:
|
||||
mRetryPolicy->onSuccess();
|
||||
}
|
||||
|
||||
void malformedResponse() { mStatus = HTTP_INTERNAL_ERROR_OTHER; mReason = llformat("Malformed response contents (original code: %d)", mStatus); }
|
||||
|
||||
bool onFailure()
|
||||
{
|
||||
bool retry = mStatus != HTTP_INTERNAL_ERROR_OTHER && mStatus != 410; // We handle these and stop
|
||||
LL_WARNS("Inventory") << "Inventory error: " << dumpResponse() << LL_ENDL;
|
||||
if (retry) mRetryPolicy->onFailure(mStatus, getResponseHeaders());
|
||||
mRetryPolicy->onFailure(mStatus, getResponseHeaders());
|
||||
F32 seconds_to_wait;
|
||||
if (retry && mRetryPolicy->shouldRetry(seconds_to_wait))
|
||||
if (mRetryPolicy->shouldRetry(seconds_to_wait))
|
||||
{
|
||||
if (mStatus == 503)
|
||||
{
|
||||
// Pad delay a bit more since we're getting throttled.
|
||||
seconds_to_wait += 10.f + ll_frand(4.f);
|
||||
}
|
||||
LL_WARNS("Inventory") << "Retrying in " << seconds_to_wait << "seconds due to inventory error for " << getName() <<": " << dumpResponse() << LL_ENDL;
|
||||
doAfterInterval(mCommandFunc,seconds_to_wait);
|
||||
return true;
|
||||
}
|
||||
else
|
||||
{
|
||||
// Command func holds a reference to self, need to release it
|
||||
// after a success or final failure.
|
||||
// *TODO: Notify user? This seems bad.
|
||||
LL_WARNS("Inventory") << "Abort due to inventory error for " << getName() <<": " << dumpResponse() << LL_ENDL;
|
||||
mCommandFunc = no_op;
|
||||
return false;
|
||||
}
|
||||
return retry;
|
||||
}
|
||||
|
||||
protected:
|
||||
void httpCompleted() override
|
||||
{
|
||||
AISAPI::InvokeAISCommandCoro(this, getURL(), mTargetId, getContent(), mCompletionFunc, (AISAPI::COMMAND_TYPE)mType);
|
||||
// Continue through if successful or longer retrying,
|
||||
if (isGoodStatus(mStatus) || !onFailure())
|
||||
{
|
||||
markComplete();
|
||||
AISAPI::InvokeAISCommandCoro(this, getURL(), mTargetId, getContent(), mCompletionFunc, (AISAPI::COMMAND_TYPE)mType);
|
||||
}
|
||||
}
|
||||
|
||||
private:
|
||||
command_func_type mCommandFunc;
|
||||
LLPointer<LLHTTPRetryPolicy> mRetryPolicy;
|
||||
AISAPI::completion_t mCompletionFunc;
|
||||
const LLUUID mTargetId;
|
||||
const char* mName;
|
||||
bool mActive = false;
|
||||
AISAPI::COMMAND_TYPE mType;
|
||||
};
|
||||
|
||||
U8 AISCommand::sActiveAISCommands = 0;
|
||||
std::queue< boost::intrusive_ptr< AISCommand > > AISCommand::sPendingAISCommands;
|
||||
|
||||
//=========================================================================
|
||||
const std::string AISAPI::INVENTORY_CAP_NAME("InventoryAPIv3");
|
||||
const std::string AISAPI::LIBRARY_CAP_NAME("LibraryAPIv3");
|
||||
@@ -312,21 +367,18 @@ void AISAPI::UpdateItem(const LLUUID &itemId, const LLSD &updates, completion_t
|
||||
boost::intrusive_ptr< AISCommand > responder = new AISCommand(UPDATEITEM, "UpdateItem",itemId, callback);
|
||||
responder->run(boost::bind(&LLHTTPClient::patch, url, updates, responder/*,*/ DEBUG_CURLIO_PARAM(debug_off), keep_alive, (AIStateMachine*)NULL, 0));
|
||||
}
|
||||
void AISAPI::InvokeAISCommandCoro(AISCommand* responder,
|
||||
void AISAPI::InvokeAISCommandCoro(LLHTTPClient::ResponderWithCompleted* responder,
|
||||
std::string url,
|
||||
LLUUID targetId, LLSD result, completion_t callback, COMMAND_TYPE type)
|
||||
{
|
||||
LL_DEBUGS("Inventory") << "url: " << url << LL_ENDL;
|
||||
|
||||
auto status = responder->getStatus();
|
||||
auto status = responder->getStatus();
|
||||
|
||||
if (!responder->isGoodStatus(status) || !result.isMap())
|
||||
{
|
||||
if (!result.isMap())
|
||||
{
|
||||
responder->malformedResponse();
|
||||
}
|
||||
else if (status == 410) //GONE
|
||||
{
|
||||
LL_WARNS("Inventory") << "Inventory error: " << status << ": " << responder->getReason() << LL_ENDL;
|
||||
if (status == 410) //GONE
|
||||
{
|
||||
// Item does not exist or was already deleted from server.
|
||||
// parent folder is out of sync
|
||||
@@ -360,11 +412,12 @@ void AISAPI::InvokeAISCommandCoro(AISCommand* responder,
|
||||
}
|
||||
}
|
||||
}
|
||||
// Keep these statuses accounted for in the responder too
|
||||
if (responder->onFailure()) // If we're retrying, exit early.
|
||||
return;
|
||||
if (!result.isMap())
|
||||
{
|
||||
LL_WARNS("Inventory") << "Inventory error: Malformed response contents" << LL_ENDL;
|
||||
}
|
||||
LL_WARNS("Inventory") << ll_pretty_print_sd(result) << LL_ENDL;
|
||||
}
|
||||
else responder->markComplete();
|
||||
|
||||
gInventory.onAISUpdateReceived("AISCommand", result);
|
||||
|
||||
|
||||
@@ -72,7 +72,7 @@ private:
|
||||
static std::string getInvCap();
|
||||
static std::string getLibCap();
|
||||
|
||||
static void InvokeAISCommandCoro(class AISCommand* responder,
|
||||
static void InvokeAISCommandCoro(LLHTTPClient::ResponderWithCompleted* responder,
|
||||
std::string url, LLUUID targetId, LLSD body,
|
||||
completion_t callback, COMMAND_TYPE type);
|
||||
};
|
||||
|
||||
@@ -159,6 +159,7 @@
|
||||
|
||||
// Included so that constants/settings might be initialized
|
||||
// in save_settings_to_globals()
|
||||
#include "aosystem.h"
|
||||
#include "llbutton.h"
|
||||
#include "llcombobox.h"
|
||||
#include "floaterlocalassetbrowse.h"
|
||||
@@ -220,13 +221,49 @@
|
||||
#include <client/crashpad_client.h>
|
||||
#include <client/prune_crash_reports.h>
|
||||
#include <client/settings.h>
|
||||
#include <client/annotation.h>
|
||||
|
||||
#include <fmt/format.h>
|
||||
|
||||
#include "llnotificationsutil.h"
|
||||
#include "llversioninfo.h"
|
||||
|
||||
|
||||
template <size_t SIZE, crashpad::Annotation::Type T = crashpad::Annotation::Type::kString>
|
||||
struct crashpad_annotation : public crashpad::Annotation {
|
||||
std::array<char, SIZE> buffer;
|
||||
crashpad_annotation(const char* name) : crashpad::Annotation(T, name, buffer.data())
|
||||
{}
|
||||
void set(const std::string& src) {
|
||||
//LL_INFOS() << name() << ": " << src.c_str() << LL_ENDL;
|
||||
const size_t min_size = llmin(SIZE, src.size());
|
||||
memcpy(buffer.data(), src.data(), min_size);
|
||||
buffer.data()[SIZE - 1] = '\0';
|
||||
SetSize(min_size);
|
||||
}
|
||||
};
|
||||
#define DEFINE_CRASHPAD_ANNOTATION(name, len) \
|
||||
static crashpad_annotation<len> g_crashpad_annotation_##name##_buffer("sentry[tags]["#name"]");
|
||||
#define DEFINE_CRASHPAD_ANNOTATION_EXTRA(name, len) \
|
||||
static crashpad_annotation<len> g_crashpad_annotation_##name##_buffer("sentry[extra]["#name"]");
|
||||
#define SET_CRASHPAD_ANNOTATION_VALUE(name, value) \
|
||||
g_crashpad_annotation_##name##_buffer.set(value);
|
||||
#else
|
||||
#define SET_CRASHPAD_ANNOTATION_VALUE(name, value)
|
||||
#define DEFINE_CRASHPAD_ANNOTATION_EXTRA(name, len)
|
||||
#define DEFINE_CRASHPAD_ANNOTATION(name, len)
|
||||
#endif
|
||||
|
||||
DEFINE_CRASHPAD_ANNOTATION_EXTRA(fatal_message, 512);
|
||||
DEFINE_CRASHPAD_ANNOTATION(grid_name, 64);
|
||||
DEFINE_CRASHPAD_ANNOTATION(region_name, 64);
|
||||
DEFINE_CRASHPAD_ANNOTATION_EXTRA(cpu_string, 128);
|
||||
DEFINE_CRASHPAD_ANNOTATION_EXTRA(gpu_string, 128);
|
||||
DEFINE_CRASHPAD_ANNOTATION_EXTRA(gl_version, 128);
|
||||
DEFINE_CRASHPAD_ANNOTATION_EXTRA(session_duration, 32);
|
||||
DEFINE_CRASHPAD_ANNOTATION_EXTRA(startup_state, 32);
|
||||
DEFINE_CRASHPAD_ANNOTATION_EXTRA(memory_sys, 32);
|
||||
DEFINE_CRASHPAD_ANNOTATION_EXTRA(memory_alloc, 32);
|
||||
|
||||
////// Windows-specific includes to the bottom - nasty defines in these pollute the preprocessor
|
||||
//
|
||||
@@ -770,8 +807,18 @@ bool LLAppViewer::init()
|
||||
initCrashReporting();
|
||||
#endif
|
||||
|
||||
writeDebugInfo();
|
||||
|
||||
setupErrorHandling();
|
||||
|
||||
{
|
||||
auto fn = boost::bind<bool>([](const LLSD& stateInfo) -> bool {
|
||||
SET_CRASHPAD_ANNOTATION_VALUE(startup_state, stateInfo["str"].asString());
|
||||
return false;
|
||||
}, _1);
|
||||
LLStartUp::getStateEventPump().listen<::LLEventListener>("LLAppViewer", fn);
|
||||
}
|
||||
|
||||
//
|
||||
// Start of the application
|
||||
//
|
||||
@@ -1038,6 +1085,8 @@ bool LLAppViewer::init()
|
||||
gGLManager.getGLInfo(gDebugInfo);
|
||||
gGLManager.printGLInfoString();
|
||||
|
||||
writeDebugInfo();
|
||||
|
||||
// Load Default bindings
|
||||
load_default_bindings(gSavedSettings.getBOOL("LiruUseZQSDKeys"));
|
||||
|
||||
@@ -1125,6 +1174,8 @@ bool LLAppViewer::init()
|
||||
// save the graphics card
|
||||
gDebugInfo["GraphicsCard"] = LLFeatureManager::getInstance()->getGPUString();
|
||||
|
||||
writeDebugInfo();
|
||||
|
||||
// Save the current version to the prefs file
|
||||
gSavedSettings.setString("LastRunVersion",
|
||||
LLVersionInfo::getChannelAndVersion());
|
||||
@@ -1142,6 +1193,8 @@ bool LLAppViewer::init()
|
||||
gGLActive = FALSE;
|
||||
LLViewerMedia::initClass();
|
||||
LL_INFOS("InitInfo") << "Viewer media initialized." << LL_ENDL ;
|
||||
|
||||
writeDebugInfo();
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -1293,6 +1346,12 @@ bool LLAppViewer::mainLoop()
|
||||
//clear call stack records
|
||||
LL_CLEAR_CALLSTACKS();
|
||||
|
||||
#ifdef USE_CRASHPAD
|
||||
// Not event based. Update per frame
|
||||
SET_CRASHPAD_ANNOTATION_VALUE(session_duration, std::to_string(LLFrameTimer::getElapsedSeconds()));
|
||||
SET_CRASHPAD_ANNOTATION_VALUE(memory_alloc, std::to_string((LLMemory::getCurrentRSS() >> 10)/1000.f));
|
||||
#endif
|
||||
|
||||
//check memory availability information
|
||||
checkMemory() ;
|
||||
|
||||
@@ -1659,6 +1718,8 @@ bool LLAppViewer::cleanup()
|
||||
|
||||
LLCalc::cleanUp();
|
||||
|
||||
AOSystem::deleteSingleton();
|
||||
|
||||
LL_INFOS() << "Global stuff deleted" << LL_ENDL;
|
||||
|
||||
// Note: this is where LLFeatureManager::getInstance()-> used to be deleted.
|
||||
@@ -2741,6 +2802,16 @@ void LLAppViewer::writeDebugInfo(bool isStatic)
|
||||
|
||||
isStatic ? LLSDSerialize::toPrettyXML(gDebugInfo, out_file)
|
||||
: LLSDSerialize::toPrettyXML(gDebugInfo["Dynamic"], out_file);
|
||||
#else
|
||||
SET_CRASHPAD_ANNOTATION_VALUE(fatal_message, gDebugInfo["FatalMessage"].asString());
|
||||
SET_CRASHPAD_ANNOTATION_VALUE(grid_name, gDebugInfo["GridName"].asString());
|
||||
SET_CRASHPAD_ANNOTATION_VALUE(region_name, gDebugInfo["CurrentRegion"].asString());
|
||||
SET_CRASHPAD_ANNOTATION_VALUE(cpu_string, gDebugInfo["CPUInfo"]["CPUString"].asString());
|
||||
SET_CRASHPAD_ANNOTATION_VALUE(gpu_string, gDebugInfo["GraphicsCard"].asString());
|
||||
SET_CRASHPAD_ANNOTATION_VALUE(gl_version, gDebugInfo["GLInfo"]["GLVersion"].asString());
|
||||
SET_CRASHPAD_ANNOTATION_VALUE(session_duration, std::to_string(LLFrameTimer::getElapsedSeconds()));
|
||||
SET_CRASHPAD_ANNOTATION_VALUE(memory_alloc, std::to_string((LLMemory::getCurrentRSS() >> 10) / 1000.f));
|
||||
SET_CRASHPAD_ANNOTATION_VALUE(memory_sys, std::to_string(gDebugInfo["RAMInfo"]["Physical"].asInteger() * 0.001f));
|
||||
#endif
|
||||
}
|
||||
|
||||
@@ -2925,8 +2996,8 @@ void LLAppViewer::handleViewerCrash()
|
||||
gDebugInfo["ViewerExePath"] = gDirUtilp->getExecutablePathAndName();
|
||||
gDebugInfo["CurrentPath"] = gDirUtilp->getCurPath();
|
||||
gDebugInfo["Dynamic"]["SessionLength"] = F32(LLFrameTimer::getElapsedSeconds());
|
||||
gDebugInfo["StartupState"] = LLStartUp::getStartupStateString();
|
||||
gDebugInfo["Dynamic"]["RAMInfo"]["Allocated"] = (LLSD::Integer) LLMemory::getCurrentRSS() >> 10;
|
||||
gDebugInfo["StartupState"] = LLStartUp::getStartupStateString();
|
||||
gDebugInfo["FirstLogin"] = (LLSD::Boolean) gAgent.isFirstLogin();
|
||||
gDebugInfo["FirstRunThisInstall"] = gSavedSettings.getBOOL("FirstRunThisInstall");
|
||||
|
||||
@@ -4788,11 +4859,14 @@ void LLAppViewer::disconnectViewer()
|
||||
// floater_sound_preview.xml
|
||||
// floater_animation_preview.xml
|
||||
// files.
|
||||
|
||||
// A more generic mechanism would be nice..
|
||||
LLFloater* fl = static_cast<LLFloater*>(*it);
|
||||
if (fl
|
||||
&& (fl->getName() == "Image Preview"
|
||||
|| fl->getName() == "Sound Preview"
|
||||
|| fl->getName() == "Animation Preview"
|
||||
|| fl->getName() == "perm prefs"
|
||||
))
|
||||
{
|
||||
floaters_to_close.push_back(fl);
|
||||
|
||||
@@ -35,6 +35,7 @@
|
||||
|
||||
// viewer includes
|
||||
#include "llagent.h"
|
||||
#include "llagentbenefits.h"
|
||||
#include "llcompilequeue.h"
|
||||
#include "llfloaterbuycurrency.h"
|
||||
#include "statemachine/aifilepicker.h"
|
||||
@@ -59,7 +60,6 @@
|
||||
|
||||
// library includes
|
||||
#include "lldir.h"
|
||||
#include "lleconomy.h"
|
||||
#include "llfocusmgr.h"
|
||||
#include "llnotificationsutil.h"
|
||||
#include "llscrolllistctrl.h"
|
||||
@@ -326,7 +326,11 @@ void LLAssetUploadResponder::uploadFailure(const LLSD& content)
|
||||
// deal with L$ errors
|
||||
if (reason == "insufficient funds")
|
||||
{
|
||||
S32 price = LLGlobalEconomy::Singleton::getInstance()->getPriceUpload();
|
||||
S32 price;
|
||||
if (content.has("upload_price"))
|
||||
price = content["upload_price"];
|
||||
else
|
||||
LLAgentBenefitsMgr::current().findUploadCost(mAssetType, price);
|
||||
LLFloaterBuyCurrency::buyCurrency("Uploading costs", price);
|
||||
}
|
||||
else
|
||||
@@ -390,13 +394,14 @@ void LLNewAgentInventoryResponder::uploadComplete(const LLSD& content)
|
||||
|
||||
// Update L$ and ownership credit information
|
||||
// since it probably changed on the server
|
||||
if (asset_type == LLAssetType::AT_TEXTURE ||
|
||||
if (content.has("upload_price"))
|
||||
expected_upload_cost = content["upload_price"];
|
||||
else if (asset_type == LLAssetType::AT_TEXTURE ||
|
||||
asset_type == LLAssetType::AT_SOUND ||
|
||||
asset_type == LLAssetType::AT_ANIMATION ||
|
||||
asset_type == LLAssetType::AT_MESH)
|
||||
{
|
||||
expected_upload_cost =
|
||||
LLGlobalEconomy::Singleton::getInstance()->getPriceUpload();
|
||||
LLAgentBenefitsMgr::current().findUploadCost(asset_type, expected_upload_cost);
|
||||
}
|
||||
|
||||
LL_INFOS() << "Adding " << content["new_inventory_item"].asUUID() << " "
|
||||
|
||||
@@ -349,7 +349,10 @@ bool LLAttachmentsMgr::getPendingAttachments(uuid_set_t& ids) const
|
||||
ids.clear();
|
||||
|
||||
// Returns the union of the LL maintained list of attachments that are waiting for link creation and our maintained list of attachments that are pending link creation
|
||||
set_union(mRecentlyArrivedAttachments.begin(), mRecentlyArrivedAttachments.end(), mPendingAttachLinks.begin(), mPendingAttachLinks.end(), std::inserter(ids, ids.begin()));
|
||||
ids.insert(mRecentlyArrivedAttachments.begin(), mRecentlyArrivedAttachments.end());
|
||||
ids.insert(mPendingAttachLinks.begin(), mPendingAttachLinks.end());
|
||||
// Singu Note: "Expression: Sequence not ordered" using std::set_union
|
||||
//set_union(mRecentlyArrivedAttachments.begin(), mRecentlyArrivedAttachments.end(), mPendingAttachLinks.begin(), mPendingAttachLinks.end(), std::inserter(ids, ids.begin()));
|
||||
|
||||
return !ids.empty();
|
||||
}
|
||||
|
||||
@@ -1149,6 +1149,7 @@ LLSpatialPartition* LLDrawable::getSpatialPartition()
|
||||
//must be an active volume
|
||||
if (!mSpatialBridge)
|
||||
{
|
||||
// Spatial bridge ctors self-register...
|
||||
if (mVObjp->isHUDAttachment())
|
||||
{
|
||||
setSpatialBridge(new LLHUDBridge(this, getRegion()));
|
||||
@@ -1595,11 +1596,7 @@ void LLSpatialBridge::cleanupReferences()
|
||||
LLDrawable::cleanupReferences();
|
||||
if (mDrawable)
|
||||
{
|
||||
/*
|
||||
|
||||
DON'T DO THIS -- this should happen through octree destruction
|
||||
|
||||
mDrawable->setSpatialGroup(NULL);
|
||||
mDrawable->setGroup(NULL);
|
||||
if (mDrawable->getVObj())
|
||||
{
|
||||
LLViewerObject::const_child_list_t& child_list = mDrawable->getVObj()->getChildren();
|
||||
@@ -1607,17 +1604,18 @@ void LLSpatialBridge::cleanupReferences()
|
||||
iter != child_list.end(); iter++)
|
||||
{
|
||||
LLViewerObject* child = *iter;
|
||||
LLDrawable* drawable = child->mDrawable;
|
||||
LLDrawable* drawable = child->mDrawable;
|
||||
if (drawable)
|
||||
{
|
||||
drawable->setSpatialGroup(NULL);
|
||||
drawable->setGroup(NULL);
|
||||
}
|
||||
}
|
||||
}*/
|
||||
}
|
||||
|
||||
LLDrawable* drawablep = mDrawable;
|
||||
mDrawable = NULL;
|
||||
drawablep->setSpatialBridge(NULL);
|
||||
LLPointer<LLSpatialBridge> bridgep = mDrawable->getSpatialBridge();
|
||||
mDrawable->setSpatialBridge(nullptr);
|
||||
mDrawable = nullptr;
|
||||
bridgep = nullptr;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -174,7 +174,8 @@ void LLAvatarListEntry::processProperties(void* data, EAvatarProcessorType type)
|
||||
using namespace boost::gregorian;
|
||||
int year, month, day;
|
||||
const auto born = pAvatarData->born_on;
|
||||
if (!born.empty() && sscanf(born.c_str(),"%d/%d/%d",&month,&day,&year) == 3)
|
||||
if (born.empty()) return; // Opensim returns this for NPCs.
|
||||
if (sscanf(born.c_str(),"%d/%d/%d",&month,&day,&year) == 3)
|
||||
try
|
||||
{
|
||||
mAge = (day_clock::local_day() - date(year, month, day)).days();
|
||||
@@ -187,10 +188,14 @@ void LLAvatarListEntry::processProperties(void* data, EAvatarProcessorType type)
|
||||
if (!mStats[STAT_TYPE_AGE] && (U32)mAge < sAvatarAgeAlertDays) //Only announce age once per entry.
|
||||
chat_avatar_status(mName, mID, STAT_TYPE_AGE, mStats[STAT_TYPE_AGE] = true, (mPosition - gAgent.getPositionGlobal()).magVec());
|
||||
}
|
||||
else // Something failed, resend request
|
||||
else // Something failed, resend request but only on NonSL grids
|
||||
{
|
||||
LL_WARNS() << "Failed to extract age from APT_PROPERTIES for " << mID << ", received \"" << born << "\". Requesting properties again." << LL_ENDL;
|
||||
inst.sendAvatarPropertiesRequest(mID);
|
||||
LL_WARNS() << "Failed to extract age from APT_PROPERTIES for " << mID << ", received \"" << born << "\"." << LL_ENDL;
|
||||
if (!gHippoGridManager->getConnectedGrid()->isSecondLife())
|
||||
{
|
||||
LL_WARNS() << "Requesting properties again." << LL_ENDL;
|
||||
inst.sendAvatarPropertiesRequest(mID);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -360,48 +365,50 @@ static void cmd_toggle_mark(LLAvatarListEntry* entry)
|
||||
static void cmd_ar(const LLAvatarListEntry* entry);
|
||||
static void cmd_teleport(const LLAvatarListEntry* entry);
|
||||
|
||||
const LLUUID& active_owner_or_id(const LLSD& userdata);
|
||||
|
||||
namespace
|
||||
{
|
||||
typedef LLMemberListener<LLView> view_listener_t;
|
||||
class RadarTrack : public view_listener_t
|
||||
class RadarTrack final : public view_listener_t
|
||||
{
|
||||
bool handleEvent(LLPointer<LLEvent> event, const LLSD& userdata)
|
||||
bool handleEvent(LLPointer<LLEvent> event, const LLSD& userdata) override
|
||||
{
|
||||
LLFloaterAvatarList::instance().onClickTrack();
|
||||
return true;
|
||||
}
|
||||
};
|
||||
|
||||
class RadarFocus : public view_listener_t
|
||||
class RadarFocus final : public view_listener_t
|
||||
{
|
||||
bool handleEvent(LLPointer<LLEvent> event, const LLSD& userdata)
|
||||
bool handleEvent(LLPointer<LLEvent> event, const LLSD& userdata) override
|
||||
{
|
||||
LLFloaterAvatarList::setFocusAvatar(LFIDBearer::getActiveSelectedID());
|
||||
LLFloaterAvatarList::setFocusAvatar(active_owner_or_id(userdata));
|
||||
return true;
|
||||
}
|
||||
};
|
||||
|
||||
class RadarFocusPrev : public view_listener_t
|
||||
class RadarFocusPrev final : public view_listener_t
|
||||
{
|
||||
bool handleEvent(LLPointer<LLEvent> event, const LLSD& userdata)
|
||||
bool handleEvent(LLPointer<LLEvent> event, const LLSD& userdata) override
|
||||
{
|
||||
LLFloaterAvatarList::instance().focusOnPrev(userdata.asInteger());
|
||||
return true;
|
||||
}
|
||||
};
|
||||
|
||||
class RadarFocusNext : public view_listener_t
|
||||
class RadarFocusNext final : public view_listener_t
|
||||
{
|
||||
bool handleEvent(LLPointer<LLEvent> event, const LLSD& userdata)
|
||||
bool handleEvent(LLPointer<LLEvent> event, const LLSD& userdata) override
|
||||
{
|
||||
LLFloaterAvatarList::instance().focusOnNext(userdata.asInteger());
|
||||
return true;
|
||||
}
|
||||
};
|
||||
|
||||
class RadarAnnounceKeys : public view_listener_t
|
||||
class RadarAnnounceKeys final : public view_listener_t
|
||||
{
|
||||
bool handleEvent(LLPointer<LLEvent> event, const LLSD& userdata)
|
||||
bool handleEvent(LLPointer<LLEvent> event, const LLSD& userdata) override
|
||||
{
|
||||
LLFloaterAvatarList::instance().sendKeys();
|
||||
return true;
|
||||
|
||||
@@ -36,13 +36,13 @@
|
||||
#include "llbvhloader.h"
|
||||
#include "lldatapacker.h"
|
||||
#include "lldir.h"
|
||||
#include "lleconomy.h"
|
||||
#include "llnotificationsutil.h"
|
||||
#include "llvfile.h"
|
||||
#include "llapr.h"
|
||||
#include "llstring.h"
|
||||
|
||||
#include "llagent.h"
|
||||
#include "llagentbenefits.h"
|
||||
#include "llanimationstates.h"
|
||||
#include "llbbox.h"
|
||||
#include "llbutton.h"
|
||||
@@ -229,7 +229,7 @@ BOOL LLFloaterBvhPreview::postBuild()
|
||||
getChild<LLSlider>("priority")->setMaxValue(7);
|
||||
}
|
||||
|
||||
childSetLabelArg("ok_btn", "[UPLOADFEE]", gHippoGridManager->getConnectedGrid()->getUploadFee());
|
||||
childSetLabelArg("ok_btn", "[UPLOADFEE]", gHippoGridManager->getConnectedGrid()->formatFee(LLAgentBenefitsMgr::current().getAnimationUploadCost()));
|
||||
childSetAction("ok_btn", onBtnOK, this);
|
||||
setDefaultBtn();
|
||||
|
||||
@@ -1238,7 +1238,7 @@ void LLFloaterBvhPreview::onBtnOK(void* userdata)
|
||||
std::string name = floaterp->getChild<LLUICtrl>("name_form")->getValue().asString();
|
||||
std::string desc = floaterp->getChild<LLUICtrl>("description_form")->getValue().asString();
|
||||
LLAssetStorage::LLStoreAssetCallback callback = NULL;
|
||||
S32 expected_upload_cost = LLGlobalEconomy::Singleton::getInstance()->getPriceUpload();
|
||||
S32 expected_upload_cost = LLAgentBenefitsMgr::current().getAnimationUploadCost();
|
||||
void *userdata = NULL;
|
||||
|
||||
// <edit>
|
||||
@@ -1268,7 +1268,9 @@ void LLFloaterBvhPreview::onBtnOK(void* userdata)
|
||||
0,
|
||||
LLFolderType::FT_NONE,
|
||||
LLInventoryType::IT_ANIMATION,
|
||||
LLFloaterPerms::getNextOwnerPerms("Uploads"), LLFloaterPerms::getGroupPerms("Uploads"), LLFloaterPerms::getEveryonePerms("Uploads"),
|
||||
LLFloaterPerms::getNextOwnerPerms("Uploads"),
|
||||
LLFloaterPerms::getGroupPerms("Uploads"),
|
||||
LLFloaterPerms::getEveryonePerms("Uploads"),
|
||||
name,
|
||||
callback, expected_upload_cost, userdata);
|
||||
}
|
||||
|
||||
@@ -79,7 +79,7 @@
|
||||
//
|
||||
LLColor4 agent_chat_color(const LLUUID& id, const std::string&, bool local_chat = true);
|
||||
LLColor4 get_text_color(const LLChat& chat, bool from_im = false);
|
||||
void show_log_browser(const std::string&, const std::string&);
|
||||
void show_log_browser(const std::string&, const LLUUID&);
|
||||
|
||||
//
|
||||
// Member Functions
|
||||
@@ -96,7 +96,7 @@ LLFloaterChat::LLFloaterChat(const LLSD& seed)
|
||||
|
||||
LLTextEditor* history_editor_with_mute = getChild<LLTextEditor>("Chat History Editor with mute");
|
||||
getChild<LLUICtrl>("show mutes")->setCommitCallback(boost::bind(&LLFloaterChat::onClickToggleShowMute, this, _2, getChild<LLTextEditor>("Chat History Editor"), history_editor_with_mute));
|
||||
getChild<LLUICtrl>("chat_history_open")->setCommitCallback(boost::bind(show_log_browser, "chat", "chat"));
|
||||
getChild<LLUICtrl>("chat_history_open")->setCommitCallback(boost::bind(show_log_browser, "chat", LLUUID::null));
|
||||
}
|
||||
|
||||
LLFloaterChat::~LLFloaterChat()
|
||||
@@ -243,7 +243,7 @@ void log_chat_text(const LLChat& chat)
|
||||
else
|
||||
histstr = chat.mText;
|
||||
|
||||
LLLogChat::saveHistory(std::string("chat"), histstr);
|
||||
LLLogChat::saveHistory("chat", LLUUID::null, histstr);
|
||||
}
|
||||
// static
|
||||
void LLFloaterChat::addChatHistory(LLChat& chat, bool log_to_file)
|
||||
@@ -287,6 +287,11 @@ void LLFloaterChat::addChatHistory(LLChat& chat, bool log_to_file)
|
||||
return;
|
||||
}
|
||||
}
|
||||
else if (chat.mChatType == CHAT_TYPE_OWNER && gSavedSettings.getBOOL("SinguOwnerSayAsErrors"))
|
||||
{
|
||||
LLFloaterScriptDebug::addScriptLine(chat, color);
|
||||
return;
|
||||
}
|
||||
|
||||
// could flash the chat button in the status bar here. JC
|
||||
LLFloaterChat* chat_floater = LLFloaterChat::getInstance(LLSD());
|
||||
@@ -530,28 +535,19 @@ LLColor4 get_text_color(const LLChat& chat, bool from_im)
|
||||
//static
|
||||
void LLFloaterChat::loadHistory()
|
||||
{
|
||||
LLLogChat::loadHistory("chat", &chatFromLogFile, (void*)LLFloaterChat::getInstance());
|
||||
LLLogChat::loadHistory("chat", LLUUID::null, boost::bind(&LLFloaterChat::chatFromLogFile, getInstance(), _1, _2));
|
||||
}
|
||||
|
||||
//static
|
||||
void LLFloaterChat::chatFromLogFile(LLLogChat::ELogLineType type, std::string line, void* userdata)
|
||||
|
||||
void LLFloaterChat::chatFromLogFile(LLLogChat::ELogLineType type, const std::string& line)
|
||||
{
|
||||
switch (type)
|
||||
bool log_line = type == LLLogChat::LOG_LINE;
|
||||
if (log_line || gSavedPerAccountSettings.getBOOL("LogChat"))
|
||||
{
|
||||
case LLLogChat::LOG_EMPTY:
|
||||
if (gSavedPerAccountSettings.getBOOL("LogChat"))
|
||||
addChatHistory(static_cast<LLFloaterChat*>(userdata)->getString("IM_logging_string"), false);
|
||||
break;
|
||||
case LLLogChat::LOG_END:
|
||||
if (gSavedPerAccountSettings.getBOOL("LogChat"))
|
||||
addChatHistory(static_cast<LLFloaterChat*>(userdata)->getString("IM_end_log_string"), false);
|
||||
break;
|
||||
case LLLogChat::LOG_LINE:
|
||||
addChatHistory(line, FALSE);
|
||||
break;
|
||||
default:
|
||||
// nothing
|
||||
break;
|
||||
LLStyleSP style(new LLStyle(true, gSavedSettings.getColor4("LogChatColor"), LLStringUtil::null));
|
||||
const auto text = log_line ? line : getString(type == LLLogChat::LOG_END ? "IM_end_log_string" : "IM_logging_string");
|
||||
for (const auto& ed_name : { "Chat History Editor", "Chat History Editor with mute" })
|
||||
getChild<LLTextEditor>(ed_name)->appendText(text, false, true, style, false);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -73,7 +73,7 @@ public:
|
||||
static void triggerAlerts(const std::string& text);
|
||||
|
||||
void onClickToggleShowMute(bool show_mute, class LLTextEditor* history_editor, LLTextEditor* history_editor_with_mute);
|
||||
static void chatFromLogFile(LLLogChat::ELogLineType type, std::string line, void* userdata);
|
||||
void chatFromLogFile(LLLogChat::ELogLineType type, const std::string& line);
|
||||
static void loadHistory();
|
||||
static void* createSpeakersPanel(void* data);
|
||||
static void* createChatPanel(void* data);
|
||||
|
||||
@@ -45,6 +45,7 @@
|
||||
|
||||
#include "hbfloatergrouptitles.h"
|
||||
#include "llagent.h"
|
||||
#include "llagentbenefits.h"
|
||||
#include "llbutton.h"
|
||||
#include "llfloatergroupinvite.h"
|
||||
#include "llgroupactions.h"
|
||||
@@ -187,7 +188,7 @@ void LLPanelGroups::setTexts()
|
||||
LLUICtrl* ctrl(getChild<LLUICtrl>("groupcount"));
|
||||
size_t count(gAgent.mGroups.size());
|
||||
ctrl->setTextArg("[COUNT]", llformat("%d", count));
|
||||
int maxgroups(gHippoLimits->getMaxAgentGroups());
|
||||
int maxgroups(LLAgentBenefitsMgr::current().getGroupMembershipLimit());
|
||||
ctrl->setTextArg("[MAX]", llformat("%d", maxgroups));
|
||||
ctrl->setTextArg("[LEFT]", llformat("%d", maxgroups - count));
|
||||
}
|
||||
|
||||
@@ -40,6 +40,7 @@
|
||||
#include "llimagej2c.h"
|
||||
|
||||
#include "llagent.h"
|
||||
#include "llagentbenefits.h"
|
||||
#include "llbutton.h"
|
||||
#include "llcombobox.h"
|
||||
#include "lldrawable.h"
|
||||
@@ -96,7 +97,8 @@ BOOL LLFloaterImagePreview::postBuild()
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
childSetLabelArg("ok_btn", "[UPLOADFEE]", gHippoGridManager->getConnectedGrid()->getUploadFee());
|
||||
auto& grid = *gHippoGridManager->getConnectedGrid();
|
||||
childSetLabelArg("ok_btn", "[UPLOADFEE]", grid.formatFee(LLAgentBenefitsMgr::current().getTextureUploadCost()));
|
||||
|
||||
LLCtrlSelectionInterface* iface = childGetSelectionInterface("clothing_type_combo");
|
||||
if (iface)
|
||||
@@ -126,7 +128,11 @@ BOOL LLFloaterImagePreview::postBuild()
|
||||
|
||||
// <edit>
|
||||
gSavedSettings.setBOOL("TemporaryUpload",FALSE);
|
||||
childSetValue("temp_check",FALSE);
|
||||
auto child = getChildView("temp_check");
|
||||
if (grid.isSecondLife())
|
||||
child->setVisible(false);
|
||||
else
|
||||
child->setValue(false);
|
||||
// </edit>
|
||||
}
|
||||
else
|
||||
|
||||
@@ -58,6 +58,7 @@ LLFloaterInspect::LLFloaterInspect(const LLSD&)
|
||||
mDirty(FALSE)
|
||||
{
|
||||
mCommitCallbackRegistrar.add("Inspect.OwnerProfile", boost::bind(&LLFloaterInspect::onClickOwnerProfile, this));
|
||||
mCommitCallbackRegistrar.add("Inspect.LastOwnerProfile", boost::bind(&LLFloaterInspect::onClickLastOwnerProfile, this));
|
||||
mCommitCallbackRegistrar.add("Inspect.CreatorProfile", boost::bind(&LLFloaterInspect::onClickCreatorProfile, this));
|
||||
mCommitCallbackRegistrar.add("Inspect.SelectObject", boost::bind(&LLFloaterInspect::onSelectObject, this));
|
||||
LLUICtrlFactory::getInstance()->buildFloater(this, "floater_inspect.xml");
|
||||
@@ -166,6 +167,36 @@ void LLFloaterInspect::onClickOwnerProfile()
|
||||
}
|
||||
}
|
||||
|
||||
void LLFloaterInspect::onClickLastOwnerProfile()
|
||||
{
|
||||
if(mObjectList->getAllSelected().size() == 0) return;
|
||||
LLScrollListItem* first_selected =mObjectList->getFirstSelected();
|
||||
|
||||
if (first_selected)
|
||||
{
|
||||
LLUUID selected_id = first_selected->getUUID();
|
||||
struct f : public LLSelectedNodeFunctor
|
||||
{
|
||||
LLUUID obj_id;
|
||||
f(const LLUUID& id) : obj_id(id) {}
|
||||
virtual bool apply(LLSelectNode* node)
|
||||
{
|
||||
return (obj_id == node->getObject()->getID());
|
||||
}
|
||||
} func(selected_id);
|
||||
LLSelectNode* node = mObjectSelection->getFirstNode(&func);
|
||||
if(node)
|
||||
{
|
||||
const LLUUID& last_owner_id = node->mPermissions->getLastOwner();
|
||||
// [RLVa:KB] - Checked: 2010-08-25 (RLVa-1.2.2a) | Modified: RLVa-1.0.0e
|
||||
if (gRlvHandler.hasBehaviour(RLV_BHVR_SHOWNAMES) || gRlvHandler.hasBehaviour(RLV_BHVR_SHOWNAMETAGS))
|
||||
if (last_owner_id == node->mPermissions->getOwner()) return;
|
||||
// [/RLVa:KB]
|
||||
LLAvatarActions::showProfile(last_owner_id);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void LLFloaterInspect::onSelectObject()
|
||||
{
|
||||
if(LLFloaterInspect::getSelectedUUID() != LLUUID::null)
|
||||
|
||||
@@ -60,6 +60,7 @@ public:
|
||||
virtual void onFocusReceived();
|
||||
void onClickCreatorProfile();
|
||||
void onClickOwnerProfile();
|
||||
void onClickLastOwnerProfile();
|
||||
void onSelectObject();
|
||||
|
||||
LLScrollListCtrl* mObjectList;
|
||||
|
||||
@@ -4405,24 +4405,27 @@ bool LLModelPreview::lodQueryCallback()
|
||||
// not the best solution, but model preview belongs to floater
|
||||
// so it is an easy way to check that preview still exists.
|
||||
LLFloaterModelPreview* fmp = LLFloaterModelPreview::sInstance;
|
||||
if (fmp && fmp->mModelPreview)
|
||||
{
|
||||
LLModelPreview* preview = fmp->mModelPreview;
|
||||
if (preview->mLodsQuery.size() > 0)
|
||||
{
|
||||
S32 lod = preview->mLodsQuery.back();
|
||||
preview->mLodsQuery.pop_back();
|
||||
preview->genLODs(lod);
|
||||
|
||||
// return false to continue cycle
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
for (U32 lod = 0; lod < NUM_LOD; ++lod)
|
||||
if (fmp)
|
||||
{
|
||||
LLIconCtrl* icon = fmp->getChild<LLIconCtrl>(lod_icon_name[lod]);
|
||||
icon->setVisible(true);
|
||||
if (fmp->mModelPreview)
|
||||
{
|
||||
LLModelPreview* preview = fmp->mModelPreview;
|
||||
if (preview->mLodsQuery.size() > 0)
|
||||
{
|
||||
S32 lod = preview->mLodsQuery.back();
|
||||
preview->mLodsQuery.pop_back();
|
||||
preview->genLODs(lod);
|
||||
|
||||
// return false to continue cycle
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
for (U32 lod = 0; lod < NUM_LOD; ++lod)
|
||||
{
|
||||
LLIconCtrl* icon = fmp->getChild<LLIconCtrl>(lod_icon_name[lod]);
|
||||
icon->setVisible(true);
|
||||
}
|
||||
}
|
||||
|
||||
// nothing to process
|
||||
|
||||
@@ -48,11 +48,11 @@
|
||||
#include "llviewermenufile.h" // upload_new_resource()
|
||||
#include "lluictrlfactory.h"
|
||||
#include "llstring.h"
|
||||
#include "lleconomy.h"
|
||||
|
||||
// linden includes
|
||||
#include "llassetstorage.h"
|
||||
#include "llinventorytype.h"
|
||||
#include "llagentbenefits.h"
|
||||
|
||||
#include "hippogridmanager.h"
|
||||
|
||||
@@ -134,13 +134,37 @@ BOOL LLFloaterNameDesc::postBuild()
|
||||
// Cancel button
|
||||
getChild<LLUICtrl>("cancel_btn")->setCommitCallback(boost::bind(&LLFloaterNameDesc::onBtnCancel, this));
|
||||
|
||||
getChild<LLUICtrl>("ok_btn")->setLabelArg("[UPLOADFEE]", llformat("%s%d", gHippoGridManager->getConnectedGrid()->getCurrencySymbol().c_str(), LLGlobalEconomy::Singleton::getInstance()->getPriceUpload()));
|
||||
S32 expected_upload_cost = getExpectedUploadCost();
|
||||
getChild<LLUICtrl>("ok_btn")->setLabelArg("[UPLOADFEE]", llformat("%s%d", gHippoGridManager->getConnectedGrid()->getCurrencySymbol().c_str(), expected_upload_cost));
|
||||
|
||||
setDefaultBtn("ok_btn");
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
S32 LLFloaterNameDesc::getExpectedUploadCost() const
|
||||
{
|
||||
std::string exten = gDirUtilp->getExtension(mFilename);
|
||||
LLAssetType::EType asset_type = exten == "wav" ? LLAssetType::AT_SOUND
|
||||
: (exten == "anim" || exten == "bvh") ? LLAssetType::AT_ANIMATION
|
||||
: exten != "lsl" ? LLAssetType::AT_TEXTURE
|
||||
: LLAssetType::AT_NONE;
|
||||
S32 upload_cost = -1;
|
||||
|
||||
if (asset_type != LLAssetType::AT_NONE)
|
||||
{
|
||||
if (!LLAgentBenefitsMgr::current().findUploadCost(asset_type, upload_cost))
|
||||
{
|
||||
LL_WARNS() << "Unable to find upload cost for asset type " << asset_type << LL_ENDL;
|
||||
}
|
||||
}
|
||||
/*else
|
||||
{
|
||||
LL_WARNS() << "Unable to find upload cost for " << mFilename << LL_ENDL;
|
||||
}*/
|
||||
return upload_cost;
|
||||
}
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// LLFloaterNameDesc()
|
||||
//-----------------------------------------------------------------------------
|
||||
@@ -173,7 +197,8 @@ void LLFloaterNameDesc::onBtnOK()
|
||||
getChildView("ok_btn")->setEnabled(FALSE); // don't allow inadvertent extra uploads
|
||||
|
||||
LLAssetStorage::LLStoreAssetCallback callback = NULL;
|
||||
S32 expected_upload_cost = LLGlobalEconomy::Singleton::getInstance()->getPriceUpload(); // kinda hack - assumes that unsubclassed LLFloaterNameDesc is only used for uploading chargeable assets, which it is right now (it's only used unsubclassed for the sound upload dialog, and THAT should be a subclass).
|
||||
S32 expected_upload_cost = getExpectedUploadCost();
|
||||
|
||||
void *nruserdata = NULL;
|
||||
std::string display_name = LLStringUtil::null;
|
||||
|
||||
|
||||
@@ -53,6 +53,8 @@ public:
|
||||
void onBtnCancel();
|
||||
void doCommit();
|
||||
|
||||
S32 getExpectedUploadCost() const;
|
||||
|
||||
protected:
|
||||
virtual void onCommit();
|
||||
|
||||
|
||||
@@ -114,7 +114,7 @@ void LLFloaterObjectIMInfo::onClickMute()
|
||||
// [/RLVa:KB]
|
||||
|
||||
LLMuteList::instance().add(LLMute(mOwnerID, mName, mGroupOwned ? LLMute::GROUP : LLMute::AGENT));
|
||||
LLFloaterMute::showInstance();
|
||||
LLFloaterMute::showInstance()->selectMute(mOwnerID);
|
||||
close();
|
||||
}
|
||||
|
||||
|
||||
@@ -42,6 +42,7 @@
|
||||
#include "llviewerwindow.h"
|
||||
#include "lluictrlfactory.h"
|
||||
#include "llpermissions.h"
|
||||
#include "llsdserialize.h"
|
||||
#include "hippogridmanager.h"
|
||||
|
||||
extern class AIHTTPTimeoutPolicy floaterPermsResponder_timeout;
|
||||
@@ -63,6 +64,25 @@ U32 LLFloaterPerms::getEveryonePerms(std::string prefix)
|
||||
return flags;
|
||||
}
|
||||
|
||||
//static
|
||||
U32 LLFloaterPerms::getNextOwnerPerms(std::string prefix)
|
||||
{
|
||||
U32 flags = PERM_MOVE;
|
||||
if ( gSavedSettings.getBOOL(prefix+"NextOwnerCopy") )
|
||||
{
|
||||
flags |= PERM_COPY;
|
||||
}
|
||||
if ( gSavedSettings.getBOOL(prefix+"NextOwnerModify") )
|
||||
{
|
||||
flags |= PERM_MODIFY;
|
||||
}
|
||||
if ( gSavedSettings.getBOOL(prefix+"NextOwnerTransfer") )
|
||||
{
|
||||
flags |= PERM_TRANSFER;
|
||||
}
|
||||
return flags;
|
||||
}
|
||||
|
||||
//static
|
||||
U32 LLFloaterPerms::getNextOwnerPermsInverted(std::string prefix)
|
||||
{
|
||||
@@ -83,25 +103,6 @@ U32 LLFloaterPerms::getNextOwnerPermsInverted(std::string prefix)
|
||||
return flags;
|
||||
}
|
||||
|
||||
//static
|
||||
U32 LLFloaterPerms::getNextOwnerPerms(std::string prefix)
|
||||
{
|
||||
U32 flags = PERM_MOVE;
|
||||
if ( gSavedSettings.getBOOL(prefix+"NextOwnerCopy") )
|
||||
{
|
||||
flags |= PERM_COPY;
|
||||
}
|
||||
if ( gSavedSettings.getBOOL(prefix+"NextOwnerModify") )
|
||||
{
|
||||
flags |= PERM_MODIFY;
|
||||
}
|
||||
if ( gSavedSettings.getBOOL(prefix+"NextOwnerTransfer") )
|
||||
{
|
||||
flags |= PERM_TRANSFER;
|
||||
}
|
||||
return flags;
|
||||
}
|
||||
|
||||
namespace
|
||||
{
|
||||
void handle_checkboxes(LLView* view, const std::string& ctrl_name, const LLSD& value, const std::string& type)
|
||||
@@ -138,6 +139,7 @@ LLFloaterPermsDefault::LLFloaterPermsDefault(const LLSD& seed)
|
||||
LLUICtrlFactory::getInstance()->buildFloater(this, "floater_perm_prefs.xml");
|
||||
}
|
||||
|
||||
|
||||
// String equivalents of enum Categories - initialization order must match enum order!
|
||||
const std::string LLFloaterPermsDefault::sCategoryNames[CAT_LAST] =
|
||||
{
|
||||
@@ -224,41 +226,66 @@ void LLFloaterPermsDefault::onClickCancel()
|
||||
close();
|
||||
}
|
||||
|
||||
class LLFloaterPermsResponder : public LLHTTPClient::ResponderWithResult
|
||||
struct LLFloaterPermsRequester final : LLSingleton<LLFloaterPermsRequester>
|
||||
{
|
||||
friend class LLSingleton<LLFloaterPermsRequester>;
|
||||
std::string mUrl;
|
||||
LLSD mReport;
|
||||
U8 mRetriesCount = 0;
|
||||
static void init(const std::string url, const LLSD report)
|
||||
{
|
||||
auto& inst = instance();
|
||||
inst.mUrl = url;
|
||||
inst.mReport = report;
|
||||
inst.retry();
|
||||
}
|
||||
bool retry();
|
||||
};
|
||||
|
||||
class LLFloaterPermsResponder final : public LLHTTPClient::ResponderWithResult
|
||||
{
|
||||
public:
|
||||
LLFloaterPermsResponder() : LLHTTPClient::ResponderWithResult() {}
|
||||
private:
|
||||
static std::string sPreviousReason;
|
||||
|
||||
void httpFailure(void)
|
||||
void httpFailure() override
|
||||
{
|
||||
// <singu> Prevent 404s from annoying the user all the tme
|
||||
if (mStatus == HTTP_NOT_FOUND)
|
||||
LL_INFOS("FloaterPermsResponder") << "Failed to send default permissions to simulator. 404, reason: " << mReason << LL_ENDL;
|
||||
else
|
||||
// </singu>
|
||||
auto* requester = LLFloaterPermsRequester::getIfExists();
|
||||
if (!requester || requester->retry()) return;
|
||||
|
||||
LLFloaterPermsRequester::deleteSingleton();
|
||||
const std::string& reason = getReason();
|
||||
// Do not display the same error more than once in a row
|
||||
if (mReason != sPreviousReason)
|
||||
if (reason != sPreviousReason)
|
||||
{
|
||||
sPreviousReason = mReason;
|
||||
sPreviousReason = reason;
|
||||
LLSD args;
|
||||
args["REASON"] = mReason;
|
||||
args["REASON"] = reason;
|
||||
LLNotificationsUtil::add("DefaultObjectPermissions", args);
|
||||
}
|
||||
}
|
||||
void httpSuccess(void)
|
||||
void httpSuccess() override
|
||||
{
|
||||
//const LLSD& content = getContent();
|
||||
//dump_sequential_xml("perms_responder_result.xml", content);
|
||||
|
||||
// Since we have had a successful POST call be sure to display the next error message
|
||||
// even if it is the same as a previous one.
|
||||
sPreviousReason = "";
|
||||
mCapSent = true;
|
||||
LL_INFOS("FloaterPermsResponder") << "Sent default permissions to simulator" << LL_ENDL;
|
||||
LL_INFOS("ObjectPermissionsFloater") << "Default permissions successfully sent to simulator" << LL_ENDL;
|
||||
}
|
||||
/*virtual*/ AIHTTPTimeoutPolicy const& getHTTPTimeoutPolicy() const { return floaterPermsResponder_timeout; }
|
||||
/*virtual*/ char const* getName() const { return "LLFloaterPermsResponder"; }
|
||||
AIHTTPTimeoutPolicy const& getHTTPTimeoutPolicy() const override { return floaterPermsResponder_timeout; }
|
||||
char const* getName() const override { return "LLFloaterPermsResponder"; }
|
||||
};
|
||||
|
||||
bool LLFloaterPermsRequester::retry()
|
||||
{
|
||||
if (++mRetriesCount < 5)
|
||||
{
|
||||
LLHTTPClient::post(mUrl, mReport, new LLFloaterPermsResponder);
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
std::string LLFloaterPermsResponder::sPreviousReason;
|
||||
|
||||
void LLFloaterPermsDefault::sendInitialPerms()
|
||||
@@ -266,12 +293,13 @@ void LLFloaterPermsDefault::sendInitialPerms()
|
||||
if (!mCapSent)
|
||||
{
|
||||
updateCap();
|
||||
mCapSent = true;
|
||||
}
|
||||
}
|
||||
|
||||
void LLFloaterPermsDefault::updateCap()
|
||||
{
|
||||
std::string object_url = gAgent.getRegion()->getCapability("AgentPreferences");
|
||||
std::string object_url = gAgent.getRegionCapability("AgentPreferences");
|
||||
|
||||
if (!object_url.empty())
|
||||
{
|
||||
@@ -283,13 +311,24 @@ void LLFloaterPermsDefault::updateCap()
|
||||
report["default_object_perm_masks"]["NextOwner"] =
|
||||
(LLSD::Integer)LLFloaterPerms::getNextOwnerPerms(sCategoryNames[CAT_OBJECTS]);
|
||||
|
||||
LLHTTPClient::post(object_url, report, new LLFloaterPermsResponder());
|
||||
{
|
||||
std::ostringstream sent_perms_log;
|
||||
LLSDSerialize::toPrettyXML(report, sent_perms_log);
|
||||
LL_DEBUGS("ObjectPermissionsFloater") << "Sending default permissions to '"
|
||||
<< object_url << "'\n"
|
||||
<< sent_perms_log.str() << LL_ENDL;
|
||||
}
|
||||
LLFloaterPermsRequester::init(object_url, report);
|
||||
}
|
||||
else
|
||||
{
|
||||
LL_DEBUGS("ObjectPermissionsFloater") << "AgentPreferences cap not available." << LL_ENDL;
|
||||
}
|
||||
}
|
||||
|
||||
void LLFloaterPermsDefault::ok()
|
||||
{
|
||||
// Changes were already applied to saved settings.
|
||||
// Changes were already applied automatically to saved settings.
|
||||
// Refreshing internal values makes it official.
|
||||
refresh();
|
||||
|
||||
@@ -302,11 +341,11 @@ void LLFloaterPermsDefault::cancel()
|
||||
{
|
||||
for (U32 iter = CAT_OBJECTS; iter < CAT_LAST; iter++)
|
||||
{
|
||||
gSavedSettings.setBOOL(sCategoryNames[iter]+"ShareWithGroup", mShareWithGroup[iter]);
|
||||
gSavedSettings.setBOOL(sCategoryNames[iter]+"EveryoneCopy", mEveryoneCopy[iter]);
|
||||
gSavedSettings.setBOOL(sCategoryNames[iter]+"NextOwnerCopy", mNextOwnerCopy[iter]);
|
||||
gSavedSettings.setBOOL(sCategoryNames[iter]+"NextOwnerModify", mNextOwnerModify[iter]);
|
||||
gSavedSettings.setBOOL(sCategoryNames[iter]+"NextOwnerTransfer", mNextOwnerTransfer[iter]);
|
||||
gSavedSettings.setBOOL(sCategoryNames[iter]+"ShareWithGroup", mShareWithGroup[iter]);
|
||||
gSavedSettings.setBOOL(sCategoryNames[iter]+"EveryoneCopy", mEveryoneCopy[iter]);
|
||||
gSavedPerAccountSettings.setBOOL(sCategoryNames[iter]+"EveryoneExport", mEveryoneExport[iter]);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -55,7 +55,6 @@
|
||||
#include "llviewerwindow.h"
|
||||
#include "llstatusbar.h"
|
||||
#include "llviewerregion.h"
|
||||
#include "lleconomy.h"
|
||||
#include "lltrans.h"
|
||||
|
||||
#include "llgl.h"
|
||||
@@ -104,11 +103,7 @@ void LLFloaterPostcard::init()
|
||||
if(!gAgent.getID().isNull())
|
||||
{
|
||||
// we're logged in, so we can get this info.
|
||||
gMessageSystem->newMessageFast(_PREHASH_UserInfoRequest);
|
||||
gMessageSystem->nextBlockFast(_PREHASH_AgentData);
|
||||
gMessageSystem->addUUIDFast(_PREHASH_AgentID, gAgent.getID());
|
||||
gMessageSystem->addUUIDFast(_PREHASH_SessionID, gAgent.getSessionID());
|
||||
gAgent.sendReliableMessage();
|
||||
gAgent.sendAgentUserInfoRequest();
|
||||
}
|
||||
|
||||
sInstances.insert(this);
|
||||
@@ -234,7 +229,7 @@ void LLFloaterPostcard::onClose(bool app_quitting)
|
||||
destroy();
|
||||
}
|
||||
|
||||
class LLSendPostcardResponder : public LLAssetUploadResponder
|
||||
class LLSendPostcardResponder final : public LLAssetUploadResponder
|
||||
{
|
||||
private:
|
||||
int mSnapshotIndex;
|
||||
@@ -249,22 +244,22 @@ public:
|
||||
{
|
||||
}
|
||||
// *TODO define custom uploadFailed here so it's not such a generic message
|
||||
/*virtual*/ void uploadComplete(const LLSD& content)
|
||||
void uploadComplete(const LLSD& content) override final
|
||||
{
|
||||
// we don't care about what the server returns from this post, just clean up the UI
|
||||
LLFloaterSnapshot::savePostcardDone(true, mSnapshotIndex);
|
||||
}
|
||||
/*virtual*/ void uploadFailure(const LLSD& content)
|
||||
void uploadFailure(const LLSD& content) override final
|
||||
{
|
||||
LLAssetUploadResponder::uploadFailure(content);
|
||||
LLFloaterSnapshot::savePostcardDone(false, mSnapshotIndex);
|
||||
}
|
||||
/*virtual*/ void httpFailure(void)
|
||||
void httpFailure(void) override final
|
||||
{
|
||||
LLAssetUploadResponder::httpFailure();
|
||||
LLFloaterSnapshot::savePostcardDone(false, mSnapshotIndex);
|
||||
}
|
||||
/*virtual*/ char const* getName(void) const { return "LLSendPostcardResponder"; }
|
||||
char const* getName(void) const override final { return "LLSendPostcardResponder"; }
|
||||
};
|
||||
|
||||
// static
|
||||
@@ -274,7 +269,6 @@ void LLFloaterPostcard::onClickSend(void* data)
|
||||
{
|
||||
LLFloaterPostcard *self = (LLFloaterPostcard *)data;
|
||||
|
||||
std::string from(self->childGetValue("from_form").asString());
|
||||
std::string to(self->childGetValue("to_form").asString());
|
||||
|
||||
boost::regex emailFormat("[A-Za-z0-9.%+-_]+@[A-Za-z0-9.-]+\\.[A-Za-z]{2,}(,[ \t]*[A-Za-z0-9.%+-_]+@[A-Za-z0-9.-]+\\.[A-Za-z]{2,})*");
|
||||
@@ -285,12 +279,6 @@ void LLFloaterPostcard::onClickSend(void* data)
|
||||
return;
|
||||
}
|
||||
|
||||
if (from.empty() || !boost::regex_match(from, emailFormat))
|
||||
{
|
||||
LLNotificationsUtil::add("PromptSelfEmail");
|
||||
return;
|
||||
}
|
||||
|
||||
std::string subject(self->childGetValue("subject_form").asString());
|
||||
if(subject.empty() || !self->mHasFirstMsgFocus)
|
||||
{
|
||||
@@ -350,10 +338,8 @@ void LLFloaterPostcard::uploadCallback(const LLUUID& asset_id, void *user_data,
|
||||
// static
|
||||
void LLFloaterPostcard::updateUserInfo(const std::string& email)
|
||||
{
|
||||
for (instance_list_t::iterator iter = sInstances.begin();
|
||||
iter != sInstances.end(); ++iter)
|
||||
for (auto& instance : sInstances)
|
||||
{
|
||||
LLFloaterPostcard *instance = *iter;
|
||||
const std::string& text = instance->childGetValue("from_form").asString();
|
||||
if (text.empty())
|
||||
{
|
||||
@@ -417,7 +403,6 @@ void LLFloaterPostcard::sendPostcard()
|
||||
// the capability already encodes: agent ID, region ID
|
||||
body["pos-global"] = mPosTakenGlobal.getValue();
|
||||
body["to"] = childGetValue("to_form").asString();
|
||||
body["from"] = childGetValue("from_form").asString();
|
||||
body["name"] = childGetValue("name_form").asString();
|
||||
body["subject"] = childGetValue("subject_form").asString();
|
||||
body["msg"] = childGetValue("msg_form").asString();
|
||||
|
||||
@@ -46,17 +46,17 @@ class LLLineEditor;
|
||||
class LLButton;
|
||||
class LLImageJPEG;
|
||||
|
||||
class LLFloaterPostcard
|
||||
class LLFloaterPostcard final
|
||||
: public LLFloater
|
||||
{
|
||||
public:
|
||||
LLFloaterPostcard(LLImageJPEG* jpeg, LLViewerTexture *img, const LLVector2& img_scale, const LLVector3d& pos_taken_global, int index);
|
||||
/*virtual*/ ~LLFloaterPostcard();
|
||||
/*virtual*/ ~LLFloaterPostcard() override;
|
||||
|
||||
/*virtual*/ void init();
|
||||
/*virtual*/ BOOL postBuild();
|
||||
/*virtual*/ void draw();
|
||||
/*virtual*/ void onClose(bool app_quitting);
|
||||
void init();
|
||||
/*virtual*/ BOOL postBuild() override;
|
||||
/*virtual*/ void draw() override;
|
||||
/*virtual*/ void onClose(bool app_quitting) override;
|
||||
|
||||
static LLFloaterPostcard* showFromSnapshot(LLImageJPEG *jpeg, LLViewerTexture *img, const LLVector2& img_scale, const LLVector3d& pos_taken_global, int index);
|
||||
|
||||
|
||||
@@ -54,7 +54,7 @@
|
||||
#include "llfocusmgr.h"
|
||||
#include "llbutton.h"
|
||||
#include "llcombobox.h"
|
||||
#include "lleconomy.h"
|
||||
#include "llagentbenefits.h"
|
||||
#include "llsliderctrl.h"
|
||||
#include "llspinctrl.h"
|
||||
#include "llviewercontrol.h"
|
||||
@@ -1414,7 +1414,7 @@ void LLSnapshotLivePreview::saveTexture()
|
||||
std::string who_took_it;
|
||||
LLAgentUI::buildFullname(who_took_it);
|
||||
LLAssetStorage::LLStoreAssetCallback callback = &LLSnapshotLivePreview::saveTextureDone;
|
||||
S32 expected_upload_cost = LLGlobalEconomy::Singleton::getInstance()->getPriceUpload();
|
||||
S32 expected_upload_cost = LLAgentBenefitsMgr::current().getTextureUploadCost();
|
||||
saveTextureUserData* user_data = new saveTextureUserData(this, sSnapshotIndex, gSavedSettings.getBOOL("TemporaryUpload"));
|
||||
if (upload_new_resource(tid, // tid
|
||||
LLAssetType::AT_TEXTURE,
|
||||
@@ -1752,7 +1752,7 @@ void LLFloaterSnapshot::Impl::updateControls(LLFloaterSnapshot* floater, bool de
|
||||
{
|
||||
DoutEntering(dc::snapshot, "LLFloaterSnapshot::Impl::updateControls()");
|
||||
const HippoGridInfo& grid(*gHippoGridManager->getConnectedGrid());
|
||||
floater->childSetLabelArg("upload_btn", "[UPLOADFEE]", gSavedSettings.getBOOL("TemporaryUpload") ? (grid.getCurrencySymbol() + '0') : grid.getUploadFee());
|
||||
floater->childSetLabelArg("upload_btn", "[UPLOADFEE]", grid.formatFee(gSavedSettings.getBOOL("TemporaryUpload") ? 0 : LLAgentBenefitsMgr::current().getTextureUploadCost()));
|
||||
|
||||
LLSnapshotLivePreview::ESnapshotType shot_type = (LLSnapshotLivePreview::ESnapshotType)gSavedSettings.getS32("LastSnapshotType");
|
||||
ESnapshotFormat shot_format = (ESnapshotFormat)gSavedSettings.getS32("SnapshotFormat");
|
||||
@@ -1857,7 +1857,7 @@ void LLFloaterSnapshot::Impl::updateControls(LLFloaterSnapshot* floater, bool de
|
||||
{
|
||||
bytes_string = floater->getString("unknown");
|
||||
}
|
||||
S32 upload_cost = LLGlobalEconomy::Singleton::getInstance()->getPriceUpload();
|
||||
S32 upload_cost = LLAgentBenefitsMgr::current().getTextureUploadCost();
|
||||
floater->childSetLabelArg("texture", "[AMOUNT]", llformat("%d",upload_cost));
|
||||
floater->childSetLabelArg("upload_btn", "[AMOUNT]", llformat("%d",upload_cost));
|
||||
floater->childSetTextArg("file_size_label", "[SIZE]", bytes_string);
|
||||
|
||||
@@ -302,10 +302,10 @@ void LLFloaterWindLight::syncMenu()
|
||||
// blue horizon
|
||||
param_mgr->mBlueHorizon = cur_params.getVector(param_mgr->mBlueHorizon.mName, err);
|
||||
//setColorSwatch("WLBlueHorizon", param_mgr->mBlueHorizon, WL_BLUE_HORIZON_DENSITY_SCALE);
|
||||
childSetValue("WLBlueHorizonR", param_mgr->mBlueHorizon.r);
|
||||
childSetValue("WLBlueHorizonG", param_mgr->mBlueHorizon.g);
|
||||
childSetValue("WLBlueHorizonB", param_mgr->mBlueHorizon.b);
|
||||
childSetValue("WLBlueHorizonI", param_mgr->mBlueHorizon.i);
|
||||
childSetValue("WLBlueHorizonR", param_mgr->mBlueHorizon.r / WL_BLUE_HORIZON_DENSITY_SCALE);
|
||||
childSetValue("WLBlueHorizonG", param_mgr->mBlueHorizon.g / WL_BLUE_HORIZON_DENSITY_SCALE);
|
||||
childSetValue("WLBlueHorizonB", param_mgr->mBlueHorizon.b / WL_BLUE_HORIZON_DENSITY_SCALE);
|
||||
childSetValue("WLBlueHorizonI", param_mgr->mBlueHorizon.i / WL_BLUE_HORIZON_DENSITY_SCALE);
|
||||
|
||||
// haze density, horizon, mult, and altitude
|
||||
param_mgr->mHazeDensity = cur_params.getFloat(param_mgr->mHazeDensity.mName, err);
|
||||
@@ -320,20 +320,20 @@ void LLFloaterWindLight::syncMenu()
|
||||
// blue density
|
||||
param_mgr->mBlueDensity = cur_params.getVector(param_mgr->mBlueDensity.mName, err);
|
||||
//setColorSwatch("WLBlueDensity", param_mgr->mBlueDensity, WL_BLUE_HORIZON_DENSITY_SCALE);
|
||||
childSetValue("WLBlueDensityR", param_mgr->mBlueDensity.r);
|
||||
childSetValue("WLBlueDensityG", param_mgr->mBlueDensity.g);
|
||||
childSetValue("WLBlueDensityB", param_mgr->mBlueDensity.b);
|
||||
childSetValue("WLBlueDensityI", param_mgr->mBlueDensity.i);
|
||||
childSetValue("WLBlueDensityR", param_mgr->mBlueDensity.r / WL_BLUE_HORIZON_DENSITY_SCALE);
|
||||
childSetValue("WLBlueDensityG", param_mgr->mBlueDensity.g / WL_BLUE_HORIZON_DENSITY_SCALE);
|
||||
childSetValue("WLBlueDensityB", param_mgr->mBlueDensity.b / WL_BLUE_HORIZON_DENSITY_SCALE);
|
||||
childSetValue("WLBlueDensityI", param_mgr->mBlueDensity.i / WL_BLUE_HORIZON_DENSITY_SCALE);
|
||||
|
||||
// Lighting
|
||||
|
||||
// sunlight
|
||||
param_mgr->mSunlight = cur_params.getVector(param_mgr->mSunlight.mName, err);
|
||||
//setColorSwatch("WLSunlight", param_mgr->mSunlight, WL_SUN_AMBIENT_SLIDER_SCALE);
|
||||
childSetValue("WLSunlightR", param_mgr->mSunlight.r);
|
||||
childSetValue("WLSunlightG", param_mgr->mSunlight.g);
|
||||
childSetValue("WLSunlightB", param_mgr->mSunlight.b);
|
||||
childSetValue("WLSunlightI", param_mgr->mSunlight.i);
|
||||
childSetValue("WLSunlightR", param_mgr->mSunlight.r / WL_SUN_AMBIENT_SLIDER_SCALE);
|
||||
childSetValue("WLSunlightG", param_mgr->mSunlight.g / WL_SUN_AMBIENT_SLIDER_SCALE);
|
||||
childSetValue("WLSunlightB", param_mgr->mSunlight.b / WL_SUN_AMBIENT_SLIDER_SCALE);
|
||||
childSetValue("WLSunlightI", param_mgr->mSunlight.i / WL_SUN_AMBIENT_SLIDER_SCALE);
|
||||
|
||||
// glow
|
||||
param_mgr->mGlow = cur_params.getVector(param_mgr->mGlow.mName, err);
|
||||
@@ -343,10 +343,10 @@ void LLFloaterWindLight::syncMenu()
|
||||
// ambient
|
||||
param_mgr->mAmbient = cur_params.getVector(param_mgr->mAmbient.mName, err);
|
||||
//setColorSwatch("WLAmbient", param_mgr->mAmbient, WL_SUN_AMBIENT_SLIDER_SCALE);
|
||||
childSetValue("WLAmbientR", param_mgr->mAmbient.r);
|
||||
childSetValue("WLAmbientG", param_mgr->mAmbient.g);
|
||||
childSetValue("WLAmbientB", param_mgr->mAmbient.b);
|
||||
childSetValue("WLAmbientI", param_mgr->mAmbient.i);
|
||||
childSetValue("WLAmbientR", param_mgr->mAmbient.r / WL_SUN_AMBIENT_SLIDER_SCALE);
|
||||
childSetValue("WLAmbientG", param_mgr->mAmbient.g / WL_SUN_AMBIENT_SLIDER_SCALE);
|
||||
childSetValue("WLAmbientB", param_mgr->mAmbient.b / WL_SUN_AMBIENT_SLIDER_SCALE);
|
||||
childSetValue("WLAmbientI", param_mgr->mAmbient.i / WL_SUN_AMBIENT_SLIDER_SCALE);
|
||||
|
||||
childSetValue("WLSunAngle", param_mgr->mCurParams.getFloat("sun_angle",err) / F_TWO_PI);
|
||||
childSetValue("WLEastAngle", param_mgr->mCurParams.getFloat("east_angle",err) / F_TWO_PI);
|
||||
@@ -356,10 +356,10 @@ void LLFloaterWindLight::syncMenu()
|
||||
// Cloud Color
|
||||
param_mgr->mCloudColor = cur_params.getVector(param_mgr->mCloudColor.mName, err);
|
||||
//setColorSwatch("WLCloudColor", param_mgr->mCloudColor, WL_CLOUD_SLIDER_SCALE);
|
||||
childSetValue("WLCloudColorR", param_mgr->mCloudColor.r);
|
||||
childSetValue("WLCloudColorG", param_mgr->mCloudColor.g);
|
||||
childSetValue("WLCloudColorB", param_mgr->mCloudColor.b);
|
||||
childSetValue("WLCloudColorI", param_mgr->mCloudColor.i);
|
||||
childSetValue("WLCloudColorR", param_mgr->mCloudColor.r / WL_CLOUD_SLIDER_SCALE);
|
||||
childSetValue("WLCloudColorG", param_mgr->mCloudColor.g / WL_CLOUD_SLIDER_SCALE);
|
||||
childSetValue("WLCloudColorB", param_mgr->mCloudColor.b / WL_CLOUD_SLIDER_SCALE);
|
||||
childSetValue("WLCloudColorI", param_mgr->mCloudColor.i / WL_CLOUD_SLIDER_SCALE);
|
||||
|
||||
// Cloud
|
||||
param_mgr->mCloudMain = cur_params.getVector(param_mgr->mCloudMain.mName, err);
|
||||
@@ -513,18 +513,7 @@ void LLFloaterWindLight::onColorControlRMoved(LLUICtrl* ctrl, void* userdata)
|
||||
std::string name = color_ctrl->mSliderName;
|
||||
name.append("I");
|
||||
|
||||
if (color_ctrl->isSunOrAmbientColor)
|
||||
{
|
||||
childSetValue(name, color_ctrl->r / WL_SUN_AMBIENT_SLIDER_SCALE);
|
||||
}
|
||||
else if (color_ctrl->isBlueHorizonOrDensity)
|
||||
{
|
||||
childSetValue(name, color_ctrl->r / WL_BLUE_HORIZON_DENSITY_SCALE);
|
||||
}
|
||||
else
|
||||
{
|
||||
childSetValue(name, color_ctrl->r);
|
||||
}
|
||||
childSetValue(name, sldr_ctrl->getValueF32());
|
||||
}
|
||||
|
||||
color_ctrl->update(LLWLParamManager::getInstance()->mCurParams);
|
||||
|
||||
@@ -2010,7 +2010,7 @@ void LLFolderView::scrollToShowSelection()
|
||||
// However we allow scrolling for folder views with mAutoSelectOverride
|
||||
// (used in Places SP) as an exception because the selection in them
|
||||
// is not reset during items filtering. See STORM-133.
|
||||
if ( (!LLInventoryModelBackgroundFetch::instance().folderFetchActive() || mAutoSelectOverride)
|
||||
if ( (LLInventoryModelBackgroundFetch::instance().isEverythingFetched() || mAutoSelectOverride)
|
||||
&& mSelectedItems.size() )
|
||||
{
|
||||
mNeedsScroll = TRUE;
|
||||
|
||||
@@ -44,7 +44,6 @@
|
||||
#include "roles_constants.h"
|
||||
#include "lltransactiontypes.h"
|
||||
#include "llstatusbar.h"
|
||||
#include "lleconomy.h"
|
||||
#include "llviewerregion.h"
|
||||
#include "llviewerwindow.h"
|
||||
#include "llfloaterdirectory.h"
|
||||
|
||||
@@ -36,6 +36,7 @@
|
||||
|
||||
#include "llfocusmgr.h"
|
||||
|
||||
#include "llavataractions.h"
|
||||
#include "llbutton.h"
|
||||
#include "lliconctrl.h"
|
||||
#include "llfloaterchat.h" // for add_chat_history()
|
||||
@@ -94,15 +95,15 @@ LLGroupNotifyBox::LLGroupNotifyBox(const std::string& subject,
|
||||
mHasInventory(has_inventory),
|
||||
mInventoryOffer(NULL)
|
||||
{
|
||||
const S32 VPAD = 2;
|
||||
const S32 TOP = getRect().getHeight() - 32; // Get past the top menu bar
|
||||
const S32 BOTTOM_PAD = VPAD * 2;
|
||||
const S32 BTN_TOP = BOTTOM_PAD + BTN_HEIGHT + VPAD;
|
||||
const S32 RIGHT = getRect().getWidth() - HPAD - HPAD;
|
||||
const S32 LINE_HEIGHT = 16;
|
||||
constexpr S32 PAD = 2;
|
||||
const S32 TOP = getRect().getHeight() - 28; // Get past the top menu bar
|
||||
const S32 BOTTOM_PAD = PAD * 2;
|
||||
const S32 BTN_TOP = BOTTOM_PAD + BTN_HEIGHT + PAD;
|
||||
const S32 RIGHT = getRect().getWidth() - HPAD;
|
||||
constexpr S32 LINE_HEIGHT = 16;
|
||||
|
||||
const S32 LABEL_WIDTH = 64;
|
||||
const S32 ICON_WIDTH = 64;
|
||||
constexpr S32 LABEL_WIDTH = 64;
|
||||
constexpr S32 ICON_WIDTH = 64;
|
||||
|
||||
time_t timestamp = (time_t)time_stamp.secondsSinceEpoch();
|
||||
if (!timestamp) time(×tamp);
|
||||
@@ -122,48 +123,59 @@ LLGroupNotifyBox::LLGroupNotifyBox(const std::string& subject,
|
||||
setBackgroundColor( gColors.getColor("GroupNotifyBoxColor") );
|
||||
|
||||
S32 y = TOP;
|
||||
S32 x = HPAD + HPAD;
|
||||
S32 x = ICON_WIDTH + HPAD + PAD;
|
||||
|
||||
static const auto text_color = gColors.getColor("GroupNotifyTextColor");
|
||||
class NoticeText : public LLTextBox
|
||||
{
|
||||
public:
|
||||
NoticeText(const std::string& name, const LLRect& rect, const std::string& text = LLStringUtil::null, const LLFontGL* font = NULL)
|
||||
NoticeText(const std::string& name, const LLRect& rect, const std::string& text = LLStringUtil::null, const LLFontGL* font = NULL)
|
||||
: LLTextBox(name, rect, text, font)
|
||||
{
|
||||
setHAlign(LLFontGL::RIGHT);
|
||||
setFontShadow(LLFontGL::DROP_SHADOW_SOFT);
|
||||
setBorderVisible(FALSE);
|
||||
setColor( gColors.getColor("GroupNotifyTextColor") );
|
||||
setBackgroundColor( gColors.getColor("GroupNotifyBoxColor") );
|
||||
setColor(text_color);
|
||||
setBackgroundColor(LLColor4::transparent);
|
||||
}
|
||||
};
|
||||
|
||||
// Title
|
||||
addChild(new NoticeText(std::string("title"),LLRect(x,y,RIGHT - HPAD,y - LINE_HEIGHT),LLTrans::getString("GroupNotifyGroupNotice"),LLFontGL::getFontSansSerifHuge()));
|
||||
static LLStyleSP headerstyle = nullptr;
|
||||
if (!headerstyle)
|
||||
{
|
||||
headerstyle = new LLStyle(true, text_color, LLStringUtil::null);
|
||||
headerstyle->mBold = true;
|
||||
}
|
||||
const auto bottom = y - ICON_WIDTH;
|
||||
|
||||
y -= llfloor(1.5f*LINE_HEIGHT);
|
||||
auto links = new LLTextEditor(std::string("group"), LLRect(x, y + 5, RIGHT, bottom), S32_MAX, LLStringUtil::null, nullptr, false, true); // Top adjustment to line up with icon
|
||||
links->setBorderVisible(FALSE);
|
||||
static const auto header_bg_color = gColors.getColor("GroupNotifyHeaderBGColor");
|
||||
if (header_bg_color[VALPHA]) links->setReadOnlyFgColor(text_color);
|
||||
links->setReadOnlyBgColor(header_bg_color);
|
||||
links->setEnabled(false);
|
||||
links->setTakesNonScrollClicks(TRUE);
|
||||
links->setHideScrollbarForShortDocs(TRUE);
|
||||
links->setWordWrap(TRUE);
|
||||
|
||||
x += HPAD + HPAD + ICON_WIDTH;
|
||||
links->appendText(subject, false, false, headerstyle, false); // This is from a user, do not force replace.
|
||||
links->appendText(time_buf, false, true, nullptr, true);
|
||||
links->appendText(LLTrans::getString("GroupNotifyBy", LLSD().with("NAME", from_name).with("GROUP", group_name)), false, true, nullptr, true);
|
||||
addChild(links);
|
||||
|
||||
std::stringstream from;
|
||||
from << LLTrans::getString("GroupNotifySentBy") << " " + from_name << LLTrans::getString(",") + " " << group_name;
|
||||
x = HPAD;
|
||||
|
||||
addChild(new NoticeText(std::string("group"),LLRect(x,y,RIGHT - HPAD,y - LINE_HEIGHT),from.str(),LLFontGL::getFontSansSerif()));
|
||||
|
||||
y -= (LINE_HEIGHT + VPAD);
|
||||
x = HPAD + HPAD;
|
||||
|
||||
// TODO: change this to be the group icon.
|
||||
LLIconCtrl* icon = new LLIconCtrl(std::string("icon"),
|
||||
LLRect(x, y, x+ICON_WIDTH, y-ICON_WIDTH),
|
||||
group_insignia.isNull() ? "notify_box_icon.tga" : group_insignia.asString());
|
||||
LLRect(x, y, x+ICON_WIDTH, bottom),
|
||||
group_insignia.isNull() ? "icon_groupnotice.tga" : group_insignia.asString());
|
||||
|
||||
icon->setMouseOpaque(FALSE);
|
||||
addChild(icon);
|
||||
|
||||
x += HPAD + HPAD + ICON_WIDTH;
|
||||
y = bottom - PAD*2;
|
||||
|
||||
// If we have inventory with this message, leave room for the name.
|
||||
S32 box_bottom = BTN_TOP + (mHasInventory ? (LINE_HEIGHT + 2*VPAD) : 0);
|
||||
S32 box_bottom = BTN_TOP + (mHasInventory ? (LINE_HEIGHT + 2*PAD) : 0);
|
||||
|
||||
LLTextEditor* text = new LLViewerTextEditor(std::string("box"),
|
||||
LLRect(x, y, RIGHT, box_bottom),
|
||||
@@ -172,15 +184,11 @@ LLGroupNotifyBox::LLGroupNotifyBox(const std::string& subject,
|
||||
LLFontGL::getFontSansSerif(),
|
||||
FALSE,
|
||||
true);
|
||||
text->setBorderVisible(false);
|
||||
|
||||
static const LLStyleSP headerstyle(new LLStyle(true,LLColor4::black,"SansSerifBig"));
|
||||
static const LLStyleSP datestyle(new LLStyle(true,LLColor4::black,"serif"));
|
||||
static const LLStyleSP msgstyle(new LLStyle(true, LLColor4::grey4, LLStringUtil::null));
|
||||
|
||||
text->appendText(subject + '\n',false,false,headerstyle,false);
|
||||
|
||||
text->appendText(time_buf,false,false,datestyle,false);
|
||||
text->appendText(std::string(" \n\n") + message,false,false,msgstyle,false);
|
||||
text->appendText(message, false, false, msgstyle, false);
|
||||
|
||||
LLColor4 semi_transparent(1.0f,1.0f,1.0f,0.8f);
|
||||
text->setCursor(0,0);
|
||||
@@ -196,11 +204,11 @@ LLGroupNotifyBox::LLGroupNotifyBox(const std::string& subject,
|
||||
|
||||
addChild(text);
|
||||
|
||||
y = box_bottom - VPAD;
|
||||
y = box_bottom - PAD;
|
||||
|
||||
if (mHasInventory)
|
||||
{
|
||||
addChild(new NoticeText(std::string("subjecttitle"),LLRect(x,y,x + LABEL_WIDTH,y - LINE_HEIGHT),LLTrans::getString("GroupNotifyAttached"),LLFontGL::getFontSansSerif()));
|
||||
addChild(new NoticeText(std::string("subjecttitle"), LLRect(x,y,x + LABEL_WIDTH,y - LINE_HEIGHT), LLTrans::getString("GroupNotifyAttached") + ' ', LLFontGL::getFontSansSerif()));
|
||||
|
||||
LLUIImagePtr item_icon = LLInventoryIcon::getIcon(mInventoryOffer->mType,
|
||||
LLInventoryType::IT_TEXTURE,
|
||||
@@ -240,7 +248,7 @@ LLGroupNotifyBox::LLGroupNotifyBox(const std::string& subject,
|
||||
S32 btn_width = 80;
|
||||
S32 wide_btn_width = 136;
|
||||
LLRect btn_rect;
|
||||
x = 3 * HPAD;
|
||||
x = 2 * HPAD;
|
||||
|
||||
btn_rect.setOriginAndSize(x,
|
||||
BOTTOM_PAD,
|
||||
@@ -364,10 +372,10 @@ bool LLGroupNotifyBox::onNewNotification(const LLSD& notify)
|
||||
|
||||
gNotifyBoxView->addChild(new LLGroupNotifyBox(payload["subject"].asString(),
|
||||
payload["message"].asString(),
|
||||
payload["sender_name"].asString(),
|
||||
payload.has("sender_id") ? LLAvatarActions::getSLURL(payload["sender_id"]) : payload["sender_name"].asString(),
|
||||
payload["group_id"].asUUID(),
|
||||
group_data.mInsigniaID,
|
||||
group_data.mName,
|
||||
LLGroupActions::getSLURL(payload["group_id"].asUUID()),
|
||||
notification->getDate(),
|
||||
payload["inventory_offer"].isDefined(),
|
||||
payload["inventory_name"].asString(),
|
||||
|
||||
@@ -375,9 +375,7 @@ LLFloaterIMPanel::LLFloaterIMPanel(
|
||||
|
||||
if ( gSavedPerAccountSettings.getBOOL("LogShowHistory") )
|
||||
{
|
||||
LLLogChat::loadHistory(mLogLabel,
|
||||
&chatFromLogFile,
|
||||
(void *)this);
|
||||
LLLogChat::loadHistory(mLogLabel, mSessionType == P2P_SESSION ? mOtherParticipantUUID : mSessionUUID, boost::bind(&LLFloaterIMPanel::chatFromLogFile, this, _1, _2));
|
||||
}
|
||||
|
||||
if ( !mSessionInitialized )
|
||||
@@ -801,7 +799,7 @@ void LLFloaterIMPanel::addHistoryLine(const std::string &utf8msg, LLColor4 incol
|
||||
// Now we're adding the actual line of text, so erase the
|
||||
// "Foo is typing..." text segment, and the optional timestamp
|
||||
// if it was present. JC
|
||||
removeTypingIndicator(NULL);
|
||||
removeTypingIndicator(source);
|
||||
|
||||
// Actually add the line
|
||||
bool prepend_newline = true;
|
||||
@@ -861,7 +859,7 @@ void LLFloaterIMPanel::addHistoryLine(const std::string &utf8msg, LLColor4 incol
|
||||
// Floater title contains display name -> bad idea to use that as filename
|
||||
// mLogLabel, however, is the old legacy name
|
||||
//LLLogChat::saveHistory(getTitle(),histstr);
|
||||
LLLogChat::saveHistory(mLogLabel, histstr);
|
||||
LLLogChat::saveHistory(mLogLabel, mSessionType == P2P_SESSION ? mOtherParticipantUUID : mSessionUUID, histstr);
|
||||
// [/Ansariel: Display name support]
|
||||
}
|
||||
|
||||
@@ -1179,9 +1177,9 @@ void LLFloaterIMPanel::onFlyoutCommit(LLComboBox* flyout, const LLSD& value)
|
||||
}
|
||||
}
|
||||
|
||||
void show_log_browser(const std::string& name, const std::string& id)
|
||||
void show_log_browser(const std::string& name, const LLUUID& id)
|
||||
{
|
||||
const std::string file(LLLogChat::makeLogFileName(name));
|
||||
const std::string file(LLLogChat::makeLogFileName(name, id));
|
||||
if (!LLFile::isfile(file))
|
||||
{
|
||||
make_ui_sound("UISndBadKeystroke");
|
||||
@@ -1195,7 +1193,7 @@ void show_log_browser(const std::string& name, const std::string& id)
|
||||
}
|
||||
LLFloaterWebContent::Params p;
|
||||
p.url("file:///" + file);
|
||||
p.id(id);
|
||||
p.id(id.asString());
|
||||
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.
|
||||
@@ -1206,8 +1204,8 @@ void LLFloaterIMPanel::onClickHistory()
|
||||
if (mOtherParticipantUUID.notNull())
|
||||
{
|
||||
// [Ansariel: Display name support]
|
||||
//show_log_browser(getTitle(), mOtherParticipantUUID.asString());
|
||||
show_log_browser(mLogLabel, mOtherParticipantUUID.asString());
|
||||
//show_log_browser(getTitle(), mSessionType == P2P_SESSION ? mOtherParticipantUUID : mSessionUUID);
|
||||
show_log_browser(mLogLabel, mSessionType == P2P_SESSION ? mOtherParticipantUUID : mSessionUUID);
|
||||
// [/Ansariel: Display name support]
|
||||
}
|
||||
}
|
||||
@@ -1458,7 +1456,7 @@ void LLFloaterIMPanel::onSendMsg()
|
||||
|
||||
bool other_was_typing = mOtherTyping;
|
||||
addHistoryLine(utf8_text, gSavedSettings.getColor("UserChatColor"), true, gAgentID, name);
|
||||
if (other_was_typing) addTypingIndicator(mOtherTypingName);
|
||||
if (other_was_typing) addTypingIndicator(mOtherParticipantUUID);
|
||||
}
|
||||
}
|
||||
else
|
||||
@@ -1588,90 +1586,99 @@ void LLFloaterIMPanel::sendTypingState(bool typing)
|
||||
}
|
||||
|
||||
|
||||
void LLFloaterIMPanel::processIMTyping(const LLIMInfo* im_info, bool typing)
|
||||
void LLFloaterIMPanel::processIMTyping(const LLUUID& from_id, BOOL typing)
|
||||
{
|
||||
if (typing)
|
||||
{
|
||||
// other user started typing
|
||||
std::string name;
|
||||
if (!LLAvatarNameCache::getNSName(im_info->mFromID, name)) name = im_info->mName;
|
||||
addTypingIndicator(name);
|
||||
addTypingIndicator(from_id);
|
||||
}
|
||||
else
|
||||
{
|
||||
// other user stopped typing
|
||||
removeTypingIndicator(im_info);
|
||||
removeTypingIndicator(from_id);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
void LLFloaterIMPanel::addTypingIndicator(const std::string &name)
|
||||
void LLFloaterIMPanel::addTypingIndicator(const LLUUID& from_id)
|
||||
{
|
||||
// we may have lost a "stop-typing" packet, don't add it twice
|
||||
if (!mOtherTyping)
|
||||
// Singu TODO: Actually implement this?
|
||||
/* Operation of "<name> is typing" state machine:
|
||||
Not Typing state:
|
||||
|
||||
User types in P2P IM chat ... Send Start Typing, save Started time,
|
||||
start Idle Timer (N seconds) go to Typing state
|
||||
|
||||
Typing State:
|
||||
|
||||
User enters a non-return character: if Now - Started > ME_TYPING_TIMEOUT, send
|
||||
Start Typing, restart Idle Timer
|
||||
User enters a return character: stop Idle Timer, send IM and Stop
|
||||
Typing, go to Not Typing state
|
||||
Idle Timer expires: send Stop Typing, go to Not Typing state
|
||||
|
||||
The recipient has a complementary state machine in which a Start Typing
|
||||
that is not followed by either an IM or another Start Typing within OTHER_TYPING_TIMEOUT
|
||||
seconds switches the sender out of typing state.
|
||||
|
||||
This has the nice quality of being self-healing for lost start/stop
|
||||
messages while adding messages only for the (relatively rare) case of a
|
||||
user who types a very long message (one that takes more than ME_TYPING_TIMEOUT seconds
|
||||
to type).
|
||||
|
||||
Note: OTHER_TYPING_TIMEOUT must be > ME_TYPING_TIMEOUT for proper operation of the state machine
|
||||
|
||||
*/
|
||||
|
||||
// We may have lost a "stop-typing" packet, don't add it twice
|
||||
if (from_id.notNull() && !mOtherTyping)
|
||||
{
|
||||
mOtherTyping = true;
|
||||
// Save im_info so that removeTypingIndicator can be properly called because a timeout has occurred
|
||||
LLAvatarNameCache::getNSName(from_id, mOtherTypingName);
|
||||
|
||||
mTypingLineStartIndex = mHistoryEditor->getWText().length();
|
||||
LLUIString typing_start = sTypingStartString;
|
||||
typing_start.setArg("[NAME]", name);
|
||||
typing_start.setArg("[NAME]", mOtherTypingName);
|
||||
addHistoryLine(typing_start, gSavedSettings.getColor4("SystemChatColor"), false);
|
||||
mOtherTypingName = name;
|
||||
mOtherTyping = true;
|
||||
|
||||
// Update speaker
|
||||
LLIMSpeakerMgr* speaker_mgr = mSpeakers;
|
||||
if ( speaker_mgr )
|
||||
{
|
||||
speaker_mgr->setSpeakerTyping(from_id, TRUE);
|
||||
}
|
||||
mOtherTyping = true; // addHistoryLine clears this flag. Set it again.
|
||||
}
|
||||
// MBW -- XXX -- merge from release broke this (argument to this function changed from an LLIMInfo to a name)
|
||||
// Richard will fix.
|
||||
// mSpeakers->setSpeakerTyping(im_info->mFromID, TRUE);
|
||||
}
|
||||
|
||||
|
||||
void LLFloaterIMPanel::removeTypingIndicator(const LLIMInfo* im_info)
|
||||
void LLFloaterIMPanel::removeTypingIndicator(const LLUUID& from_id)
|
||||
{
|
||||
if (mOtherTyping)
|
||||
{
|
||||
// Must do this first, otherwise addHistoryLine calls us again.
|
||||
mOtherTyping = false;
|
||||
|
||||
S32 chars_to_remove = mHistoryEditor->getWText().length() - mTypingLineStartIndex;
|
||||
mHistoryEditor->removeTextFromEnd(chars_to_remove);
|
||||
if (im_info)
|
||||
|
||||
if (from_id.notNull())
|
||||
{
|
||||
mSpeakers->setSpeakerTyping(im_info->mFromID, FALSE);
|
||||
mSpeakers->setSpeakerTyping(from_id, FALSE);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
//static
|
||||
void LLFloaterIMPanel::chatFromLogFile(LLLogChat::ELogLineType type, std::string line, void* userdata)
|
||||
void LLFloaterIMPanel::chatFromLogFile(LLLogChat::ELogLineType type, const std::string& line)
|
||||
{
|
||||
LLFloaterIMPanel* self = (LLFloaterIMPanel*)userdata;
|
||||
std::string message = line;
|
||||
|
||||
switch (type)
|
||||
bool log_line = type == LLLogChat::LOG_LINE;
|
||||
if (log_line || gSavedPerAccountSettings.getBOOL("LogInstantMessages"))
|
||||
{
|
||||
case LLLogChat::LOG_EMPTY:
|
||||
// add warning log enabled message
|
||||
if (gSavedPerAccountSettings.getBOOL("LogInstantMessages"))
|
||||
{
|
||||
message = LLFloaterChat::getInstance()->getString("IM_logging_string");
|
||||
}
|
||||
break;
|
||||
case LLLogChat::LOG_END:
|
||||
// add log end message
|
||||
if (gSavedPerAccountSettings.getBOOL("LogInstantMessages"))
|
||||
{
|
||||
message = LLFloaterChat::getInstance()->getString("IM_end_log_string");
|
||||
}
|
||||
break;
|
||||
case LLLogChat::LOG_LINE:
|
||||
// just add normal lines from file
|
||||
break;
|
||||
default:
|
||||
// nothing
|
||||
break;
|
||||
LLStyleSP style(new LLStyle(true, gSavedSettings.getColor4("LogChatColor"), LLStringUtil::null));
|
||||
mHistoryEditor->appendText(log_line ? line :
|
||||
getString(type == LLLogChat::LOG_END ? "IM_end_log_string" : "IM_logging_string"),
|
||||
false, true, style, false);
|
||||
}
|
||||
|
||||
//self->addHistoryLine(line, LLColor4::grey, FALSE);
|
||||
LLStyleSP style(new LLStyle(true, gSavedSettings.getColor4("LogChatColor"), LLStringUtil::null));
|
||||
self->mHistoryEditor->appendText(message, false, true, style, false);
|
||||
}
|
||||
|
||||
void LLFloaterIMPanel::showSessionStartError(
|
||||
|
||||
@@ -39,7 +39,6 @@
|
||||
|
||||
class LLAvatarName;
|
||||
class LLIMSpeakerMgr;
|
||||
class LLIMInfo;
|
||||
class LLInventoryCategory;
|
||||
class LLInventoryItem;
|
||||
class LLLineEditor;
|
||||
@@ -126,8 +125,8 @@ public:
|
||||
void sessionInitReplyReceived(const LLUUID& im_session_id);
|
||||
|
||||
// Handle other participant in the session typing.
|
||||
void processIMTyping(const LLIMInfo* im_info, bool typing);
|
||||
static void chatFromLogFile(LLLogChat::ELogLineType type, std::string line, void* userdata);
|
||||
void processIMTyping(const LLUUID& from_id, BOOL typing);
|
||||
void chatFromLogFile(LLLogChat::ELogLineType type, const std::string& line);
|
||||
|
||||
//show error statuses to the user
|
||||
void showSessionStartError(const std::string& error_string);
|
||||
@@ -177,10 +176,10 @@ private:
|
||||
void setTyping(bool typing);
|
||||
|
||||
// Add the "User is typing..." indicator.
|
||||
void addTypingIndicator(const std::string &name);
|
||||
void addTypingIndicator(const LLUUID& from_id);
|
||||
|
||||
// Remove the "User is typing..." indicator.
|
||||
void removeTypingIndicator(const LLIMInfo* im_info);
|
||||
void removeTypingIndicator(const LLUUID& from_id = LLUUID::null);
|
||||
|
||||
void sendTypingState(bool typing);
|
||||
|
||||
|
||||
@@ -514,22 +514,22 @@ bool group_vote_callback(const LLSD& notification, const LLSD& response)
|
||||
}
|
||||
static LLNotificationFunctorRegistration group_vote_callback_reg("GroupVote", group_vote_callback);
|
||||
|
||||
void LLIMProcessing::processNewMessage(LLUUID from_id,
|
||||
void LLIMProcessing::processNewMessage(const LLUUID& from_id,
|
||||
BOOL from_group,
|
||||
LLUUID to_id,
|
||||
const LLUUID& to_id,
|
||||
U8 offline,
|
||||
EInstantMessage dialog, // U8
|
||||
LLUUID session_id,
|
||||
const LLUUID& session_id,
|
||||
U32 timestamp,
|
||||
std::string name,
|
||||
std::string message,
|
||||
std::string& name,
|
||||
std::string& message,
|
||||
U32 parent_estate_id,
|
||||
LLUUID region_id,
|
||||
const LLUUID& region_id,
|
||||
LLVector3 position,
|
||||
U8 *binary_bucket,
|
||||
S32 binary_bucket_size,
|
||||
LLHost &sender,
|
||||
LLUUID aux_id)
|
||||
const LLUUID& aux_id)
|
||||
{
|
||||
LLChat chat;
|
||||
std::string buffer;
|
||||
@@ -566,6 +566,10 @@ void LLIMProcessing::processNewMessage(LLUUID from_id,
|
||||
// object IMs contain sender object id in session_id (STORM-1209)
|
||||
|| (chat.mSourceType == CHAT_SOURCE_OBJECT && LLMuteList::getInstance()->isMuted(session_id));
|
||||
|
||||
// Singu Note: Try to get Owner whenever possible, here owner is the from id
|
||||
if (chat.mSourceType == CHAT_SOURCE_OBJECT && session_id.notNull())
|
||||
if (auto obj = gObjectList.findObject(session_id)) obj->mOwnerID = from_id;
|
||||
|
||||
bool is_linden = chat.mSourceType != CHAT_SOURCE_OBJECT &&
|
||||
LLMuteList::getInstance()->isLinden(name);
|
||||
chat.mMuted = is_muted && !is_linden;
|
||||
@@ -637,8 +641,7 @@ void LLIMProcessing::processNewMessage(LLUUID from_id,
|
||||
{
|
||||
RlvUtil::sendBusyMessage(from_id, RlvStrings::getVersion(), session_id);
|
||||
// We won't receive a typing stop message, so do that manually (see comment at the end of LLFloaterIMPanel::sendMsg)
|
||||
LLPointer<LLIMInfo> im_info = new LLIMInfo(gMessageSystem);
|
||||
gIMMgr->processIMTypingStop(im_info);
|
||||
gIMMgr->processIMTypingStop(from_id, dialog);
|
||||
}
|
||||
// [/RLVa:KB]
|
||||
else if (offline == IM_ONLINE
|
||||
@@ -914,16 +917,15 @@ void LLIMProcessing::processNewMessage(LLUUID from_id,
|
||||
autoresponder_finish(show_autoresponded, session_id, from_id, name, itemid, is_muted);
|
||||
}
|
||||
}
|
||||
LLPointer<LLIMInfo> im_info = new LLIMInfo(gMessageSystem);
|
||||
gIMMgr->processIMTypingStart(im_info);
|
||||
|
||||
gIMMgr->processIMTypingStart(from_id, dialog);
|
||||
script_msg_api(from_id.asString() + ", 4");
|
||||
}
|
||||
break;
|
||||
|
||||
case IM_TYPING_STOP:
|
||||
{
|
||||
LLPointer<LLIMInfo> im_info = new LLIMInfo(gMessageSystem);
|
||||
gIMMgr->processIMTypingStop(im_info);
|
||||
gIMMgr->processIMTypingStop(from_id, dialog);
|
||||
script_msg_api(from_id.asString() + ", 5");
|
||||
}
|
||||
break;
|
||||
@@ -1838,7 +1840,7 @@ void LLIMProcessing::processNewMessage(LLUUID from_id,
|
||||
strings.push_back(from_id.asString());
|
||||
send_generic_message("requestonlinenotification", strings);
|
||||
|
||||
args["NAME"] = name;
|
||||
args["NAME"] = LLAvatarActions::getSLURL(from_id);
|
||||
LLSD payload;
|
||||
payload["from_id"] = from_id;
|
||||
LLAvatarNameCache::get(from_id, boost::bind(¬ification_display_name_callback, _1, _2, "FriendshipAccepted", args, payload));
|
||||
@@ -1967,6 +1969,8 @@ void LLIMProcessing::requestOfflineMessagesCoro(const LLCoroResponder& responder
|
||||
from_group = message_data["from_group"].asString() == "Y";
|
||||
}
|
||||
|
||||
auto agentName = message_data["from_agent_name"].asString();
|
||||
auto message = message_data["message"].asString();
|
||||
LLIMProcessing::processNewMessage(message_data["from_agent_id"].asUUID(),
|
||||
from_group,
|
||||
message_data["to_agent_id"].asUUID(),
|
||||
@@ -1974,8 +1978,8 @@ void LLIMProcessing::requestOfflineMessagesCoro(const LLCoroResponder& responder
|
||||
(EInstantMessage)message_data["dialog"].asInteger(),
|
||||
LLUUID::null, // session id, since there is none we can only use frienship/group invite caps
|
||||
message_data["timestamp"].asInteger(),
|
||||
message_data["from_agent_name"].asString(),
|
||||
message_data["message"].asString(),
|
||||
agentName,
|
||||
message,
|
||||
parent_estate_id,
|
||||
message_data["region_id"].asUUID(),
|
||||
position,
|
||||
|
||||
@@ -38,22 +38,22 @@ class LLIMProcessing
|
||||
{
|
||||
public:
|
||||
// Pre-process message for IM manager
|
||||
static void processNewMessage(LLUUID from_id,
|
||||
static void processNewMessage(const LLUUID& from_id,
|
||||
BOOL from_group,
|
||||
LLUUID to_id,
|
||||
const LLUUID& to_id,
|
||||
U8 offline,
|
||||
EInstantMessage dialog, // U8
|
||||
LLUUID session_id,
|
||||
const LLUUID& session_id,
|
||||
U32 timestamp,
|
||||
std::string agentName,
|
||||
std::string message,
|
||||
std::string& agentName,
|
||||
std::string& message,
|
||||
U32 parent_estate_id,
|
||||
LLUUID region_id,
|
||||
const LLUUID& region_id,
|
||||
LLVector3 position,
|
||||
U8 *binary_bucket,
|
||||
S32 binary_bucket_size,
|
||||
LLHost &sender,
|
||||
LLUUID aux_id = LLUUID::null);
|
||||
const LLUUID& aux_id = LLUUID::null);
|
||||
|
||||
// Either receives list of offline messages from 'ReadOfflineMsgs' capability
|
||||
// or uses legacy method
|
||||
|
||||
@@ -1138,23 +1138,23 @@ void LLIMMgr::noteMutedUsers(LLFloaterIMPanel* floater,
|
||||
}
|
||||
}
|
||||
|
||||
void LLIMMgr::processIMTypingStart(const LLIMInfo* im_info)
|
||||
void LLIMMgr::processIMTypingStart(const LLUUID& from_id, const EInstantMessage im_type)
|
||||
{
|
||||
processIMTypingCore(im_info, TRUE);
|
||||
processIMTypingCore(from_id, im_type, TRUE);
|
||||
}
|
||||
|
||||
void LLIMMgr::processIMTypingStop(const LLIMInfo* im_info)
|
||||
void LLIMMgr::processIMTypingStop(const LLUUID& from_id, const EInstantMessage im_type)
|
||||
{
|
||||
processIMTypingCore(im_info, FALSE);
|
||||
processIMTypingCore(from_id, im_type, FALSE);
|
||||
}
|
||||
|
||||
void LLIMMgr::processIMTypingCore(const LLIMInfo* im_info, BOOL typing)
|
||||
void LLIMMgr::processIMTypingCore(const LLUUID& from_id, const EInstantMessage im_type, BOOL typing)
|
||||
{
|
||||
LLUUID session_id = computeSessionID(im_info->mIMType, im_info->mFromID);
|
||||
LLFloaterIMPanel* floater = findFloaterBySession(session_id);
|
||||
if (floater)
|
||||
LLUUID session_id = computeSessionID(im_type, from_id);
|
||||
LLFloaterIMPanel* im_floater = findFloaterBySession(session_id);
|
||||
if (im_floater)
|
||||
{
|
||||
floater->processIMTyping(im_info, typing);
|
||||
im_floater->processIMTyping(from_id, typing);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1275,10 +1275,10 @@ LLFloaterChatterBox* LLIMMgr::getFloater()
|
||||
return LLFloaterChatterBox::getInstance(LLSD());
|
||||
}
|
||||
|
||||
class LLViewerChatterBoxSessionStartReply : public LLHTTPNode
|
||||
class LLViewerChatterBoxSessionStartReply final : public LLHTTPNode
|
||||
{
|
||||
public:
|
||||
virtual void describe(Description& desc) const
|
||||
void describe(Description& desc) const override
|
||||
{
|
||||
desc.shortInfo("Used for receiving a reply to a request to initialize an ChatterBox session");
|
||||
desc.postAPI();
|
||||
@@ -1287,18 +1287,15 @@ public:
|
||||
desc.source(__FILE__, __LINE__);
|
||||
}
|
||||
|
||||
virtual void post(ResponsePtr response,
|
||||
void post(ResponsePtr response,
|
||||
const LLSD& context,
|
||||
const LLSD& input) const
|
||||
const LLSD& input) const override
|
||||
{
|
||||
LLSD body;
|
||||
LLUUID temp_session_id;
|
||||
LLUUID session_id;
|
||||
bool success;
|
||||
|
||||
body = input["body"];
|
||||
success = body["success"].asBoolean();
|
||||
temp_session_id = body["temp_session_id"].asUUID();
|
||||
LLSD body = input["body"];
|
||||
bool success = body["success"].asBoolean();
|
||||
LLUUID temp_session_id = body["temp_session_id"].asUUID();
|
||||
|
||||
if ( success )
|
||||
{
|
||||
@@ -1336,10 +1333,10 @@ public:
|
||||
}
|
||||
};
|
||||
|
||||
class LLViewerChatterBoxSessionEventReply : public LLHTTPNode
|
||||
class LLViewerChatterBoxSessionEventReply final : public LLHTTPNode
|
||||
{
|
||||
public:
|
||||
virtual void describe(Description& desc) const
|
||||
void describe(Description& desc) const override
|
||||
{
|
||||
desc.shortInfo("Used for receiving a reply to a ChatterBox session event");
|
||||
desc.postAPI();
|
||||
@@ -1348,24 +1345,18 @@ public:
|
||||
desc.source(__FILE__, __LINE__);
|
||||
}
|
||||
|
||||
virtual void post(ResponsePtr response,
|
||||
void post(ResponsePtr response,
|
||||
const LLSD& context,
|
||||
const LLSD& input) const
|
||||
const LLSD& input) const override
|
||||
{
|
||||
LLUUID session_id;
|
||||
bool success;
|
||||
|
||||
LLSD body = input["body"];
|
||||
success = body["success"].asBoolean();
|
||||
session_id = body["session_id"].asUUID();
|
||||
bool success = body["success"].asBoolean();
|
||||
LLUUID session_id = body["session_id"].asUUID();
|
||||
|
||||
if ( !success )
|
||||
{
|
||||
//throw an error dialog
|
||||
LLFloaterIMPanel* floater =
|
||||
gIMMgr->findFloaterBySession(session_id);
|
||||
|
||||
if (floater)
|
||||
if (auto* floater = gIMMgr->findFloaterBySession(session_id))
|
||||
{
|
||||
floater->showSessionEventError(
|
||||
body["event"].asString(),
|
||||
@@ -1378,46 +1369,40 @@ public:
|
||||
class LLViewerForceCloseChatterBoxSession: public LLHTTPNode
|
||||
{
|
||||
public:
|
||||
virtual void post(ResponsePtr response,
|
||||
void post(ResponsePtr response,
|
||||
const LLSD& context,
|
||||
const LLSD& input) const
|
||||
const LLSD& input) const override
|
||||
{
|
||||
LLUUID session_id;
|
||||
std::string reason;
|
||||
LLUUID session_id = input["body"]["session_id"].asUUID();
|
||||
std::string reason = input["body"]["reason"].asString();
|
||||
|
||||
session_id = input["body"]["session_id"].asUUID();
|
||||
reason = input["body"]["reason"].asString();
|
||||
|
||||
LLFloaterIMPanel* floater =
|
||||
gIMMgr ->findFloaterBySession(session_id);
|
||||
|
||||
if ( floater )
|
||||
if (auto* floater = gIMMgr ->findFloaterBySession(session_id))
|
||||
{
|
||||
floater->showSessionForceClose(reason);
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
class LLViewerChatterBoxSessionAgentListUpdates : public LLHTTPNode
|
||||
class LLViewerChatterBoxSessionAgentListUpdates final : public LLHTTPNode
|
||||
{
|
||||
public:
|
||||
virtual void post(
|
||||
void post(
|
||||
ResponsePtr responder,
|
||||
const LLSD& context,
|
||||
const LLSD& input) const
|
||||
const LLSD& input) const override
|
||||
{
|
||||
const LLUUID& session_id = input["body"]["session_id"].asUUID();
|
||||
gIMMgr->processAgentListUpdates(session_id, input["body"]);
|
||||
}
|
||||
};
|
||||
|
||||
class LLViewerChatterBoxSessionUpdate : public LLHTTPNode
|
||||
class LLViewerChatterBoxSessionUpdate final : public LLHTTPNode
|
||||
{
|
||||
public:
|
||||
virtual void post(
|
||||
void post(
|
||||
ResponsePtr responder,
|
||||
const LLSD& context,
|
||||
const LLSD& input) const
|
||||
const LLSD& input) const override
|
||||
{
|
||||
LLUUID session_id = input["body"]["session_id"].asUUID();
|
||||
LLFloaterIMPanel* im_floater = gIMMgr->findFloaterBySession(session_id);
|
||||
@@ -1445,14 +1430,14 @@ void leave_group_chat(const LLUUID& from_id, const LLUUID& session_id)
|
||||
gIMMgr->removeSession(session_id);
|
||||
}
|
||||
|
||||
class LLViewerChatterBoxInvitation : public LLHTTPNode
|
||||
class LLViewerChatterBoxInvitation final : public LLHTTPNode
|
||||
{
|
||||
public:
|
||||
|
||||
virtual void post(
|
||||
void post(
|
||||
ResponsePtr response,
|
||||
const LLSD& context,
|
||||
const LLSD& input) const
|
||||
const LLSD& input) const override
|
||||
{
|
||||
//for backwards compatiblity reasons...we need to still
|
||||
//check for 'text' or 'voice' invitations...bleh
|
||||
@@ -1582,10 +1567,9 @@ public:
|
||||
LLFloaterChat::addChat(chat, TRUE, is_this_agent);
|
||||
|
||||
//K now we want to accept the invitation
|
||||
std::string url = gAgent.getRegion()->getCapability(
|
||||
"ChatSessionRequest");
|
||||
std::string url = gAgent.getRegionCapability("ChatSessionRequest");
|
||||
|
||||
if ( url != "" )
|
||||
if (!url.empty())
|
||||
{
|
||||
LLSD data;
|
||||
data["method"] = "accept invitation";
|
||||
|
||||
@@ -42,7 +42,7 @@
|
||||
class LLFloaterChatterBox;
|
||||
class LLFloaterIMPanel;
|
||||
|
||||
class LLIMMgr : public LLSingleton<LLIMMgr>
|
||||
class LLIMMgr final : public LLSingleton<LLIMMgr>
|
||||
{
|
||||
public:
|
||||
enum EInvitationType
|
||||
@@ -121,8 +121,8 @@ public:
|
||||
void updateFloaterSessionID(const LLUUID& old_session_id,
|
||||
const LLUUID& new_session_id);
|
||||
|
||||
void processIMTypingStart(const LLIMInfo* im_info);
|
||||
void processIMTypingStop(const LLIMInfo* im_info);
|
||||
void processIMTypingStart(const LLUUID& from_id, const EInstantMessage im_type);
|
||||
void processIMTypingStop(const LLUUID& from_id, const EInstantMessage im_type);
|
||||
|
||||
void clearNewIMNotification();
|
||||
|
||||
@@ -209,7 +209,7 @@ private:
|
||||
void noteOfflineUsers(LLFloaterIMPanel* panel, const uuid_vec_t& ids);
|
||||
void noteMutedUsers(LLFloaterIMPanel* panel, const uuid_vec_t& ids);
|
||||
|
||||
void processIMTypingCore(const LLIMInfo* im_info, BOOL typing);
|
||||
void processIMTypingCore(const LLUUID& from_id, const EInstantMessage im_type, BOOL typing);
|
||||
|
||||
private:
|
||||
std::set<LLHandle<LLFloater> > mFloaters;
|
||||
|
||||
@@ -36,6 +36,7 @@
|
||||
|
||||
#include "lffloaterinvpanel.h"
|
||||
#include "llagent.h"
|
||||
#include "llagentbenefits.h"
|
||||
#include "llagentcamera.h"
|
||||
#include "llagentwearables.h"
|
||||
#include "llappearancemgr.h"
|
||||
@@ -3888,6 +3889,9 @@ void build_context_menu_folder_options(LLInventoryModel* model, const LLUUID& mU
|
||||
const LLInventoryCategory* category = model->getCategory(mUUID);
|
||||
if(!category) return;
|
||||
|
||||
items.push_back(std::string("Open Folder In New Window"));
|
||||
items.push_back(std::string("Copy Folder UUID"));
|
||||
|
||||
const LLUUID trash_id = model->findCategoryUUIDForType(LLFolderType::FT_TRASH);
|
||||
if (trash_id == mUUID) return;
|
||||
if (model->isObjectDescendentOf(mUUID, trash_id)) return;
|
||||
@@ -3901,9 +3905,6 @@ void build_context_menu_folder_options(LLInventoryModel* model, const LLUUID& mU
|
||||
const LLUUID listings_folder = gInventory.findCategoryUUIDForType(LLFolderType::FT_MARKETPLACE_LISTINGS, false);
|
||||
if (listings_folder.notNull() && gInventory.isObjectDescendentOf(mUUID, listings_folder)) return;
|
||||
|
||||
items.push_back(std::string("Open Folder In New Window"));
|
||||
items.push_back(std::string("Copy Folder UUID"));
|
||||
|
||||
LLFolderType::EType type = category->getPreferredType();
|
||||
const bool is_system_folder = LLFolderType::lookupIsProtectedType(type);
|
||||
// calling card related functionality for folders.
|
||||
@@ -6050,7 +6051,7 @@ bool confirm_attachment_rez(const LLSD& notification, const LLSD& response)
|
||||
if (!gAgentAvatarp->canAttachMoreObjects())
|
||||
{
|
||||
LLSD args;
|
||||
args["MAX_ATTACHMENTS"] = llformat("%d", MAX_AGENT_ATTACHMENTS);
|
||||
args["MAX_ATTACHMENTS"] = llformat("%d", LLAgentBenefitsMgr::current().getAttachmentLimit());
|
||||
LLNotificationsUtil::add("MaxAttachmentsOnOutfit", args);
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -36,35 +36,100 @@
|
||||
#include "lllogchat.h"
|
||||
#include "llappviewer.h"
|
||||
#include "llfloaterchat.h"
|
||||
#include "llsdserialize.h"
|
||||
|
||||
static std::string get_log_dir_file(const std::string& filename)
|
||||
{
|
||||
return gDirUtilp->getExpandedFilename(LL_PATH_PER_ACCOUNT_CHAT_LOGS, filename);
|
||||
}
|
||||
|
||||
//static
|
||||
std::string LLLogChat::makeLogFileName(std::string filename)
|
||||
std::string LLLogChat::makeLogFileNameInternal(std::string filename)
|
||||
{
|
||||
if (gSavedPerAccountSettings.getBOOL("LogFileNamewithDate"))
|
||||
static const LLCachedControl<bool> with_date(gSavedPerAccountSettings, "LogFileNamewithDate");
|
||||
if (with_date)
|
||||
{
|
||||
time_t now;
|
||||
time(&now);
|
||||
char dbuffer[100]; /* Flawfinder: ignore */
|
||||
if (filename == "chat")
|
||||
{
|
||||
static const LLCachedControl<std::string> local_chat_date_format(gSavedPerAccountSettings, "LogFileLocalChatDateFormat", "-%Y-%m-%d");
|
||||
strftime(dbuffer, 100, local_chat_date_format().c_str(), localtime(&now));
|
||||
}
|
||||
else
|
||||
{
|
||||
static const LLCachedControl<std::string> ims_date_format(gSavedPerAccountSettings, "LogFileIMsDateFormat", "-%Y-%m");
|
||||
strftime(dbuffer, 100, ims_date_format().c_str(), localtime(&now));
|
||||
}
|
||||
filename += dbuffer;
|
||||
std::array<char, 100> dbuffer;
|
||||
static const LLCachedControl<std::string> local_chat_date_format(gSavedPerAccountSettings, "LogFileLocalChatDateFormat", "-%Y-%m-%d");
|
||||
static const LLCachedControl<std::string> ims_date_format(gSavedPerAccountSettings, "LogFileIMsDateFormat", "-%Y-%m");
|
||||
strftime(dbuffer.data(), dbuffer.size(), (filename == "chat" ? local_chat_date_format : ims_date_format)().c_str(), localtime(&now));
|
||||
filename += dbuffer.data();
|
||||
}
|
||||
cleanFileName(filename);
|
||||
return get_log_dir_file(filename + ".txt");
|
||||
}
|
||||
|
||||
static LLSD sIDMap;
|
||||
|
||||
static std::string get_ids_map_file() { return get_log_dir_file("ids_to_names.json"); }
|
||||
void LLLogChat::initializeIDMap()
|
||||
{
|
||||
const auto map_file = get_ids_map_file();
|
||||
if (LLFile::isfile(map_file)) // If we've already made this file, load our map from it
|
||||
{
|
||||
if (auto&& fstr = llifstream(map_file))
|
||||
{
|
||||
LLSDSerialize::fromNotation(sIDMap, fstr, LLSDSerialize::SIZE_UNLIMITED);
|
||||
fstr.close();
|
||||
}
|
||||
}
|
||||
else if (gCacheName) // Load what we can from name cache to initialize the map file
|
||||
{
|
||||
for (const auto& r : gCacheName->getReverseMap()) // For every name id pair
|
||||
if (LLFile::isfile(makeLogFileNameInternal(r.first))) // If there's a log file for them
|
||||
sIDMap[r.second.asString()] = r.first; // Add them to the map
|
||||
|
||||
if (auto&& fstr = llofstream(map_file))
|
||||
{
|
||||
LLSDSerialize::toPrettyNotation(sIDMap, fstr);
|
||||
fstr.close();
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
//static
|
||||
std::string LLLogChat::makeLogFileName(const std::string& username, const LLUUID& id)
|
||||
{
|
||||
const auto name = username.empty() ? id.asString() : username; // Fall back on ID if the grid sucks and we have no name
|
||||
std::string filename = makeLogFileNameInternal(name);
|
||||
if (id.notNull() && !LLFile::isfile(filename)) // No existing file by this user's current name, check for possible file rename
|
||||
{
|
||||
auto& entry = sIDMap[id.asString()];
|
||||
const bool empty = !entry.size();
|
||||
if (empty || entry != name) // If we haven't seen this entry yet, or the name is different than we remember
|
||||
{
|
||||
const auto migrateFile = [&filename](const std::string& name) {
|
||||
std::string oldname = makeLogFileNameInternal(name);
|
||||
if (!LLFile::isfile(oldname)) return false; // An old file by this name doesn't exist
|
||||
LLFile::rename(oldname, filename); // Move the existing file to the new name
|
||||
return true; // Report success
|
||||
};
|
||||
if (empty) // We didn't see this entry on load
|
||||
{
|
||||
// Ideally, we would look up the old names here via server request
|
||||
// In lieu of that, our reverse cache has old names and new names that we've gained since our initialization of the ID map
|
||||
for (const auto& r : gCacheName->getReverseMap())
|
||||
if (r.second == id && migrateFile(r.first))
|
||||
break;
|
||||
}
|
||||
else migrateFile(entry.asStringRef()); // We've seen this entry before, migrate old file if it exists
|
||||
|
||||
entry = name; // Update the entry to point to the new name
|
||||
|
||||
if (auto&& fstr = llofstream(get_ids_map_file())) // Write back to our map file
|
||||
{
|
||||
LLSDSerialize::toPrettyNotation(sIDMap, fstr);
|
||||
fstr.close();
|
||||
}
|
||||
}
|
||||
}
|
||||
filename = cleanFileName(filename);
|
||||
filename = gDirUtilp->getExpandedFilename(LL_PATH_PER_ACCOUNT_CHAT_LOGS,filename);
|
||||
filename += ".txt";
|
||||
return filename;
|
||||
}
|
||||
|
||||
std::string LLLogChat::cleanFileName(std::string filename)
|
||||
void LLLogChat::cleanFileName(std::string& filename)
|
||||
{
|
||||
std::string invalidChars = "\"\'\\/?*:<>|[]{}~"; // Cannot match glob or illegal filename chars
|
||||
S32 position = filename.find_first_of(invalidChars);
|
||||
@@ -73,7 +138,6 @@ std::string LLLogChat::cleanFileName(std::string filename)
|
||||
filename[position] = '_';
|
||||
position = filename.find_first_of(invalidChars, position);
|
||||
}
|
||||
return filename;
|
||||
}
|
||||
|
||||
static void time_format(std::string& out, const char* fmt, const std::tm* time)
|
||||
@@ -92,6 +156,7 @@ static void time_format(std::string& out, const char* fmt, const std::tm* time)
|
||||
charvector.resize(1+size); // Use the String Stone
|
||||
format_the_time();
|
||||
}
|
||||
#undef format_the_time
|
||||
out.assign(charvector.data());
|
||||
}
|
||||
|
||||
@@ -117,15 +182,15 @@ std::string LLLogChat::timestamp(bool withdate)
|
||||
|
||||
|
||||
//static
|
||||
void LLLogChat::saveHistory(std::string const& filename, std::string line)
|
||||
void LLLogChat::saveHistory(const std::string& name, const LLUUID& id, const std::string& line)
|
||||
{
|
||||
if(!filename.size())
|
||||
if(name.empty() && id.isNull())
|
||||
{
|
||||
LL_INFOS() << "Filename is Empty!" << LL_ENDL;
|
||||
return;
|
||||
}
|
||||
|
||||
LLFILE* fp = LLFile::fopen(LLLogChat::makeLogFileName(filename), "a"); /*Flawfinder: ignore*/
|
||||
LLFILE* fp = LLFile::fopen(LLLogChat::makeLogFileName(name, id), "a"); /*Flawfinder: ignore*/
|
||||
if (!fp)
|
||||
{
|
||||
LL_INFOS() << "Couldn't open chat history log!" << LL_ENDL;
|
||||
@@ -140,10 +205,9 @@ void LLLogChat::saveHistory(std::string const& filename, std::string line)
|
||||
|
||||
static long const LOG_RECALL_BUFSIZ = 2048;
|
||||
|
||||
void LLLogChat::loadHistory(std::string const& filename , void (*callback)(ELogLineType, std::string, void*), void* userdata)
|
||||
void LLLogChat::loadHistory(const std::string& name, const LLUUID& id, std::function<void (ELogLineType, const std::string&)> callback)
|
||||
{
|
||||
bool filename_empty = filename.empty();
|
||||
if (filename_empty)
|
||||
if (name.empty() && id.isNull())
|
||||
{
|
||||
LL_WARNS() << "filename is empty!" << LL_ENDL;
|
||||
}
|
||||
@@ -154,7 +218,7 @@ void LLLogChat::loadHistory(std::string const& filename , void (*callback)(ELogL
|
||||
if (lines == 0) break;
|
||||
|
||||
// Open the log file.
|
||||
LLFILE* fptr = LLFile::fopen(makeLogFileName(filename), "rb");
|
||||
LLFILE* fptr = LLFile::fopen(makeLogFileName(name, id), "rb");
|
||||
if (!fptr) break;
|
||||
|
||||
// Set pos to point to the last character of the file, if any.
|
||||
@@ -199,20 +263,15 @@ void LLLogChat::loadHistory(std::string const& filename , void (*callback)(ELogL
|
||||
// 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);
|
||||
// strip newline chars from the end of the string
|
||||
for (S32 i = strlen(buffer) - 1; i >= 0 && (buffer[i] == '\r' || buffer[i] == '\n'); --i)
|
||||
buffer[i] = '\0';
|
||||
callback(LOG_LINE, buffer);
|
||||
}
|
||||
|
||||
fclose(fptr);
|
||||
callback(LOG_END, LLStringUtil::null, userdata);
|
||||
callback(LOG_END, LLStringUtil::null);
|
||||
return;
|
||||
}
|
||||
callback(LOG_EMPTY, LLStringUtil::null, userdata);
|
||||
callback(LOG_EMPTY, LLStringUtil::null);
|
||||
}
|
||||
|
||||
|
||||
@@ -45,14 +45,15 @@ public:
|
||||
LOG_LINE,
|
||||
LOG_END
|
||||
};
|
||||
static void initializeIDMap();
|
||||
static std::string timestamp(bool withdate = false);
|
||||
static std::string makeLogFileName(std::string filename);
|
||||
static void saveHistory(std::string const& filename, std::string line);
|
||||
static void loadHistory(std::string const& filename,
|
||||
void (*callback)(ELogLineType,std::string,void*),
|
||||
void* userdata);
|
||||
static std::string makeLogFileName(const std::string& name, const LLUUID& id);
|
||||
static void saveHistory(const std::string& name, const LLUUID& id, const std::string& line);
|
||||
static void loadHistory(const std::string& name, const LLUUID& id,
|
||||
std::function<void (ELogLineType, const std::string&)> callback);
|
||||
private:
|
||||
static std::string cleanFileName(std::string filename);
|
||||
static std::string makeLogFileNameInternal(std::string filename);
|
||||
static void cleanFileName(std::string& filename);
|
||||
};
|
||||
|
||||
#endif
|
||||
|
||||
@@ -134,7 +134,7 @@ LLMaterialMgr::~LLMaterialMgr()
|
||||
bool LLMaterialMgr::isGetPending(const LLUUID& region_id, const LLMaterialID& material_id) const
|
||||
{
|
||||
get_pending_map_t::const_iterator itPending = mGetPending.find(pending_material_t(region_id, material_id));
|
||||
return (mGetPending.end() != itPending) && (LLFrameTimer::getTotalSeconds() < itPending->second + MATERIALS_POST_TIMEOUT);
|
||||
return (mGetPending.end() != itPending) && (LLFrameTimer::getTotalSeconds() < itPending->second + F64(MATERIALS_POST_TIMEOUT));
|
||||
}
|
||||
|
||||
void LLMaterialMgr::markGetPending(const LLUUID& region_id, const LLMaterialID& material_id)
|
||||
@@ -270,7 +270,7 @@ boost::signals2::connection LLMaterialMgr::getTE(const LLUUID& region_id, const
|
||||
bool LLMaterialMgr::isGetAllPending(const LLUUID& region_id) const
|
||||
{
|
||||
getall_pending_map_t::const_iterator itPending = mGetAllPending.find(region_id);
|
||||
return (mGetAllPending.end() != itPending) && (LLFrameTimer::getTotalSeconds() < itPending->second + MATERIALS_GET_TIMEOUT);
|
||||
return (mGetAllPending.end() != itPending) && (LLFrameTimer::getTotalSeconds() < itPending->second + F64(MATERIALS_GET_TIMEOUT));
|
||||
}
|
||||
|
||||
void LLMaterialMgr::getAll(const LLUUID& region_id)
|
||||
@@ -583,7 +583,7 @@ void LLMaterialMgr::processGetQueue()
|
||||
{
|
||||
get_queue_t::iterator itRegionQueue = loopRegionQueue++;
|
||||
|
||||
const LLUUID& region_id = itRegionQueue->first;
|
||||
const LLUUID region_id = itRegionQueue->first;
|
||||
if (isGetAllPending(region_id))
|
||||
{
|
||||
continue;
|
||||
@@ -621,12 +621,12 @@ void LLMaterialMgr::processGetQueue()
|
||||
material_queue_t& materials = itRegionQueue->second;
|
||||
U32 max_entries = regionp->getMaxMaterialsPerTransaction();
|
||||
material_queue_t::iterator loopMaterial = materials.begin();
|
||||
while ( (materials.end() != loopMaterial) && (materialsData.size() < (int)max_entries) )
|
||||
while ( (materials.end() != loopMaterial) && ((U32)materialsData.size() < max_entries) )
|
||||
{
|
||||
material_queue_t::iterator itMaterial = loopMaterial++;
|
||||
materialsData.append((*itMaterial).asLLSD());
|
||||
materials.erase(itMaterial);
|
||||
markGetPending(region_id, *itMaterial);
|
||||
materials.erase(itMaterial);
|
||||
}
|
||||
if (materials.empty())
|
||||
{
|
||||
@@ -727,7 +727,7 @@ void LLMaterialMgr::processPutQueue()
|
||||
facematerial_map_t& face_map = itQueue->second;
|
||||
U32 max_entries = regionp->getMaxMaterialsPerTransaction();
|
||||
facematerial_map_t::iterator itFace = face_map.begin();
|
||||
while ( (face_map.end() != itFace) && (facesData.size() < (int)max_entries) )
|
||||
while ( (face_map.end() != itFace) && ((U32)facesData.size() < max_entries) )
|
||||
{
|
||||
LLSD faceData = LLSD::emptyMap();
|
||||
faceData[MATERIALS_CAP_FACE_FIELD] = static_cast<LLSD::Integer>(itFace->first);
|
||||
|
||||
@@ -207,7 +207,10 @@ BOOL LLMediaCtrl::handleScrollWheel( S32 x, S32 y, S32 clicks )
|
||||
{
|
||||
if (LLPanel::handleScrollWheel(x, y, clicks)) return TRUE;
|
||||
if (mMediaSource && mMediaSource->hasMedia())
|
||||
mMediaSource->getMediaPlugin()->scrollEvent(x, y, 0, clicks, gKeyboard->currentMask(TRUE));
|
||||
{
|
||||
convertInputCoords(x, y);
|
||||
mMediaSource->scrollWheel(x, y, 0, clicks, gKeyboard->currentMask(TRUE));
|
||||
}
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
@@ -146,7 +146,7 @@ struct CommWrapper
|
||||
static void toggleInstance(const LLSD& key) { only_comm() ? LLFloaterChatterBox::toggleInstance(key) : LLFloaterMyFriends::toggleInstance(key); }
|
||||
};
|
||||
|
||||
struct MenuFloaterDict : public LLSingleton<MenuFloaterDict>
|
||||
struct MenuFloaterDict final : public LLSingleton<MenuFloaterDict>
|
||||
{
|
||||
typedef std::map<const std::string, std::pair<std::function<void ()>, std::function<bool ()> > > menu_floater_map_t;
|
||||
menu_floater_map_t mEntries;
|
||||
|
||||
@@ -38,7 +38,6 @@
|
||||
#include "lldatapacker.h"
|
||||
#include "llfasttimer.h"
|
||||
#include "llfloaterperms.h"
|
||||
#include "lleconomy.h"
|
||||
#include "llimagej2c.h"
|
||||
#include "llhost.h"
|
||||
#include "llnotificationsutil.h"
|
||||
@@ -66,6 +65,7 @@
|
||||
#include "lluploadfloaterobservers.h"
|
||||
#include "aicurl.h"
|
||||
|
||||
#include <mutex>
|
||||
#include "boost/lexical_cast.hpp"
|
||||
|
||||
#ifndef LL_WINDOWS
|
||||
@@ -742,10 +742,13 @@ void LLMeshRepoThread::lockAndLoadMeshLOD(const LLVolumeParams& mesh_params, S32
|
||||
|
||||
void LLMeshRepoThread::loadMeshLOD(const LLVolumeParams& mesh_params, S32 lod)
|
||||
{ //could be called from any thread
|
||||
std::unique_lock<LLMutex> header_lock(*mHeaderMutex);
|
||||
bool exists = mMeshHeader.find(mesh_params.getSculptID()) != mMeshHeader.end();
|
||||
header_lock.unlock();
|
||||
LLMutexLock lock(mMutex);
|
||||
mesh_header_map::iterator iter = mMeshHeader.find(mesh_params.getSculptID());
|
||||
if (iter != mMeshHeader.end())
|
||||
{ //if we have the header, request LOD byte range
|
||||
if (exists)
|
||||
{
|
||||
//if we have the header, request LOD byte range
|
||||
gMeshRepo.mThread->pushLODRequest(mesh_params, lod, 0.f);
|
||||
LLMeshRepository::sLODProcessing++;
|
||||
}
|
||||
|
||||
@@ -72,7 +72,7 @@ namespace
|
||||
{
|
||||
// This method is used to return an object to mute given an object id.
|
||||
// Its used by the LLMute constructor and LLMuteList::isMuted.
|
||||
LLViewerObject* get_object_to_mute_from_id(LLUUID object_id)
|
||||
LLViewerObject* get_object_to_mute_from_id(const LLUUID& object_id)
|
||||
{
|
||||
LLViewerObject *objectp = gObjectList.findObject(object_id);
|
||||
if ((objectp) && (!objectp->isAvatar()))
|
||||
@@ -91,11 +91,11 @@ namespace
|
||||
class LLDispatchEmptyMuteList : public LLDispatchHandler
|
||||
{
|
||||
public:
|
||||
virtual bool operator()(
|
||||
bool operator()(
|
||||
const LLDispatcher* dispatcher,
|
||||
const std::string& key,
|
||||
const LLUUID& invoice,
|
||||
const sparam_t& strings)
|
||||
const sparam_t& strings) override
|
||||
{
|
||||
LLMuteList::getInstance()->setLoaded();
|
||||
return true;
|
||||
@@ -160,10 +160,10 @@ std::string LLMute::getDisplayType() const
|
||||
LLMuteList* LLMuteList::getInstance()
|
||||
{
|
||||
// Register callbacks at the first time that we find that the message system has been created.
|
||||
static BOOL registered = FALSE;
|
||||
if( !registered && gMessageSystem != NULL)
|
||||
static bool registered = false;
|
||||
if( !registered && gMessageSystem)
|
||||
{
|
||||
registered = TRUE;
|
||||
registered = true;
|
||||
// Register our various callbacks
|
||||
gMessageSystem->setHandlerFuncFast(_PREHASH_MuteListUpdate, processMuteListUpdate);
|
||||
gMessageSystem->setHandlerFuncFast(_PREHASH_UseCachedMuteList, processUseCachedMuteList);
|
||||
@@ -206,7 +206,7 @@ BOOL LLMuteList::isLinden(const std::string& name) const
|
||||
tokenizer::iterator token_iter = tokens.begin();
|
||||
|
||||
if (token_iter == tokens.end()) return FALSE;
|
||||
token_iter++;
|
||||
++token_iter;
|
||||
if (token_iter == tokens.end()) return FALSE;
|
||||
|
||||
std::string last_name = *token_iter;
|
||||
@@ -227,7 +227,7 @@ static LLVOAvatar* find_avatar(const LLUUID& id)
|
||||
}
|
||||
else
|
||||
{
|
||||
return NULL;
|
||||
return nullptr;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -237,6 +237,7 @@ BOOL LLMuteList::add(const LLMute& mute, U32 flags)
|
||||
if ((mute.mType == LLMute::AGENT)
|
||||
&& isLinden(mute.mName) && (flags & LLMute::flagTextChat || flags == 0))
|
||||
{
|
||||
LL_WARNS() << "Trying to mute a Linden; ignored" << LL_ENDL;
|
||||
LLNotifications::instance().add("MuteLinden", LLSD(), LLSD());
|
||||
return FALSE;
|
||||
}
|
||||
@@ -245,6 +246,7 @@ BOOL LLMuteList::add(const LLMute& mute, U32 flags)
|
||||
if (mute.mType == LLMute::AGENT
|
||||
&& mute.mID == gAgent.getID())
|
||||
{
|
||||
LL_WARNS() << "Trying to self; ignored" << LL_ENDL;
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
@@ -275,67 +277,67 @@ BOOL LLMuteList::add(const LLMute& mute, U32 flags)
|
||||
}
|
||||
else
|
||||
{
|
||||
LL_INFOS() << "duplicate mute ignored" << LL_ENDL;
|
||||
// was duplicate
|
||||
return FALSE;
|
||||
}
|
||||
}
|
||||
|
||||
// Need a local (non-const) copy to set up flags properly.
|
||||
LLMute localmute = mute;
|
||||
|
||||
// If an entry for the same entity is already in the list, remove it, saving flags as necessary.
|
||||
mute_set_t::iterator it = mMutes.find(localmute);
|
||||
bool duplicate = it != mMutes.end();
|
||||
if (duplicate)
|
||||
{
|
||||
// This mute is already in the list. Save the existing entry's flags if that's warranted.
|
||||
localmute.mFlags = it->mFlags;
|
||||
|
||||
mMutes.erase(it);
|
||||
// Don't need to call notifyObservers() here, since it will happen after the entry has been re-added below.
|
||||
}
|
||||
else
|
||||
{
|
||||
// Need a local (non-const) copy to set up flags properly.
|
||||
LLMute localmute = mute;
|
||||
|
||||
// If an entry for the same entity is already in the list, remove it, saving flags as necessary.
|
||||
mute_set_t::iterator it = mMutes.find(localmute);
|
||||
if (it != mMutes.end())
|
||||
{
|
||||
// This mute is already in the list. Save the existing entry's flags if that's warranted.
|
||||
localmute.mFlags = it->mFlags;
|
||||
|
||||
mMutes.erase(it);
|
||||
// Don't need to call notifyObservers() here, since it will happen after the entry has been re-added below.
|
||||
}
|
||||
else
|
||||
{
|
||||
// There was no entry in the list previously. Fake things up by making it look like the previous entry had all properties unmuted.
|
||||
localmute.mFlags = LLMute::flagAll;
|
||||
}
|
||||
// There was no entry in the list previously. Fake things up by making it look like the previous entry had all properties unmuted.
|
||||
localmute.mFlags = LLMute::flagAll;
|
||||
}
|
||||
|
||||
if(flags)
|
||||
{
|
||||
// The user passed some combination of flags. Make sure those flag bits are turned off (i.e. those properties will be muted).
|
||||
localmute.mFlags &= (~flags);
|
||||
}
|
||||
else
|
||||
{
|
||||
// The user passed 0. Make sure all flag bits are turned off (i.e. all properties will be muted).
|
||||
localmute.mFlags = 0;
|
||||
}
|
||||
if(flags)
|
||||
{
|
||||
// The user passed some combination of flags. Make sure those flag bits are turned off (i.e. those properties will be muted).
|
||||
localmute.mFlags &= (~flags);
|
||||
}
|
||||
else
|
||||
{
|
||||
// The user passed 0. Make sure all flag bits are turned off (i.e. all properties will be muted).
|
||||
localmute.mFlags = 0;
|
||||
}
|
||||
|
||||
// (re)add the mute entry.
|
||||
{
|
||||
std::pair<mute_set_t::iterator, bool> result = mMutes.insert(localmute);
|
||||
if (result.second)
|
||||
// (re)add the mute entry.
|
||||
{
|
||||
auto result = mMutes.insert(localmute);
|
||||
if (result.second)
|
||||
{
|
||||
LL_INFOS() << "Muting " << localmute.mName << " id " << localmute.mID << " flags " << localmute.mFlags << LL_ENDL;
|
||||
updateAdd(localmute);
|
||||
notifyObservers();
|
||||
notifyObserversDetailed(localmute);
|
||||
if(!(localmute.mFlags & LLMute::flagParticles))
|
||||
{
|
||||
LL_INFOS() << "Muting " << localmute.mName << " id " << localmute.mID << " flags " << localmute.mFlags << LL_ENDL;
|
||||
updateAdd(localmute);
|
||||
notifyObservers();
|
||||
notifyObserversDetailed(localmute);
|
||||
if(!(localmute.mFlags & LLMute::flagParticles))
|
||||
//Kill all particle systems owned by muted task
|
||||
if(localmute.mType == LLMute::AGENT || localmute.mType == LLMute::OBJECT)
|
||||
{
|
||||
//Kill all particle systems owned by muted task
|
||||
if(localmute.mType == LLMute::AGENT || localmute.mType == LLMute::OBJECT)
|
||||
{
|
||||
LLViewerPartSim::getInstance()->clearParticlesByOwnerID(localmute.mID);
|
||||
}
|
||||
LLViewerPartSim::getInstance()->clearParticlesByOwnerID(localmute.mID);
|
||||
}
|
||||
//mute local lights that are attached to the avatar
|
||||
LLVOAvatar *avatarp = find_avatar(localmute.mID);
|
||||
if (avatarp)
|
||||
{
|
||||
LLPipeline::removeMutedAVsLights(avatarp);
|
||||
}
|
||||
return TRUE;
|
||||
}
|
||||
//mute local lights that are attached to the avatar
|
||||
LLVOAvatar *avatarp = find_avatar(localmute.mID);
|
||||
if (avatarp)
|
||||
{
|
||||
LLPipeline::removeMutedAVsLights(avatarp);
|
||||
}
|
||||
return !duplicate;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -514,18 +516,14 @@ std::vector<LLMute> LLMuteList::getMutes() const
|
||||
{
|
||||
std::vector<LLMute> mutes;
|
||||
|
||||
for (mute_set_t::const_iterator it = mMutes.begin();
|
||||
it != mMutes.end();
|
||||
++it)
|
||||
for (const auto& mMute : mMutes)
|
||||
{
|
||||
mutes.push_back(*it);
|
||||
mutes.push_back(mMute);
|
||||
}
|
||||
|
||||
for (string_set_t::const_iterator it = mLegacyMutes.begin();
|
||||
it != mLegacyMutes.end();
|
||||
++it)
|
||||
for (const auto& mLegacyMute : mLegacyMutes)
|
||||
{
|
||||
LLMute legacy(LLUUID::null, *it);
|
||||
LLMute legacy(LLUUID::null, mLegacyMute);
|
||||
mutes.push_back(legacy);
|
||||
}
|
||||
|
||||
@@ -538,7 +536,7 @@ std::vector<LLMute> LLMuteList::getMutes() const
|
||||
//-----------------------------------------------------------------------------
|
||||
BOOL LLMuteList::loadFromFile(const std::string& filename)
|
||||
{
|
||||
if(!filename.size())
|
||||
if(filename.empty())
|
||||
{
|
||||
LL_WARNS() << "Mute List Filename is Empty!" << LL_ENDL;
|
||||
return FALSE;
|
||||
@@ -588,7 +586,7 @@ BOOL LLMuteList::loadFromFile(const std::string& filename)
|
||||
//-----------------------------------------------------------------------------
|
||||
BOOL LLMuteList::saveToFile(const std::string& filename)
|
||||
{
|
||||
if(!filename.size())
|
||||
if(filename.empty())
|
||||
{
|
||||
LL_WARNS() << "Mute List Filename is Empty!" << LL_ENDL;
|
||||
return FALSE;
|
||||
@@ -603,23 +601,19 @@ BOOL LLMuteList::saveToFile(const std::string& filename)
|
||||
// legacy mutes have null uuid
|
||||
std::string id_string;
|
||||
LLUUID::null.toString(id_string);
|
||||
for (string_set_t::iterator it = mLegacyMutes.begin();
|
||||
it != mLegacyMutes.end();
|
||||
++it)
|
||||
for (const auto& mLegacyMute : mLegacyMutes)
|
||||
{
|
||||
fprintf(fp, "%d %s %s|\n", (S32)LLMute::BY_NAME, id_string.c_str(), it->c_str());
|
||||
fprintf(fp, "%d %s %s|\n", (S32)LLMute::BY_NAME, id_string.c_str(), mLegacyMute.c_str());
|
||||
}
|
||||
for (mute_set_t::iterator it = mMutes.begin();
|
||||
it != mMutes.end();
|
||||
++it)
|
||||
for (const auto& mMute : mMutes)
|
||||
{
|
||||
// Don't save external mutes as they are not sent to the server and probably won't
|
||||
//be valid next time anyway.
|
||||
if (it->mType != LLMute::EXTERNAL)
|
||||
if (mMute.mType != LLMute::EXTERNAL)
|
||||
{
|
||||
it->mID.toString(id_string);
|
||||
const std::string& name = it->mName;
|
||||
fprintf(fp, "%d %s %s|%u\n", (S32)it->mType, id_string.c_str(), name.c_str(), it->mFlags);
|
||||
mMute.mID.toString(id_string);
|
||||
const std::string& name = mMute.mName;
|
||||
fprintf(fp, "%d %s %s|%u\n", (S32)mMute.mType, id_string.c_str(), name.c_str(), mMute.mFlags);
|
||||
}
|
||||
}
|
||||
fclose(fp);
|
||||
@@ -629,6 +623,9 @@ BOOL LLMuteList::saveToFile(const std::string& filename)
|
||||
|
||||
BOOL LLMuteList::isMuted(const LLUUID& id, const std::string& name, U32 flags) const
|
||||
{
|
||||
if (mMutes.empty() && mLegacyMutes.empty())
|
||||
return FALSE;
|
||||
|
||||
// for objects, check for muting on their parent prim
|
||||
LLViewerObject* mute_object = get_object_to_mute_from_id(id);
|
||||
LLUUID id_to_check = (mute_object) ? mute_object->getID() : id;
|
||||
@@ -662,10 +659,8 @@ BOOL LLMuteList::isMuted(const LLUUID& id, const std::string& name, U32 flags) c
|
||||
//-----------------------------------------------------------------------------
|
||||
void LLMuteList::requestFromServer(const LLUUID& agent_id)
|
||||
{
|
||||
std::string agent_id_string;
|
||||
std::string filename;
|
||||
agent_id.toString(agent_id_string);
|
||||
filename = gDirUtilp->getExpandedFilename(LL_PATH_CACHE,agent_id_string) + ".cached_mute";
|
||||
std::string filename = gDirUtilp->getExpandedFilename(LL_PATH_CACHE,
|
||||
llformat("%s.cached_mute", agent_id.asString().c_str()));
|
||||
LLCRC crc;
|
||||
crc.update(filename);
|
||||
|
||||
@@ -688,10 +683,8 @@ void LLMuteList::cache(const LLUUID& agent_id)
|
||||
// Write to disk even if empty.
|
||||
if(mIsLoaded)
|
||||
{
|
||||
std::string agent_id_string;
|
||||
std::string filename;
|
||||
agent_id.toString(agent_id_string);
|
||||
filename = gDirUtilp->getExpandedFilename(LL_PATH_CACHE,agent_id_string) + ".cached_mute";
|
||||
std::string filename = gDirUtilp->getExpandedFilename(LL_PATH_CACHE,
|
||||
llformat("%s.cached_mute", agent_id.asString().c_str()));
|
||||
saveToFile(filename);
|
||||
}
|
||||
}
|
||||
@@ -729,10 +722,8 @@ void LLMuteList::processUseCachedMuteList(LLMessageSystem* msg, void**)
|
||||
{
|
||||
LL_INFOS() << "LLMuteList::processUseCachedMuteList()" << LL_ENDL;
|
||||
|
||||
std::string agent_id_string;
|
||||
gAgent.getID().toString(agent_id_string);
|
||||
std::string filename;
|
||||
filename = gDirUtilp->getExpandedFilename(LL_PATH_CACHE,agent_id_string) + ".cached_mute";
|
||||
std::string filename = gDirUtilp->getExpandedFilename(LL_PATH_CACHE,
|
||||
llformat("%s.cached_mute", gAgent.getID().asString().c_str()));
|
||||
LLMuteList::getInstance()->loadFromFile(filename);
|
||||
}
|
||||
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user