Compare commits
106 Commits
sv-1.8.7.8
...
sv-1.8.9.8
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
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
|
||||
@@ -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);
|
||||
|
||||
|
||||
@@ -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())
|
||||
|
||||
@@ -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;
|
||||
|
||||
|
||||
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,40 @@
|
||||
#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(#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(name, len)
|
||||
#endif
|
||||
|
||||
DEFINE_CRASHPAD_ANNOTATION(fatal_message, 512);
|
||||
DEFINE_CRASHPAD_ANNOTATION(grid_name, 64);
|
||||
DEFINE_CRASHPAD_ANNOTATION(cpu_string, 128);
|
||||
DEFINE_CRASHPAD_ANNOTATION(startup_state, 32);
|
||||
|
||||
////// Windows-specific includes to the bottom - nasty defines in these pollute the preprocessor
|
||||
//
|
||||
@@ -770,8 +798,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
|
||||
//
|
||||
@@ -1659,6 +1697,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 +2781,10 @@ 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(cpu_string, gDebugInfo["CPUInfo"]["CPUString"].asString());
|
||||
#endif
|
||||
}
|
||||
|
||||
|
||||
@@ -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() << " "
|
||||
|
||||
@@ -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()));
|
||||
@@ -1615,9 +1616,9 @@ void LLSpatialBridge::cleanupReferences()
|
||||
}
|
||||
}*/
|
||||
|
||||
LLDrawable* drawablep = mDrawable;
|
||||
mDrawable = NULL;
|
||||
drawablep->setSpatialBridge(NULL);
|
||||
LLPointer<LLDrawable> drawablep = mDrawable;
|
||||
mDrawable = nullptr;
|
||||
drawablep->setSpatialBridge(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);
|
||||
}
|
||||
|
||||
@@ -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());
|
||||
|
||||
@@ -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();
|
||||
|
||||
|
||||
@@ -55,7 +55,6 @@
|
||||
#include "llviewerwindow.h"
|
||||
#include "llstatusbar.h"
|
||||
#include "llviewerregion.h"
|
||||
#include "lleconomy.h"
|
||||
#include "lltrans.h"
|
||||
|
||||
#include "llgl.h"
|
||||
|
||||
@@ -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);
|
||||
|
||||
@@ -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(),
|
||||
|
||||
@@ -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;
|
||||
@@ -1838,7 +1842,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 +1971,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 +1980,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
|
||||
|
||||
@@ -36,6 +36,7 @@
|
||||
|
||||
#include "lffloaterinvpanel.h"
|
||||
#include "llagent.h"
|
||||
#include "llagentbenefits.h"
|
||||
#include "llagentcamera.h"
|
||||
#include "llagentwearables.h"
|
||||
#include "llappearancemgr.h"
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
@@ -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++;
|
||||
}
|
||||
|
||||
@@ -197,38 +197,16 @@ LLNotifyBox::LLNotifyBox(LLNotificationPtr notification)
|
||||
|
||||
x += HPAD + HPAD + 32;
|
||||
|
||||
// add a caution textbox at the top of a caution notification
|
||||
if (mIsCaution && !mIsTip)
|
||||
{
|
||||
S32 caution_height = ((S32)sFont->getLineHeight() * 2) + VPAD;
|
||||
auto caution_box = new LLTextBox(
|
||||
std::string("caution_box"),
|
||||
LLRect(x, y, getRect().getWidth() - 2, caution_height),
|
||||
LLStringUtil::null,
|
||||
sFont,
|
||||
FALSE);
|
||||
|
||||
caution_box->setFontStyle(LLFontGL::BOLD);
|
||||
caution_box->setColor(gColors.getColor("NotifyCautionWarnColor"));
|
||||
caution_box->setBackgroundColor(gColors.getColor("NotifyCautionBoxColor"));
|
||||
caution_box->setBorderVisible(FALSE);
|
||||
caution_box->setWrappedText(notification->getMessage());
|
||||
|
||||
addChild(caution_box);
|
||||
|
||||
// adjust the vertical position of the next control so that
|
||||
// it appears below the caution textbox
|
||||
y = y - caution_height;
|
||||
}
|
||||
else
|
||||
{
|
||||
const S32 BTN_TOP = BOTTOM_PAD + (((mNumOptions-1+2)/3)) * (BTN_HEIGHT+VPAD);
|
||||
|
||||
// Tokenization on \n is handled by LLTextBox
|
||||
|
||||
const S32 MAX_LENGTH = 512 + 20 + DB_FIRST_NAME_BUF_SIZE + DB_LAST_NAME_BUF_SIZE + DB_INV_ITEM_NAME_BUF_SIZE; // For script dialogs: add space for title.
|
||||
const auto height = mIsTip ? BOTTOM : BTN_TOP+16;
|
||||
|
||||
mText = new LLTextEditor(std::string("box"), LLRect(x, y, getRect().getWidth()-2, height), MAX_LENGTH, LLStringUtil::null, sFont, FALSE, true);
|
||||
|
||||
mText = new LLTextEditor(std::string("box"), LLRect(x, y, getRect().getWidth()-2, mIsTip ? BOTTOM : BTN_TOP+16), MAX_LENGTH, LLStringUtil::null, sFont, FALSE, true);
|
||||
mText->setWordWrap(TRUE);
|
||||
mText->setMouseOpaque(TRUE);
|
||||
mText->setBorderVisible(FALSE);
|
||||
@@ -238,12 +216,17 @@ LLNotifyBox::LLNotifyBox(LLNotificationPtr notification)
|
||||
// rendered under the text box, therefore we want
|
||||
// the actual text box to be transparent
|
||||
|
||||
auto text_color = gColors.getColor(mIsCaution && mIsTip ? "NotifyCautionWarnColor" : "NotifyTextColor");
|
||||
auto text_color = gColors.getColor(mIsCaution ? "NotifyCautionWarnColor" : "NotifyTextColor");
|
||||
LLStyleSP style = new LLStyle(true, text_color, LLStringUtil::null);
|
||||
style->mBold = mIsCaution && !mIsTip;
|
||||
|
||||
mText->setReadOnlyFgColor(text_color); //sets caution text color for tip notifications
|
||||
if (!mIsCaution) // We could do some extra color math here to determine if bg's too close to link color, but let's just cross with the link color instead
|
||||
if (!mIsCaution || !mIsTip) // We could do some extra color math here to determine if bg's too close to link color, but let's just cross with the link color instead
|
||||
mText->setLinkColor(new LLColor4(lerp(text_color, gSavedSettings.getColor4("HTMLLinkColor"), 0.4f)));
|
||||
mText->setTabStop(FALSE); // can't tab to it (may be a problem for scrolling via keyboard)
|
||||
mText->appendText(message,false,false,nullptr,!layout_script_dialog); // Now we can set the text, since colors have been set.
|
||||
mText->appendText(message,false,false,style); // Now we can set the text, since colors have been set.
|
||||
if (is_textbox || layout_script_dialog)
|
||||
mText->appendText(notification->getSubstitutions()["SCRIPT_MESSAGE"], false, true, style, false);
|
||||
addChild(mText);
|
||||
}
|
||||
|
||||
@@ -399,6 +382,7 @@ LLButton* LLNotifyBox::addButton(const std::string& name, const std::string& lab
|
||||
|
||||
LLButton* btn = new LLButton(name, btn_rect, "", boost::bind(&LLNotifyBox::onClickButton, this, is_option ? name : ""));
|
||||
btn->setLabel(label);
|
||||
btn->setToolTip(label);
|
||||
btn->setFont(font);
|
||||
|
||||
if (mIsCaution)
|
||||
|
||||
@@ -45,6 +45,7 @@
|
||||
#include "llwindow.h"
|
||||
|
||||
#include "llagent.h"
|
||||
#include "llagentbenefits.h"
|
||||
#include "llavataractions.h"
|
||||
#include "llavatarpropertiesprocessor.h"
|
||||
#include "llcallingcard.h"
|
||||
@@ -984,23 +985,23 @@ void LLPanelAvatarPicks::processProperties(void* data, EAvatarProcessorType type
|
||||
// are no tabs in the container.
|
||||
tabs->selectFirstTab();
|
||||
bool edit(getPanelAvatar()->isEditable());
|
||||
S32 tab_count = tabs->getTabCount();
|
||||
bool can_add = self && tabs->getTabCount() < LLAgentBenefitsMgr::current().getPicksLimit();
|
||||
LLView* view = getChildView("New...");
|
||||
view->setEnabled(self && tab_count < MAX_AVATAR_PICKS
|
||||
view->setEnabled(can_add
|
||||
// [RLVa:KB] - Checked: 2009-07-04 (RLVa-1.0.0a)
|
||||
&& !gRlvHandler.hasBehaviour(RLV_BHVR_SHOWLOC));
|
||||
// [/RLVa:KB]
|
||||
view->setVisible(self && edit);
|
||||
view = getChildView("Delete...");
|
||||
view->setEnabled(self && tab_count);
|
||||
view->setEnabled(can_add);
|
||||
view->setVisible(self && edit);
|
||||
|
||||
//For pick import/export - RK
|
||||
view = getChildView("Import...");
|
||||
view->setVisible(self && edit);
|
||||
view->setEnabled(tab_count < MAX_AVATAR_PICKS);
|
||||
view->setEnabled(can_add);
|
||||
view = getChildView("Export...");
|
||||
view->setEnabled(self && tab_count);
|
||||
view->setEnabled(can_add);
|
||||
view->setVisible(self);
|
||||
|
||||
childSetVisible("loading_text", false);
|
||||
@@ -1022,13 +1023,13 @@ void LLPanelAvatarPicks::onClickNew()
|
||||
panel_pick->initNewPick();
|
||||
tabs->addTabPanel(panel_pick, panel_pick->getPickName());
|
||||
tabs->selectLastTab();
|
||||
S32 tab_count = tabs->getTabCount();
|
||||
getChildView("New...")->setEnabled(tab_count < MAX_AVATAR_PICKS
|
||||
bool can_add = tabs->getTabCount() < LLAgentBenefitsMgr::current().getPicksLimit();
|
||||
getChildView("New...")->setEnabled(can_add
|
||||
// [RLVa:KB] - Checked: 2009-07-04 (RLVa-1.0.0a)
|
||||
&& !gRlvHandler.hasBehaviour(RLV_BHVR_SHOWLOC));
|
||||
// [/RLVa:KB]
|
||||
getChildView("Delete...")->setEnabled(true);
|
||||
getChildView("Import...")->setEnabled(tab_count < MAX_AVATAR_PICKS);
|
||||
getChildView("Import...")->setEnabled(can_add);
|
||||
}
|
||||
|
||||
//Pick import and export - RK
|
||||
@@ -1039,17 +1040,17 @@ void LLPanelAvatarPicks::onClickImport()
|
||||
}
|
||||
|
||||
// static
|
||||
void LLPanelAvatarPicks::onClickImport_continued(void* data, bool import)
|
||||
void LLPanelAvatarPicks::onClickImport_continued(void* data, bool importt)
|
||||
{
|
||||
LLPanelAvatarPicks* self = (LLPanelAvatarPicks*)data;
|
||||
LLTabContainer* tabs = self->getChild<LLTabContainer>("picks tab");
|
||||
if (import && self->mPanelPick)
|
||||
if (importt && self->mPanelPick)
|
||||
{
|
||||
tabs->addTabPanel(self->mPanelPick, self->mPanelPick->getPickName());
|
||||
tabs->selectLastTab();
|
||||
self->childSetEnabled("New...", !gRlvHandler.hasBehaviour(RLV_BHVR_SHOWLOC));
|
||||
self->childSetEnabled("Delete...", false);
|
||||
self->childSetEnabled("Import...", tabs->getTabCount() < MAX_AVATAR_PICKS);
|
||||
self->childSetEnabled("Import...", tabs->getTabCount() < LLAgentBenefitsMgr::current().getPicksLimit());
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -251,7 +251,7 @@ private:
|
||||
|
||||
//Pick import and export - RK
|
||||
void onClickImport();
|
||||
static void onClickImport_continued(void* self, bool import);
|
||||
static void onClickImport_continued(void* self, bool importt);
|
||||
void onClickExport();
|
||||
|
||||
bool callbackDelete(const LLSD& notification, const LLSD& response);
|
||||
|
||||
@@ -32,6 +32,7 @@
|
||||
|
||||
#include "lllineeditor.h"
|
||||
#include "llfloaterexperienceprofile.h"
|
||||
#include "llfloaterexperiences.h"
|
||||
//#include "llfloaterreg.h"
|
||||
#include "lluictrlfactory.h"
|
||||
#include "llscrolllistctrl.h"
|
||||
@@ -62,13 +63,12 @@ const static std::string columnSpace = " ";
|
||||
/* Singu Note: We do not have injectors, so we'll have to call this function instead
|
||||
static LLPanelInjector<LLPanelExperiencePicker> t_panel_status("llpanelexperiencepicker");
|
||||
*/
|
||||
void* create_xp_picker(void* data) { return new LLPanelExperiencePicker(false); }
|
||||
|
||||
LLPanelExperiencePicker::LLPanelExperiencePicker(bool build)
|
||||
LLPanelExperiencePicker::LLPanelExperiencePicker()
|
||||
:LLPanel()
|
||||
{
|
||||
//buildFromFile("panel_experience_search.xml");
|
||||
if (build) LLUICtrlFactory::getInstance()->buildPanel(this, "panel_experience_search.xml"); // Singu Note: Use filename in xml
|
||||
LLUICtrlFactory::getInstance()->buildPanel(this, "panel_experience_search.xml"); // Singu Note: Use filename in xml
|
||||
setDefaultFilters();
|
||||
}
|
||||
|
||||
@@ -288,7 +288,7 @@ void LLPanelExperiencePicker::onBtnSelect()
|
||||
|
||||
void LLPanelExperiencePicker::onBtnClose()
|
||||
{
|
||||
LLFloater* floater = static_cast<LLFloater*>(getParent());
|
||||
LLFloater* floater = mSelectionCallback ? static_cast<LLFloater*>(getParent()) : LLFloaterExperiences::findInstance();
|
||||
if (floater)
|
||||
{
|
||||
floater->close();
|
||||
|
||||
@@ -32,7 +32,6 @@
|
||||
class LLScrollListCtrl;
|
||||
class LLLineEditor;
|
||||
|
||||
void* create_xp_picker(void* data);
|
||||
class LLPanelExperiencePicker final : public LLPanel
|
||||
{
|
||||
public:
|
||||
@@ -44,7 +43,7 @@ public:
|
||||
typedef std::function<bool (const LLSD&)> filter_function;
|
||||
typedef std::vector<filter_function> filter_list;
|
||||
|
||||
LLPanelExperiencePicker(bool build = true);
|
||||
LLPanelExperiencePicker();
|
||||
virtual ~LLPanelExperiencePicker();
|
||||
|
||||
BOOL postBuild() override;
|
||||
|
||||
@@ -35,6 +35,7 @@
|
||||
#include "llpanelgroupgeneral.h"
|
||||
|
||||
#include "llagent.h"
|
||||
#include "llagentbenefits.h"
|
||||
#include "lluictrlfactory.h"
|
||||
#include "roles_constants.h"
|
||||
|
||||
@@ -182,10 +183,11 @@ BOOL LLPanelGroupGeneral::postBuild()
|
||||
mCtrlOpenEnrollment->setCommitCallback(boost::bind(&LLPanelGroupGeneral::onCommitAny,this));
|
||||
}
|
||||
|
||||
auto& grid = *gHippoGridManager->getConnectedGrid();
|
||||
mCtrlEnrollmentFee = getChild<LLCheckBoxCtrl>("check_enrollment_fee", recurse);
|
||||
if (mCtrlEnrollmentFee)
|
||||
{
|
||||
mCtrlEnrollmentFee->setLabelArg("[CURRENCY]", gHippoGridManager->getConnectedGrid()->getCurrencySymbol());
|
||||
mCtrlEnrollmentFee->setLabelArg("[CURRENCY]", grid.getCurrencySymbol());
|
||||
mCtrlEnrollmentFee->setCommitCallback(boost::bind(&LLPanelGroupGeneral::onCommitEnrollment,this));
|
||||
}
|
||||
|
||||
@@ -242,7 +244,7 @@ BOOL LLPanelGroupGeneral::postBuild()
|
||||
}
|
||||
|
||||
LLStringUtil::format_map_t args;
|
||||
args["[GROUPCREATEFEE]"] = gHippoGridManager->getConnectedGrid()->getGroupCreationFee();
|
||||
args["[GROUPCREATEFEE]"] = grid.formatFee(LLAgentBenefitsMgr::current().getCreateGroupCost());
|
||||
mIncompleteMemberDataStr = getString("incomplete_member_data_str");
|
||||
mConfirmGroupCreateStr = getString("confirm_group_create_str", args);
|
||||
|
||||
|
||||
@@ -29,7 +29,6 @@
|
||||
|
||||
#include "llagent.h"
|
||||
#include "llagentcamera.h"
|
||||
#include "lleconomy.h"
|
||||
#include "llfirstuse.h"
|
||||
#include "llfiltereditor.h"
|
||||
#include "llinventorybridge.h"
|
||||
|
||||
@@ -36,7 +36,6 @@
|
||||
#include "llpanelobject.h"
|
||||
|
||||
// linden library includes
|
||||
#include "lleconomy.h"
|
||||
#include "llerror.h"
|
||||
#include "llfontgl.h"
|
||||
#include "llpermissionsflags.h"
|
||||
|
||||
@@ -566,7 +566,7 @@ void LLPanelPrimMediaControls::updateShape()
|
||||
// media_impl->handleKeyHere(KEY_RIGHT, MASK_NONE);
|
||||
break;
|
||||
case SCROLL_NONE:
|
||||
default:
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -41,7 +41,11 @@
|
||||
#include "lltabcontainer.h"
|
||||
#include "llviewercontrol.h"
|
||||
#include "llviewernetwork.h"
|
||||
#include "llmutelist.h"
|
||||
#endif
|
||||
#include "llfloatermute.h"
|
||||
|
||||
#ifdef AI_UNUSED
|
||||
static const std::string PANEL_PICKS = "panel_picks";
|
||||
#endif // AI_UNUSED
|
||||
|
||||
@@ -55,19 +59,19 @@ std::string getProfileURL(const std::string& agent_name)
|
||||
llassert(!url.empty());
|
||||
LLSD subs;
|
||||
subs["AGENT_NAME"] = agent_name;
|
||||
url = LLWeb::expandURLSubstitutions(url,subs);
|
||||
url = LLWeb::expandURLSubstitutions(url, subs);
|
||||
LLStringUtil::toLower(url);
|
||||
return url;
|
||||
}
|
||||
|
||||
class LLProfileHandler : public LLCommandHandler
|
||||
class LLProfileHandler final : public LLCommandHandler
|
||||
{
|
||||
public:
|
||||
// requires trusted browser to trigger
|
||||
LLProfileHandler() : LLCommandHandler("profile", UNTRUSTED_THROTTLE) { }
|
||||
|
||||
bool handle(const LLSD& params, const LLSD& query_map,
|
||||
LLMediaCtrl* web)
|
||||
LLMediaCtrl* web) override
|
||||
{
|
||||
if (params.size() < 1) return false;
|
||||
std::string agent_name = params[0];
|
||||
@@ -80,14 +84,14 @@ public:
|
||||
};
|
||||
LLProfileHandler gProfileHandler;
|
||||
|
||||
class LLAgentHandler : public LLCommandHandler
|
||||
class LLAgentHandler final : public LLCommandHandler
|
||||
{
|
||||
public:
|
||||
// requires trusted browser to trigger
|
||||
LLAgentHandler() : LLCommandHandler("agent", UNTRUSTED_THROTTLE) { }
|
||||
|
||||
bool handle(const LLSD& params, const LLSD& query_map,
|
||||
LLMediaCtrl* web)
|
||||
LLMediaCtrl* web) override
|
||||
{
|
||||
if (params.size() < 2) return false;
|
||||
LLUUID avatar_id;
|
||||
@@ -144,6 +148,12 @@ public:
|
||||
return true;
|
||||
}
|
||||
|
||||
if (verb == "removefriend")
|
||||
{
|
||||
LLAvatarActions::removeFriendDialog(avatar_id);
|
||||
return true;
|
||||
}
|
||||
|
||||
if (verb == "mute")
|
||||
{
|
||||
if (! LLAvatarActions::isBlocked(avatar_id))
|
||||
@@ -162,6 +172,28 @@ public:
|
||||
return true;
|
||||
}
|
||||
|
||||
if (verb == "block")
|
||||
{
|
||||
if (params.size() > 2)
|
||||
{
|
||||
const std::string object_name = LLURI::unescape(params[2].asString());
|
||||
LLMute mute(avatar_id, object_name, LLMute::OBJECT);
|
||||
LLMuteList::getInstance()->add(mute);
|
||||
LLFloaterMute::showInstance()->selectMute(mute.mID);
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
if (verb == "unblock")
|
||||
{
|
||||
if (params.size() > 2)
|
||||
{
|
||||
const std::string object_name = params[2].asString();
|
||||
LLMute mute(avatar_id, object_name, LLMute::OBJECT);
|
||||
LLMuteList::getInstance()->remove(mute);
|
||||
}
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
};
|
||||
@@ -171,13 +203,13 @@ LLAgentHandler gAgentHandler;
|
||||
#ifdef AI_UNUSED
|
||||
//-- LLPanelProfile::ChildStack begins ----------------------------------------
|
||||
LLPanelProfile::ChildStack::ChildStack()
|
||||
: mParent(NULL)
|
||||
: mParent(nullptr)
|
||||
{
|
||||
}
|
||||
|
||||
LLPanelProfile::ChildStack::~ChildStack()
|
||||
{
|
||||
while (mStack.size() != 0)
|
||||
while (!mStack.empty())
|
||||
{
|
||||
view_list_t& top = mStack.back();
|
||||
for (view_list_t::const_iterator it = top.begin(); it != top.end(); ++it)
|
||||
@@ -217,7 +249,7 @@ bool LLPanelProfile::ChildStack::push()
|
||||
/// Restore saved children (adding them back to the child list).
|
||||
bool LLPanelProfile::ChildStack::pop()
|
||||
{
|
||||
if (mStack.size() == 0)
|
||||
if (mStack.empty())
|
||||
{
|
||||
LL_WARNS() << "Empty stack" << LL_ENDL;
|
||||
llassert(mStack.size() == 0);
|
||||
@@ -240,7 +272,7 @@ bool LLPanelProfile::ChildStack::pop()
|
||||
void LLPanelProfile::ChildStack::preParentReshape()
|
||||
{
|
||||
mSavedStack = mStack;
|
||||
while(mStack.size() > 0)
|
||||
while(!mStack.empty())
|
||||
{
|
||||
pop();
|
||||
}
|
||||
@@ -255,9 +287,8 @@ void LLPanelProfile::ChildStack::postParentReshape()
|
||||
for (stack_t::const_iterator stack_it = mStack.begin(); stack_it != mStack.end(); ++stack_it)
|
||||
{
|
||||
const view_list_t& vlist = (*stack_it);
|
||||
for (view_list_t::const_iterator list_it = vlist.begin(); list_it != vlist.end(); ++list_it)
|
||||
for (auto viewp : vlist)
|
||||
{
|
||||
LLView* viewp = *list_it;
|
||||
LL_DEBUGS() << "removing " << viewp->getName() << LL_ENDL;
|
||||
mParent->removeChild(viewp);
|
||||
}
|
||||
@@ -273,9 +304,9 @@ void LLPanelProfile::ChildStack::dump()
|
||||
std::ostringstream dbg_line;
|
||||
dbg_line << "lvl #" << lvl << ":";
|
||||
const view_list_t& vlist = (*stack_it);
|
||||
for (view_list_t::const_iterator list_it = vlist.begin(); list_it != vlist.end(); ++list_it)
|
||||
for (auto list_it : vlist)
|
||||
{
|
||||
dbg_line << " " << (*list_it)->getName();
|
||||
dbg_line << " " << list_it->getName();
|
||||
}
|
||||
LL_DEBUGS() << dbg_line.str() << LL_ENDL;
|
||||
}
|
||||
@@ -372,7 +403,7 @@ void LLPanelProfile::onOpen()
|
||||
void LLPanelProfile::onTabSelected(const LLSD& param)
|
||||
{
|
||||
std::string tab_name = param.asString();
|
||||
if (NULL != getTabContainer()[tab_name])
|
||||
if (nullptr != getTabContainer()[tab_name])
|
||||
{
|
||||
getTabContainer()[tab_name]->onOpen(getAvatarId());
|
||||
}
|
||||
@@ -416,7 +447,7 @@ void LLPanelProfile::closePanel(LLPanel* panel)
|
||||
|
||||
// Prevent losing focus by the floater
|
||||
const child_list_t* child_list = getChildList();
|
||||
if (child_list->size() > 0)
|
||||
if (!child_list->empty())
|
||||
{
|
||||
child_list->front()->setFocus(TRUE);
|
||||
}
|
||||
|
||||
@@ -36,7 +36,6 @@
|
||||
|
||||
// linden library includes
|
||||
#include "llclickaction.h"
|
||||
#include "lleconomy.h"
|
||||
#include "llerror.h"
|
||||
#include "llfontgl.h"
|
||||
#include "llflexibleobject.h"
|
||||
|
||||
@@ -43,7 +43,6 @@
|
||||
|
||||
#include "llagent.h"
|
||||
#include "llbutton.h"
|
||||
#include "lleconomy.h"
|
||||
#include "llfloaterinventory.h"
|
||||
#include "llfloaterworldmap.h"
|
||||
#include "lliconctrl.h"
|
||||
|
||||
@@ -36,7 +36,6 @@
|
||||
// library includes
|
||||
#include "llcachename.h"
|
||||
#include "lldbstrings.h"
|
||||
#include "lleconomy.h"
|
||||
#include "llgl.h"
|
||||
#include "llmediaentry.h"
|
||||
#include "llrender.h"
|
||||
@@ -5446,6 +5445,7 @@ void LLSelectMgr::processObjectProperties(LLMessageSystem* msg, void** user_data
|
||||
node->mInventorySerial = inv_serial;
|
||||
node->mSitName.assign(sit_name);
|
||||
node->mTouchName.assign(touch_name);
|
||||
if (auto obj = node->getObject()) obj->mOwnerID = owner_id; // Singu Note: Try to get Owner whenever possible
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -70,6 +70,7 @@ static U32 sZombieGroups = 0;
|
||||
U32 LLSpatialGroup::sNodeCount = 0;
|
||||
|
||||
U32 gOctreeMaxCapacity;
|
||||
float gOctreeMinSize;
|
||||
U32 gOctreeReserveCapacity;
|
||||
|
||||
BOOL LLSpatialGroup::sNoDelete = FALSE;
|
||||
@@ -1623,10 +1624,10 @@ void renderOctree(LLSpatialGroup* group)
|
||||
gGL.diffuseColor4fv(col.mV);
|
||||
LLVector4a fudge;
|
||||
fudge.splat(0.001f);
|
||||
const LLVector4a* bounds = group->getObjectBounds();
|
||||
LLVector4a size = bounds[1];
|
||||
size.mul(1.01f);
|
||||
size.add(fudge);
|
||||
//const LLVector4a* bounds = group->getObjectBounds();
|
||||
//LLVector4a size = bounds[1];
|
||||
//size.mul(1.01f);
|
||||
//size.add(fudge);*/
|
||||
|
||||
//{
|
||||
// LLGLDepthTest depth(GL_TRUE, GL_FALSE);
|
||||
|
||||
@@ -52,9 +52,9 @@
|
||||
#include "llaudioengine_openal.h"
|
||||
#endif
|
||||
|
||||
#include "aosystem.h"
|
||||
#include "hippogridmanager.h"
|
||||
#include "hippolimits.h"
|
||||
#include "floaterao.h"
|
||||
#include "statemachine/aifilepicker.h"
|
||||
#include "lfsimfeaturehandler.h"
|
||||
|
||||
@@ -95,6 +95,7 @@
|
||||
#include "v3math.h"
|
||||
|
||||
#include "llagent.h"
|
||||
#include "llagentbenefits.h"
|
||||
#include "llagentcamera.h"
|
||||
#include "llagentwearables.h"
|
||||
#include "llagentpilot.h"
|
||||
@@ -286,6 +287,7 @@ static LLHost gFirstSim;
|
||||
static std::string gFirstSimSeedCap;
|
||||
static LLVector3 gAgentStartLookAt(1.0f, 0.f, 0.f);
|
||||
static std::string gAgentStartLocation = "safe";
|
||||
static bool mBenefitsSuccessfullyInit = false;
|
||||
|
||||
|
||||
boost::scoped_ptr<LLEventPump> LLStartUp::sStateWatcher(new LLEventStream("StartupState"));
|
||||
@@ -316,6 +318,7 @@ void apply_udp_blacklist(const std::string& csv);
|
||||
//bool process_login_success_response(std::string& password);
|
||||
bool process_login_success_response(std::string& password, U32& first_sim_size_x, U32& first_sim_size_y);
|
||||
// </FS:CR> Aurora Sim
|
||||
void on_benefits_failed_callback(const LLSD& notification, const LLSD& response);
|
||||
void transition_back_to_login_panel(const std::string& emsg);
|
||||
|
||||
void callback_cache_name(const LLUUID& id, const std::string& full_name, bool is_group)
|
||||
@@ -2009,7 +2012,7 @@ bool idle_startup()
|
||||
send_complete_agent_movement(regionp->getHost());
|
||||
gAssetStorage->setUpstream(regionp->getHost());
|
||||
gCacheName->setUpstream(regionp->getHost());
|
||||
msg->newMessageFast(_PREHASH_EconomyDataRequest);
|
||||
if (!mBenefitsSuccessfullyInit) msg->newMessageFast(_PREHASH_EconomyDataRequest);
|
||||
gAgent.sendReliableMessage();
|
||||
}
|
||||
display_startup();
|
||||
@@ -2678,6 +2681,11 @@ bool idle_startup()
|
||||
set_startup_status(1.0, LLStringUtil::null, LLStringUtil::null);
|
||||
display_startup();
|
||||
|
||||
if (!mBenefitsSuccessfullyInit && gHippoGridManager->getConnectedGrid()->isSecondLife())
|
||||
{
|
||||
LLNotificationsUtil::add("FailedToGetBenefits", LLSD(), LLSD(), boost::bind(on_benefits_failed_callback, _1, _2));
|
||||
}
|
||||
|
||||
// Let the map know about the inventory.
|
||||
LLFloaterWorldMap* floater_world_map = gFloaterWorldMap;
|
||||
if(floater_world_map)
|
||||
@@ -2687,10 +2695,7 @@ bool idle_startup()
|
||||
}
|
||||
|
||||
// Start the AO now that settings have loaded and login successful -- MC
|
||||
if (!gAOInvTimer)
|
||||
{
|
||||
gAOInvTimer = new AOInvTimer();
|
||||
}
|
||||
AOSystem::start();
|
||||
|
||||
gViewerWindow->showCursor();
|
||||
gViewerWindow->getWindow()->resetBusyCount();
|
||||
@@ -3889,10 +3894,70 @@ void apply_udp_blacklist(const std::string& csv)
|
||||
|
||||
}
|
||||
|
||||
void on_benefits_failed_callback(const LLSD& notification, const LLSD& response)
|
||||
{
|
||||
LL_WARNS("Benefits") << "Failed to load benefits information" << LL_ENDL;
|
||||
}
|
||||
|
||||
bool init_benefits(LLSD& response)
|
||||
{
|
||||
bool succ = true;
|
||||
|
||||
std::string package_name = response["account_type"].asString();
|
||||
const LLSD& benefits_sd = response["account_level_benefits"];
|
||||
if (!LLAgentBenefitsMgr::init(package_name, benefits_sd) ||
|
||||
!LLAgentBenefitsMgr::initCurrent(package_name, benefits_sd))
|
||||
{
|
||||
succ = false;
|
||||
}
|
||||
else
|
||||
{
|
||||
LL_DEBUGS("Benefits") << "Initialized current benefits, level " << package_name << " from " << benefits_sd << LL_ENDL;
|
||||
}
|
||||
const LLSD& packages_sd = response["premium_packages"];
|
||||
for(LLSD::map_const_iterator package_iter = packages_sd.beginMap();
|
||||
package_iter != packages_sd.endMap();
|
||||
++package_iter)
|
||||
{
|
||||
std::string package_name = package_iter->first;
|
||||
const LLSD& benefits_sd = package_iter->second["benefits"];
|
||||
if (LLAgentBenefitsMgr::init(package_name, benefits_sd))
|
||||
{
|
||||
LL_DEBUGS("Benefits") << "Initialized benefits for package " << package_name << " from " << benefits_sd << LL_ENDL;
|
||||
}
|
||||
else
|
||||
{
|
||||
LL_WARNS("Benefits") << "Failed init for package " << package_name << " from " << benefits_sd << LL_ENDL;
|
||||
succ = false;
|
||||
}
|
||||
}
|
||||
|
||||
if (!LLAgentBenefitsMgr::has("Base"))
|
||||
{
|
||||
LL_WARNS("Benefits") << "Benefits info did not include required package Base" << LL_ENDL;
|
||||
succ = false;
|
||||
}
|
||||
if (!LLAgentBenefitsMgr::has("Premium"))
|
||||
{
|
||||
LL_WARNS("Benefits") << "Benefits info did not include required package Premium" << LL_ENDL;
|
||||
succ = false;
|
||||
}
|
||||
|
||||
// FIXME PREMIUM - for testing if login does not yet provide Premium Plus. Should be removed thereafter.
|
||||
//if (succ && !LLAgentBenefitsMgr::has("Premium Plus"))
|
||||
//{
|
||||
// LLAgentBenefitsMgr::init("Premium Plus", packages_sd["Premium"]["benefits"]);
|
||||
// llassert(LLAgentBenefitsMgr::has("Premium Plus"));
|
||||
//}
|
||||
return succ;
|
||||
}
|
||||
|
||||
bool process_login_success_response(std::string& password, U32& first_sim_size_x, U32& first_sim_size_y)
|
||||
{
|
||||
LLSD response = LLUserAuth::getInstance()->getResponse();
|
||||
|
||||
mBenefitsSuccessfullyInit = init_benefits(response);
|
||||
|
||||
std::string text(response["udp_blacklist"]);
|
||||
if(!text.empty())
|
||||
{
|
||||
@@ -4115,14 +4180,15 @@ bool process_login_success_response(std::string& password, U32& first_sim_size_x
|
||||
LLWorldMap::gotMapServerURL(true);
|
||||
}
|
||||
|
||||
bool opensim = !gHippoGridManager->getConnectedGrid()->isSecondLife();
|
||||
auto& grid = *gHippoGridManager->getConnectedGrid();
|
||||
bool opensim = !grid.isSecondLife();
|
||||
if (opensim)
|
||||
{
|
||||
std::string web_profile_url = response["web_profile_url"];
|
||||
//if(!web_profile_url.empty()) // Singu Note: We're using this to check if this grid supports web profiles at all, so set empty if empty.
|
||||
gSavedSettings.setString("WebProfileURL", web_profile_url);
|
||||
}
|
||||
else if(!gHippoGridManager->getConnectedGrid()->isInProductionGrid())
|
||||
else if(!grid.isInProductionGrid())
|
||||
{
|
||||
gSavedSettings.setString("WebProfileURL", "https://my-demo.secondlife.com/[AGENT_NAME]");
|
||||
}
|
||||
@@ -4183,34 +4249,34 @@ bool process_login_success_response(std::string& password, U32& first_sim_size_x
|
||||
|
||||
// Override grid info with anything sent in the login response
|
||||
std::string tmp = response["gridname"].asString();
|
||||
if (!tmp.empty()) gHippoGridManager->getConnectedGrid()->setGridName(tmp);
|
||||
if (!tmp.empty()) grid.setGridName(tmp);
|
||||
tmp = response["loginuri"].asString();
|
||||
if (!tmp.empty()) gHippoGridManager->getConnectedGrid()->setLoginUri(tmp);
|
||||
if (!tmp.empty()) grid.setLoginUri(tmp);
|
||||
tmp = response["welcome"].asString();
|
||||
if (!tmp.empty()) gHippoGridManager->getConnectedGrid()->setLoginPage(tmp);
|
||||
if (!tmp.empty()) grid.setLoginPage(tmp);
|
||||
tmp = response["loginpage"].asString();
|
||||
if (!tmp.empty()) gHippoGridManager->getConnectedGrid()->setLoginPage(tmp);
|
||||
if (!tmp.empty()) grid.setLoginPage(tmp);
|
||||
tmp = response["economy"].asString();
|
||||
if (!tmp.empty()) gHippoGridManager->getConnectedGrid()->setHelperUri(tmp);
|
||||
if (!tmp.empty()) grid.setHelperUri(tmp);
|
||||
tmp = response["helperuri"].asString();
|
||||
if (!tmp.empty()) gHippoGridManager->getConnectedGrid()->setHelperUri(tmp);
|
||||
if (!tmp.empty()) grid.setHelperUri(tmp);
|
||||
tmp = response["about"].asString();
|
||||
if (!tmp.empty()) gHippoGridManager->getConnectedGrid()->setWebSite(tmp);
|
||||
if (!tmp.empty()) grid.setWebSite(tmp);
|
||||
tmp = response["website"].asString();
|
||||
if (!tmp.empty()) gHippoGridManager->getConnectedGrid()->setWebSite(tmp);
|
||||
if (!tmp.empty()) grid.setWebSite(tmp);
|
||||
tmp = response["help"].asString();
|
||||
if (!tmp.empty()) gHippoGridManager->getConnectedGrid()->setSupportUrl(tmp);
|
||||
if (!tmp.empty()) grid.setSupportUrl(tmp);
|
||||
tmp = response["support"].asString();
|
||||
if (!tmp.empty()) gHippoGridManager->getConnectedGrid()->setSupportUrl(tmp);
|
||||
if (!tmp.empty()) grid.setSupportUrl(tmp);
|
||||
tmp = response["register"].asString();
|
||||
if (!tmp.empty()) gHippoGridManager->getConnectedGrid()->setRegisterUrl(tmp);
|
||||
if (!tmp.empty()) grid.setRegisterUrl(tmp);
|
||||
tmp = response["account"].asString();
|
||||
if (!tmp.empty()) gHippoGridManager->getConnectedGrid()->setRegisterUrl(tmp);
|
||||
if (!tmp.empty()) grid.setRegisterUrl(tmp);
|
||||
tmp = response["password"].asString();
|
||||
if (!tmp.empty()) gHippoGridManager->getConnectedGrid()->setPasswordUrl(tmp);
|
||||
if (!tmp.empty()) grid.setPasswordUrl(tmp);
|
||||
tmp = response["search"].asString();
|
||||
if (!tmp.empty()) gHippoGridManager->getConnectedGrid()->setSearchUrl(tmp);
|
||||
else if (opensim) tmp = gHippoGridManager->getConnectedGrid()->getSearchUrl(); // Fallback from grid info response for setting
|
||||
if (!tmp.empty()) grid.setSearchUrl(tmp);
|
||||
else if (opensim) tmp = grid.getSearchUrl(); // Fallback from grid info response for setting
|
||||
if (opensim)
|
||||
{
|
||||
gSavedSettings.setString("SearchURL", tmp); // Singu Note: For web search purposes, always set this setting
|
||||
@@ -4219,32 +4285,31 @@ bool process_login_success_response(std::string& password, U32& first_sim_size_x
|
||||
gMenuBarView->getChildView("Avatar Picker")->setVisible(!tmp.empty());
|
||||
gSavedSettings.setString("DestinationGuideURL", response["destination_guide_url"].asString());
|
||||
tmp = response["classified_fee"].asString();
|
||||
gHippoGridManager->getConnectedGrid()->setClassifiedFee(tmp.empty() ? 0 : atoi(tmp.c_str()));
|
||||
grid.setClassifiedFee(tmp.empty() ? 0 : atoi(tmp.c_str()));
|
||||
}
|
||||
tmp = response["currency"].asString();
|
||||
if (!tmp.empty())
|
||||
{
|
||||
LLTrans::setDefaultArg("[CURRENCY]", tmp);
|
||||
gHippoGridManager->getConnectedGrid()->setCurrencySymbol(tmp);
|
||||
grid.setCurrencySymbol(tmp);
|
||||
}
|
||||
tmp = response["currency_text"].asString();
|
||||
if (!tmp.empty())
|
||||
{
|
||||
LLTrans::setDefaultArg("[CURRENCY_TEXT]", tmp);
|
||||
gHippoGridManager->getConnectedGrid()->setCurrencyText(tmp);
|
||||
grid.setCurrencyText(tmp);
|
||||
}
|
||||
tmp = response["real_currency"].asString();
|
||||
if (!tmp.empty()) gHippoGridManager->getConnectedGrid()->setRealCurrencySymbol(tmp);
|
||||
if (!tmp.empty()) grid.setRealCurrencySymbol(tmp);
|
||||
tmp = response["directory_fee"].asString();
|
||||
if (!tmp.empty()) gHippoGridManager->getConnectedGrid()->setDirectoryFee(atoi(tmp.c_str()));
|
||||
tmp = response["max_groups"].asString();
|
||||
if (!tmp.empty()) gHippoGridManager->getConnectedGrid()->setMaxAgentGroups(atoi(tmp.c_str()));
|
||||
tmp = response["max-agent-groups"].asString();
|
||||
if (!tmp.empty()) gHippoGridManager->getConnectedGrid()->setMaxAgentGroups(atoi(tmp.c_str()));
|
||||
if (!tmp.empty()) grid.setDirectoryFee(atoi(tmp.c_str()));
|
||||
if (mBenefitsSuccessfullyInit)
|
||||
tmp = response["VoiceConnector"].asString();
|
||||
if (!tmp.empty()) gHippoGridManager->getConnectedGrid()->setVoiceConnector(tmp);
|
||||
if (!tmp.empty()) grid.setVoiceConnector(tmp);
|
||||
tmp = response["upc_supported"].asString();
|
||||
if (!tmp.empty()) gHippoGridManager->getConnectedGrid()->setUPCSupported(true);
|
||||
if (!tmp.empty()) grid.setUPCSupported(true);
|
||||
if (opensim && !mBenefitsSuccessfullyInit)
|
||||
LLAgentBenefitsMgr::instance().initNonSL(response);
|
||||
gHippoGridManager->saveFile();
|
||||
gHippoLimits->setLimits();
|
||||
|
||||
|
||||
@@ -139,6 +139,7 @@ public:
|
||||
static bool startLLProxy(); // Initialize the SOCKS 5 proxy
|
||||
|
||||
static LLViewerStats::PhaseMap& getPhases() { return *sPhases; }
|
||||
static LLEventPump& getStateEventPump() { return *sStateWatcher; }
|
||||
private:
|
||||
static LLSLURL sStartSLURL;
|
||||
|
||||
|
||||
@@ -53,6 +53,7 @@
|
||||
#include "llglheaders.h"
|
||||
#include "lldrawpoolterrain.h"
|
||||
#include "lldrawable.h"
|
||||
#include "hippogridmanager.h"
|
||||
|
||||
extern LLPipeline gPipeline;
|
||||
extern bool gShiftFrame;
|
||||
@@ -71,7 +72,6 @@ LLSurface::LLSurface(U32 type, LLViewerRegion *regionp) :
|
||||
mGridsPerEdge(0),
|
||||
mOOGridsPerEdge(0.f),
|
||||
mPatchesPerEdge(0),
|
||||
mNumberOfPatches(0),
|
||||
mType(type),
|
||||
mDetailTextureScale(0.f),
|
||||
mOriginGlobal(0.0, 0.0, 0.0),
|
||||
@@ -86,9 +86,6 @@ LLSurface::LLSurface(U32 type, LLViewerRegion *regionp) :
|
||||
mSurfaceZ = NULL;
|
||||
mNorm = NULL;
|
||||
|
||||
// Patch data
|
||||
mPatchList = NULL;
|
||||
|
||||
// One of each for each camera
|
||||
mVisiblePatchCount = 0;
|
||||
|
||||
@@ -119,7 +116,6 @@ LLSurface::~LLSurface()
|
||||
mGridsPerEdge = 0;
|
||||
mGridsPerPatchEdge = 0;
|
||||
mPatchesPerEdge = 0;
|
||||
mNumberOfPatches = 0;
|
||||
destroyPatchData();
|
||||
|
||||
LLDrawPoolTerrain *poolp = (LLDrawPoolTerrain*) gPipeline.findPool(LLDrawPool::POOL_TERRAIN, mSTexturep);
|
||||
@@ -168,7 +164,6 @@ void LLSurface::create(const S32 grids_per_edge,
|
||||
mOOGridsPerEdge = 1.f / mGridsPerEdge;
|
||||
mGridsPerPatchEdge = grids_per_patch_edge;
|
||||
mPatchesPerEdge = grids_per_edge / mGridsPerPatchEdge;
|
||||
mNumberOfPatches = mPatchesPerEdge * mPatchesPerEdge;
|
||||
mMetersPerGrid = width / (F32)grids_per_edge;
|
||||
mMetersPerEdge = mMetersPerGrid * grids_per_edge;
|
||||
// <FS:CR> Aurora Sim
|
||||
@@ -310,14 +305,13 @@ void LLSurface::setOriginGlobal(const LLVector3d &origin_global)
|
||||
{
|
||||
LLVector3d new_origin_global;
|
||||
mOriginGlobal = origin_global;
|
||||
LLSurfacePatch *patchp;
|
||||
S32 i, j;
|
||||
// Need to update the southwest corners of the patches
|
||||
for (j=0; j<mPatchesPerEdge; j++)
|
||||
{
|
||||
for (i=0; i<mPatchesPerEdge; i++)
|
||||
{
|
||||
patchp = getPatch(i, j);
|
||||
const auto& patchp = getPatch(i, j);
|
||||
|
||||
new_origin_global = patchp->getOriginGlobal();
|
||||
|
||||
@@ -369,383 +363,197 @@ void LLSurface::getNeighboringRegionsStatus( std::vector<S32>& regions )
|
||||
}
|
||||
}
|
||||
|
||||
void LLSurface::connectNeighbor(LLSurface *neighborp, U32 direction)
|
||||
void LLSurface::connectNeighbor(LLSurface* neighborp, U32 direction)
|
||||
{
|
||||
S32 i;
|
||||
LLSurfacePatch *patchp, *neighbor_patchp;
|
||||
// <FS:CR> Aurora Sim
|
||||
S32 neighborPatchesPerEdge = neighborp->mPatchesPerEdge;
|
||||
// </FS:CR> Aurora Sim
|
||||
// Constraints:
|
||||
// - Regions width must equal height
|
||||
// - Region width divisible by mGridsPerPatchEdge (16)
|
||||
// - Region can only neighbor one other per side and coner (8 total, N, S, E, W, NW, NE, SW, SE)
|
||||
// - Non-power-of-2 regions should work here, but the rest of the viewer code will probably choke on them.
|
||||
|
||||
surface_patch_ref patchp, neighbor_patchp;
|
||||
if (mNeighbors[direction] == neighborp)
|
||||
{
|
||||
return;
|
||||
}
|
||||
if (mNeighbors[direction])
|
||||
{
|
||||
mNeighbors[direction]->disconnectNeighbor(this, gDirOpposite[direction]);
|
||||
}
|
||||
mNeighbors[direction] = neighborp;
|
||||
neighborp->mNeighbors[gDirOpposite[direction]] = this;
|
||||
|
||||
// <FS:CR> Aurora Sim
|
||||
S32 ppe[2];
|
||||
S32 own_offset[2] = {0, 0};
|
||||
S32 neighbor_offset[2] = {0, 0};
|
||||
U32 own_xpos, own_ypos, neighbor_xpos, neighbor_ypos;
|
||||
|
||||
ppe[0] = (mPatchesPerEdge < neighborPatchesPerEdge) ? mPatchesPerEdge : neighborPatchesPerEdge; // used for x
|
||||
ppe[1] = ppe[0]; // used for y
|
||||
|
||||
from_region_handle(mRegionp->getHandle(), &own_xpos, &own_ypos);
|
||||
from_region_handle(neighborp->getRegion()->getHandle(), &neighbor_xpos, &neighbor_ypos);
|
||||
|
||||
if(own_ypos >= neighbor_ypos)
|
||||
{
|
||||
neighbor_offset[1] = (own_ypos - neighbor_ypos) / mGridsPerPatchEdge;
|
||||
ppe[1] = llmin(mPatchesPerEdge, neighborPatchesPerEdge-neighbor_offset[1]);
|
||||
}
|
||||
else
|
||||
{
|
||||
own_offset[1] = (neighbor_ypos - own_ypos) / mGridsPerPatchEdge;
|
||||
ppe[1] = llmin(mPatchesPerEdge-own_offset[1], neighborPatchesPerEdge);
|
||||
}
|
||||
|
||||
if(own_xpos >= neighbor_xpos)
|
||||
{
|
||||
neighbor_offset[0] = (own_xpos - neighbor_xpos) / mGridsPerPatchEdge;
|
||||
ppe[0] = llmin(mPatchesPerEdge, neighborPatchesPerEdge-neighbor_offset[0]);
|
||||
}
|
||||
else
|
||||
{
|
||||
own_offset[0] = (neighbor_xpos - own_xpos) / mGridsPerPatchEdge;
|
||||
ppe[0] = llmin(mPatchesPerEdge-own_offset[0], neighborPatchesPerEdge);
|
||||
}
|
||||
// <FS:CR> Aurora Sim
|
||||
const S32 max_idx = mPatchesPerEdge - 1;
|
||||
const S32 neighbor_max_idx = neighborp->mPatchesPerEdge - 1;
|
||||
|
||||
// Connect patches
|
||||
if (NORTHEAST == direction)
|
||||
if (direction >= 4)
|
||||
{
|
||||
patchp = getPatch(mPatchesPerEdge - 1, mPatchesPerEdge - 1);
|
||||
// <FS:CR> Aurora Sim
|
||||
//neighbor_patchp = neighborp->getPatch(0, 0);
|
||||
neighbor_patchp = neighborp->getPatch(neighbor_offset[0], neighbor_offset[1]);
|
||||
// </FS:CR> Aurora Sim
|
||||
|
||||
patchp->connectNeighbor(neighbor_patchp, direction);
|
||||
neighbor_patchp->connectNeighbor(patchp, gDirOpposite[direction]);
|
||||
|
||||
patchp->updateNorthEdge(); // Only update one of north or east.
|
||||
patchp->dirtyZ();
|
||||
}
|
||||
else if (NORTHWEST == direction)
|
||||
// Corner stitch
|
||||
S32 patches[4][2] = {
|
||||
{max_idx, max_idx}, //NORTHEAST
|
||||
{0, max_idx}, //NORTHWEST
|
||||
{0, 0}, //SOUTHWEST
|
||||
{max_idx, 0}, //SOUTHEAST
|
||||
};
|
||||
const S32* p = patches[direction - 4];
|
||||
surface_patch_ref patchp = getPatch(p[0], p[1]);
|
||||
patchp->connectNeighbor(neighborp->getPatch(max_idx - p[0], max_idx - p[1]), direction);
|
||||
if (NORTHEAST == direction)
|
||||
{
|
||||
patchp->updateNorthEdge(); // Only update one of north or east.
|
||||
if (patchp->dirtyZ())
|
||||
{
|
||||
dirtySurfacePatch(patchp);
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
// <FS:CR> Aurora Sim
|
||||
S32 off = mPatchesPerEdge + neighbor_offset[1] - own_offset[1];
|
||||
// </FS:CR> Aurora Sim
|
||||
patchp = getPatch(0, mPatchesPerEdge - 1);
|
||||
// <FS:CR> Aurora Sim
|
||||
//neighbor_patchp = neighborp->getPatch(mPatchesPerEdge - 1, 0);
|
||||
neighbor_patchp = neighborp->getPatch(neighbor_offset[0] - 1, off); //neighborPatchesPerEdge - 1
|
||||
if (!neighbor_patchp)
|
||||
// Edge stitch
|
||||
// Aurora complicates this logic.
|
||||
U32 pos[2][2] = { {0,0},{0,0} };
|
||||
from_region_handle(mRegionp->getHandle(), &pos[0][0], &pos[0][1]);
|
||||
from_region_handle(neighborp->getRegion()->getHandle(), &pos[1][0], &pos[1][1]);
|
||||
S32 width[2] = { (S32)mRegionp->getWidth(), (S32)neighborp->getRegion()->getWidth() };
|
||||
U32 mins[2] = { llmax(pos[0][0], pos[1][0]), llmax(pos[0][1], pos[1][1]) };
|
||||
U32 maxs[2] = { llmin(pos[0][0] + width[0], pos[1][0] + width[1]), llmin(pos[0][1] + width[0], pos[1][1] + width[1]) };
|
||||
S32 start[2][2] = {
|
||||
{S32((mins[0] - pos[0][0]) / mGridsPerPatchEdge) - 1, S32((mins[1] - pos[0][1]) / mGridsPerPatchEdge) - 1},
|
||||
{S32((mins[0] - pos[1][0]) / neighborp->mGridsPerPatchEdge) - 1,S32((mins[1] - pos[1][1]) / neighborp->mGridsPerPatchEdge) - 1}
|
||||
};
|
||||
|
||||
S32 end[2] = { llmin(S32((maxs[0] - pos[0][0]) / mGridsPerPatchEdge), max_idx), llmin(S32((maxs[1] - pos[0][1]) / mGridsPerPatchEdge), max_idx) };
|
||||
const U32& neighbor_direction = gDirOpposite[direction];
|
||||
S32 stride[4][4][2] = {
|
||||
{{0, 1}, {max_idx, 0}, {neighbor_max_idx, 0}, {NORTHEAST, SOUTHEAST}}, //EAST
|
||||
{{1, 0}, {0, max_idx}, {0, neighbor_max_idx}, {NORTHEAST, NORTHWEST} }, //NORTH
|
||||
{{0, 1}, {0, 0}, {0, 0}, {NORTHWEST, SOUTHWEST}}, //WEST
|
||||
{{1, 0}, {0, 0}, {0, 0}, {SOUTHEAST, SOUTHWEST}} //SOUTH
|
||||
};
|
||||
const S32 offs[2][2] = {
|
||||
{stride[direction][0][0], stride[direction][0][1]},
|
||||
{stride[neighbor_direction][0][0], stride[neighbor_direction][0][1]}
|
||||
};
|
||||
|
||||
S32 x[2], y[2];
|
||||
x[0] = stride[direction][1][0] + offs[0][0] * start[0][0];
|
||||
y[0] = stride[direction][1][1] + offs[0][1] * start[0][1];
|
||||
x[1] = stride[neighbor_direction][2][0] + offs[1][0] * start[1][0];
|
||||
y[1] = stride[neighbor_direction][2][1] + offs[1][1] * start[1][1];
|
||||
|
||||
for (
|
||||
x[0] = stride[direction][1][0] + offs[0][0] * start[0][0],
|
||||
y[0] = stride[direction][1][1] + offs[0][1] * start[0][1],
|
||||
x[1] = stride[neighbor_direction][2][0] + offs[1][0] * start[1][0],
|
||||
y[1] = stride[neighbor_direction][2][1] + offs[1][1] * start[1][1];
|
||||
(!offs[0][0] || x[0] <= end[0]) && (!offs[0][1] || (y[0] <= end[1]));
|
||||
x[0] += offs[0][0], y[0] += offs[0][1],
|
||||
x[1] += offs[1][0], y[1] += offs[1][1])
|
||||
{
|
||||
mNeighbors[direction] = NULL;
|
||||
return;
|
||||
}
|
||||
// </FS:CR> Aurora Sim
|
||||
|
||||
patchp->connectNeighbor(neighbor_patchp, direction);
|
||||
neighbor_patchp->connectNeighbor(patchp, gDirOpposite[direction]);
|
||||
}
|
||||
else if (SOUTHWEST == direction)
|
||||
{
|
||||
patchp = getPatch(0, 0);
|
||||
// <FS:CR> Aurora Sim
|
||||
//neighbor_patchp = neighborp->getPatch(mPatchesPerEdge - 1, mPatchesPerEdge - 1);
|
||||
neighbor_patchp = neighborp->getPatch(neighbor_offset[0] - 1, neighbor_offset[1] - 1);
|
||||
if (!neighbor_patchp)
|
||||
{
|
||||
mNeighbors[direction] = NULL;
|
||||
return;
|
||||
}
|
||||
// </FS:CR> Aurora Sim
|
||||
|
||||
patchp->connectNeighbor(neighbor_patchp, direction);
|
||||
neighbor_patchp->connectNeighbor(patchp, gDirOpposite[direction]);
|
||||
|
||||
// <FS:CR> Aurora Sim
|
||||
//neighbor_patchp->updateNorthEdge(); // Only update one of north or east.
|
||||
neighbor_patchp->updateEastEdge(); // Only update one of north or east.
|
||||
// </FS:CR> Aurora Sim
|
||||
neighbor_patchp->dirtyZ();
|
||||
}
|
||||
else if (SOUTHEAST == direction)
|
||||
{
|
||||
// <FS:CR> Aurora Sim
|
||||
S32 off = mPatchesPerEdge + neighbor_offset[0] - own_offset[0];
|
||||
// </FS:CR> Aurora Sim
|
||||
|
||||
patchp = getPatch(mPatchesPerEdge - 1, 0);
|
||||
// <FS:CR> Aurora Sim
|
||||
//neighbor_patchp = neighborp->getPatch(0, mPatchesPerEdge - 1);
|
||||
neighbor_patchp = neighborp->getPatch(off, neighbor_offset[1] - 1); //0
|
||||
if (!neighbor_patchp)
|
||||
{
|
||||
mNeighbors[direction] = NULL;
|
||||
return;
|
||||
}
|
||||
// </FS:CR> Aurora Sim
|
||||
|
||||
patchp->connectNeighbor(neighbor_patchp, direction);
|
||||
neighbor_patchp->connectNeighbor(patchp, gDirOpposite[direction]);
|
||||
}
|
||||
else if (EAST == direction)
|
||||
{
|
||||
// Do east/west connections, first
|
||||
// <FS:CR> Aurora Sim
|
||||
//for (i = 0; i < (S32)mPatchesPerEdge; i++)
|
||||
for (i = 0; i < ppe[1]; i++)
|
||||
// </FS:CR> Aurora Sim
|
||||
{
|
||||
// <FS:CR> Aurora Sim
|
||||
//patchp = getPatch(mPatchesPerEdge - 1, i);
|
||||
//neighbor_patchp = neighborp->getPatch(0, i);
|
||||
patchp = getPatch(mPatchesPerEdge - 1, i + own_offset[1]);
|
||||
neighbor_patchp = neighborp->getPatch(0, i + neighbor_offset[1]);
|
||||
// </FS:CR> Aurora Sim
|
||||
|
||||
patchp->connectNeighbor(neighbor_patchp, direction);
|
||||
neighbor_patchp->connectNeighbor(patchp, gDirOpposite[direction]);
|
||||
|
||||
patchp->updateEastEdge();
|
||||
patchp->dirtyZ();
|
||||
}
|
||||
|
||||
// Now do northeast/southwest connections
|
||||
// <FS:CR> Aurora Sim
|
||||
//for (i = 0; i < (S32)mPatchesPerEdge - 1; i++)
|
||||
for (i = 0; i < ppe[1] - 1; i++)
|
||||
// </FS:CR> Aurora Sim
|
||||
{
|
||||
// <FS:CR> Aurora Sim
|
||||
//patchp = getPatch(mPatchesPerEdge - 1, i);
|
||||
//neighbor_patchp = neighborp->getPatch(0, i+1);
|
||||
patchp = getPatch(mPatchesPerEdge - 1, i + own_offset[1]);
|
||||
neighbor_patchp = neighborp->getPatch(0, i+1 + neighbor_offset[1]);
|
||||
// </FS:CR> Aurora Sim
|
||||
|
||||
patchp->connectNeighbor(neighbor_patchp, NORTHEAST);
|
||||
neighbor_patchp->connectNeighbor(patchp, SOUTHWEST);
|
||||
}
|
||||
// Now do southeast/northwest connections
|
||||
// <FS:CR> Aurora Sim
|
||||
//for (i = 1; i < (S32)mPatchesPerEdge; i++)
|
||||
for (i = 1; i < ppe[1]; i++)
|
||||
// </FS:CR> Aurora Sim
|
||||
{
|
||||
// <FS:CR> Aurora Sim
|
||||
//patchp = getPatch(mPatchesPerEdge - 1, i);
|
||||
//neighbor_patchp = neighborp->getPatch(0, i-1);
|
||||
patchp = getPatch(mPatchesPerEdge - 1, i + own_offset[1]);
|
||||
neighbor_patchp = neighborp->getPatch(0, i-1 + neighbor_offset[1]);
|
||||
// </FS:CR> Aurora Sim
|
||||
|
||||
patchp->connectNeighbor(neighbor_patchp, SOUTHEAST);
|
||||
neighbor_patchp->connectNeighbor(patchp, NORTHWEST);
|
||||
if (x[0] < 0 || y[0] < 0) {
|
||||
continue;
|
||||
}
|
||||
surface_patch_ref patchp = getPatch(x[0], y[0]);
|
||||
// diagonal stitch 1
|
||||
if ((offs[1][0] > 0 && x[1] > 0) || (offs[1][1] > 0 && y[1] > 0))
|
||||
{
|
||||
patchp->connectNeighbor(neighborp->getPatch(x[1] - offs[1][0], y[1] - offs[1][1]), stride[direction][3][1]);
|
||||
}
|
||||
// edge stitch
|
||||
if (x[1] >= 0 && y[1] >= 0 && x[1] <= neighbor_max_idx && y[1] <= neighbor_max_idx)
|
||||
{
|
||||
patchp->connectNeighbor(neighborp->getPatch(x[1], y[1]), direction);
|
||||
}
|
||||
// diagonal stitch 2
|
||||
if (x[1] + offs[1][0] <= neighbor_max_idx && y[1] + offs[1][1] <= neighbor_max_idx)
|
||||
{
|
||||
patchp->connectNeighbor(neighborp->getPatch(x[1] + offs[1][0], y[1] + offs[1][1]), stride[direction][3][0]);
|
||||
}
|
||||
if (direction == EAST)
|
||||
{
|
||||
patchp->updateEastEdge();
|
||||
if (patchp->dirtyZ())
|
||||
{
|
||||
dirtySurfacePatch(patchp);
|
||||
}
|
||||
}
|
||||
else if (direction == NORTH)
|
||||
{
|
||||
patchp->updateNorthEdge();
|
||||
if (patchp->dirtyZ())
|
||||
{
|
||||
dirtySurfacePatch(patchp);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
else if (NORTH == direction)
|
||||
{
|
||||
// Do north/south connections, first
|
||||
// <FS:CR> Aurora Sim
|
||||
//for (i = 0; i < (S32)mPatchesPerEdge; i++)
|
||||
for (i = 0; i < ppe[0]; i++)
|
||||
// </FS:CR> Aurora Sim
|
||||
{
|
||||
// <FS:CR> Aurora Sim
|
||||
//patchp = getPatch(i, mPatchesPerEdge - 1);
|
||||
//neighbor_patchp = neighborp->getPatch(i, 0);
|
||||
patchp = getPatch(i + own_offset[0], mPatchesPerEdge - 1);
|
||||
neighbor_patchp = neighborp->getPatch(i + neighbor_offset[0], 0);
|
||||
// </FS:CR> Aurora Sim
|
||||
|
||||
patchp->connectNeighbor(neighbor_patchp, direction);
|
||||
neighbor_patchp->connectNeighbor(patchp, gDirOpposite[direction]);
|
||||
|
||||
patchp->updateNorthEdge();
|
||||
patchp->dirtyZ();
|
||||
}
|
||||
|
||||
// Do northeast/southwest connections
|
||||
// <FS:CR> Aurora Sim
|
||||
//for (i = 0; i < (S32)mPatchesPerEdge - 1; i++)
|
||||
for (i = 0; i < ppe[0] - 1; i++)
|
||||
// </FS:CR> Aurora Sim
|
||||
{
|
||||
// <FS:CR> Aurora Sim
|
||||
//patchp = getPatch(i, mPatchesPerEdge - 1);
|
||||
//neighbor_patchp = neighborp->getPatch(i+1, 0);
|
||||
patchp = getPatch(i + own_offset[0], mPatchesPerEdge - 1);
|
||||
neighbor_patchp = neighborp->getPatch(i+1 + neighbor_offset[0], 0);
|
||||
// </FS:CR> Aurora Sim
|
||||
|
||||
patchp->connectNeighbor(neighbor_patchp, NORTHEAST);
|
||||
neighbor_patchp->connectNeighbor(patchp, SOUTHWEST);
|
||||
}
|
||||
// Do southeast/northwest connections
|
||||
// <FS:CR> Aurora Sim
|
||||
//for (i = 1; i < (S32)mPatchesPerEdge; i++)
|
||||
for (i = 1; i < ppe[0]; i++)
|
||||
// </FS:CR> Aurora Sim
|
||||
{
|
||||
// <FS:CR> Aurora Sim
|
||||
//patchp = getPatch(i, mPatchesPerEdge - 1);
|
||||
//neighbor_patchp = neighborp->getPatch(i-1, 0);
|
||||
patchp = getPatch(i + own_offset[0], mPatchesPerEdge - 1);
|
||||
neighbor_patchp = neighborp->getPatch(i-1 + neighbor_offset[0], 0);
|
||||
// </FS:CR> Aurora Sim
|
||||
|
||||
patchp->connectNeighbor(neighbor_patchp, NORTHWEST);
|
||||
neighbor_patchp->connectNeighbor(patchp, SOUTHEAST);
|
||||
}
|
||||
}
|
||||
else if (WEST == direction)
|
||||
{
|
||||
// Do east/west connections, first
|
||||
// <FS:CR> Aurora Sim
|
||||
//for (i = 0; i < mPatchesPerEdge; i++)
|
||||
for (i = 0; i < ppe[1]; i++)
|
||||
// </FS:CR> Aurora Sim
|
||||
{
|
||||
// <FS:CR> Aurora Sim
|
||||
//patchp = getPatch(0, i);
|
||||
//neighbor_patchp = neighborp->getPatch(mPatchesPerEdge - 1, i);
|
||||
patchp = getPatch(0, i + own_offset[1]);
|
||||
neighbor_patchp = neighborp->getPatch(neighborPatchesPerEdge - 1, i + neighbor_offset[1]);
|
||||
if (!neighbor_patchp) continue;
|
||||
// </FS:CR> Aurora Sim
|
||||
|
||||
patchp->connectNeighbor(neighbor_patchp, direction);
|
||||
neighbor_patchp->connectNeighbor(patchp, gDirOpposite[direction]);
|
||||
|
||||
neighbor_patchp->updateEastEdge();
|
||||
neighbor_patchp->dirtyZ();
|
||||
}
|
||||
|
||||
// Now do northeast/southwest connections
|
||||
// <FS:CR> Aurora Sim
|
||||
//for (i = 1; i < mPatchesPerEdge; i++)
|
||||
for (i = 1; i < ppe[1]; i++)
|
||||
// </FS:CR> Aurora Sim
|
||||
{
|
||||
// <FS:CR> Aurora Sim
|
||||
//patchp = getPatch(0, i);
|
||||
//neighbor_patchp = neighborp->getPatch(mPatchesPerEdge - 1, i - 1);
|
||||
patchp = getPatch(0, i + own_offset[1]);
|
||||
neighbor_patchp = neighborp->getPatch(neighborPatchesPerEdge - 1, i - 1 + neighbor_offset[1]);
|
||||
if (!neighbor_patchp) continue;
|
||||
// </FS:CR> Aurora Sim
|
||||
|
||||
patchp->connectNeighbor(neighbor_patchp, SOUTHWEST);
|
||||
neighbor_patchp->connectNeighbor(patchp, NORTHEAST);
|
||||
}
|
||||
|
||||
// Now do northwest/southeast connections
|
||||
// <FS:CR> Aurora Sim
|
||||
//for (i = 0; i < mPatchesPerEdge - 1; i++)
|
||||
for (i = 0; i < ppe[1] - 1; i++)
|
||||
// </FS:CR> Aurora Sim
|
||||
{
|
||||
// <FS:CR> Aurora Sim
|
||||
//patchp = getPatch(0, i);
|
||||
//neighbor_patchp = neighborp->getPatch(mPatchesPerEdge - 1, i + 1);
|
||||
patchp = getPatch(0, i + own_offset[1]);
|
||||
neighbor_patchp = neighborp->getPatch(neighborPatchesPerEdge - 1, i + 1 + neighbor_offset[1]);
|
||||
if (!neighbor_patchp) continue;
|
||||
// </FS:CR> Aurora Sim
|
||||
|
||||
patchp->connectNeighbor(neighbor_patchp, NORTHWEST);
|
||||
neighbor_patchp->connectNeighbor(patchp, SOUTHEAST);
|
||||
}
|
||||
}
|
||||
else if (SOUTH == direction)
|
||||
{
|
||||
// Do north/south connections, first
|
||||
// <FS:CR> Aurora Sim
|
||||
//for (i = 0; i < mPatchesPerEdge; i++)
|
||||
for (i = 0; i < ppe[0]; i++)
|
||||
// </FS:CR> Aurora Sim
|
||||
{
|
||||
// <FS:CR> Aurora Sim
|
||||
//patchp = getPatch(i, 0);
|
||||
//neighbor_patchp = neighborp->getPatch(i, mPatchesPerEdge - 1);
|
||||
patchp = getPatch(i + own_offset[0], 0);
|
||||
neighbor_patchp = neighborp->getPatch(i + neighbor_offset[0], neighborPatchesPerEdge - 1);
|
||||
if (!neighbor_patchp) continue;
|
||||
// </FS:CR> Aurora Sim
|
||||
|
||||
patchp->connectNeighbor(neighbor_patchp, direction);
|
||||
neighbor_patchp->connectNeighbor(patchp, gDirOpposite[direction]);
|
||||
|
||||
neighbor_patchp->updateNorthEdge();
|
||||
neighbor_patchp->dirtyZ();
|
||||
}
|
||||
|
||||
// Now do northeast/southwest connections
|
||||
// <FS:CR> Aurora Sim
|
||||
//for (i = 1; i < mPatchesPerEdge; i++)
|
||||
for (i = 1; i < ppe[0]; i++)
|
||||
// </FS:CR> Aurora Sim
|
||||
{
|
||||
// <FS:CR> Aurora Sim
|
||||
//patchp = getPatch(i, 0);
|
||||
//neighbor_patchp = neighborp->getPatch(i - 1, mPatchesPerEdge - 1);
|
||||
patchp = getPatch(i + own_offset[0], 0);
|
||||
neighbor_patchp = neighborp->getPatch(i - 1 + neighbor_offset[0], neighborPatchesPerEdge - 1);
|
||||
// </FS:CR> Aurora Sim
|
||||
|
||||
patchp->connectNeighbor(neighbor_patchp, SOUTHWEST);
|
||||
neighbor_patchp->connectNeighbor(patchp, NORTHEAST);
|
||||
}
|
||||
// Now do northeast/southwest connections
|
||||
// <FS:CR> Aurora Sim
|
||||
//for (i = 0; i < mPatchesPerEdge - 1; i++)
|
||||
for (i = 0; i < ppe[0] - 1; i++)
|
||||
// </FS:CR> Aurora Sim
|
||||
{
|
||||
// <FS:CR> Aurora Sim
|
||||
//patchp = getPatch(i, 0);
|
||||
//neighbor_patchp = neighborp->getPatch(i + 1, mPatchesPerEdge - 1);
|
||||
patchp = getPatch(i + own_offset[0], 0);
|
||||
neighbor_patchp = neighborp->getPatch(i + 1 + neighbor_offset[0], neighborPatchesPerEdge - 1);
|
||||
// </FS:CR> Aurora Sim
|
||||
|
||||
patchp->connectNeighbor(neighbor_patchp, SOUTHEAST);
|
||||
neighbor_patchp->connectNeighbor(patchp, NORTHWEST);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void LLSurface::disconnectNeighbor(LLSurface *surfacep)
|
||||
void LLSurface::disconnectNeighbor(LLSurface* surfacep, U32 direction)
|
||||
{
|
||||
S32 i;
|
||||
for (i = 0; i < 8; i++)
|
||||
if (surfacep && surfacep == mNeighbors[direction])
|
||||
{
|
||||
if (surfacep == mNeighbors[i])
|
||||
// Iterate through surface patches, removing any connectivity to removed surface.
|
||||
// Extra branches for debugging.
|
||||
if (!gHippoGridManager->getCurrentGrid()->isSecondLife())
|
||||
{
|
||||
mNeighbors[i] = NULL;
|
||||
for (auto& patchp : mPatchList)
|
||||
{
|
||||
patchp->disconnectNeighbor(surfacep);
|
||||
}
|
||||
}
|
||||
if (gHippoGridManager->getCurrentGrid()->isSecondLife())
|
||||
{
|
||||
for (auto& patchp : mPatchList)
|
||||
{
|
||||
patchp->disconnectNeighbor(surfacep);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Iterate through surface patches, removing any connectivity to removed surface.
|
||||
if (mPatchList) // Don't crash if removed before
|
||||
for (i = 0; i < mNumberOfPatches; i++)
|
||||
{
|
||||
(mPatchList + i)->disconnectNeighbor(surfacep);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
void LLSurface::disconnectAllNeighbors()
|
||||
{
|
||||
// Pulled out of loop to debug.
|
||||
if (mNeighbors[EAST])
|
||||
{
|
||||
mNeighbors[EAST]->disconnectNeighbor(this, gDirOpposite[EAST]);
|
||||
}
|
||||
if (mNeighbors[NORTH])
|
||||
{
|
||||
mNeighbors[NORTH]->disconnectNeighbor(this, gDirOpposite[NORTH]);
|
||||
}
|
||||
if (mNeighbors[WEST])
|
||||
{
|
||||
mNeighbors[WEST]->disconnectNeighbor(this, gDirOpposite[WEST]);
|
||||
}
|
||||
if (mNeighbors[SOUTH])
|
||||
{
|
||||
mNeighbors[SOUTH]->disconnectNeighbor(this, gDirOpposite[SOUTH]);
|
||||
}
|
||||
if (mNeighbors[NORTHEAST])
|
||||
{
|
||||
mNeighbors[NORTHEAST]->disconnectNeighbor(this, gDirOpposite[NORTHEAST]);
|
||||
}
|
||||
if (mNeighbors[NORTHWEST])
|
||||
{
|
||||
mNeighbors[NORTHWEST]->disconnectNeighbor(this, gDirOpposite[NORTHWEST]);
|
||||
}
|
||||
if (mNeighbors[SOUTHWEST])
|
||||
{
|
||||
mNeighbors[SOUTHWEST]->disconnectNeighbor(this, gDirOpposite[SOUTHWEST]);
|
||||
}
|
||||
if (mNeighbors[SOUTHEAST])
|
||||
{
|
||||
mNeighbors[SOUTHEAST]->disconnectNeighbor(this, gDirOpposite[SOUTHEAST]);
|
||||
}
|
||||
S32 i;
|
||||
for (i = 0; i < 8; i++)
|
||||
{
|
||||
if (mNeighbors[i])
|
||||
{
|
||||
mNeighbors[i]->disconnectNeighbor(this);
|
||||
//mNeighbors[i]->disconnectNeighbor(this);
|
||||
mNeighbors[i] = NULL;
|
||||
}
|
||||
}
|
||||
@@ -802,13 +610,9 @@ void LLSurface::updatePatchVisibilities(LLAgent &agent)
|
||||
|
||||
LLVector3 pos_region = mRegionp->getPosRegionFromGlobal(gAgentCamera.getCameraPositionGlobal());
|
||||
|
||||
LLSurfacePatch *patchp;
|
||||
|
||||
mVisiblePatchCount = 0;
|
||||
for (S32 i=0; i<mNumberOfPatches; i++)
|
||||
for (auto& patchp : mPatchList)
|
||||
{
|
||||
patchp = mPatchList + i;
|
||||
|
||||
patchp->updateVisibility();
|
||||
if (patchp->getVisible())
|
||||
{
|
||||
@@ -832,19 +636,29 @@ BOOL LLSurface::idleUpdate(F32 max_update_time)
|
||||
|
||||
// If the Z height data has changed, we need to rebuild our
|
||||
// property line vertex arrays.
|
||||
if (mDirtyPatchList.size() > 0)
|
||||
if (!mDirtyPatchList.empty())
|
||||
{
|
||||
getRegion()->dirtyHeights();
|
||||
}
|
||||
|
||||
// Always call updateNormals() / updateVerticalStats()
|
||||
// every frame to avoid artifacts
|
||||
for(std::set<LLSurfacePatch *>::iterator iter = mDirtyPatchList.begin();
|
||||
iter != mDirtyPatchList.end(); )
|
||||
for (auto it = mDirtyPatchList.cbegin(); it != mDirtyPatchList.cend();)
|
||||
{
|
||||
std::set<LLSurfacePatch *>::iterator curiter = iter++;
|
||||
LLSurfacePatch *patchp = *curiter;
|
||||
patchp->updateNormals();
|
||||
if (it->second.expired())
|
||||
{
|
||||
LL_WARNS() << "Expired dirty patch detected. Side " << it->first << LL_ENDL;
|
||||
}
|
||||
surface_patch_ref patchp = it->second.lock();
|
||||
if (!patchp)
|
||||
{
|
||||
it = mDirtyPatchList.erase(it);
|
||||
continue;
|
||||
}
|
||||
if (patchp->updateNormals())
|
||||
{
|
||||
patchp->getSurface()->dirtySurfacePatch(patchp);
|
||||
}
|
||||
patchp->updateVerticalStats();
|
||||
if (max_update_time == 0.f || update_timer.getElapsedTimeF32() < max_update_time)
|
||||
{
|
||||
@@ -852,9 +666,11 @@ BOOL LLSurface::idleUpdate(F32 max_update_time)
|
||||
{
|
||||
did_update = TRUE;
|
||||
patchp->clearDirty();
|
||||
mDirtyPatchList.erase(curiter);
|
||||
it = mDirtyPatchList.erase(it);
|
||||
continue;
|
||||
}
|
||||
}
|
||||
++it;
|
||||
}
|
||||
return did_update;
|
||||
}
|
||||
@@ -865,7 +681,6 @@ void LLSurface::decompressDCTPatch(LLBitPack &bitpack, LLGroupHeader *gopp, BOOL
|
||||
LLPatchHeader ph;
|
||||
S32 j, i;
|
||||
S32 patch[LARGE_PATCH_SIZE*LARGE_PATCH_SIZE];
|
||||
LLSurfacePatch *patchp;
|
||||
|
||||
init_patch_decompressor(gopp->patch_size);
|
||||
gopp->stride = mGridsPerEdge;
|
||||
@@ -912,8 +727,7 @@ void LLSurface::decompressDCTPatch(LLBitPack &bitpack, LLGroupHeader *gopp, BOOL
|
||||
return;
|
||||
}
|
||||
|
||||
patchp = &mPatchList[j*mPatchesPerEdge + i];
|
||||
|
||||
const surface_patch_ref& patchp = mPatchList[j * mPatchesPerEdge + i];
|
||||
|
||||
decode_patch(bitpack, patch);
|
||||
decompress_patch(patchp->getDataZ(), patch, &ph);
|
||||
@@ -921,22 +735,26 @@ void LLSurface::decompressDCTPatch(LLBitPack &bitpack, LLGroupHeader *gopp, BOOL
|
||||
// Update edges for neighbors. Need to guarantee that this gets done before we generate vertical stats.
|
||||
patchp->updateNorthEdge();
|
||||
patchp->updateEastEdge();
|
||||
if (patchp->getNeighborPatch(WEST))
|
||||
LLSurfacePatch* neighborPatch;
|
||||
if (neighborPatch = patchp->getNeighborPatch(WEST))
|
||||
{
|
||||
patchp->getNeighborPatch(WEST)->updateEastEdge();
|
||||
neighborPatch->updateEastEdge();
|
||||
}
|
||||
if (patchp->getNeighborPatch(SOUTHWEST))
|
||||
if (neighborPatch = patchp->getNeighborPatch(SOUTHWEST))
|
||||
{
|
||||
patchp->getNeighborPatch(SOUTHWEST)->updateEastEdge();
|
||||
patchp->getNeighborPatch(SOUTHWEST)->updateNorthEdge();
|
||||
neighborPatch->updateEastEdge();
|
||||
neighborPatch->updateNorthEdge();
|
||||
}
|
||||
if (patchp->getNeighborPatch(SOUTH))
|
||||
if (neighborPatch = patchp->getNeighborPatch(SOUTH))
|
||||
{
|
||||
patchp->getNeighborPatch(SOUTH)->updateNorthEdge();
|
||||
neighborPatch->updateNorthEdge();
|
||||
}
|
||||
|
||||
// Dirty patch statistics, and flag that the patch has data.
|
||||
patchp->dirtyZ();
|
||||
if (patchp->dirtyZ())
|
||||
{
|
||||
dirtySurfacePatch(patchp);
|
||||
}
|
||||
patchp->setHasReceivedData();
|
||||
}
|
||||
}
|
||||
@@ -1089,8 +907,13 @@ LLVector3 LLSurface::resolveNormalGlobal(const LLVector3d& pos_global) const
|
||||
|
||||
}
|
||||
|
||||
LLSurfacePatch *LLSurface::resolvePatchRegion(const F32 x, const F32 y) const
|
||||
const surface_patch_ref& LLSurface::resolvePatchRegion(const F32 x, const F32 y) const
|
||||
{
|
||||
if (mPatchList.empty()) {
|
||||
LL_WARNS() << "No patches for current region!" << LL_ENDL;
|
||||
static surface_patch_ref empty;
|
||||
return empty;
|
||||
}
|
||||
// x and y should be region-local coordinates.
|
||||
// If x and y are outside of the surface, then the returned
|
||||
// index will be for the nearest boundary patch.
|
||||
@@ -1141,29 +964,24 @@ LLSurfacePatch *LLSurface::resolvePatchRegion(const F32 x, const F32 y) const
|
||||
|
||||
// *NOTE: Super paranoia code follows.
|
||||
S32 index = i + j * mPatchesPerEdge;
|
||||
if((index < 0) || (index >= mNumberOfPatches))
|
||||
if((index < 0) || (index >= mPatchList.size()))
|
||||
{
|
||||
if(0 == mNumberOfPatches)
|
||||
{
|
||||
LL_WARNS() << "No patches for current region!" << LL_ENDL;
|
||||
return NULL;
|
||||
}
|
||||
S32 old_index = index;
|
||||
index = llclamp(old_index, 0, (mNumberOfPatches - 1));
|
||||
index = llclamp(old_index, 0, ((S32)mPatchList.size() - 1));
|
||||
LL_WARNS() << "Clamping out of range patch index " << old_index
|
||||
<< " to " << index << LL_ENDL;
|
||||
}
|
||||
return &(mPatchList[index]);
|
||||
return mPatchList[index];
|
||||
}
|
||||
|
||||
|
||||
LLSurfacePatch *LLSurface::resolvePatchRegion(const LLVector3 &pos_region) const
|
||||
const surface_patch_ref& LLSurface::resolvePatchRegion(const LLVector3 &pos_region) const
|
||||
{
|
||||
return resolvePatchRegion(pos_region.mV[VX], pos_region.mV[VY]);
|
||||
}
|
||||
|
||||
|
||||
LLSurfacePatch *LLSurface::resolvePatchGlobal(const LLVector3d &pos_global) const
|
||||
const surface_patch_ref& LLSurface::resolvePatchGlobal(const LLVector3d &pos_global) const
|
||||
{
|
||||
llassert(mRegionp);
|
||||
LLVector3 pos_region = mRegionp->getPosRegionFromGlobal(pos_global);
|
||||
@@ -1192,37 +1010,28 @@ void LLSurface::createPatchData()
|
||||
// Assumes mGridsPerEdge, mGridsPerPatchEdge, and mPatchesPerEdge have been properly set
|
||||
// TODO -- check for create() called when surface is not empty
|
||||
S32 i, j;
|
||||
LLSurfacePatch *patchp;
|
||||
|
||||
// Allocate memory
|
||||
mPatchList = new LLSurfacePatch[mNumberOfPatches];
|
||||
|
||||
// One of each for each camera
|
||||
mVisiblePatchCount = mNumberOfPatches;
|
||||
|
||||
for (j=0; j<mPatchesPerEdge; j++)
|
||||
mPatchList.resize(mPatchesPerEdge * mPatchesPerEdge);
|
||||
for (S32 i = 0; i < mPatchList.size(); ++i)
|
||||
{
|
||||
for (i=0; i<mPatchesPerEdge; i++)
|
||||
{
|
||||
patchp = getPatch(i, j);
|
||||
patchp->setSurface(this);
|
||||
}
|
||||
mPatchList[i] = std::make_shared<LLSurfacePatch>(this, i);
|
||||
}
|
||||
|
||||
// One of each for each camera
|
||||
mVisiblePatchCount = mPatchList.size();
|
||||
|
||||
for (j=0; j<mPatchesPerEdge; j++)
|
||||
{
|
||||
for (i=0; i<mPatchesPerEdge; i++)
|
||||
{
|
||||
patchp = getPatch(i, j);
|
||||
patchp->mHasReceivedData = FALSE;
|
||||
patchp->mSTexUpdate = TRUE;
|
||||
const auto& patchp = getPatch(i, j);
|
||||
|
||||
S32 data_offset = i * mGridsPerPatchEdge + j * mGridsPerPatchEdge * mGridsPerEdge;
|
||||
|
||||
patchp->setDataZ(mSurfaceZ + data_offset);
|
||||
patchp->setDataNorm(mNorm + data_offset);
|
||||
|
||||
|
||||
// We make each patch point to its neighbors so we can do resolution checking
|
||||
// when butting up different resolutions. Patches that don't have neighbors
|
||||
// somewhere will point to NULL on that side.
|
||||
@@ -1311,9 +1120,7 @@ void LLSurface::createPatchData()
|
||||
void LLSurface::destroyPatchData()
|
||||
{
|
||||
// Delete all of the cached patch data for these patches.
|
||||
|
||||
delete [] mPatchList;
|
||||
mPatchList = NULL;
|
||||
mPatchList.clear();
|
||||
mVisiblePatchCount = 0;
|
||||
}
|
||||
|
||||
@@ -1336,36 +1143,50 @@ U32 LLSurface::getRenderStride(const U32 render_level) const
|
||||
}
|
||||
|
||||
|
||||
LLSurfacePatch *LLSurface::getPatch(const S32 x, const S32 y) const
|
||||
const surface_patch_ref& LLSurface::getPatch(const S32 x, const S32 y) const
|
||||
{
|
||||
static surface_patch_ref empty(nullptr);
|
||||
if ((x < 0) || (x >= mPatchesPerEdge))
|
||||
{
|
||||
LL_WARNS() << "Asking for patch out of bounds" << LL_ENDL;
|
||||
return NULL;
|
||||
return empty;
|
||||
}
|
||||
if ((y < 0) || (y >= mPatchesPerEdge))
|
||||
{
|
||||
LL_WARNS() << "Asking for patch out of bounds" << LL_ENDL;
|
||||
return NULL;
|
||||
return empty;
|
||||
}
|
||||
|
||||
return mPatchList + x + y*mPatchesPerEdge;
|
||||
return mPatchList[x + y*mPatchesPerEdge];
|
||||
}
|
||||
|
||||
|
||||
void LLSurface::dirtyAllPatches()
|
||||
{
|
||||
S32 i;
|
||||
for (i = 0; i < mNumberOfPatches; i++)
|
||||
for (auto& patchp : mPatchList)
|
||||
{
|
||||
mPatchList[i].dirtyZ();
|
||||
if (patchp->dirtyZ())
|
||||
{
|
||||
dirtySurfacePatch(patchp);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void LLSurface::dirtySurfacePatch(LLSurfacePatch *patchp)
|
||||
void LLSurface::dirtySurfacePatch(const surface_patch_ref& patchp)
|
||||
{
|
||||
if (!patchp)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
// Put surface patch on dirty surface patch list
|
||||
mDirtyPatchList.insert(patchp);
|
||||
if (std::find_if(mDirtyPatchList.begin(), mDirtyPatchList.end(),
|
||||
[&patchp](std::pair<U32, std::weak_ptr<LLSurfacePatch > >& entry) -> bool {
|
||||
return entry.second.lock().get() == patchp.get();
|
||||
}) == mDirtyPatchList.end())
|
||||
{
|
||||
mDirtyPatchList.push_back(std::make_pair(patchp->getSide(), patchp));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -60,9 +60,12 @@ static const S32 ONE_LESS_THAN_NEIGHBOR = -1;
|
||||
const S32 ABOVE_WATERLINE_ALPHA = 32; // The alpha of water when the land elevation is above the waterline.
|
||||
|
||||
class LLViewerRegion;
|
||||
class LLSurfacePatch;
|
||||
class LLBitPack;
|
||||
class LLGroupHeader;
|
||||
class LLSurfacePatch;
|
||||
|
||||
typedef std::shared_ptr<LLSurfacePatch> surface_patch_ref;
|
||||
typedef std::weak_ptr<LLSurfacePatch> surface_patch_weak_ref;
|
||||
|
||||
class LLSurface
|
||||
{
|
||||
@@ -82,7 +85,7 @@ public:
|
||||
void setOriginGlobal(const LLVector3d &origin_global);
|
||||
|
||||
void connectNeighbor(LLSurface *neighborp, U32 direction);
|
||||
void disconnectNeighbor(LLSurface *neighborp);
|
||||
void disconnectNeighbor(LLSurface *neighborp, U32 direction);
|
||||
void disconnectAllNeighbors();
|
||||
|
||||
// <FS:CR> Aurora Sim
|
||||
@@ -111,9 +114,9 @@ public:
|
||||
F32 resolveHeightGlobal(const LLVector3d &position_global) const;
|
||||
LLVector3 resolveNormalGlobal(const LLVector3d& v) const; // Returns normal to surface
|
||||
|
||||
LLSurfacePatch *resolvePatchRegion(const F32 x, const F32 y) const;
|
||||
LLSurfacePatch *resolvePatchRegion(const LLVector3 &position_region) const;
|
||||
LLSurfacePatch *resolvePatchGlobal(const LLVector3d &position_global) const;
|
||||
const surface_patch_ref& resolvePatchRegion(const F32 x, const F32 y) const;
|
||||
const surface_patch_ref& resolvePatchRegion(const LLVector3 &position_region) const;
|
||||
const surface_patch_ref& resolvePatchGlobal(const LLVector3d &position_global) const;
|
||||
|
||||
// Update methods (called during idle, normally)
|
||||
BOOL idleUpdate(F32 max_update_time);
|
||||
@@ -136,7 +139,7 @@ public:
|
||||
|
||||
void dirtyAllPatches(); // Use this to dirty all patches when changing terrain parameters
|
||||
|
||||
void dirtySurfacePatch(LLSurfacePatch *patchp);
|
||||
void dirtySurfacePatch(const surface_patch_ref& patchp);
|
||||
LLVOWater *getWaterObj() { return mWaterObjp; }
|
||||
|
||||
static void setTextureSize(const S32 texture_size);
|
||||
@@ -155,8 +158,6 @@ public:
|
||||
F32 mOOGridsPerEdge; // Inverse of grids per edge
|
||||
|
||||
S32 mPatchesPerEdge; // Number of patches on one side of a region
|
||||
S32 mNumberOfPatches; // Total number of patches
|
||||
|
||||
|
||||
// Each surface points at 8 neighbors (or NULL)
|
||||
// +---+---+---+
|
||||
@@ -191,11 +192,11 @@ protected:
|
||||
|
||||
//F32 updateTexture(LLSurfacePatch *ppatch);
|
||||
|
||||
LLSurfacePatch *getPatch(const S32 x, const S32 y) const;
|
||||
const surface_patch_ref& getPatch(const S32 x, const S32 y) const;
|
||||
|
||||
protected:
|
||||
LLVector3d mOriginGlobal; // In absolute frame
|
||||
LLSurfacePatch *mPatchList; // Array of all patches
|
||||
std::vector< surface_patch_ref > mPatchList; // Array of all patches
|
||||
|
||||
// Array of grid data, mGridsPerEdge * mGridsPerEdge
|
||||
F32 *mSurfaceZ;
|
||||
@@ -203,7 +204,7 @@ protected:
|
||||
// Array of grid normals, mGridsPerEdge * mGridsPerEdge
|
||||
LLVector3 *mNorm;
|
||||
|
||||
std::set<LLSurfacePatch *> mDirtyPatchList;
|
||||
std::vector< std::pair<U32, surface_patch_weak_ref > > mDirtyPatchList;
|
||||
|
||||
|
||||
// The textures should never be directly initialized - use the setter methods!
|
||||
|
||||
@@ -47,9 +47,9 @@ extern bool gShiftFrame;
|
||||
extern U64MicrosecondsImplicit gFrameTime;
|
||||
extern LLPipeline gPipeline;
|
||||
|
||||
LLSurfacePatch::LLSurfacePatch()
|
||||
LLSurfacePatch::LLSurfacePatch(LLSurface* surface, U32 side)
|
||||
: mHasReceivedData(FALSE),
|
||||
mSTexUpdate(FALSE),
|
||||
mSTexUpdate(TRUE),
|
||||
mDirty(FALSE),
|
||||
mDirtyZStats(TRUE),
|
||||
mHeightsGenerated(FALSE),
|
||||
@@ -70,17 +70,12 @@ LLSurfacePatch::LLSurfacePatch()
|
||||
// set to non-zero values by higher classes.
|
||||
mConnectedEdge(NO_EDGE),
|
||||
mLastUpdateTime(0),
|
||||
mSurfacep(NULL)
|
||||
{
|
||||
S32 i;
|
||||
for (i = 0; i < 8; i++)
|
||||
{
|
||||
setNeighborPatch(i, NULL);
|
||||
}
|
||||
for (i = 0; i < 9; i++)
|
||||
{
|
||||
mNormalsInvalid[i] = TRUE;
|
||||
}
|
||||
mSurfacep(NULL),
|
||||
mNeighborPatches{ 0,0,0,0,0,0,0,0 },
|
||||
mNormalsInvalid{ 1,1,1,1,1,1,1,1,1 },
|
||||
mSide(side)
|
||||
{
|
||||
setSurface(surface);
|
||||
}
|
||||
|
||||
|
||||
@@ -90,7 +85,7 @@ LLSurfacePatch::~LLSurfacePatch()
|
||||
}
|
||||
|
||||
|
||||
void LLSurfacePatch::dirty()
|
||||
bool LLSurfacePatch::dirty()
|
||||
{
|
||||
// These are outside of the loop in case we're still waiting for a dirty from the
|
||||
// texture being updated...
|
||||
@@ -109,8 +104,9 @@ void LLSurfacePatch::dirty()
|
||||
if (!mDirty)
|
||||
{
|
||||
mDirty = TRUE;
|
||||
mSurfacep->dirtySurfacePatch(this);
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
@@ -133,45 +129,31 @@ void LLSurfacePatch::disconnectNeighbor(LLSurface *surfacep)
|
||||
U32 i;
|
||||
for (i = 0; i < 8; i++)
|
||||
{
|
||||
if (getNeighborPatch(i))
|
||||
const auto& patch = getNeighborPatch(i);
|
||||
if (patch)
|
||||
{
|
||||
if (getNeighborPatch(i)->mSurfacep == surfacep)
|
||||
if (patch->mSurfacep == surfacep)
|
||||
{
|
||||
if (EAST == i)
|
||||
{
|
||||
mConnectedEdge &= EAST_EDGE;
|
||||
}
|
||||
else if (NORTH == i)
|
||||
{
|
||||
mConnectedEdge &= NORTH_EDGE;
|
||||
}
|
||||
else if (WEST == i)
|
||||
{
|
||||
mConnectedEdge &= WEST_EDGE;
|
||||
}
|
||||
else if (SOUTH == i)
|
||||
{
|
||||
mConnectedEdge &= SOUTH_EDGE;
|
||||
}
|
||||
setNeighborPatch(i, NULL);
|
||||
mNormalsInvalid[i] = TRUE;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Clean up connected edges
|
||||
if (getNeighborPatch(EAST))
|
||||
{
|
||||
if (getNeighborPatch(EAST)->mSurfacep == surfacep)
|
||||
{
|
||||
mConnectedEdge &= ~EAST_EDGE;
|
||||
}
|
||||
}
|
||||
if (getNeighborPatch(NORTH))
|
||||
{
|
||||
if (getNeighborPatch(NORTH)->mSurfacep == surfacep)
|
||||
{
|
||||
mConnectedEdge &= ~NORTH_EDGE;
|
||||
}
|
||||
}
|
||||
if (getNeighborPatch(WEST))
|
||||
{
|
||||
if (getNeighborPatch(WEST)->mSurfacep == surfacep)
|
||||
{
|
||||
mConnectedEdge &= ~WEST_EDGE;
|
||||
}
|
||||
}
|
||||
if (getNeighborPatch(SOUTH))
|
||||
{
|
||||
if (getNeighborPatch(SOUTH)->mSurfacep == surfacep)
|
||||
{
|
||||
mConnectedEdge &= ~SOUTH_EDGE;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
LLVector3 LLSurfacePatch::getPointAgent(const U32 x, const U32 y) const
|
||||
@@ -283,64 +265,65 @@ void LLSurfacePatch::calcNormal(const U32 x, const U32 y, const U32 stride)
|
||||
{
|
||||
for (j = 0; j < 2; j++)
|
||||
{
|
||||
LLSurfacePatch* patch;
|
||||
if (poffsets[i][j][0] < 0)
|
||||
{
|
||||
if (!ppatches[i][j]->getNeighborPatch(WEST))
|
||||
if (patch = ppatches[i][j]->getNeighborPatch(WEST))
|
||||
{
|
||||
poffsets[i][j][0] = 0;
|
||||
// <FS:CR> Aurora Sim
|
||||
ppatches[i][j] = patch;
|
||||
poffsets[i][j][0] += patch_width;
|
||||
poffsets[i][j][2] = patch->getSurface()->getGridsPerEdge();
|
||||
// </FS:CR> Aurora Sim
|
||||
}
|
||||
else
|
||||
{
|
||||
// <FS:CR> Aurora Sim
|
||||
ppatches[i][j] = ppatches[i][j]->getNeighborPatch(WEST);
|
||||
poffsets[i][j][0] += patch_width;
|
||||
poffsets[i][j][2] = ppatches[i][j]->getSurface()->getGridsPerEdge();
|
||||
// </FS:CR> Aurora Sim
|
||||
poffsets[i][j][0] = 0;
|
||||
}
|
||||
}
|
||||
if (poffsets[i][j][1] < 0)
|
||||
{
|
||||
if (!ppatches[i][j]->getNeighborPatch(SOUTH))
|
||||
if (patch = ppatches[i][j]->getNeighborPatch(SOUTH))
|
||||
{
|
||||
poffsets[i][j][1] = 0;
|
||||
// <FS:CR> Aurora Sim
|
||||
ppatches[i][j] = patch;
|
||||
poffsets[i][j][1] += patch_width;
|
||||
poffsets[i][j][2] = patch->getSurface()->getGridsPerEdge();
|
||||
// </FS>CR> Aurora Sim
|
||||
}
|
||||
else
|
||||
{
|
||||
// <FS:CR> Aurora Sim
|
||||
ppatches[i][j] = ppatches[i][j]->getNeighborPatch(SOUTH);
|
||||
poffsets[i][j][1] += patch_width;
|
||||
poffsets[i][j][2] = ppatches[i][j]->getSurface()->getGridsPerEdge();
|
||||
// </FS>CR> Aurora Sim
|
||||
poffsets[i][j][1] = 0;
|
||||
}
|
||||
}
|
||||
if (poffsets[i][j][0] >= (S32)patch_width)
|
||||
{
|
||||
if (!ppatches[i][j]->getNeighborPatch(EAST))
|
||||
if (patch = ppatches[i][j]->getNeighborPatch(EAST))
|
||||
{
|
||||
poffsets[i][j][0] = patch_width - 1;
|
||||
// <FS:CR> Aurora Sim
|
||||
ppatches[i][j] = patch;
|
||||
poffsets[i][j][0] -= patch_width;
|
||||
poffsets[i][j][2] = patch->getSurface()->getGridsPerEdge();
|
||||
// </FS:CR> Aurora Sim
|
||||
}
|
||||
else
|
||||
{
|
||||
// <FS:CR> Aurora Sim
|
||||
ppatches[i][j] = ppatches[i][j]->getNeighborPatch(EAST);
|
||||
poffsets[i][j][0] -= patch_width;
|
||||
poffsets[i][j][2] = ppatches[i][j]->getSurface()->getGridsPerEdge();
|
||||
// </FS:CR> Aurora Sim
|
||||
poffsets[i][j][0] = patch_width - 1;
|
||||
}
|
||||
}
|
||||
if (poffsets[i][j][1] >= (S32)patch_width)
|
||||
{
|
||||
if (!ppatches[i][j]->getNeighborPatch(NORTH))
|
||||
if (patch = ppatches[i][j]->getNeighborPatch(NORTH))
|
||||
{
|
||||
poffsets[i][j][1] = patch_width - 1;
|
||||
// <FS:CR> Aurora Sim
|
||||
ppatches[i][j] = patch;
|
||||
poffsets[i][j][1] -= patch_width;
|
||||
poffsets[i][j][2] = patch->getSurface()->getGridsPerEdge();
|
||||
// </FS:CR> Aurora Sim
|
||||
}
|
||||
else
|
||||
{
|
||||
// <FS:CR> Aurora Sim
|
||||
ppatches[i][j] = ppatches[i][j]->getNeighborPatch(NORTH);
|
||||
poffsets[i][j][1] -= patch_width;
|
||||
poffsets[i][j][2] = ppatches[i][j]->getSurface()->getGridsPerEdge();
|
||||
// </FS:CR> Aurora Sim
|
||||
poffsets[i][j][1] = patch_width - 1;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -474,11 +457,11 @@ void LLSurfacePatch::updateVerticalStats()
|
||||
}
|
||||
|
||||
|
||||
void LLSurfacePatch::updateNormals()
|
||||
bool LLSurfacePatch::updateNormals()
|
||||
{
|
||||
if (mSurfacep->mType == 'w')
|
||||
{
|
||||
return;
|
||||
return false;
|
||||
}
|
||||
U32 grids_per_patch_edge = mSurfacep->getGridsPerPatchEdge();
|
||||
U32 grids_per_edge = mSurfacep->getGridsPerEdge();
|
||||
@@ -515,10 +498,12 @@ void LLSurfacePatch::updateNormals()
|
||||
// update the west edge
|
||||
if (mNormalsInvalid[NORTHWEST] || mNormalsInvalid[WEST] || mNormalsInvalid[SOUTHWEST])
|
||||
{
|
||||
LLSurfacePatch* northwest_patchp = getNeighborPatch(NORTHWEST);
|
||||
LLSurfacePatch* north_patchp = getNeighborPatch(NORTH);
|
||||
// <FS:CR> Aurora Sim
|
||||
if (!getNeighborPatch(NORTH) && getNeighborPatch(NORTHWEST) && getNeighborPatch(NORTHWEST)->getHasReceivedData())
|
||||
if (!north_patchp && northwest_patchp && northwest_patchp->getHasReceivedData())
|
||||
{
|
||||
*(mDataZ + grids_per_patch_edge*grids_per_edge) = *(getNeighborPatch(NORTHWEST)->mDataZ + grids_per_patch_edge);
|
||||
*(mDataZ + grids_per_patch_edge*grids_per_edge) = *(northwest_patchp->mDataZ + grids_per_patch_edge);
|
||||
}
|
||||
// </FS:CR> Aurora Sim
|
||||
|
||||
@@ -533,10 +518,12 @@ void LLSurfacePatch::updateNormals()
|
||||
// update the south edge
|
||||
if (mNormalsInvalid[SOUTHWEST] || mNormalsInvalid[SOUTH] || mNormalsInvalid[SOUTHEAST])
|
||||
{
|
||||
LLSurfacePatch* southeast_patchp = getNeighborPatch(SOUTHEAST);
|
||||
LLSurfacePatch* east_patchp = getNeighborPatch(EAST);
|
||||
// <FS:CR> Aurora Sim
|
||||
if (!getNeighborPatch(EAST) && getNeighborPatch(SOUTHEAST) && getNeighborPatch(SOUTHEAST)->getHasReceivedData())
|
||||
if (!east_patchp && southeast_patchp && southeast_patchp->getHasReceivedData())
|
||||
{
|
||||
*(mDataZ + grids_per_patch_edge) = *(getNeighborPatch(SOUTHEAST)->mDataZ + grids_per_patch_edge * getNeighborPatch(SOUTHEAST)->getSurface()->getGridsPerEdge());
|
||||
*(mDataZ + grids_per_patch_edge) = *(southeast_patchp->mDataZ + grids_per_patch_edge * southeast_patchp->getSurface()->getGridsPerEdge());
|
||||
}
|
||||
// </FS:CR> Aurora Sim
|
||||
|
||||
@@ -552,11 +539,14 @@ void LLSurfacePatch::updateNormals()
|
||||
// we'll want to do different things.
|
||||
if (mNormalsInvalid[NORTHEAST])
|
||||
{
|
||||
if (!getNeighborPatch(NORTHEAST))
|
||||
LLSurfacePatch* northeast_patchp = getNeighborPatch(NORTHEAST);
|
||||
LLSurfacePatch* north_patchp = getNeighborPatch(NORTH);
|
||||
LLSurfacePatch* east_patchp = getNeighborPatch(EAST);
|
||||
if (!northeast_patchp)
|
||||
{
|
||||
if (!getNeighborPatch(NORTH))
|
||||
if (!north_patchp)
|
||||
{
|
||||
if (!getNeighborPatch(EAST))
|
||||
if (!east_patchp)
|
||||
{
|
||||
// No north or east neighbors. Pull from the diagonal in your own patch.
|
||||
*(mDataZ + grids_per_patch_edge + grids_per_patch_edge*grids_per_edge) =
|
||||
@@ -564,13 +554,13 @@ void LLSurfacePatch::updateNormals()
|
||||
}
|
||||
else
|
||||
{
|
||||
if (getNeighborPatch(EAST)->getHasReceivedData())
|
||||
if (east_patchp->getHasReceivedData())
|
||||
{
|
||||
// East, but not north. Pull from your east neighbor's northwest point.
|
||||
*(mDataZ + grids_per_patch_edge + grids_per_patch_edge*grids_per_edge) =
|
||||
// <FS:CR> Aurora Sim
|
||||
//*(getNeighborPatch(EAST)->mDataZ + (grids_per_patch_edge - 1)*grids_per_edge);
|
||||
*(getNeighborPatch(EAST)->mDataZ + (getNeighborPatch(EAST)->getSurface()->getGridsPerPatchEdge() - 1)*getNeighborPatch(EAST)->getSurface()->getGridsPerEdge());
|
||||
*(east_patchp->mDataZ + (east_patchp->getSurface()->getGridsPerPatchEdge() - 1)* east_patchp->getSurface()->getGridsPerEdge());
|
||||
// </FS:CR> Aurora Sim
|
||||
}
|
||||
else
|
||||
@@ -583,7 +573,7 @@ void LLSurfacePatch::updateNormals()
|
||||
else
|
||||
{
|
||||
// We have a north.
|
||||
if (getNeighborPatch(EAST))
|
||||
if (east_patchp)
|
||||
{
|
||||
// North and east neighbors, but not northeast.
|
||||
// Pull from diagonal in your own patch.
|
||||
@@ -592,13 +582,13 @@ void LLSurfacePatch::updateNormals()
|
||||
}
|
||||
else
|
||||
{
|
||||
if (getNeighborPatch(NORTH)->getHasReceivedData())
|
||||
if (north_patchp->getHasReceivedData())
|
||||
{
|
||||
// North, but not east. Pull from your north neighbor's southeast corner.
|
||||
*(mDataZ + grids_per_patch_edge + grids_per_patch_edge*grids_per_edge) =
|
||||
// <FS:CR> Aurora Sim
|
||||
//*(getNeighborPatch(NORTH)->mDataZ + (grids_per_patch_edge - 1));
|
||||
*(getNeighborPatch(NORTH)->mDataZ + (getNeighborPatch(NORTH)->getSurface()->getGridsPerPatchEdge() - 1));
|
||||
*(north_patchp->mDataZ + (north_patchp->getSurface()->getGridsPerPatchEdge() - 1));
|
||||
// </FS:CR> Aurora Sim
|
||||
}
|
||||
else
|
||||
@@ -609,25 +599,25 @@ void LLSurfacePatch::updateNormals()
|
||||
}
|
||||
}
|
||||
}
|
||||
else if (getNeighborPatch(NORTHEAST)->mSurfacep != mSurfacep)
|
||||
else if (northeast_patchp->mSurfacep != mSurfacep)
|
||||
{
|
||||
if (
|
||||
(!getNeighborPatch(NORTH) || (getNeighborPatch(NORTH)->mSurfacep != mSurfacep))
|
||||
(!north_patchp || (north_patchp->mSurfacep != mSurfacep))
|
||||
&&
|
||||
(!getNeighborPatch(EAST) || (getNeighborPatch(EAST)->mSurfacep != mSurfacep)))
|
||||
(!east_patchp || (east_patchp->mSurfacep != mSurfacep)))
|
||||
{
|
||||
// <FS:CR> Aurora Sim
|
||||
U32 own_xpos, own_ypos, neighbor_xpos, neighbor_ypos;
|
||||
S32 own_offset = 0, neighbor_offset = 0;
|
||||
from_region_handle(mSurfacep->getRegion()->getHandle(), &own_xpos, &own_ypos);
|
||||
from_region_handle(getNeighborPatch(NORTHEAST)->mSurfacep->getRegion()->getHandle(), &neighbor_xpos, &neighbor_ypos);
|
||||
from_region_handle(northeast_patchp->mSurfacep->getRegion()->getHandle(), &neighbor_xpos, &neighbor_ypos);
|
||||
if (own_ypos >= neighbor_ypos)
|
||||
neighbor_offset = own_ypos - neighbor_ypos;
|
||||
else
|
||||
own_offset = neighbor_ypos - own_ypos;
|
||||
|
||||
*(mDataZ + grids_per_patch_edge + grids_per_patch_edge*grids_per_edge) =
|
||||
*(getNeighborPatch(NORTHEAST)->mDataZ + (grids_per_edge + neighbor_offset - own_offset - 1) * getNeighborPatch(NORTHEAST)->getSurface()->getGridsPerEdge());
|
||||
*(northeast_patchp->mDataZ + (grids_per_edge + neighbor_offset - own_offset - 1) * northeast_patchp->getSurface()->getGridsPerEdge());
|
||||
// </FS:CR> Aurora Sim
|
||||
}
|
||||
}
|
||||
@@ -656,15 +646,12 @@ void LLSurfacePatch::updateNormals()
|
||||
dirty_patch = TRUE;
|
||||
}
|
||||
|
||||
if (dirty_patch)
|
||||
{
|
||||
mSurfacep->dirtySurfacePatch(this);
|
||||
}
|
||||
|
||||
for (i = 0; i < 9; i++)
|
||||
{
|
||||
mNormalsInvalid[i] = FALSE;
|
||||
}
|
||||
|
||||
return dirty_patch;
|
||||
}
|
||||
|
||||
void LLSurfacePatch::updateEastEdge()
|
||||
@@ -719,7 +706,8 @@ void LLSurfacePatch::updateNorthEdge()
|
||||
U32 i;
|
||||
F32 *south_surface, *north_surface;
|
||||
|
||||
if (!getNeighborPatch(NORTH))
|
||||
LLSurfacePatch* patchp = getNeighborPatch(NORTH);
|
||||
if (!patchp)
|
||||
{
|
||||
south_surface = mDataZ + grids_per_patch_edge*grids_per_edge;
|
||||
north_surface = mDataZ + (grids_per_patch_edge - 1) * grids_per_edge;
|
||||
@@ -727,7 +715,7 @@ void LLSurfacePatch::updateNorthEdge()
|
||||
else if (mConnectedEdge & NORTH_EDGE)
|
||||
{
|
||||
south_surface = mDataZ + grids_per_patch_edge*grids_per_edge;
|
||||
north_surface = getNeighborPatch(NORTH)->mDataZ;
|
||||
north_surface = patchp->mDataZ;
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -748,10 +736,11 @@ BOOL LLSurfacePatch::updateTexture()
|
||||
F32 meters_per_grid = getSurface()->getMetersPerGrid();
|
||||
F32 grids_per_patch_edge = (F32)getSurface()->getGridsPerPatchEdge();
|
||||
|
||||
if ((!getNeighborPatch(EAST) || getNeighborPatch(EAST)->getHasReceivedData())
|
||||
&& (!getNeighborPatch(WEST) || getNeighborPatch(WEST)->getHasReceivedData())
|
||||
&& (!getNeighborPatch(SOUTH) || getNeighborPatch(SOUTH)->getHasReceivedData())
|
||||
&& (!getNeighborPatch(NORTH) || getNeighborPatch(NORTH)->getHasReceivedData()))
|
||||
LLSurfacePatch* patchp;
|
||||
if ((!(patchp = getNeighborPatch(EAST)) || patchp->getHasReceivedData())
|
||||
&& (!(patchp = getNeighborPatch(WEST)) || patchp->getHasReceivedData())
|
||||
&& (!(patchp = getNeighborPatch(SOUTH)) || patchp->getHasReceivedData())
|
||||
&& (!(patchp = getNeighborPatch(NORTH)) || patchp->getHasReceivedData()))
|
||||
{
|
||||
LLViewerRegion *regionp = getSurface()->getRegion();
|
||||
LLVector3d origin_region = getOriginGlobal() - getSurface()->getOriginGlobal();
|
||||
@@ -813,7 +802,7 @@ void LLSurfacePatch::updateGL()
|
||||
}
|
||||
}
|
||||
|
||||
void LLSurfacePatch::dirtyZ()
|
||||
bool LLSurfacePatch::dirtyZ()
|
||||
{
|
||||
mSTexUpdate = TRUE;
|
||||
|
||||
@@ -827,20 +816,36 @@ void LLSurfacePatch::dirtyZ()
|
||||
// Invalidate normals in this and neighboring patches
|
||||
for (i = 0; i < 8; i++)
|
||||
{
|
||||
if (getNeighborPatch(i))
|
||||
if (mNeighborPatches[i] == nullptr)
|
||||
{
|
||||
getNeighborPatch(i)->mNormalsInvalid[gDirOpposite[i]] = TRUE;
|
||||
getNeighborPatch(i)->dirty();
|
||||
continue;
|
||||
}
|
||||
if (mNeighborPatches[i]->expired())
|
||||
{
|
||||
LL_WARNS() << "Expired neighbor patch detected. Side " << i << LL_ENDL;
|
||||
delete mNeighborPatches[i];
|
||||
mNeighborPatches[i] = nullptr;
|
||||
continue;
|
||||
}
|
||||
const surface_patch_ref& patchp = mNeighborPatches[i]->lock();
|
||||
if (patchp)
|
||||
{
|
||||
patchp->mNormalsInvalid[gDirOpposite[i]] = TRUE;
|
||||
if (patchp->dirty())
|
||||
{
|
||||
patchp->getSurface()->dirtySurfacePatch(patchp);
|
||||
}
|
||||
if (i < 4)
|
||||
{
|
||||
getNeighborPatch(i)->mNormalsInvalid[gDirAdjacent[gDirOpposite[i]][0]] = TRUE;
|
||||
getNeighborPatch(i)->mNormalsInvalid[gDirAdjacent[gDirOpposite[i]][1]] = TRUE;
|
||||
patchp->mNormalsInvalid[gDirAdjacent[gDirOpposite[i]][0]] = TRUE;
|
||||
patchp->mNormalsInvalid[gDirAdjacent[gDirOpposite[i]][1]] = TRUE;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
dirty();
|
||||
mLastUpdateTime = gFrameTime;
|
||||
|
||||
return dirty();
|
||||
}
|
||||
|
||||
|
||||
@@ -877,35 +882,29 @@ void LLSurfacePatch::setOriginGlobal(const LLVector3d &origin_global)
|
||||
|
||||
}
|
||||
|
||||
void LLSurfacePatch::connectNeighbor(LLSurfacePatch *neighbor_patchp, const U32 direction)
|
||||
void LLSurfacePatch::connectNeighbor(const surface_patch_ref& neighbor_patchp, const U32 direction)
|
||||
{
|
||||
llassert(neighbor_patchp);
|
||||
if (!neighbor_patchp) return;
|
||||
mNormalsInvalid[direction] = TRUE;
|
||||
neighbor_patchp->mNormalsInvalid[gDirOpposite[direction]] = TRUE;
|
||||
|
||||
setNeighborPatch(direction, neighbor_patchp);
|
||||
neighbor_patchp->setNeighborPatch(gDirOpposite[direction], this);
|
||||
|
||||
if (EAST == direction)
|
||||
{
|
||||
mConnectedEdge |= EAST_EDGE;
|
||||
neighbor_patchp->mConnectedEdge |= WEST_EDGE;
|
||||
}
|
||||
else if (NORTH == direction)
|
||||
{
|
||||
mConnectedEdge |= NORTH_EDGE;
|
||||
neighbor_patchp->mConnectedEdge |= SOUTH_EDGE;
|
||||
}
|
||||
else if (WEST == direction)
|
||||
{
|
||||
mConnectedEdge |= WEST_EDGE;
|
||||
neighbor_patchp->mConnectedEdge |= EAST_EDGE;
|
||||
}
|
||||
else if (SOUTH == direction)
|
||||
{
|
||||
mConnectedEdge |= SOUTH_EDGE;
|
||||
neighbor_patchp->mConnectedEdge |= NORTH_EDGE;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -963,13 +962,14 @@ void LLSurfacePatch::updateVisibility()
|
||||
if (mVObjp)
|
||||
{
|
||||
mVObjp->dirtyGeom();
|
||||
if (getNeighborPatch(WEST))
|
||||
LLSurfacePatch* patchp;
|
||||
if (patchp = getNeighborPatch(WEST))
|
||||
{
|
||||
getNeighborPatch(WEST)->mVObjp->dirtyGeom();
|
||||
patchp->mVObjp->dirtyGeom();
|
||||
}
|
||||
if (getNeighborPatch(SOUTH))
|
||||
if (patchp = getNeighborPatch(SOUTH))
|
||||
{
|
||||
getNeighborPatch(SOUTH)->mVObjp->dirtyGeom();
|
||||
patchp->mVObjp->dirtyGeom();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1074,9 +1074,21 @@ F32 LLSurfacePatch::getMaxComposition() const
|
||||
return mMaxComposition;
|
||||
}
|
||||
|
||||
void LLSurfacePatch::setNeighborPatch(const U32 direction, LLSurfacePatch *neighborp)
|
||||
void LLSurfacePatch::setNeighborPatch(const U32 direction, const surface_patch_ref& neighborp)
|
||||
{
|
||||
mNeighborPatches[direction] = neighborp;
|
||||
if (!neighborp)
|
||||
{
|
||||
delete mNeighborPatches[direction];
|
||||
mNeighborPatches[direction] = nullptr;
|
||||
}
|
||||
else
|
||||
{
|
||||
if (mNeighborPatches[direction] == nullptr)
|
||||
{
|
||||
mNeighborPatches[direction] = new surface_patch_weak_ref();
|
||||
}
|
||||
*mNeighborPatches[direction] = neighborp;
|
||||
}
|
||||
mNormalsInvalid[direction] = TRUE;
|
||||
if (direction < 4)
|
||||
{
|
||||
@@ -1087,7 +1099,15 @@ void LLSurfacePatch::setNeighborPatch(const U32 direction, LLSurfacePatch *neigh
|
||||
|
||||
LLSurfacePatch *LLSurfacePatch::getNeighborPatch(const U32 direction) const
|
||||
{
|
||||
return mNeighborPatches[direction];
|
||||
if (mNeighborPatches[direction] == nullptr)
|
||||
{
|
||||
return nullptr;
|
||||
}
|
||||
else if (mNeighborPatches[direction]->expired())
|
||||
{
|
||||
LL_WARNS() << "Expired neighbor patch detected. Side " << direction << LL_ENDL;
|
||||
}
|
||||
return mNeighborPatches[direction]->lock().get();
|
||||
}
|
||||
|
||||
void LLSurfacePatch::clearVObj()
|
||||
|
||||
@@ -43,6 +43,10 @@ class LLVector2;
|
||||
class LLColor4U;
|
||||
class LLAgent;
|
||||
|
||||
class LLSurfacePatch;
|
||||
typedef std::shared_ptr<LLSurfacePatch> surface_patch_ref;
|
||||
typedef std::weak_ptr<LLSurfacePatch> surface_patch_weak_ref;
|
||||
|
||||
// A patch shouldn't know about its visibility since that really depends on the
|
||||
// camera that is looking (or not looking) at it. So, anything about a patch
|
||||
// that is specific to a camera should be in the class below.
|
||||
@@ -64,26 +68,23 @@ public:
|
||||
|
||||
|
||||
|
||||
class LLSurfacePatch
|
||||
class LLSurfacePatch
|
||||
{
|
||||
public:
|
||||
LLSurfacePatch();
|
||||
LLSurfacePatch(LLSurface* surface, U32 side);
|
||||
~LLSurfacePatch();
|
||||
|
||||
void reset(const U32 id);
|
||||
void connectNeighbor(LLSurfacePatch *neighborp, const U32 direction);
|
||||
void connectNeighbor(const surface_patch_ref& neighbor_patchp, const U32 direction);
|
||||
void disconnectNeighbor(LLSurface *surfacep);
|
||||
|
||||
void setNeighborPatch(const U32 direction, LLSurfacePatch *neighborp);
|
||||
void setNeighborPatch(const U32 direction, const surface_patch_ref& neighborp);
|
||||
LLSurfacePatch *getNeighborPatch(const U32 direction) const;
|
||||
|
||||
void colorPatch(const U8 r, const U8 g, const U8 b);
|
||||
|
||||
BOOL updateTexture();
|
||||
|
||||
void updateVerticalStats();
|
||||
void updateCompositionStats();
|
||||
void updateNormals();
|
||||
bool updateNormals();
|
||||
|
||||
void updateEastEdge();
|
||||
void updateNorthEdge();
|
||||
@@ -92,7 +93,7 @@ public:
|
||||
void updateVisibility();
|
||||
void updateGL();
|
||||
|
||||
void dirtyZ(); // Dirty the z values of this patch
|
||||
bool dirtyZ(); // Dirty the z values of this patch
|
||||
void setHasReceivedData();
|
||||
BOOL getHasReceivedData() const;
|
||||
|
||||
@@ -139,17 +140,19 @@ public:
|
||||
void setDataNorm(LLVector3 *data_norm) { mDataNorm = data_norm; }
|
||||
F32 *getDataZ() const { return mDataZ; }
|
||||
|
||||
void dirty(); // Mark this surface patch as dirty...
|
||||
bool dirty(); // Mark this surface patch as dirty...
|
||||
void clearDirty() { mDirty = FALSE; }
|
||||
|
||||
void clearVObj();
|
||||
|
||||
U32 getSide() const { return mSide; }
|
||||
|
||||
public:
|
||||
BOOL mHasReceivedData; // has the patch EVER received height data?
|
||||
BOOL mSTexUpdate; // Does the surface texture need to be updated?
|
||||
|
||||
protected:
|
||||
LLSurfacePatch *mNeighborPatches[8]; // Adjacent patches
|
||||
std::weak_ptr<LLSurfacePatch>* mNeighborPatches[8]; // Adjacent patches
|
||||
BOOL mNormalsInvalid[9]; // Which normals are invalid
|
||||
|
||||
BOOL mDirty;
|
||||
@@ -184,6 +187,8 @@ protected:
|
||||
// of LLSurface that is "connected" to another LLSurface
|
||||
U64 mLastUpdateTime; // Time patch was last updated
|
||||
|
||||
U32 mSide; // Side relative to parent surface.
|
||||
|
||||
LLSurface *mSurfacep; // Pointer to "parent" surface
|
||||
};
|
||||
|
||||
|
||||
@@ -872,7 +872,7 @@ LLTextureFetchWorker::LLTextureFetchWorker(LLTextureFetch* fetcher,
|
||||
mCacheReadCount(0U),
|
||||
mCacheWriteCount(0U)
|
||||
{
|
||||
mCanUseNET = mUrl.empty() ;
|
||||
mCanUseNET = mUrl.empty() && !gHippoGridManager->getConnectedGrid()->isSecondLife();
|
||||
|
||||
if (!mCanUseNET)
|
||||
{
|
||||
@@ -1236,9 +1236,10 @@ bool LLTextureFetchWorker::doWork(S32 param)
|
||||
if (mState == LOAD_FROM_NETWORK)
|
||||
{
|
||||
static LLCachedControl<bool> use_http(gSavedSettings,"ImagePipelineUseHTTP");
|
||||
bool is_sl = gHippoGridManager->getConnectedGrid()->isSecondLife();
|
||||
|
||||
// if (mHost != LLHost::invalid) use_http = false;
|
||||
if (use_http && mCanUseHTTP && mUrl.empty()) // get http url.
|
||||
if ((is_sl || use_http) && mCanUseHTTP && mUrl.empty()) // get http url.
|
||||
{
|
||||
LLViewerRegion* region = NULL;
|
||||
if (mHost == LLHost::invalid)
|
||||
@@ -1280,6 +1281,7 @@ bool LLTextureFetchWorker::doWork(S32 param)
|
||||
mWriteToCacheState = CAN_WRITE;
|
||||
}
|
||||
if (!mUrl.empty() && SGHostBlackList::isBlacklisted(mUrl)){
|
||||
LL_DEBUGS("Texture") << mID << "Blacklisted" << LL_ENDL;
|
||||
mCanUseHTTP = false;
|
||||
}
|
||||
if (mCanUseHTTP && !mUrl.empty())
|
||||
@@ -1292,7 +1294,12 @@ bool LLTextureFetchWorker::doWork(S32 param)
|
||||
}
|
||||
// don't return, fall through to next state
|
||||
}
|
||||
else if (mSentRequest == UNSENT && mCanUseNET)
|
||||
else if (!mCanUseNET)
|
||||
{
|
||||
LL_WARNS(LOG_TXT) << mID << "Unable to retrieve texture via HTTP and UDP unavailable (probable 404): " << mUrl << LL_ENDL;
|
||||
return true;
|
||||
}
|
||||
else if (mSentRequest == UNSENT)
|
||||
{
|
||||
LL_DEBUGS("Texture") << mID << " moving to UDP fetch. mSentRequest=" << mSentRequest << " mCanUseNET = " << mCanUseNET << LL_ENDL;
|
||||
setState(SEND_UDP_REQ);
|
||||
@@ -1821,6 +1828,7 @@ bool LLTextureFetchWorker::doWork(S32 param)
|
||||
S32 discard = mHaveAllData ? 0 : mLoadedDiscard;
|
||||
U32 image_priority = LLWorkerThread::PRIORITY_NORMAL | mWorkPriority;
|
||||
mDecoded = FALSE;
|
||||
setPriority(LLWorkerThread::PRIORITY_LOW | mWorkPriority);
|
||||
setState(DECODE_IMAGE_UPDATE);
|
||||
LL_DEBUGS(LOG_TXT) << mID << ": Decoding. Bytes: " << mFormattedImage->getDataSize() << " Discard: " << discard
|
||||
<< " All Data: " << mHaveAllData << LL_ENDL;
|
||||
@@ -2348,7 +2356,7 @@ LLTextureFetch::~LLTextureFetch()
|
||||
while (! mCommands.empty())
|
||||
{
|
||||
TFRequest * req(mCommands.front());
|
||||
mCommands.erase(mCommands.begin());
|
||||
mCommands.pop_front();
|
||||
delete req;
|
||||
}
|
||||
|
||||
@@ -3367,7 +3375,7 @@ LLTextureFetch::TFRequest * LLTextureFetch::cmdDequeue()
|
||||
if (! mCommands.empty())
|
||||
{
|
||||
ret = mCommands.front();
|
||||
mCommands.erase(mCommands.begin());
|
||||
mCommands.pop_front();
|
||||
}
|
||||
unlockQueue(); // -Mfq
|
||||
|
||||
|
||||
@@ -177,7 +177,7 @@ private:
|
||||
// is logically tied to LLQueuedThread's list of
|
||||
// QueuedRequest instances and so must be covered by the
|
||||
// same locks.
|
||||
typedef std::vector<TFRequest *> command_queue_t;
|
||||
typedef std::deque<TFRequest *> command_queue_t;
|
||||
command_queue_t mCommands;
|
||||
|
||||
// If true, modifies some behaviors that help with QA tasks.
|
||||
|
||||
@@ -164,10 +164,10 @@ void LLToolBrushLand::modifyLandAtPointGlobal(const LLVector3d &pos_global,
|
||||
//if(!is_changed) continue;
|
||||
|
||||
// Now to update the patch information so it will redraw correctly.
|
||||
LLSurfacePatch *patchp= land.resolvePatchRegion(pos_region);
|
||||
if (patchp)
|
||||
auto& patchp = land.resolvePatchRegion(pos_region);
|
||||
if (patchp && patchp->dirtyZ())
|
||||
{
|
||||
patchp->dirtyZ();
|
||||
patchp->getSurface()->dirtySurfacePatch(patchp);
|
||||
}
|
||||
|
||||
// Also force the property lines to update, normals to recompute, etc.
|
||||
@@ -305,10 +305,10 @@ void LLToolBrushLand::modifyLandInSelectionGlobal()
|
||||
//if(!is_changed) continue;
|
||||
|
||||
// Now to update the patch information so it will redraw correctly.
|
||||
LLSurfacePatch *patchp= land.resolvePatchRegion(min_region);
|
||||
if (patchp)
|
||||
auto& patchp = land.resolvePatchRegion(min_region);
|
||||
if (patchp && patchp->dirtyZ())
|
||||
{
|
||||
patchp->dirtyZ();
|
||||
patchp->getSurface()->dirtySurfacePatch(patchp);
|
||||
}
|
||||
|
||||
// Also force the property lines to update, normals to recompute, etc.
|
||||
|
||||
@@ -454,6 +454,7 @@ static bool handleRepartition(const LLSD&)
|
||||
if (gPipeline.isInit())
|
||||
{
|
||||
gOctreeMaxCapacity = gSavedSettings.getU32("OctreeMaxNodeCapacity");
|
||||
gOctreeMinSize = gSavedSettings.getF32("OctreeMinimumNodeSize");
|
||||
gOctreeReserveCapacity = llmin(gSavedSettings.getU32("OctreeReserveNodeCapacity"),U32(512));
|
||||
gObjectList.repartitionObjects();
|
||||
}
|
||||
@@ -692,6 +693,7 @@ void settings_setup_listeners()
|
||||
gSavedSettings.getControl("OctreeStaticObjectSizeFactor")->getSignal()->connect(boost::bind(&handleRepartition, _2));
|
||||
gSavedSettings.getControl("OctreeDistanceFactor")->getSignal()->connect(boost::bind(&handleRepartition, _2));
|
||||
gSavedSettings.getControl("OctreeMaxNodeCapacity")->getSignal()->connect(boost::bind(&handleRepartition, _2));
|
||||
gSavedSettings.getControl("OctreeMinimumNodeSize")->getSignal()->connect(boost::bind(&handleRepartition, _2));
|
||||
gSavedSettings.getControl("OctreeReserveNodeCapacity")->getSignal()->connect(boost::bind(&handleRepartition, _2));
|
||||
gSavedSettings.getControl("OctreeAlphaDistanceFactor")->getSignal()->connect(boost::bind(&handleRepartition, _2));
|
||||
gSavedSettings.getControl("OctreeAttachmentSizeFactor")->getSignal()->connect(boost::bind(&handleRepartition, _2));
|
||||
|
||||
@@ -56,25 +56,22 @@ namespace LLViewerDisplayName
|
||||
void doNothing() { }
|
||||
}
|
||||
|
||||
class LLSetDisplayNameResponder : public LLHTTPClient::ResponderIgnoreBody
|
||||
class LLSetDisplayNameResponder final : public LLHTTPClient::ResponderIgnoreBody
|
||||
{
|
||||
LOG_CLASS(LLSetDisplayNameResponder);
|
||||
private:
|
||||
// only care about errors
|
||||
/*virtual*/ void httpFailure()
|
||||
void httpFailure() override
|
||||
{
|
||||
LL_WARNS() << dumpResponse() << LL_ENDL;
|
||||
LLViewerDisplayName::sSetDisplayNameSignal(false, "", LLSD());
|
||||
LLViewerDisplayName::sSetDisplayNameSignal(false, LLStringUtil::null, LLSD());
|
||||
LLViewerDisplayName::sSetDisplayNameSignal.disconnect_all_slots();
|
||||
}
|
||||
|
||||
/*virtual*/ char const* getName(void) const { return "LLSetDisplayNameResponder"; }
|
||||
char const* getName() const override { return "LLSetDisplayNameResponder"; }
|
||||
};
|
||||
|
||||
void LLViewerDisplayName::set(const std::string& display_name, const set_name_slot_t& slot)
|
||||
{
|
||||
// TODO: simple validation here
|
||||
|
||||
LLViewerRegion* region = gAgent.getRegion();
|
||||
llassert(region);
|
||||
std::string cap_url = region->getCapability("SetDisplayName");
|
||||
@@ -93,7 +90,7 @@ void LLViewerDisplayName::set(const std::string& display_name, const set_name_sl
|
||||
// Our display name will be in cache before the viewer's UI is available
|
||||
// to request a change, so we can use direct lookup without callback.
|
||||
LLAvatarName av_name;
|
||||
if (!LLAvatarNameCache::get( gAgent.getID(), &av_name))
|
||||
if (!LLAvatarNameCache::get(gAgent.getID(), &av_name))
|
||||
{
|
||||
slot(false, "name unavailable", LLSD());
|
||||
return;
|
||||
@@ -104,8 +101,6 @@ void LLViewerDisplayName::set(const std::string& display_name, const set_name_sl
|
||||
change_array.append(av_name.getDisplayName());
|
||||
change_array.append(display_name);
|
||||
|
||||
LL_INFOS() << "Set name POST to " << cap_url << LL_ENDL;
|
||||
|
||||
// Record our caller for when the server sends back a reply
|
||||
sSetDisplayNameSignal.connect(slot);
|
||||
|
||||
@@ -117,14 +112,14 @@ void LLViewerDisplayName::set(const std::string& display_name, const set_name_sl
|
||||
LLHTTPClient::post(cap_url, body, new LLSetDisplayNameResponder, headers);
|
||||
}
|
||||
|
||||
class LLSetDisplayNameReply : public LLHTTPNode
|
||||
class LLSetDisplayNameReply final : public LLHTTPNode
|
||||
{
|
||||
LOG_CLASS(LLSetDisplayNameReply);
|
||||
public:
|
||||
/*virtual*/ void post(
|
||||
LLHTTPNode::ResponsePtr response,
|
||||
const LLSD& context,
|
||||
const LLSD& input) const
|
||||
const LLSD& input) const override
|
||||
{
|
||||
LLSD body = input["body"];
|
||||
|
||||
@@ -157,12 +152,12 @@ public:
|
||||
};
|
||||
|
||||
|
||||
class LLDisplayNameUpdate : public LLHTTPNode
|
||||
class LLDisplayNameUpdate final : public LLHTTPNode
|
||||
{
|
||||
/*virtual*/ void post(
|
||||
LLHTTPNode::ResponsePtr response,
|
||||
const LLSD& context,
|
||||
const LLSD& input) const
|
||||
const LLSD& input) const override
|
||||
{
|
||||
LLSD body = input["body"];
|
||||
LLUUID agent_id = body["agent_id"];
|
||||
@@ -195,7 +190,7 @@ class LLDisplayNameUpdate : public LLHTTPNode
|
||||
{
|
||||
LLSD args;
|
||||
args["OLD_NAME"] = old_display_name;
|
||||
args["SLID"] = av_name.getUserName();
|
||||
args["SLID"] = "secondlife:///app/agent/" + agent_id.asString() + "/username";
|
||||
args["NEW_NAME"] = av_name.getDisplayName();
|
||||
LLNotificationsUtil::add("DisplayNameUpdate", args);
|
||||
}
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user