Compare commits

..

145 Commits

Author SHA1 Message Date
Router Gray
5040275969 [CMake] Releases shouldn't speak Greek. 2020-04-04 06:47:39 -05:00
Liru Færs
1daccf40ee Move the FMOD Powered By text, for Torric and others 2020-04-04 07:28:19 -04:00
Shyotl
4fd302286b Merge branch 'master' of https://github.com/singularity-viewer/SingularityViewer.git 2020-04-03 06:02:48 -05:00
Shyotl
18f9f19e61 Textures mid-decode potentially processing of other textures until complete. Disabled UDP texture fetch fallback when connected to official grid. 2020-04-03 06:01:58 -05:00
Liru Færs
1de6d4461a Add missing EmergencyTeleportSeconds preference to System->Security
Thanks for the heads up about this missing preferences, and for the
Spanish translation, Damian!
2020-04-03 02:53:41 -04:00
Shyotl
4198f47ab6 Fix header breakage in debug/relwithdebug 2020-04-03 00:33:19 -05:00
Shyotl
d9049ba342 Handle AISAPI throttling and status 410 a bit better. 2020-04-02 21:47:07 -05:00
Shyotl
f75ac3e4c2 Merge branch 'master' of https://github.com/singularity-viewer/SingularityViewer.git 2020-04-02 20:09:53 -05:00
Liru Færs
06698deaca A couple more sim->region changes 2020-04-02 21:08:23 -04:00
Shyotl
445eb29bd3 Bring aisapi handling closer to LL (code 499 retry, match timeout values, etc) 2020-04-02 20:07:55 -05:00
Shyotl
cc034f6841 Fix inventory scrolling issue when navigating via keyboard. 2020-04-02 20:03:08 -05:00
Liru Færs
3c368651f1 Update crashpad, thanks Rye! 2020-04-02 20:39:01 -04:00
Damian Zhaoying
321730e384 More translations fixes in Area search and menu list owners. 2020-04-02 03:02:23 -03:00
Damian Zhaoying
c2fd88670f Fix some remaining spanish translations. 2020-04-02 02:36:20 -03:00
Liru Færs
7b03103a1f April Fools!
Ha, goteem
2020-04-01 20:52:44 -04:00
Liru Færs
ac3e19c91a Merge branch 'master' of git://github.com/Shyotl/SingularityViewer 2020-04-01 20:47:23 -04:00
Liru Færs
4c7d2224e3 Fix reverted xml change, fix formatting 2020-04-01 20:43:00 -04:00
Shyotl
3ab800d99e Merge branch 'master' of https://github.com/singularity-viewer/SingularityViewer.git 2020-04-01 19:26:41 -05:00
Shyotl
332cef0f84 Disable debug logging unless RelWithDeb 2020-04-01 19:26:23 -05:00
Damian Zhaoying
9de6d7627b A lot of updates and fixes for spanish language translations. 2020-04-01 20:44:41 -03:00
Liru Færs
98b42e88c1 Fix SV-2282: Incorrect terminology for TP Sound preference UI 2020-04-01 06:56:51 -04:00
Liru Færs
e642e9561a The sim is actually the region 2020-04-01 04:42:34 -04:00
Liru Færs
77f500cb64 Merge branch 'master' of git://github.com/Shyotl/SingularityViewer 2020-04-01 01:59:42 -04:00
Liru Færs
d04a8fc677 Merge branch 'master' of https://github.com/RouterGray/SingularityViewer 2020-04-01 01:59:32 -04:00
Liru Færs
6028ae7b61 Fix group notices: Have a background for the header for certain skins. 2020-04-01 01:56:58 -04:00
Shyotl
347c2cbd8b Fall in line with LL octree code. 2020-03-31 19:07:55 -05:00
Router Gray
919ffb314b [UI] Add missing 'AlreadyInGroup' to strings.xml 2020-03-30 15:24:28 -05:00
Router Gray
c033d69d54 [Linux] More follow-through on earlier manifest tuning, make always really mean always. 2020-03-30 03:06:21 -05:00
Router Gray
356d289972 User request: Add last owner profile button to object inspect. 2020-03-29 19:16:52 -05:00
Router Gray
eeabbce377 [Lib] Update abseil. (Alchemy sync) 2020-03-29 16:39:16 -05:00
Router Gray
0b992fdd46 [Lib] Update nlohmann json and switch it to FetchContent instead of prebuilts. (Alchemy sync) 2020-03-29 16:38:53 -05:00
Router Gray
a7e56d2af9 Fix an accident in a ternary. 2020-03-29 16:31:40 -05:00
Router Gray
b10619e4d8 [Linux] Don't strip binaries, even when building release, unless packaging. Makes quick debugging in the dev checkout easier.
This may need more work if we want to support building an 'install' target, bypassing packaging, but I never hear of anyone doing that.  I'll address it if needed.
2020-03-29 15:24:10 -05:00
Router Gray
74518f299c Merge remote-tracking branch 'github-liru/master' 2020-03-29 15:21:22 -05:00
Liru Færs
407b527a55 [XPTools] Fix linux crash bug, make Cancel button close Experiences floater 2020-03-29 00:43:21 -04:00
Liru Færs
b21cc835b2 Clean up old Experience UI port code 2020-03-28 16:38:14 -04:00
Shyotl
4de8c3a38e Merge branch 'master' of https://github.com/singularity-viewer/SingularityViewer.git 2020-03-27 02:56:20 -05:00
Shyotl
72d8b8f78c Potentially harden against region teardown crash. Screw with branching to delve more information from callstacks since dynamic annotations don't seem to work with sentry.io using crashpad lib... sadface. 2020-03-27 02:55:12 -05:00
Liru Færs
45f4f601bf nopaque 2020-03-27 02:35:06 -04:00
Liru Færs
731283aa0b Friendship accepted notifications as tips with linked names 2020-03-27 00:51:45 -04:00
Liru Færs
89ce328ba5 Fix script dialogs showing UI SLURLs when SinguReplaceLinks is false
All interface SLURLs should be force replaced.
Also fixes text boxes not respecting setting at all
2020-03-26 23:31:52 -04:00
Liru Færs
28e5270d87 All agent SLURLs should use the name system names, not just profile ones. 2020-03-25 23:57:05 -04:00
Shyotl
4a237de72a Merge branch 'master' of https://github.com/singularity-viewer/SingularityViewer.git 2020-03-25 22:37:23 -05:00
Shyotl
e91aac1dd9 For science. Let's see if sentry.io accepts these annotations... 2020-03-25 22:35:29 -05:00
Liru Færs
7cab44a17d Merge branch 'master' of https://github.com/RouterGray/SingularityViewer 2020-03-25 05:47:34 -04:00
Liru Færs
cf57624688 Fix IsNearby check having invalid logic and hiding options because of it 2020-03-24 22:41:23 -04:00
Liru Færs
c7448f290d Fix inverted logic for benefits on opensim 2020-03-24 17:42:21 -04:00
Liru Færs
55f9937238 Fix looping over empty age strings on OpenSim, no longer retry on SL 2020-03-24 16:27:16 -04:00
Liru Færs
ac1ef4d1ba Hide temp upload on SL 2020-03-23 21:39:08 -04:00
Liru Færs
ee1baafb59 Actually Delete LLView copy constructor 2020-03-23 21:20:21 -04:00
Liru Færs
9522e385cd Merge viewer-benefits
Replace MAX_AGENT_ATTACHMENTS with sim based response
Replace max groups with benefits based response
Upload costs are now handled by sim response
Removed no-longer-needed lleconomy files and classes
Removed dead fields from hippolimits and hippogridmanager
Also removed lame LL code that is redundant and silly

On non SL grids, when values are not provided for benefits, they will be
set to the values granting maximum liberty.
Old standardized responses still work when benefits aren't implemented.
2020-03-23 20:15:59 -04:00
Router Gray
a9b047b168 Minor compile fixes: move a declaration out of a namespace, add an include 2020-03-23 11:47:17 -05:00
Liru Færs
8c6e6143c2 Fix accidental paste in aosystem init 2020-03-23 09:11:13 -04:00
Liru Færs
0704876dfd Comment out unused macros in llviewerregion.h 2020-03-23 09:10:46 -04:00
Liru Færs
54b75a3219 Add SinguOwnerSayAsErrors to make llOwnerSay spew to debug console instead 2020-03-23 08:44:25 -04:00
Liru Færs
11d59d1b00 Merge branch 'master' of git://github.com/Shyotl/SingularityViewer
# Conflicts:
#	indra/newview/llsurface.cpp
2020-03-23 01:04:25 -04:00
Liru Færs
4e042db404 Merge branch 'master' of https://github.com/RouterGray/SingularityViewer 2020-03-23 01:03:25 -04:00
Liru Færs
0f6285b2e9 Split up floaterao.* into aosystem.* and aostate.h, also further refactor 2020-03-22 15:02:08 -04:00
Liru Færs
a3d2107bfd Fix an oopsie woopsie, thanks bready doggy 2020-03-22 10:46:30 -04:00
Liru Færs
a66c91bc5a Labels for agent slurls should use the default name system 2020-03-22 10:36:54 -04:00
Liru Færs
4602602a5f Link owner name in inventory offers from objects 2020-03-22 10:03:51 -04:00
Liru Færs
0511d5903a erase iters properly, please 2020-03-22 09:53:47 -04:00
Liru Færs
7597ce3b37 Force Swim button for AO, for when you wanna swim above water
Force Swim forces swims to be enabled
2020-03-22 09:52:54 -04:00
Liru Færs
7509d929d8 Make everyone upset! Reorganize group notices!
Feature request: clickable names and group names
Remove dead space in group notices that has always plagued us
2020-03-22 09:07:46 -04:00
Liru Færs
c7e03600aa Fix constant reallocation of texture fetch command queue because...who..uses a vector..for a fifo...
By Rye, thanks!
2020-03-22 07:46:20 -04:00
Liru Færs
4871f5ed8e AO Refactor
Should fix AO not turning on without opening floater first

Cleans up code
Reduces memory footprint, especially when not in use
Removes unused functions and parameters
Decouples AO from Floater class (AOSystem)
Removes duplicate Idle state
Formalizes singleton patterns of globals
Centralizes override handling into override structs
Fall back on simple english notecard explanation when missing config ini
Fixes sitting override playing when sitting is disabled (and acting weird)
Moves the bulk of override handling into override structs
No longer state-based, now tracks using per-struct playing field
2020-03-22 07:42:24 -04:00
Router Gray
e5a6f1e2d9 [CMake Linux] Fix my being too rushed in Copy3rdParty, restore openal 2020-03-16 03:38:55 -05:00
Shyotl
a29491658b Merge branch 'master' of https://github.com/singularity-viewer/SingularityViewer.git
# Conflicts:
#	indra/llmath/lloctree.h
#	indra/newview/llsurface.cpp
2020-03-15 00:53:20 -05:00
Shyotl
26976b715d Fixup minor use after free issues, and improper mutex usage in meshrepo. Also fixed some compiler warnings. 2020-03-15 00:46:57 -05:00
Liru Færs
8d564d6ed1 Follow Pilot algorithm tweak: Fly if already flying or target is above 2020-03-10 17:00:02 -04:00
Liru Færs
18fbac26dc Correct comment in follow pilot code 2020-03-10 16:32:14 -04:00
Liru Færs
9f82933149 Reduce repeated follow pilot code 2020-03-10 16:31:51 -04:00
Liru Færs
9b7aa959b0 Fix unresolved links in caution notifications 2020-03-10 16:30:37 -04:00
Liru Færs
1c46c26e6b Notifications with tooltips on buttons, for when text is too long! 2020-03-10 16:29:10 -04:00
Liru Færs
506c6aaa9e Use INetC instead of NSISdl, thanks Rye! 2020-03-10 16:27:48 -04:00
Liru Færs
dd61d475cb Prevent use of outdated notecard import by removing it from LLTextEditor
LLViewerTextEditor properly overrides this anyway.
2020-03-05 04:09:46 -05:00
Liru Færs
6e5eed7957 Fix focus on Object Owners
Just noticed this must've slipped out of a previous commit
2020-03-04 15:45:04 -05:00
Liru Færs
7859c0a191 Fix the ancient way of magic text box hack wherein multiple buttons works
Also when muting scripts through notification, properly pop mute dialog
2020-03-03 22:02:44 -05:00
Liru Færs
ef46d21582 Final 2020-03-03 21:51:54 -05:00
Router Gray
5071c1e0cf Merge remote-tracking branch 'github-liru/master' into NixTesting 2020-03-01 09:42:35 -06:00
Router Gray
ecd52a9e1a [Cmake] Comment out unused llplugincookiestore. 2020-03-01 09:42:00 -06:00
Router Gray
0a6a47a099 [Linux] Use system X11. 2020-03-01 09:42:00 -06:00
Router Gray
9880fe225e [Linux] Use system libraries for dbus-glib, gtk-atk-pango-glib, and ogg-vorbis. 2020-03-01 09:42:00 -06:00
Liru Færs
5d44552a60 Allow UI scale values as low as .5 to better meet HiDPI needs
Adapted from Rye's work on Alchemy, Thanks!
2020-03-01 09:21:59 -05:00
Liru Færs
ffa32f8c98 Fix linux compile 2020-03-01 03:51:47 -05:00
Liru Færs
b7086a993d Merge branch 'master' of git://github.com/Shyotl/SingularityViewer
# Conflicts:
#	indra/llmath/lloctree.h
#	indra/newview/llsurface.cpp
2020-03-01 03:39:30 -05:00
Shyotl
d2d172f6ec Allow oversized images when performing raw snapshots. 2020-02-29 22:51:45 -06:00
Shyotl
34f6ea4db2 Rework LLSurface[Patch]. Abuse weak_ptr for now. Rewrote connectNeighbor. LLSurfacePatch no longer calls parent LLSurface with this poiter, instead parent surface just handles return value and controls its own behavior [Requred for weak_ptr/shared_ptr change. 2020-02-29 22:33:51 -06:00
Shyotl
d8c4db17f2 Make gcc happy again.. 2020-02-29 22:15:46 -06:00
Shyotl
c340dde03d Speculative fixes. 2020-02-29 22:15:27 -06:00
Liru Færs
e502b87b63 Ooops, forgot to save the rewrite of this that actually fixes it 2020-02-29 11:16:46 -05:00
Liru Færs
d6f320fb5e Clean up Object SLURL right click menu with a few submenus 2020-02-29 08:20:50 -05:00
Liru Færs
e4eca079e6 Allow right clicking object UI labels to interact with their owners! 2020-02-29 08:19:41 -05:00
Liru Færs
68ceac3678 llDialog & llTextBox with linked owner name and object name 2020-02-29 06:46:20 -05:00
Liru Færs
991d603a0c Don't copy around strings and UUIDs, LL... pls 2020-02-29 05:57:36 -05:00
Liru Færs
74a6f7382a When possible, populate the owner id of our llviewerobjects 2020-02-29 05:51:07 -05:00
Liru Færs
9264482dc3 Small patch to french translation, thanks Nomade 2020-02-29 04:47:53 -05:00
Liru Færs
1a61c49fc7 Display name change notifications that link to the user 2020-02-29 04:47:17 -05:00
Liru Færs
c2480d7227 When muting an object via pie menu, select it in the mute floater 2020-02-29 04:46:15 -05:00
Liru Færs
72b5976605 Merge to fix missing agent slurl handler for removefriend and (un)block 2020-02-29 04:45:37 -05:00
Liru Færs
1b742aa933 Menu finals and overrides 2020-02-28 22:33:37 -05:00
Liru Færs
9412f631fa Object->Derender from Object UIs 2020-02-28 01:31:34 -05:00
Router Gray
be07df3043 [Lib] Update Linux dullahan 2020-02-26 23:54:22 -06:00
Router Gray
8f89127900 [CEF] Catch a missed change for dullahan update. OCDly fix an indentation. 2020-02-26 23:24:36 -06:00
Router Gray
c72059e73f [CMake CEF] How was this even working? Set dependencies and link targets to cef instead of webkit. 2020-02-26 07:21:48 -06:00
Router Gray
2fc2b7c12b Sync some mime types with upstream, also remove erroneous 'video/libvlc' mimetype. There is no such mimetype. 2020-02-26 07:05:41 -06:00
Liru Færs
a652cb4f0a Collaboration between myself and Router the Gray to Flinux 2020-02-25 13:25:12 -05:00
Liru Færs
16b8980d28 Fix the new window inventory folder floater, and opt it to squeak! 2020-02-25 12:52:41 -05:00
Liru Færs
841a55c266 Remove duplicate setText line that was failing anyway. 2020-02-25 10:23:37 -05:00
Liru Færs
2aa6adfd46 Pip, Squeak. 2020-02-25 08:04:31 -05:00
Liru Færs
bac0b3d745 Update FMOD Studio to 2.00.07 2020-02-25 06:55:05 -05:00
Liru Færs
b08b597397 Merge branch 'master' of git://github.com/Shyotl/SingularityViewer
# Conflicts:
#	indra/llcommon/llsd.cpp
#	indra/llcommon/llsdserialize.cpp
#	indra/newview/llspeakers.cpp
#	indra/newview/llviewermessage.cpp
2020-02-25 06:51:41 -05:00
Shyotl
25cb81221e Don't use clamp mode on av mesh. 2020-02-25 02:36:32 -06:00
Liru Færs
4f5749878f Merge branch 'master' of https://github.com/RouterGray/SingularityViewer
# Conflicts:
#	indra/newview/llexperiencelog.cpp
2020-02-25 03:33:49 -05:00
Liru Færs
2aa3ba4d36 Fix crashes that were reported when using object right click menu
Menu entries that cannot work when an object vanishes will gracefully fail.
2020-02-25 03:29:41 -05:00
Liru Færs
6a2421e2e7 Fix dumb build warning on windows 2020-02-25 03:27:37 -05:00
Liru Færs
e78061b077 Hide group voting tab on secondlife, it is no longer used there. 2020-02-25 03:27:06 -05:00
Liru Færs
379f97e15a Buncha small fixes, mainly from alchemy
Update firestorm jira url
Maintain sorting and and scroll position when refreshing region tracker
Add missing CrashHostUrl setting
And a buncha other tinies, probably a crash fix or two.
2020-02-25 03:26:33 -05:00
Liru Færs
2afd2c500b Update VLC and Dullahan. Update vcredist deployment. Thanks Alchemy! 2020-02-25 03:21:27 -05:00
Liru Færs
0c3e144547 Properly sized FMOD logo, 40 pixels high. Inspired by Alchemy, thanks Rye!¶ 2020-02-25 03:08:01 -05:00
Liru Færs
842d1b8d93 Add LLIMProcessing and support for new message caps! And UserInfo cap!
Also delayed sound support!
Fixed memory leaks and pass by values that LL likes to introduce.
Extended LLCoroResponder to have a responder for Raw strings, also clean it
Adds friend request message logging.
2020-02-25 03:04:58 -05:00
Shyotl
5c2c2a8c01 Minor cleanup. Octree vfunc reduction. Range-based for loops with map/array llsd types. 2020-02-25 01:50:50 -06:00
Router Gray
61f0837114 Make Linux and LLExperienceLog play nice. Thanks Liru. 2020-02-24 17:30:40 -06:00
Router Gray
aa95d8fe3d [LL] Update the login splash page for LL grids. 2020-02-24 06:37:42 -06:00
Router Gray
a52c4779c8 Make event notifications say 'Dismiss' instead of 'Cancel'. 2020-02-23 13:44:24 -06:00
Router Gray
1ece0e6051 [UI] Add Copy Folder UUID to inventory actions 2020-02-19 12:40:33 -06:00
Liru Færs
6a56d048c0 Don't confuse the user by showing loading when refreshing item's experience
Also reorganize some code in that area to be cleaner
2020-02-11 20:19:04 -05:00
Liru Færs
e34999b6a9 Fix missing string for experience profile button tooltip in scripts 2020-02-11 19:49:11 -05:00
Liru Færs
103b2c0f33 Fix layout of item properties floater 2020-02-11 19:07:39 -05:00
Liru Færs
2fe45cb8c2 Fix group inventory receiveds not displaying properly in chat history
Also fix linking to an avatar profile when a group's object gives an item
2020-02-11 18:34:45 -05:00
Liru Færs
64a44d6c1b Fix size and position of folder floaters not being restored from setting 2020-02-11 18:31:47 -05:00
Liru Færs
3073a175d7 Add LiruUseMarkedColor to disable use of mark color in the new places 2020-02-11 17:39:46 -05:00
Liru Færs
3b550c3a93 Fix the Jira URL bug we brought up at the last TPV meeting 2020-02-11 15:13:42 -05:00
Liru Færs
1d2c0cb8c6 Script permission dialogs should link back to the object and its owner 2020-02-11 15:09:48 -05:00
Liru Færs
2f369299c5 Object info with right-clickable owner naame, also improve code overall 2020-02-11 15:06:39 -05:00
Liru Færs
e65b513562 Syncy stuffs 2020-02-11 13:04:05 -05:00
Liru Færs
6959b688be Fix the issue with thin resize space in inventory folder floaters 2020-02-11 12:20:33 -05:00
Liru Færs
7db999d801 Fix copyright being 2019, thanks Del 2020-02-11 12:17:05 -05:00
Liru Færs
703ad01c8b AntiSpam refactor!
Adds SLURLs to antispam notifications
Reduces weight of antispam to either global queue, multiple queues, or none
Renames variables to make more sense
Repositions code, cleans up code, uses modern C++, etc
This fixes a bit of a leak or two, especially with antispam turned off!
Also fixes the endless leak of queue expansion by cleaning up while idle
When changing between global and individual queues, they're now purged.
Also made some improvements to previous commit, woops.
Also fix wrong logic for is_linden and chat source type for objects
2020-02-11 12:16:44 -05:00
Liru Færs
199879aea8 Break out functions for getting object owner, owner and object slurls 2020-02-09 18:52:06 -05:00
Liru Færs
eefa0f07a7 Reduce reused getBOOL 2020-02-09 18:28:48 -05:00
Liru Færs
6e6fb44bdb Fix potential crash, thanks Rye and Testicular! 2020-02-09 18:28:10 -05:00
Liru Færs
0892d14933 Fix debit permission Allow being too long, and remove newlines from it 2020-02-09 04:34:55 -05:00
Liru Færs
400da6ec92 Fix out of order and duplicate preferences 2020-02-09 04:33:20 -05:00
Liru Færs
18539831d1 Request: Just show viewer's short name in update notification, not channel 2020-02-09 04:32:27 -05:00
294 changed files with 8931 additions and 8076 deletions

View File

@@ -8,7 +8,7 @@ name = "pypi"
[packages] [packages]
llbase = "*" llbase = "*"
certifi = "*" certifi = "*"
autobuild = {hg = "https://bitbucket.org/alchemyviewer/autobuild-1.1"} autobuild = {git = "https://git.alchemyviewer.org/alchemy/autobuild.git"}
[requires] [requires]
python_version = "2.7" python_version = "2.7"

View File

@@ -410,11 +410,11 @@
<key>archive</key> <key>archive</key>
<map> <map>
<key>hash</key> <key>hash</key>
<string>4614b29cc98021cf1770a8290171602b</string> <string>a96fda7ad5cee967823f5c94390ba35b</string>
<key>hash_algorithm</key> <key>hash_algorithm</key>
<string>md5</string> <string>md5</string>
<key>url</key> <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> </map>
<key>name</key> <key>name</key>
<string>windows</string> <string>windows</string>
@@ -424,18 +424,18 @@
<key>archive</key> <key>archive</key>
<map> <map>
<key>hash</key> <key>hash</key>
<string>d801461b7a6a40fffab828aa1e01e3e6</string> <string>5ff95ca1007ed2dc300b59de17453201</string>
<key>hash_algorithm</key> <key>hash_algorithm</key>
<string>md5</string> <string>md5</string>
<key>url</key> <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> </map>
<key>name</key> <key>name</key>
<string>windows64</string> <string>windows64</string>
</map> </map>
</map> </map>
<key>version</key> <key>version</key>
<string>ce32d093.7</string> <string>c6d76a90.194</string>
</map> </map>
<key>curl</key> <key>curl</key>
<map> <map>
@@ -664,11 +664,11 @@
<key>archive</key> <key>archive</key>
<map> <map>
<key>hash</key> <key>hash</key>
<string>06746b78827e9a0c6b666bd2528d36ad</string> <string>695efb6fc548a56dc4ff34e8d9a37bfb</string>
<key>hash_algorithm</key> <key>hash_algorithm</key>
<string>md5</string> <string>md5</string>
<key>url</key> <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> </map>
<key>name</key> <key>name</key>
<string>linux64</string> <string>linux64</string>
@@ -678,9 +678,11 @@
<key>archive</key> <key>archive</key>
<map> <map>
<key>hash</key> <key>hash</key>
<string>e19b664ad8cf9e7f4a7bf649d28faa76</string> <string>1b278ff2535f428ea6536683d096fdd0</string>
<key>hash_algorithm</key>
<string>md5</string>
<key>url</key> <key>url</key>
<string>https://bitbucket.org/SingularityViewer/libraries/downloads/dullahan-1.1.1320_73.1.12+gee4b49f+chromium-73.0.3683.75-windows-191102212.tar.bz2</string> <string>https://pkg.alchemyviewer.org/repository/autobuild-external/dullahan/windows/dullahan-1.3.201911222116_78.3.7_gea7ef34_chromium-78.0.3904.108-windows-2.tar.bz2</string>
</map> </map>
<key>name</key> <key>name</key>
<string>windows</string> <string>windows</string>
@@ -690,18 +692,18 @@
<key>archive</key> <key>archive</key>
<map> <map>
<key>hash</key> <key>hash</key>
<string>414190fd1ce3876ee3efc682b06ae65c</string> <string>b9346fea7643b10308c7bd9a769ef5f7</string>
<key>hash_algorithm</key> <key>hash_algorithm</key>
<string>md5</string> <string>md5</string>
<key>url</key> <key>url</key>
<string>http://depot.alchemyviewer.org/pub/packages/windows64/msvc-1920/dullahan-1.1.1320_73.1.12-gee4b49f-chromium-73.0.3683.75-windows64-190871757.tar.bz2</string> <string>https://pkg.alchemyviewer.org/repository/autobuild-external/dullahan/windows64/dullahan-1.3.201911222103_78.3.7_gea7ef34_chromium-78.0.3904.108-windows64-2.tar.bz2</string>
</map> </map>
<key>name</key> <key>name</key>
<string>windows64</string> <string>windows64</string>
</map> </map>
</map> </map>
<key>version</key> <key>version</key>
<string>1.1.1320_73.1.12+gee4b49f+chromium-73.0.3683.75</string> <string>1.3.201911222103_78.3.7_gea7ef34_chromium-78.0.3904.108</string>
</map> </map>
<key>elfio</key> <key>elfio</key>
<map> <map>
@@ -816,7 +818,7 @@
<key>fmodstudio</key> <key>fmodstudio</key>
<map> <map>
<key>copyright</key> <key>copyright</key>
<string>FMOD Studio, copyright (c) Firelight Technologies Pty, Ltd., 2012-2019.</string> <string>FMOD Studio, Copyright (c) Firelight Technologies Pty Ltd.</string>
<key>description</key> <key>description</key>
<string>FMOD Studio audio system library</string> <string>FMOD Studio audio system library</string>
<key>license</key> <key>license</key>
@@ -888,11 +890,11 @@
<key>archive</key> <key>archive</key>
<map> <map>
<key>hash</key> <key>hash</key>
<string>22daed7c860daaef217eb8d90dfc1119</string> <string>d32efb193ffcd73bcba4875ddfd17bf0</string>
<key>hash_algorithm</key> <key>hash_algorithm</key>
<string>md5</string> <string>md5</string>
<key>url</key> <key>url</key>
<string>https://pkg.alchemyviewer.org/repository/autobuild-internal/fmodstudio/windows/fmodstudio-2.00.06.3-windows-3.tar.bz2</string> <string>https://pkg.alchemyviewer.org/repository/autobuild-internal/fmodstudio/windows/fmodstudio-2.00.07.4-windows-4.tar.bz2</string>
</map> </map>
<key>name</key> <key>name</key>
<string>windows</string> <string>windows</string>
@@ -902,18 +904,18 @@
<key>archive</key> <key>archive</key>
<map> <map>
<key>hash</key> <key>hash</key>
<string>ccf7b1935743df55244139c4323c0465</string> <string>0604fd6b53ceaf14ce04d0de1bea51b8</string>
<key>hash_algorithm</key> <key>hash_algorithm</key>
<string>md5</string> <string>md5</string>
<key>url</key> <key>url</key>
<string>https://pkg.alchemyviewer.org/repository/autobuild-internal/fmodstudio/windows64/fmodstudio-2.00.06.3-windows64-3.tar.bz2</string> <string>https://pkg.alchemyviewer.org/repository/autobuild-internal/fmodstudio/windows64/fmodstudio-2.00.07.4-windows64-4.tar.bz2</string>
</map> </map>
<key>name</key> <key>name</key>
<string>windows64</string> <string>windows64</string>
</map> </map>
</map> </map>
<key>version</key> <key>version</key>
<string>2.00.06.3</string> <string>2.00.07.4</string>
</map> </map>
<key>fonts</key> <key>fonts</key>
<map> <map>
@@ -996,7 +998,7 @@
<key>freetype</key> <key>freetype</key>
<map> <map>
<key>copyright</key> <key>copyright</key>
<string>Copyright 2006-2017 by David Turner, Robert Wilhelm, and Werner Lemberg.</string> <string>Copyright 2006-2018 by David Turner, Robert Wilhelm, and Werner Lemberg.</string>
<key>description</key> <key>description</key>
<string>Font rendering library</string> <string>Font rendering library</string>
<key>license</key> <key>license</key>
@@ -1931,38 +1933,6 @@
<key>version</key> <key>version</key>
<string>7.11.1.297294</string> <string>7.11.1.297294</string>
</map> </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> <key>nvapi</key>
<map> <map>
<key>copyright</key> <key>copyright</key>
@@ -2506,7 +2476,7 @@
<key>vlc-bin</key> <key>vlc-bin</key>
<map> <map>
<key>copyright</key> <key>copyright</key>
<string>Copyright (C) 1998-2016 VLC authors and VideoLAN</string> <string>Copyright (C) 1998-2020 VLC authors and VideoLAN</string>
<key>license</key> <key>license</key>
<string>GPL2</string> <string>GPL2</string>
<key>license_file</key> <key>license_file</key>
@@ -2544,9 +2514,9 @@
<key>archive</key> <key>archive</key>
<map> <map>
<key>hash</key> <key>hash</key>
<string>add560654a53cb1c554044a4fac3c718</string> <string>3ff1d097e4f9b8f864a639aff974a506</string>
<key>url</key> <key>url</key>
<string>http://automated-builds-secondlife-com.s3.amazonaws.com/ct2/12144/71458/vlc_bin-2.2.8.511703-windows-511703.tar.bz2</string> <string>https://pkg.alchemyviewer.org/repository/autobuild-external/vlc-bin/windows/vlc_bin-3.0.8.189-windows-189.tar.bz2</string>
</map> </map>
<key>name</key> <key>name</key>
<string>windows</string> <string>windows</string>
@@ -2556,16 +2526,16 @@
<key>archive</key> <key>archive</key>
<map> <map>
<key>hash</key> <key>hash</key>
<string>94bf04b49acc1e1bf2c06e2232f8a083</string> <string>b890b109b526cc6ad211eadefed83316</string>
<key>url</key> <key>url</key>
<string>http://automated-builds-secondlife-com.s3.amazonaws.com/ct2/12145/71463/vlc_bin-2.2.8.511703-windows64-511703.tar.bz2</string> <string>https://pkg.alchemyviewer.org/repository/autobuild-external/vlc-bin/windows64/vlc_bin-3.0.8.189-windows64-189.tar.bz2</string>
</map> </map>
<key>name</key> <key>name</key>
<string>windows64</string> <string>windows64</string>
</map> </map>
</map> </map>
<key>version</key> <key>version</key>
<string>2.2.8.511703</string> <string>3.0.8.189</string>
</map> </map>
<key>xmlrpc-epi</key> <key>xmlrpc-epi</key>
<map> <map>

View File

@@ -1,13 +1,13 @@
# -*- cmake -*- # -*- cmake -*-
include(Prebuilt) include(Prebuilt)
if (STANDALONE) if (LINUX)
include(FindPkgConfig) include(FindPkgConfig)
pkg_check_modules(OGG REQUIRED ogg) pkg_check_modules(OGG REQUIRED ogg)
pkg_check_modules(VORBIS REQUIRED vorbis) pkg_check_modules(VORBIS REQUIRED vorbis)
pkg_check_modules(VORBISENC REQUIRED vorbisenc) pkg_check_modules(VORBISENC REQUIRED vorbisenc)
pkg_check_modules(VORBISFILE REQUIRED vorbisfile) pkg_check_modules(VORBISFILE REQUIRED vorbisfile)
else (STANDALONE) else (LINUX)
use_prebuilt_binary(ogg_vorbis) use_prebuilt_binary(ogg_vorbis)
set(VORBIS_INCLUDE_DIRS ${LIBS_PREBUILT_DIR}/include) set(VORBIS_INCLUDE_DIRS ${LIBS_PREBUILT_DIR}/include)
set(VORBISENC_INCLUDE_DIRS ${VORBIS_INCLUDE_DIRS}) set(VORBISENC_INCLUDE_DIRS ${VORBIS_INCLUDE_DIRS})
@@ -32,7 +32,7 @@ else (STANDALONE)
set(VORBISENC_LIBRARIES vorbisenc) set(VORBISENC_LIBRARIES vorbisenc)
set(VORBISFILE_LIBRARIES vorbisfile) set(VORBISFILE_LIBRARIES vorbisfile)
endif (WINDOWS) endif (WINDOWS)
endif (STANDALONE) endif (LINUX)
link_directories( link_directories(
${VORBIS_LIBRARY_DIRS} ${VORBIS_LIBRARY_DIRS}

View File

@@ -50,7 +50,6 @@ set(cmake_SOURCE_FILES
GooglePerfTools.cmake GooglePerfTools.cmake
Hunspell.cmake Hunspell.cmake
JPEG.cmake JPEG.cmake
Json.cmake
LLAddBuildTest.cmake LLAddBuildTest.cmake
LLAppearance.cmake LLAppearance.cmake
LLAudio.cmake LLAudio.cmake

View File

@@ -13,10 +13,6 @@ include(LLCommon)
# set up platform specific lists of files that need to be copied # set up platform specific lists of files that need to be copied
################################################################### ###################################################################
if(WINDOWS) if(WINDOWS)
set(CMAKE_INSTALL_SYSTEM_RUNTIME_LIBS_SKIP TRUE)
set(CMAKE_INSTALL_UCRT_LIBRARIES TRUE)
include(InstallRequiredSystemLibrariesAL)
set(SHARED_LIB_STAGING_DIR_DEBUG "${SHARED_LIB_STAGING_DIR}/Debug") set(SHARED_LIB_STAGING_DIR_DEBUG "${SHARED_LIB_STAGING_DIR}/Debug")
set(SHARED_LIB_STAGING_DIR_RELWITHDEBINFO "${SHARED_LIB_STAGING_DIR}/RelWithDebInfo") set(SHARED_LIB_STAGING_DIR_RELWITHDEBINFO "${SHARED_LIB_STAGING_DIR}/RelWithDebInfo")
set(SHARED_LIB_STAGING_DIR_RELEASE "${SHARED_LIB_STAGING_DIR}/Release") set(SHARED_LIB_STAGING_DIR_RELEASE "${SHARED_LIB_STAGING_DIR}/Release")
@@ -96,26 +92,6 @@ if(WINDOWS)
list(APPEND release_files fmod.dll) list(APPEND release_files fmod.dll)
endif (USE_FMODSTUDIO) endif (USE_FMODSTUDIO)
foreach(redistfullfile IN LISTS CMAKE_INSTALL_SYSTEM_RUNTIME_LIBS)
get_filename_component(redistfilepath ${redistfullfile} DIRECTORY )
get_filename_component(redistfilename ${redistfullfile} NAME)
copy_if_different(
${redistfilepath}
"${SHARED_LIB_STAGING_DIR_RELEASE}"
out_targets
${redistfilename}
)
set(third_party_targets ${third_party_targets} ${out_targets})
copy_if_different(
${redistfilepath}
"${SHARED_LIB_STAGING_DIR_RELWITHDEBINFO}"
out_targets
${redistfilename}
)
set(third_party_targets ${third_party_targets} ${out_targets})
endforeach()
elseif(DARWIN) elseif(DARWIN)
set(SHARED_LIB_STAGING_DIR_DEBUG "${SHARED_LIB_STAGING_DIR}/Debug/Resources") set(SHARED_LIB_STAGING_DIR_DEBUG "${SHARED_LIB_STAGING_DIR}/Debug/Resources")
set(SHARED_LIB_STAGING_DIR_RELWITHDEBINFO "${SHARED_LIB_STAGING_DIR}/RelWithDebInfo/Resources") set(SHARED_LIB_STAGING_DIR_RELWITHDEBINFO "${SHARED_LIB_STAGING_DIR}/RelWithDebInfo/Resources")
@@ -148,10 +124,10 @@ elseif(DARWIN)
libndofdev.dylib libndofdev.dylib
) )
if (FMODSTUDIO) if (USE_FMODSTUDIO)
list(APPEND debug_files libfmodL.dylib) list(APPEND debug_files libfmodL.dylib)
list(APPEND release_files libfmod.dylib) list(APPEND release_files libfmod.dylib)
endif (FMODSTUDIO) endif (USE_FMODSTUDIO)
elseif(LINUX) elseif(LINUX)
# linux is weird, multiple side by side configurations aren't supported # linux is weird, multiple side by side configurations aren't supported
@@ -181,12 +157,9 @@ elseif(LINUX)
set(release_files set(release_files
libapr-1.so.0 libapr-1.so.0
libaprutil-1.so.0 libaprutil-1.so.0
libatk-1.0.so
libexpat.so libexpat.so
libexpat.so.1 libexpat.so.1
libGLOD.so libGLOD.so
libgmodule-2.0.so
libgobject-2.0.so
libopenal.so libopenal.so
) )

View File

@@ -1,24 +1,11 @@
# -*- cmake -*- # -*- cmake -*-
include(Prebuilt)
if (STANDALONE) if (LINUX)
include(FindPkgConfig) include(FindPkgConfig)
pkg_check_modules(DBUSGLIB REQUIRED dbus-glib-1) pkg_check_modules(DBUSGLIB REQUIRED dbus-glib-1)
elseif (LINUX) endif (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)
if (DBUSGLIB_FOUND) if (DBUSGLIB_FOUND)
set(DBUSGLIB ON CACHE BOOL "Build with dbus-glib message bus support.") set(DBUSGLIB ON CACHE BOOL "Build with dbus-glib message bus support.")

View File

@@ -1,741 +0,0 @@
# Distributed under the OSI-approved BSD 3-Clause License. See accompanying
# file Copyright.txt or https://cmake.org/licensing for details.
#[=======================================================================[.rst:
InstallRequiredSystemLibraries
------------------------------
Include this module to search for compiler-provided system runtime
libraries and add install rules for them. Some optional variables
may be set prior to including the module to adjust behavior:
``CMAKE_INSTALL_SYSTEM_RUNTIME_LIBS``
Specify additional runtime libraries that may not be detected.
After inclusion any detected libraries will be appended to this.
``CMAKE_INSTALL_SYSTEM_RUNTIME_LIBS_SKIP``
Set to TRUE to skip calling the :command:`install(PROGRAMS)` command to
allow the includer to specify its own install rule, using the value of
``CMAKE_INSTALL_SYSTEM_RUNTIME_LIBS`` to get the list of libraries.
``CMAKE_INSTALL_DEBUG_LIBRARIES``
Set to TRUE to install the debug runtime libraries when available
with MSVC tools.
``CMAKE_INSTALL_DEBUG_LIBRARIES_ONLY``
Set to TRUE to install only the debug runtime libraries with MSVC
tools even if the release runtime libraries are also available.
``CMAKE_INSTALL_UCRT_LIBRARIES``
Set to TRUE to install the Windows Universal CRT libraries for
app-local deployment (e.g. to Windows XP). This is meaningful
only with MSVC from Visual Studio 2015 or higher.
One may set a ``CMAKE_WINDOWS_KITS_10_DIR`` *environment variable*
to an absolute path to tell CMake to look for Windows 10 SDKs in
a custom location. The specified directory is expected to contain
``Redist/ucrt/DLLs/*`` directories.
``CMAKE_INSTALL_MFC_LIBRARIES``
Set to TRUE to install the MSVC MFC runtime libraries.
``CMAKE_INSTALL_OPENMP_LIBRARIES``
Set to TRUE to install the MSVC OpenMP runtime libraries
``CMAKE_INSTALL_SYSTEM_RUNTIME_DESTINATION``
Specify the :command:`install(PROGRAMS)` command ``DESTINATION``
option. If not specified, the default is ``bin`` on Windows
and ``lib`` elsewhere.
``CMAKE_INSTALL_SYSTEM_RUNTIME_LIBS_NO_WARNINGS``
Set to TRUE to disable warnings about required library files that
do not exist. (For example, Visual Studio Express editions may
not provide the redistributable files.)
``CMAKE_INSTALL_SYSTEM_RUNTIME_COMPONENT``
Specify the :command:`install(PROGRAMS)` command ``COMPONENT``
option. If not specified, no such option will be used.
#]=======================================================================]
cmake_policy(PUSH)
cmake_policy(SET CMP0054 NEW) # if() quoted variables not dereferenced
set(_IRSL_HAVE_Intel FALSE)
set(_IRSL_HAVE_MSVC FALSE)
foreach(LANG IN ITEMS C CXX Fortran)
if("${CMAKE_${LANG}_COMPILER_ID}" STREQUAL "Intel")
if(NOT _IRSL_HAVE_Intel)
get_filename_component(_Intel_basedir "${CMAKE_${LANG}_COMPILER}" PATH)
if(CMAKE_SIZEOF_VOID_P EQUAL 8)
set(_Intel_archdir intel64)
else()
set(_Intel_archdir x86)
endif()
set(_Intel_compiler_ver ${CMAKE_${LANG}_COMPILER_VERSION})
if(WIN32)
get_filename_component(_Intel_redistdir "${_Intel_basedir}/../../redist/${_Intel_archdir}/compiler" ABSOLUTE)
elseif(APPLE)
get_filename_component(_Intel_redistdir "${_Intel_basedir}/../../compiler/lib" ABSOLUTE)
else()
if(EXISTS "${_Intel_basedir}/../lib/${_Intel_archdir}_lin")
get_filename_component(_Intel_redistdir "${_Intel_basedir}/../lib/${_Intel_archdir}" ABSOLUTE)
else()
get_filename_component(_Intel_redistdir "${_Intel_basedir}/../../compiler/lib/${_Intel_archdir}_lin" ABSOLUTE)
endif()
endif()
set(_IRSL_HAVE_Intel TRUE)
endif()
elseif("${CMAKE_${LANG}_COMPILER_ID}" STREQUAL "MSVC")
set(_IRSL_HAVE_MSVC TRUE)
endif()
endforeach()
if(MSVC)
file(TO_CMAKE_PATH "$ENV{SYSTEMROOT}" SYSTEMROOT)
if(CMAKE_CL_64)
if(MSVC_VERSION GREATER 1599)
# VS 10 and later:
set(CMAKE_MSVC_ARCH x64)
else()
# VS 9 and earlier:
set(CMAKE_MSVC_ARCH amd64)
endif()
else()
set(CMAKE_MSVC_ARCH x86)
endif()
get_filename_component(devenv_dir "${CMAKE_MAKE_PROGRAM}" PATH)
get_filename_component(base_dir "${devenv_dir}/../.." ABSOLUTE)
if(MSVC_VERSION EQUAL 1300)
set(__install__libs
"${SYSTEMROOT}/system32/msvcp70.dll"
"${SYSTEMROOT}/system32/msvcr70.dll"
)
endif()
if(MSVC_VERSION EQUAL 1310)
set(__install__libs
"${SYSTEMROOT}/system32/msvcp71.dll"
"${SYSTEMROOT}/system32/msvcr71.dll"
)
endif()
if(MSVC_TOOLSET_VERSION EQUAL 80)
# Find the runtime library redistribution directory.
get_filename_component(msvc_install_dir
"[HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\VisualStudio\\8.0;InstallDir]" ABSOLUTE)
if(DEFINED MSVC80_REDIST_DIR AND EXISTS "${MSVC80_REDIST_DIR}")
set(MSVC_REDIST_DIR "${MSVC80_REDIST_DIR}") # use old cache entry
endif()
find_path(MSVC_REDIST_DIR NAMES ${CMAKE_MSVC_ARCH}/Microsoft.VC80.CRT/Microsoft.VC80.CRT.manifest
PATHS
"${msvc_install_dir}/../../VC/redist"
"${base_dir}/VC/redist"
)
mark_as_advanced(MSVC_REDIST_DIR)
set(MSVC_CRT_DIR "${MSVC_REDIST_DIR}/${CMAKE_MSVC_ARCH}/Microsoft.VC80.CRT")
# Install the manifest that allows DLLs to be loaded from the
# directory containing the executable.
if(NOT CMAKE_INSTALL_DEBUG_LIBRARIES_ONLY)
set(__install__libs
"${MSVC_CRT_DIR}/Microsoft.VC80.CRT.manifest"
"${MSVC_CRT_DIR}/msvcm80.dll"
"${MSVC_CRT_DIR}/msvcp80.dll"
"${MSVC_CRT_DIR}/msvcr80.dll"
)
else()
set(__install__libs)
endif()
if(CMAKE_INSTALL_DEBUG_LIBRARIES)
set(MSVC_CRT_DIR
"${MSVC_REDIST_DIR}/Debug_NonRedist/${CMAKE_MSVC_ARCH}/Microsoft.VC80.DebugCRT")
set(__install__libs ${__install__libs}
"${MSVC_CRT_DIR}/Microsoft.VC80.DebugCRT.manifest"
"${MSVC_CRT_DIR}/msvcm80d.dll"
"${MSVC_CRT_DIR}/msvcp80d.dll"
"${MSVC_CRT_DIR}/msvcr80d.dll"
)
endif()
endif()
if(MSVC_TOOLSET_VERSION EQUAL 90)
# Find the runtime library redistribution directory.
get_filename_component(msvc_install_dir
"[HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\VisualStudio\\9.0;InstallDir]" ABSOLUTE)
get_filename_component(msvc_express_install_dir
"[HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\VCExpress\\9.0;InstallDir]" ABSOLUTE)
if(DEFINED MSVC90_REDIST_DIR AND EXISTS "${MSVC90_REDIST_DIR}")
set(MSVC_REDIST_DIR "${MSVC90_REDIST_DIR}") # use old cache entry
endif()
find_path(MSVC_REDIST_DIR NAMES ${CMAKE_MSVC_ARCH}/Microsoft.VC90.CRT/Microsoft.VC90.CRT.manifest
PATHS
"${msvc_install_dir}/../../VC/redist"
"${msvc_express_install_dir}/../../VC/redist"
"${base_dir}/VC/redist"
)
mark_as_advanced(MSVC_REDIST_DIR)
set(MSVC_CRT_DIR "${MSVC_REDIST_DIR}/${CMAKE_MSVC_ARCH}/Microsoft.VC90.CRT")
# Install the manifest that allows DLLs to be loaded from the
# directory containing the executable.
if(NOT CMAKE_INSTALL_DEBUG_LIBRARIES_ONLY)
set(__install__libs
"${MSVC_CRT_DIR}/Microsoft.VC90.CRT.manifest"
"${MSVC_CRT_DIR}/msvcm90.dll"
"${MSVC_CRT_DIR}/msvcp90.dll"
"${MSVC_CRT_DIR}/msvcr90.dll"
)
else()
set(__install__libs)
endif()
if(CMAKE_INSTALL_DEBUG_LIBRARIES)
set(MSVC_CRT_DIR
"${MSVC_REDIST_DIR}/Debug_NonRedist/${CMAKE_MSVC_ARCH}/Microsoft.VC90.DebugCRT")
set(__install__libs ${__install__libs}
"${MSVC_CRT_DIR}/Microsoft.VC90.DebugCRT.manifest"
"${MSVC_CRT_DIR}/msvcm90d.dll"
"${MSVC_CRT_DIR}/msvcp90d.dll"
"${MSVC_CRT_DIR}/msvcr90d.dll"
)
endif()
endif()
set(MSVC_REDIST_NAME "")
set(_MSVC_DLL_VERSION "")
set(_MSVC_IDE_VERSION "")
if(MSVC_VERSION GREATER_EQUAL 2000)
message(WARNING "MSVC ${MSVC_VERSION} not yet supported.")
elseif(MSVC_VERSION_VERSION GREATER_EQUAL 143)
message(WARNING "MSVC toolset v${MSVC_VERSION_VERSION} not yet supported.")
elseif(MSVC_TOOLSET_VERSION EQUAL 142)
set(MSVC_REDIST_NAME VC142)
set(_MSVC_DLL_VERSION 140)
set(_MSVC_IDE_VERSION 16)
if(MSVC_VERSION EQUAL 1920)
# VS2019 named this differently prior to update 1.
set(MSVC_REDIST_NAME VC141)
endif()
elseif(MSVC_TOOLSET_VERSION EQUAL 141)
set(MSVC_REDIST_NAME VC141)
set(_MSVC_DLL_VERSION 140)
set(_MSVC_IDE_VERSION 15)
if(MSVC_VERSION EQUAL 1910)
# VS2017 named this differently prior to update 3.
set(MSVC_REDIST_NAME VC150)
endif()
elseif(MSVC_TOOLSET_VERSION)
set(MSVC_REDIST_NAME VC${MSVC_TOOLSET_VERSION})
math(EXPR _MSVC_DLL_VERSION "${MSVC_TOOLSET_VERSION} / 10 * 10")
math(EXPR _MSVC_IDE_VERSION "${MSVC_TOOLSET_VERSION} / 10")
endif()
set(_MSVCRT_DLL_VERSION "")
set(_MSVCRT_IDE_VERSION "")
if(_MSVC_IDE_VERSION GREATER_EQUAL 10)
set(_MSVCRT_DLL_VERSION "${_MSVC_DLL_VERSION}")
set(_MSVCRT_IDE_VERSION "${_MSVC_IDE_VERSION}")
endif()
if(_MSVCRT_DLL_VERSION)
set(v "${_MSVCRT_DLL_VERSION}")
set(vs "${_MSVCRT_IDE_VERSION}")
# Find the runtime library redistribution directory.
if(vs VERSION_LESS 15 AND DEFINED MSVC${vs}_REDIST_DIR AND EXISTS "${MSVC${vs}_REDIST_DIR}")
set(MSVC_REDIST_DIR "${MSVC${vs}_REDIST_DIR}") # use old cache entry
endif()
if(NOT vs VERSION_LESS 15)
set(_vs_redist_paths "")
cmake_host_system_information(RESULT _vs_dir QUERY VS_${vs}_DIR) # undocumented query
if(IS_DIRECTORY "${_vs_dir}")
file(GLOB _vs_redist_paths "${_vs_dir}/VC/Redist/MSVC/*")
endif()
unset(_vs_dir)
else()
get_filename_component(_vs_dir
"[HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\VisualStudio\\${vs}.0;InstallDir]" ABSOLUTE)
set(programfilesx86 "ProgramFiles(x86)")
set(_vs_redist_paths
"${_vs_dir}/../../VC/redist"
"${base_dir}/VC/redist"
"$ENV{ProgramFiles}/Microsoft Visual Studio ${vs}.0/VC/redist"
"$ENV{${programfilesx86}}/Microsoft Visual Studio ${vs}.0/VC/redist"
)
unset(_vs_dir)
unset(programfilesx86)
endif()
find_path(MSVC_REDIST_DIR NAMES ${CMAKE_MSVC_ARCH}/Microsoft.${MSVC_REDIST_NAME}.CRT PATHS ${_vs_redist_paths})
unset(_vs_redist_paths)
mark_as_advanced(MSVC_REDIST_DIR)
set(MSVC_CRT_DIR "${MSVC_REDIST_DIR}/${CMAKE_MSVC_ARCH}/Microsoft.${MSVC_REDIST_NAME}.CRT")
if(NOT CMAKE_INSTALL_DEBUG_LIBRARIES_ONLY)
set(__install__libs
"${MSVC_CRT_DIR}/msvcp${v}.dll"
)
if(NOT vs VERSION_LESS 14)
file(GLOB __msvcr_dlls "${MSVC_CRT_DIR}/*.dll")
list(APPEND __install__libs ${__msvcr_dlls})
else()
list(APPEND __install__libs "${MSVC_CRT_DIR}/msvcr${v}.dll")
endif()
else()
set(__install__libs)
endif()
if(CMAKE_INSTALL_DEBUG_LIBRARIES)
set(MSVC_CRT_DIR
"${MSVC_REDIST_DIR}/Debug_NonRedist/${CMAKE_MSVC_ARCH}/Microsoft.${MSVC_REDIST_NAME}.DebugCRT")
set(__install__libs ${__install__libs}
"${MSVC_CRT_DIR}/msvcp${v}d.dll"
)
if(NOT vs VERSION_LESS 14)
list(APPEND __install__libs
"${MSVC_CRT_DIR}/vcruntime${v}d.dll"
"${MSVC_CRT_DIR}/concrt${v}d.dll"
)
else()
list(APPEND __install__libs "${MSVC_CRT_DIR}/msvcr${v}d.dll")
endif()
endif()
if(CMAKE_INSTALL_UCRT_LIBRARIES AND NOT vs VERSION_LESS 14)
# Find the Windows Kits directory.
get_filename_component(windows_kits_dir
"[HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\Windows Kits\\Installed Roots;KitsRoot10]" ABSOLUTE)
set(programfilesx86 "ProgramFiles(x86)")
if(";${CMAKE_VS_WINDOWS_TARGET_PLATFORM_VERSION};$ENV{UCRTVersion};$ENV{WindowsSDKVersion};" MATCHES [=[;(10\.[0-9.]+)[;\]]=])
set(__ucrt_version "${CMAKE_MATCH_1}/")
else()
set(__ucrt_version "")
endif()
find_path(WINDOWS_KITS_DIR
NAMES
Redist/${__ucrt_version}ucrt/DLLs/${CMAKE_MSVC_ARCH}/ucrtbase.dll
Redist/ucrt/DLLs/${CMAKE_MSVC_ARCH}/ucrtbase.dll
PATHS
$ENV{CMAKE_WINDOWS_KITS_10_DIR}
"${windows_kits_dir}"
"$ENV{ProgramFiles}/Windows Kits/10"
"$ENV{${programfilesx86}}/Windows Kits/10"
)
mark_as_advanced(WINDOWS_KITS_DIR)
# Glob the list of UCRT DLLs.
if(NOT CMAKE_INSTALL_DEBUG_LIBRARIES_ONLY)
if(EXISTS "${WINDOWS_KITS_DIR}/Redist/${__ucrt_version}ucrt/DLLs/${CMAKE_MSVC_ARCH}/ucrtbase.dll")
file(GLOB __ucrt_dlls "${WINDOWS_KITS_DIR}/Redist/${__ucrt_version}ucrt/DLLs/${CMAKE_MSVC_ARCH}/*.dll")
else()
file(GLOB __ucrt_dlls "${WINDOWS_KITS_DIR}/Redist/ucrt/DLLs/${CMAKE_MSVC_ARCH}/*.dll")
endif()
list(APPEND __install__libs ${__ucrt_dlls})
endif()
if(CMAKE_INSTALL_DEBUG_LIBRARIES)
if(EXISTS "${WINDOWS_KITS_DIR}/bin/${__ucrt_version}${CMAKE_MSVC_ARCH}/ucrt/ucrtbased.dll")
file(GLOB __ucrt_dlls "${WINDOWS_KITS_DIR}/bin/${__ucrt_version}${CMAKE_MSVC_ARCH}/ucrt/*.dll")
else()
file(GLOB __ucrt_dlls "${WINDOWS_KITS_DIR}/bin/${CMAKE_MSVC_ARCH}/ucrt/*.dll")
endif()
list(APPEND __install__libs ${__ucrt_dlls})
endif()
endif()
endif()
if(CMAKE_INSTALL_MFC_LIBRARIES)
if(MSVC_VERSION EQUAL 1300)
set(__install__libs ${__install__libs}
"${SYSTEMROOT}/system32/mfc70.dll"
)
endif()
if(MSVC_VERSION EQUAL 1310)
set(__install__libs ${__install__libs}
"${SYSTEMROOT}/system32/mfc71.dll"
)
endif()
if(MSVC_VERSION EQUAL 1400)
if(CMAKE_INSTALL_DEBUG_LIBRARIES)
set(MSVC_MFC_DIR
"${MSVC_REDIST_DIR}/Debug_NonRedist/${CMAKE_MSVC_ARCH}/Microsoft.VC80.DebugMFC")
set(__install__libs ${__install__libs}
"${MSVC_MFC_DIR}/Microsoft.VC80.DebugMFC.manifest"
"${MSVC_MFC_DIR}/mfc80d.dll"
"${MSVC_MFC_DIR}/mfc80ud.dll"
"${MSVC_MFC_DIR}/mfcm80d.dll"
"${MSVC_MFC_DIR}/mfcm80ud.dll"
)
endif()
set(MSVC_MFC_DIR "${MSVC_REDIST_DIR}/${CMAKE_MSVC_ARCH}/Microsoft.VC80.MFC")
# Install the manifest that allows DLLs to be loaded from the
# directory containing the executable.
if(NOT CMAKE_INSTALL_DEBUG_LIBRARIES_ONLY)
set(__install__libs ${__install__libs}
"${MSVC_MFC_DIR}/Microsoft.VC80.MFC.manifest"
"${MSVC_MFC_DIR}/mfc80.dll"
"${MSVC_MFC_DIR}/mfc80u.dll"
"${MSVC_MFC_DIR}/mfcm80.dll"
"${MSVC_MFC_DIR}/mfcm80u.dll"
)
endif()
# include the language dll's for vs8 as well as the actual dll's
set(MSVC_MFCLOC_DIR "${MSVC_REDIST_DIR}/${CMAKE_MSVC_ARCH}/Microsoft.VC80.MFCLOC")
# Install the manifest that allows DLLs to be loaded from the
# directory containing the executable.
set(__install__libs ${__install__libs}
"${MSVC_MFCLOC_DIR}/Microsoft.VC80.MFCLOC.manifest"
"${MSVC_MFCLOC_DIR}/mfc80chs.dll"
"${MSVC_MFCLOC_DIR}/mfc80cht.dll"
"${MSVC_MFCLOC_DIR}/mfc80enu.dll"
"${MSVC_MFCLOC_DIR}/mfc80esp.dll"
"${MSVC_MFCLOC_DIR}/mfc80deu.dll"
"${MSVC_MFCLOC_DIR}/mfc80fra.dll"
"${MSVC_MFCLOC_DIR}/mfc80ita.dll"
"${MSVC_MFCLOC_DIR}/mfc80jpn.dll"
"${MSVC_MFCLOC_DIR}/mfc80kor.dll"
)
endif()
if(MSVC_VERSION EQUAL 1500)
if(CMAKE_INSTALL_DEBUG_LIBRARIES)
set(MSVC_MFC_DIR
"${MSVC_REDIST_DIR}/Debug_NonRedist/${CMAKE_MSVC_ARCH}/Microsoft.VC90.DebugMFC")
set(__install__libs ${__install__libs}
"${MSVC_MFC_DIR}/Microsoft.VC90.DebugMFC.manifest"
"${MSVC_MFC_DIR}/mfc90d.dll"
"${MSVC_MFC_DIR}/mfc90ud.dll"
"${MSVC_MFC_DIR}/mfcm90d.dll"
"${MSVC_MFC_DIR}/mfcm90ud.dll"
)
endif()
set(MSVC_MFC_DIR "${MSVC_REDIST_DIR}/${CMAKE_MSVC_ARCH}/Microsoft.VC90.MFC")
# Install the manifest that allows DLLs to be loaded from the
# directory containing the executable.
if(NOT CMAKE_INSTALL_DEBUG_LIBRARIES_ONLY)
set(__install__libs ${__install__libs}
"${MSVC_MFC_DIR}/Microsoft.VC90.MFC.manifest"
"${MSVC_MFC_DIR}/mfc90.dll"
"${MSVC_MFC_DIR}/mfc90u.dll"
"${MSVC_MFC_DIR}/mfcm90.dll"
"${MSVC_MFC_DIR}/mfcm90u.dll"
)
endif()
# include the language dll's for vs9 as well as the actual dll's
set(MSVC_MFCLOC_DIR "${MSVC_REDIST_DIR}/${CMAKE_MSVC_ARCH}/Microsoft.VC90.MFCLOC")
# Install the manifest that allows DLLs to be loaded from the
# directory containing the executable.
set(__install__libs ${__install__libs}
"${MSVC_MFCLOC_DIR}/Microsoft.VC90.MFCLOC.manifest"
"${MSVC_MFCLOC_DIR}/mfc90chs.dll"
"${MSVC_MFCLOC_DIR}/mfc90cht.dll"
"${MSVC_MFCLOC_DIR}/mfc90enu.dll"
"${MSVC_MFCLOC_DIR}/mfc90esp.dll"
"${MSVC_MFCLOC_DIR}/mfc90deu.dll"
"${MSVC_MFCLOC_DIR}/mfc90fra.dll"
"${MSVC_MFCLOC_DIR}/mfc90ita.dll"
"${MSVC_MFCLOC_DIR}/mfc90jpn.dll"
"${MSVC_MFCLOC_DIR}/mfc90kor.dll"
)
endif()
set(_MFC_DLL_VERSION "")
set(_MFC_IDE_VERSION "")
if(_MSVC_IDE_VERSION GREATER_EQUAL 10)
set(_MFC_DLL_VERSION ${_MSVC_DLL_VERSION})
set(_MFC_IDE_VERSION ${_MSVC_IDE_VERSION})
endif()
if(_MFC_DLL_VERSION)
set(v "${_MFC_DLL_VERSION}")
set(vs "${_MFC_IDE_VERSION}")
# Starting with VS 15 the MFC DLLs may be in a different directory.
if (NOT vs VERSION_LESS 15)
file(GLOB _MSVC_REDIST_DIRS "${MSVC_REDIST_DIR}/../*")
find_path(MSVC_REDIST_MFC_DIR NAMES ${CMAKE_MSVC_ARCH}/Microsoft.${MSVC_REDIST_NAME}.MFC
PATHS ${_MSVC_REDIST_DIRS} NO_DEFAULT_PATH)
mark_as_advanced(MSVC_REDIST_MFC_DIR)
unset(_MSVC_REDIST_DIRS)
else()
set(MSVC_REDIST_MFC_DIR "${MSVC_REDIST_DIR}")
endif()
# Multi-Byte Character Set versions of MFC are available as optional
# addon since Visual Studio 12. So for version 12 or higher, check
# whether they are available and exclude them if they are not.
if(CMAKE_INSTALL_DEBUG_LIBRARIES)
set(MSVC_MFC_DIR
"${MSVC_REDIST_MFC_DIR}/Debug_NonRedist/${CMAKE_MSVC_ARCH}/Microsoft.${MSVC_REDIST_NAME}.DebugMFC")
set(__install__libs ${__install__libs}
"${MSVC_MFC_DIR}/mfc${v}ud.dll"
"${MSVC_MFC_DIR}/mfcm${v}ud.dll"
)
if("${v}" LESS 12 OR EXISTS "${MSVC_MFC_DIR}/mfc${v}d.dll")
set(__install__libs ${__install__libs}
"${MSVC_MFC_DIR}/mfc${v}d.dll"
)
endif()
if("${v}" LESS 12 OR EXISTS "${MSVC_MFC_DIR}/mfcm${v}d.dll")
set(__install__libs ${__install__libs}
"${MSVC_MFC_DIR}/mfcm${v}d.dll"
)
endif()
endif()
set(MSVC_MFC_DIR "${MSVC_REDIST_MFC_DIR}/${CMAKE_MSVC_ARCH}/Microsoft.${MSVC_REDIST_NAME}.MFC")
if(NOT CMAKE_INSTALL_DEBUG_LIBRARIES_ONLY)
set(__install__libs ${__install__libs}
"${MSVC_MFC_DIR}/mfc${v}u.dll"
"${MSVC_MFC_DIR}/mfcm${v}u.dll"
)
if("${v}" LESS 12 OR EXISTS "${MSVC_MFC_DIR}/mfc${v}.dll")
set(__install__libs ${__install__libs}
"${MSVC_MFC_DIR}/mfc${v}.dll"
)
endif()
if("${v}" LESS 12 OR EXISTS "${MSVC_MFC_DIR}/mfcm${v}.dll")
set(__install__libs ${__install__libs}
"${MSVC_MFC_DIR}/mfcm${v}.dll"
)
endif()
endif()
# include the language dll's as well as the actual dll's
set(MSVC_MFCLOC_DIR "${MSVC_REDIST_MFC_DIR}/${CMAKE_MSVC_ARCH}/Microsoft.${MSVC_REDIST_NAME}.MFCLOC")
set(__install__libs ${__install__libs}
"${MSVC_MFCLOC_DIR}/mfc${v}chs.dll"
"${MSVC_MFCLOC_DIR}/mfc${v}cht.dll"
"${MSVC_MFCLOC_DIR}/mfc${v}deu.dll"
"${MSVC_MFCLOC_DIR}/mfc${v}enu.dll"
"${MSVC_MFCLOC_DIR}/mfc${v}esn.dll"
"${MSVC_MFCLOC_DIR}/mfc${v}fra.dll"
"${MSVC_MFCLOC_DIR}/mfc${v}ita.dll"
"${MSVC_MFCLOC_DIR}/mfc${v}jpn.dll"
"${MSVC_MFCLOC_DIR}/mfc${v}kor.dll"
"${MSVC_MFCLOC_DIR}/mfc${v}rus.dll"
)
endif()
endif()
# MSVC 8 was the first version with OpenMP
# Furthermore, there is no debug version of this
if(CMAKE_INSTALL_OPENMP_LIBRARIES AND _IRSL_HAVE_MSVC)
set(_MSOMP_DLL_VERSION ${_MSVC_DLL_VERSION})
set(_MSOMP_IDE_VERSION ${_MSVC_IDE_VERSION})
if(_MSOMP_DLL_VERSION)
set(v "${_MSOMP_DLL_VERSION}")
set(vs "${_MSOMP_IDE_VERSION}")
set(MSVC_OPENMP_DIR "${MSVC_REDIST_DIR}/${CMAKE_MSVC_ARCH}/Microsoft.${MSVC_REDIST_NAME}.OPENMP")
if(NOT CMAKE_INSTALL_DEBUG_LIBRARIES_ONLY)
set(__install__libs ${__install__libs}
"${MSVC_OPENMP_DIR}/vcomp${v}.dll")
endif()
endif()
endif()
foreach(lib
${__install__libs}
)
if(EXISTS ${lib})
set(CMAKE_INSTALL_SYSTEM_RUNTIME_LIBS
${CMAKE_INSTALL_SYSTEM_RUNTIME_LIBS} ${lib})
else()
if(NOT CMAKE_INSTALL_SYSTEM_RUNTIME_LIBS_NO_WARNINGS)
message(WARNING "system runtime library file does not exist: '${lib}'")
# This warning indicates an incomplete Visual Studio installation
# or a bug somewhere above here in this file.
# If you would like to avoid this warning, fix the real problem, or
# set CMAKE_INSTALL_SYSTEM_RUNTIME_LIBS_NO_WARNINGS before including
# this file.
endif()
endif()
endforeach()
endif()
if(_IRSL_HAVE_Intel)
unset(__install_libs)
if(CMAKE_INSTALL_OPENMP_LIBRARIES)
if(WIN32)
list(APPEND __install_libs "${_Intel_redistdir}/libiomp5md.dll" "${_Intel_redistdir}/libiompstubs5md.dll")
elseif(APPLE)
list(APPEND __install_libs "${_Intel_redistdir}/libiomp5.dylib" "${_Intel_redistdir}/libiompstubs5.dylib")
else()
list(APPEND __install_libs "${_Intel_redistdir}/libiomp5.so" "${_Intel_redistdir}/libiompstubs5.so")
if(_Intel_compiler_ver VERSION_LESS 17)
list(APPEND __install_libs "${_Intel_redistdir}/libomp_db.so")
endif()
if(_Intel_compiler_ver VERSION_LESS 13)
list(APPEND __install_libs "${_Intel_redistdir}/libiompprof5.so")
endif()
endif()
endif()
if(WIN32)
set(__install_dirs "${_Intel_redistdir}/1033")
if(EXISTS "${_Intel_redistdir}/1041")
list(APPEND __install_dirs "${_Intel_redistdir}/1041")
endif()
if(_Intel_compiler_ver VERSION_LESS 18)
list(APPEND __install_dirs "${_Intel_redistdir}/irml" "${_Intel_redistdir}/irml_c")
endif()
foreach(__Intel_lib IN ITEMS cilkrts20.dll libchkp.dll libioffload_host.dll libirngmd.dll
libmmd.dll libmmdd.dll libmpx.dll liboffload.dll svml_dispmd.dll)
list(APPEND __install_libs "${_Intel_redistdir}/${__Intel_lib}")
endforeach()
if(CMAKE_C_COMPILER_ID STREQUAL Intel OR CMAKE_CXX_COMPILER_ID STREQUAL Intel)
list(APPEND __install_libs "${_Intel_redistdir}/libgfxoffload.dll")
endif()
if(CMAKE_Fortran_COMPILER_ID STREQUAL Intel)
foreach(__Intel_lib IN ITEMS ifdlg100.dll libicaf.dll libifcoremd.dll libifcoremdd.dll libifcorert.dll libifcorertd.dll libifportmd.dll)
list(APPEND __install_libs "${_Intel_redistdir}/${__Intel_lib}")
endforeach()
endif()
elseif(APPLE)
foreach(__Intel_lib IN ITEMS libchkp.dylib libcilkrts.5.dylib libcilkrts.dylib libimf.dylib libintlc.dylib libirc.dylib libirng.dylib libsvml.dylib)
list(APPEND __install_libs "${_Intel_redistdir}/${__Intel_lib}")
endforeach()
if(CMAKE_C_COMPILER_ID STREQUAL Intel OR CMAKE_CXX_COMPILER_ID STREQUAL Intel)
if(_Intel_compiler_ver VERSION_LESS 17)
list(APPEND __install_libs "${_Intel_redistdir}/libistrconv.dylib")
endif()
endif()
if(CMAKE_Fortran_COMPILER_ID STREQUAL Intel)
foreach(__Intel_lib IN ITEMS libifcore.dylib libifcoremt.dylib libifport.dylib libifportmt.dylib)
list(APPEND __install_libs "${_Intel_redistdir}/${__Intel_lib}")
endforeach()
endif()
else()
foreach(__Intel_lib IN ITEMS libchkp.so libcilkrts.so libcilkrts.so.5 libimf.so libintlc.so libintlc.so.5 libirc.so libpdbx.so libpdbx.so.5 libsvml.so)
list(APPEND __install_libs "${_Intel_redistdir}/${__Intel_lib}")
endforeach()
if(_Intel_compiler_ver VERSION_GREATER_EQUAL 13)
foreach(__Intel_lib IN ITEMS libirng.so liboffload.so liboffload.so.5)
list(APPEND __install_libs "${_Intel_redistdir}/${__Intel_lib}")
endforeach()
endif()
if(CMAKE_C_COMPILER_ID STREQUAL Intel OR CMAKE_CXX_COMPILER_ID STREQUAL Intel)
set(__install_dirs "${_Intel_redistdir}/irml")
list(APPEND __install_libs "${_Intel_redistdir}/cilk_db.so")
if(_Intel_compiler_ver VERSION_GREATER_EQUAL 15)
list(APPEND __install_libs "${_Intel_redistdir}/libistrconv.so" "${_Intel_redistdir}/libgfxoffload.so")
endif()
endif()
if(_Intel_compiler_ver VERSION_GREATER_EQUAL 16)
foreach(__Intel_lib IN ITEMS libioffload_host.so libioffload_host.so.5 libioffload_target.so libioffload_target.so.5 libmpx.so offload_main)
list(APPEND __install_libs "${_Intel_redistdir}/${__Intel_lib}")
endforeach()
endif()
if(_Intel_compiler_ver VERSION_LESS 15)
foreach(__Intel_lib IN ITEMS libcxaguard.so libcxaguard.so.5)
list(APPEND __install_libs "${_Intel_redistdir}/${__Intel_lib}")
endforeach()
endif()
if(CMAKE_Fortran_COMPILER_ID STREQUAL Intel)
foreach(__Intel_lib IN ITEMS libicaf.so libifcore.so libifcore.so.5 libifcoremt.so libifcoremt.so.5 libifport.so libifport.so.5)
list(APPEND __install_libs "${_Intel_redistdir}/${__Intel_lib}")
endforeach()
endif()
endif()
foreach(lib IN LISTS __install_libs)
if(EXISTS ${lib})
list(APPEND CMAKE_INSTALL_SYSTEM_RUNTIME_LIBS ${lib})
else()
if(NOT CMAKE_INSTALL_SYSTEM_RUNTIME_LIBS_NO_WARNINGS)
message(WARNING "system runtime library file does not exist: '${lib}'")
endif()
endif()
endforeach()
foreach(dir IN LISTS __install_dirs)
if(EXISTS ${dir})
list(APPEND CMAKE_INSTALL_SYSTEM_RUNTIME_DIRECTORIES ${dir})
else()
if(NOT CMAKE_INSTALL_SYSTEM_RUNTIME_LIBS_NO_WARNINGS)
message(WARNING "system runtime library file does not exist: '${dir}'")
endif()
endif()
endforeach()
endif()
if(WATCOM)
get_filename_component( CompilerPath ${CMAKE_C_COMPILER} PATH )
if(CMAKE_C_COMPILER_VERSION)
set(_compiler_version ${CMAKE_C_COMPILER_VERSION})
else()
set(_compiler_version ${CMAKE_CXX_COMPILER_VERSION})
endif()
string(REGEX MATCHALL "[0-9]+" _watcom_version_list "${_compiler_version}")
list(GET _watcom_version_list 0 _watcom_major)
list(GET _watcom_version_list 1 _watcom_minor)
set( __install__libs
${CompilerPath}/clbr${_watcom_major}${_watcom_minor}.dll
${CompilerPath}/mt7r${_watcom_major}${_watcom_minor}.dll
${CompilerPath}/plbr${_watcom_major}${_watcom_minor}.dll )
foreach(lib
${__install__libs}
)
if(EXISTS ${lib})
set(CMAKE_INSTALL_SYSTEM_RUNTIME_LIBS
${CMAKE_INSTALL_SYSTEM_RUNTIME_LIBS} ${lib})
else()
if(NOT CMAKE_INSTALL_SYSTEM_RUNTIME_LIBS_NO_WARNINGS)
message(WARNING "system runtime library file does not exist: '${lib}'")
# This warning indicates an incomplete Watcom installation
# or a bug somewhere above here in this file.
# If you would like to avoid this warning, fix the real problem, or
# set CMAKE_INSTALL_SYSTEM_RUNTIME_LIBS_NO_WARNINGS before including
# this file.
endif()
endif()
endforeach()
endif()
# Include system runtime libraries in the installation if any are
# specified by CMAKE_INSTALL_SYSTEM_RUNTIME_LIBS.
if(CMAKE_INSTALL_SYSTEM_RUNTIME_LIBS)
if(NOT CMAKE_INSTALL_SYSTEM_RUNTIME_LIBS_SKIP)
if(NOT CMAKE_INSTALL_SYSTEM_RUNTIME_DESTINATION)
if(WIN32)
set(CMAKE_INSTALL_SYSTEM_RUNTIME_DESTINATION bin)
else()
set(CMAKE_INSTALL_SYSTEM_RUNTIME_DESTINATION lib)
endif()
endif()
if(CMAKE_INSTALL_SYSTEM_RUNTIME_COMPONENT)
set(_CMAKE_INSTALL_SYSTEM_RUNTIME_COMPONENT
COMPONENT ${CMAKE_INSTALL_SYSTEM_RUNTIME_COMPONENT})
endif()
install(PROGRAMS ${CMAKE_INSTALL_SYSTEM_RUNTIME_LIBS}
DESTINATION ${CMAKE_INSTALL_SYSTEM_RUNTIME_DESTINATION}
${_CMAKE_INSTALL_SYSTEM_RUNTIME_COMPONENT}
)
install(DIRECTORY ${CMAKE_INSTALL_SYSTEM_RUNTIME_DIRECTORIES}
DESTINATION ${CMAKE_INSTALL_SYSTEM_RUNTIME_DESTINATION}
${_CMAKE_INSTALL_SYSTEM_RUNTIME_COMPONENT}
)
endif()
endif()
cmake_policy(POP)

View File

@@ -7,6 +7,6 @@ set(LLAUDIO_INCLUDE_DIRS
${LIBS_OPEN_DIR}/llaudio ${LIBS_OPEN_DIR}/llaudio
) )
add_definitions(-DOV_EXCLUDE_STATIC_CALLBACKS) #add_definitions(-DOV_EXCLUDE_STATIC_CALLBACKS)
set(LLAUDIO_LIBRARIES llaudio ${OPENAL_LIBRARIES}) set(LLAUDIO_LIBRARIES llaudio ${OPENAL_LIBRARIES})

View File

@@ -1,11 +1,9 @@
# -*- cmake -*- # -*- cmake -*-
include(Prebuilt)
include(FreeType) include(FreeType)
if (STANDALONE) if (LINUX)
include(FindPkgConfig) include(FindPkgConfig)
if (LINUX)
set(PKGCONFIG_PACKAGES set(PKGCONFIG_PACKAGES
atk atk
cairo cairo
@@ -21,8 +19,8 @@ if (STANDALONE)
pangox pangox
pangoxft pangoxft
sdl sdl
x11
) )
endif (LINUX)
foreach(pkg ${PKGCONFIG_PACKAGES}) foreach(pkg ${PKGCONFIG_PACKAGES})
pkg_check_modules(${pkg} REQUIRED ${pkg}) pkg_check_modules(${pkg} REQUIRED ${pkg})
@@ -31,39 +29,6 @@ if (STANDALONE)
list(APPEND UI_LIBRARIES ${${pkg}_LIBRARIES}) list(APPEND UI_LIBRARIES ${${pkg}_LIBRARIES})
add_definitions(${${pkg}_CFLAGS_OTHERS}) add_definitions(${${pkg}_CFLAGS_OTHERS})
endforeach(pkg) 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) add_definitions(-DLL_GTK=1 -DLL_X11=1)
endif (LINUX) endif (LINUX)

View File

@@ -270,6 +270,8 @@ if (NOT VIEWER_CHANNEL_GRK)
set(VIEWER_CHANNEL_GRK "\\u03B1") # "α" set(VIEWER_CHANNEL_GRK "\\u03B1") # "α"
elseif (VIEWER_CHANNEL_TYPE MATCHES "Beta") elseif (VIEWER_CHANNEL_TYPE MATCHES "Beta")
set(VIEWER_CHANNEL_GRK "\\u03B2") # "β" set(VIEWER_CHANNEL_GRK "\\u03B2") # "β"
else()
set(VIEWER_CHANNEL_GRK "")
endif () endif ()
endif (NOT VIEWER_CHANNEL_GRK) endif (NOT VIEWER_CHANNEL_GRK)

View File

@@ -15,10 +15,15 @@ FetchContent_Declare(
GIT_REPOSITORY https://github.com/fmtlib/fmt.git GIT_REPOSITORY https://github.com/fmtlib/fmt.git
GIT_TAG 6.1.2 GIT_TAG 6.1.2
) )
FetchContent_Declare(
nlohmann_json
GIT_REPOSITORY https://github.com/nlohmann/json.git
GIT_TAG v3.7.3
)
FetchContent_Declare( FetchContent_Declare(
absl absl
GIT_REPOSITORY https://github.com/abseil/abseil-cpp.git GIT_REPOSITORY https://github.com/abseil/abseil-cpp.git
GIT_TAG 29235139149790f5afc430c11cec8f1eb1677607 GIT_TAG 0033c9ea91a52ade7c6b725aa2ef3cbe15463421
) )
# This is a hack because absl has dumb cmake # This is a hack because absl has dumb cmake
@@ -44,5 +49,14 @@ if(WINDOWS)
FetchContent_MakeAvailable(fmt) FetchContent_MakeAvailable(fmt)
endif() 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_FOLDER)
unset(CMAKE_POSITION_INDEPENDENT_CODE) unset(CMAKE_POSITION_INDEPENDENT_CODE)

View File

@@ -12,7 +12,6 @@ include(Linking)
include(Boost) include(Boost)
include(OpenSSL) include(OpenSSL)
include(LLSharedLibs) include(LLSharedLibs)
include(Json)
include(Copy3rdPartyLibs) include(Copy3rdPartyLibs)
include(ZLIB) include(ZLIB)
include(URIPARSER) include(URIPARSER)
@@ -300,6 +299,7 @@ target_link_libraries(
${Boost_SYSTEM_LIBRARY} ${Boost_SYSTEM_LIBRARY}
${CORESERVICES_LIBRARY} ${CORESERVICES_LIBRARY}
${URIPARSER_LIBRARY} ${URIPARSER_LIBRARY}
nlohmann_json::nlohmann_json
${RT_LIBRARY} ${RT_LIBRARY}
) )

View File

@@ -132,7 +132,7 @@ class LL_COMMON_API AIArgs
// Add another replacement. // Add another replacement.
AIArgs& operator()(char const* key, std::string const& replacement) { mArgs[key] = replacement; return *this; } AIArgs& operator()(char const* key, std::string const& replacement) { mArgs[key] = replacement; return *this; }
// The destructor may not throw. // The destructor may not throw.
~AIArgs() throw() { } ~AIArgs() noexcept { }
// Accessor. // Accessor.
LLStringUtil::format_map_t const& operator*() const { return mArgs; } LLStringUtil::format_map_t const& operator*() const { return mArgs; }
@@ -193,7 +193,7 @@ class LL_COMMON_API Line
Line(std::string const& xml_desc, AIArgs const& args, bool newline = false) : mNewline(newline), mXmlDesc(xml_desc), mArgs(args), mType(normal) { } Line(std::string const& xml_desc, AIArgs const& args, bool newline = false) : mNewline(newline), mXmlDesc(xml_desc), mArgs(args), mType(normal) { }
Line(Prefix const& prefix, bool newline = false) : mNewline(newline), mXmlDesc("AIPrefix"), mArgs("[PREFIX]", prefix.str()), mType(prefix.type()) { } Line(Prefix const& prefix, bool newline = false) : mNewline(newline), mXmlDesc("AIPrefix"), mArgs("[PREFIX]", prefix.str()), mType(prefix.type()) { }
// The destructor may not throw. // The destructor may not throw.
~Line() throw() { } ~Line() noexcept { }
// Prepend a newline before this line. // Prepend a newline before this line.
void set_newline(void) { mNewline = true; } void set_newline(void) { mNewline = true; }
@@ -225,7 +225,7 @@ class LL_COMMON_API Error : public std::exception
typedef std::deque<Line> lines_type; typedef std::deque<Line> lines_type;
// The destructor may not throw. // The destructor may not throw.
~Error() throw() { } ~Error() noexcept { }
// Accessors. // Accessors.
lines_type const& lines(void) const { return mLines; } lines_type const& lines(void) const { return mLines; }
@@ -267,7 +267,7 @@ class LL_COMMON_API ErrorCode : public Error
public: public:
// The destructor may not throw. // The destructor may not throw.
~ErrorCode() throw() { } ~ErrorCode() noexcept { }
// Accessor. // Accessor.
int getCode(void) const { return mCode; } int getCode(void) const { return mCode; }

View File

@@ -244,7 +244,6 @@ const U8 SIM_ACCESS_DOWN = 254;
const U8 SIM_ACCESS_MAX = SIM_ACCESS_ADULT; const U8 SIM_ACCESS_MAX = SIM_ACCESS_ADULT;
// attachment constants // attachment constants
const U32 MAX_AGENT_ATTACHMENTS = 38;
const U8 ATTACHMENT_ADD = 0x80; const U8 ATTACHMENT_ADD = 0x80;
// god levels // god levels

View File

@@ -353,8 +353,14 @@ typedef LLError::NoClassInfo _LL_CLASS_TO_LOG;
// NEW Macros for debugging, allow the passing of a string tag // 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) // 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_INFOS(...) lllog(LLError::LEVEL_INFO, false, false, ##__VA_ARGS__)
#define LL_WARNS(...) lllog(LLError::LEVEL_WARN, 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__) #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 // 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). // 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_INFOS_ONCE(...) lllog(LLError::LEVEL_INFO, true, false, ##__VA_ARGS__)
#define LL_WARNS_ONCE(...) lllog(LLError::LEVEL_WARN, true, false, ##__VA_ARGS__) #define LL_WARNS_ONCE(...) lllog(LLError::LEVEL_WARN, true, false, ##__VA_ARGS__)
// No function name // 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_INFOS_NF(...) lllog(LLError::LEVEL_INFO, false, true, ##__VA_ARGS__)
#define LL_WARNS_NF(...) lllog(LLError::LEVEL_WARN, 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__) #define LL_ERRS_NF(...) lllog(LLError::LEVEL_ERROR, false, true, ##__VA_ARGS__)

View File

@@ -412,7 +412,7 @@ public:
std::runtime_error(what), std::runtime_error(what),
mData(data) mData(data)
{} {}
virtual ~LLErrorEvent() throw() {} virtual ~LLErrorEvent() noexcept {}
LLSD getData() const { return mData; } LLSD getData() const { return mData; }

View File

@@ -381,10 +381,9 @@ std::string LLSDArgsMapper::formatlist(const LLSD& list)
{ {
std::ostringstream out; std::ostringstream out;
const char* delim = ""; const char* delim = "";
for (LLSD::array_const_iterator li(list.beginArray()), lend(list.endArray()); for (auto const& entry : list.array())
li != lend; ++li)
{ {
out << delim << li->asString(); out << delim << entry.asString();
delim = ", "; delim = ", ";
} }
return out.str(); return out.str();
@@ -494,10 +493,9 @@ struct LLEventDispatcher::MapParamsDispatchEntry: public LLEventDispatcher::Para
{ {
// Build the set of all param keys, then delete the ones that are // Build the set of all param keys, then delete the ones that are
// optional. What's left are the ones that are required. // optional. What's left are the ones that are required.
for (LLSD::array_const_iterator pi(params.beginArray()), pend(params.endArray()); for (auto const& entry : params.array())
pi != pend; ++pi)
{ {
mRequired[pi->asString()] = LLSD(); mRequired[entry.asString()] = LLSD();
} }
if (defaults.isArray() || defaults.isUndefined()) if (defaults.isArray() || defaults.isUndefined())

View File

@@ -182,10 +182,10 @@ public:
bool operator! () const { return ! mListener; } bool operator! () const { return ! mListener; }
/// explicit accessor /// explicit accessor
const LLEventListener& getListener() const { return *mListener; } const ::LLEventListener& getListener() const { return *mListener; }
/// implicit conversion to LLEventListener /// implicit conversion to LLEventListener
operator LLEventListener() const { return *mListener; } operator ::LLEventListener() const { return *mListener; }
/// allow calling directly /// allow calling directly
bool operator()(const LLSD& event) const; bool operator()(const LLSD& event) const;
@@ -277,7 +277,7 @@ namespace LLEventDetail
/// Any callable capable of connecting an LLEventListener to an /// Any callable capable of connecting an LLEventListener to an
/// LLStandardSignal to produce an LLBoundListener can be mapped to this /// LLStandardSignal to produce an LLBoundListener can be mapped to this
/// signature. /// 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 /// overload of visit_and_connect() when we have a string identifier available
template <typename LISTENER> template <typename LISTENER>
@@ -547,7 +547,7 @@ private:
virtual void reset(); virtual void reset();
private: 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& after,
const NameList& before); const NameList& before);
std::string mName; std::string mName;
@@ -845,7 +845,7 @@ namespace LLEventDetail
* Visitor binds a reference to LLEventListener so we can track() any * Visitor binds a reference to LLEventListener so we can track() any
* shared_ptrs we find in the argument list. * shared_ptrs we find in the argument list.
*/ */
Visitor(LLEventListener& listener): Visitor(::LLEventListener& listener):
mListener(listener) mListener(listener)
{ {
} }
@@ -988,7 +988,7 @@ namespace LLEventDetail
|*==========================================================================*/ |*==========================================================================*/
/// Bind a reference to the LLEventListener to call its track() method. /// 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) const ConnectFunc& connect_func)
{ {
// Capture the listener // Capture the listener
LLEventListener listener(raw_listener); ::LLEventListener listener(raw_listener);
// Define our Visitor, binding the listener so we can call // Define our Visitor, binding the listener so we can call
// listener.track() if we discover any shared_ptr<Foo>. // listener.track() if we discover any shared_ptr<Foo>.
LLEventDetail::Visitor visitor(listener); LLEventDetail::Visitor visitor(listener);

View File

@@ -54,6 +54,7 @@ std::string LLFile::strerr(int errn)
{ {
char buffer[256]; char buffer[256];
strerror_s(buffer, errn); // infers sizeof(buffer) -- love it! strerror_s(buffer, errn); // infers sizeof(buffer) -- love it!
buffer[255] = 0;
return buffer; return buffer;
} }

View File

@@ -140,10 +140,14 @@ public:
virtual void erase(Integer) { } virtual void erase(Integer) { }
virtual const LLSD& ref(Integer) const { return undef(); } virtual const LLSD& ref(Integer) const { return undef(); }
virtual LLSD::map_const_iterator beginMap() const { return endMap(); } virtual const std::map<String, LLSD>& map() const { static const std::map<String, LLSD> empty; return empty; }
virtual LLSD::map_const_iterator endMap() const { static const std::map<String, LLSD> empty; return empty.end(); } virtual std::map<String, LLSD>& map() { static std::map<String, LLSD> empty; return empty; }
virtual LLSD::array_const_iterator beginArray() const { return endArray(); } LLSD::map_const_iterator beginMap() const { return map().begin(); }
virtual LLSD::array_const_iterator endArray() const { static const std::vector<LLSD> empty; return empty.end(); } LLSD::map_const_iterator endMap() const { return map().end(); }
virtual const std::vector<LLSD>& array() const { static const std::vector<LLSD> empty; return empty; }
virtual std::vector<LLSD>& array() { static std::vector<LLSD> empty; return empty; }
LLSD::array_const_iterator beginArray() const { return array().begin(); }
LLSD::array_const_iterator endArray() const { return array().end(); }
virtual void dumpStats() const; virtual void dumpStats() const;
virtual void calcStats(S32 type_counts[], S32 share_counts[]) const; virtual void calcStats(S32 type_counts[], S32 share_counts[]) const;
@@ -200,7 +204,7 @@ namespace
}; };
class ImplBoolean class ImplBoolean final
: public ImplBase<LLSD::TypeBoolean, LLSD::Boolean> : public ImplBase<LLSD::TypeBoolean, LLSD::Boolean>
{ {
public: public:
@@ -221,7 +225,7 @@ namespace
{ return mValue ? "true" : ""; } { return mValue ? "true" : ""; }
class ImplInteger class ImplInteger final
: public ImplBase<LLSD::TypeInteger, LLSD::Integer> : public ImplBase<LLSD::TypeInteger, LLSD::Integer>
{ {
public: public:
@@ -237,7 +241,7 @@ namespace
{ return llformat("%d", mValue); } { return llformat("%d", mValue); }
class ImplReal class ImplReal final
: public ImplBase<LLSD::TypeReal, LLSD::Real> : public ImplBase<LLSD::TypeReal, LLSD::Real>
{ {
public: public:
@@ -259,7 +263,7 @@ namespace
{ return llformat("%lg", mValue); } { return llformat("%lg", mValue); }
class ImplString class ImplString final
: public ImplBase<LLSD::TypeString, LLSD::String, const LLSD::String&> : public ImplBase<LLSD::TypeString, LLSD::String, const LLSD::String&>
{ {
public: public:
@@ -303,7 +307,7 @@ namespace
} }
class ImplUUID class ImplUUID final
: public ImplBase<LLSD::TypeUUID, LLSD::UUID, const LLSD::UUID&> : public ImplBase<LLSD::TypeUUID, LLSD::UUID, const LLSD::UUID&>
{ {
public: public:
@@ -314,7 +318,7 @@ namespace
}; };
class ImplDate class ImplDate final
: public ImplBase<LLSD::TypeDate, LLSD::Date, const LLSD::Date&> : public ImplBase<LLSD::TypeDate, LLSD::Date, const LLSD::Date&>
{ {
public: public:
@@ -336,7 +340,7 @@ namespace
}; };
class ImplURI class ImplURI final
: public ImplBase<LLSD::TypeURI, LLSD::URI, const LLSD::URI&> : public ImplBase<LLSD::TypeURI, LLSD::URI, const LLSD::URI&>
{ {
public: public:
@@ -347,7 +351,7 @@ namespace
}; };
class ImplBinary class ImplBinary final
: public ImplBase<LLSD::TypeBinary, LLSD::Binary, const LLSD::Binary&> : public ImplBase<LLSD::TypeBinary, LLSD::Binary, const LLSD::Binary&>
{ {
public: public:
@@ -357,7 +361,7 @@ namespace
}; };
class ImplMap : public LLSD::Impl class ImplMap final : public LLSD::Impl
{ {
private: private:
typedef std::map<LLSD::String, LLSD> DataMap; typedef std::map<LLSD::String, LLSD> DataMap;
@@ -390,10 +394,8 @@ namespace
int size() const override { return mData.size(); } int size() const override { return mData.size(); }
LLSD::map_iterator beginMap() { return mData.begin(); } DataMap& map() final override { return mData; }
LLSD::map_iterator endMap() { return mData.end(); } const DataMap& map() const final override { return mData; }
LLSD::map_const_iterator beginMap() const override { return mData.begin(); }
LLSD::map_const_iterator endMap() const override { return mData.end(); }
void dumpStats() const override; void dumpStats() const override;
void calcStats(S32 type_counts[], S32 share_counts[]) const override; void calcStats(S32 type_counts[], S32 share_counts[]) const override;
@@ -491,7 +493,7 @@ namespace
} }
class ImplArray : public LLSD::Impl class ImplArray final : public LLSD::Impl
{ {
private: private:
typedef std::vector<LLSD> DataVector; typedef std::vector<LLSD> DataVector;
@@ -522,12 +524,8 @@ namespace
LLSD& ref(LLSD::Integer); LLSD& ref(LLSD::Integer);
const LLSD& ref(LLSD::Integer) const override; const LLSD& ref(LLSD::Integer) const override;
LLSD::array_iterator beginArray() { return mData.begin(); } DataVector& array() final override { return mData; }
LLSD::array_iterator endArray() { return mData.end(); } const DataVector& array() const final override { return mData; }
LLSD::reverse_array_iterator rbeginArray() { return mData.rbegin(); }
LLSD::reverse_array_iterator rendArray() { return mData.rend(); }
LLSD::array_const_iterator beginArray() const override { return mData.begin(); }
LLSD::array_const_iterator endArray() const override { return mData.end(); }
void calcStats(S32 type_counts[], S32 share_counts[]) const override; void calcStats(S32 type_counts[], S32 share_counts[]) const override;
}; };
@@ -940,7 +938,7 @@ static const char *llsd_dump(const LLSD &llsd, bool useXMLFormat)
out << LLSDNotationStreamer(llsd); out << LLSDNotationStreamer(llsd);
out_string = out.str(); out_string = out.str();
} }
int len = out_string.length(); size_t len = out_string.length();
sStorage = new char[len + 1]; sStorage = new char[len + 1];
memcpy(sStorage, out_string.c_str(), len); memcpy(sStorage, out_string.c_str(), len);
sStorage[len] = '\0'; sStorage[len] = '\0';
@@ -959,18 +957,24 @@ const char *LLSD::dump(const LLSD &llsd)
return llsd_dump(llsd, false); return llsd_dump(llsd, false);
} }
LLSD::map_iterator LLSD::beginMap() { return makeMap(impl).beginMap(); } std::map<LLSD::String, LLSD>& LLSD::map() { return makeMap(impl).map(); }
LLSD::map_iterator LLSD::endMap() { return makeMap(impl).endMap(); } const std::map<LLSD::String, LLSD>& LLSD::map() const { return safe(impl).map(); }
LLSD::map_const_iterator LLSD::beginMap() const { return safe(impl).beginMap(); }
LLSD::map_const_iterator LLSD::endMap() const { return safe(impl).endMap(); }
LLSD::array_iterator LLSD::beginArray() { return makeArray(impl).beginArray(); } LLSD::map_iterator LLSD::beginMap() { return map().begin(); }
LLSD::array_iterator LLSD::endArray() { return makeArray(impl).endArray(); } LLSD::map_iterator LLSD::endMap() { return map().end(); }
LLSD::array_const_iterator LLSD::beginArray() const{ return safe(impl).beginArray(); } LLSD::map_const_iterator LLSD::beginMap() const { return map().cbegin(); }
LLSD::array_const_iterator LLSD::endArray() const { return safe(impl).endArray(); } LLSD::map_const_iterator LLSD::endMap() const { return map().cend(); }
LLSD::reverse_array_iterator LLSD::rbeginArray() { return makeArray(impl).rbeginArray(); } std::vector<LLSD>& LLSD::array() { return makeArray(impl).array(); }
LLSD::reverse_array_iterator LLSD::rendArray() { return makeArray(impl).rendArray(); } const std::vector<LLSD>& LLSD::array() const { return safe(impl).array(); }
LLSD::array_iterator LLSD::beginArray() { return array().begin(); }
LLSD::array_iterator LLSD::endArray() { return array().end(); }
LLSD::array_const_iterator LLSD::beginArray() const{ return array().cbegin(); }
LLSD::array_const_iterator LLSD::endArray() const { return array().cend(); }
LLSD::reverse_array_iterator LLSD::rbeginArray() { return array().rbegin(); }
LLSD::reverse_array_iterator LLSD::rendArray() { return array().rend(); }
namespace llsd namespace llsd
{ {

View File

@@ -320,6 +320,8 @@ public:
typedef std::map<String, LLSD>::iterator map_iterator; typedef std::map<String, LLSD>::iterator map_iterator;
typedef std::map<String, LLSD>::const_iterator map_const_iterator; typedef std::map<String, LLSD>::const_iterator map_const_iterator;
std::map<String, LLSD>& map();
const std::map<String, LLSD>& map() const;
map_iterator beginMap(); map_iterator beginMap();
map_iterator endMap(); map_iterator endMap();
map_const_iterator beginMap() const; map_const_iterator beginMap() const;
@@ -329,6 +331,8 @@ public:
typedef std::vector<LLSD>::const_iterator array_const_iterator; typedef std::vector<LLSD>::const_iterator array_const_iterator;
typedef std::vector<LLSD>::reverse_iterator reverse_array_iterator; typedef std::vector<LLSD>::reverse_iterator reverse_array_iterator;
std::vector<LLSD>& array();
const std::vector<LLSD>& array() const;
array_iterator beginArray(); array_iterator beginArray();
array_iterator endArray(); array_iterator endArray();
array_const_iterator beginArray() const; array_const_iterator beginArray() const;

View File

@@ -122,9 +122,9 @@ nlohmann::json LlsdToJson(const LLSD &val)
} }
break; break;
case LLSD::TypeArray: case LLSD::TypeArray:
for (LLSD::array_const_iterator it = val.beginArray(); it != val.endArray(); ++it) for (auto const& entry : val.array())
{ {
result.push_back(LlsdToJson(*it)); result.push_back(LlsdToJson(entry));
} }
break; break;
case LLSD::TypeBinary: case LLSD::TypeBinary:

View File

@@ -267,12 +267,10 @@ void LLParamSDParserUtilities::readSDValues(read_sd_cb_t cb, const LLSD& sd, LLI
} }
else if (sd.isArray()) else if (sd.isArray())
{ {
for (LLSD::array_const_iterator it = sd.beginArray(); for (auto const& entry : sd.array())
it != sd.endArray();
++it)
{ {
stack.push_back(make_pair(std::string(), true)); stack.push_back(make_pair(std::string(), true));
readSDValues(cb, *it, stack); readSDValues(cb, entry, stack);
stack.pop_back(); stack.pop_back();
} }
} }

View File

@@ -1322,13 +1322,11 @@ S32 LLSDNotationFormatter::format_impl(const LLSD& data, std::ostream& ostr, U32
{ {
ostr << post << pre << "["; ostr << post << pre << "[";
bool need_comma = false; bool need_comma = false;
auto iter = data.beginArray(); for (const auto& entry : data.array())
auto end = data.endArray();
for(; iter != end; ++iter)
{ {
if(need_comma) ostr << ","; if (need_comma) ostr << ",";
need_comma = true; need_comma = true;
format_count += format_impl(*iter, ostr, options, level + 1); format_count += format_impl(entry, ostr, options, level + 1);
} }
ostr << "]"; ostr << "]";
break; break;
@@ -1461,11 +1459,9 @@ S32 LLSDBinaryFormatter::format(const LLSD& data, std::ostream& ostr, U32 option
ostr.put('['); ostr.put('[');
U32 size_nbo = htonl(data.size()); U32 size_nbo = htonl(data.size());
ostr.write(reinterpret_cast<const char*>(&size_nbo), sizeof(U32)); ostr.write(reinterpret_cast<const char*>(&size_nbo), sizeof(U32));
auto iter = data.beginArray(); for (const auto& entry : data.array())
auto end = data.endArray();
for(; iter != end; ++iter)
{ {
format_count += format(*iter, ostr); format_count += format(entry, ostr);
} }
ostr.put(']'); ostr.put(']');
break; break;

View File

@@ -116,11 +116,9 @@ S32 LLSDXMLFormatter::format_impl(const LLSD& data, std::ostream& ostr, U32 opti
else else
{ {
ostr << pre << "<array>" << post; ostr << pre << "<array>" << post;
LLSD::array_const_iterator iter = data.beginArray(); for (const auto& entry : data.array())
LLSD::array_const_iterator end = data.endArray();
for(; iter != end; ++iter)
{ {
format_count += format_impl(*iter, ostr, options, level + 1); format_count += format_impl(entry, ostr, options, level + 1);
} }
ostr << pre << "</array>" << post; ostr << pre << "</array>" << post;
} }

View File

@@ -891,9 +891,9 @@ LLSD llsd_clone(LLSD value, LLSD filter)
break; break;
case LLSD::TypeArray: case LLSD::TypeArray:
clone = LLSD::emptyArray(); clone = LLSD::emptyArray();
for (LLSD::array_const_iterator ita = value.beginArray(); ita != value.endArray(); ++ita) for (auto const& entry : value.array())
{ {
clone.append(llsd_clone(*ita, filter)); clone.append(llsd_clone(entry, filter));
} }
break; break;
@@ -943,9 +943,9 @@ LLSD llsd_shallow(LLSD value, LLSD filter)
else if (value.isArray()) else if (value.isArray())
{ {
shallow = LLSD::emptyArray(); shallow = LLSD::emptyArray();
for (LLSD::array_const_iterator ita = value.beginArray(); ita != value.endArray(); ++ita) for (auto const& entry : value.array())
{ {
shallow.append(*ita); shallow.append(entry);
} }
} }
else else

View File

@@ -1340,7 +1340,8 @@ void LLStringUtil::formatNumber(std::string& numStr, std::string decimals)
// std::locale() throws if the locale is unknown! (EXT-7926) // std::locale() throws if the locale is unknown! (EXT-7926)
try try
{ {
strStream.imbue(std::locale(sLocale.c_str())); std::locale locale(sLocale.c_str());
strStream.imbue(locale);
} catch (const std::exception &) } catch (const std::exception &)
{ {
LL_WARNS_ONCE("Locale") << "Cannot set locale to " << sLocale << LL_ENDL; LL_WARNS_ONCE("Locale") << "Cannot set locale to " << sLocale << LL_ENDL;

View File

@@ -243,7 +243,7 @@ public:
bool operator<(const LLFormatMapString& rhs) const { return mString < rhs.mString; } bool operator<(const LLFormatMapString& rhs) const { return mString < rhs.mString; }
std::size_t length() const { return mString.length(); } std::size_t length() const { return mString.length(); }
// The destructor may not throw. // The destructor may not throw.
~LLFormatMapString() throw() { } ~LLFormatMapString() noexcept { }
private: private:
std::string mString; std::string mString;

View File

@@ -1274,7 +1274,7 @@ BOOL gunzip_file(const std::string& srcfile, const std::string& dstfile)
const S32 UNCOMPRESS_BUFFER_SIZE = 32768; const S32 UNCOMPRESS_BUFFER_SIZE = 32768;
BOOL retval = FALSE; BOOL retval = FALSE;
gzFile src = NULL; gzFile src = NULL;
U8 buffer[UNCOMPRESS_BUFFER_SIZE]; std::array<U8, UNCOMPRESS_BUFFER_SIZE> buffer;
LLFILE *dst = NULL; LLFILE *dst = NULL;
S32 bytes = 0; S32 bytes = 0;
tmpfile = dstfile + ".t"; tmpfile = dstfile + ".t";
@@ -1288,8 +1288,8 @@ BOOL gunzip_file(const std::string& srcfile, const std::string& dstfile)
if (! dst) goto err; if (! dst) goto err;
do do
{ {
bytes = gzread(src, buffer, UNCOMPRESS_BUFFER_SIZE); bytes = gzread(src, buffer.data(), buffer.size());
size_t nwrit = fwrite(buffer, sizeof(U8), bytes, dst); size_t nwrit = fwrite(buffer.data(), sizeof(U8), bytes, dst);
if (nwrit < (size_t) bytes) if (nwrit < (size_t) bytes)
{ {
LL_WARNS() << "Short write on " << tmpfile << ": Wrote " << nwrit << " of " << bytes << " bytes." << LL_ENDL; LL_WARNS() << "Short write on " << tmpfile << ": Wrote " << nwrit << " of " << bytes << " bytes." << LL_ENDL;
@@ -1311,7 +1311,7 @@ BOOL gzip_file(const std::string& srcfile, const std::string& dstfile)
const S32 COMPRESS_BUFFER_SIZE = 32768; const S32 COMPRESS_BUFFER_SIZE = 32768;
std::string tmpfile; std::string tmpfile;
BOOL retval = FALSE; BOOL retval = FALSE;
U8 buffer[COMPRESS_BUFFER_SIZE]; std::array<U8, COMPRESS_BUFFER_SIZE> buffer;
gzFile dst = NULL; gzFile dst = NULL;
LLFILE *src = NULL; LLFILE *src = NULL;
S32 bytes = 0; S32 bytes = 0;
@@ -1325,9 +1325,9 @@ BOOL gzip_file(const std::string& srcfile, const std::string& dstfile)
src = LLFile::fopen(srcfile, "rb"); /* Flawfinder: ignore */ src = LLFile::fopen(srcfile, "rb"); /* Flawfinder: ignore */
if (! src) goto err; if (! src) goto err;
while ((bytes = (S32)fread(buffer, sizeof(U8), COMPRESS_BUFFER_SIZE, src)) > 0) while ((bytes = (S32)fread(buffer.data(), sizeof(U8), buffer.size(), src)) > 0)
{ {
if (gzwrite(dst, buffer, bytes) <= 0) if (gzwrite(dst, buffer.data(), bytes) <= 0)
{ {
LL_WARNS() << "gzwrite failed: " << gzerror(dst, NULL) << LL_ENDL; LL_WARNS() << "gzwrite failed: " << gzerror(dst, NULL) << LL_ENDL;
goto err; goto err;

View File

@@ -17,7 +17,6 @@ include_directories(
set(llinventory_SOURCE_FILES set(llinventory_SOURCE_FILES
llcategory.cpp llcategory.cpp
lleconomy.cpp
llfoldertype.cpp llfoldertype.cpp
llinventory.cpp llinventory.cpp
llinventorydefines.cpp llinventorydefines.cpp
@@ -40,7 +39,6 @@ set(llinventory_HEADER_FILES
CMakeLists.txt CMakeLists.txt
llcategory.h llcategory.h
lleconomy.h
llfoldertype.h llfoldertype.h
llinventory.h llinventory.h
llinventorydefines.h llinventorydefines.h

View File

@@ -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;
}

View File

@@ -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

View File

@@ -103,9 +103,9 @@ LLSD LLSettingsBase::combineSDMaps(const LLSD &settings, const LLSD &other) cons
break; break;
case LLSD::TypeArray: case LLSD::TypeArray:
newSettings[key_name] = LLSD::emptyArray(); newSettings[key_name] = LLSD::emptyArray();
for (LLSD::array_const_iterator ita = value.beginArray(); ita != value.endArray(); ++ita) for (auto const& entry : value.array())
{ {
newSettings[key_name].append(*ita); newSettings[key_name].append(entry);
} }
break; break;
//case LLSD::TypeInteger: //case LLSD::TypeInteger:
@@ -137,9 +137,9 @@ LLSD LLSettingsBase::combineSDMaps(const LLSD &settings, const LLSD &other) cons
break; break;
case LLSD::TypeArray: case LLSD::TypeArray:
newSettings[key_name] = LLSD::emptyArray(); newSettings[key_name] = LLSD::emptyArray();
for (LLSD::array_const_iterator ita = value.beginArray(); ita != value.endArray(); ++ita) for (auto const& entry : value.array())
{ {
newSettings[key_name].append(*ita); newSettings[key_name].append(entry);
} }
break; break;
//case LLSD::TypeInteger: //case LLSD::TypeInteger:

View File

@@ -240,16 +240,16 @@ bool LLSettingsDay::initialize(bool validate_frames)
{ {
mDayTracks[i].clear(); mDayTracks[i].clear();
LLSD curtrack = tracks[i]; LLSD curtrack = tracks[i];
for (LLSD::array_const_iterator it = curtrack.beginArray(); it != curtrack.endArray(); ++it) for (const auto& entry : curtrack.array())
{ {
LLSettingsBase::TrackPosition keyframe = LLSettingsBase::TrackPosition((*it)[SETTING_KEYKFRAME].asReal()); LLSettingsBase::TrackPosition keyframe = LLSettingsBase::TrackPosition(entry[SETTING_KEYKFRAME].asReal());
keyframe = llclamp(keyframe, 0.0f, 1.0f); keyframe = llclamp(keyframe, 0.0f, 1.0f);
LLSettingsBase::ptr_t setting; LLSettingsBase::ptr_t setting;
if ((*it).has(SETTING_KEYNAME)) if (entry.has(SETTING_KEYNAME))
{ {
std::string key_name = (*it)[SETTING_KEYNAME]; std::string key_name = entry[SETTING_KEYNAME];
if (i == TRACK_WATER) if (i == TRACK_WATER)
{ {
setting = used[key_name]; setting = used[key_name];
@@ -469,36 +469,36 @@ namespace
S32 framecount(0); S32 framecount(0);
for (LLSD::array_iterator track = value.beginArray(); track != value.endArray(); ++track) for (auto& entry : value.array())
{ {
S32 index = 0; S32 index = 0;
while (index < (*track).size()) while (index < entry.size())
{ {
LLSD& elem = (*track)[index]; LLSD& elem = entry[index];
++framecount; ++framecount;
if (index >= LLSettingsDay::FRAME_MAX) if (index >= LLSettingsDay::FRAME_MAX)
{ {
(*track).erase(index); entry.erase(index);
continue; continue;
} }
if (!elem.has(LLSettingsDay::SETTING_KEYKFRAME)) if (!elem.has(LLSettingsDay::SETTING_KEYKFRAME))
{ {
(*track).erase(index); entry.erase(index);
continue; continue;
} }
if (!elem[LLSettingsDay::SETTING_KEYKFRAME].isReal()) if (!elem[LLSettingsDay::SETTING_KEYKFRAME].isReal())
{ {
(*track).erase(index); entry.erase(index);
continue; continue;
} }
if (!elem.has(LLSettingsDay::SETTING_KEYNAME) && if (!elem.has(LLSettingsDay::SETTING_KEYNAME) &&
!elem.has(LLSettingsDay::SETTING_KEYID)) !elem.has(LLSettingsDay::SETTING_KEYID))
{ {
(*track).erase(index); entry.erase(index);
continue; continue;
} }

View File

@@ -45,6 +45,7 @@
#endif #endif
extern U32 gOctreeMaxCapacity; extern U32 gOctreeMaxCapacity;
extern float gOctreeMinSize;
extern U32 gOctreeReserveCapacity; extern U32 gOctreeReserveCapacity;
#if LL_DEBUG #if LL_DEBUG
#define LL_OCTREE_PARANOIA_CHECK 0 #define LL_OCTREE_PARANOIA_CHECK 0
@@ -404,7 +405,7 @@ public:
F32 size = mSize[0]; F32 size = mSize[0];
F32 p_size = size * 2.f; F32 p_size = size * 2.f;
return (radius <= 0.001f && size <= 0.001f) || return (radius <= gOctreeMinSize && size <= gOctreeMinSize) ||
(radius <= p_size && radius > size); (radius <= p_size && radius > size);
} }
@@ -425,7 +426,7 @@ public:
} }
void accept(oct_traveler* visitor) { visitor->visit(this); } void accept(oct_traveler* visitor) { visitor->visit(this); }
virtual bool isLeaf() const { return mChildCount == 0; } bool isLeaf() const { return mChildCount == 0; }
U32 getElementCount() const { return mData.size(); } U32 getElementCount() const { return mData.size(); }
bool isEmpty() const { return mData.size() == 0; } bool isEmpty() const { return mData.size() == 0; }
@@ -498,7 +499,7 @@ public:
return node; return node;
} }
virtual bool insert(T* data) bool insert(T* data) override
{ {
OctreeGuard::checkGuarded(this); OctreeGuard::checkGuarded(this);
if (data == NULL || data->getBinIndex() != -1) if (data == NULL || data->getBinIndex() != -1)
@@ -511,7 +512,7 @@ public:
//is it here? //is it here?
if (isInside(data->getPositionGroup())) 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))) (data->getBinRadius() > getSize()[0] && parent && parent->getElementCount() >= gOctreeMaxCapacity)))
{ //it belongs here { //it belongs here
/*mElementCount++; /*mElementCount++;
@@ -537,7 +538,7 @@ public:
OctreeStats::getInstance()->realloc(old_cap,mData.capacity()); OctreeStats::getInstance()->realloc(old_cap,mData.capacity());
#endif #endif
BaseType::insert(data); LLOctreeNode<T>::notifyAddition(data);
return true; return true;
} }
else else
@@ -566,8 +567,9 @@ public:
LLVector4a val; LLVector4a val;
val.setSub(center, getCenter()); val.setSub(center, getCenter());
val.setAbs(val); val.setAbs(val);
LLVector4a min_diff(gOctreeMinSize);
S32 lt = val.lessThan(LLVector4a::getEpsilon()).getGatheredBits() & 0x7;
S32 lt = val.lessThan(min_diff).getGatheredBits() & 0x7;
if( lt == 0x7 ) if( lt == 0x7 )
{ {
@@ -593,7 +595,7 @@ public:
OctreeStats::getInstance()->realloc(old_cap,mData.capacity()); OctreeStats::getInstance()->realloc(old_cap,mData.capacity());
#endif #endif
BaseType::insert(data); LLOctreeNode<T>::notifyAddition(data);
return true; return true;
} }
@@ -616,6 +618,7 @@ public:
} }
#endif #endif
llassert(size[0] >= gOctreeMinSize*0.5f);
//make the new kid //make the new kid
child = new LLOctreeNode<T>(center, size, this); child = new LLOctreeNode<T>(center, size, this);
addChild(child); addChild(child);
@@ -623,10 +626,7 @@ public:
child->insert(data); child->insert(data);
} }
} }
// Singu note: now that we allow wider range in octree, discard them here else if (parent)
// if they fall out of range
#if 0
else
{ {
//it's not in here, give it to the root //it's not in here, give it to the root
OCT_ERRS << "Octree insertion failed, starting over from root!" << LL_ENDL; OCT_ERRS << "Octree insertion failed, starting over from root!" << LL_ENDL;
@@ -639,12 +639,15 @@ public:
parent = node->getOctParent(); 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; return false;
} }
@@ -708,7 +711,7 @@ public:
checkAlive(); checkAlive();
} }
bool remove(T* data) bool remove(T* data) final override
{ {
OctreeGuard::checkGuarded(this); OctreeGuard::checkGuarded(this);
S32 i = data->getBinIndex(); S32 i = data->getBinIndex();
@@ -849,10 +852,9 @@ public:
if (!silent) if (!silent)
{ {
for (U32 i = 0; i < this->getListenerCount(); i++) for (auto& entry : this->mListeners)
{ {
oct_listener* listener = getOctListener(i); ((oct_listener*)entry.get())->handleChildAddition(this, child);
listener->handleChildAddition(this, child);
} }
} }
} }
@@ -861,16 +863,17 @@ public:
{ {
OctreeGuard::checkGuarded(this); OctreeGuard::checkGuarded(this);
for (U32 i = 0; i < this->getListenerCount(); i++) oct_node* child = getChild(index);
for (auto& entry : this->mListeners)
{ {
oct_listener* listener = getOctListener(i); ((oct_listener*)entry.get())->handleChildRemoval(this, child);
listener->handleChildRemoval(this, getChild(index));
} }
if (destroy) if (destroy)
{ {
mChild[index]->destroy(); child->destroy();
delete mChild[index]; delete child;
} }
--mChildCount; --mChildCount;
@@ -1012,7 +1015,7 @@ public:
} }
// LLOctreeRoot::insert // LLOctreeRoot::insert
bool insert(T* data) bool insert(T* data) final override
{ {
if (data == NULL) if (data == NULL)
{ {
@@ -1050,10 +1053,15 @@ public:
{ {
LLOctreeNode<T>::insert(data); LLOctreeNode<T>::insert(data);
} }
else else if (node->isInside(data->getPositionGroup()))
{ {
node->insert(data); 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) else if (this->getChildCount() == 0)
{ {
@@ -1088,6 +1096,8 @@ public:
this->setSize(size2); this->setSize(size2);
this->updateMinMax(); this->updateMinMax();
llassert(size[0] >= gOctreeMinSize);
//copy our children to a new branch //copy our children to a new branch
LLOctreeNode<T>* newnode = new LLOctreeNode<T>(center, size, this); LLOctreeNode<T>* newnode = new LLOctreeNode<T>(center, size, this);

View File

@@ -44,7 +44,6 @@ public:
virtual void handleInsertion(const LLTreeNode<T>* node, T* data) = 0; virtual void handleInsertion(const LLTreeNode<T>* node, T* data) = 0;
virtual void handleRemoval(const LLTreeNode<T>* node, T* data) = 0; virtual void handleRemoval(const LLTreeNode<T>* node, T* data) = 0;
virtual void handleDestruction(const LLTreeNode<T>* node) = 0; virtual void handleDestruction(const LLTreeNode<T>* node) = 0;
virtual void handleStateChange(const LLTreeNode<T>* node) = 0;
}; };
template <class T> template <class T>
@@ -53,11 +52,15 @@ class LLTreeNode
public: public:
virtual ~LLTreeNode(); virtual ~LLTreeNode();
virtual bool insert(T* data); virtual bool insert(T* data) = 0;
virtual bool remove(T* data); virtual bool remove(T* data) = 0;
virtual void notifyRemoval(T* data); bool notifyAddition(T* data);
virtual U32 getListenerCount() { return mListeners.size(); } void notifyRemoval(T* data);
virtual LLTreeListener<T>* getListener(U32 index) const U32 getListenerCount() const
{
return mListeners.size();
}
LLTreeListener<T>* getListener(U32 index) const
{ {
if(index < mListeners.size()) if(index < mListeners.size())
{ {
@@ -65,7 +68,10 @@ public:
} }
return NULL; return NULL;
} }
virtual void addListener(LLTreeListener<T>* listener) { mListeners.push_back(listener); } void addListener(LLTreeListener<T>* listener)
{
mListeners.push_back(listener);
}
protected: protected:
void destroyListeners() void destroyListeners()
@@ -97,7 +103,7 @@ LLTreeNode<T>::~LLTreeNode()
}; };
template <class T> template <class T>
bool LLTreeNode<T>::insert(T* data) bool LLTreeNode<T>::notifyAddition(T* data)
{ {
for (U32 i = 0; i < mListeners.size(); i++) for (U32 i = 0; i < mListeners.size(); i++)
{ {
@@ -106,12 +112,6 @@ bool LLTreeNode<T>::insert(T* data)
return true; return true;
}; };
template <class T>
bool LLTreeNode<T>::remove(T* data)
{
return true;
};
template <class T> template <class T>
void LLTreeNode<T>::notifyRemoval(T* data) void LLTreeNode<T>::notifyRemoval(T* data)
{ {

View File

@@ -38,7 +38,7 @@ class LLVolumeParams;
class LLProfile; class LLProfile;
class LLPath; class LLPath;
template <class T> class LLOctreeNode; template <class T> class LLOctreeRoot;
class LLVolumeFace; class LLVolumeFace;
class LLVolume; class LLVolume;
@@ -964,7 +964,7 @@ public:
// vertices per joint. // vertices per joint.
LLJointRiggingInfoTab mJointRiggingInfoTab; LLJointRiggingInfoTab mJointRiggingInfoTab;
LLOctreeNode<LLVolumeTriangle>* mOctree; LLOctreeRoot<LLVolumeTriangle>* mOctree;
//whether or not face has been cache optimized //whether or not face has been cache optimized
BOOL mOptimized; BOOL mOptimized;

View File

@@ -112,14 +112,13 @@ public:
} }
//LISTENER FUNCTIONS //LISTENER FUNCTIONS
virtual void handleChildAddition(const LLOctreeNode<LLVolumeTriangle>* parent, void handleChildAddition(const LLOctreeNode<LLVolumeTriangle>* parent,
LLOctreeNode<LLVolumeTriangle>* child); LLOctreeNode<LLVolumeTriangle>* child) final override;
virtual void handleStateChange(const LLTreeNode<LLVolumeTriangle>* node) { } void handleChildRemoval(const LLOctreeNode<LLVolumeTriangle>* parent,
virtual void handleChildRemoval(const LLOctreeNode<LLVolumeTriangle>* parent, const LLOctreeNode<LLVolumeTriangle>* child) final override { }
const LLOctreeNode<LLVolumeTriangle>* child) { } void handleInsertion(const LLTreeNode<LLVolumeTriangle>* node, LLVolumeTriangle* tri) final override { }
virtual void handleInsertion(const LLTreeNode<LLVolumeTriangle>* node, LLVolumeTriangle* tri) { } void handleRemoval(const LLTreeNode<LLVolumeTriangle>* node, LLVolumeTriangle* tri) final override { }
virtual void handleRemoval(const LLTreeNode<LLVolumeTriangle>* node, LLVolumeTriangle* tri) { } void handleDestruction(const LLTreeNode<LLVolumeTriangle>* node) final override { }
virtual void handleDestruction(const LLTreeNode<LLVolumeTriangle>* node) { }
public: public:

View File

@@ -139,8 +139,8 @@ set(llmessage_HEADER_FILES
lldatapacker.h lldatapacker.h
lldbstrings.h lldbstrings.h
lldispatcher.h lldispatcher.h
llexperiencecache.h
lleventflags.h lleventflags.h
llexperiencecache.h
llfiltersd2xmlrpc.h llfiltersd2xmlrpc.h
llfollowcamparams.h llfollowcamparams.h
llhost.h llhost.h

View File

@@ -960,4 +960,5 @@ P(webProfileResponders);
P(wholeModelFeeResponder); P(wholeModelFeeResponder);
P(wholeModelUploadResponder); P(wholeModelUploadResponder);
P2(XMLRPCResponder, connect_40s); P2(XMLRPCResponder, connect_40s);
P(getUpdateInfoResponder); P(getUpdateInfoResponder);
P2(AISAPIResponder, connect_60s);

View File

@@ -335,7 +335,7 @@ void LLAvatarNameCache::requestNamesViaCapability()
while(!sAskQueue.empty()) while(!sAskQueue.empty())
{ {
it = sAskQueue.begin(); it = sAskQueue.begin();
const LLUUID& agent_id = *it; const LLUUID agent_id = *it;
sAskQueue.erase(it); sAskQueue.erase(it);
if (url.empty()) if (url.empty())

View File

@@ -28,15 +28,35 @@
#include <functional> #include <functional>
#include "llhttpclient.h" #include "llhttpclient.h"
struct LLCoroResponder final : public LLHTTPClient::ResponderWithCompleted struct LLCoroResponderBase : public LLHTTPClient::ResponderWithCompleted
{
const AIHTTPReceivedHeaders& getHeaders() const { return mReceivedHeaders; }
const LLSD& getContent() const { return mContent; }
char const* getName() const override final { return "LLCoroResponder"; }
protected:
LLCoroResponderBase() {}
};
struct LLCoroResponder final : public LLCoroResponderBase
{ {
typedef std::function<void(const LLCoroResponder&)> cb_t; typedef std::function<void(const LLCoroResponder&)> cb_t;
LLCoroResponder(const cb_t& cb) : mCB(cb) {} LLCoroResponder(const cb_t& cb) : mCB(cb) {}
void httpCompleted() override { mCB(*this); } void httpCompleted() override { mCB(*this); }
const AIHTTPReceivedHeaders& getHeaders() const { return mReceivedHeaders; } private:
const LLSD& getContent() const { return mContent; } const cb_t mCB;
};
char const* getName() const override { return "LLCoroResponder"; }
struct LLCoroResponderRaw final : public LLCoroResponderBase
{
typedef std::function<void(const LLCoroResponderRaw&, const std::string&)> cb_t;
LLCoroResponderRaw(const cb_t& cb) : mCB(cb) {}
void completedRaw(const LLChannelDescriptors& channels, const buffer_ptr_t& buffer) override
{
std::string content;
decode_raw_body(channels, buffer, content);
mCB(*this, content);
}
private: private:
const cb_t mCB; const cb_t mCB;
}; };

View File

@@ -130,11 +130,10 @@ void LLExperienceCache::importFile(std::istream& istr)
LLSD experiences = data["experiences"]; LLSD experiences = data["experiences"];
LLUUID public_key; LLUUID public_key;
LLSD::map_const_iterator it = experiences.beginMap(); for (const auto& it : experiences.map())
for (; it != experiences.endMap(); ++it)
{ {
public_key.set(it->first); public_key.set(it.first);
mCache[public_key] = it->second; mCache[public_key] = it.second;
} }
LL_DEBUGS("ExperienceCache") << "importFile() loaded " << mCache.size() << LL_ENDL; LL_DEBUGS("ExperienceCache") << "importFile() loaded " << mCache.size() << LL_ENDL;
@@ -164,10 +163,8 @@ void LLExperienceCache::exportFile(std::ostream& ostr) const
void LLExperienceCache::bootstrap(const LLSD& legacyKeys, int initialExpiration) void LLExperienceCache::bootstrap(const LLSD& legacyKeys, int initialExpiration)
{ {
LLExperienceCacheImpl::mapKeys(legacyKeys); LLExperienceCacheImpl::mapKeys(legacyKeys);
LLSD::array_const_iterator it = legacyKeys.beginArray(); for (auto experience : legacyKeys.array())
for (/**/; it != legacyKeys.endArray(); ++it)
{ {
LLSD experience = *it;
if (experience.has(EXPERIENCE_ID)) if (experience.has(EXPERIENCE_ID))
{ {
if (!experience.has(EXPIRES)) if (!experience.has(EXPIRES))
@@ -272,10 +269,8 @@ void LLExperienceCache::requestExperiencesCoro(const LLCoroResponder& responder,
LLSD experiences = result["experience_keys"]; LLSD experiences = result["experience_keys"];
for (LLSD::array_const_iterator it = experiences.beginArray(); for (const auto& row : experiences.array())
it != experiences.endArray(); ++it)
{ {
const LLSD& row = *it;
LLUUID public_key = row[EXPERIENCE_ID].asUUID(); LLUUID public_key = row[EXPERIENCE_ID].asUUID();
LL_DEBUGS("ExperienceCache") << "Received result for " << public_key LL_DEBUGS("ExperienceCache") << "Received result for " << public_key
@@ -286,10 +281,9 @@ void LLExperienceCache::requestExperiencesCoro(const LLCoroResponder& responder,
LLSD error_ids = result["error_ids"]; LLSD error_ids = result["error_ids"];
for (LLSD::array_const_iterator errIt = error_ids.beginArray(); for (const auto& err : error_ids.array())
errIt != error_ids.endArray(); ++errIt)
{ {
LLUUID id = errIt->asUUID(); LLUUID id = err.asUUID();
LLSD exp; LLSD exp;
exp[EXPIRES] = DEFAULT_EXPIRATION; exp[EXPIRES] = DEFAULT_EXPIRATION;
exp[EXPERIENCE_ID] = id; exp[EXPERIENCE_ID] = id;
@@ -605,9 +599,9 @@ void LLExperienceCache::findExperienceByNameCoro(const LLCoroResponder& responde
} }
const LLSD& experiences = result["experience_keys"]; const LLSD& experiences = result["experience_keys"];
for (LLSD::array_const_iterator it = experiences.beginArray(); it != experiences.endArray(); ++it) for (const auto& it : experiences.array())
{ {
insert(*it); insert(it);
} }
fn(result); fn(result);
@@ -803,15 +797,14 @@ void LLExperienceCache::updateExperience(LLSD updateData, ExperienceGetFn_t fn)
//========================================================================= //=========================================================================
void LLExperienceCacheImpl::mapKeys(const LLSD& legacyKeys) void LLExperienceCacheImpl::mapKeys(const LLSD& legacyKeys)
{ {
LLSD::array_const_iterator exp = legacyKeys.beginArray(); for (const auto& exp : legacyKeys.array())
for (/**/; exp != legacyKeys.endArray(); ++exp) {
{ if (exp.has(LLExperienceCacheImpl::EXPERIENCE_ID) && exp.has(LLExperienceCacheImpl::PRIVATE_KEY))
if (exp->has(LLExperienceCacheImpl::EXPERIENCE_ID) && exp->has(LLExperienceCacheImpl::PRIVATE_KEY)) {
{ LLExperienceCacheImpl::privateToPublicKeyMap[exp[LLExperienceCacheImpl::PRIVATE_KEY].asUUID()] =
LLExperienceCacheImpl::privateToPublicKeyMap[(*exp)[LLExperienceCacheImpl::PRIVATE_KEY].asUUID()] = exp[LLExperienceCacheImpl::EXPERIENCE_ID].asUUID();
(*exp)[LLExperienceCacheImpl::EXPERIENCE_ID].asUUID(); }
} }
}
} }
// Return time to retry a request that generated an error, based on // Return time to retry a request that generated an error, based on

View File

@@ -19,7 +19,7 @@ include_directories(
set(llplugin_SOURCE_FILES set(llplugin_SOURCE_FILES
llpluginclassbasic.cpp llpluginclassbasic.cpp
llpluginclassmedia.cpp llpluginclassmedia.cpp
llplugincookiestore.cpp #llplugincookiestore.cpp
llplugininstance.cpp llplugininstance.cpp
llpluginmessage.cpp llpluginmessage.cpp
llpluginmessagepipe.cpp llpluginmessagepipe.cpp
@@ -34,7 +34,7 @@ set(llplugin_HEADER_FILES
llpluginclassbasic.h llpluginclassbasic.h
llpluginclassmedia.h llpluginclassmedia.h
llpluginclassmediaowner.h llpluginclassmediaowner.h
llplugincookiestore.h #llplugincookiestore.h
llplugininstance.h llplugininstance.h
llpluginmessage.h llpluginmessage.h
llpluginmessageclasses.h llpluginmessageclasses.h

View File

@@ -623,12 +623,14 @@ bool LLPluginClassMedia::keyEvent(EKeyEventType type, int key_code, MASK modifie
return result; return result;
} }
void LLPluginClassMedia::scrollEvent(int x, int y, MASK modifiers) void LLPluginClassMedia::scrollEvent(int x, int y, int clicks_x, int clicks_y, MASK modifiers)
{ {
LLPluginMessage message(LLPLUGIN_MESSAGE_CLASS_MEDIA, "scroll_event"); LLPluginMessage message(LLPLUGIN_MESSAGE_CLASS_MEDIA, "scroll_event");
message.setValueS32("x", x); message.setValueS32("x", x);
message.setValueS32("y", y); message.setValueS32("y", y);
message.setValueS32("clicks_x", clicks_x);
message.setValueS32("clicks_y", clicks_y);
message.setValue("modifiers", translateModifiers(modifiers)); message.setValue("modifiers", translateModifiers(modifiers));
sendMessage(message); sendMessage(message);
@@ -711,9 +713,9 @@ void LLPluginClassMedia::sendPickFileResponse(const std::vector<std::string> fil
} }
LLSD file_list = LLSD::emptyArray(); LLSD file_list = LLSD::emptyArray();
for (std::vector<std::string>::const_iterator in_iter = files.begin(); in_iter != files.end(); ++in_iter) for (const auto& file : files)
{ {
file_list.append(LLSD::String(*in_iter)); file_list.append(LLSD::String(file));
} }
message.setValueLLSD("file_list", file_list); message.setValueLLSD("file_list", file_list);

View File

@@ -75,7 +75,7 @@ public:
void setAutoScale(bool auto_scale); void setAutoScale(bool auto_scale);
void setZoomFactor(F64 zoom_factor) { mZoomFactor = zoom_factor; } void setZoomFactor(F64 zoom_factor) { mZoomFactor = zoom_factor; }
void setBackgroundColor(LLColor4 color) { mBackgroundColor = color; }; void setBackgroundColor(const LLColor4& color) { mBackgroundColor = color; };
void setOwner(LLPluginClassMediaOwner *owner) { mOwner = owner; }; void setOwner(LLPluginClassMediaOwner *owner) { mOwner = owner; };
@@ -107,7 +107,7 @@ public:
bool keyEvent(EKeyEventType type, int key_code, MASK modifiers, LLSD native_key_data); bool keyEvent(EKeyEventType type, int key_code, MASK modifiers, LLSD native_key_data);
void scrollEvent(int x, int y, MASK modifiers); void scrollEvent(int x, int y, int clicks_x, int clicks_y, MASK modifiers);
// enable/disable media plugin debugging messages and info spam // enable/disable media plugin debugging messages and info spam
void enableMediaPluginDebugging( bool enable ); void enableMediaPluginDebugging( bool enable );

View File

@@ -4991,110 +4991,6 @@ void LLTextEditor::setOnScrollEndCallback(void (*callback)(void*), void* userdat
mScrollbar->setOnScrollEndCallback(callback, userdata); 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 // LLTextSegment

View File

@@ -236,8 +236,8 @@ public:
void setCommitOnFocusLost(BOOL b) { mCommitOnFocusLost = b; } void setCommitOnFocusLost(BOOL b) { mCommitOnFocusLost = b; }
// Hack to handle Notecards // Hack to handle Notecards
virtual BOOL importBuffer(const char* buffer, S32 length ); virtual BOOL importBuffer(const char* buffer, S32 length) { return false; }
virtual BOOL exportBuffer(std::string& buffer ); virtual BOOL exportBuffer(std::string& buffer) { return false; }
// If takes focus, will take keyboard focus on click. // If takes focus, will take keyboard focus on click.
void setTakesFocus(BOOL b) { mTakesFocus = b; } void setTakesFocus(BOOL b) { mTakesFocus = b; }

View File

@@ -588,7 +588,7 @@ void LLUrlEntryAgent::onAvatarNameCache(const LLUUID& id,
} }
mAvatarNameCacheConnections.erase(range.first, range.second); 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 // received the agent name from the server - tell our observers
callObservers(id.asString(), label, mIcon); callObservers(id.asString(), label, mIcon);
@@ -666,7 +666,7 @@ std::string LLUrlEntryAgent::getLabel(const std::string &url, const LLUrlLabelCa
LLAvatarName av_name; LLAvatarName av_name;
if (LLAvatarNameCache::get(agent_id, &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 // handle suffixes like /mute or /offerteleport
label = localize_slapp_label(url, label); label = localize_slapp_label(url, label);
@@ -1551,7 +1551,7 @@ void LLUrlEntryExperienceProfile::onExperienceDetails(const LLSD& experience_det
// //
LLUrlEntryJira::LLUrlEntryJira() LLUrlEntryJira::LLUrlEntryJira()
{ {
mPattern = boost::regex("((?:ALCH|SV|BUG|CHOP|FIRE|MAINT|OPEN|SCR|STORM|SVC|VWR|WEB)-\\d+)", mPattern = boost::regex("(\\b(?:ALCH|SV|BUG|CHOP|FIRE|MAINT|OPEN|SCR|STORM|SVC|VWR|WEB)-\\d+)",
boost::regex::perl); boost::regex::perl);
mMenuName = "menu_url_http.xml"; mMenuName = "menu_url_http.xml";
mTooltip = LLTrans::getString("TooltipHttpUrl"); mTooltip = LLTrans::getString("TooltipHttpUrl");
@@ -1575,7 +1575,7 @@ std::string LLUrlEntryJira::getUrl(const std::string &url) const
(url.find("SV") != std::string::npos) ? (url.find("SV") != std::string::npos) ?
"https://singularityviewer.atlassian.net/browse/%1%" : "https://singularityviewer.atlassian.net/browse/%1%" :
(url.find("FIRE") != std::string::npos) ? (url.find("FIRE") != std::string::npos) ?
"http://jira.phoenixviewer.com/browse/%1%" : "https://jira.firestormviewer.com/browse/%1%" :
"http://jira.secondlife.com/browse/%1%" "http://jira.secondlife.com/browse/%1%"
) % url).str(); ) % url).str();
} }

View File

@@ -132,7 +132,7 @@ protected:
/// ///
/// LLUrlEntryHTTP Describes generic http: and https: Urls /// LLUrlEntryHTTP Describes generic http: and https: Urls
/// ///
class LLUrlEntryHTTP : public LLUrlEntryBase class LLUrlEntryHTTP final : public LLUrlEntryBase
{ {
public: public:
LLUrlEntryHTTP(); LLUrlEntryHTTP();
@@ -144,7 +144,7 @@ public:
/// ///
/// LLUrlEntryHTTPLabel Describes generic http: and https: Urls with custom labels /// LLUrlEntryHTTPLabel Describes generic http: and https: Urls with custom labels
/// ///
class LLUrlEntryHTTPLabel : public LLUrlEntryBase class LLUrlEntryHTTPLabel final : public LLUrlEntryBase
{ {
public: public:
LLUrlEntryHTTPLabel(); LLUrlEntryHTTPLabel();
@@ -156,7 +156,7 @@ public:
/// ///
/// LLUrlEntryHTTPNoProtocol Describes generic Urls like www.google.com /// LLUrlEntryHTTPNoProtocol Describes generic Urls like www.google.com
/// ///
class LLUrlEntryHTTPNoProtocol : public LLUrlEntryBase class LLUrlEntryHTTPNoProtocol final : public LLUrlEntryBase
{ {
public: public:
LLUrlEntryHTTPNoProtocol(); LLUrlEntryHTTPNoProtocol();
@@ -166,7 +166,7 @@ public:
std::string getTooltip(const std::string &url) const override; std::string getTooltip(const std::string &url) const override;
}; };
class LLUrlEntryInvalidSLURL : public LLUrlEntryBase class LLUrlEntryInvalidSLURL final : public LLUrlEntryBase
{ {
public: public:
LLUrlEntryInvalidSLURL(); LLUrlEntryInvalidSLURL();
@@ -180,7 +180,7 @@ public:
/// ///
/// LLUrlEntrySLURL Describes http://slurl.com/... Urls /// LLUrlEntrySLURL Describes http://slurl.com/... Urls
/// ///
class LLUrlEntrySLURL : public LLUrlEntryBase class LLUrlEntrySLURL final : public LLUrlEntryBase
{ {
public: public:
LLUrlEntrySLURL(); LLUrlEntrySLURL();
@@ -205,7 +205,7 @@ public:
/// ///
/// LLUrlEntrySeconlifeURLs Describes *secondlife.com and *lindenlab.com Urls /// LLUrlEntrySeconlifeURLs Describes *secondlife.com and *lindenlab.com Urls
/// ///
class LLUrlEntrySimpleSecondlifeURL : public LLUrlEntrySecondlifeURL class LLUrlEntrySimpleSecondlifeURL final : public LLUrlEntrySecondlifeURL
{ {
public: public:
LLUrlEntrySimpleSecondlifeURL(); LLUrlEntrySimpleSecondlifeURL();
@@ -281,7 +281,7 @@ private:
/// secondlife:///app/agent/0e346d8b-4433-4d66-a6b0-fd37083abc4c/completename /// secondlife:///app/agent/0e346d8b-4433-4d66-a6b0-fd37083abc4c/completename
/// that displays the full display name + user name for an avatar /// that displays the full display name + user name for an avatar
/// such as "James Linden (james.linden)" /// such as "James Linden (james.linden)"
class LLUrlEntryAgentCompleteName : public LLUrlEntryAgentName class LLUrlEntryAgentCompleteName final : public LLUrlEntryAgentName
{ {
public: public:
LLUrlEntryAgentCompleteName(); LLUrlEntryAgentCompleteName();
@@ -289,7 +289,7 @@ private:
/*virtual*/ std::string getName(const LLAvatarName& avatar_name) override; /*virtual*/ std::string getName(const LLAvatarName& avatar_name) override;
}; };
class LLUrlEntryAgentLegacyName : public LLUrlEntryAgentName class LLUrlEntryAgentLegacyName final : public LLUrlEntryAgentName
{ {
public: public:
LLUrlEntryAgentLegacyName(); LLUrlEntryAgentLegacyName();
@@ -302,7 +302,7 @@ private:
/// secondlife:///app/agent/0e346d8b-4433-4d66-a6b0-fd37083abc4c/displayname /// secondlife:///app/agent/0e346d8b-4433-4d66-a6b0-fd37083abc4c/displayname
/// that displays the just the display name for an avatar /// that displays the just the display name for an avatar
/// such as "James Linden" /// such as "James Linden"
class LLUrlEntryAgentDisplayName : public LLUrlEntryAgentName class LLUrlEntryAgentDisplayName final : public LLUrlEntryAgentName
{ {
public: public:
LLUrlEntryAgentDisplayName(); LLUrlEntryAgentDisplayName();
@@ -315,7 +315,7 @@ private:
/// secondlife:///app/agent/0e346d8b-4433-4d66-a6b0-fd37083abc4c/username /// secondlife:///app/agent/0e346d8b-4433-4d66-a6b0-fd37083abc4c/username
/// that displays the just the display name for an avatar /// that displays the just the display name for an avatar
/// such as "james.linden" /// such as "james.linden"
class LLUrlEntryAgentUserName : public LLUrlEntryAgentName class LLUrlEntryAgentUserName final : public LLUrlEntryAgentName
{ {
public: public:
LLUrlEntryAgentUserName(); LLUrlEntryAgentUserName();
@@ -326,12 +326,12 @@ private:
/// ///
/// LLUrlEntryExperienceProfile Describes a Second Life experience profile Url, e.g., /// LLUrlEntryExperienceProfile Describes a Second Life experience profile Url, e.g.,
/// secondlife:///app/experience/0e346d8b-4433-4d66-a6b0-fd37083abc4c/profile /// secondlife:///app/experience/0e346d8b-4433-4d66-a6b0-fd37083abc4c/profile
/// that displays the experience namethat displays the experience name /// that displays the experience name
class LLUrlEntryExperienceProfile : public LLUrlEntryBase class LLUrlEntryExperienceProfile final : public LLUrlEntryBase
{ {
public: public:
LLUrlEntryExperienceProfile(); LLUrlEntryExperienceProfile();
/*virtual*/ std::string getLabel(const std::string &url, const LLUrlLabelCallback &cb); /*virtual*/ std::string getLabel(const std::string &url, const LLUrlLabelCallback &cb) override;
private: private:
void onExperienceDetails(const LLSD& experience_details); void onExperienceDetails(const LLSD& experience_details);
}; };
@@ -341,7 +341,7 @@ private:
/// LLUrlEntryGroup Describes a Second Life group Url, e.g., /// LLUrlEntryGroup Describes a Second Life group Url, e.g.,
/// secondlife:///app/group/00005ff3-4044-c79f-9de8-fb28ae0df991/about /// secondlife:///app/group/00005ff3-4044-c79f-9de8-fb28ae0df991/about
/// ///
class LLUrlEntryGroup : public LLUrlEntryBase class LLUrlEntryGroup final : public LLUrlEntryBase
{ {
public: public:
LLUrlEntryGroup(); LLUrlEntryGroup();
@@ -356,7 +356,7 @@ private:
/// LLUrlEntryInventory Describes a Second Life inventory Url, e.g., /// LLUrlEntryInventory Describes a Second Life inventory Url, e.g.,
/// secondlife:///app/inventory/0e346d8b-4433-4d66-a6b0-fd37083abc4c/select /// secondlife:///app/inventory/0e346d8b-4433-4d66-a6b0-fd37083abc4c/select
/// ///
class LLUrlEntryInventory : public LLUrlEntryBase class LLUrlEntryInventory final : public LLUrlEntryBase
{ {
public: public:
LLUrlEntryInventory(); LLUrlEntryInventory();
@@ -368,7 +368,7 @@ private:
/// LLUrlEntryObjectIM Describes a Second Life inspector for the object Url, e.g., /// LLUrlEntryObjectIM Describes a Second Life inspector for the object Url, e.g.,
/// secondlife:///app/objectim/7bcd7864-da6b-e43f-4486-91d28a28d95b?name=Object&owner=3de548e1-57be-cfea-2b78-83ae3ad95998&slurl=Danger!%20Danger!/200/200/30/&groupowned=1 /// secondlife:///app/objectim/7bcd7864-da6b-e43f-4486-91d28a28d95b?name=Object&owner=3de548e1-57be-cfea-2b78-83ae3ad95998&slurl=Danger!%20Danger!/200/200/30/&groupowned=1
/// ///
class LLUrlEntryObjectIM : public LLUrlEntryBase class LLUrlEntryObjectIM final : public LLUrlEntryBase
{ {
public: public:
LLUrlEntryObjectIM(); LLUrlEntryObjectIM();
@@ -381,7 +381,7 @@ private:
/// LLUrlEntryParcel Describes a Second Life parcel Url, e.g., /// LLUrlEntryParcel Describes a Second Life parcel Url, e.g.,
/// secondlife:///app/parcel/0000060e-4b39-e00b-d0c3-d98b1934e3a8/about /// secondlife:///app/parcel/0000060e-4b39-e00b-d0c3-d98b1934e3a8/about
/// ///
class LLUrlEntryParcel : public LLUrlEntryBase class LLUrlEntryParcel final : public LLUrlEntryBase
{ {
public: public:
struct LLParcelData struct LLParcelData
@@ -428,7 +428,7 @@ private:
/// LLUrlEntryPlace Describes a Second Life location Url, e.g., /// LLUrlEntryPlace Describes a Second Life location Url, e.g.,
/// secondlife://Ahern/50/50/50 /// secondlife://Ahern/50/50/50
/// ///
class LLUrlEntryPlace : public LLUrlEntryBase class LLUrlEntryPlace final : public LLUrlEntryBase
{ {
public: public:
LLUrlEntryPlace(); LLUrlEntryPlace();
@@ -440,7 +440,7 @@ public:
/// LLUrlEntryRegion Describes a Second Life location Url, e.g., /// LLUrlEntryRegion Describes a Second Life location Url, e.g.,
/// secondlife:///app/region/Ahern/128/128/0 /// secondlife:///app/region/Ahern/128/128/0
/// ///
class LLUrlEntryRegion : public LLUrlEntryBase class LLUrlEntryRegion final : public LLUrlEntryBase
{ {
public: public:
LLUrlEntryRegion(); LLUrlEntryRegion();
@@ -452,7 +452,7 @@ public:
/// LLUrlEntryTeleport Describes a Second Life teleport Url, e.g., /// LLUrlEntryTeleport Describes a Second Life teleport Url, e.g.,
/// secondlife:///app/teleport/Ahern/50/50/50/ /// secondlife:///app/teleport/Ahern/50/50/50/
/// ///
class LLUrlEntryTeleport : public LLUrlEntryBase class LLUrlEntryTeleport final : public LLUrlEntryBase
{ {
public: public:
LLUrlEntryTeleport(); LLUrlEntryTeleport();
@@ -464,7 +464,7 @@ public:
/// LLUrlEntrySL Describes a generic SLURL, e.g., a Url that starts /// LLUrlEntrySL Describes a generic SLURL, e.g., a Url that starts
/// with secondlife:// (used as a catch-all for cases not matched above) /// with secondlife:// (used as a catch-all for cases not matched above)
/// ///
class LLUrlEntrySL : public LLUrlEntryBase class LLUrlEntrySL final : public LLUrlEntryBase
{ {
public: public:
LLUrlEntrySL(); LLUrlEntrySL();
@@ -475,7 +475,7 @@ public:
/// LLUrlEntrySLLabel Describes a generic SLURL, e.g., a Url that starts /// LLUrlEntrySLLabel Describes a generic SLURL, e.g., a Url that starts
/// with secondlife:// with the ability to specify a custom label. /// with secondlife:// with the ability to specify a custom label.
/// ///
class LLUrlEntrySLLabel : public LLUrlEntryBase class LLUrlEntrySLLabel final : public LLUrlEntryBase
{ {
public: public:
LLUrlEntrySLLabel(); LLUrlEntrySLLabel();
@@ -489,7 +489,7 @@ public:
/// LLUrlEntryWorldMap Describes a Second Life worldmap Url, e.g., /// LLUrlEntryWorldMap Describes a Second Life worldmap Url, e.g.,
/// secondlife:///app/worldmap/Ahern/50/50/50 /// secondlife:///app/worldmap/Ahern/50/50/50
/// ///
class LLUrlEntryWorldMap : public LLUrlEntryBase class LLUrlEntryWorldMap final : public LLUrlEntryBase
{ {
public: public:
LLUrlEntryWorldMap(); LLUrlEntryWorldMap();
@@ -500,7 +500,7 @@ public:
/// ///
/// LLUrlEntryNoLink lets us turn of URL detection with <nolink>...</nolink> tags /// LLUrlEntryNoLink lets us turn of URL detection with <nolink>...</nolink> tags
/// ///
class LLUrlEntryNoLink : public LLUrlEntryBase class LLUrlEntryNoLink final : public LLUrlEntryBase
{ {
public: public:
LLUrlEntryNoLink(); LLUrlEntryNoLink();
@@ -512,7 +512,7 @@ public:
/// ///
/// LLUrlEntryIcon describes an icon with <icon>...</icon> tags /// LLUrlEntryIcon describes an icon with <icon>...</icon> tags
/// ///
class LLUrlEntryIcon : public LLUrlEntryBase class LLUrlEntryIcon final : public LLUrlEntryBase
{ {
public: public:
LLUrlEntryIcon(); LLUrlEntryIcon();
@@ -524,7 +524,7 @@ public:
/// ///
/// LLUrlEntryEmail Describes a generic mailto: Urls /// LLUrlEntryEmail Describes a generic mailto: Urls
/// ///
class LLUrlEntryEmail : public LLUrlEntryBase class LLUrlEntryEmail final : public LLUrlEntryBase
{ {
public: public:
LLUrlEntryEmail(); LLUrlEntryEmail();
@@ -536,7 +536,7 @@ public:
/// ///
/// LLUrlEntryJira describes a Jira Issue /// LLUrlEntryJira describes a Jira Issue
/// ///
class LLUrlEntryJira : public LLUrlEntryBase class LLUrlEntryJira final : public LLUrlEntryBase
{ {
public: public:
LLUrlEntryJira(); LLUrlEntryJira();

View File

@@ -235,7 +235,7 @@ private:
private: private:
// widgets in general are not copyable // widgets in general are not copyable
LLView(const LLView& other) {}; LLView(const LLView& other) = delete;
public: public:
#if LL_DEBUG #if LL_DEBUG
static BOOL sIsDrawing; static BOOL sIsDrawing;

View File

@@ -18,7 +18,6 @@ include(FMODSTUDIO)
include(GeneratePrecompiledHeader) include(GeneratePrecompiledHeader)
include(GLOD) include(GLOD)
include(Hunspell) include(Hunspell)
include(Json)
include(LLAddBuildTest) include(LLAddBuildTest)
include(LLAppearance) include(LLAppearance)
include(LLAudio) include(LLAudio)
@@ -63,7 +62,6 @@ include_directories(
${STATEMACHINE_INCLUDE_DIRS} ${STATEMACHINE_INCLUDE_DIRS}
${DBUSGLIB_INCLUDE_DIRS} ${DBUSGLIB_INCLUDE_DIRS}
${ZLIB_INCLUDE_DIRS} ${ZLIB_INCLUDE_DIRS}
${JSON_INCLUDE_DIR}
${GLOD_INCLUDE_DIR} ${GLOD_INCLUDE_DIR}
${LLAUDIO_INCLUDE_DIRS} ${LLAUDIO_INCLUDE_DIRS}
${LLCHARACTER_INCLUDE_DIRS} ${LLCHARACTER_INCLUDE_DIRS}
@@ -92,6 +90,7 @@ set(viewer_SOURCE_FILES
aixmllindengenepool.cpp aixmllindengenepool.cpp
alfloaterregiontracker.cpp alfloaterregiontracker.cpp
aoremotectrl.cpp aoremotectrl.cpp
aosystem.cpp
ascentfloatercontactgroups.cpp ascentfloatercontactgroups.cpp
ascentkeyword.cpp ascentkeyword.cpp
ascentprefschat.cpp ascentprefschat.cpp
@@ -119,6 +118,7 @@ set(viewer_SOURCE_FILES
llaisapi.cpp llaisapi.cpp
llagent.cpp llagent.cpp
llagentaccess.cpp llagentaccess.cpp
llagentbenefits.cpp
llagentcamera.cpp llagentcamera.cpp
llagentdata.cpp llagentdata.cpp
llagentlanguage.cpp llagentlanguage.cpp
@@ -324,6 +324,7 @@ set(viewer_SOURCE_FILES
llhudtext.cpp llhudtext.cpp
llhudview.cpp llhudview.cpp
llimpanel.cpp llimpanel.cpp
llimprocessing.cpp
llimview.cpp llimview.cpp
llinventoryactions.cpp llinventoryactions.cpp
llinventorybridge.cpp llinventorybridge.cpp
@@ -635,6 +636,8 @@ set(viewer_HEADER_FILES
aixmllindengenepool.h aixmllindengenepool.h
alfloaterregiontracker.h alfloaterregiontracker.h
aoremotectrl.h aoremotectrl.h
aostate.h
aosystem.h
ascentfloatercontactgroups.h ascentfloatercontactgroups.h
ascentkeyword.h ascentkeyword.h
ascentprefschat.h ascentprefschat.h
@@ -662,6 +665,7 @@ set(viewer_HEADER_FILES
llaisapi.h llaisapi.h
llagent.h llagent.h
llagentaccess.h llagentaccess.h
llagentbenefits.h
llagentcamera.h llagentcamera.h
llagentdata.h llagentdata.h
llagentlanguage.h llagentlanguage.h
@@ -867,6 +871,7 @@ set(viewer_HEADER_FILES
llhudtext.h llhudtext.h
llhudview.h llhudview.h
llimpanel.h llimpanel.h
llimprocessing.h
llimview.h llimview.h
llinventorybridge.h llinventorybridge.h
llinventoryclipboard.h llinventoryclipboard.h
@@ -1703,6 +1708,7 @@ target_link_libraries(${VIEWER_BINARY_NAME}
${LLAPPEARANCE_LIBRARIES} ${LLAPPEARANCE_LIBRARIES}
absl::flat_hash_map absl::flat_hash_map
absl::node_hash_map absl::node_hash_map
nlohmann_json::nlohmann_json
${FMT_LIBRARY} ${FMT_LIBRARY}
) )
@@ -1821,7 +1827,7 @@ if (DARWIN)
${CMAKE_CURRENT_SOURCE_DIR}/viewer_manifest.py ${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) if (PACKAGE)
add_custom_target(llpackage ALL DEPENDS ${VIEWER_BINARY_NAME}) add_custom_target(llpackage ALL DEPENDS ${VIEWER_BINARY_NAME})

View File

@@ -14,457 +14,300 @@
*/ */
#include "llviewerprecompiledheaders.h" #include "llviewerprecompiledheaders.h"
#include "NACLantispam.h" #include "NACLantispam.h"
#include "llviewercontrol.h"
#include "llnotificationsutil.h"
#include "llviewerobjectlist.h"
#include "llagent.h" #include "llagent.h"
#include "llavataractions.h"
#include "llcallbacklist.h" // For idle cleaning
#include "llnotificationsutil.h"
#include "lltrans.h" #include "lltrans.h"
#include "llviewerobjectlist.h"
#include <time.h> #include <time.h>
#include <boost/lexical_cast.hpp> #include <boost/lexical_cast.hpp>
class NACLAntiSpamQueue
{
friend class NACLAntiSpamRegistry;
public:
const U32& getAmount() const { return mAmount; }
const U32& getTime() const { return mTime; }
protected:
NACLAntiSpamQueue(const U32& time, const U32& amount) : mTime(time), mAmount(amount) {}
void setAmount(const U32& amount) { mAmount = amount; }
void setTime(const U32& time) { mTime = time; }
void block(const LLUUID& source) { mEntries[source.asString()].block(); }
void reset() { mEntries.clear(); }
// Returns 0 if unblocked/disabled, 1 if check results in a new block, 2 if by an existing block
U8 check(const LLUUID& source, const U32& multiplier)
{
const auto key = source.asString();
auto it = mEntries.find(key);
if (it != mEntries.end())
return it->second.blockIfNeeded(mAmount * multiplier, mTime);
mEntries[key]; // Default construct an Entry
return 0U;
}
void idle()
{
// Clean out old unblocked entries
const auto time_limit = mTime + 1; // One second after time has gone up, the next offense would reset anyway
for (auto it = mEntries.begin(); it != mEntries.end();)
{
const auto& entry = it->second;
if (entry.getBlocked() || entry.withinBlockTime(time_limit))
++it;
else it = mEntries.erase(it);
}
}
private:
class Entry
{
friend class NACLAntiSpamQueue;
protected:
void reset() { updateTime(); mAmount = 1; mBlocked = false; }
const U32& getAmount() const { return mAmount; }
const std::time_t& getTime() const { return mTime; }
void updateTime() { mTime = time(nullptr); }
void block() { mBlocked = true; }
bool withinBlockTime(const U32& time_limit) const { return (time(nullptr) - mTime) <= time_limit; }
U8 blockIfNeeded(const U32& amount, const U32& time_limit)
{
if (mBlocked) return 2U; // Already blocked
if (withinBlockTime(time_limit))
{
if (++mAmount > amount)
{
block();
return 1U;
}
}
else reset(); // Enough time has passed to forgive or not already in list
return 0U;
}
bool getBlocked() const { return mBlocked; }
private:
U32 mAmount = 1;
std::time_t mTime = time(nullptr);
bool mBlocked = false;
};
boost::unordered_map<std::string, Entry> mEntries;
U32 mAmount, mTime;
};
bool can_block(const LLUUID& id) bool can_block(const LLUUID& id)
{ {
if (id.isNull() || gAgent.getID() == id) return false; //Can't block system or self. if (id.isNull() || gAgentID == id) return false; // Can't block system or self.
if (const LLViewerObject* obj = gObjectList.findObject(id)) //From an object, if (const LLViewerObject* obj = gObjectList.findObject(id)) // From an object,
return !obj->permYouOwner(); //not own object. return !obj->permYouOwner(); // not own object.
return true; return true;
} }
U32 NACLAntiSpamRegistry::globalAmount; bool is_collision_sound(const std::string& sound)
U32 NACLAntiSpamRegistry::globalTime; {
bool NACLAntiSpamRegistry::bGlobalQueue; // The following sounds will be ignored for purposes of spam protection. They have been gathered from wiki documentation of frequent official sounds.
NACLAntiSpamQueue* NACLAntiSpamRegistry::queues[NACLAntiSpamRegistry::QUEUE_MAX] = {0}; const std::array<const std::string, 29> COLLISION_SOUNDS = {
boost::unordered_map<std::string,NACLAntiSpamQueueEntry*> NACLAntiSpamRegistry::globalEntries; "dce5fdd4-afe4-4ea1-822f-dd52cac46b08",
boost::unordered_map<std::string,NACLAntiSpamQueueEntry*>::iterator NACLAntiSpamRegistry::it2; "51011582-fbca-4580-ae9e-1a5593f094ec",
"68d62208-e257-4d0c-bbe2-20c9ea9760bb",
"75872e8c-bc39-451b-9b0b-042d7ba36cba",
"6a45ba0b-5775-4ea8-8513-26008a17f873",
"992a6d1b-8c77-40e0-9495-4098ce539694",
"2de4da5a-faf8-46be-bac6-c4d74f1e5767",
"6e3fb0f7-6d9c-42ca-b86b-1122ff562d7d",
"14209133-4961-4acc-9649-53fc38ee1667",
"bc4a4348-cfcc-4e5e-908e-8a52a8915fe6",
"9e5c1297-6eed-40c0-825a-d9bcd86e3193",
"e534761c-1894-4b61-b20c-658a6fb68157",
"8761f73f-6cf9-4186-8aaa-0948ed002db1",
"874a26fd-142f-4173-8c5b-890cd846c74d",
"0e24a717-b97e-4b77-9c94-b59a5a88b2da",
"75cf3ade-9a5b-4c4d-bb35-f9799bda7fb2",
"153c8bf7-fb89-4d89-b263-47e58b1b4774",
"55c3e0ce-275a-46fa-82ff-e0465f5e8703",
"24babf58-7156-4841-9a3f-761bdbb8e237",
"aca261d8-e145-4610-9e20-9eff990f2c12",
"0642fba6-5dcf-4d62-8e7b-94dbb529d117",
"25a863e8-dc42-4e8a-a357-e76422ace9b5",
"9538f37c-456e-4047-81be-6435045608d4",
"8c0f84c3-9afd-4396-b5f5-9bca2c911c20",
"be582e5d-b123-41a2-a150-454c39e961c8",
"c70141d4-ba06-41ea-bcbc-35ea81cb8335",
"7d1826f4-24c4-4aac-8c2e-eff45df37783",
"063c97d3-033a-4e9b-98d8-05c8074922cb",
"00000000-0000-0000-0000-000000000120"
};
// The following sounds will be ignored for purposes of spam protection. They have been gathered from wiki documentation of frequent official sounds. for (const auto& collision : COLLISION_SOUNDS)
const std::string COLLISION_SOUNDS[] ={"dce5fdd4-afe4-4ea1-822f-dd52cac46b08","51011582-fbca-4580-ae9e-1a5593f094ec","68d62208-e257-4d0c-bbe2-20c9ea9760bb","75872e8c-bc39-451b-9b0b-042d7ba36cba","6a45ba0b-5775-4ea8-8513-26008a17f873","992a6d1b-8c77-40e0-9495-4098ce539694","2de4da5a-faf8-46be-bac6-c4d74f1e5767","6e3fb0f7-6d9c-42ca-b86b-1122ff562d7d","14209133-4961-4acc-9649-53fc38ee1667","bc4a4348-cfcc-4e5e-908e-8a52a8915fe6","9e5c1297-6eed-40c0-825a-d9bcd86e3193","e534761c-1894-4b61-b20c-658a6fb68157","8761f73f-6cf9-4186-8aaa-0948ed002db1","874a26fd-142f-4173-8c5b-890cd846c74d","0e24a717-b97e-4b77-9c94-b59a5a88b2da","75cf3ade-9a5b-4c4d-bb35-f9799bda7fb2","153c8bf7-fb89-4d89-b263-47e58b1b4774","55c3e0ce-275a-46fa-82ff-e0465f5e8703","24babf58-7156-4841-9a3f-761bdbb8e237","aca261d8-e145-4610-9e20-9eff990f2c12","0642fba6-5dcf-4d62-8e7b-94dbb529d117","25a863e8-dc42-4e8a-a357-e76422ace9b5","9538f37c-456e-4047-81be-6435045608d4","8c0f84c3-9afd-4396-b5f5-9bca2c911c20","be582e5d-b123-41a2-a150-454c39e961c8","c70141d4-ba06-41ea-bcbc-35ea81cb8335","7d1826f4-24c4-4aac-8c2e-eff45df37783","063c97d3-033a-4e9b-98d8-05c8074922cb","00000000-0000-0000-0000-000000000120"}; if (collision == sound)
const int COLLISION_SOUNDS_SIZE=29; return true;
return false;
// NaClAntiSpamQueueEntry
NACLAntiSpamQueueEntry::NACLAntiSpamQueueEntry()
{
entryTime=0;
entryAmount=0;
blocked=false;
} }
void NACLAntiSpamQueueEntry::clearEntry()
{
entryTime=0;
entryAmount=0;
blocked=false;
}
U32 NACLAntiSpamQueueEntry::getEntryAmount() const
{
return entryAmount;
}
U32 NACLAntiSpamQueueEntry::getEntryTime() const
{
return entryTime;
}
void NACLAntiSpamQueueEntry::updateEntryAmount()
{
entryAmount++;
}
void NACLAntiSpamQueueEntry::updateEntryTime()
{
entryTime=time(0);
}
void NACLAntiSpamQueueEntry::setBlocked()
{
blocked=true;
}
bool NACLAntiSpamQueueEntry::getBlocked() const
{
return blocked;
}
// NaClAntiSpamQueue
NACLAntiSpamQueue::NACLAntiSpamQueue(U32 time, U32 amount)
{
queueTime=time;
queueAmount=amount;
}
void NACLAntiSpamQueue::setAmount(U32 amount)
{
queueAmount=amount;
}
void NACLAntiSpamQueue::setTime(U32 time)
{
queueTime=time;
}
U32 NACLAntiSpamQueue::getAmount() const
{
return queueAmount;
}
U32 NACLAntiSpamQueue::getTime() const
{
return queueTime;
}
void NACLAntiSpamQueue::clearEntries()
{
for(it = entries.begin(); it != entries.end(); it++)
{
it->second->clearEntry();
}
}
void NACLAntiSpamQueue::purgeEntries()
{
for(it = entries.begin(); it != entries.end(); it++)
{
delete it->second;
}
entries.clear();
}
void NACLAntiSpamQueue::blockEntry(LLUUID& source)
{
it=entries.find(source.asString());
if(it == entries.end())
{
entries[source.asString()]=new NACLAntiSpamQueueEntry();
}
entries[source.asString()]->setBlocked();
}
int NACLAntiSpamQueue::checkEntry(LLUUID& name, U32 multiplier)
// Returns 0 if unblocked/disabled, 1 if check results in a new block, 2 if by an existing block
{
static LLCachedControl<bool> enabled(gSavedSettings,"AntiSpamEnabled",false);
if(!enabled) return 0;
it=entries.find(name.asString());
if(it != entries.end())
{
if(it->second->getBlocked()) return 2;
U32 eTime=it->second->getEntryTime();
U32 currentTime=time(0);
if((currentTime-eTime) <= queueTime)
{
it->second->updateEntryAmount();
U32 eAmount=it->second->getEntryAmount();
if(eAmount > (queueAmount*multiplier))
{
it->second->setBlocked();
return 1;
}
else
return 0;
}
else
{
it->second->clearEntry();
it->second->updateEntryAmount();
it->second->updateEntryTime();
return 0;
}
}
else
{
//LL_DEBUGS() << "[antispam] New queue entry:" << name.asString() << LL_ENDL;
entries[name.asString()]=new NACLAntiSpamQueueEntry();
entries[name.asString()]->updateEntryAmount();
entries[name.asString()]->updateEntryTime();
return 0;
}
}
// NaClAntiSpamRegistry // NaClAntiSpamRegistry
static const char* QUEUE_NAME[NACLAntiSpamRegistry::QUEUE_MAX] = { constexpr std::array<const char*, NACLAntiSpamRegistry::QUEUE_MAX> QUEUE_NAME = {
"Chat", "Chat",
"Inventory", "Inventory",
"Instant Message", "Instant Message",
"calling card", "calling card",
"sound", "sound",
"Sound Preload", "Sound Preload",
"Script Dialog", "Script Dialog",
"Teleport"}; "Teleport"
};
NACLAntiSpamRegistry::NACLAntiSpamRegistry(U32 time, U32 amount) NACLAntiSpamRegistry::NACLAntiSpamRegistry()
{ {
globalTime=time; auto control = gSavedSettings.getControl("_NACL_AntiSpamTime");
globalAmount=amount; const U32 time = control->get().asInteger();
static LLCachedControl<bool> _NACL_AntiSpamGlobalQueue(gSavedSettings,"_NACL_AntiSpamGlobalQueue"); mConnections[0] = control->getSignal()->connect(boost::bind(&NACLAntiSpamRegistry::handleNaclAntiSpamTimeChanged, _2));
bGlobalQueue=_NACL_AntiSpamGlobalQueue;
for(int queue = 0; queue < QUEUE_MAX; ++queue) control = gSavedSettings.getControl("_NACL_AntiSpamAmount");
const U32 amount = control->get().asInteger();
mConnections[1] = control->getSignal()->connect(boost::bind(&NACLAntiSpamRegistry::handleNaclAntiSpamAmountChanged, _2));
control = gSavedSettings.getControl("_NACL_AntiSpamGlobalQueue");
mConnections[2] = control->getSignal()->connect(boost::bind(&NACLAntiSpamRegistry::handleNaclAntiSpamGlobalQueueChanged, _2));
initializeQueues(control->get(), time, amount);
}
void NACLAntiSpamRegistry::initializeQueues(bool global, const U32& time, const U32& amount)
{
if (global) // If Global, initialize global queue
mGlobalQueue.reset(new NACLAntiSpamQueue(time, amount));
else
{ {
queues[queue] = new NACLAntiSpamQueue(time,amount); mQueues.reset(new std::array<NACLAntiSpamQueue, QUEUE_MAX>{{
NACLAntiSpamQueue(time, amount), // QUEUE_CHAT
NACLAntiSpamQueue(time, amount), // QUEUE_INVENTORY
NACLAntiSpamQueue(time, amount), // QUEUE_IM
NACLAntiSpamQueue(time, amount), // QUEUE_CALLING_CARD
NACLAntiSpamQueue(time, amount), // QUEUE_SOUND
NACLAntiSpamQueue(time, amount), // QUEUE_SOUND_PRELOAD
NACLAntiSpamQueue(time, amount), // QUEUE_SCRIPT_DIALOG
NACLAntiSpamQueue(time, amount) // QUEUE_TELEPORT
}});
} }
} }
//static
const char* NACLAntiSpamRegistry::getQueueName(U32 queue_id) constexpr const char* getQueueName(const NACLAntiSpamRegistry::Type& name)
{ {
if(queue_id >= QUEUE_MAX) return name >= QUEUE_NAME.size() ? "Unknown" : QUEUE_NAME[name];
return "Unknown";
return QUEUE_NAME[queue_id];
} }
//static
void NACLAntiSpamRegistry::registerQueues(U32 time, U32 amount)
{
globalTime=time;
globalAmount=amount;
static LLCachedControl<bool> _NACL_AntiSpamGlobalQueue(gSavedSettings,"_NACL_AntiSpamGlobalQueue");
bGlobalQueue=_NACL_AntiSpamGlobalQueue;
for(int queue = 0; queue < QUEUE_MAX; ++queue)
{
queues[queue] = new NACLAntiSpamQueue(time,amount);
}
}
//static
/*void NACLAntiSpamRegistry::registerQueue(U32 name, U32 time, U32 amount)
{
it=queues.find(name);
if(it == queues.end())
{
queues[name]=new NACLAntiSpamQueue(time,amount);
}
}*/
//static
void NACLAntiSpamRegistry::setRegisteredQueueTime(U32 name, U32 time)
{
if(name >= QUEUE_MAX || queues[name] == 0)
{
LL_ERRS("AntiSpam") << "CODE BUG: Attempting to set time of antispam queue that was outside of the reasonable range of queues or not created. Queue: " << getQueueName(name) << LL_ENDL;
return;
}
queues[name]->setTime(time);
}
//static
void NACLAntiSpamRegistry::setRegisteredQueueAmount(U32 name, U32 amount)
{
if(name >= QUEUE_MAX || queues[name] == 0)
{
LL_ERRS("AntiSpam") << "CODE BUG: Attempting to set amount for antispam queue that was outside of the reasonable range of queues or not created. Queue: " << getQueueName(name) << LL_ENDL;
return;
}
queues[name]->setAmount(amount);
}
//static
void NACLAntiSpamRegistry::setAllQueueTimes(U32 time) void NACLAntiSpamRegistry::setAllQueueTimes(U32 time)
{ {
globalTime=time; if (mGlobalQueue) mGlobalQueue->setTime(time);
for(int queue = 0; queue < QUEUE_MAX; ++queue) else for(auto& queue : *mQueues) queue.setTime(time);
if( queues[queue] )
queues[queue]->setTime(time);
} }
//static
void NACLAntiSpamRegistry::setAllQueueAmounts(U32 amount) void NACLAntiSpamRegistry::setAllQueueAmounts(U32 amount)
{ {
globalAmount=amount; if (mGlobalQueue) mGlobalQueue->setAmount(amount);
for(int queue = 0; queue < QUEUE_MAX; ++queue) else for (U8 queue = 0U; queue < QUEUE_MAX; ++queue)
{ {
if(!queues[queue]) continue; auto& q = (*mQueues)[queue];
if(queue == QUEUE_SOUND || queue == QUEUE_SOUND_PRELOAD) if (queue == QUEUE_SOUND || queue == QUEUE_SOUND_PRELOAD)
queues[queue]->setAmount(amount*5); q.setAmount(amount*5);
else else
queues[queue]->setAmount(amount); q.setAmount(amount);
} }
} }
//static
void NACLAntiSpamRegistry::clearRegisteredQueue(U32 name) void NACLAntiSpamRegistry::blockOnQueue(const Type& name, const LLUUID& source)
{ {
if(name >= QUEUE_MAX || queues[name] == 0) if (name >= QUEUE_MAX)
{ LL_ERRS("AntiSpam") << "CODE BUG: Attempting to use a antispam queue that was outside of the reasonable range of queues. Queue: " << getQueueName(name) << LL_ENDL;
LL_ERRS("AntiSpam") << "CODE BUG: Attempting to clear antispam queue that was outside of the reasonable range of queues or not created. Queue: " << getQueueName(name) << LL_ENDL; else (mGlobalQueue ? *mGlobalQueue : (*mQueues)[name]).block(source);
return;
}
queues[name]->clearEntries();
} }
//static
void NACLAntiSpamRegistry::purgeRegisteredQueue(U32 name) bool NACLAntiSpamRegistry::checkQueue(const Type& name, const LLUUID& source, const LFIDBearer::Type& type, const U32& multiplier)
{
if(name >= QUEUE_MAX || queues[name] == 0)
{
LL_ERRS("AntiSpam") << "CODE BUG: Attempting to purge antispam queue that was outside of the reasonable range of queues or not created. Queue: " << getQueueName(name) << LL_ENDL;
return;
}
queues[name]->purgeEntries();
}
//static
void NACLAntiSpamRegistry::blockOnQueue(U32 name, LLUUID& source)
{
if(bGlobalQueue)
{
NACLAntiSpamRegistry::blockGlobalEntry(source);
}
else
{
if(name >= QUEUE_MAX || queues[name] == 0)
{
LL_ERRS("AntiSpam") << "CODE BUG: Attempting to use a antispam queue that was outside of the reasonable range of queues or not created. Queue: " << getQueueName(name) << LL_ENDL;
return;
}
queues[name]->blockEntry(source);
}
}
//static
void NACLAntiSpamRegistry::blockGlobalEntry(LLUUID& source)
{
it2=globalEntries.find(source.asString());
if(it2 == globalEntries.end())
{
globalEntries[source.asString()]=new NACLAntiSpamQueueEntry();
}
globalEntries[source.asString()]->setBlocked();
}
//static
bool NACLAntiSpamRegistry::checkQueue(U32 name, LLUUID& source, U32 multiplier)
//returns true if blocked //returns true if blocked
{ {
if (name >= QUEUE_MAX)
{
LL_ERRS("AntiSpam") << "CODE BUG: Attempting to check antispam queue that was outside of the reasonable range of queues. Queue: " << getQueueName(name) << LL_ENDL;
return false;
}
if (!can_block(source)) return false; if (!can_block(source)) return false;
int result; auto& queue = mGlobalQueue ? *mGlobalQueue : (*mQueues)[name];
if(bGlobalQueue) const auto result = queue.check(source, multiplier);
if (!result) return false; // Safe
if (result != 2 // Not previously blocked
&& gSavedSettings.getBOOL("AntiSpamNotify")) // and Just blocked!
{ {
result=NACLAntiSpamRegistry::checkGlobalEntry(source,multiplier); const std::string get_slurl_for(const LLUUID& id, const LFIDBearer::Type& type);
} const auto slurl = get_slurl_for(source, type);
else LLSD args;
{ args["SOURCE"] = slurl.empty() ? source.asString() : slurl;
if(name >= QUEUE_MAX || queues[name] == 0) args["TYPE"] = LLTrans::getString(getQueueName(name));
{ args["AMOUNT"] = (LLSD::Integer)(multiplier * queue.getAmount());
LL_ERRS("AntiSpam") << "CODE BUG: Attempting to check antispam queue that was outside of the reasonable range of queues or not created. Queue: " << getQueueName(name) << LL_ENDL; args["TIME"] = (LLSD::Integer)queue.getTime();
return false; LLNotificationsUtil::add("AntiSpamBlock", args);
}
result=queues[name]->checkEntry(source,multiplier);
}
if(result == 0) //Safe
return false;
else if(result == 2) //Previously blocked
{
return true;
}
else //Just blocked!
{
if(gSavedSettings.getBOOL("AntiSpamNotify"))
{
LLSD args;
args["SOURCE"] = source.asString().c_str();
args["TYPE"] = LLTrans::getString(getQueueName(name));
args["AMOUNT"] = boost::lexical_cast<std::string>(multiplier * queues[name]->getAmount());
args["TIME"] = boost::lexical_cast<std::string>(queues[name]->getTime());
LLNotificationsUtil::add("AntiSpamBlock", args);
}
return true;
} }
return true;
} }
// Global queue stoof void NACLAntiSpamRegistry::idle()
//static
void NACLAntiSpamRegistry::setGlobalQueue(bool value)
{ {
NACLAntiSpamRegistry::purgeAllQueues(); if (mGlobalQueue) mGlobalQueue->idle();
bGlobalQueue=value; else for (auto& queue : *mQueues) queue.idle();
} }
//static
void NACLAntiSpamRegistry::setGlobalAmount(U32 amount) void NACLAntiSpamRegistry::resetQueues()
{ {
globalAmount=amount; if (mGlobalQueue) mGlobalQueue->reset();
else for (auto& queue : *mQueues) queue.reset();
LL_INFOS() << "AntiSpam Queues Reset" << LL_ENDL;
} }
//static
void NACLAntiSpamRegistry::setGlobalTime(U32 time)
{
globalTime=time;
}
//static
void NACLAntiSpamRegistry::clearAllQueues()
{
if(bGlobalQueue)
NACLAntiSpamRegistry::clearGlobalEntries();
else
for(int queue = 0; queue < QUEUE_MAX; ++queue)
{
if(queues[queue]) queues[queue]->clearEntries();
}
}
//static
void NACLAntiSpamRegistry::purgeAllQueues() void NACLAntiSpamRegistry::purgeAllQueues()
{ {
if(bGlobalQueue) // Note: These resets are upon the unique_ptr, not the Queue itself!
NACLAntiSpamRegistry::purgeGlobalEntries(); if (mGlobalQueue)
mGlobalQueue.reset();
else else
for(int queue = 0; queue < QUEUE_MAX; ++queue) mQueues.reset();
{
if(queues[queue]) queues[queue]->purgeEntries();
}
LL_INFOS() << "AntiSpam Queues Purged" << LL_ENDL;
}
//static
int NACLAntiSpamRegistry::checkGlobalEntry(LLUUID& name, U32 multiplier)
{
static LLCachedControl<bool> enabled(gSavedSettings,"AntiSpamEnabled",false);
if(!enabled) return 0;
it2=globalEntries.find(name.asString());
if(it2 != globalEntries.end())
{
if(it2->second->getBlocked()) return 2;
U32 eTime=it2->second->getEntryTime();
U32 currentTime=time(0);
if((currentTime-eTime) <= globalTime)
{
it2->second->updateEntryAmount();
U32 eAmount=it2->second->getEntryAmount();
if(eAmount > (globalAmount*multiplier))
return 1;
else
return 0;
}
else
{
it2->second->clearEntry();
it2->second->updateEntryAmount();
it2->second->updateEntryTime();
return 0;
}
}
else
{
globalEntries[name.asString()]=new NACLAntiSpamQueueEntry();
globalEntries[name.asString()]->updateEntryAmount();
globalEntries[name.asString()]->updateEntryTime();
return 0;
}
}
//static
void NACLAntiSpamRegistry::clearGlobalEntries()
{
for(it2 = globalEntries.begin(); it2 != globalEntries.end(); it2++)
{
it2->second->clearEntry();
}
}
//static
void NACLAntiSpamRegistry::purgeGlobalEntries()
{
for(it2 = globalEntries.begin(); it2 != globalEntries.end(); it2++)
{
delete it2->second;
it2->second = 0;
}
globalEntries.clear();
} }
//Handlers // Handlers
//static // static
void NACLAntiSpamRegistry::startup()
{
auto onAntiSpamToggle = [](const LLControlVariable*, const LLSD& value) {
if (value.asBoolean()) instance();
else deleteSingleton();
};
auto control = gSavedSettings.getControl("AntiSpamEnabled");
control->getSignal()->connect(onAntiSpamToggle);
onAntiSpamToggle(control, control->get());
}
// static
bool NACLAntiSpamRegistry::handleNaclAntiSpamGlobalQueueChanged(const LLSD& newvalue) bool NACLAntiSpamRegistry::handleNaclAntiSpamGlobalQueueChanged(const LLSD& newvalue)
{ {
setGlobalQueue(newvalue.asBoolean()); if (instanceExists())
{
auto& inst = instance();
inst.purgeAllQueues();
inst.initializeQueues(newvalue.asBoolean(), gSavedSettings.getU32("_NACL_AntiSpamTime"), gSavedSettings.getU32("_NACL_AntiSpamAmount"));
}
return true; return true;
} }
//static //static
bool NACLAntiSpamRegistry::handleNaclAntiSpamTimeChanged(const LLSD& newvalue) bool NACLAntiSpamRegistry::handleNaclAntiSpamTimeChanged(const LLSD& newvalue)
{ {
setAllQueueTimes(newvalue.asInteger()); if (auto inst = getIfExists()) inst->setAllQueueTimes(newvalue.asInteger());
return true; return true;
} }
//static //static
bool NACLAntiSpamRegistry::handleNaclAntiSpamAmountChanged(const LLSD& newvalue) bool NACLAntiSpamRegistry::handleNaclAntiSpamAmountChanged(const LLSD& newvalue)
{ {
setAllQueueAmounts(newvalue.asInteger()); if (auto inst = getIfExists()) inst->setAllQueueAmounts(newvalue.asInteger());
return true; return true;
} }

View File

@@ -13,72 +13,22 @@
* 0. You just DO WHAT THE FUCK YOU WANT TO. * 0. You just DO WHAT THE FUCK YOU WANT TO.
*/ */
#ifndef NACLANTISPAM_H #pragma once
#define NACLANTISPAM_H #include <boost/signals2/connection.hpp>
#include <boost/unordered/unordered_map.hpp> #include <boost/unordered/unordered_map.hpp>
#include "stdtypes.h" #include "stdtypes.h"
#include "lfidbearer.h"
#include "lluuid.h" #include "lluuid.h"
class NACLAntiSpamQueueEntry
class NACLAntiSpamQueue;
class NACLAntiSpamRegistry final : public LLSingleton<NACLAntiSpamRegistry>
{ {
friend class NACLAntiSpamQueue; friend class LLSingleton<NACLAntiSpamRegistry>;
friend class NACLAntiSpamRegistry; NACLAntiSpamRegistry();
protected:
NACLAntiSpamQueueEntry();
void clearEntry();
U32 getEntryAmount() const;
U32 getEntryTime() const;
void updateEntryAmount();
void updateEntryTime();
bool getBlocked() const;
void setBlocked();
private:
U32 entryAmount;
U32 entryTime;
bool blocked;
};
class NACLAntiSpamQueue
{
friend class NACLAntiSpamRegistry;
public: public:
U32 getAmount() const; static void startup();
U32 getTime() const;
protected: enum Type : U8 {
NACLAntiSpamQueue(U32 time, U32 amount);
void setAmount(U32 amount);
void setTime(U32 time);
void clearEntries();
void purgeEntries();
void blockEntry(LLUUID& source);
int checkEntry(LLUUID& source, U32 multiplier);
private:
boost::unordered_map<std::string,NACLAntiSpamQueueEntry*> entries;
boost::unordered_map<std::string,NACLAntiSpamQueueEntry*>::iterator it;
U32 queueAmount;
U32 queueTime;
};
class NACLAntiSpamRegistry
{
public:
NACLAntiSpamRegistry(U32 time=2, U32 amount=10);
static void registerQueues(U32 time=2, U32 amount=10);
// static void registerQueue(U32 name, U32 time, U32 amount);
static void setRegisteredQueueTime(U32 name, U32 time);
static void setRegisteredQueueAmount(U32 name,U32 amount);
static void setAllQueueTimes(U32 amount);
static void setAllQueueAmounts(U32 time);
static bool checkQueue(U32 name, LLUUID& source, U32 multiplier=1);
static bool handleNaclAntiSpamGlobalQueueChanged(const LLSD& newvalue);
static bool handleNaclAntiSpamTimeChanged(const LLSD& newvalue);
static bool handleNaclAntiSpamAmountChanged(const LLSD& newvalue);
static void clearRegisteredQueue(U32 name);
static void purgeRegisteredQueue(U32 name);
static void clearAllQueues();
static void purgeAllQueues();
static void setGlobalQueue(bool value);
static void setGlobalAmount(U32 amount);
static void setGlobalTime(U32 time);
static void blockOnQueue(U32 name,LLUUID& owner_id);
enum {
QUEUE_CHAT, QUEUE_CHAT,
QUEUE_INVENTORY, QUEUE_INVENTORY,
QUEUE_IM, QUEUE_IM,
@@ -89,22 +39,19 @@ public:
QUEUE_TELEPORT, QUEUE_TELEPORT,
QUEUE_MAX QUEUE_MAX
}; };
bool checkQueue(const Type& name, const LLUUID& source, const LFIDBearer::Type& type = LFIDBearer::AVATAR, const U32& multiplier = 1);
void blockOnQueue(const Type& name, const LLUUID& owner_id);
void idle();
void resetQueues();
private: private:
static const char* getQueueName(U32 queue_id); void setAllQueueTimes(U32 amount);
static NACLAntiSpamQueue* queues[QUEUE_MAX]; void setAllQueueAmounts(U32 time);
static boost::unordered_map<std::string,NACLAntiSpamQueueEntry*> globalEntries; void purgeAllQueues();
static boost::unordered_map<std::string,NACLAntiSpamQueueEntry*>::iterator it2; void initializeQueues(bool global, const U32& time, const U32& amount);
static U32 globalTime; static bool handleNaclAntiSpamGlobalQueueChanged(const LLSD& newvalue);
static U32 globalAmount; static bool handleNaclAntiSpamTimeChanged(const LLSD& newvalue);
static bool bGlobalQueue; static bool handleNaclAntiSpamAmountChanged(const LLSD& newvalue);
std::unique_ptr<std::array<NACLAntiSpamQueue, QUEUE_MAX>> mQueues;
static int checkGlobalEntry(LLUUID& source, U32 multiplier); std::unique_ptr<NACLAntiSpamQueue> mGlobalQueue;
static void clearGlobalEntries(); std::array<boost::signals2::scoped_connection, 3> mConnections;
static void purgeGlobalEntries();
static void blockGlobalEntry(LLUUID& source);
}; };
extern const std::string COLLISION_SOUNDS[];
extern const int COLLISION_SOUNDS_SIZE;
#endif //NACLANTISPAM_H

View File

@@ -1 +1 @@
1.8.7 1.8.9

View File

@@ -117,6 +117,9 @@ void ALFloaterRegionTracker::refresh()
{ {
saved_selected_values.push_back(item->getValue().asString()); saved_selected_values.push_back(item->getValue().asString());
} }
S32 saved_scroll_pos = mRegionScrollList->getScrollPos();
auto sort_column_name = mRegionScrollList->getSortColumnName();
auto sort_asending = mRegionScrollList->getSortAscending();
mRegionScrollList->deleteAllItems(); mRegionScrollList->deleteAllItems();
const std::string& cur_region_name = gAgent.getRegion()->getName(); const std::string& cur_region_name = gAgent.getRegion()->getName();
@@ -172,8 +175,11 @@ void ALFloaterRegionTracker::refresh()
mRegionScrollList->addRow(row); mRegionScrollList->addRow(row);
} }
} }
mRegionScrollList->sortByColumn(sort_column_name, sort_asending);
if (!saved_selected_values.empty()) if (!saved_selected_values.empty())
mRegionScrollList->selectMultiple(saved_selected_values); mRegionScrollList->selectMultiple(saved_selected_values);
mRegionScrollList->setScrollPos(saved_scroll_pos);
} }
BOOL ALFloaterRegionTracker::tick() BOOL ALFloaterRegionTracker::tick()

37
indra/newview/aostate.h Normal file
View 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
View 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
View 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);
};

View File

@@ -2,7 +2,7 @@
<array> <array>
<map> <map>
<key>default_grids_version</key><string>22</string> <key>default_grids_version</key><string>23</string>
</map> </map>
<!-- Second Life --> <!-- Second Life -->
@@ -11,7 +11,7 @@
<key>gridname</key><string>Second Life</string> <key>gridname</key><string>Second Life</string>
<key>platform</key><string>SecondLife</string> <key>platform</key><string>SecondLife</string>
<key>loginuri</key><string>https://login.agni.lindenlab.com/cgi-bin/login.cgi</string> <key>loginuri</key><string>https://login.agni.lindenlab.com/cgi-bin/login.cgi</string>
<key>loginpage</key><string>http://viewer-login.agni.lindenlab.com/</string> <key>loginpage</key><string>https://viewer-splash.secondlife.com/</string>
<key>helperuri</key><string>https://secondlife.com/helpers/</string> <key>helperuri</key><string>https://secondlife.com/helpers/</string>
<key>website</key><string>http://secondlife.com/</string> <key>website</key><string>http://secondlife.com/</string>
<key>support</key><string>http://secondlife.com/support/</string> <key>support</key><string>http://secondlife.com/support/</string>
@@ -26,7 +26,7 @@
<key>gridnick</key><string>secondlife_beta</string> <key>gridnick</key><string>secondlife_beta</string>
<key>gridname</key><string>Second Life BETA</string> <key>gridname</key><string>Second Life BETA</string>
<key>helperuri</key><string>http://aditi-secondlife.webdev.lindenlab.com/helpers/</string> <key>helperuri</key><string>http://aditi-secondlife.webdev.lindenlab.com/helpers/</string>
<key>loginpage</key><string>http://viewer-login.agni.lindenlab.com/</string> <key>loginpage</key><string>https://viewer-splash.secondlife.com/</string>
<key>loginuri</key><string>https://login.aditi.lindenlab.com/cgi-bin/login.cgi</string> <key>loginuri</key><string>https://login.aditi.lindenlab.com/cgi-bin/login.cgi</string>
<key>password</key><string>http://secondlife.com/account/request.php</string> <key>password</key><string>http://secondlife.com/account/request.php</string>
<key>platform</key><string>SecondLife</string> <key>platform</key><string>SecondLife</string>

View File

@@ -133,6 +133,17 @@
media_plugin_libvlc media_plugin_libvlc
</impl> </impl>
</scheme> </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"> <scheme name="libvlc">
<label name="libvlc_label"> <label name="libvlc_label">
LibVLC supported media LibVLC supported media
@@ -474,8 +485,8 @@
media_plugin_libvlc media_plugin_libvlc
</impl> </impl>
</mimetype> </mimetype>
<mimetype menu="1" name="video/libvlc"> <mimetype menu="1" name="video/quicktime">
<label name="video/libvlc_label"> <label name="video/quicktime_label">
Movie (QuickTime) Movie (QuickTime)
</label> </label>
<widgettype> <widgettype>
@@ -515,7 +526,7 @@
movie movie
</widgettype> </widgettype>
<impl> <impl>
media_plugin_cef media_plugin_libvlc
</impl> </impl>
</mimetype> </mimetype>
</mimetypes> </mimetypes>

View File

@@ -497,6 +497,19 @@
<key>IsCOA</key> <key>IsCOA</key>
<integer>1</integer> <integer>1</integer>
</map> </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> <key>AONoStandsInMouselook</key>
<map> <map>
<key>Comment</key> <key>Comment</key>
@@ -2556,6 +2569,17 @@ This should be as low as possible, but too low may break functionality</string>
<integer>1</integer> <integer>1</integer>
</map> </map>
<!-- Standard SL options (To my knowledge) --> <!-- Standard SL options (To my knowledge) -->
<key>CrashHostUrl</key>
<map>
<key>Comment</key>
<string>A URL pointing to a crash report handler; overrides cluster negotiation to locate crash handler.</string>
<key>Persist</key>
<integer>1</integer>
<key>Type</key>
<string>String</string>
<key>Value</key>
<string />
</map>
<key>AFKTimeout</key> <key>AFKTimeout</key>
<map> <map>
<key>Comment</key> <key>Comment</key>
@@ -11736,28 +11760,6 @@ This should be as low as possible, but too low may break functionality</string>
<key>Value</key> <key>Value</key>
<real>0.34999999404</real> <real>0.34999999404</real>
</map> </map>
<key>RevokePermsOnStandUp</key>
<map>
<key>Comment</key>
<string>When enabled, revokes any permission granted to an object you don't own and from which your avatar is standing up</string>
<key>Persist</key>
<integer>1</integer>
<key>Type</key>
<string>Boolean</string>
<key>Value</key>
<integer>0</integer>
</map>
<key>PickerContextOpacity</key>
<map>
<key>Comment</key>
<string>Controls overall opacity of context frustrum connecting color and texture pickers with their swatches</string>
<key>Persist</key>
<integer>1</integer>
<key>Type</key>
<string>F32</string>
<key>Value</key>
<real>0.34999999404</real>
</map>
<key>PicksPerSecondMouseMoving</key> <key>PicksPerSecondMouseMoving</key>
<map> <map>
<key>Comment</key> <key>Comment</key>
@@ -12626,6 +12628,18 @@ This should be as low as possible, but too low may break functionality</string>
<integer>128</integer> <integer>128</integer>
</map> </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> <key>OctreeReserveNodeCapacity</key>
<map> <map>
<key>Comment</key> <key>Comment</key>
@@ -14638,6 +14652,17 @@ This should be as low as possible, but too low may break functionality</string>
<key>Value</key> <key>Value</key>
<integer>1</integer> <integer>1</integer>
</map> </map>
<key>RevokePermsOnStandUp</key>
<map>
<key>Comment</key>
<string>When enabled, revokes any permission granted to an object you don't own and from which your avatar is standing up</string>
<key>Persist</key>
<integer>1</integer>
<key>Type</key>
<string>Boolean</string>
<key>Value</key>
<integer>0</integer>
</map>
<key>RevokePermsOnStopAnimation</key> <key>RevokePermsOnStopAnimation</key>
<map> <map>
<key>Comment</key> <key>Comment</key>

View File

@@ -984,6 +984,17 @@ RIP Latif Khalifa.</string>
<key>Value</key> <key>Value</key>
<boolean>1</boolean> <boolean>1</boolean>
</map> </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> <key>SinguPostProcessDefault</key>
<map> <map>
<key>Comment</key> <key>Comment</key>
@@ -1175,6 +1186,17 @@ Changing this setting only affects new text.</string>
<key>Value</key> <key>Value</key>
<integer>1</integer> <integer>1</integer>
</map> </map>
<key>LiruUseMarkedColor</key>
<map>
<key>Comment</key>
<string>Whether or not to use the color of marks done on radar and minimap to color tags and chat from those individuals</string>
<key>Persist</key>
<integer>1</integer>
<key>Type</key>
<string>Boolean</string>
<key>Value</key>
<integer>1</integer>
</map>
<key>OBJExportNotifyFailed</key> <key>OBJExportNotifyFailed</key>
<map> <map>
<key>Comment</key> <key>Comment</key>
@@ -1643,6 +1665,8 @@ Changing this setting only affects new text.</string>
<string>Boolean</string> <string>Boolean</string>
<key>Value</key> <key>Value</key>
<boolean>0</boolean> <boolean>0</boolean>
<key>IsCOA</key>
<integer>1</integer>
</map> </map>
<key>ToolbarVisibleFastTimers</key> <key>ToolbarVisibleFastTimers</key>
<map> <map>

View File

@@ -70,7 +70,10 @@ LLPrefsAscentChat::LLPrefsAscentChat()
} }
childSetEnabled("reset_antispam", started); childSetEnabled("reset_antispam", started);
getChild<LLUICtrl>("reset_antispam")->setCommitCallback(boost::bind(NACLAntiSpamRegistry::purgeAllQueues)); getChild<LLUICtrl>("reset_antispam")->setCommitCallback([](LLUICtrl* ctrl, const LLSD& param) {
if (auto inst = NACLAntiSpamRegistry::getIfExists())
inst->resetQueues();
});
getChild<LLUICtrl>("autoreplace")->setCommitCallback(boost::bind(LLFloaterAutoReplaceSettings::showInstance, LLSD())); getChild<LLUICtrl>("autoreplace")->setCommitCallback(boost::bind(LLFloaterAutoReplaceSettings::showInstance, LLSD()));
getChild<LLUICtrl>("KeywordsOn")->setCommitCallback(boost::bind(&LLPrefsAscentChat::onCommitKeywords, this, _1)); getChild<LLUICtrl>("KeywordsOn")->setCommitCallback(boost::bind(&LLPrefsAscentChat::onCommitKeywords, this, _1));

View File

@@ -207,6 +207,7 @@ void LLPrefsAscentSys::refreshValues()
mDisplayScriptJumps = gSavedSettings.getBOOL("AscentDisplayTotalScriptJumps"); mDisplayScriptJumps = gSavedSettings.getBOOL("AscentDisplayTotalScriptJumps");
mNumScriptDiff = gSavedSettings.getF32("Ascentnumscriptdiff"); mNumScriptDiff = gSavedSettings.getF32("Ascentnumscriptdiff");
mReplaceLinks = gSavedSettings.getBOOL("SinguReplaceLinks"); mReplaceLinks = gSavedSettings.getBOOL("SinguReplaceLinks");
mEmergencySeconds = gSavedPerAccountSettings.getU32("EmergencyTeleportSeconds");
mLandmark = gSavedPerAccountSettings.getString("EmergencyTeleportLandmark"); mLandmark = gSavedPerAccountSettings.getString("EmergencyTeleportLandmark");
mLandmarkBackup = gSavedPerAccountSettings.getString("EmergencyTeleportLandmarkBackup"); mLandmarkBackup = gSavedPerAccountSettings.getString("EmergencyTeleportLandmarkBackup");
@@ -353,6 +354,7 @@ void LLPrefsAscentSys::cancel()
gSavedSettings.setBOOL("AscentDisplayTotalScriptJumps", mDisplayScriptJumps); gSavedSettings.setBOOL("AscentDisplayTotalScriptJumps", mDisplayScriptJumps);
gSavedSettings.setF32("Ascentnumscriptdiff", mNumScriptDiff); gSavedSettings.setF32("Ascentnumscriptdiff", mNumScriptDiff);
gSavedSettings.setBOOL("SinguReplaceLinks", mReplaceLinks); gSavedSettings.setBOOL("SinguReplaceLinks", mReplaceLinks);
gSavedPerAccountSettings.setU32("EmergencyTeleportSeconds", mEmergencySeconds);
gSavedPerAccountSettings.setString("EmergencyTeleportLandmark", mLandmark); gSavedPerAccountSettings.setString("EmergencyTeleportLandmark", mLandmark);
gSavedPerAccountSettings.setString("EmergencyTeleportLandmarkBackup", mLandmarkBackup); gSavedPerAccountSettings.setString("EmergencyTeleportLandmarkBackup", mLandmarkBackup);

View File

@@ -118,6 +118,7 @@ private:
bool mDisplayScriptJumps; bool mDisplayScriptJumps;
bool mReplaceLinks; bool mReplaceLinks;
F32 mNumScriptDiff; F32 mNumScriptDiff;
U32 mEmergencySeconds;
std::string mLandmark; std::string mLandmark;
std::string mLandmarkBackup; std::string mLandmarkBackup;

File diff suppressed because it is too large Load Diff

View File

@@ -1,134 +1,30 @@
#pragma once
#ifndef LL_LLFLOATERAO_H #include "aostate.h"
#define LL_LLFLOATERAO_H
#include "llfloater.h" #include "llfloater.h"
#include "llviewercontrol.h"
#include "llagent.h"
#include "lleventtimer.h"
class LLFloaterAO final : public LLFloater, public LLFloaterSingleton<LLFloaterAO>
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>
{ {
friend class AOSystem;
public: public:
LLFloaterAO(const LLSD&); LLFloaterAO(const LLSD&);
BOOL postBuild() override; BOOL postBuild() override;
void onOpen() override; void onOpen() override;
virtual ~LLFloaterAO(); virtual ~LLFloaterAO();
static void init();
static void run();
void updateLayout(bool advanced); 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: private:
void onSpinnerCommit() const;
static AOState mAnimationState; void onComboBoxCommit(LLUICtrl* ctrl) const;
static LLUUID mCurrentStandId; std::array<class LLComboBox*, STATE_AGENT_END> mCombos;
static void onSpinnerCommit();
static void onComboBoxCommit(LLUICtrl* ctrl);
protected: protected:
static AOState getStateFromCombo(const class LLComboBox* combo); LLComboBox* getComboFromState(const U8& state) const { return mCombos[state]; }
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);
}; };
extern AOInvTimer* gAOInvTimer;
#endif

View File

@@ -8,7 +8,6 @@
#include <stdtypes.h> #include <stdtypes.h>
#include <lldir.h> #include <lldir.h>
#include <lleconomy.h>
#include <llerror.h> #include <llerror.h>
#include <llfile.h> #include <llfile.h>
#include <llhttpclient.h> #include <llhttpclient.h>
@@ -59,7 +58,6 @@ HippoGridInfo::HippoGridInfo(const std::string& gridName) :
mRenderCompat(true), mRenderCompat(true),
mAutoUpdate(false), mAutoUpdate(false),
mLocked(false), mLocked(false),
mMaxAgentGroups(-1),
mCurrencySymbol("OS$"), mCurrencySymbol("OS$"),
mCurrencyText("OS Dollars"), mCurrencyText("OS Dollars"),
mRealCurrencySymbol("US$"), mRealCurrencySymbol("US$"),
@@ -414,37 +412,22 @@ void HippoGridInfo::getGridInfo()
XML_ParserFree(parser); 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 HippoGridInfo::getDirectoryFee() const
{ {
std::string fee; std::string fee = formatFee(mDirectoryFee, true);
formatFee(fee, mDirectoryFee, true);
if (mDirectoryFee != 0) fee += "/" + LLTrans::getString("hippo_label_week"); if (mDirectoryFee != 0) fee += "/" + LLTrans::getString("hippo_label_week");
return fee; 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 else
{ {
fee = llformat("%s%d", getCurrencySymbol().c_str(), cost); return llformat("%s%d", getCurrencySymbol().c_str(), cost);
} }
} }

View File

@@ -56,15 +56,13 @@ public:
const std::string& getVoiceConnector() const { return mVoiceConnector; } const std::string& getVoiceConnector() const { return mVoiceConnector; }
bool isRenderCompat() const { return mRenderCompat; } bool isRenderCompat() const { return mRenderCompat; }
std::string getGridNick() const; std::string getGridNick() const;
int getMaxAgentGroups() const { return mMaxAgentGroups; }
const std::string& getCurrencySymbol() const { return mCurrencySymbol; } const std::string& getCurrencySymbol() const { return mCurrencySymbol; }
const std::string& getCurrencyText() const { return mCurrencyText; } const std::string& getCurrencyText() const { return mCurrencyText; }
const std::string& getRealCurrencySymbol() const { return mRealCurrencySymbol; } const std::string& getRealCurrencySymbol() const { return mRealCurrencySymbol; }
std::string getUploadFee() const;
std::string getGroupCreationFee() const;
const int& getClassifiedFee() const { return mClassifiedFee; } const int& getClassifiedFee() const { return mClassifiedFee; }
std::string getDirectoryFee() const; std::string getDirectoryFee() const;
std::string formatFee(S32 cost, bool showFree = true) const;
void setPlatform (const std::string& platform); void setPlatform (const std::string& platform);
void setPlatform (Platform platform); void setPlatform (Platform platform);
@@ -82,7 +80,6 @@ public:
void setSearchUrl(const std::string& url); void setSearchUrl(const std::string& url);
void setGridMessage(const std::string& message); void setGridMessage(const std::string& message);
void setRenderCompat(bool compat); void setRenderCompat(bool compat);
void setMaxAgentGroups(int max) { mMaxAgentGroups = max; }
void setVoiceConnector(const std::string& vc) { mVoiceConnector = vc; } void setVoiceConnector(const std::string& vc) { mVoiceConnector = vc; }
void setUPCSupported(bool on); void setUPCSupported(bool on);
bool getUPCSupported(); bool getUPCSupported();
@@ -123,7 +120,6 @@ private:
bool mAutoUpdate; bool mAutoUpdate;
bool mLocked; bool mLocked;
bool mUPCSupported; bool mUPCSupported;
int mMaxAgentGroups;
std::string mCurrencySymbol; std::string mCurrencySymbol;
std::string mCurrencyText; std::string mCurrencyText;
@@ -143,7 +139,6 @@ private:
static std::string sanitizeUri(std::string const& uri_in); static std::string sanitizeUri(std::string const& uri_in);
void useHttps(void); 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 onXmlElementStart(void* userData, const XML_Char* name, const XML_Char** atts);
static void onXmlElementEnd(void* userData, const XML_Char* name); static void onXmlElementEnd(void* userData, const XML_Char* name);

View File

@@ -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() void HippoLimits::setOpenSimLimits()
{ {
setMaxAgentGroups();
mMaxPrimScale = 8192.0f; mMaxPrimScale = 8192.0f;
mMaxHeight = 10000.0f; mMaxHeight = 10000.0f;
mMinPrimScale = 0.001f; mMinPrimScale = 0.001f;
@@ -67,7 +46,6 @@ void HippoLimits::setOpenSimLimits()
void HippoLimits::setWhiteCoreLimits() void HippoLimits::setWhiteCoreLimits()
{ {
setMaxAgentGroups();
mMaxPrimScale = 8192.0f; mMaxPrimScale = 8192.0f;
mMinPrimScale = 0.001f; mMinPrimScale = 0.001f;
mMaxHeight = 10000.0f; mMaxHeight = 10000.0f;
@@ -78,7 +56,6 @@ void HippoLimits::setWhiteCoreLimits()
void HippoLimits::setSecondLifeLimits() void HippoLimits::setSecondLifeLimits()
{ {
LL_INFOS() << "Using Second Life limits." << LL_ENDL; LL_INFOS() << "Using Second Life limits." << LL_ENDL;
setMaxAgentGroups();
mMinPrimScale = 0.01f; mMinPrimScale = 0.01f;
mMaxHeight = 4096.0f; mMaxHeight = 4096.0f;

View File

@@ -8,7 +8,6 @@ class HippoLimits
public: public:
HippoLimits(); HippoLimits();
int getMaxAgentGroups() const { return mMaxAgentGroups; }
float getMaxHeight() const { return mMaxHeight; } float getMaxHeight() const { return mMaxHeight; }
float getMinHoleSize() const { return mMinHoleSize; } float getMinHoleSize() const { return mMinHoleSize; }
float getMaxHollow() const { return mMaxHollow; } float getMaxHollow() const { return mMaxHollow; }
@@ -18,14 +17,12 @@ public:
void setLimits(); void setLimits();
private: private:
int mMaxAgentGroups;
float mMaxHeight; float mMaxHeight;
float mMinHoleSize; float mMinHoleSize;
float mMaxHollow; float mMaxHollow;
float mMaxPrimScale; float mMaxPrimScale;
float mMinPrimScale; float mMinPrimScale;
void setMaxAgentGroups();
void setOpenSimLimits(); void setOpenSimLimits();
void setWhiteCoreLimits(); void setWhiteCoreLimits();
void setSecondLifeLimits(); void setSecondLifeLimits();

View File

@@ -17,7 +17,7 @@
//#include "llsdserialize.h" //#include "llsdserialize.h"
#include "lltooldraganddrop.h" #include "lltooldraganddrop.h"
//#include "llassetuploadresponders.h" //#include "llassetuploadresponders.h"
//#include "lleconomy.h" //#include "llagentbenefits.h"
//#include "llfloaterperms.h" //#include "llfloaterperms.h"
@@ -635,7 +635,7 @@ void ImportTracker::send_inventory(LLSD& prim)
body["next_owner_mask"] = LLSD::Integer(U32_MAX); body["next_owner_mask"] = LLSD::Integer(U32_MAX);
body["group_mask"] = LLSD::Integer(U32_MAX); body["group_mask"] = LLSD::Integer(U32_MAX);
body["everyone_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()); //cmdline_printchat("posting "+ data->assetid.asString());
LLHTTPClient::post(url, body, new JCImportInventoryResponder(body, data->assetid, data->type,data)); LLHTTPClient::post(url, body, new JCImportInventoryResponder(body, data->assetid, data->type,data));
//error = TRUE; //error = TRUE;

View File

@@ -194,7 +194,7 @@
VIAddVersionKey /LANG=${LANG_ENGLISH} "ProductName" "Singularity Viewer Installer" VIAddVersionKey /LANG=${LANG_ENGLISH} "ProductName" "Singularity Viewer Installer"
VIAddVersionKey /LANG=${LANG_ENGLISH} "Comments" "A viewer for the meta-verse!" VIAddVersionKey /LANG=${LANG_ENGLISH} "Comments" "A viewer for the meta-verse!"
VIAddVersionKey /LANG=${LANG_ENGLISH} "CompanyName" "${VENDORSTR}" VIAddVersionKey /LANG=${LANG_ENGLISH} "CompanyName" "${VENDORSTR}"
VIAddVersionKey /LANG=${LANG_ENGLISH} "LegalCopyright" "Copyright © 2010-2019, ${VENDORSTR}" VIAddVersionKey /LANG=${LANG_ENGLISH} "LegalCopyright" "Copyright © 2010-2020, ${VENDORSTR}"
VIAddVersionKey /LANG=${LANG_ENGLISH} "FileDescription" "${APPNAME} Installer" VIAddVersionKey /LANG=${LANG_ENGLISH} "FileDescription" "${APPNAME} Installer"
VIAddVersionKey /LANG=${LANG_ENGLISH} "ProductVersion" "${VERSION_LONG}" VIAddVersionKey /LANG=${LANG_ENGLISH} "ProductVersion" "${VERSION_LONG}"
VIAddVersionKey /LANG=${LANG_ENGLISH} "FileVersion" "${VERSION_LONG}" VIAddVersionKey /LANG=${LANG_ENGLISH} "FileVersion" "${VERSION_LONG}"
@@ -207,7 +207,7 @@
;because this will make your installer start faster. ;because this will make your installer start faster.
!insertmacro MUI_RESERVEFILE_LANGDLL !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\nsDialogs.dll"
ReserveFile "${NSISDIR}\Plugins\x86-unicode\StartMenu.dll" ReserveFile "${NSISDIR}\Plugins\x86-unicode\StartMenu.dll"
ReserveFile "${NSISDIR}\Plugins\x86-unicode\StdUtils.dll" ReserveFile "${NSISDIR}\Plugins\x86-unicode\StdUtils.dll"
@@ -410,19 +410,40 @@ Section "Viewer"
;This placeholder is replaced by the complete list of all the files in the installer, by viewer_manifest.py ;This placeholder is replaced by the complete list of all the files in the installer, by viewer_manifest.py
%%INSTALL_FILES%% %%INSTALL_FILES%%
;Create temp dir and set out dir to it
CreateDirectory "$TEMP\AlchemyInst"
SetOutPath "$TEMP\AlchemyInst"
;Download LibVLC ;Download LibVLC
!ifdef WIN64_BIN_BUILD !ifdef WIN64_BIN_BUILD
NSISdl::download "http://download.videolan.org/pub/videolan/vlc/2.2.8/win64/vlc-2.2.8-win64.7z" "$INSTDIR\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 !else
NSISdl::download "http://download.videolan.org/pub/videolan/vlc/2.2.8/win32/vlc-2.2.8-win32.7z" "$INSTDIR\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 !endif
Nsis7z::Extract "$INSTDIR\libvlc.7z" Nsis7z::ExtractWithDetails "$TEMP\AlchemyInst\libvlc.7z" "Unpacking media plugins %s..."
Rename "$INSTDIR\vlc-2.2.8\libvlc.dll" "$INSTDIR\llplugin\libvlc.dll" Rename "$TEMP\AlchemyInst\vlc-3.0.8\libvlc.dll" "$INSTDIR\llplugin\libvlc.dll"
Rename "$INSTDIR\vlc-2.2.8\libvlccore.dll" "$INSTDIR\llplugin\libvlccore.dll" Rename "$TEMP\AlchemyInst\vlc-3.0.8\libvlccore.dll" "$INSTDIR\llplugin\libvlccore.dll"
Rename "$INSTDIR\vlc-2.2.8\plugins" "$INSTDIR\llplugin\plugins" Rename "$TEMP\AlchemyInst\vlc-3.0.8\plugins" "$INSTDIR\llplugin\plugins"
RMDir /r "$INSTDIR\vlc-2.2.8"
Delete "$INSTDIR\libvlc.7z" ;Download and install VC redist
!ifdef WIN64_BIN_BUILD
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"
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
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"
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
;Remove temp dir and reset out to inst dir
RMDir /r "$TEMP\AlchemyInst\"
SetOutPath "$INSTDIR"
;Pass the installer's language to the client to use as a default ;Pass the installer's language to the client to use as a default
StrCpy $SHORTCUT_LANG_PARAM "--set InstallLanguage $(LanguageCode)" StrCpy $SHORTCUT_LANG_PARAM "--set InstallLanguage $(LanguageCode)"

View File

@@ -299,6 +299,7 @@ void JCFloaterAreaSearch::processObjectPropertiesFamily(LLMessageSystem* msg, vo
// We cache unknown objects (to avoid having to request them later) // We cache unknown objects (to avoid having to request them later)
// and requested objects. // and requested objects.
msg->getUUIDFast(_PREHASH_ObjectData, _PREHASH_OwnerID, data->owner_id); 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->getUUIDFast(_PREHASH_ObjectData, _PREHASH_GroupID, data->group_id);
msg->getStringFast(_PREHASH_ObjectData, _PREHASH_Name, data->name); msg->getStringFast(_PREHASH_ObjectData, _PREHASH_Name, data->name);
msg->getStringFast(_PREHASH_ObjectData, _PREHASH_Description, data->desc); msg->getStringFast(_PREHASH_ObjectData, _PREHASH_Description, data->desc);

View File

@@ -32,49 +32,38 @@ LFFloaterInvPanel::LFFloaterInvPanel(const LLSD& cat, const std::string& name, L
: LLInstanceTracker<LFFloaterInvPanel, LLSD>(cat) : LLInstanceTracker<LFFloaterInvPanel, LLSD>(cat)
{ {
// Setup the floater first // Setup the floater first
mPanel = new LLInventoryPanel("inv_panel", LLInventoryPanel::DEFAULT_SORT_ORDER, cat, LLRect(), model ? model : &gInventory, true); auto mPanel = new LLInventoryPanel("inv_panel", LLInventoryPanel::DEFAULT_SORT_ORDER, cat, LLRect(), model ? model : &gInventory, true);
const auto& title = name.empty() ? gInventory.getCategory(mPanel->getRootFolderID())->getName() : name;
// Figure out a unique name for our rect control
const auto rect_control = llformat("FloaterInv%sRect", boost::algorithm::erase_all_copy(title, " ").data());
bool existed = gSavedSettings.controlExists(rect_control);
if (existed) // Set our initial rect to the stored control
setRectControl(rect_control);
// Load from XUI // Load from XUI
mCommitCallbackRegistrar.add("InvPanel.Search", boost::bind(&LLInventoryPanel::setFilterSubString, boost::ref(mPanel), _2)); mCommitCallbackRegistrar.add("InvPanel.Search", boost::bind(&LLInventoryPanel::setFilterSubString, mPanel, _2));
LLUICtrlFactory::getInstance()->buildFloater(this, "floater_inv_panel.xml"); LLUICtrlFactory::getInstance()->buildFloater(this, "floater_inv_panel.xml");
// Now set the title // Now set the title
const auto& title = name.empty() ? gInventory.getCategory(mPanel->getRootFolderID())->getName() : name;
setTitle(title); setTitle(title);
// If we haven't existed before, create and set our rect control now // Figure out a unique name for our rect control
if (!existed) const auto rect_control = llformat("FloaterInv%sRect", boost::algorithm::erase_all_copy(title, " ").data());
if (!gSavedSettings.controlExists(rect_control)) // If we haven't existed before, create it
{ {
S32 left, top; S32 left, top;
gFloaterView->getNewFloaterPosition(&left, &top); gFloaterView->getNewFloaterPosition(&left, &top);
LLRect rect = getRect(); LLRect rect = getRect();
rect.translate(left - rect.mLeft, top - rect.mTop); rect.translate(left - rect.mLeft, top - rect.mTop);
setRect(rect);
gSavedSettings.declareRect(rect_control, rect, "Rectangle for " + title + " window"); gSavedSettings.declareRect(rect_control, rect, "Rectangle for " + title + " window");
setRectControl(rect_control);
} }
setRectControl(rect_control);
applyRectControl(); // Set our initial rect to the stored (or just created) control
// Now take care of the children // Now take care of the children
LLPanel* panel = getChild<LLPanel>("placeholder_panel"); LLPanel* panel = getChild<LLPanel>("placeholder_panel");
mPanel->setRect(panel->getRect()); mPanel->setRect(panel->getRect());
mPanel->setOrigin(0, 0);
mPanel->postBuild(); mPanel->postBuild();
mPanel->setFollows(FOLLOWS_ALL); mPanel->setFollows(FOLLOWS_ALL);
mPanel->setEnabled(true); mPanel->setEnabled(true);
mPanel->removeBorder(); mPanel->removeBorder();
addChild(mPanel); panel->addChild(mPanel);
removeChild(panel);
}
LFFloaterInvPanel::~LFFloaterInvPanel()
{
delete mPanel;
} }
// static // static
@@ -101,15 +90,18 @@ void LFFloaterInvPanel::closeAll()
} }
} }
// virtual
BOOL LFFloaterInvPanel::handleKeyHere(KEY key, MASK mask) BOOL LFFloaterInvPanel::handleKeyHere(KEY key, MASK mask)
{ {
if (!mPanel->hasFocus() && mask == MASK_NONE && (key == KEY_RETURN || key == KEY_DOWN)) if (mask == MASK_NONE && (key == KEY_RETURN || key == KEY_DOWN))
{ {
mPanel->setFocus(true); auto& mPanel = *getChild<LLInventoryPanel>("inv_panel");
if (LLFolderView* root = mPanel->getRootFolder()) if (!mPanel.hasFocus())
root->scrollToShowSelection(); {
return true; mPanel.setFocus(true);
if (LLFolderView* root = mPanel.getRootFolder())
root->scrollToShowSelection();
return true;
}
} }
return LLFloater::handleKeyHere(key, mask); return LLFloater::handleKeyHere(key, mask);

View File

@@ -18,18 +18,16 @@
* Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
* Boston, MA 02110-1301 USA */ * Boston, MA 02110-1301 USA */
#ifndef LFFLOATERINVPANEL_H #pragma once
#define LFFLOATERINVPANEL_H
#include "llfloater.h" #include "llfloater.h"
#include "llinstancetracker.h" #include "llinstancetracker.h"
#include "llsdutil.h" #include "llsdutil.h"
class LFFloaterInvPanel : public LLFloater, public LLInstanceTracker<LFFloaterInvPanel, LLSD> class LFFloaterInvPanel final : public LLFloater, public LLInstanceTracker<LFFloaterInvPanel, LLSD>
{ {
LFFloaterInvPanel(const LLSD& cat, const std::string& name = LLStringUtil::null, class LLInventoryModel* model = nullptr); LFFloaterInvPanel(const LLSD& cat, const std::string& name = LLStringUtil::null, class LLInventoryModel* model = nullptr);
~LFFloaterInvPanel();
public: public:
static void show(const LLSD& cat, const std::string& name = LLStringUtil::null, LLInventoryModel* model = nullptr); // Show the floater for cat (create with other params if necessary) static void show(const LLSD& cat, const std::string& name = LLStringUtil::null, LLInventoryModel* model = nullptr); // Show the floater for cat (create with other params if necessary)
@@ -42,10 +40,5 @@ public:
} }
static void closeAll(); // Called when not allowed to have inventory open static void closeAll(); // Called when not allowed to have inventory open
/*virtual*/ BOOL handleKeyHere(KEY key, MASK mask); BOOL handleKeyHere(KEY key, MASK mask) override;
private:
class LLInventoryPanel* mPanel;
}; };
#endif //LFFLOATERINVPANEL_H

View File

@@ -31,6 +31,7 @@
#include "pipeline.h" #include "pipeline.h"
#include "llagentaccess.h" #include "llagentaccess.h"
#include "llagentbenefits.h"
#include "llagentcamera.h" #include "llagentcamera.h"
#include "llagentwearables.h" #include "llagentwearables.h"
#include "llagentui.h" #include "llagentui.h"
@@ -38,11 +39,14 @@
#include "llanimationstates.h" #include "llanimationstates.h"
#include "llcallingcard.h" #include "llcallingcard.h"
#include "llcapabilitylistener.h" #include "llcapabilitylistener.h"
#include "llcororesponder.h"
#include "llconsole.h" #include "llconsole.h"
#include "llenvmanager.h" #include "llenvmanager.h"
#include "llfirstuse.h" #include "llfirstuse.h"
#include "llfloatercamera.h" #include "llfloatercamera.h"
#include "llfloatertools.h" #include "llfloatertools.h"
#include "llfloaterpostcard.h"
#include "llfloaterpreference.h"
#include "llgroupactions.h" #include "llgroupactions.h"
#include "llgroupmgr.h" #include "llgroupmgr.h"
#include "llhomelocationresponder.h" #include "llhomelocationresponder.h"
@@ -103,7 +107,7 @@
#include "lluictrlfactory.h" //For LLUICtrlFactory::getLayeredXMLNode #include "lluictrlfactory.h" //For LLUICtrlFactory::getLayeredXMLNode
#include "floaterao.h" // for Typing override #include "aosystem.h" // for Typing override
#include "hippolimits.h" // for getMaxAgentGroups #include "hippolimits.h" // for getMaxAgentGroups
// [RLVa:KB] - Checked: 2011-11-04 (RLVa-1.4.4a) // [RLVa:KB] - Checked: 2011-11-04 (RLVa-1.4.4a)
#include "rlvactions.h" #include "rlvactions.h"
@@ -184,10 +188,10 @@ public:
LLTeleportRequestViaLandmark(const LLUUID &pLandmarkId); LLTeleportRequestViaLandmark(const LLUUID &pLandmarkId);
virtual ~LLTeleportRequestViaLandmark(); virtual ~LLTeleportRequestViaLandmark();
virtual bool canRestartTeleport(); bool canRestartTeleport() override;
virtual void startTeleport(); void startTeleport() override;
virtual void restartTeleport(); void restartTeleport() override;
protected: protected:
inline const LLUUID &getLandmarkId() const {return mLandmarkId;}; inline const LLUUID &getLandmarkId() const {return mLandmarkId;};
@@ -196,15 +200,15 @@ private:
LLUUID mLandmarkId; LLUUID mLandmarkId;
}; };
class LLTeleportRequestViaLure : public LLTeleportRequestViaLandmark class LLTeleportRequestViaLure final : public LLTeleportRequestViaLandmark
{ {
public: public:
LLTeleportRequestViaLure(const LLUUID &pLureId, BOOL pIsLureGodLike); LLTeleportRequestViaLure(const LLUUID &pLureId, BOOL pIsLureGodLike);
virtual ~LLTeleportRequestViaLure(); virtual ~LLTeleportRequestViaLure();
virtual bool canRestartTeleport(); bool canRestartTeleport() override;
virtual void startTeleport(); void startTeleport() override;
protected: protected:
inline BOOL isLureGodLike() const {return mIsLureGodLike;}; inline BOOL isLureGodLike() const {return mIsLureGodLike;};
@@ -219,10 +223,10 @@ public:
LLTeleportRequestViaLocation(const LLVector3d &pPosGlobal); LLTeleportRequestViaLocation(const LLVector3d &pPosGlobal);
virtual ~LLTeleportRequestViaLocation(); virtual ~LLTeleportRequestViaLocation();
virtual bool canRestartTeleport(); bool canRestartTeleport() override;
virtual void startTeleport(); void startTeleport() override;
virtual void restartTeleport(); void restartTeleport() override;
protected: protected:
inline const LLVector3d &getPosGlobal() const {return mPosGlobal;}; inline const LLVector3d &getPosGlobal() const {return mPosGlobal;};
@@ -232,16 +236,16 @@ private:
}; };
class LLTeleportRequestViaLocationLookAt : public LLTeleportRequestViaLocation class LLTeleportRequestViaLocationLookAt final : public LLTeleportRequestViaLocation
{ {
public: public:
LLTeleportRequestViaLocationLookAt(const LLVector3d &pPosGlobal); LLTeleportRequestViaLocationLookAt(const LLVector3d &pPosGlobal);
virtual ~LLTeleportRequestViaLocationLookAt(); virtual ~LLTeleportRequestViaLocationLookAt();
virtual bool canRestartTeleport(); bool canRestartTeleport() override;
virtual void startTeleport(); void startTeleport() override;
virtual void restartTeleport(); void restartTeleport() override;
protected: protected:
@@ -258,12 +262,12 @@ const F32 LLAgent::TYPING_TIMEOUT_SECS = 5.f;
std::map<std::string, std::string> LLAgent::sTeleportErrorMessages; std::map<std::string, std::string> LLAgent::sTeleportErrorMessages;
std::map<std::string, std::string> LLAgent::sTeleportProgressMessages; std::map<std::string, std::string> LLAgent::sTeleportProgressMessages;
class LLAgentFriendObserver : public LLFriendObserver class LLAgentFriendObserver final : public LLFriendObserver
{ {
public: public:
LLAgentFriendObserver() {} LLAgentFriendObserver() = default;
virtual ~LLAgentFriendObserver() {} virtual ~LLAgentFriendObserver() = default;
virtual void changed(U32 mask); void changed(U32 mask) override;
}; };
void LLAgentFriendObserver::changed(U32 mask) void LLAgentFriendObserver::changed(U32 mask)
@@ -293,7 +297,7 @@ bool LLAgent::isActionAllowed(const LLSD& sdname)
{ {
bool allow_agent_voice = false; bool allow_agent_voice = false;
LLVoiceChannel* channel = LLVoiceChannel::getCurrentVoiceChannel(); LLVoiceChannel* channel = LLVoiceChannel::getCurrentVoiceChannel();
if (channel != NULL) if (channel != nullptr)
{ {
if (channel->getSessionName().empty() && channel->getSessionID().isNull()) if (channel->getSessionName().empty() && channel->getSessionID().isNull())
{ {
@@ -908,7 +912,7 @@ void LLAgent::setRegion(LLViewerRegion *regionp)
if (mRegionp) if (mRegionp)
{ {
// NaCl - Antispam Registry // NaCl - Antispam Registry
NACLAntiSpamRegistry::purgeAllQueues(); if (auto antispam = NACLAntiSpamRegistry::getIfExists()) antispam->resetQueues();
// NaCl End // NaCl End
// We've changed regions, we're now going to change our agent coordinate frame. // We've changed regions, we're now going to change our agent coordinate frame.
@@ -1779,9 +1783,10 @@ void LLAgent::autoPilot(F32 *delta_yaw)
if (auto object = gObjectList.findObject(mLeaderID)) if (auto object = gObjectList.findObject(mLeaderID))
{ {
mAutoPilotTargetGlobal = object->getPositionGlobal(); 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 (av->isSitting() && (!rlv_handler_t::isEnabled() || !gRlvHandler.hasBehaviour(RLV_BHVR_SIT)))
{ {
if (auto seat = av->getParent()) if (auto seat = av->getParent())
@@ -1801,7 +1806,7 @@ void LLAgent::autoPilot(F32 *delta_yaw)
} }
else // Ground sit, but only if near enough 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()) if (!gAgentAvatarp->isSittingAvatarOnGround())
setControlFlags(AGENT_CONTROL_SIT_ON_GROUND); setControlFlags(AGENT_CONTROL_SIT_ON_GROUND);
@@ -1819,7 +1824,7 @@ void LLAgent::autoPilot(F32 *delta_yaw)
} }
else 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 follow = 3; // We're close enough, indicate no walking
} }
@@ -2112,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-> gChatBar->
sendChatFromViewer("", CHAT_TYPE_START, FALSE); sendChatFromViewer("", CHAT_TYPE_START, FALSE);
} }
@@ -2125,7 +2130,7 @@ void LLAgent::stopTyping()
if (mRenderState & AGENT_STATE_TYPING) if (mRenderState & AGENT_STATE_TYPING)
{ {
clearRenderState(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-> gChatBar->
sendChatFromViewer("", CHAT_TYPE_STOP, FALSE); sendChatFromViewer("", CHAT_TYPE_STOP, FALSE);
} }
@@ -2589,15 +2594,11 @@ void LLAgent::onAnimStop(const LLUUID& id)
} }
else if (id == ANIM_AGENT_AWAY) else if (id == ANIM_AGENT_AWAY)
{ {
// clearAFK();
// [RLVa:KB] - Checked: 2010-05-03 (RLVa-1.2.0g) | Added: RLVa-1.1.0g // [RLVa:KB] - Checked: 2010-05-03 (RLVa-1.2.0g) | Added: RLVa-1.1.0g
#ifdef RLV_EXTENSION_CMD_ALLOWIDLE
if (!gRlvHandler.hasBehaviour(RLV_BHVR_ALLOWIDLE)) if (!gRlvHandler.hasBehaviour(RLV_BHVR_ALLOWIDLE))
clearAFK(); clearAFK();
#else
clearAFK();
#endif // RLV_EXTENSION_CMD_ALLOWIDLE
// [/RLVa:KB] // [/RLVa:KB]
// clearAFK();
} }
else if (id == ANIM_AGENT_STANDUP) else if (id == ANIM_AGENT_STANDUP)
{ {
@@ -2668,7 +2669,7 @@ bool LLAgent::canAccessMaturityInRegion( U64 region_handle ) const
return true; return true;
} }
bool LLAgent::canAccessMaturityAtGlobal( LLVector3d pos_global ) const bool LLAgent::canAccessMaturityAtGlobal(const LLVector3d& pos_global ) const
{ {
U64 region_handle = to_region_handle_global( pos_global.mdV[0], pos_global.mdV[1] ); U64 region_handle = to_region_handle_global( pos_global.mdV[0], pos_global.mdV[1] );
return canAccessMaturityInRegion( region_handle ); return canAccessMaturityInRegion( region_handle );
@@ -2715,7 +2716,7 @@ int LLAgent::convertTextToMaturity(char text)
return LLAgentAccess::convertTextToMaturity(text); return LLAgentAccess::convertTextToMaturity(text);
} }
class LLMaturityPreferencesResponder : public LLHTTPClient::ResponderWithResult class LLMaturityPreferencesResponder final : public LLHTTPClient::ResponderWithResult
{ {
LOG_CLASS(LLMaturityPreferencesResponder); LOG_CLASS(LLMaturityPreferencesResponder);
public: public:
@@ -2723,12 +2724,10 @@ public:
virtual ~LLMaturityPreferencesResponder(); virtual ~LLMaturityPreferencesResponder();
protected: protected:
virtual void httpSuccess(); void httpSuccess() override;
virtual void httpFailure(); void httpFailure() override;
/*virtual*/ char const* getName(void) const { return "LLMaturityPreferencesResponder"; }
protected:
char const* getName() const override { return "LLMaturityPreferencesResponder"; }
private: private:
U8 parseMaturityFromServerResponse(const LLSD &pContent) const; U8 parseMaturityFromServerResponse(const LLSD &pContent) const;
@@ -2929,7 +2928,7 @@ void LLAgent::sendMaturityPreferenceToServer(U8 pPreferredMaturity)
boost::intrusive_ptr<LLHTTPClient::ResponderWithResult> responderPtr = boost::intrusive_ptr<LLHTTPClient::ResponderWithResult>(new LLMaturityPreferencesResponder(this, pPreferredMaturity, mLastKnownResponseMaturity)); boost::intrusive_ptr<LLHTTPClient::ResponderWithResult> responderPtr = boost::intrusive_ptr<LLHTTPClient::ResponderWithResult>(new LLMaturityPreferencesResponder(this, pPreferredMaturity, mLastKnownResponseMaturity));
// If we don't have a region, report it as an error // If we don't have a region, report it as an error
if (getRegion() == NULL) if (getRegion() == nullptr)
{ {
responderPtr->failureResult(0U, "region is not defined", LLSD()); responderPtr->failureResult(0U, "region is not defined", LLSD());
} }
@@ -3162,7 +3161,7 @@ BOOL LLAgent::setUserGroupFlags(const LLUUID& group_id, BOOL accept_notices, BOO
BOOL LLAgent::canJoinGroups() const BOOL LLAgent::canJoinGroups() const
{ {
return (S32)mGroups.size() < gHippoLimits->getMaxAgentGroups(); return (S32)mGroups.size() < LLAgentBenefitsMgr::current().getGroupMembershipLimit();
} }
LLQuaternion LLAgent::getHeadRotation() LLQuaternion LLAgent::getHeadRotation()
@@ -3206,24 +3205,27 @@ void LLAgent::sendAnimationRequests(const uuid_vec_t &anim_ids, EAnimRequest req
msg->addUUIDFast(_PREHASH_AgentID, getID()); msg->addUUIDFast(_PREHASH_AgentID, getID());
msg->addUUIDFast(_PREHASH_SessionID, getSessionID()); msg->addUUIDFast(_PREHASH_SessionID, getSessionID());
for (U32 i = 0; i < anim_ids.size(); i++) for (auto anim_id : anim_ids)
{ {
if (anim_ids[i].isNull()) if (anim_id.isNull())
{ {
continue; continue;
} }
msg->nextBlockFast(_PREHASH_AnimationList); msg->nextBlockFast(_PREHASH_AnimationList);
msg->addUUIDFast(_PREHASH_AnimID, (anim_ids[i]) ); msg->addUUIDFast(_PREHASH_AnimID, anim_id);
msg->addBOOLFast(_PREHASH_StartAnim, (request == ANIM_REQUEST_START) ? TRUE : FALSE); msg->addBOOLFast(_PREHASH_StartAnim, (request == ANIM_REQUEST_START) ? TRUE : FALSE);
num_valid_anims++; num_valid_anims++;
} }
if (!num_valid_anims)
{
msg->clearMessage();
return;
}
msg->nextBlockFast(_PREHASH_PhysicalAvatarEventList); msg->nextBlockFast(_PREHASH_PhysicalAvatarEventList);
msg->addBinaryDataFast(_PREHASH_TypeData, NULL, 0); msg->addBinaryDataFast(_PREHASH_TypeData, nullptr, 0);
if (num_valid_anims)
{ sendReliableMessage();
sendReliableMessage();
}
} }
void LLAgent::sendAnimationRequest(const LLUUID &anim_id, EAnimRequest request) void LLAgent::sendAnimationRequest(const LLUUID &anim_id, EAnimRequest request)
@@ -3244,7 +3246,7 @@ void LLAgent::sendAnimationRequest(const LLUUID &anim_id, EAnimRequest request)
msg->addBOOLFast(_PREHASH_StartAnim, (request == ANIM_REQUEST_START) ? TRUE : FALSE); msg->addBOOLFast(_PREHASH_StartAnim, (request == ANIM_REQUEST_START) ? TRUE : FALSE);
msg->nextBlockFast(_PREHASH_PhysicalAvatarEventList); msg->nextBlockFast(_PREHASH_PhysicalAvatarEventList);
msg->addBinaryDataFast(_PREHASH_TypeData, NULL, 0); msg->addBinaryDataFast(_PREHASH_TypeData, nullptr, 0);
sendReliableMessage(); sendReliableMessage();
} }
@@ -3268,7 +3270,7 @@ void LLAgent::sendAnimationStateReset()
msg->addBOOLFast(_PREHASH_StartAnim, FALSE); msg->addBOOLFast(_PREHASH_StartAnim, FALSE);
msg->nextBlockFast(_PREHASH_PhysicalAvatarEventList); msg->nextBlockFast(_PREHASH_PhysicalAvatarEventList);
msg->addBinaryDataFast(_PREHASH_TypeData, NULL, 0); msg->addBinaryDataFast(_PREHASH_TypeData, nullptr, 0);
sendReliableMessage(); sendReliableMessage();
} }
@@ -3507,8 +3509,8 @@ void LLAgent::processAgentDropGroup(LLMessageSystem *msg, void **)
// Remove the group if it already exists remove it and add the new data to pick up changes. // Remove the group if it already exists remove it and add the new data to pick up changes.
LLGroupData gd; LLGroupData gd;
gd.mID = group_id; gd.mID = group_id;
std::vector<LLGroupData>::iterator found_it = std::find(gAgent.mGroups.begin(), gAgent.mGroups.end(), gd); auto found_it = std::find(gAgent.mGroups.cbegin(), gAgent.mGroups.cend(), gd);
if (found_it != gAgent.mGroups.end()) if (found_it != gAgent.mGroups.cend())
{ {
gAgent.mGroups.erase(found_it); gAgent.mGroups.erase(found_it);
if (gAgent.getGroupID() == group_id) if (gAgent.getGroupID() == group_id)
@@ -3534,12 +3536,12 @@ void LLAgent::processAgentDropGroup(LLMessageSystem *msg, void **)
} }
} }
class LLAgentDropGroupViewerNode : public LLHTTPNode class LLAgentDropGroupViewerNode final : public LLHTTPNode
{ {
virtual void post( void post(
LLHTTPNode::ResponsePtr response, LLHTTPNode::ResponsePtr response,
const LLSD& context, const LLSD& context,
const LLSD& input) const const LLSD& input) const override
{ {
if ( if (
@@ -3566,11 +3568,8 @@ class LLAgentDropGroupViewerNode : public LLHTTPNode
//there is only one set of data in the AgentData block //there is only one set of data in the AgentData block
LLSD agent_data = body["AgentData"][0]; LLSD agent_data = body["AgentData"][0];
LLUUID agent_id; LLUUID agent_id = agent_data["AgentID"].asUUID();
LLUUID group_id; LLUUID group_id = agent_data["GroupID"].asUUID();
agent_id = agent_data["AgentID"].asUUID();
group_id = agent_data["GroupID"].asUUID();
if (agent_id != gAgentID) if (agent_id != gAgentID)
{ {
@@ -3585,8 +3584,8 @@ class LLAgentDropGroupViewerNode : public LLHTTPNode
// and add the new data to pick up changes. // and add the new data to pick up changes.
LLGroupData gd; LLGroupData gd;
gd.mID = group_id; gd.mID = group_id;
std::vector<LLGroupData>::iterator found_it = std::find(gAgent.mGroups.begin(), gAgent.mGroups.end(), gd); auto found_it = std::find(gAgent.mGroups.cbegin(), gAgent.mGroups.cend(), gd);
if (found_it != gAgent.mGroups.end()) if (found_it != gAgent.mGroups.cend())
{ {
gAgent.mGroups.erase(found_it); gAgent.mGroups.erase(found_it);
if (gAgent.getGroupID() == group_id) if (gAgent.getGroupID() == group_id)
@@ -3657,8 +3656,8 @@ void LLAgent::processAgentGroupDataUpdate(LLMessageSystem *msg, void **)
{ {
need_floater_update = true; need_floater_update = true;
// Remove the group if it already exists remove it and add the new data to pick up changes. // Remove the group if it already exists remove it and add the new data to pick up changes.
std::vector<LLGroupData>::iterator found_it = std::find(gAgent.mGroups.begin(), gAgent.mGroups.end(), group); auto found_it = std::find(gAgent.mGroups.cbegin(), gAgent.mGroups.cend(), group);
if (found_it != gAgent.mGroups.end()) if (found_it != gAgent.mGroups.cend())
{ {
gAgent.mGroups.erase(found_it); gAgent.mGroups.erase(found_it);
} }
@@ -3672,12 +3671,12 @@ void LLAgent::processAgentGroupDataUpdate(LLMessageSystem *msg, void **)
} }
class LLAgentGroupDataUpdateViewerNode : public LLHTTPNode class LLAgentGroupDataUpdateViewerNode final : public LLHTTPNode
{ {
virtual void post( void post(
LLHTTPNode::ResponsePtr response, LLHTTPNode::ResponsePtr response,
const LLSD& context, const LLSD& context,
const LLSD& input) const const LLSD& input) const override
{ {
LLSD body = input["body"]; LLSD body = input["body"];
if(body.has("body")) if(body.has("body"))
@@ -3717,8 +3716,8 @@ class LLAgentGroupDataUpdateViewerNode : public LLHTTPNode
{ {
need_floater_update = true; need_floater_update = true;
// Remove the group if it already exists remove it and add the new data to pick up changes. // Remove the group if it already exists remove it and add the new data to pick up changes.
std::vector<LLGroupData>::iterator found_it = std::find(gAgent.mGroups.begin(), gAgent.mGroups.end(), group); auto found_it = std::find(gAgent.mGroups.cbegin(), gAgent.mGroups.cend(), group);
if (found_it != gAgent.mGroups.end()) if (found_it != gAgent.mGroups.cend())
{ {
gAgent.mGroups.erase(found_it); gAgent.mGroups.erase(found_it);
} }
@@ -3919,7 +3918,7 @@ void LLAgent::processAgentCachedTextureResponse(LLMessageSystem *mesgsys, void *
return; return;
} }
if (gAgentAvatarp->isEditingAppearance()) if (isAgentAvatarValid() && gAgentAvatarp->isEditingAppearance())
{ {
// ignore baked textures when in customize mode // ignore baked textures when in customize mode
return; return;
@@ -4050,6 +4049,7 @@ void LLAgent::clearVisualParams(void *data)
// protected // protected
bool LLAgent::teleportCore(bool is_local) bool LLAgent::teleportCore(bool is_local)
{ {
LL_INFOS("Teleport") << "In teleport core!" << LL_ENDL;
if ((TELEPORT_NONE != mTeleportState) && (mTeleportState != TELEPORT_PENDING)) if ((TELEPORT_NONE != mTeleportState) && (mTeleportState != TELEPORT_PENDING))
{ {
LL_WARNS() << "Attempt to teleport when already teleporting." << LL_ENDL; LL_WARNS() << "Attempt to teleport when already teleporting." << LL_ENDL;
@@ -4067,7 +4067,7 @@ bool LLAgent::teleportCore(bool is_local)
// Stop all animation before actual teleporting // Stop all animation before actual teleporting
if (isAgentAvatarValid()) if (isAgentAvatarValid())
{ {
for ( LLVOAvatar::AnimIterator anim_it= gAgentAvatarp->mPlayingAnimations.begin(); for ( auto anim_it= gAgentAvatarp->mPlayingAnimations.begin();
anim_it != gAgentAvatarp->mPlayingAnimations.end(); anim_it != gAgentAvatarp->mPlayingAnimations.end();
++anim_it) ++anim_it)
{ {
@@ -4086,8 +4086,7 @@ bool LLAgent::teleportCore(bool is_local)
LLFloaterWorldMap::hide(); LLFloaterWorldMap::hide();
// hide land floater too - it'll be out of date // hide land floater too - it'll be out of date
if (LLFloaterLand::findInstance()) if (LLFloaterLand::findInstance()) LLFloaterLand::hideInstance();
LLFloaterLand::hideInstance();
LLViewerParcelMgr::getInstance()->deselectLand(); LLViewerParcelMgr::getInstance()->deselectLand();
LLViewerMediaFocus::getInstance()->clearFocus(); LLViewerMediaFocus::getInstance()->clearFocus();
@@ -4861,7 +4860,7 @@ void LLAgent::sendAgentSetAppearance()
// This means the baked texture IDs on the server will be untouched. // This means the baked texture IDs on the server will be untouched.
// Once all textures are baked, another AvatarAppearance message will be sent to update the TEs // Once all textures are baked, another AvatarAppearance message will be sent to update the TEs
msg->nextBlockFast(_PREHASH_ObjectData); msg->nextBlockFast(_PREHASH_ObjectData);
gMessageSystem->addBinaryDataFast(_PREHASH_TextureEntry, NULL, 0); gMessageSystem->addBinaryDataFast(_PREHASH_TextureEntry, nullptr, 0);
} }
@@ -4884,9 +4883,7 @@ void LLAgent::sendAgentSetAppearance()
} }
LL_INFOS() << "Avatar XML num VisualParams transmitted = " << transmitted_params << LL_ENDL; LL_INFOS() << "Avatar XML num VisualParams transmitted = " << transmitted_params << LL_ENDL;
if(transmitted_params < 218) { if (transmitted_params < 218) LLNotificationsUtil::add("SGIncompleteAppearance");
LLNotificationsUtil::add("SGIncompleteAppearance");
}
sendReliableMessage(); sendReliableMessage();
} }
@@ -4901,8 +4898,96 @@ void LLAgent::sendAgentDataUpdateRequest()
void LLAgent::sendAgentUserInfoRequest() void LLAgent::sendAgentUserInfoRequest()
{ {
if(getID().isNull()) std::string cap;
if (getID().isNull())
return; // not logged in return; // not logged in
if (mRegionp)
cap = mRegionp->getCapability("UserInfo");
if (!cap.empty())
{
LLHTTPClient::get(cap, new LLCoroResponder(
boost::bind(&LLAgent::requestAgentUserInfoCoro, this, _1)));
}
else
{
sendAgentUserInfoRequestMessage();
}
}
void LLAgent::requestAgentUserInfoCoro(const LLCoroResponder& responder)
{
const auto& result = responder.getContent();
const auto& status = responder.getStatus();
if (!responder.isGoodStatus(status))
{
LL_WARNS("UserInfo") << "Failed to get user information: " << result["message"] << "Status " << status << " Reason: " << responder.getReason() << LL_ENDL;
return;
}
bool im_via_email;
bool is_verified_email;
std::string email;
std::string dir_visibility;
im_via_email = result["im_via_email"].asBoolean();
is_verified_email = result["is_verified"].asBoolean();
email = result["email"].asString();
dir_visibility = result["directory_visibility"].asString();
// TODO: This should probably be changed. I'm not entirely comfortable
// having LLAgent interact directly with the UI in this way.
LLFloaterPreference::updateUserInfo(dir_visibility, im_via_email, email, is_verified_email);
LLFloaterPostcard::updateUserInfo(email);
}
void LLAgent::sendAgentUpdateUserInfo(bool im_via_email, const std::string& directory_visibility)
{
std::string cap;
if (getID().isNull())
return; // not logged in
if (mRegionp)
cap = mRegionp->getCapability("UserInfo");
if (!cap.empty())
{
LLSD body(LLSDMap
("dir_visibility", LLSD::String(directory_visibility))
("im_via_email", LLSD::Boolean(im_via_email)));
LLHTTPClient::post(cap, body, new LLCoroResponder(
boost::bind(&LLAgent::updateAgentUserInfoCoro, this, _1)));
}
else
{
sendAgentUpdateUserInfoMessage(im_via_email, directory_visibility);
}
}
void LLAgent::updateAgentUserInfoCoro(const LLCoroResponder& responder)
{
const auto& result = responder.getContent();
const auto& status = responder.getStatus();
if (!responder.isGoodStatus(status))
{
LL_WARNS("UserInfo") << "Failed to set user information." << LL_ENDL;
}
else if (!result["success"].asBoolean())
{
LL_WARNS("UserInfo") << "Failed to set user information: " << result["message"] << LL_ENDL;
}
}
// deprecated:
// May be removed when UserInfo cap propagates to all simhosts in grid
void LLAgent::sendAgentUserInfoRequestMessage()
{
gMessageSystem->newMessageFast(_PREHASH_UserInfoRequest); gMessageSystem->newMessageFast(_PREHASH_UserInfoRequest);
gMessageSystem->nextBlockFast(_PREHASH_AgentData); gMessageSystem->nextBlockFast(_PREHASH_AgentData);
gMessageSystem->addUUIDFast(_PREHASH_AgentID, getID()); gMessageSystem->addUUIDFast(_PREHASH_AgentID, getID());
@@ -4910,6 +4995,21 @@ void LLAgent::sendAgentUserInfoRequest()
sendReliableMessage(); sendReliableMessage();
} }
void LLAgent::sendAgentUpdateUserInfoMessage(bool im_via_email, const std::string& directory_visibility)
{
gMessageSystem->newMessageFast(_PREHASH_UpdateUserInfo);
gMessageSystem->nextBlockFast(_PREHASH_AgentData);
gMessageSystem->addUUIDFast(_PREHASH_AgentID, getID());
gMessageSystem->addUUIDFast(_PREHASH_SessionID, getSessionID());
gMessageSystem->nextBlockFast(_PREHASH_UserData);
gMessageSystem->addBOOLFast(_PREHASH_IMViaEMail, im_via_email);
gMessageSystem->addString("DirectoryVisibility", directory_visibility);
gAgent.sendReliableMessage();
}
// end deprecated
//------
void LLAgent::observeFriends() void LLAgent::observeFriends()
{ {
if(!mFriendObserver) if(!mFriendObserver)
@@ -4977,18 +5077,6 @@ const void LLAgent::getTeleportSourceSLURL(LLSLURL& slurl) const
slurl = *mTeleportSourceSLURL; slurl = *mTeleportSourceSLURL;
} }
void LLAgent::sendAgentUpdateUserInfo(bool im_via_email, const std::string& directory_visibility )
{
gMessageSystem->newMessageFast(_PREHASH_UpdateUserInfo);
gMessageSystem->nextBlockFast(_PREHASH_AgentData);
gMessageSystem->addUUIDFast(_PREHASH_AgentID, getID());
gMessageSystem->addUUIDFast(_PREHASH_SessionID, getSessionID());
gMessageSystem->nextBlockFast(_PREHASH_UserData);
gMessageSystem->addBOOLFast(_PREHASH_IMViaEMail, im_via_email);
gMessageSystem->addString("DirectoryVisibility", directory_visibility);
gAgent.sendReliableMessage();
}
void LLAgent::dumpGroupInfo() void LLAgent::dumpGroupInfo()
{ {
LL_INFOS() << "group " << mGroupName << LL_ENDL; LL_INFOS() << "group " << mGroupName << LL_ENDL;

View File

@@ -33,8 +33,6 @@
#ifndef LL_LLAGENT_H #ifndef LL_LLAGENT_H
#define LL_LLAGENT_H #define LL_LLAGENT_H
#include <set>
#include "indra_constants.h" #include "indra_constants.h"
#include "llevent.h" // LLObservable base class #include "llevent.h" // LLObservable base class
#include "llagentconstants.h" #include "llagentconstants.h"
@@ -46,7 +44,6 @@
#include "llinventorymodel.h" #include "llinventorymodel.h"
#include "v3dmath.h" #include "v3dmath.h"
#include <boost/function.hpp>
#include <boost/shared_ptr.hpp> #include <boost/shared_ptr.hpp>
#include <boost/signals2.hpp> #include <boost/signals2.hpp>
@@ -70,6 +67,7 @@ class LLAgentAccess;
class LLSLURL; class LLSLURL;
class LLSimInfo; class LLSimInfo;
class LLTeleportRequest; class LLTeleportRequest;
struct LLCoroResponder;
typedef boost::shared_ptr<LLTeleportRequest> LLTeleportRequestPtr; typedef boost::shared_ptr<LLTeleportRequest> LLTeleportRequestPtr;
@@ -100,7 +98,7 @@ struct LLGroupData
//------------------------------------------------------------------------ //------------------------------------------------------------------------
// LLAgent // LLAgent
//------------------------------------------------------------------------ //------------------------------------------------------------------------
class LLAgent : public LLOldEvents::LLObservable class LLAgent final : public LLOldEvents::LLObservable
{ {
LOG_CLASS(LLAgent); LOG_CLASS(LLAgent);
@@ -248,7 +246,7 @@ public:
void changeParcels(); // called by LLViewerParcelMgr when we cross a parcel boundary void changeParcels(); // called by LLViewerParcelMgr when we cross a parcel boundary
// Register a boost callback to be called when the agent changes parcels // Register a boost callback to be called when the agent changes parcels
typedef boost::function<void()> parcel_changed_callback_t; typedef std::function<void()> parcel_changed_callback_t;
boost::signals2::connection addParcelChangedCallback(parcel_changed_callback_t); boost::signals2::connection addParcelChangedCallback(parcel_changed_callback_t);
private: private:
@@ -786,7 +784,7 @@ public:
void requestEnterGodMode(); void requestEnterGodMode();
void requestLeaveGodMode(); void requestLeaveGodMode();
typedef boost::function<void (U8)> god_level_change_callback_t; typedef std::function<void (U8)> god_level_change_callback_t;
typedef boost::signals2::signal<void (U8)> god_level_change_signal_t; typedef boost::signals2::signal<void (U8)> god_level_change_signal_t;
typedef boost::signals2::connection god_level_change_slot_t; typedef boost::signals2::connection god_level_change_slot_t;
@@ -808,7 +806,7 @@ public:
bool canAccessMature() const; bool canAccessMature() const;
bool canAccessAdult() const; bool canAccessAdult() const;
bool canAccessMaturityInRegion( U64 region_handle ) const; bool canAccessMaturityInRegion( U64 region_handle ) const;
bool canAccessMaturityAtGlobal( LLVector3d pos_global ) const; bool canAccessMaturityAtGlobal( const LLVector3d& pos_global ) const;
bool prefersPG() const; bool prefersPG() const;
bool prefersMature() const; bool prefersMature() const;
bool prefersAdult() const; bool prefersAdult() const;
@@ -965,9 +963,17 @@ public:
void sendAgentSetAppearance(); void sendAgentSetAppearance();
void sendAgentDataUpdateRequest(); void sendAgentDataUpdateRequest();
void sendAgentUserInfoRequest(); void sendAgentUserInfoRequest();
// IM to Email and Online visibility
// IM to Email and Online visibility
void sendAgentUpdateUserInfo(bool im_to_email, const std::string& directory_visibility); void sendAgentUpdateUserInfo(bool im_to_email, const std::string& directory_visibility);
private:
void requestAgentUserInfoCoro(const LLCoroResponder& responder);
void updateAgentUserInfoCoro(const LLCoroResponder& responder);
// DEPRECATED: may be removed when User Info cap propagates
void sendAgentUserInfoRequestMessage();
void sendAgentUpdateUserInfoMessage(bool im_via_email, const std::string& directory_visibility);
//-------------------------------------------------------------------- //--------------------------------------------------------------------
// Receive // Receive
//-------------------------------------------------------------------- //--------------------------------------------------------------------

View 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;
}

View 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

View File

@@ -29,6 +29,7 @@
#include "pipeline.h" #include "pipeline.h"
#include "aosystem.h" //For AOSystem
#include "llagent.h" #include "llagent.h"
#include "llanimationstates.h" #include "llanimationstates.h"
#include "llfloatercamera.h" #include "llfloatercamera.h"
@@ -49,7 +50,6 @@
#include "llwindow.h" #include "llwindow.h"
#include "llworld.h" #include "llworld.h"
#include "llfloatertools.h" //For gFloaterTools #include "llfloatertools.h" //For gFloaterTools
#include "floaterao.h" //For LLFloaterAO
#include "llfloatercustomize.h" //For gFloaterCustomize #include "llfloatercustomize.h" //For gFloaterCustomize
// [RLVa:KB] - Checked: 2010-05-10 (RLVa-1.2.0g) // [RLVa:KB] - Checked: 2010-05-10 (RLVa-1.2.0g)
#include "rlvhandler.h" #include "rlvhandler.h"
@@ -2265,7 +2265,8 @@ void LLAgentCamera::changeCameraToMouselook(BOOL animate)
mMouselookTimer.reset(); mMouselookTimer.reset();
gFocusMgr.setKeyboardFocus(NULL); gFocusMgr.setKeyboardFocus(NULL);
if (gSavedSettings.getBOOL("AONoStandsInMouselook")) LLFloaterAO::stopMotion(LLFloaterAO::getCurrentStandId(), true); auto ao = AOSystem::getIfExists();
if (ao && gSavedSettings.getBOOL("AONoStandsInMouselook")) ao->stopCurrentStand();
updateLastCamera(); updateLastCamera();
mCameraMode = CAMERA_MODE_MOUSELOOK; mCameraMode = CAMERA_MODE_MOUSELOOK;
@@ -2512,13 +2513,13 @@ void LLAgentCamera::changeCameraToCustomizeAvatar()
gAgent.sendAnimationRequest(ANIM_AGENT_CUSTOMIZE, ANIM_REQUEST_START); gAgent.sendAnimationRequest(ANIM_AGENT_CUSTOMIZE, ANIM_REQUEST_START);
gAgent.setCustomAnim(TRUE); gAgent.setCustomAnim(TRUE);
gAgentAvatarp->startMotion(ANIM_AGENT_CUSTOMIZE); gAgentAvatarp->startMotion(ANIM_AGENT_CUSTOMIZE);
} LLMotion* turn_motion = gAgentAvatarp->findMotion(ANIM_AGENT_CUSTOMIZE);
LLMotion* turn_motion = gAgentAvatarp->findMotion(ANIM_AGENT_CUSTOMIZE);
if (turn_motion) if (turn_motion)
{ {
// delay camera animation long enough to play through turn animation // delay camera animation long enough to play through turn animation
setAnimationDuration(turn_motion->getDuration() + CUSTOMIZE_AVATAR_CAMERA_ANIM_SLOP); setAnimationDuration(turn_motion->getDuration() + CUSTOMIZE_AVATAR_CAMERA_ANIM_SLOP);
}
} }
} }
// <edit> // <edit>

View File

@@ -40,11 +40,21 @@
/// Classes for AISv3 support. /// Classes for AISv3 support.
///---------------------------------------------------------------------------- ///----------------------------------------------------------------------------
extern AIHTTPTimeoutPolicy AISAPIResponder_timeout;
class AISCommand final : public LLHTTPClient::ResponderWithCompleted class AISCommand final : public LLHTTPClient::ResponderWithCompleted
{ {
public: public:
typedef boost::function<void()> command_func_type; typedef boost::function<void()> command_func_type;
// AISCommand - base class for retry-able HTTP requests using the AISv3 cap. // 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) : AISCommand(AISAPI::COMMAND_TYPE type, const char* name, const LLUUID& targetId, AISAPI::completion_t callback) :
mCommandFunc(NULL), mCommandFunc(NULL),
mRetryPolicy(new LLAdaptiveRetryPolicy(1.0, 32.0, 2.0, 10)), mRetryPolicy(new LLAdaptiveRetryPolicy(1.0, 32.0, 2.0, 10)),
@@ -53,10 +63,30 @@ public:
mName(name), mName(name),
mType(type) mType(type)
{} {}
virtual ~AISCommand()
{
if (mActive)
{
--sActiveAISCommands;
while (sActiveAISCommands < sMaxActiveAISCommands && !sPendingAISCommands.empty())
{
sPendingAISCommands.front()->dispatch();
sPendingAISCommands.pop();
}
}
}
void run( command_func_type func ) void run( command_func_type func )
{ {
(mCommandFunc = func)(); mCommandFunc = func;
if (sActiveAISCommands >= sMaxActiveAISCommands)
{
sPendingAISCommands.push(this);
}
else
{
dispatch();
}
} }
char const* getName(void) const override char const* getName(void) const override
@@ -64,6 +94,17 @@ public:
return mName; return mName;
} }
private:
void dispatch()
{
if (LLApp::isQuitting())
{
return;
}
++sActiveAISCommands;
mActive = true;
(mCommandFunc)();
}
void markComplete() void markComplete()
{ {
// Command func holds a reference to self, need to release it // Command func holds a reference to self, need to release it
@@ -72,42 +113,56 @@ public:
mRetryPolicy->onSuccess(); mRetryPolicy->onSuccess();
} }
void malformedResponse() { mStatus = HTTP_INTERNAL_ERROR_OTHER; mReason = llformat("Malformed response contents (original code: %d)", mStatus); }
bool onFailure() bool onFailure()
{ {
bool retry = mStatus != HTTP_INTERNAL_ERROR_OTHER && mStatus != 410; // We handle these and stop mRetryPolicy->onFailure(mStatus, getResponseHeaders());
LL_WARNS("Inventory") << "Inventory error: " << dumpResponse() << LL_ENDL;
if (retry) mRetryPolicy->onFailure(mStatus, getResponseHeaders());
F32 seconds_to_wait; 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); doAfterInterval(mCommandFunc,seconds_to_wait);
return true;
} }
else else
{ {
// Command func holds a reference to self, need to release it // Command func holds a reference to self, need to release it
// after a success or final failure. // after a success or final failure.
// *TODO: Notify user? This seems bad. // *TODO: Notify user? This seems bad.
LL_WARNS("Inventory") << "Abort due to inventory error for " << getName() <<": " << dumpResponse() << LL_ENDL;
mCommandFunc = no_op; mCommandFunc = no_op;
return false;
} }
return retry;
} }
protected: protected:
void httpCompleted() override 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; command_func_type mCommandFunc;
LLPointer<LLHTTPRetryPolicy> mRetryPolicy; LLPointer<LLHTTPRetryPolicy> mRetryPolicy;
AISAPI::completion_t mCompletionFunc; AISAPI::completion_t mCompletionFunc;
const LLUUID mTargetId; const LLUUID mTargetId;
const char* mName; const char* mName;
bool mActive = false;
AISAPI::COMMAND_TYPE mType; 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::INVENTORY_CAP_NAME("InventoryAPIv3");
const std::string AISAPI::LIBRARY_CAP_NAME("LibraryAPIv3"); 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); 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)); 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, std::string url,
LLUUID targetId, LLSD result, completion_t callback, COMMAND_TYPE type) LLUUID targetId, LLSD result, completion_t callback, COMMAND_TYPE type)
{ {
LL_DEBUGS("Inventory") << "url: " << url << LL_ENDL; LL_DEBUGS("Inventory") << "url: " << url << LL_ENDL;
auto status = responder->getStatus(); auto status = responder->getStatus();
if (!responder->isGoodStatus(status) || !result.isMap()) if (!responder->isGoodStatus(status) || !result.isMap())
{ {
if (!result.isMap()) LL_WARNS("Inventory") << "Inventory error: " << status << ": " << responder->getReason() << LL_ENDL;
{ if (status == 410) //GONE
responder->malformedResponse();
}
else if (status == 410) //GONE
{ {
// Item does not exist or was already deleted from server. // Item does not exist or was already deleted from server.
// parent folder is out of sync // 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 (!result.isMap())
if (responder->onFailure()) // If we're retrying, exit early. {
return; 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); gInventory.onAISUpdateReceived("AISCommand", result);
@@ -734,11 +787,9 @@ void AISUpdate::parseUUIDArray(const LLSD& content, const std::string& name, uui
{ {
if (content.has(name)) if (content.has(name))
{ {
for(LLSD::array_const_iterator it = content[name].beginArray(), for (auto& id : content[name].array())
end = content[name].endArray();
it != end; ++it)
{ {
ids.insert((*it).asUUID()); ids.insert(id.asUUID());
} }
} }
} }

View File

@@ -72,7 +72,7 @@ private:
static std::string getInvCap(); static std::string getInvCap();
static std::string getLibCap(); static std::string getLibCap();
static void InvokeAISCommandCoro(class AISCommand* responder, static void InvokeAISCommandCoro(LLHTTPClient::ResponderWithCompleted* responder,
std::string url, LLUUID targetId, LLSD body, std::string url, LLUUID targetId, LLSD body,
completion_t callback, COMMAND_TYPE type); completion_t callback, COMMAND_TYPE type);
}; };

View File

@@ -47,6 +47,7 @@
#include "llagent.h" #include "llagent.h"
#include "llagentcamera.h" #include "llagentcamera.h"
#include "llagentwearables.h" #include "llagentwearables.h"
#include "llimprocessing.h"
#include "llwindow.h" #include "llwindow.h"
#include "llviewerstats.h" #include "llviewerstats.h"
#include "llmarketplacefunctions.h" #include "llmarketplacefunctions.h"
@@ -158,6 +159,7 @@
// Included so that constants/settings might be initialized // Included so that constants/settings might be initialized
// in save_settings_to_globals() // in save_settings_to_globals()
#include "aosystem.h"
#include "llbutton.h" #include "llbutton.h"
#include "llcombobox.h" #include "llcombobox.h"
#include "floaterlocalassetbrowse.h" #include "floaterlocalassetbrowse.h"
@@ -190,6 +192,7 @@
#include "llviewerthrottle.h" #include "llviewerthrottle.h"
#include "llparcel.h" #include "llparcel.h"
#include "llviewerassetstats.h" #include "llviewerassetstats.h"
#include "NACLantispam.h"
#include "llmainlooprepeater.h" #include "llmainlooprepeater.h"
@@ -218,13 +221,40 @@
#include <client/crashpad_client.h> #include <client/crashpad_client.h>
#include <client/prune_crash_reports.h> #include <client/prune_crash_reports.h>
#include <client/settings.h> #include <client/settings.h>
#include <client/annotation.h>
#include <fmt/format.h> #include <fmt/format.h>
#include "llnotificationsutil.h" #include "llnotificationsutil.h"
#include "llversioninfo.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 #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 ////// Windows-specific includes to the bottom - nasty defines in these pollute the preprocessor
// //
@@ -429,27 +459,6 @@ static void ui_audio_callback(const LLUUID& uuid)
} }
} }
void request_initial_instant_messages()
{
static BOOL requested = FALSE;
if (!requested
&& gMessageSystem
&& LLMuteList::getInstance()->isLoaded()
&& isAgentAvatarValid())
{
// Auto-accepted inventory items may require the avatar object
// to build a correct name. Likewise, inventory offers from
// muted avatars require the mute list to properly mute.
LLMessageSystem* msg = gMessageSystem;
msg->newMessageFast(_PREHASH_RetrieveInstantMessages);
msg->nextBlockFast(_PREHASH_AgentData);
msg->addUUIDFast(_PREHASH_AgentID, gAgent.getID());
msg->addUUIDFast(_PREHASH_SessionID, gAgent.getSessionID());
gAgent.sendReliableMessage();
requested = TRUE;
}
}
// Use these strictly for things that are constructed at startup, // Use these strictly for things that are constructed at startup,
// or for things that are performance critical. JC // or for things that are performance critical. JC
static void settings_to_globals() static void settings_to_globals()
@@ -789,8 +798,18 @@ bool LLAppViewer::init()
initCrashReporting(); initCrashReporting();
#endif #endif
writeDebugInfo();
setupErrorHandling(); 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 // Start of the application
// //
@@ -1678,6 +1697,8 @@ bool LLAppViewer::cleanup()
LLCalc::cleanUp(); LLCalc::cleanUp();
AOSystem::deleteSingleton();
LL_INFOS() << "Global stuff deleted" << LL_ENDL; LL_INFOS() << "Global stuff deleted" << LL_ENDL;
// Note: this is where LLFeatureManager::getInstance()-> used to be deleted. // Note: this is where LLFeatureManager::getInstance()-> used to be deleted.
@@ -2760,6 +2781,10 @@ void LLAppViewer::writeDebugInfo(bool isStatic)
isStatic ? LLSDSerialize::toPrettyXML(gDebugInfo, out_file) isStatic ? LLSDSerialize::toPrettyXML(gDebugInfo, out_file)
: LLSDSerialize::toPrettyXML(gDebugInfo["Dynamic"], 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 #endif
} }
@@ -4049,7 +4074,7 @@ void LLAppViewer::idle()
// here. // here.
{ {
LAZY_FT("request_initial_instant_messages"); LAZY_FT("request_initial_instant_messages");
request_initial_instant_messages(); LLIMProcessing::requestOfflineMessages();
} }
/////////////////////////////////// ///////////////////////////////////
@@ -4209,6 +4234,7 @@ void LLAppViewer::idle()
gIdleCallbacks.callFunctions(); gIdleCallbacks.callFunctions();
gInventory.idleNotifyObservers(); gInventory.idleNotifyObservers();
if (auto antispam = NACLAntiSpamRegistry::getIfExists()) antispam->idle();
} }
// Metrics logging (LLViewerAssetStats, etc.) // Metrics logging (LLViewerAssetStats, etc.)

View File

@@ -35,6 +35,7 @@
// viewer includes // viewer includes
#include "llagent.h" #include "llagent.h"
#include "llagentbenefits.h"
#include "llcompilequeue.h" #include "llcompilequeue.h"
#include "llfloaterbuycurrency.h" #include "llfloaterbuycurrency.h"
#include "statemachine/aifilepicker.h" #include "statemachine/aifilepicker.h"
@@ -59,7 +60,6 @@
// library includes // library includes
#include "lldir.h" #include "lldir.h"
#include "lleconomy.h"
#include "llfocusmgr.h" #include "llfocusmgr.h"
#include "llnotificationsutil.h" #include "llnotificationsutil.h"
#include "llscrolllistctrl.h" #include "llscrolllistctrl.h"
@@ -326,7 +326,11 @@ void LLAssetUploadResponder::uploadFailure(const LLSD& content)
// deal with L$ errors // deal with L$ errors
if (reason == "insufficient funds") 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); LLFloaterBuyCurrency::buyCurrency("Uploading costs", price);
} }
else else
@@ -390,13 +394,14 @@ void LLNewAgentInventoryResponder::uploadComplete(const LLSD& content)
// Update L$ and ownership credit information // Update L$ and ownership credit information
// since it probably changed on the server // 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_SOUND ||
asset_type == LLAssetType::AT_ANIMATION || asset_type == LLAssetType::AT_ANIMATION ||
asset_type == LLAssetType::AT_MESH) asset_type == LLAssetType::AT_MESH)
{ {
expected_upload_cost = LLAgentBenefitsMgr::current().findUploadCost(asset_type, expected_upload_cost);
LLGlobalEconomy::Singleton::getInstance()->getPriceUpload();
} }
LL_INFOS() << "Adding " << content["new_inventory_item"].asUUID() << " " LL_INFOS() << "Adding " << content["new_inventory_item"].asUUID() << " "

View File

@@ -1149,6 +1149,7 @@ LLSpatialPartition* LLDrawable::getSpatialPartition()
//must be an active volume //must be an active volume
if (!mSpatialBridge) if (!mSpatialBridge)
{ {
// Spatial bridge ctors self-register...
if (mVObjp->isHUDAttachment()) if (mVObjp->isHUDAttachment())
{ {
setSpatialBridge(new LLHUDBridge(this, getRegion())); setSpatialBridge(new LLHUDBridge(this, getRegion()));
@@ -1615,9 +1616,9 @@ void LLSpatialBridge::cleanupReferences()
} }
}*/ }*/
LLDrawable* drawablep = mDrawable; LLPointer<LLDrawable> drawablep = mDrawable;
mDrawable = NULL; mDrawable = nullptr;
drawablep->setSpatialBridge(NULL); drawablep->setSpatialBridge(nullptr);
} }
} }

View File

@@ -36,7 +36,7 @@
#include "lldate.h" #include "lldate.h"
class LLExperienceLogDispatchHandler : public LLDispatchHandler class LLExperienceLogDispatchHandler final : public LLDispatchHandler
{ {
public: public:
bool operator()( bool operator()(
@@ -226,24 +226,26 @@ LLExperienceLog::~LLExperienceLog()
void LLExperienceLog::eraseExpired() void LLExperienceLog::eraseExpired()
{ {
std::vector<std::string> expired; std::vector<std::string> expired;
std::for_each(mEvents.beginMap(), mEvents.endMap(), for (const auto& event_pair : mEvents.map())
[&](const auto& event_pair) {
{ const std::string& date = event_pair.first;
const std::string& date = event_pair.first; if (isExpired(date))
if (isExpired(date)) {
{
expired.push_back(date); expired.push_back(date);
} }
}); }
for (const auto& date : expired) for (const auto& date : expired)
{ {
mEvents.erase(date); mEvents.erase(date);
} }
} }
bool LLExperienceLog::isExpired(const std::string& date) bool LLExperienceLog::isExpired(const std::string& date) const
{ {
if (date.empty())
return true;
S32 month, day, year = 0; S32 month, day, year = 0;
S32 matched = sscanf(date.c_str(), "%d-%d-%d", &year, &month, &day); S32 matched = sscanf(date.c_str(), "%d-%d-%d", &year, &month, &day);
if (matched != 3) return false; if (matched != 3) return false;

View File

@@ -61,7 +61,7 @@ public:
static void notify(LLSD& message); static void notify(LLSD& message);
static std::string getFilename(); static std::string getFilename();
static std::string getPermissionString(const LLSD& message, const std::string& base); static std::string getPermissionString(const LLSD& message, const std::string& base);
bool isExpired(const std::string& date); bool isExpired(const std::string& date) const;
protected: protected:
void handleExperienceMessage(LLSD& message); void handleExperienceMessage(LLSD& message);

View File

@@ -134,7 +134,7 @@ namespace
} }
} //namespace } //namespace
const LLColor4* mm_getMarkerColor(const LLUUID& id); const LLColor4* mm_getMarkerColor(const LLUUID& id, bool mark_only = true);
LLAvatarListEntry::LLAvatarListEntry(const LLUUID& id, const std::string& name, const LLVector3d& position) : LLAvatarListEntry::LLAvatarListEntry(const LLUUID& id, const std::string& name, const LLVector3d& position) :
mID(id), mName(name), mPosition(position), mMarked(mm_getMarkerColor(id)), mFocused(false), mID(id), mName(name), mPosition(position), mMarked(mm_getMarkerColor(id)), mFocused(false),
mStats(), mStats(),
@@ -174,7 +174,8 @@ void LLAvatarListEntry::processProperties(void* data, EAvatarProcessorType type)
using namespace boost::gregorian; using namespace boost::gregorian;
int year, month, day; int year, month, day;
const auto born = pAvatarData->born_on; 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 try
{ {
mAge = (day_clock::local_day() - date(year, month, day)).days(); 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. 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()); 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; LL_WARNS() << "Failed to extract age from APT_PROPERTIES for " << mID << ", received \"" << born << "\"." << LL_ENDL;
inst.sendAvatarPropertiesRequest(mID); 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_ar(const LLAvatarListEntry* entry);
static void cmd_teleport(const LLAvatarListEntry* entry); static void cmd_teleport(const LLAvatarListEntry* entry);
const LLUUID& active_owner_or_id(const LLSD& userdata);
namespace namespace
{ {
typedef LLMemberListener<LLView> view_listener_t; 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(); LLFloaterAvatarList::instance().onClickTrack();
return true; 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; 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()); LLFloaterAvatarList::instance().focusOnPrev(userdata.asInteger());
return true; 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()); LLFloaterAvatarList::instance().focusOnNext(userdata.asInteger());
return true; 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(); LLFloaterAvatarList::instance().sendKeys();
return true; return true;

View File

@@ -36,13 +36,13 @@
#include "llbvhloader.h" #include "llbvhloader.h"
#include "lldatapacker.h" #include "lldatapacker.h"
#include "lldir.h" #include "lldir.h"
#include "lleconomy.h"
#include "llnotificationsutil.h" #include "llnotificationsutil.h"
#include "llvfile.h" #include "llvfile.h"
#include "llapr.h" #include "llapr.h"
#include "llstring.h" #include "llstring.h"
#include "llagent.h" #include "llagent.h"
#include "llagentbenefits.h"
#include "llanimationstates.h" #include "llanimationstates.h"
#include "llbbox.h" #include "llbbox.h"
#include "llbutton.h" #include "llbutton.h"
@@ -229,7 +229,7 @@ BOOL LLFloaterBvhPreview::postBuild()
getChild<LLSlider>("priority")->setMaxValue(7); 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); childSetAction("ok_btn", onBtnOK, this);
setDefaultBtn(); setDefaultBtn();
@@ -1238,7 +1238,7 @@ void LLFloaterBvhPreview::onBtnOK(void* userdata)
std::string name = floaterp->getChild<LLUICtrl>("name_form")->getValue().asString(); std::string name = floaterp->getChild<LLUICtrl>("name_form")->getValue().asString();
std::string desc = floaterp->getChild<LLUICtrl>("description_form")->getValue().asString(); std::string desc = floaterp->getChild<LLUICtrl>("description_form")->getValue().asString();
LLAssetStorage::LLStoreAssetCallback callback = NULL; LLAssetStorage::LLStoreAssetCallback callback = NULL;
S32 expected_upload_cost = LLGlobalEconomy::Singleton::getInstance()->getPriceUpload(); S32 expected_upload_cost = LLAgentBenefitsMgr::current().getAnimationUploadCost();
void *userdata = NULL; void *userdata = NULL;
// <edit> // <edit>
@@ -1268,7 +1268,9 @@ void LLFloaterBvhPreview::onBtnOK(void* userdata)
0, 0,
LLFolderType::FT_NONE, LLFolderType::FT_NONE,
LLInventoryType::IT_ANIMATION, LLInventoryType::IT_ANIMATION,
LLFloaterPerms::getNextOwnerPerms("Uploads"), LLFloaterPerms::getGroupPerms("Uploads"), LLFloaterPerms::getEveryonePerms("Uploads"), LLFloaterPerms::getNextOwnerPerms("Uploads"),
LLFloaterPerms::getGroupPerms("Uploads"),
LLFloaterPerms::getEveryonePerms("Uploads"),
name, name,
callback, expected_upload_cost, userdata); callback, expected_upload_cost, userdata);
} }

View File

@@ -287,6 +287,11 @@ void LLFloaterChat::addChatHistory(LLChat& chat, bool log_to_file)
return; 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 // could flash the chat button in the status bar here. JC
LLFloaterChat* chat_floater = LLFloaterChat::getInstance(LLSD()); LLFloaterChat* chat_floater = LLFloaterChat::getInstance(LLSD());

View File

@@ -491,18 +491,18 @@ void LLFloaterExperienceProfile::setPreferences( const LLSD& content )
const LLSD& blocked = content["blocked"]; const LLSD& blocked = content["blocked"];
for(LLSD::array_const_iterator it = experiences.beginArray(); it != experiences.endArray() ; ++it) for(const auto& exp : experiences.array())
{ {
if (it->asUUID()==mExperienceId) if (exp.asUUID()==mExperienceId)
{ {
experienceAllowed(); experienceAllowed();
return; return;
} }
} }
for(LLSD::array_const_iterator it = blocked.beginArray(); it != blocked.endArray() ; ++it) for(const auto& exp : blocked.array())
{ {
if (it->asUUID()==mExperienceId) if (exp.asUUID()==mExperienceId)
{ {
experienceBlocked(); experienceBlocked();
return; return;
@@ -520,19 +520,17 @@ void LLFloaterExperienceProfile::onFieldChanged()
{ {
return; return;
} }
LLSD::map_const_iterator st = mExperienceDetails.beginMap();
LLSD::map_const_iterator dt = mPackage.beginMap();
mDirty = false; mDirty = mPackage.size() != mExperienceDetails.size();
while(!mDirty && st != mExperienceDetails.endMap() && dt != mPackage.endMap()) if (!mDirty)
{ {
mDirty = st->first != dt->first || st->second.asString() != dt->second.asString(); LLSD::map_const_iterator st = mExperienceDetails.beginMap();
++st;++dt; LLSD::map_const_iterator dt = mPackage.beginMap();
} LLSD::map_const_iterator ste = mExperienceDetails.endMap();
LLSD::map_const_iterator dte = mPackage.endMap();
if (!mDirty && (st != mExperienceDetails.endMap() || dt != mPackage.endMap())) for (; st != ste && dt != dte; ++st, ++dt)
{ if (mDirty = st->first != dt->first || st->second.asString() != dt->second.asString())
mDirty = true; break;
} }
getChild<LLButton>(BTN_SAVE)->setEnabled(mDirty); getChild<LLButton>(BTN_SAVE)->setEnabled(mDirty);
@@ -607,16 +605,15 @@ void LLFloaterExperienceProfile::onSaveComplete( const LLSD& content )
if (content.has("removed")) if (content.has("removed"))
{ {
const LLSD& removed = content["removed"]; const LLSD& removed = content["removed"];
LLSD::map_const_iterator it = removed.beginMap(); for(const auto& it : removed.map())
for(/**/; it != removed.endMap(); ++it)
{ {
const std::string& field = it->first; const std::string& field = it.first;
if (field == LLExperienceCache::EXPERIENCE_ID) if (field == LLExperienceCache::EXPERIENCE_ID)
{ {
//this message should be removed by the experience api //this message should be removed by the experience api
continue; continue;
} }
const LLSD& data = it->second; const LLSD& data = it.second;
std::string error_tag = data["error_tag"].asString()+ "ExperienceProfileMessage"; std::string error_tag = data["error_tag"].asString()+ "ExperienceProfileMessage";
LLSD fields; LLSD fields;
if (LLNotificationTemplates::instance().templateExists(error_tag)) if (LLNotificationTemplates::instance().templateExists(error_tag))
@@ -641,21 +638,21 @@ void LLFloaterExperienceProfile::onSaveComplete( const LLSD& content )
const LLSD& experiences = content["experience_keys"]; const LLSD& experiences = content["experience_keys"];
LLSD::array_const_iterator it = experiences.beginArray(); if (experiences.size() == 0)
if (it == experiences.endArray()) {
{
LL_WARNS() << "LLFloaterExperienceProfile::onSaveComplete called with empty content" << LL_ENDL; LL_WARNS() << "LLFloaterExperienceProfile::onSaveComplete called with empty content" << LL_ENDL;
return; return;
} }
if (!it->has(LLExperienceCache::EXPERIENCE_ID) || ((*it)[LLExperienceCache::EXPERIENCE_ID].asUUID() != id)) const auto& exp = experiences[0];
{ if (!exp.has(LLExperienceCache::EXPERIENCE_ID) || (exp[LLExperienceCache::EXPERIENCE_ID].asUUID() != id))
{
LL_WARNS() << "LLFloaterExperienceProfile::onSaveComplete called with unexpected experience id" << LL_ENDL; LL_WARNS() << "LLFloaterExperienceProfile::onSaveComplete called with unexpected experience id" << LL_ENDL;
return; return;
} }
refreshExperience(*it); refreshExperience(exp);
LLExperienceCache::instance().insert(*it); LLExperienceCache::instance().insert(exp);
LLExperienceCache::instance().fetch(id, true); LLExperienceCache::instance().fetch(id, true);
if (mSaveCompleteAction == VIEW) if (mSaveCompleteAction == VIEW)
@@ -872,14 +869,12 @@ bool LLFloaterExperienceProfile::hasPermission(const LLSD& content, const std::s
return false; return false;
const LLSD& list = content[name]; const LLSD& list = content[name];
LLSD::array_const_iterator it = list.beginArray(); for (const auto& it : list.array())
while (it != list.endArray())
{ {
if (it->asUUID() == test) if (it.asUUID() == test)
{ {
return true; return true;
} }
++it;
} }
return false; return false;
} }

View File

@@ -259,9 +259,9 @@ void LLFloaterExperiences::checkAndOpen(LLPanelExperiences* panel, const LLSD& c
if (mPrepurchaseIds.size() + 1 == response_ids.size()) if (mPrepurchaseIds.size() + 1 == response_ids.size())
{ {
// we have a new element // we have a new element
for (LLSD::array_const_iterator it = response_ids.beginArray(); it != response_ids.endArray(); ++it) for (const auto& it : response_ids.array())
{ {
LLUUID experience_id = it->asUUID(); LLUUID experience_id = it.asUUID();
if (std::find(mPrepurchaseIds.begin(), mPrepurchaseIds.end(), experience_id) == mPrepurchaseIds.end()) if (std::find(mPrepurchaseIds.begin(), mPrepurchaseIds.end(), experience_id) == mPrepurchaseIds.end())
{ {
// new element found, open it // new element found, open it

View File

@@ -45,6 +45,7 @@
#include "hbfloatergrouptitles.h" #include "hbfloatergrouptitles.h"
#include "llagent.h" #include "llagent.h"
#include "llagentbenefits.h"
#include "llbutton.h" #include "llbutton.h"
#include "llfloatergroupinvite.h" #include "llfloatergroupinvite.h"
#include "llgroupactions.h" #include "llgroupactions.h"
@@ -187,7 +188,7 @@ void LLPanelGroups::setTexts()
LLUICtrl* ctrl(getChild<LLUICtrl>("groupcount")); LLUICtrl* ctrl(getChild<LLUICtrl>("groupcount"));
size_t count(gAgent.mGroups.size()); size_t count(gAgent.mGroups.size());
ctrl->setTextArg("[COUNT]", llformat("%d", count)); ctrl->setTextArg("[COUNT]", llformat("%d", count));
int maxgroups(gHippoLimits->getMaxAgentGroups()); int maxgroups(LLAgentBenefitsMgr::current().getGroupMembershipLimit());
ctrl->setTextArg("[MAX]", llformat("%d", maxgroups)); ctrl->setTextArg("[MAX]", llformat("%d", maxgroups));
ctrl->setTextArg("[LEFT]", llformat("%d", maxgroups - count)); ctrl->setTextArg("[LEFT]", llformat("%d", maxgroups - count));
} }

View File

@@ -40,6 +40,7 @@
#include "llimagej2c.h" #include "llimagej2c.h"
#include "llagent.h" #include "llagent.h"
#include "llagentbenefits.h"
#include "llbutton.h" #include "llbutton.h"
#include "llcombobox.h" #include "llcombobox.h"
#include "lldrawable.h" #include "lldrawable.h"
@@ -96,7 +97,8 @@ BOOL LLFloaterImagePreview::postBuild()
return FALSE; 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"); LLCtrlSelectionInterface* iface = childGetSelectionInterface("clothing_type_combo");
if (iface) if (iface)
@@ -126,7 +128,11 @@ BOOL LLFloaterImagePreview::postBuild()
// <edit> // <edit>
gSavedSettings.setBOOL("TemporaryUpload",FALSE); gSavedSettings.setBOOL("TemporaryUpload",FALSE);
childSetValue("temp_check",FALSE); auto child = getChildView("temp_check");
if (grid.isSecondLife())
child->setVisible(false);
else
child->setValue(false);
// </edit> // </edit>
} }
else else

View File

@@ -58,6 +58,7 @@ LLFloaterInspect::LLFloaterInspect(const LLSD&)
mDirty(FALSE) mDirty(FALSE)
{ {
mCommitCallbackRegistrar.add("Inspect.OwnerProfile", boost::bind(&LLFloaterInspect::onClickOwnerProfile, this)); 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.CreatorProfile", boost::bind(&LLFloaterInspect::onClickCreatorProfile, this));
mCommitCallbackRegistrar.add("Inspect.SelectObject", boost::bind(&LLFloaterInspect::onSelectObject, this)); mCommitCallbackRegistrar.add("Inspect.SelectObject", boost::bind(&LLFloaterInspect::onSelectObject, this));
LLUICtrlFactory::getInstance()->buildFloater(this, "floater_inspect.xml"); 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() void LLFloaterInspect::onSelectObject()
{ {
if(LLFloaterInspect::getSelectedUUID() != LLUUID::null) if(LLFloaterInspect::getSelectedUUID() != LLUUID::null)

View File

@@ -60,6 +60,7 @@ public:
virtual void onFocusReceived(); virtual void onFocusReceived();
void onClickCreatorProfile(); void onClickCreatorProfile();
void onClickOwnerProfile(); void onClickOwnerProfile();
void onClickLastOwnerProfile();
void onSelectObject(); void onSelectObject();
LLScrollListCtrl* mObjectList; LLScrollListCtrl* mObjectList;

View File

@@ -4405,24 +4405,27 @@ bool LLModelPreview::lodQueryCallback()
// not the best solution, but model preview belongs to floater // not the best solution, but model preview belongs to floater
// so it is an easy way to check that preview still exists. // so it is an easy way to check that preview still exists.
LLFloaterModelPreview* fmp = LLFloaterModelPreview::sInstance; LLFloaterModelPreview* fmp = LLFloaterModelPreview::sInstance;
if (fmp && fmp->mModelPreview) if (fmp)
{
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]); if (fmp->mModelPreview)
icon->setVisible(true); {
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 // nothing to process

View File

@@ -48,11 +48,11 @@
#include "llviewermenufile.h" // upload_new_resource() #include "llviewermenufile.h" // upload_new_resource()
#include "lluictrlfactory.h" #include "lluictrlfactory.h"
#include "llstring.h" #include "llstring.h"
#include "lleconomy.h"
// linden includes // linden includes
#include "llassetstorage.h" #include "llassetstorage.h"
#include "llinventorytype.h" #include "llinventorytype.h"
#include "llagentbenefits.h"
#include "hippogridmanager.h" #include "hippogridmanager.h"
@@ -134,13 +134,37 @@ BOOL LLFloaterNameDesc::postBuild()
// Cancel button // Cancel button
getChild<LLUICtrl>("cancel_btn")->setCommitCallback(boost::bind(&LLFloaterNameDesc::onBtnCancel, this)); 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"); setDefaultBtn("ok_btn");
return TRUE; 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() // LLFloaterNameDesc()
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
@@ -173,7 +197,8 @@ void LLFloaterNameDesc::onBtnOK()
getChildView("ok_btn")->setEnabled(FALSE); // don't allow inadvertent extra uploads getChildView("ok_btn")->setEnabled(FALSE); // don't allow inadvertent extra uploads
LLAssetStorage::LLStoreAssetCallback callback = NULL; 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; void *nruserdata = NULL;
std::string display_name = LLStringUtil::null; std::string display_name = LLStringUtil::null;

Some files were not shown because too many files have changed in this diff Show More