Commit Graph

46523 Commits (b6bbd86e5e6a23ef8bc81fa2374a82f05b4d18ed)

Author SHA1 Message Date
Nat Goodspeed b6bbd86e5e DRTVWR-558: Generalize LLEventDispatcher::add() constraints.
Instead of checking whether an add() parameter is exactly LLSD or LLSDMap,
check whether it's convertible to LLSD -- which handles those cases and more.

(cherry picked from commit fa168c11f64771dadc5df86d14ca2f07eba3b8ba)
(cherry picked from commit 6b5bfc1cf674fc568d86d7ed623fd7bb3ee2f646)
2023-07-13 12:34:32 -04:00
Nat Goodspeed 1ef06b04a3 DRTVWR-558: LLEventAPI allows all LLEventDispatcher add() overloads.
Previously, LLEventAPI intentionally hid all but one of the many add()
overloads supported by its LLEventDispatcher base class. The reason was that
certain of the add() methods take an optional fourth parameter that's an
LLSD::Map describing the expected parameter structure, while others take a
fourth templated parameter that's an instance getter callable. This led to
ambiguity, especially when passed an LLSDMap instance that's convertible to
LLSD but isn't literally LLSD. At the time, it was simpler to constrain the
add() methods inherited from LLEventDispatcher.

But by adding new std::enable_if constraints to certain LLEventDispatcher
add() methods, we've resolved the ambiguities, so LLEventAPI subclasses can
now use any add() overload (as claimed on the relevant Confluence page).

LLEventDispatcher comments have always loftily claimed that an instance getter
callable may return either a pointer or a reference, doesn't matter. But it
does when trying to pass the getter's result to boost::fusion::push_back(): a
reference must be wrapped with std::ref() while a pointer cannot be.
std::ref(pointer) produces errors. Introduce LLEventDispatcher::invoker::
bindable() overloads to Do The Right Thing whether passed a pointer or a
reference.

(cherry picked from commit 743f487c2e123171c9fc6d5b84d768f1d856d569)
(cherry picked from commit 8618e41b3489e321ecd70eb65ec4d9ca7e2f75c6)
2023-07-13 12:34:32 -04:00
Nat Goodspeed ee7fc1d14b DRTVWR-558: Change LLEventDispatcher error action (also LLEventAPI).
Originally the LLEventAPI mechanism was primarily used for VITA testing. In
that case it was okay for the viewer to crash with LL_ERRS if the test script
passed a bad request.

With puppetry, hopefully new LEAP scripts will be written to engage
LLEventAPIs in all sorts of interesting ways. Change error handling from
LL_ERRS to LL_WARNS. Furthermore, if the incoming request contains a "reply"
key, send back an error response to the requester.

Update lleventdispatcher_test.cpp accordingly.

(cherry picked from commit de0539fcbe815ceec2041ecc9981e3adf59f2806)
(cherry picked from commit 4b60941952e97691f11806062f4bc66dd5ac8dae)
2023-07-13 12:34:31 -04:00
Nat Goodspeed cc3d21ccea DRTVWR-558: Tweak LLEventDispatcher.
Instead of std::map<std::string, boost::shared_ptr>, use std::unique_ptr as
the mapped_type, using emplace() to store new entries. This more correctly
captures the desired semantics: we have no intention of passing around the
pointers in the map, we just want the map to delete them on destruction.

Use std::function instead of boost::function.

(cherry picked from commit 7ba53ef82db5683756e296225f0c8b838420a26e)
2023-07-13 12:34:31 -04:00
Nat Goodspeed 8855a82f51 DRTVWR-558: Add LL::apply() test for function(const LLSD&).
(cherry picked from commit 7d33e00d925614911a7602da1bd79916cc849ad7)
2023-07-13 12:34:31 -04:00
Nat Goodspeed 196e49c1f8 DRTVWR-558: Add unit test for VAPPLY().
Add to apply_test.cpp a collect() function that incrementally accumulates an
arbitrary number of arguments into a std::vector<std::string>. Construct a
std::array<std::string> to pass it, using VAPPLY().

Clarify in header comments that LL::apply() can't call a variadic function
with arguments of dynamic size: std::vector or LLSD. The compiler can deduce
how many arguments to pass to a function with a fixed argument list; it can
deduce how many arguments to pass to a variadic function with a fixed number
of arguments. But it can't compile a call to a variadic function with an
arguments data structure whose size can vary at runtime.

(cherry picked from commit ceed33396266b123896f7cfb9b90abdf240e1eec)
2023-07-13 12:34:31 -04:00
Nat Goodspeed c682603417 DRTVWR-558: Extend LL::apply() to LLSD array arguments.
Make apply(function, std::array) and apply(function, std::vector) available
even when we borrow the C++17 implementation of apply(function, std::tuple).

Add apply(function, LLSD) with interpretations:

* isUndefined() is treated as an empty array, for calling a nullary function
* scalar LLSD is treated as a single-entry array, for calling a unary function
* isArray() converts function parameters using LLSDParam
* isMap() is an error.

Add unit tests for all flavors of LL::apply().

(cherry picked from commit 3006c24251c6259d00df9e0f4f66b8a617e6026d)
2023-07-13 12:34:12 -04:00
Nat Goodspeed 324f0d9b8a DRTVWR-558: Fix builds on macOS 12.5 Monterey.
Always search for python3[.exe] instead of plain 'python'. macOS Monterey no
longer bundles Python 2 at all.

Explicitly make PYTHON_EXECUTABLE a cached value so if the user edits it in
CMakeCache.txt, it won't be overwritten by indra/cmake/Python.cmake.

Do NOT set DYLD_LIBRARY_PATH for test executables! That has Bad Effects, as
discussed in https://stackoverflow.com/q/73418423/5533635. Instead, create
symlinks from build-mumble/sharedlibs/Resources -> Release/Resources and from
build-mumble/test/Resources -> ../sharedlibs/Release/Resources. For test
executables in sharedlibs/RelWithDebInfo and test/RelWithDebInfo, this
supports our dylibs' baked-in load path @executable_path/../Resources. That
load path assumes running in a standard app bundle (which the viewer in fact
does), but we've been avoiding creating an app bundle for every test program.
These symlinks allow us to continue doing that while avoiding
DYLD_LIBRARY_PATH.

Add indra/llcommon/apply.h. The LL::apply() function and its wrapper macro
VAPPLY were very useful in diagnosing the problem.

Tweak llleap_test.cpp. This source was modified extensively for diagnostic
purposes; these are the small improvements that remain.

(cherry picked from commit 15d37713b9)
(cherry picked from commit a1adcf1905d1fbc5fe07ff5a627295ccfe461ac4)
2023-07-13 12:32:15 -04:00
Nat Goodspeed 11d22f3cf8 SL-18330: Merge commit '6b53036' into DRTVWR-587-maint-V
Bring over part of the LLEventDispatcher work inspired by DRTVWR-558.
2023-07-12 16:47:11 -04:00
Andrey Kleshchev e80f0f331d SL-19986 Crash at LLConversationItemSession::findParticipant
Observed on bugsplat, no repro. Something destroys LLConversationItem without cleaning list (some sessions reuse the item, but they aren't supposed to remove it). Either item should inform floater to be properly removed or should be stored as an LLPointer.
2023-07-11 03:10:36 +03:00
Andrey Kleshchev d61e6fc7ec SL-19963 Group Profile's money details have misleading date 2023-07-07 20:26:51 +03:00
Andrey Kleshchev f5385a8026 SL-18164 Media type format not shown in the About Land's media tab 2023-07-06 21:51:01 +03:00
Maxim Nikolenko 5928afda8a
SL-19702 restore previous double clicking behavior for objects (#266) 2023-07-06 21:46:19 +03:00
Maxim Nikolenko 374de322bf SL-19950 don't try to change fly state if it's not needed 2023-07-05 20:48:54 +03:00
Andrey Kleshchev 9e703ac967 SL-19716 and SL-19437 viewer_manager 2023-07-05 02:27:42 +03:00
Alexander Gavriliuk bea1bbe955 SL-19565 Prefs Bug when searching in Prefs 2023-06-30 16:09:30 +02:00
Alexander Gavriliuk 3f34acaa18 SL-19816 Home location on world map for invalid locations 2023-06-30 15:12:25 +02:00
Nat Goodspeed 5a70639b79 Increment viewer version to 6.6.13
following promotion of DRTVWR-577
2023-05-17 09:54:46 -04:00
Andrey Kleshchev 250228af25 SL-19660 Updated contributions doc 2023-05-09 17:58:13 +03:00
akleshchev 6c4c57cb47
SL-19660 Merge pull request #199 from beqjanus/main
BUG-233797/233798 - fix blackout when u/w fog_density < 0
2023-05-09 17:55:00 +03:00
Andrey Lihatskiy 55e2d48941 Merge remote-tracking branch 'origin/zap-LLSDArray' into DRTVWR-577-maint-S 2023-05-04 16:09:50 +03:00
Nat Goodspeed e7c5b9fb0f SL-19647: Eliminate LLSDArray entirely.
Newer C++ compilers have different semantics around LLSDArray's special copy
constructor, which was essential to proper LLSD nesting. In short, we can no
longer trust LLSDArray to behave correctly. Now that we have variadic
functions, get rid of LLSDArray and replace every reference with llsd::array().
2023-05-03 17:38:30 -04:00
Nat Goodspeed 3c77c1b90f DRTVWR-575: Replace some LLSDArray() usage with llsd::array().
It seems newer compilers have a different interpretation of exactly when to
engage LLSDArray's copy constructor. In particular, this assignment:

some_LLSD_map[key] = LLSDArray(...)(...)...;

used to convert the LLSDArray object directly to LLSD; now it first calls the
custom copy constructor, which embeds the intended array within an outer array
before assigning it into the containing map.

The newer llsd::array() function avoids that problem because what it returns
is already an LLSD object.

Taking inventory of LLSDArray assignments of that form turned up a number of
workarounds like LLSD(LLSDArray(...)). Replacing those with llsd::array() is
both simpler and more readable.

Tip of the hat to Chorazinallen for surfacing this issue!

(cherry picked from commit bb718155bd)
2023-05-03 12:31:42 -04:00
Beq Janus 8254407854
Merge branch 'main' into main 2023-05-02 21:11:10 +01:00
Andrey Lihatskiy ff8dcc23bf Merge branch 'main' into DRTVWR-577-maint-S 2023-05-02 17:39:37 +03:00
Vir Linden 7ed52090a6 Increment viewer version to 6.6.12
following promotion of DRTVWR-539
2023-05-02 10:24:54 -04:00
Beq 4ae5a8965f BUG-233797/BUG-233798 -ve underwater fog density causes blackout. 2023-04-30 11:52:22 +01:00
Andrey Lihatskiy 4e47e532f8 Merge branch 'SL-19594-fakesmile' into DRTVWR-577-maint-S 2023-04-19 23:15:28 +03:00
Nat Goodspeed 86846ffb8d SL-19594: Update to bugsplat build 579696 2023-04-19 15:35:47 -04:00
Andrey Lihatskiy 82fb4a08ec SL-19591 Prompt user to save current settings as Graphics Preset before enabling AutoFPS 2023-04-18 01:36:44 +03:00
Andrey Kleshchev 6d2bfe7ea2 SL-17659 The display name reset button 2023-04-03 21:41:05 +03:00
Andrey Kleshchev a6daa3a26d SL-19432 External group links dont load in SL 2023-03-31 17:47:07 +03:00
Mnikolenko Productengine 41d24952ff Merge branch 'main' into DRTVWR-539
# Conflicts:
#	indra/integration_tests/llui_libtest/CMakeLists.txt
#	indra/newview/llfloateravatarrendersettings.cpp
2023-03-31 17:17:21 +03:00
Mnikolenko Productengine 561f5f57c2 SL-19425 capitalization fix 2023-03-31 17:05:34 +03:00
Andrey Kleshchev 302bfb6e81 SL-19491 Revert SL-19346
This reverts part of commit 0c2b00efaa.
2023-03-30 16:15:51 +03:00
Andrey Lihatskiy 5217e6bfb7 Merge branch 'main' into DRTVWR-577-maint-S
# Conflicts:
#	indra/cmake/CMakeLists.txt
#	indra/newview/skins/default/xui/es/floater_tools.xml
2023-03-30 00:25:16 +03:00
Nat Goodspeed c7053a6928 Increment viewer version to 6.6.11
following promotion of DRTVWR-573
2023-03-29 16:56:36 -04:00
Brad Linden d6cf9e2772 Attempt to fix build breakage for DRTVWR-559 2023-03-27 22:04:02 +03:00
Andrey Lihatskiy c61a2b466a SL-17761 Updated the login failure message 2023-03-27 21:24:36 +03:00
Andrey Lihatskiy 9da0f76d2c SL-19462 Declare the FetchGroupChatHistory setting in the code
to make it accessible after updating the viewer
2023-03-23 14:35:55 +02:00
Andrey Kleshchev f6ba8306f0 SL-18876 Update fmod studion to version 2.02.13
Should fix "Radio/Stream hiccups at a regular rate during playback"
2023-03-22 20:19:23 +02:00
Andrey Lihatskiy d080ec2808 SL-4126 Updated contributions.txt 2023-03-22 19:09:26 +02:00
Ansariel 9bbdd922d6 SL-4126: Create NVIDIA application profile for Second Life specific settings 2023-03-22 19:07:08 +02:00
Andrey Lihatskiy 79e51195fb SL-19289 UI for Estate Floater - Block Scripted Agents from Estate/Region 2023-03-21 00:05:42 +02:00
Brad Payne (Vir Linden) 72cec2d347 SL-19161 - logging of basic translation stats in ViewerStats 2023-03-20 22:39:48 +02:00
Mnikolenko Productengine 87ecafd7b4 SL-19426 AutoFPS - when enabled always render at least 5 avatars 2023-03-20 20:08:40 +02:00
Andrey Lihatskiy dca3c83cd9 Merge branch 'DRTVWR-568' into DRTVWR-573-maint-R
# Conflicts:
#	indra/cmake/Copy3rdPartyLibs.cmake
#	indra/cmake/FindOpenJPEG.cmake
#	indra/cmake/OpenJPEG.cmake
#	indra/integration_tests/llui_libtest/CMakeLists.txt
#	indra/newview/CMakeLists.txt
2023-03-20 01:23:16 +02:00
Mnikolenko Productengine 5b7137f9aa SL-19425 add third option to Settings affect: World Only 2023-03-19 22:07:17 +02:00
Mnikolenko Productengine 464c2b393e SL-19424 Set default auto FPS to 15 2023-03-19 21:02:46 +02:00
Bennett Goble ffa8d83eaf SL-17761: Replace 'Grid emergency' message with generic error
The viewer currently presents a startling "Grid emergency" warning if an
unrecognized error is returned from login. Let's tone this down a bit
and present the error as it is: an unrecognized login failure rather
than SLearth exploding.
2023-03-13 14:36:08 +02:00