Compare commits

..

178 Commits

Author SHA1 Message Date
Liru Færs
4df2193a4c [Chat Logs] Always read from name cache on start to try to update ID Map 2020-04-19 16:40:17 -04:00
Liru Færs
343be08467 [Chat Logs] Break out migrateFile from makeLogFileName for use elsewhere 2020-04-19 15:50:50 -04:00
Liru Færs
788b83bff3 Woops, thanks for catching this, Shyotl! 2020-04-18 19:15:49 -04:00
Liru Færs
c201ac90ba Track log names in a json map AND Fix processing local log load as system
Update old style callbacks for chatFromLogFile functions to lambdas
Keep track of people's log's name using their IDs, but don't rename.
Fallback on ID if name is empty (if the grid is a meanie)
Also track group names this way, sometimes those change.
Prefer std::array, since we're in the area.
2020-04-18 00:17:05 -04:00
Shyotl
af3c66ad08 Merge branch 'master' of https://github.com/singularity-viewer/SingularityViewer.git 2020-04-16 02:23:32 -05:00
Shyotl
9bffc4bb82 Attempt to squash spatial partition crash. 2020-04-16 00:52:55 -05:00
Shyotl
132db6225e Make Debug configuration compile once more. 2020-04-16 00:49:42 -05:00
Shyotl
257086cbfc Revert texture fetching behavior back closer to v3. 2020-04-16 00:36:56 -05:00
Liru Færs
7755f1ec52 Merge branch 'master' of https://github.com/RouterGray/SingularityViewer 2020-04-11 10:28:04 -04:00
Router Gray
c5f1ac808b Fix postcard sends, use cap for user info, stop using 'from' email as per upstream. Mark final and overrides. Thanks Nadira Fairport for reporting & Liru for help. 2020-04-11 09:22:26 -05:00
Liru Færs
1a8660909d Copy Folder ID and Open Folder In New Window for ANY folder 2020-04-10 17:40:06 -04:00
Shyotl
e6826a4c7c Fix 'is typing...' notifications never going away. 2020-04-10 16:28:37 -05:00
Router Gray
801bb8a075 Compile fix, make types agree in terniary in octree. Thanks Liru. 2020-04-10 13:21:57 -05:00
Shyotl
b2c965e22d Do not apply internal windlight parameter scaling on the sliders themselves. 2020-04-09 14:20:55 -05:00
Shyotl
be3cbc642b Update current region debug string upon cap seed request. Carry over seed cap if dead region is replaced with new. 2020-04-09 02:12:36 -05:00
Shyotl
24331d3c90 Prefer LLPointer over potential for dangling LLSpatialGroup pointers. 2020-04-09 01:56:32 -05:00
Shyotl
8a16e6c99f Merge branch 'master' of https://github.com/singularity-viewer/SingularityViewer.git 2020-04-08 18:18:19 -05:00
Shyotl
f36e8fbeca Better crashdump context. 2020-04-08 18:11:09 -05:00
Liru Færs
718ef09adf Fix removing/exporting picks when unable to add more
Wooops, wrote that wrong, must've been tired or something
2020-04-08 09:21:21 -04:00
Liru Færs
6443849ea9 Do not lookup strings in the toolbar per frame, ack! 2020-04-08 08:33:41 -04:00
Liru Færs
cbb7e473ba Merge branch 'master' of git://github.com/Shyotl/SingularityViewer 2020-04-08 06:59:48 -04:00
Liru Færs
118957362f Fix mismatched tag 2020-04-08 05:11:11 -04:00
Shyotl
ed7f73769f Potentially fix crash in LLSurface 2020-04-07 23:30:12 -05:00
Liru Færs
ae15dcb318 Merge 41224c57317b6c1b44528aa1dc1f13732cdffe6d from viewer-lion... sorta
Fixes broken default perms message sometimes popping up for certain avs
2020-04-07 16:55:58 -04:00
Liru Færs
c4af22481c Update mesh export code, cause why not. 2020-04-07 15:30:13 -04:00
Liru Færs
ae17f76bb4 Remove now unused LLIMInfo 2020-04-07 10:49:48 -04:00
Liru Færs
7e62d17fda Don't try to use region if it's null for permissions defaults 2020-04-07 05:56:06 -04:00
Liru Færs
f9185e8bc8 Fix mutelist popping up, I think
LLMuteList::add should return false if nothing new was added
2020-04-07 05:55:24 -04:00
Liru Færs
1361f9b57d Simplify selection of mute 2020-04-07 04:29:45 -04:00
Liru Færs
b86eae026b Sync to fix using gMessageSystem when it may not have the right message 2020-04-07 04:29:20 -04:00
Liru Færs
79d938a4f4 Sync LLMuteList code with upstream 2020-04-07 02:51:08 -04:00
Liru Færs
23068a70a2 Select Mute when muting object via Object profile 2020-04-06 07:53:42 -04:00
Shyotl
0aa5e0bb88 Close 'default permissions' window on client disconnect. Nonfunctional after that point anyhow. Also applying setting crashes due to null region after dc. 2020-04-05 14:56:35 -05:00
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
319 changed files with 9597 additions and 8917 deletions

View File

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

View File

@@ -410,11 +410,11 @@
<key>archive</key>
<map>
<key>hash</key>
<string>4614b29cc98021cf1770a8290171602b</string>
<string>a96fda7ad5cee967823f5c94390ba35b</string>
<key>hash_algorithm</key>
<string>md5</string>
<key>url</key>
<string>https://pkg.alchemyviewer.org/repository/autobuild-external/crashpad/windows/crashpad-ce32d093.7-windows-7.tar.bz2</string>
<string>https://pkg.alchemyviewer.org/repository/autobuild-external/crashpad/windows/crashpad-c6d76a90.194-windows-194.tar.bz2</string>
</map>
<key>name</key>
<string>windows</string>
@@ -424,18 +424,18 @@
<key>archive</key>
<map>
<key>hash</key>
<string>d801461b7a6a40fffab828aa1e01e3e6</string>
<string>5ff95ca1007ed2dc300b59de17453201</string>
<key>hash_algorithm</key>
<string>md5</string>
<key>url</key>
<string>https://pkg.alchemyviewer.org/repository/autobuild-external/crashpad/windows64/crashpad-ce32d093.7-windows64-7.tar.bz2</string>
<string>https://pkg.alchemyviewer.org/repository/autobuild-external/crashpad/windows64/crashpad-c6d76a90.194-windows64-194.tar.bz2</string>
</map>
<key>name</key>
<string>windows64</string>
</map>
</map>
<key>version</key>
<string>ce32d093.7</string>
<string>c6d76a90.194</string>
</map>
<key>curl</key>
<map>
@@ -664,11 +664,11 @@
<key>archive</key>
<map>
<key>hash</key>
<string>06746b78827e9a0c6b666bd2528d36ad</string>
<string>695efb6fc548a56dc4ff34e8d9a37bfb</string>
<key>hash_algorithm</key>
<string>md5</string>
<key>url</key>
<string>https://bitbucket.org/SingularityViewer/libraries/downloads/dullahan-1.1.1320_73.1.12%252Bgee4b49f%252Bchromium-73.0.3683.75-linux64-192030536.tar.bz2</string>
<string>https://bitbucket.org/router_gray/3p-dullahan/downloads/dullahan-1.3.202002250830_79.1.38_gecefb59_chromium-79.0.3945.130-linux64-200580406.tar.bz2</string>
</map>
<key>name</key>
<string>linux64</string>
@@ -678,9 +678,11 @@
<key>archive</key>
<map>
<key>hash</key>
<string>e19b664ad8cf9e7f4a7bf649d28faa76</string>
<string>1b278ff2535f428ea6536683d096fdd0</string>
<key>hash_algorithm</key>
<string>md5</string>
<key>url</key>
<string>https://bitbucket.org/SingularityViewer/libraries/downloads/dullahan-1.1.1320_73.1.12+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>
<key>name</key>
<string>windows</string>
@@ -690,18 +692,18 @@
<key>archive</key>
<map>
<key>hash</key>
<string>414190fd1ce3876ee3efc682b06ae65c</string>
<string>b9346fea7643b10308c7bd9a769ef5f7</string>
<key>hash_algorithm</key>
<string>md5</string>
<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>
<key>name</key>
<string>windows64</string>
</map>
</map>
<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>
<key>elfio</key>
<map>
@@ -816,7 +818,7 @@
<key>fmodstudio</key>
<map>
<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>
<string>FMOD Studio audio system library</string>
<key>license</key>
@@ -888,11 +890,11 @@
<key>archive</key>
<map>
<key>hash</key>
<string>22daed7c860daaef217eb8d90dfc1119</string>
<string>d32efb193ffcd73bcba4875ddfd17bf0</string>
<key>hash_algorithm</key>
<string>md5</string>
<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>
<key>name</key>
<string>windows</string>
@@ -902,18 +904,18 @@
<key>archive</key>
<map>
<key>hash</key>
<string>ccf7b1935743df55244139c4323c0465</string>
<string>0604fd6b53ceaf14ce04d0de1bea51b8</string>
<key>hash_algorithm</key>
<string>md5</string>
<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>
<key>name</key>
<string>windows64</string>
</map>
</map>
<key>version</key>
<string>2.00.06.3</string>
<string>2.00.07.4</string>
</map>
<key>fonts</key>
<map>
@@ -996,7 +998,7 @@
<key>freetype</key>
<map>
<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>
<string>Font rendering library</string>
<key>license</key>
@@ -1931,38 +1933,6 @@
<key>version</key>
<string>7.11.1.297294</string>
</map>
<key>modernjson</key>
<map>
<key>copyright</key>
<string>Copyright (c) 2013-2018 Niels Lohmann</string>
<key>description</key>
<string>JSON for Modern C++</string>
<key>license</key>
<string>MIT</string>
<key>license_file</key>
<string>LICENSES/modernjson.txt</string>
<key>name</key>
<string>modernjson</string>
<key>platforms</key>
<map>
<key>common</key>
<map>
<key>archive</key>
<map>
<key>hash</key>
<string>6f11eca7e2a6ca61f9217e949a64f026</string>
<key>hash_algorithm</key>
<string>md5</string>
<key>url</key>
<string>https://depot.alchemyviewer.org/pub/common/lib/modernjson-3.2.0-common-201809210551.tar.bz2</string>
</map>
<key>name</key>
<string>common</string>
</map>
</map>
<key>version</key>
<string>3.2.0</string>
</map>
<key>nvapi</key>
<map>
<key>copyright</key>
@@ -2506,7 +2476,7 @@
<key>vlc-bin</key>
<map>
<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>
<string>GPL2</string>
<key>license_file</key>
@@ -2544,9 +2514,9 @@
<key>archive</key>
<map>
<key>hash</key>
<string>add560654a53cb1c554044a4fac3c718</string>
<string>3ff1d097e4f9b8f864a639aff974a506</string>
<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>
<key>name</key>
<string>windows</string>
@@ -2556,16 +2526,16 @@
<key>archive</key>
<map>
<key>hash</key>
<string>94bf04b49acc1e1bf2c06e2232f8a083</string>
<string>b890b109b526cc6ad211eadefed83316</string>
<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>
<key>name</key>
<string>windows64</string>
</map>
</map>
<key>version</key>
<string>2.2.8.511703</string>
<string>3.0.8.189</string>
</map>
<key>xmlrpc-epi</key>
<map>

View File

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

View File

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

View File

@@ -13,10 +13,6 @@ include(LLCommon)
# set up platform specific lists of files that need to be copied
###################################################################
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_RELWITHDEBINFO "${SHARED_LIB_STAGING_DIR}/RelWithDebInfo")
set(SHARED_LIB_STAGING_DIR_RELEASE "${SHARED_LIB_STAGING_DIR}/Release")
@@ -96,26 +92,6 @@ if(WINDOWS)
list(APPEND release_files fmod.dll)
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)
set(SHARED_LIB_STAGING_DIR_DEBUG "${SHARED_LIB_STAGING_DIR}/Debug/Resources")
set(SHARED_LIB_STAGING_DIR_RELWITHDEBINFO "${SHARED_LIB_STAGING_DIR}/RelWithDebInfo/Resources")
@@ -148,10 +124,10 @@ elseif(DARWIN)
libndofdev.dylib
)
if (FMODSTUDIO)
if (USE_FMODSTUDIO)
list(APPEND debug_files libfmodL.dylib)
list(APPEND release_files libfmod.dylib)
endif (FMODSTUDIO)
endif (USE_FMODSTUDIO)
elseif(LINUX)
# linux is weird, multiple side by side configurations aren't supported
@@ -181,12 +157,9 @@ elseif(LINUX)
set(release_files
libapr-1.so.0
libaprutil-1.so.0
libatk-1.0.so
libexpat.so
libexpat.so.1
libGLOD.so
libgmodule-2.0.so
libgobject-2.0.so
libopenal.so
)

View File

@@ -1,24 +1,11 @@
# -*- cmake -*-
include(Prebuilt)
if (STANDALONE)
if (LINUX)
include(FindPkgConfig)
pkg_check_modules(DBUSGLIB REQUIRED dbus-glib-1)
elseif (LINUX)
use_prebuilt_binary(dbus-glib)
set(DBUSGLIB_FOUND ON FORCE BOOL)
set(DBUSGLIB_INCLUDE_DIRS
${LIBS_PREBUILT_DIR}/include/dbus
)
# We don't need to explicitly link against dbus-glib itself, because
# the viewer probes for the system's copy at runtime.
set(DBUSGLIB_LIBRARIES
gobject-2.0
glib-2.0
)
endif (STANDALONE)
endif (LINUX)
if (DBUSGLIB_FOUND)
set(DBUSGLIB ON CACHE BOOL "Build with dbus-glib message bus support.")

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
)
add_definitions(-DOV_EXCLUDE_STATIC_CALLBACKS)
#add_definitions(-DOV_EXCLUDE_STATIC_CALLBACKS)
set(LLAUDIO_LIBRARIES llaudio ${OPENAL_LIBRARIES})

View File

@@ -1,11 +1,9 @@
# -*- cmake -*-
include(Prebuilt)
include(FreeType)
if (STANDALONE)
if (LINUX)
include(FindPkgConfig)
if (LINUX)
set(PKGCONFIG_PACKAGES
atk
cairo
@@ -21,8 +19,8 @@ if (STANDALONE)
pangox
pangoxft
sdl
x11
)
endif (LINUX)
foreach(pkg ${PKGCONFIG_PACKAGES})
pkg_check_modules(${pkg} REQUIRED ${pkg})
@@ -31,39 +29,6 @@ if (STANDALONE)
list(APPEND UI_LIBRARIES ${${pkg}_LIBRARIES})
add_definitions(${${pkg}_CFLAGS_OTHERS})
endforeach(pkg)
else (STANDALONE)
if (LINUX)
use_prebuilt_binary(gtk-atk-pango-glib)
set(UI_LIBRARIES
atk-1.0
cairo
gdk-x11-2.0
gdk_pixbuf-2.0
Xinerama
glib-2.0
gio-2.0
gmodule-2.0
gobject-2.0
gthread-2.0
gtk-x11-2.0
pango-1.0
pangoft2-1.0
pangoxft-1.0
pangocairo-1.0
pixman-1
X11
${FREETYPE_LIBRARIES}
)
endif (LINUX)
include_directories (
${LIBS_PREBUILT_DIR}/include
)
foreach(include ${${LL_ARCH}_INCLUDES})
include_directories(${LIBS_PREBUILT_DIR}/include/${include})
endforeach(include)
endif (STANDALONE)
if (LINUX)
add_definitions(-DLL_GTK=1 -DLL_X11=1)
endif (LINUX)

View File

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

View File

@@ -15,10 +15,15 @@ FetchContent_Declare(
GIT_REPOSITORY https://github.com/fmtlib/fmt.git
GIT_TAG 6.1.2
)
FetchContent_Declare(
nlohmann_json
GIT_REPOSITORY https://github.com/nlohmann/json.git
GIT_TAG v3.7.3
)
FetchContent_Declare(
absl
GIT_REPOSITORY https://github.com/abseil/abseil-cpp.git
GIT_TAG 29235139149790f5afc430c11cec8f1eb1677607
GIT_TAG 0033c9ea91a52ade7c6b725aa2ef3cbe15463421
)
# This is a hack because absl has dumb cmake
@@ -44,5 +49,14 @@ if(WINDOWS)
FetchContent_MakeAvailable(fmt)
endif()
# Typically you don't care so much for a third party library's tests to be
# run from your own project's code.
set(JSON_BuildTests OFF CACHE INTERNAL "")
# If you only include this third party in PRIVATE source files, you do not
# need to install it when your main project gets installed.
set(JSON_Install OFF CACHE INTERNAL "")
FetchContent_MakeAvailable(nlohmann_json)
unset(CMAKE_FOLDER)
unset(CMAKE_POSITION_INDEPENDENT_CODE)

View File

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

View File

@@ -132,7 +132,7 @@ class LL_COMMON_API AIArgs
// Add another replacement.
AIArgs& operator()(char const* key, std::string const& replacement) { mArgs[key] = replacement; return *this; }
// The destructor may not throw.
~AIArgs() throw() { }
~AIArgs() noexcept { }
// Accessor.
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(Prefix const& prefix, bool newline = false) : mNewline(newline), mXmlDesc("AIPrefix"), mArgs("[PREFIX]", prefix.str()), mType(prefix.type()) { }
// The destructor may not throw.
~Line() throw() { }
~Line() noexcept { }
// Prepend a newline before this line.
void set_newline(void) { mNewline = true; }
@@ -225,7 +225,7 @@ class LL_COMMON_API Error : public std::exception
typedef std::deque<Line> lines_type;
// The destructor may not throw.
~Error() throw() { }
~Error() noexcept { }
// Accessors.
lines_type const& lines(void) const { return mLines; }
@@ -267,7 +267,7 @@ class LL_COMMON_API ErrorCode : public Error
public:
// The destructor may not throw.
~ErrorCode() throw() { }
~ErrorCode() noexcept { }
// Accessor.
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;
// attachment constants
const U32 MAX_AGENT_ATTACHMENTS = 38;
const U8 ATTACHMENT_ADD = 0x80;
// 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
#ifdef SHOW_DEBUG
#define DO_DEBUG_LOG
#else
#define DO_DEBUG_LOG if (false)
#endif
// Pass comma separated list of tags (currently only supports up to 0, 1, or 2)
#define LL_DEBUGS(...) lllog(LLError::LEVEL_DEBUG, false, false, ##__VA_ARGS__)
#define LL_DEBUGS(...) DO_DEBUG_LOG lllog(LLError::LEVEL_DEBUG, false, false, ##__VA_ARGS__)
#define LL_INFOS(...) lllog(LLError::LEVEL_INFO, false, false, ##__VA_ARGS__)
#define LL_WARNS(...) lllog(LLError::LEVEL_WARN, false, false, ##__VA_ARGS__)
#define LL_ERRS(...) lllog(LLError::LEVEL_ERROR, false, false, ##__VA_ARGS__)
@@ -363,12 +369,12 @@ typedef LLError::NoClassInfo _LL_CLASS_TO_LOG;
// Only print the log message once (good for warnings or infos that would otherwise
// spam the log file over and over, such as tighter loops).
#define LL_DEBUGS_ONCE(...) lllog(LLError::LEVEL_DEBUG, true, false, ##__VA_ARGS__)
#define LL_DEBUGS_ONCE(...) DO_DEBUG_LOG lllog(LLError::LEVEL_DEBUG, true, false, ##__VA_ARGS__)
#define LL_INFOS_ONCE(...) lllog(LLError::LEVEL_INFO, true, false, ##__VA_ARGS__)
#define LL_WARNS_ONCE(...) lllog(LLError::LEVEL_WARN, true, false, ##__VA_ARGS__)
// No function name
#define LL_DEBUGS_NF(...) lllog(LLError::LEVEL_DEBUG, false, true, ##__VA_ARGS__)
#define LL_DEBUGS_NF(...) DO_DEBUG_LOG {lllog(LLError::LEVEL_DEBUG, false, true, ##__VA_ARGS__)
#define LL_INFOS_NF(...) lllog(LLError::LEVEL_INFO, false, true, ##__VA_ARGS__)
#define LL_WARNS_NF(...) lllog(LLError::LEVEL_WARN, false, true, ##__VA_ARGS__)
#define LL_ERRS_NF(...) lllog(LLError::LEVEL_ERROR, false, true, ##__VA_ARGS__)

View File

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

View File

@@ -381,10 +381,9 @@ std::string LLSDArgsMapper::formatlist(const LLSD& list)
{
std::ostringstream out;
const char* delim = "";
for (LLSD::array_const_iterator li(list.beginArray()), lend(list.endArray());
li != lend; ++li)
for (auto const& entry : list.array())
{
out << delim << li->asString();
out << delim << entry.asString();
delim = ", ";
}
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
// optional. What's left are the ones that are required.
for (LLSD::array_const_iterator pi(params.beginArray()), pend(params.endArray());
pi != pend; ++pi)
for (auto const& entry : params.array())
{
mRequired[pi->asString()] = LLSD();
mRequired[entry.asString()] = LLSD();
}
if (defaults.isArray() || defaults.isUndefined())

View File

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

View File

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

View File

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

View File

@@ -320,6 +320,8 @@ public:
typedef std::map<String, LLSD>::iterator map_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 endMap();
map_const_iterator beginMap() const;
@@ -329,6 +331,8 @@ public:
typedef std::vector<LLSD>::const_iterator array_const_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 endArray();
array_const_iterator beginArray() const;

View File

@@ -122,9 +122,9 @@ nlohmann::json LlsdToJson(const LLSD &val)
}
break;
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;
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())
{
for (LLSD::array_const_iterator it = sd.beginArray();
it != sd.endArray();
++it)
for (auto const& entry : sd.array())
{
stack.push_back(make_pair(std::string(), true));
readSDValues(cb, *it, stack);
readSDValues(cb, entry, stack);
stack.pop_back();
}
}

View File

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

View File

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

View File

@@ -891,9 +891,9 @@ LLSD llsd_clone(LLSD value, LLSD filter)
break;
case LLSD::TypeArray:
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;
@@ -943,9 +943,9 @@ LLSD llsd_shallow(LLSD value, LLSD filter)
else if (value.isArray())
{
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

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)
try
{
strStream.imbue(std::locale(sLocale.c_str()));
std::locale locale(sLocale.c_str());
strStream.imbue(locale);
} catch (const std::exception &)
{
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; }
std::size_t length() const { return mString.length(); }
// The destructor may not throw.
~LLFormatMapString() throw() { }
~LLFormatMapString() noexcept { }
private:
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;
BOOL retval = FALSE;
gzFile src = NULL;
U8 buffer[UNCOMPRESS_BUFFER_SIZE];
std::array<U8, UNCOMPRESS_BUFFER_SIZE> buffer;
LLFILE *dst = NULL;
S32 bytes = 0;
tmpfile = dstfile + ".t";
@@ -1288,8 +1288,8 @@ BOOL gunzip_file(const std::string& srcfile, const std::string& dstfile)
if (! dst) goto err;
do
{
bytes = gzread(src, buffer, UNCOMPRESS_BUFFER_SIZE);
size_t nwrit = fwrite(buffer, sizeof(U8), bytes, dst);
bytes = gzread(src, buffer.data(), buffer.size());
size_t nwrit = fwrite(buffer.data(), sizeof(U8), bytes, dst);
if (nwrit < (size_t) bytes)
{
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;
std::string tmpfile;
BOOL retval = FALSE;
U8 buffer[COMPRESS_BUFFER_SIZE];
std::array<U8, COMPRESS_BUFFER_SIZE> buffer;
gzFile dst = NULL;
LLFILE *src = NULL;
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 */
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;
goto err;

View File

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

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;
case LLSD::TypeArray:
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;
//case LLSD::TypeInteger:
@@ -137,9 +137,9 @@ LLSD LLSettingsBase::combineSDMaps(const LLSD &settings, const LLSD &other) cons
break;
case LLSD::TypeArray:
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;
//case LLSD::TypeInteger:

View File

@@ -240,16 +240,16 @@ bool LLSettingsDay::initialize(bool validate_frames)
{
mDayTracks[i].clear();
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);
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)
{
setting = used[key_name];
@@ -469,36 +469,36 @@ namespace
S32 framecount(0);
for (LLSD::array_iterator track = value.beginArray(); track != value.endArray(); ++track)
for (auto& entry : value.array())
{
S32 index = 0;
while (index < (*track).size())
while (index < entry.size())
{
LLSD& elem = (*track)[index];
LLSD& elem = entry[index];
++framecount;
if (index >= LLSettingsDay::FRAME_MAX)
{
(*track).erase(index);
entry.erase(index);
continue;
}
if (!elem.has(LLSettingsDay::SETTING_KEYKFRAME))
{
(*track).erase(index);
entry.erase(index);
continue;
}
if (!elem[LLSettingsDay::SETTING_KEYKFRAME].isReal())
{
(*track).erase(index);
entry.erase(index);
continue;
}
if (!elem.has(LLSettingsDay::SETTING_KEYNAME) &&
!elem.has(LLSettingsDay::SETTING_KEYID))
{
(*track).erase(index);
entry.erase(index);
continue;
}

View File

@@ -126,9 +126,12 @@ public:
// Returns true if this rotation is orthonormal with det ~= 1
inline bool isOkRotation() const;
} LL_ALIGN_POSTFIX(16);
#if !defined(LL_DEBUG)
static_assert(std::is_trivial<LLMatrix3a>::value, "LLMatrix3a must be a trivial type");
static_assert(std::is_standard_layout<LLMatrix3a>::value, "LLMatrix3a must be a standard layout type");
static_assert(std::is_trivial<LLRotation>::value, "LLRotation must be a trivial type");
static_assert(std::is_standard_layout<LLRotation>::value, "LLRotation must be a standard layout type");
#endif
#endif

View File

@@ -718,6 +718,8 @@ inline std::ostream& operator<<(std::ostream& s, const LLMatrix4a& m)
void matMulBoundBox(const LLMatrix4a &a, const LLVector4a *in_extents, LLVector4a *out_extents);
#if !defined(LL_DEBUG)
static_assert(std::is_trivial<LLMatrix4a>::value, "LLMatrix4a must be a trivial type");
static_assert(std::is_standard_layout<LLMatrix4a>::value, "LLMatrix4a must be a standard layout type");
#endif
#endif

View File

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

View File

@@ -104,7 +104,8 @@ private:
LL_ALIGN_16(LLVector4a mV);
} LL_ALIGN_POSTFIX(16);
#if !defined(LL_DEBUG)
static_assert(std::is_trivial<LLPlane>::value, "LLPlane must be a trivial type");
static_assert(std::is_standard_layout<LLPlane>::value, "LLPlane must be a standard layout type");
#endif
#endif // LL_LLPLANE_H

View File

@@ -105,7 +105,9 @@ protected:
} LL_ALIGN_POSTFIX(16);
#if !defined(LL_DEBUG)
static_assert(std::is_trivial<LLQuaternion2>::value, "LLQuaternion2 must be a trivial type");
static_assert(std::is_standard_layout<LLQuaternion2>::value, "LLQuaternion2 must be a standard layout type");
#endif
#endif

View File

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

View File

@@ -350,6 +350,8 @@ inline std::ostream& operator<<(std::ostream& s, const LLVector4a& v)
return s;
}
#if !defined(LL_DEBUG)
static_assert(std::is_trivial<LLVector4a>::value, "LLVector4a must be a be a trivial type");
static_assert(std::is_standard_layout<LLVector4a>::value, "LLVector4a must be a standard layout type");
#endif
#endif

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@@ -262,6 +262,8 @@ LLCacheName::~LLCacheName()
delete &impl;
}
const ReverseCache& LLCacheName::getReverseMap() const { return impl.mReverseCache; }
LLCacheName::Impl::Impl(LLMessageSystem* msg)
: mMsg(msg), mUpstreamHost(LLHost::invalid)
{

View File

@@ -57,6 +57,8 @@ public:
LLCacheName(LLMessageSystem* msg, const LLHost& upstream_host);
~LLCacheName();
const std::map<std::string, LLUUID>& getReverseMap() const;
// registers the upstream host
// for viewers, this is the currently connected simulator
// for simulators, this is the data server

View File

@@ -28,15 +28,35 @@
#include <functional>
#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;
LLCoroResponder(const cb_t& cb) : mCB(cb) {}
LLCoroResponder(const cb_t& cb) : mCB(cb) {}
void httpCompleted() override { mCB(*this); }
const AIHTTPReceivedHeaders& getHeaders() const { return mReceivedHeaders; }
const LLSD& getContent() const { return mContent; }
char const* getName() const override { return "LLCoroResponder"; }
private:
const cb_t mCB;
};
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:
const cb_t mCB;
};

View File

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

View File

@@ -58,103 +58,6 @@ const std::string SYSTEM_FROM("Second Life");
const std::string INTERACTIVE_SYSTEM_FROM("F387446C-37C4-45f2-A438-D99CBDBB563B");
const S32 IM_TTL = 1;
/**
* LLIMInfo
*/
LLIMInfo::LLIMInfo() :
mFromGroup(FALSE),
mParentEstateID(0),
mOffline(0),
mViewerThinksToIsOnline(false),
mIMType(IM_NOTHING_SPECIAL),
mTimeStamp(0),
mSource(IM_FROM_SIM),
mTTL(IM_TTL)
{
}
LLIMInfo::LLIMInfo(
const LLUUID& from_id,
BOOL from_group,
const LLUUID& to_id,
EInstantMessage im_type,
const std::string& name,
const std::string& message,
const LLUUID& id,
U32 parent_estate_id,
const LLUUID& region_id,
const LLVector3& position,
LLSD data,
U8 offline,
U32 timestamp,
EIMSource source,
S32 ttl) :
mFromID(from_id),
mFromGroup(from_group),
mToID(to_id),
mParentEstateID(0),
mRegionID(region_id),
mPosition(position),
mOffline(offline),
mViewerThinksToIsOnline(false),
mIMType(im_type),
mID(id),
mTimeStamp(timestamp),
mName(name),
mMessage(message),
mData(data),
mSource(source),
mTTL(ttl)
{
}
LLIMInfo::LLIMInfo(LLMessageSystem* msg, EIMSource source, S32 ttl) :
mViewerThinksToIsOnline(false),
mSource(source),
mTTL(ttl)
{
unpackMessageBlock(msg);
}
LLIMInfo::~LLIMInfo()
{
}
void LLIMInfo::packInstantMessage(LLMessageSystem* msg) const
{
LL_DEBUGS() << "LLIMInfo::packInstantMessage()" << LL_ENDL;
msg->newMessageFast(_PREHASH_ImprovedInstantMessage);
packMessageBlock(msg);
}
void LLIMInfo::packMessageBlock(LLMessageSystem* msg) const
{
// Construct binary bucket
std::vector<U8> bucket;
if (mData.has("binary_bucket"))
{
bucket = mData["binary_bucket"].asBinary();
}
pack_instant_message_block(
msg,
mFromID,
mFromGroup,
LLUUID::null,
mToID,
mName,
mMessage,
mOffline,
mIMType,
mID,
mParentEstateID,
mRegionID,
mPosition,
mTimeStamp,
&bucket[0],
bucket.size());
}
void pack_instant_message(
LLMessageSystem* msg,
const LLUUID& from_id,
@@ -264,124 +167,3 @@ void pack_instant_message_block(
}
msg->addBinaryDataFast(_PREHASH_BinaryBucket, bb, binary_bucket_size);
}
void LLIMInfo::unpackMessageBlock(LLMessageSystem* msg)
{
msg->getUUIDFast(_PREHASH_AgentData, _PREHASH_AgentID, mFromID);
msg->getBOOLFast(_PREHASH_MessageBlock, _PREHASH_FromGroup, mFromGroup);
msg->getUUIDFast(_PREHASH_MessageBlock, _PREHASH_ToAgentID, mToID);
msg->getU32Fast(_PREHASH_MessageBlock, _PREHASH_ParentEstateID, mParentEstateID);
msg->getUUIDFast(_PREHASH_MessageBlock, _PREHASH_RegionID, mRegionID);
msg->getVector3Fast(_PREHASH_MessageBlock, _PREHASH_Position, mPosition);
msg->getU8Fast(_PREHASH_MessageBlock, _PREHASH_Offline, mOffline);
U8 dialog;
msg->getU8Fast(_PREHASH_MessageBlock, _PREHASH_Dialog, dialog);
mIMType = (EInstantMessage) dialog;
msg->getUUIDFast(_PREHASH_MessageBlock, _PREHASH_ID, mID);
msg->getU32Fast(_PREHASH_MessageBlock, _PREHASH_Timestamp, mTimeStamp);
msg->getStringFast(_PREHASH_MessageBlock, _PREHASH_FromAgentName, mName);
msg->getStringFast(_PREHASH_MessageBlock, _PREHASH_Message, mMessage);
S32 binary_bucket_size = llmin(
MTUBYTES,
msg->getSizeFast(
_PREHASH_MessageBlock,
_PREHASH_BinaryBucket));
if(binary_bucket_size > 0)
{
std::vector<U8> bucket;
bucket.resize(binary_bucket_size);
msg->getBinaryDataFast(
_PREHASH_MessageBlock,
_PREHASH_BinaryBucket,
&bucket[0],
0,
0,
binary_bucket_size);
mData["binary_bucket"] = bucket;
}
else
{
mData.clear();
}
}
LLSD im_info_to_llsd(LLPointer<LLIMInfo> im_info)
{
LLSD param_version;
param_version["version"] = 1;
LLSD param_message;
param_message["from_id"] = im_info->mFromID;
param_message["from_group"] = im_info->mFromGroup;
param_message["to_id"] = im_info->mToID;
param_message["from_name"] = im_info->mName;
param_message["message"] = im_info->mMessage;
param_message["type"] = (S32)im_info->mIMType;
param_message["id"] = im_info->mID;
param_message["timestamp"] = (S32)im_info->mTimeStamp;
param_message["offline"] = (S32)im_info->mOffline;
param_message["parent_estate_id"] = (S32)im_info->mParentEstateID;
param_message["region_id"] = im_info->mRegionID;
param_message["position"] = ll_sd_from_vector3(im_info->mPosition);
param_message["data"] = im_info->mData;
param_message["source"]= im_info->mSource;
param_message["ttl"] = im_info->mTTL;
LLSD param_agent;
param_agent["agent_id"] = im_info->mFromID;
LLSD params;
params["version_params"] = param_version;
params["message_params"] = param_message;
params["agent_params"] = param_agent;
return params;
}
LLPointer<LLIMInfo> llsd_to_im_info(const LLSD& im_info_sd)
{
LLSD param_message = im_info_sd["message_params"];
LLSD param_agent = im_info_sd["agent_params"];
LLPointer<LLIMInfo> im_info = new LLIMInfo(
param_message["from_id"].asUUID(),
param_message["from_group"].asBoolean(),
param_message["to_id"].asUUID(),
(EInstantMessage) param_message["type"].asInteger(),
param_message["from_name"].asString(),
param_message["message"].asString(),
param_message["id"].asUUID(),
(U32) param_message["parent_estate_id"].asInteger(),
param_message["region_id"].asUUID(),
ll_vector3_from_sd(param_message["position"]),
param_message["data"],
(U8) param_message["offline"].asInteger(),
(U32) param_message["timestamp"].asInteger(),
(EIMSource)param_message["source"].asInteger(),
param_message["ttl"].asInteger());
return im_info;
}
LLPointer<LLIMInfo> LLIMInfo::clone()
{
return new LLIMInfo(
mFromID,
mFromGroup,
mToID,
mIMType,
mName,
mMessage,
mID,
mParentEstateID,
mRegionID,
mPosition,
mData,
mOffline,
mTimeStamp,
mSource,
mTTL);
}

View File

@@ -225,62 +225,6 @@ extern const std::string INTERACTIVE_SYSTEM_FROM;
// Number of retry attempts on sending the im.
extern const S32 IM_TTL;
class LLIMInfo : public LLRefCount
{
protected:
LLIMInfo();
~LLIMInfo();
public:
LLIMInfo(LLMessageSystem* msg,
EIMSource source = IM_FROM_SIM,
S32 ttl = IM_TTL);
LLIMInfo(
const LLUUID& from_id,
BOOL from_group,
const LLUUID& to_id,
EInstantMessage im_type,
const std::string& name,
const std::string& message,
const LLUUID& id,
U32 parent_estate_id,
const LLUUID& region_id,
const LLVector3& position,
LLSD data,
U8 offline,
U32 timestamp,
EIMSource source,
S32 ttl = IM_TTL);
void packInstantMessage(LLMessageSystem* msg) const;
void packMessageBlock(LLMessageSystem* msg) const;
void unpackMessageBlock(LLMessageSystem* msg);
LLPointer<LLIMInfo> clone();
public:
LLUUID mFromID;
BOOL mFromGroup;
LLUUID mToID;
U32 mParentEstateID;
LLUUID mRegionID;
LLVector3 mPosition;
U8 mOffline;
bool mViewerThinksToIsOnline;
EInstantMessage mIMType;
LLUUID mID;
U32 mTimeStamp;
std::string mName;
std::string mMessage;
LLSD mData;
EIMSource mSource;
S32 mTTL;
};
LLPointer<LLIMInfo> llsd_to_im_info(const LLSD& im_info_sd);
LLSD im_info_to_llsd(LLPointer<LLIMInfo> im_info);
void pack_instant_message(
LLMessageSystem* msgsystem,
const LLUUID& from_id,

View File

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

View File

@@ -623,12 +623,14 @@ bool LLPluginClassMedia::keyEvent(EKeyEventType type, int key_code, MASK modifie
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");
message.setValueS32("x", x);
message.setValueS32("y", y);
message.setValueS32("clicks_x", clicks_x);
message.setValueS32("clicks_y", clicks_y);
message.setValue("modifiers", translateModifiers(modifiers));
sendMessage(message);
@@ -711,9 +713,9 @@ void LLPluginClassMedia::sendPickFileResponse(const std::vector<std::string> fil
}
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);

View File

@@ -75,7 +75,7 @@ public:
void setAutoScale(bool auto_scale);
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; };
@@ -107,7 +107,7 @@ public:
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
void enableMediaPluginDebugging( bool enable );

View File

@@ -4991,110 +4991,6 @@ void LLTextEditor::setOnScrollEndCallback(void (*callback)(void*), void* userdat
mScrollbar->setOnScrollEndCallback(callback, userdata);
}
///////////////////////////////////////////////////////////////////
// Hack for Notecards
BOOL LLTextEditor::importBuffer(const char* buffer, S32 length )
{
std::istringstream instream(buffer);
// Version 1 format:
// Linden text version 1\n
// {\n
// <EmbeddedItemList chunk>
// Text length <bytes without \0>\n
// <text without \0> (text may contain ext_char_values)
// }\n
char tbuf[MAX_STRING]; /* Flawfinder: ignore */
S32 version = 0;
instream.getline(tbuf, MAX_STRING);
if( 1 != sscanf(tbuf, "Linden text version %d", &version) )
{
LL_WARNS() << "Invalid Linden text file header " << LL_ENDL;
return FALSE;
}
if( 1 != version )
{
LL_WARNS() << "Invalid Linden text file version: " << version << LL_ENDL;
return FALSE;
}
instream.getline(tbuf, MAX_STRING);
if( 0 != sscanf(tbuf, "{") )
{
LL_WARNS() << "Invalid Linden text file format" << LL_ENDL;
return FALSE;
}
S32 text_len = 0;
instream.getline(tbuf, MAX_STRING);
if( 1 != sscanf(tbuf, "Text length %d", &text_len) )
{
LL_WARNS() << "Invalid Linden text length field" << LL_ENDL;
return FALSE;
}
if( text_len > mMaxTextByteLength )
{
LL_WARNS() << "Invalid Linden text length: " << text_len << LL_ENDL;
return FALSE;
}
BOOL success = TRUE;
char* text = new char[ text_len + 1];
if (text == NULL)
{
LL_ERRS() << "Memory allocation failure." << LL_ENDL;
return FALSE;
}
instream.get(text, text_len + 1, '\0');
text[text_len] = '\0';
if( text_len != (S32)strlen(text) )/* Flawfinder: ignore */
{
LL_WARNS() << llformat("Invalid text length: %d != %d ",strlen(text),text_len) << LL_ENDL;/* Flawfinder: ignore */
success = FALSE;
}
instream.getline(tbuf, MAX_STRING);
if( success && (0 != sscanf(tbuf, "}")) )
{
LL_WARNS() << "Invalid Linden text file format: missing terminal }" << LL_ENDL;
success = FALSE;
}
if( success )
{
// Actually set the text
setText( LLStringExplicit(text) );
}
delete[] text;
setCursorPos(0);
deselect();
needsReflow();
return success;
}
BOOL LLTextEditor::exportBuffer(std::string &buffer )
{
std::ostringstream outstream(buffer);
outstream << "Linden text version 1\n";
outstream << "{\n";
outstream << llformat("Text length %d\n", mWText.length() );
outstream << getText();
outstream << "}\n";
return TRUE;
}
//////////////////////////////////////////////////////////////////////////
// LLTextSegment

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@@ -14,457 +14,300 @@
*/
#include "llviewerprecompiledheaders.h"
#include "NACLantispam.h"
#include "llviewercontrol.h"
#include "llnotificationsutil.h"
#include "llviewerobjectlist.h"
#include "llagent.h"
#include "llavataractions.h"
#include "llcallbacklist.h" // For idle cleaning
#include "llnotificationsutil.h"
#include "lltrans.h"
#include "llviewerobjectlist.h"
#include <time.h>
#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)
{
if (id.isNull() || gAgent.getID() == id) return false; //Can't block system or self.
if (const LLViewerObject* obj = gObjectList.findObject(id)) //From an object,
return !obj->permYouOwner(); //not own object.
if (id.isNull() || gAgentID == id) return false; // Can't block system or self.
if (const LLViewerObject* obj = gObjectList.findObject(id)) // From an object,
return !obj->permYouOwner(); // not own object.
return true;
}
U32 NACLAntiSpamRegistry::globalAmount;
U32 NACLAntiSpamRegistry::globalTime;
bool NACLAntiSpamRegistry::bGlobalQueue;
NACLAntiSpamQueue* NACLAntiSpamRegistry::queues[NACLAntiSpamRegistry::QUEUE_MAX] = {0};
boost::unordered_map<std::string,NACLAntiSpamQueueEntry*> NACLAntiSpamRegistry::globalEntries;
boost::unordered_map<std::string,NACLAntiSpamQueueEntry*>::iterator NACLAntiSpamRegistry::it2;
bool is_collision_sound(const std::string& sound)
{
// The following sounds will be ignored for purposes of spam protection. They have been gathered from wiki documentation of frequent official sounds.
const std::array<const std::string, 29> 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"
};
// The following sounds will be ignored for purposes of spam protection. They have been gathered from wiki documentation of frequent official 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"};
const int COLLISION_SOUNDS_SIZE=29;
// NaClAntiSpamQueueEntry
NACLAntiSpamQueueEntry::NACLAntiSpamQueueEntry()
{
entryTime=0;
entryAmount=0;
blocked=false;
for (const auto& collision : COLLISION_SOUNDS)
if (collision == sound)
return true;
return 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
static const char* QUEUE_NAME[NACLAntiSpamRegistry::QUEUE_MAX] = {
"Chat",
"Inventory",
"Instant Message",
"calling card",
"sound",
"Sound Preload",
"Script Dialog",
"Teleport"};
constexpr std::array<const char*, NACLAntiSpamRegistry::QUEUE_MAX> QUEUE_NAME = {
"Chat",
"Inventory",
"Instant Message",
"calling card",
"sound",
"Sound Preload",
"Script Dialog",
"Teleport"
};
NACLAntiSpamRegistry::NACLAntiSpamRegistry(U32 time, U32 amount)
NACLAntiSpamRegistry::NACLAntiSpamRegistry()
{
globalTime=time;
globalAmount=amount;
static LLCachedControl<bool> _NACL_AntiSpamGlobalQueue(gSavedSettings,"_NACL_AntiSpamGlobalQueue");
bGlobalQueue=_NACL_AntiSpamGlobalQueue;
for(int queue = 0; queue < QUEUE_MAX; ++queue)
auto control = gSavedSettings.getControl("_NACL_AntiSpamTime");
const U32 time = control->get().asInteger();
mConnections[0] = control->getSignal()->connect(boost::bind(&NACLAntiSpamRegistry::handleNaclAntiSpamTimeChanged, _2));
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 "Unknown";
return QUEUE_NAME[queue_id];
return name >= QUEUE_NAME.size() ? "Unknown" : QUEUE_NAME[name];
}
//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)
{
globalTime=time;
for(int queue = 0; queue < QUEUE_MAX; ++queue)
if( queues[queue] )
queues[queue]->setTime(time);
if (mGlobalQueue) mGlobalQueue->setTime(time);
else for(auto& queue : *mQueues) queue.setTime(time);
}
//static
void NACLAntiSpamRegistry::setAllQueueAmounts(U32 amount)
{
globalAmount=amount;
for(int queue = 0; queue < QUEUE_MAX; ++queue)
if (mGlobalQueue) mGlobalQueue->setAmount(amount);
else for (U8 queue = 0U; queue < QUEUE_MAX; ++queue)
{
if(!queues[queue]) continue;
if(queue == QUEUE_SOUND || queue == QUEUE_SOUND_PRELOAD)
queues[queue]->setAmount(amount*5);
auto& q = (*mQueues)[queue];
if (queue == QUEUE_SOUND || queue == QUEUE_SOUND_PRELOAD)
q.setAmount(amount*5);
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)
{
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;
return;
}
queues[name]->clearEntries();
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;
else (mGlobalQueue ? *mGlobalQueue : (*mQueues)[name]).block(source);
}
//static
void NACLAntiSpamRegistry::purgeRegisteredQueue(U32 name)
{
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)
bool NACLAntiSpamRegistry::checkQueue(const Type& name, const LLUUID& source, const LFIDBearer::Type& type, const U32& multiplier)
//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;
int result;
if(bGlobalQueue)
auto& queue = mGlobalQueue ? *mGlobalQueue : (*mQueues)[name];
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);
}
else
{
if(name >= QUEUE_MAX || queues[name] == 0)
{
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;
return false;
}
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;
const std::string get_slurl_for(const LLUUID& id, const LFIDBearer::Type& type);
const auto slurl = get_slurl_for(source, type);
LLSD args;
args["SOURCE"] = slurl.empty() ? source.asString() : slurl;
args["TYPE"] = LLTrans::getString(getQueueName(name));
args["AMOUNT"] = (LLSD::Integer)(multiplier * queue.getAmount());
args["TIME"] = (LLSD::Integer)queue.getTime();
LLNotificationsUtil::add("AntiSpamBlock", args);
}
return true;
}
// Global queue stoof
//static
void NACLAntiSpamRegistry::setGlobalQueue(bool value)
void NACLAntiSpamRegistry::idle()
{
NACLAntiSpamRegistry::purgeAllQueues();
bGlobalQueue=value;
if (mGlobalQueue) mGlobalQueue->idle();
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()
{
if(bGlobalQueue)
NACLAntiSpamRegistry::purgeGlobalEntries();
// Note: These resets are upon the unique_ptr, not the Queue itself!
if (mGlobalQueue)
mGlobalQueue.reset();
else
for(int queue = 0; queue < QUEUE_MAX; ++queue)
{
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();
mQueues.reset();
}
//Handlers
//static
// Handlers
// 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)
{
setGlobalQueue(newvalue.asBoolean());
if (instanceExists())
{
auto& inst = instance();
inst.purgeAllQueues();
inst.initializeQueues(newvalue.asBoolean(), gSavedSettings.getU32("_NACL_AntiSpamTime"), gSavedSettings.getU32("_NACL_AntiSpamAmount"));
}
return true;
}
//static
bool NACLAntiSpamRegistry::handleNaclAntiSpamTimeChanged(const LLSD& newvalue)
{
setAllQueueTimes(newvalue.asInteger());
if (auto inst = getIfExists()) inst->setAllQueueTimes(newvalue.asInteger());
return true;
}
//static
bool NACLAntiSpamRegistry::handleNaclAntiSpamAmountChanged(const LLSD& newvalue)
{
setAllQueueAmounts(newvalue.asInteger());
if (auto inst = getIfExists()) inst->setAllQueueAmounts(newvalue.asInteger());
return true;
}
}

View File

@@ -13,72 +13,22 @@
* 0. You just DO WHAT THE FUCK YOU WANT TO.
*/
#ifndef NACLANTISPAM_H
#define NACLANTISPAM_H
#pragma once
#include <boost/signals2/connection.hpp>
#include <boost/unordered/unordered_map.hpp>
#include "stdtypes.h"
#include "lfidbearer.h"
#include "lluuid.h"
class NACLAntiSpamQueueEntry
class NACLAntiSpamQueue;
class NACLAntiSpamRegistry final : public LLSingleton<NACLAntiSpamRegistry>
{
friend class NACLAntiSpamQueue;
friend class 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;
friend class LLSingleton<NACLAntiSpamRegistry>;
NACLAntiSpamRegistry();
public:
U32 getAmount() const;
U32 getTime() const;
protected:
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 {
static void startup();
enum Type : U8 {
QUEUE_CHAT,
QUEUE_INVENTORY,
QUEUE_IM,
@@ -89,22 +39,19 @@ public:
QUEUE_TELEPORT,
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:
static const char* getQueueName(U32 queue_id);
static NACLAntiSpamQueue* queues[QUEUE_MAX];
static boost::unordered_map<std::string,NACLAntiSpamQueueEntry*> globalEntries;
static boost::unordered_map<std::string,NACLAntiSpamQueueEntry*>::iterator it2;
static U32 globalTime;
static U32 globalAmount;
static bool bGlobalQueue;
static int checkGlobalEntry(LLUUID& source, U32 multiplier);
static void clearGlobalEntries();
static void purgeGlobalEntries();
static void blockGlobalEntry(LLUUID& source);
void setAllQueueTimes(U32 amount);
void setAllQueueAmounts(U32 time);
void purgeAllQueues();
void initializeQueues(bool global, const U32& time, const U32& amount);
static bool handleNaclAntiSpamGlobalQueueChanged(const LLSD& newvalue);
static bool handleNaclAntiSpamTimeChanged(const LLSD& newvalue);
static bool handleNaclAntiSpamAmountChanged(const LLSD& newvalue);
std::unique_ptr<std::array<NACLAntiSpamQueue, QUEUE_MAX>> mQueues;
std::unique_ptr<NACLAntiSpamQueue> mGlobalQueue;
std::array<boost::signals2::scoped_connection, 3> mConnections;
};
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());
}
S32 saved_scroll_pos = mRegionScrollList->getScrollPos();
auto sort_column_name = mRegionScrollList->getSortColumnName();
auto sort_asending = mRegionScrollList->getSortAscending();
mRegionScrollList->deleteAllItems();
const std::string& cur_region_name = gAgent.getRegion()->getName();
@@ -172,8 +175,11 @@ void ALFloaterRegionTracker::refresh()
mRegionScrollList->addRow(row);
}
}
mRegionScrollList->sortByColumn(sort_column_name, sort_asending);
if (!saved_selected_values.empty())
mRegionScrollList->selectMultiple(saved_selected_values);
mRegionScrollList->setScrollPos(saved_scroll_pos);
}
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>
<map>
<key>default_grids_version</key><string>22</string>
<key>default_grids_version</key><string>23</string>
</map>
<!-- Second Life -->
@@ -11,7 +11,7 @@
<key>gridname</key><string>Second Life</string>
<key>platform</key><string>SecondLife</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>website</key><string>http://secondlife.com/</string>
<key>support</key><string>http://secondlife.com/support/</string>
@@ -26,7 +26,7 @@
<key>gridnick</key><string>secondlife_beta</string>
<key>gridname</key><string>Second Life BETA</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>password</key><string>http://secondlife.com/account/request.php</string>
<key>platform</key><string>SecondLife</string>

View File

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

View File

@@ -497,6 +497,19 @@
<key>IsCOA</key>
<integer>1</integer>
</map>
<key>AOSwimForced</key>
<map>
<key>Comment</key>
<string>Sets AOSwimEnabled to true, and plays swims instead of flies, even if not underwater.</string>
<key>Persist</key>
<integer>1</integer>
<key>Type</key>
<string>Boolean</string>
<key>Value</key>
<integer>0</integer>
<key>IsCOA</key>
<integer>1</integer>
</map>
<key>AONoStandsInMouselook</key>
<map>
<key>Comment</key>
@@ -2556,6 +2569,17 @@ This should be as low as possible, but too low may break functionality</string>
<integer>1</integer>
</map>
<!-- 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>
<map>
<key>Comment</key>
@@ -11736,28 +11760,6 @@ This should be as low as possible, but too low may break functionality</string>
<key>Value</key>
<real>0.34999999404</real>
</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>
<map>
<key>Comment</key>
@@ -12626,6 +12628,18 @@ This should be as low as possible, but too low may break functionality</string>
<integer>128</integer>
</map>
<key>OctreeMinimumNodeSize</key>
<map>
<key>Comment</key>
<string>Minimum size of any octree node</string>
<key>Persist</key>
<integer>1</integer>
<key>Type</key>
<string>F32</string>
<key>Value</key>
<real>0.01</real>
</map>
<key>OctreeReserveNodeCapacity</key>
<map>
<key>Comment</key>
@@ -14638,6 +14652,17 @@ This should be as low as possible, but too low may break functionality</string>
<key>Value</key>
<integer>1</integer>
</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>
<map>
<key>Comment</key>

View File

@@ -984,6 +984,17 @@ RIP Latif Khalifa.</string>
<key>Value</key>
<boolean>1</boolean>
</map>
<key>SinguOwnerSayAsErrors</key>
<map>
<key>Comment</key>
<string>llOwnerSay will show up in the script error console instead of in chat.</string>
<key>Persist</key>
<integer>1</integer>
<key>Type</key>
<string>Boolean</string>
<key>Value</key>
<boolean>0</boolean>
</map>
<key>SinguPostProcessDefault</key>
<map>
<key>Comment</key>
@@ -1175,6 +1186,17 @@ Changing this setting only affects new text.</string>
<key>Value</key>
<integer>1</integer>
</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>
<map>
<key>Comment</key>
@@ -1643,6 +1665,8 @@ Changing this setting only affects new text.</string>
<string>Boolean</string>
<key>Value</key>
<boolean>0</boolean>
<key>IsCOA</key>
<integer>1</integer>
</map>
<key>ToolbarVisibleFastTimers</key>
<map>

View File

@@ -70,7 +70,10 @@ LLPrefsAscentChat::LLPrefsAscentChat()
}
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>("KeywordsOn")->setCommitCallback(boost::bind(&LLPrefsAscentChat::onCommitKeywords, this, _1));

View File

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

View File

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

View File

@@ -163,10 +163,11 @@ Wavefront::Wavefront(LLFace* face, LLPolyMesh* mesh, const LLXform* transform, c
if (transform_normals) Transform(normals, transform_normals);
const U32 pcount = mesh ? mesh->getNumFaces() : (vb->getNumIndices()/3); //indices
const U16 offset = face->getIndicesStart(); //indices
const U32 offset = face->getIndicesStart(); //indices
for (U32 i = 0; i < pcount; ++i)
{
triangles.push_back(tri(getIndices[i * 3 + offset] + start, getIndices[i * 3 + 1 + offset] + start, getIndices[i * 3 + 2 + offset] + start));
const auto off = i * 3 + offset;
triangles.push_back(tri(getIndices[off] + start, getIndices[off + 1] + start, getIndices[off + 2] + start));
}
}
@@ -174,9 +175,9 @@ void Wavefront::Transform(vert_t& v, const LLXform* x) //recursive
{
LLMatrix4 m;
x->getLocalMat4(m);
for (vert_t::iterator iterv = v.begin(); iterv != v.end(); ++iterv)
for (auto& i : v)
{
iterv->first = iterv->first * m;
i.first = i.first * m;
}
if (const LLXform* xp = x->getParent()) Transform(v, xp);
@@ -186,9 +187,9 @@ void Wavefront::Transform(vec3_t& v, const LLXform* x) //recursive
{
LLMatrix4 m;
x->getLocalMat4(m);
for (vec3_t::iterator iterv = v.begin(); iterv != v.end(); ++iterv)
for (auto& i : v)
{
*iterv = *iterv * m;
i = i * m;
}
if (const LLXform* xp = x->getParent()) Transform(v, xp);
@@ -252,9 +253,9 @@ namespace
asset_id_matches);
// See if any of the inventory items matching this sculpt id are exportable
for (U32 i = 0; i < items.size(); i++)
for (const auto& item : items)
{
const LLPermissions item_permissions = items[i]->getPermissions();
const LLPermissions item_permissions = item->getPermissions();
if (item_permissions.allowExportBy(gAgentID, LFSimFeatureHandler::instance().exportPolicy()))
{
return true;
@@ -269,9 +270,9 @@ namespace
}
}
class LFSaveSelectedObjects : public view_listener_t
class LFSaveSelectedObjects final : public view_listener_t
{
bool handleEvent(LLPointer<LLOldEvents::LLEvent> event, const LLSD& userdata)
bool handleEvent(LLPointer<LLOldEvents::LLEvent> event, const LLSD& userdata) override
{
if (LLObjectSelectionHandle selection = LLSelectMgr::getInstance()->getSelection())
{
@@ -288,10 +289,10 @@ namespace
S32 included = 0;
for (LLObjectSelection::iterator iter = selection->begin(); iter != selection->end(); ++iter)
{
total++;
++total;
LLSelectNode* node = *iter;
if (!can_export_node(node)) continue;
included++;
++included;
wfsaver->Add(node->getObject());
}
if (wfsaver->obj_v.empty())
@@ -322,12 +323,12 @@ void WavefrontSaver::Add(const LLVOAvatar* av_vo) //adds attachments, too!
{
offset = -av_vo->getRenderPosition();
avatar_joint_list_t vjv = av_vo->mMeshLOD;
for (avatar_joint_list_t::const_iterator itervj = vjv.begin(); itervj != vjv.end(); ++itervj)
for (const auto& itervj : vjv)
{
const LLViewerJoint* vj = dynamic_cast<LLViewerJoint*>(*itervj);
const auto* vj = dynamic_cast<const LLViewerJoint*>(itervj);
if (!vj || vj->mMeshParts.empty()) continue;
LLViewerJointMesh* vjm = dynamic_cast<LLViewerJointMesh*>(vj->mMeshParts[0]); //highest LOD
auto* vjm = dynamic_cast<LLViewerJointMesh*>(vj->mMeshParts[0]); //highest LOD
if (!vjm) continue;
vjm->updateJointGeometry();
@@ -355,21 +356,19 @@ void WavefrontSaver::Add(const LLVOAvatar* av_vo) //adds attachments, too!
Add(Wavefront(face, pm, NULL, &normfix));
}
for (LLVOAvatar::attachment_map_t::const_iterator iter = av_vo->mAttachmentPoints.begin(); iter != av_vo->mAttachmentPoints.end(); ++iter)
for (const auto& ap : av_vo->mAttachmentPoints)
{
LLViewerJointAttachment* ja = iter->second;
LLViewerJointAttachment* ja = ap.second;
if (!ja) continue;
for (LLViewerJointAttachment::attachedobjs_vec_t::iterator itero = ja->mAttachedObjects.begin(); itero != ja->mAttachedObjects.end(); ++itero)
for (const auto& o : ja->mAttachedObjects)
{
LLViewerObject* o = *itero;
if (!o) continue;
std::vector<LLViewerObject*> prims;
o->addThisAndAllChildren(prims);
for (std::vector<LLViewerObject* >::iterator iterc = prims.begin(); iterc != prims.end(); ++iterc)
for (const auto& c : prims)
{
const LLViewerObject* c = *iterc;
if (!c) continue;
if (LLSelectNode* n = LLSelectMgr::getInstance()->getSelection()->findNode(const_cast<LLViewerObject*>(c)))
{
@@ -400,9 +399,9 @@ void WavefrontSaver::Add(const LLVOAvatar* av_vo) //adds attachments, too!
}
namespace
{
class LFSaveSelectedAvatar : public view_listener_t
class LFSaveSelectedAvatar final : public view_listener_t
{
bool handleEvent(LLPointer<LLOldEvents::LLEvent> event, const LLSD& userdata)
bool handleEvent(LLPointer<LLOldEvents::LLEvent> event, const LLSD& userdata) override
{
if (const LLVOAvatar* avatar = find_avatar_from_object(LLSelectMgr::getInstance()->getSelection()->getPrimaryObject()))
{
@@ -446,49 +445,48 @@ bool WavefrontSaver::saveFile(LLFILE* fp)
int num = 0;
int index = 0;
for (std::vector<Wavefront>::iterator w_iter = obj_v.begin(); w_iter != obj_v.end(); ++w_iter)
for (const auto& obj : obj_v)
{
int count = 0;
std::string name = (*w_iter).name;
std::string name = obj.name;
if (name.empty()) name = llformat("%d", num++);
vert_t vertices = (*w_iter).vertices;
vec3_t normals = (*w_iter).normals;
tri_t triangles = (*w_iter).triangles;
auto& vertices = obj.vertices;
auto& normals = obj.normals;
auto& triangles = obj.triangles;
//Write Object
write_or_bust(fp, "o " + name + "\n");
write_or_bust(fp, "o " + name + '\n');
//Write vertices; swap axes if necessary
static const LLCachedControl<bool> swapYZ("OBJExportSwapYZ", false);
const double xm = swapYZ ? -1.0 : 1.0;
const int y = swapYZ ? 2 : 1;
const int z = swapYZ ? 1 : 2;
for (vert_t::iterator v_iter = vertices.begin(); v_iter != vertices.end(); ++v_iter)
for (const auto& vert : vertices)
{
++count;
const LLVector3 v = v_iter->first + offset;
const LLVector3 v = vert.first + offset;
write_or_bust(fp, llformat("v %f %f %f\n",v[0] * xm, v[y], v[z]));
}
for (vec3_t::iterator n_iter = normals.begin(); n_iter != normals.end(); ++n_iter)
for (const auto& n : normals)
{
const LLVector3 n = *n_iter;
write_or_bust(fp, llformat("vn %f %f %f\n",n[0] * xm, n[y], n[z]));
}
for (vert_t::iterator v_iter = vertices.begin(); v_iter != vertices.end(); ++v_iter)
for (const auto& vert : vertices)
{
write_or_bust(fp, llformat("vt %f %f\n", v_iter->second[0], v_iter->second[1]));
write_or_bust(fp, llformat("vt %f %f\n", vert.second[0], vert.second[1]));
}
//Write triangles
for (tri_t::iterator t_iter = triangles.begin(); t_iter != triangles.end(); ++t_iter)
for (const auto& triangle : triangles)
{
const int f1 = t_iter->v0 + index + 1;
const int f2 = t_iter->v1 + index + 1;
const int f3 = t_iter->v2 + index + 1;
const int f1 = triangle.v0 + index + 1;
const int f2 = triangle.v1 + index + 1;
const int f3 = triangle.v2 + index + 1;
write_or_bust(fp, llformat("f %d/%d/%d %d/%d/%d %d/%d/%d\n",
f1,f1,f1,f2,f2,f2,f3,f3,f3));
}

View File

@@ -32,16 +32,18 @@
// library includes
#include "aifilepicker.h"
#include "llavatarnamecache.h"
#include "llnotificationsutil.h"
// newview includes
#include "lfsimfeaturehandler.h"
#include "llface.h"
#include "llvovolume.h"
#include "llviewerinventory.h"
#include "llinventorymodel.h"
#include "llinventoryfunctions.h"
#include "llface.h"
#include "llversioninfo.h"
#include "llviewerinventory.h"
#include "llviewertexturelist.h"
#include "llvovolume.h"
// menu includes
#include "llevent.h"
@@ -74,11 +76,11 @@ typedef LLMemberListener<LLView> view_listener_t;
namespace DAEExportUtil
{
static LLUUID LL_TEXTURE_PLYWOOD = LLUUID("89556747-24cb-43ed-920b-47caed15465f");
static LLUUID LL_TEXTURE_BLANK = LLUUID("5748decc-f629-461c-9a36-a35a221fe21f");
static LLUUID LL_TEXTURE_INVISIBLE = LLUUID("38b86f85-2575-52a9-a531-23108d8da837");
static LLUUID LL_TEXTURE_TRANSPARENT = LLUUID("8dcd4a48-2d37-4909-9f78-f7a9eb4ef903");
static LLUUID LL_TEXTURE_MEDIA = LLUUID("8b5fec65-8d8d-9dc5-cda8-8fdf2716e361");
const auto LL_TEXTURE_PLYWOOD = LLUUID("89556747-24cb-43ed-920b-47caed15465f");
const auto LL_TEXTURE_BLANK = LLUUID("5748decc-f629-461c-9a36-a35a221fe21f");
const auto LL_TEXTURE_INVISIBLE = LLUUID("38b86f85-2575-52a9-a531-23108d8da837");
const auto LL_TEXTURE_TRANSPARENT = LLUUID("8dcd4a48-2d37-4909-9f78-f7a9eb4ef903");
const auto LL_TEXTURE_MEDIA = LLUUID("8b5fec65-8d8d-9dc5-cda8-8fdf2716e361");
enum image_format_type
{
@@ -105,23 +107,17 @@ namespace DAEExportUtil
// See if any of the inventory items matching this texture id are exportable
ExportPolicy policy = LFSimFeatureHandler::instance().exportPolicy();
for (size_t i = 0; i < items.size(); i++)
for (const auto& item : items)
{
const LLPermissions item_permissions = items[i]->getPermissions();
const LLPermissions item_permissions = item->getPermissions();
if (item_permissions.allowExportBy(gAgentID, policy))
{
if (name != NULL)
{
(*name) = items[i]->getName();
}
if (name) *name = item->getName();
return true;
}
}
if (name != NULL)
{
(*name) = id.getString();
}
if (name) *name = id.getString();
return (policy & ep_full_perm) == ep_full_perm;
}
@@ -206,7 +202,7 @@ public:
}
}
BOOL postBuild()
BOOL postBuild() override
{
mFileName = getChildView("file name editor");
mExportBtn = getChildView("export button");
@@ -306,14 +302,9 @@ public:
S32 getNumExportableTextures()
{
S32 res = 0;
for (DAESaver::string_list_t::const_iterator t = mSaver.mTextureNames.begin(); t != mSaver.mTextureNames.end(); ++t)
for (const auto& name : mSaver.mTextureNames)
{
std::string name = *t;
if (!name.empty())
{
++res;
}
if (!name.empty()) ++res;
}
return res;
@@ -365,7 +356,7 @@ public:
gIdleCallbacks.addFunction(saveTexturesWorker, this);
}
class CacheReadResponder : public LLTextureCache::ReadResponder
class CacheReadResponder final : public LLTextureCache::ReadResponder
{
private:
LLPointer<LLImageFormatted> mFormattedImage;
@@ -413,7 +404,7 @@ public:
mImageLocal = imagelocal;
}
virtual void completed(bool success)
void completed(bool success) override
{
if (success && mFormattedImage.notNull() && mImageSize > 0)
{
@@ -546,10 +537,8 @@ void DAESaver::updateTextureInfo()
{
LLTextureEntry* te = obj->getTE(face_num);
const LLUUID id = te->getID();
if (std::find(mTextures.begin(), mTextures.end(), id) != mTextures.end())
{
continue;
}
if (std::find(mTextures.begin(), mTextures.end(), id) != mTextures.end()) continue;
mTextures.push_back(id);
std::string name;
if (id != DAEExportUtil::LL_TEXTURE_BLANK && DAEExportUtil::canExportTexture(id, &name))
@@ -566,7 +555,6 @@ void DAESaver::updateTextureInfo()
}
}
class v4adapt
{
private:
@@ -579,7 +567,7 @@ public:
}
};
void DAESaver::addSource(daeElement* mesh, const char* src_id, std::string params, const std::vector<F32> &vals)
void DAESaver::addSource(daeElement* mesh, const char* src_id, const std::string& params, const std::vector<F32> &vals)
{
daeElement* source = mesh->add("source");
source->setAttribute("id", src_id);
@@ -588,9 +576,9 @@ void DAESaver::addSource(daeElement* mesh, const char* src_id, std::string param
src_array->setAttribute("id", llformat("%s-%s", src_id, "array").c_str());
src_array->setAttribute("count", llformat("%d", vals.size()).c_str());
for (U32 i = 0; i < vals.size(); i++)
for (const auto& val : vals)
{
((domFloat_array*)src_array)->getValue().append(vals[i]);
static_cast<domFloat_array*>(src_array)->getValue().append(val);
}
domAccessor* acc = daeSafeCast<domAccessor>(source->add("technique_common accessor"));
@@ -598,10 +586,10 @@ void DAESaver::addSource(daeElement* mesh, const char* src_id, std::string param
acc->setCount(vals.size() / params.size());
acc->setStride(params.size());
for (std::string::iterator p_iter = params.begin(); p_iter != params.end(); ++p_iter)
for (const auto& param : params)
{
domElement* pX = acc->add("param");
pX->setAttribute("name", llformat("%c", *p_iter).c_str());
pX->setAttribute("name", (LLStringUtil::null + param).c_str());
pX->setAttribute("type", "float");
}
}
@@ -650,7 +638,7 @@ void DAESaver::addPolygons(daeElement* mesh, const char* geomID, const char* mat
{
for (S32 i = 0; i < face->mNumIndices; i++)
{
U16 index = index_offset + face->mIndices[i];
U32 index = index_offset + face->mIndices[i];
(p->getValue()).append(index);
if (i % 3 == 0)
{
@@ -710,11 +698,21 @@ void DAESaver::transformTexCoord(S32 num_vert, LLVector2* coord, LLVector3* posi
bool DAESaver::saveDAE(std::string filename)
{
// Collada expects file and folder names to be escaped
// Note: cdom::nativePathToUri()
// Same as in LLDAELoader::OpenFile()
const char* allowed =
"ABCDEFGHIJKLMNOPQRSTUVWXYZ"
"abcdefghijklmnopqrstuvwxyz"
"0123456789"
"%-._~:\"|\\/";
std::string uri_filename = LLURI::escape(filename, allowed);
mAllMaterials.clear();
mTotalNumMaterials = 0;
DAE dae;
// First set the filename to save
daeElement* root = dae.add(filename);
daeElement* root = dae.add(uri_filename);
// Obligatory elements in header
daeElement* asset = root->add("asset");
@@ -734,9 +732,13 @@ bool DAESaver::saveDAE(std::string filename)
up_axis->setCharData("Z_UP");
// File creator
std::string author;
if (!LLAvatarNameCache::getNSName(gAgentID, author))
author = "Unknown";
daeElement* contributor = asset->add("contributor");
contributor->add("author")->setCharData(LLAppViewer::instance()->getSecondLifeTitle() + " User");
contributor->add("authoring_tool")->setCharData(LLAppViewer::instance()->getSecondLifeTitle() + " Collada Export");
contributor->add("author")->setCharData(author);
contributor->add("authoring_tool")->setCharData(LLVersionInfo::getChannelAndVersion() + " Collada Export");
daeElement* images = root->add("library_images");
daeElement* geomLib = root->add("library_geometries");
@@ -825,7 +827,6 @@ bool DAESaver::saveDAE(std::string filename)
}
}
addSource(mesh, llformat("%s-%s", geomID, "positions").c_str(), "XYZ", position_data);
addSource(mesh, llformat("%s-%s", geomID, "normals").c_str(), "XYZ", normal_data);
addSource(mesh, llformat("%s-%s", geomID, "map0").c_str(), "ST", uv_data);
@@ -845,12 +846,11 @@ bool DAESaver::saveDAE(std::string filename)
// Add triangles
if (gSavedSettings.getBOOL("DAEExportConsolidateMaterials"))
{
for (U32 objMaterial = 0; objMaterial < objMaterials.size(); objMaterial++)
for (const auto& objMaterial : objMaterials)
{
int_list_t faces;
getFacesWithMaterial(obj, objMaterials[objMaterial], &faces);
std::string matName = objMaterials[objMaterial].name;
addPolygons(mesh, geomID, (matName + "-material").c_str(), obj, &faces);
getFacesWithMaterial(obj, objMaterial, &faces);
addPolygons(mesh, geomID, (objMaterial.name + "-material").c_str(), obj, &faces);
}
}
else
@@ -888,12 +888,12 @@ bool DAESaver::saveDAE(std::string filename)
// Bind materials
daeElement* tq = nodeGeometry->add("bind_material technique_common");
for (U32 objMaterial = 0; objMaterial < objMaterials.size(); objMaterial++)
for (const auto& objMaterial : objMaterials)
{
std::string matName = objMaterials[objMaterial].name;
daeElement* instanceMaterial = tq->add("instance_material");
instanceMaterial->setAttribute("symbol", (matName + "-material").c_str());
instanceMaterial->setAttribute("target", ("#" + matName + "-material").c_str());
std::string matName = objMaterial.name + "-material";
instanceMaterial->setAttribute("symbol", matName.c_str());
instanceMaterial->setAttribute("target", ('#' + matName).c_str());
}
nodeGeometry->setAttribute("url", llformat("#%s-%s", geomID, "mesh").c_str());
@@ -904,12 +904,12 @@ bool DAESaver::saveDAE(std::string filename)
generateEffects(effects);
// Materials
for (U32 objMaterial = 0; objMaterial < mAllMaterials.size(); objMaterial++)
for (const auto& objMaterial : mAllMaterials)
{
daeElement* mat = materials->add("material");
mat->setAttribute("id", (mAllMaterials[objMaterial].name + "-material").c_str());
mat->setAttribute("id", (objMaterial.name + "-material").c_str());
daeElement* matEffect = mat->add("instance_effect");
matEffect->setAttribute("url", ("#" + mAllMaterials[objMaterial].name + "-fx").c_str());
matEffect->setAttribute("url", ('#' + objMaterial.name + "-fx").c_str());
}
root->add("scene instance_visual_scene")->setAttribute("url", "#Scene");
@@ -930,11 +930,11 @@ DAESaver::MaterialInfo DAESaver::getMaterial(LLTextureEntry* te)
{
if (gSavedSettings.getBOOL("DAEExportConsolidateMaterials"))
{
for (U32 i=0; i < mAllMaterials.size(); i++)
for (const auto& mat : mAllMaterials)
{
if (mAllMaterials[i].matches(te))
if (mat.matches(te))
{
return mAllMaterials[i];
return mat;
}
}
}
@@ -944,7 +944,7 @@ DAESaver::MaterialInfo DAESaver::getMaterial(LLTextureEntry* te)
ret.color = te->getColor();
ret.name = llformat("Material%d", mAllMaterials.size());
mAllMaterials.push_back(ret);
return mAllMaterials[mAllMaterials.size() - 1];
return ret;
}
void DAESaver::getMaterials(LLViewerObject* obj, material_list_t* ret)
@@ -954,10 +954,7 @@ void DAESaver::getMaterials(LLViewerObject* obj, material_list_t* ret)
{
LLTextureEntry* te = obj->getTE(face_num);
if (skipFace(te))
{
continue;
}
if (skipFace(te)) continue;
MaterialInfo mat = getMaterial(te);
@@ -968,7 +965,7 @@ void DAESaver::getMaterials(LLViewerObject* obj, material_list_t* ret)
}
}
void DAESaver::getFacesWithMaterial(LLViewerObject* obj, MaterialInfo& mat, int_list_t* ret)
void DAESaver::getFacesWithMaterial(LLViewerObject* obj, const MaterialInfo& mat, int_list_t* ret)
{
S32 num_faces = obj->getVolume()->getNumVolumeFaces();
for (S32 face_num = 0; face_num < num_faces; ++face_num)
@@ -985,11 +982,11 @@ void DAESaver::generateEffects(daeElement *effects)
// Effects (face color, alpha)
bool export_textures = gSavedSettings.getBOOL("DAEExportTextures");
for (U32 mat = 0; mat < mAllMaterials.size(); mat++)
for (const auto& mat : mAllMaterials)
{
LLColor4 color = mAllMaterials[mat].color;
LLColor4 color = mat.color;
domEffect* effect = (domEffect*)effects->add("effect");
effect->setId((mAllMaterials[mat].name + "-fx").c_str());
effect->setId((mat.name + "-fx").c_str());
daeElement* profile = effect->add("profile_COMMON");
std::string colladaName;
@@ -999,7 +996,7 @@ void DAESaver::generateEffects(daeElement *effects)
U32 i = 0;
for (; i < mTextures.size(); i++)
{
if (mAllMaterials[mat].textureID == mTextures[i])
if (mat.textureID == mTextures[i])
{
textID = mTextures[i];
break;
@@ -1043,19 +1040,18 @@ void DAESaver::generateEffects(daeElement *effects)
void DAESaver::generateImagesSection(daeElement* images)
{
for (U32 i=0; i < mTextureNames.size(); i++)
for (const auto& name : mTextureNames)
{
std::string name = mTextureNames[i];
if (name.empty()) continue;
std::string colladaName = name + "_" + mImageFormat;
std::string colladaName = name + '_' + mImageFormat;
daeElement* image = images->add("image");
image->setAttribute("id", colladaName.c_str());
image->setAttribute("name", colladaName.c_str());
image->add("init_from")->setCharData(LLURI::escape(name + "." + mImageFormat));
image->add("init_from")->setCharData(LLURI::escape(name + '.' + mImageFormat));
}
}
class DAESaveSelectedObjects : public view_listener_t
class DAESaveSelectedObjects final : public view_listener_t
{
bool handleEvent(LLPointer<LLOldEvents::LLEvent> event, const LLSD& userdata)
{

View File

@@ -33,50 +33,29 @@ class LLViewerObject;
class DAESaver
{
public:
class MaterialInfo
struct MaterialInfo
{
public:
LLUUID textureID;
LLColor4 color;
std::string name;
bool matches(LLTextureEntry* te)
bool matches(LLTextureEntry* te) const
{
return (textureID == te->getID()) && (color == te->getColor());
}
bool operator== (const MaterialInfo& rhs)
bool operator== (const MaterialInfo& rhs) const
{
return (textureID == rhs.textureID) && (color == rhs.color) && (name == rhs.name);
}
bool operator!= (const MaterialInfo& rhs)
bool operator!= (const MaterialInfo& rhs) const
{
return !(*this == rhs);
}
MaterialInfo()
{
}
MaterialInfo(const MaterialInfo& rhs)
{
textureID = rhs.textureID;
color = rhs.color;
name = rhs.name;
}
MaterialInfo& operator= (const MaterialInfo& rhs)
{
textureID = rhs.textureID;
color = rhs.color;
name = rhs.name;
return *this;
}
};
typedef std::vector<std::pair<LLViewerObject*,std::string> > obj_info_t;
typedef std::vector<std::pair<LLViewerObject*,std::string>> obj_info_t;
typedef uuid_vec_t id_list_t;
typedef std::vector<std::string> string_list_t;
typedef std::vector<S32> int_list_t;
@@ -97,12 +76,12 @@ public:
private:
void transformTexCoord(S32 num_vert, LLVector2* coord, LLVector3* positions, LLVector3* normals, LLTextureEntry* te, LLVector3 scale);
void addSource(daeElement* mesh, const char* src_id, std::string params, const std::vector<F32> &vals);
void addSource(daeElement* mesh, const char* src_id, const std::string& params, const std::vector<F32> &vals);
void addPolygons(daeElement* mesh, const char* geomID, const char* materialID, LLViewerObject* obj, int_list_t* faces_to_include);
bool skipFace(LLTextureEntry *te);
MaterialInfo getMaterial(LLTextureEntry* te);
void getMaterials(LLViewerObject* obj, material_list_t* ret);
void getFacesWithMaterial(LLViewerObject* obj, MaterialInfo& mat, int_list_t* ret);
void getFacesWithMaterial(LLViewerObject* obj, const MaterialInfo& mat, int_list_t* ret);
void generateEffects(daeElement *effects);
void generateImagesSection(daeElement* images);
};

File diff suppressed because it is too large Load Diff

View File

@@ -1,134 +1,30 @@
#pragma once
#ifndef LL_LLFLOATERAO_H
#define LL_LLFLOATERAO_H
#include "aostate.h"
#include "llfloater.h"
#include "llviewercontrol.h"
#include "llagent.h"
#include "lleventtimer.h"
enum AOState
{
STATE_AGENT_IDLE = 0,
STATE_AGENT_WALK = 1,
STATE_AGENT_RUN = 2,
STATE_AGENT_STAND = 3,
STATE_AGENT_PRE_JUMP = 4,
STATE_AGENT_JUMP = 5,
STATE_AGENT_TURNLEFT = 6,
STATE_AGENT_TURNRIGHT = 7,
STATE_AGENT_SIT = 8,
STATE_AGENT_GROUNDSIT = 9,
STATE_AGENT_HOVER = 10,
STATE_AGENT_HOVER_DOWN = 11,
STATE_AGENT_HOVER_UP = 12,
STATE_AGENT_CROUCH = 13,
STATE_AGENT_CROUCHWALK = 14,
STATE_AGENT_FALLDOWN = 15,
STATE_AGENT_STANDUP = 16,
STATE_AGENT_LAND = 17,
STATE_AGENT_FLY = 18,
STATE_AGENT_FLYSLOW = 19,
STATE_AGENT_TYPING = 20,
STATE_AGENT_SWIM_DOWN = 21,
STATE_AGENT_SWIM_UP = 22,
STATE_AGENT_SWIM = 23,
STATE_AGENT_FLOAT = 24,
STATE_AGENT_END
};
class AOStandTimer : public LLEventTimer
{
public:
AOStandTimer();
~AOStandTimer();
BOOL tick() override;
void reset();
};
class AOInvTimer : public LLEventTimer
{
public:
AOInvTimer();
~AOInvTimer();
BOOL tick() override;
};
class LLFloaterAO : public LLFloater, public LLFloaterSingleton<LLFloaterAO>
class LLFloaterAO final : public LLFloater, public LLFloaterSingleton<LLFloaterAO>
{
friend class AOSystem;
public:
LLFloaterAO(const LLSD&);
LLFloaterAO(const LLSD&);
BOOL postBuild() override;
void onOpen() override;
virtual ~LLFloaterAO();
static void init();
static void run();
virtual ~LLFloaterAO();
void updateLayout(bool advanced);
//static bool loadAnims();
void onClickCycleStand(bool next) const;
void onClickReloadCard() const;
void onClickOpenCard() const;
void onClickNewCard() const;
static void typing(bool start);
static AOState flyToSwimState(const AOState& state);
static AOState swimToFlyState(const AOState& state);
static AOState getAnimationState();
static void setAnimationState(const AOState& state);
static LLUUID getCurrentStandId();
static void setCurrentStandId(const LLUUID& id);
static int stand_iterator;
static void ChangeStand();
static void toggleSwim(bool underwater);
static void doMotion(const LLUUID& id, bool start, bool stand = false);
static void startMotion(const LLUUID& id, bool stand = false) { doMotion(id, true, stand); }
static void stopMotion(const LLUUID& id, bool stand = false) { doMotion(id, false, stand); }
static bool swimCheck(const AOState& state);
static LLUUID GetAnimID(const LLUUID& id);
static AOState GetStateFromAnimID(const LLUUID& id);
static LLUUID GetAnimIDFromState(const AOState& state);
static AOState GetStateFromToken(std::string strtoken);
static void onClickCycleStand(bool next);
static void onClickReloadCard();
static void onClickOpenCard();
static void onClickNewCard();
static LLUUID invfolderid;
static const LLUUID& getAssetIDByName(const std::string& name);
private:
static AOState mAnimationState;
static LLUUID mCurrentStandId;
static void onSpinnerCommit();
static void onComboBoxCommit(LLUICtrl* ctrl);
void onSpinnerCommit() const;
void onComboBoxCommit(LLUICtrl* ctrl) const;
std::array<class LLComboBox*, STATE_AGENT_END> mCombos;
protected:
static AOState getStateFromCombo(const class LLComboBox* combo);
static LLComboBox* getComboFromState(const AOState& state);
static void onNotecardLoadComplete(LLVFS *vfs,const LLUUID& asset_uuid,LLAssetType::EType type,void* user_data, S32 status, LLExtStat ext_status);
LLComboBox* getComboFromState(const U8& state) const { return mCombos[state]; }
};
extern AOInvTimer* gAOInvTimer;
#endif

View File

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

View File

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

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

View File

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

View File

@@ -17,7 +17,7 @@
//#include "llsdserialize.h"
#include "lltooldraganddrop.h"
//#include "llassetuploadresponders.h"
//#include "lleconomy.h"
//#include "llagentbenefits.h"
//#include "llfloaterperms.h"
@@ -635,7 +635,7 @@ void ImportTracker::send_inventory(LLSD& prim)
body["next_owner_mask"] = LLSD::Integer(U32_MAX);
body["group_mask"] = LLSD::Integer(U32_MAX);
body["everyone_mask"] = LLSD::Integer(U32_MAX);
body["expected_upload_cost"] = LLSD::Integer(LLGlobalEconomy::Singleton::getInstance()->getPriceUpload());
body["expected_upload_cost"] = LLAgentBenefits::current().getTextureUploadCost();
//cmdline_printchat("posting "+ data->assetid.asString());
LLHTTPClient::post(url, body, new JCImportInventoryResponder(body, data->assetid, data->type,data));
//error = TRUE;

View File

@@ -194,7 +194,7 @@
VIAddVersionKey /LANG=${LANG_ENGLISH} "ProductName" "Singularity Viewer Installer"
VIAddVersionKey /LANG=${LANG_ENGLISH} "Comments" "A viewer for the meta-verse!"
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} "ProductVersion" "${VERSION_LONG}"
VIAddVersionKey /LANG=${LANG_ENGLISH} "FileVersion" "${VERSION_LONG}"
@@ -207,7 +207,7 @@
;because this will make your installer start faster.
!insertmacro MUI_RESERVEFILE_LANGDLL
ReserveFile "${NSISDIR}\Plugins\x86-unicode\NSISdl.dll"
ReserveFile "${NSISDIR}\Plugins\x86-unicode\INetC.dll"
ReserveFile "${NSISDIR}\Plugins\x86-unicode\nsDialogs.dll"
ReserveFile "${NSISDIR}\Plugins\x86-unicode\StartMenu.dll"
ReserveFile "${NSISDIR}\Plugins\x86-unicode\StdUtils.dll"
@@ -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
%%INSTALL_FILES%%
;Create temp dir and set out dir to it
CreateDirectory "$TEMP\AlchemyInst"
SetOutPath "$TEMP\AlchemyInst"
;Download LibVLC
!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
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
Nsis7z::Extract "$INSTDIR\libvlc.7z"
Rename "$INSTDIR\vlc-2.2.8\libvlc.dll" "$INSTDIR\llplugin\libvlc.dll"
Rename "$INSTDIR\vlc-2.2.8\libvlccore.dll" "$INSTDIR\llplugin\libvlccore.dll"
Rename "$INSTDIR\vlc-2.2.8\plugins" "$INSTDIR\llplugin\plugins"
RMDir /r "$INSTDIR\vlc-2.2.8"
Delete "$INSTDIR\libvlc.7z"
Nsis7z::ExtractWithDetails "$TEMP\AlchemyInst\libvlc.7z" "Unpacking media plugins %s..."
Rename "$TEMP\AlchemyInst\vlc-3.0.8\libvlc.dll" "$INSTDIR\llplugin\libvlc.dll"
Rename "$TEMP\AlchemyInst\vlc-3.0.8\libvlccore.dll" "$INSTDIR\llplugin\libvlccore.dll"
Rename "$TEMP\AlchemyInst\vlc-3.0.8\plugins" "$INSTDIR\llplugin\plugins"
;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
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)
// and requested objects.
msg->getUUIDFast(_PREHASH_ObjectData, _PREHASH_OwnerID, data->owner_id);
if (auto obj = gObjectList.findObject(object_id)) obj->mOwnerID = data->owner_id; // Singu Note: Try to get Owner whenever possible
msg->getUUIDFast(_PREHASH_ObjectData, _PREHASH_GroupID, data->group_id);
msg->getStringFast(_PREHASH_ObjectData, _PREHASH_Name, data->name);
msg->getStringFast(_PREHASH_ObjectData, _PREHASH_Description, data->desc);

View File

@@ -32,49 +32,38 @@ LFFloaterInvPanel::LFFloaterInvPanel(const LLSD& cat, const std::string& name, L
: LLInstanceTracker<LFFloaterInvPanel, LLSD>(cat)
{
// Setup the floater first
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);
auto mPanel = new LLInventoryPanel("inv_panel", LLInventoryPanel::DEFAULT_SORT_ORDER, cat, LLRect(), model ? model : &gInventory, true);
// 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");
// Now set the title
const auto& title = name.empty() ? gInventory.getCategory(mPanel->getRootFolderID())->getName() : name;
setTitle(title);
// If we haven't existed before, create and set our rect control now
if (!existed)
// Figure out a unique name for our rect control
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;
gFloaterView->getNewFloaterPosition(&left, &top);
LLRect rect = getRect();
rect.translate(left - rect.mLeft, top - rect.mTop);
setRect(rect);
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
LLPanel* panel = getChild<LLPanel>("placeholder_panel");
mPanel->setRect(panel->getRect());
mPanel->setOrigin(0, 0);
mPanel->postBuild();
mPanel->setFollows(FOLLOWS_ALL);
mPanel->setEnabled(true);
mPanel->removeBorder();
addChild(mPanel);
removeChild(panel);
}
LFFloaterInvPanel::~LFFloaterInvPanel()
{
delete mPanel;
panel->addChild(mPanel);
}
// static
@@ -101,15 +90,18 @@ void LFFloaterInvPanel::closeAll()
}
}
// virtual
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);
if (LLFolderView* root = mPanel->getRootFolder())
root->scrollToShowSelection();
return true;
auto& mPanel = *getChild<LLInventoryPanel>("inv_panel");
if (!mPanel.hasFocus())
{
mPanel.setFocus(true);
if (LLFolderView* root = mPanel.getRootFolder())
root->scrollToShowSelection();
return true;
}
}
return LLFloater::handleKeyHere(key, mask);

View File

@@ -18,18 +18,16 @@
* Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
* Boston, MA 02110-1301 USA */
#ifndef LFFLOATERINVPANEL_H
#define LFFLOATERINVPANEL_H
#pragma once
#include "llfloater.h"
#include "llinstancetracker.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();
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)
@@ -42,10 +40,5 @@ public:
}
static void closeAll(); // Called when not allowed to have inventory open
/*virtual*/ BOOL handleKeyHere(KEY key, MASK mask);
private:
class LLInventoryPanel* mPanel;
BOOL handleKeyHere(KEY key, MASK mask) override;
};
#endif //LFFLOATERINVPANEL_H

View File

@@ -31,6 +31,7 @@
#include "pipeline.h"
#include "llagentaccess.h"
#include "llagentbenefits.h"
#include "llagentcamera.h"
#include "llagentwearables.h"
#include "llagentui.h"
@@ -38,11 +39,14 @@
#include "llanimationstates.h"
#include "llcallingcard.h"
#include "llcapabilitylistener.h"
#include "llcororesponder.h"
#include "llconsole.h"
#include "llenvmanager.h"
#include "llfirstuse.h"
#include "llfloatercamera.h"
#include "llfloatertools.h"
#include "llfloaterpostcard.h"
#include "llfloaterpreference.h"
#include "llgroupactions.h"
#include "llgroupmgr.h"
#include "llhomelocationresponder.h"
@@ -103,7 +107,7 @@
#include "lluictrlfactory.h" //For LLUICtrlFactory::getLayeredXMLNode
#include "floaterao.h" // for Typing override
#include "aosystem.h" // for Typing override
#include "hippolimits.h" // for getMaxAgentGroups
// [RLVa:KB] - Checked: 2011-11-04 (RLVa-1.4.4a)
#include "rlvactions.h"
@@ -184,10 +188,10 @@ public:
LLTeleportRequestViaLandmark(const LLUUID &pLandmarkId);
virtual ~LLTeleportRequestViaLandmark();
virtual bool canRestartTeleport();
bool canRestartTeleport() override;
virtual void startTeleport();
virtual void restartTeleport();
void startTeleport() override;
void restartTeleport() override;
protected:
inline const LLUUID &getLandmarkId() const {return mLandmarkId;};
@@ -196,15 +200,15 @@ private:
LLUUID mLandmarkId;
};
class LLTeleportRequestViaLure : public LLTeleportRequestViaLandmark
class LLTeleportRequestViaLure final : public LLTeleportRequestViaLandmark
{
public:
LLTeleportRequestViaLure(const LLUUID &pLureId, BOOL pIsLureGodLike);
virtual ~LLTeleportRequestViaLure();
virtual bool canRestartTeleport();
bool canRestartTeleport() override;
virtual void startTeleport();
void startTeleport() override;
protected:
inline BOOL isLureGodLike() const {return mIsLureGodLike;};
@@ -219,10 +223,10 @@ public:
LLTeleportRequestViaLocation(const LLVector3d &pPosGlobal);
virtual ~LLTeleportRequestViaLocation();
virtual bool canRestartTeleport();
bool canRestartTeleport() override;
virtual void startTeleport();
virtual void restartTeleport();
void startTeleport() override;
void restartTeleport() override;
protected:
inline const LLVector3d &getPosGlobal() const {return mPosGlobal;};
@@ -232,16 +236,16 @@ private:
};
class LLTeleportRequestViaLocationLookAt : public LLTeleportRequestViaLocation
class LLTeleportRequestViaLocationLookAt final : public LLTeleportRequestViaLocation
{
public:
LLTeleportRequestViaLocationLookAt(const LLVector3d &pPosGlobal);
virtual ~LLTeleportRequestViaLocationLookAt();
virtual bool canRestartTeleport();
bool canRestartTeleport() override;
virtual void startTeleport();
virtual void restartTeleport();
void startTeleport() override;
void restartTeleport() override;
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::sTeleportProgressMessages;
class LLAgentFriendObserver : public LLFriendObserver
class LLAgentFriendObserver final : public LLFriendObserver
{
public:
LLAgentFriendObserver() {}
virtual ~LLAgentFriendObserver() {}
virtual void changed(U32 mask);
LLAgentFriendObserver() = default;
virtual ~LLAgentFriendObserver() = default;
void changed(U32 mask) override;
};
void LLAgentFriendObserver::changed(U32 mask)
@@ -293,7 +297,7 @@ bool LLAgent::isActionAllowed(const LLSD& sdname)
{
bool allow_agent_voice = false;
LLVoiceChannel* channel = LLVoiceChannel::getCurrentVoiceChannel();
if (channel != NULL)
if (channel != nullptr)
{
if (channel->getSessionName().empty() && channel->getSessionID().isNull())
{
@@ -908,7 +912,7 @@ void LLAgent::setRegion(LLViewerRegion *regionp)
if (mRegionp)
{
// NaCl - Antispam Registry
NACLAntiSpamRegistry::purgeAllQueues();
if (auto antispam = NACLAntiSpamRegistry::getIfExists()) antispam->resetQueues();
// NaCl End
// 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))
{
mAutoPilotTargetGlobal = object->getPositionGlobal();
if (const auto& av = object->asAvatar()) // Fly if avatar target is flying
if (const auto& av = object->asAvatar()) // Fly/sit if avatar target is flying
{
setFlying(av->mInAir);
const auto& our_pos_global = getPositionGlobal();
setFlying(av->mInAir && (getFlying() || mAutoPilotTargetGlobal[VZ] > our_pos_global[VZ])); // If they're in air, fly if they're higher or we were already (follow) flying
if (av->isSitting() && (!rlv_handler_t::isEnabled() || !gRlvHandler.hasBehaviour(RLV_BHVR_SIT)))
{
if (auto seat = av->getParent())
@@ -1801,7 +1806,7 @@ void LLAgent::autoPilot(F32 *delta_yaw)
}
else // Ground sit, but only if near enough
{
if (dist_vec(av->getPositionAgent(), getPositionAgent()) <= mAutoPilotStopDistance) // We're close enough, sit.
if (dist_vec(mAutoPilotTargetGlobal, our_pos_global) <= mAutoPilotStopDistance) // We're close enough, sit.
{
if (!gAgentAvatarp->isSittingAvatarOnGround())
setControlFlags(AGENT_CONTROL_SIT_ON_GROUND);
@@ -1819,7 +1824,7 @@ void LLAgent::autoPilot(F32 *delta_yaw)
}
else
{
if (dist_vec(av->getPositionAgent(), getPositionAgent()) <= mAutoPilotStopDistance)
if (dist_vec(mAutoPilotTargetGlobal, our_pos_global) <= mAutoPilotStopDistance)
{
follow = 3; // We're close enough, indicate no walking
}
@@ -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->
sendChatFromViewer("", CHAT_TYPE_START, FALSE);
}
@@ -2125,7 +2130,7 @@ void LLAgent::stopTyping()
if (mRenderState & AGENT_STATE_TYPING)
{
clearRenderState(AGENT_STATE_TYPING);
LLFloaterAO::typing(false); // Singu Note: Typing anims handled by AO/settings.
AOSystem::typing(false); // Singu Note: Typing anims handled by AO/settings.
gChatBar->
sendChatFromViewer("", CHAT_TYPE_STOP, FALSE);
}
@@ -2589,15 +2594,11 @@ void LLAgent::onAnimStop(const LLUUID& id)
}
else if (id == ANIM_AGENT_AWAY)
{
// clearAFK();
// [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))
clearAFK();
#else
clearAFK();
#endif // RLV_EXTENSION_CMD_ALLOWIDLE
// [/RLVa:KB]
// clearAFK();
}
else if (id == ANIM_AGENT_STANDUP)
{
@@ -2668,7 +2669,7 @@ bool LLAgent::canAccessMaturityInRegion( U64 region_handle ) const
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] );
return canAccessMaturityInRegion( region_handle );
@@ -2715,7 +2716,7 @@ int LLAgent::convertTextToMaturity(char text)
return LLAgentAccess::convertTextToMaturity(text);
}
class LLMaturityPreferencesResponder : public LLHTTPClient::ResponderWithResult
class LLMaturityPreferencesResponder final : public LLHTTPClient::ResponderWithResult
{
LOG_CLASS(LLMaturityPreferencesResponder);
public:
@@ -2723,12 +2724,10 @@ public:
virtual ~LLMaturityPreferencesResponder();
protected:
virtual void httpSuccess();
virtual void httpFailure();
/*virtual*/ char const* getName(void) const { return "LLMaturityPreferencesResponder"; }
protected:
void httpSuccess() override;
void httpFailure() override;
char const* getName() const override { return "LLMaturityPreferencesResponder"; }
private:
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));
// 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());
}
@@ -3162,7 +3161,7 @@ BOOL LLAgent::setUserGroupFlags(const LLUUID& group_id, BOOL accept_notices, BOO
BOOL LLAgent::canJoinGroups() const
{
return (S32)mGroups.size() < gHippoLimits->getMaxAgentGroups();
return (S32)mGroups.size() < LLAgentBenefitsMgr::current().getGroupMembershipLimit();
}
LLQuaternion LLAgent::getHeadRotation()
@@ -3206,24 +3205,27 @@ void LLAgent::sendAnimationRequests(const uuid_vec_t &anim_ids, EAnimRequest req
msg->addUUIDFast(_PREHASH_AgentID, getID());
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;
}
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);
num_valid_anims++;
}
if (!num_valid_anims)
{
msg->clearMessage();
return;
}
msg->nextBlockFast(_PREHASH_PhysicalAvatarEventList);
msg->addBinaryDataFast(_PREHASH_TypeData, NULL, 0);
if (num_valid_anims)
{
sendReliableMessage();
}
msg->addBinaryDataFast(_PREHASH_TypeData, nullptr, 0);
sendReliableMessage();
}
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->nextBlockFast(_PREHASH_PhysicalAvatarEventList);
msg->addBinaryDataFast(_PREHASH_TypeData, NULL, 0);
msg->addBinaryDataFast(_PREHASH_TypeData, nullptr, 0);
sendReliableMessage();
}
@@ -3268,7 +3270,7 @@ void LLAgent::sendAnimationStateReset()
msg->addBOOLFast(_PREHASH_StartAnim, FALSE);
msg->nextBlockFast(_PREHASH_PhysicalAvatarEventList);
msg->addBinaryDataFast(_PREHASH_TypeData, NULL, 0);
msg->addBinaryDataFast(_PREHASH_TypeData, nullptr, 0);
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.
LLGroupData gd;
gd.mID = group_id;
std::vector<LLGroupData>::iterator found_it = std::find(gAgent.mGroups.begin(), gAgent.mGroups.end(), gd);
if (found_it != gAgent.mGroups.end())
auto found_it = std::find(gAgent.mGroups.cbegin(), gAgent.mGroups.cend(), gd);
if (found_it != gAgent.mGroups.cend())
{
gAgent.mGroups.erase(found_it);
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,
const LLSD& context,
const LLSD& input) const
const LLSD& input) const override
{
if (
@@ -3566,11 +3568,8 @@ class LLAgentDropGroupViewerNode : public LLHTTPNode
//there is only one set of data in the AgentData block
LLSD agent_data = body["AgentData"][0];
LLUUID agent_id;
LLUUID group_id;
agent_id = agent_data["AgentID"].asUUID();
group_id = agent_data["GroupID"].asUUID();
LLUUID agent_id = agent_data["AgentID"].asUUID();
LLUUID group_id = agent_data["GroupID"].asUUID();
if (agent_id != gAgentID)
{
@@ -3585,8 +3584,8 @@ class LLAgentDropGroupViewerNode : public LLHTTPNode
// and add the new data to pick up changes.
LLGroupData gd;
gd.mID = group_id;
std::vector<LLGroupData>::iterator found_it = std::find(gAgent.mGroups.begin(), gAgent.mGroups.end(), gd);
if (found_it != gAgent.mGroups.end())
auto found_it = std::find(gAgent.mGroups.cbegin(), gAgent.mGroups.cend(), gd);
if (found_it != gAgent.mGroups.cend())
{
gAgent.mGroups.erase(found_it);
if (gAgent.getGroupID() == group_id)
@@ -3657,8 +3656,8 @@ void LLAgent::processAgentGroupDataUpdate(LLMessageSystem *msg, void **)
{
need_floater_update = true;
// 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);
if (found_it != gAgent.mGroups.end())
auto found_it = std::find(gAgent.mGroups.cbegin(), gAgent.mGroups.cend(), group);
if (found_it != gAgent.mGroups.cend())
{
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,
const LLSD& context,
const LLSD& input) const
const LLSD& input) const override
{
LLSD body = input["body"];
if(body.has("body"))
@@ -3717,8 +3716,8 @@ class LLAgentGroupDataUpdateViewerNode : public LLHTTPNode
{
need_floater_update = true;
// 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);
if (found_it != gAgent.mGroups.end())
auto found_it = std::find(gAgent.mGroups.cbegin(), gAgent.mGroups.cend(), group);
if (found_it != gAgent.mGroups.cend())
{
gAgent.mGroups.erase(found_it);
}
@@ -3919,7 +3918,7 @@ void LLAgent::processAgentCachedTextureResponse(LLMessageSystem *mesgsys, void *
return;
}
if (gAgentAvatarp->isEditingAppearance())
if (isAgentAvatarValid() && gAgentAvatarp->isEditingAppearance())
{
// ignore baked textures when in customize mode
return;
@@ -4050,6 +4049,7 @@ void LLAgent::clearVisualParams(void *data)
// protected
bool LLAgent::teleportCore(bool is_local)
{
LL_INFOS("Teleport") << "In teleport core!" << LL_ENDL;
if ((TELEPORT_NONE != mTeleportState) && (mTeleportState != TELEPORT_PENDING))
{
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
if (isAgentAvatarValid())
{
for ( LLVOAvatar::AnimIterator anim_it= gAgentAvatarp->mPlayingAnimations.begin();
for ( auto anim_it= gAgentAvatarp->mPlayingAnimations.begin();
anim_it != gAgentAvatarp->mPlayingAnimations.end();
++anim_it)
{
@@ -4086,8 +4086,7 @@ bool LLAgent::teleportCore(bool is_local)
LLFloaterWorldMap::hide();
// hide land floater too - it'll be out of date
if (LLFloaterLand::findInstance())
LLFloaterLand::hideInstance();
if (LLFloaterLand::findInstance()) LLFloaterLand::hideInstance();
LLViewerParcelMgr::getInstance()->deselectLand();
LLViewerMediaFocus::getInstance()->clearFocus();
@@ -4861,7 +4860,7 @@ void LLAgent::sendAgentSetAppearance()
// 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
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;
if(transmitted_params < 218) {
LLNotificationsUtil::add("SGIncompleteAppearance");
}
if (transmitted_params < 218) LLNotificationsUtil::add("SGIncompleteAppearance");
sendReliableMessage();
}
@@ -4901,8 +4898,96 @@ void LLAgent::sendAgentDataUpdateRequest()
void LLAgent::sendAgentUserInfoRequest()
{
if(getID().isNull())
std::string cap;
if (getID().isNull())
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->nextBlockFast(_PREHASH_AgentData);
gMessageSystem->addUUIDFast(_PREHASH_AgentID, getID());
@@ -4910,6 +4995,21 @@ void LLAgent::sendAgentUserInfoRequest()
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()
{
if(!mFriendObserver)
@@ -4977,18 +5077,6 @@ const void LLAgent::getTeleportSourceSLURL(LLSLURL& slurl) const
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()
{
LL_INFOS() << "group " << mGroupName << LL_ENDL;

View File

@@ -33,8 +33,6 @@
#ifndef LL_LLAGENT_H
#define LL_LLAGENT_H
#include <set>
#include "indra_constants.h"
#include "llevent.h" // LLObservable base class
#include "llagentconstants.h"
@@ -46,7 +44,6 @@
#include "llinventorymodel.h"
#include "v3dmath.h"
#include <boost/function.hpp>
#include <boost/shared_ptr.hpp>
#include <boost/signals2.hpp>
@@ -70,6 +67,7 @@ class LLAgentAccess;
class LLSLURL;
class LLSimInfo;
class LLTeleportRequest;
struct LLCoroResponder;
typedef boost::shared_ptr<LLTeleportRequest> LLTeleportRequestPtr;
@@ -100,7 +98,7 @@ struct LLGroupData
//------------------------------------------------------------------------
// LLAgent
//------------------------------------------------------------------------
class LLAgent : public LLOldEvents::LLObservable
class LLAgent final : public LLOldEvents::LLObservable
{
LOG_CLASS(LLAgent);
@@ -248,7 +246,7 @@ public:
void changeParcels(); // called by LLViewerParcelMgr when we cross a parcel boundary
// 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);
private:
@@ -786,7 +784,7 @@ public:
void requestEnterGodMode();
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::connection god_level_change_slot_t;
@@ -808,7 +806,7 @@ public:
bool canAccessMature() const;
bool canAccessAdult() const;
bool canAccessMaturityInRegion( U64 region_handle ) const;
bool canAccessMaturityAtGlobal( LLVector3d pos_global ) const;
bool canAccessMaturityAtGlobal( const LLVector3d& pos_global ) const;
bool prefersPG() const;
bool prefersMature() const;
bool prefersAdult() const;
@@ -965,9 +963,17 @@ public:
void sendAgentSetAppearance();
void sendAgentDataUpdateRequest();
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);
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
//--------------------------------------------------------------------

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

View File

@@ -40,11 +40,21 @@
/// Classes for AISv3 support.
///----------------------------------------------------------------------------
extern AIHTTPTimeoutPolicy AISAPIResponder_timeout;
class AISCommand final : public LLHTTPClient::ResponderWithCompleted
{
public:
typedef boost::function<void()> command_func_type;
// AISCommand - base class for retry-able HTTP requests using the AISv3 cap.
// Limit max in flight requests to 2. Server was aggressively throttling otherwise.
constexpr static U8 sMaxActiveAISCommands = 4;
static U8 sActiveAISCommands;
static std::queue< boost::intrusive_ptr< AISCommand > > sPendingAISCommands;
virtual AIHTTPTimeoutPolicy const& getHTTPTimeoutPolicy(void) const { return AISAPIResponder_timeout; }
AISCommand(AISAPI::COMMAND_TYPE type, const char* name, const LLUUID& targetId, AISAPI::completion_t callback) :
mCommandFunc(NULL),
mRetryPolicy(new LLAdaptiveRetryPolicy(1.0, 32.0, 2.0, 10)),
@@ -53,10 +63,30 @@ public:
mName(name),
mType(type)
{}
virtual ~AISCommand()
{
if (mActive)
{
--sActiveAISCommands;
while (sActiveAISCommands < sMaxActiveAISCommands && !sPendingAISCommands.empty())
{
sPendingAISCommands.front()->dispatch();
sPendingAISCommands.pop();
}
}
}
void run( command_func_type func )
{
(mCommandFunc = func)();
mCommandFunc = func;
if (sActiveAISCommands >= sMaxActiveAISCommands)
{
sPendingAISCommands.push(this);
}
else
{
dispatch();
}
}
char const* getName(void) const override
@@ -64,6 +94,17 @@ public:
return mName;
}
private:
void dispatch()
{
if (LLApp::isQuitting())
{
return;
}
++sActiveAISCommands;
mActive = true;
(mCommandFunc)();
}
void markComplete()
{
// Command func holds a reference to self, need to release it
@@ -72,42 +113,56 @@ public:
mRetryPolicy->onSuccess();
}
void malformedResponse() { mStatus = HTTP_INTERNAL_ERROR_OTHER; mReason = llformat("Malformed response contents (original code: %d)", mStatus); }
bool onFailure()
{
bool retry = mStatus != HTTP_INTERNAL_ERROR_OTHER && mStatus != 410; // We handle these and stop
LL_WARNS("Inventory") << "Inventory error: " << dumpResponse() << LL_ENDL;
if (retry) mRetryPolicy->onFailure(mStatus, getResponseHeaders());
mRetryPolicy->onFailure(mStatus, getResponseHeaders());
F32 seconds_to_wait;
if (retry && mRetryPolicy->shouldRetry(seconds_to_wait))
if (mRetryPolicy->shouldRetry(seconds_to_wait))
{
if (mStatus == 503)
{
// Pad delay a bit more since we're getting throttled.
seconds_to_wait += 10.f + ll_frand(4.f);
}
LL_WARNS("Inventory") << "Retrying in " << seconds_to_wait << "seconds due to inventory error for " << getName() <<": " << dumpResponse() << LL_ENDL;
doAfterInterval(mCommandFunc,seconds_to_wait);
return true;
}
else
{
// Command func holds a reference to self, need to release it
// after a success or final failure.
// *TODO: Notify user? This seems bad.
LL_WARNS("Inventory") << "Abort due to inventory error for " << getName() <<": " << dumpResponse() << LL_ENDL;
mCommandFunc = no_op;
return false;
}
return retry;
}
protected:
void httpCompleted() override
{
AISAPI::InvokeAISCommandCoro(this, getURL(), mTargetId, getContent(), mCompletionFunc, (AISAPI::COMMAND_TYPE)mType);
// Continue through if successful or longer retrying,
if (isGoodStatus(mStatus) || !onFailure())
{
markComplete();
AISAPI::InvokeAISCommandCoro(this, getURL(), mTargetId, getContent(), mCompletionFunc, (AISAPI::COMMAND_TYPE)mType);
}
}
private:
command_func_type mCommandFunc;
LLPointer<LLHTTPRetryPolicy> mRetryPolicy;
AISAPI::completion_t mCompletionFunc;
const LLUUID mTargetId;
const char* mName;
bool mActive = false;
AISAPI::COMMAND_TYPE mType;
};
U8 AISCommand::sActiveAISCommands = 0;
std::queue< boost::intrusive_ptr< AISCommand > > AISCommand::sPendingAISCommands;
//=========================================================================
const std::string AISAPI::INVENTORY_CAP_NAME("InventoryAPIv3");
const std::string AISAPI::LIBRARY_CAP_NAME("LibraryAPIv3");
@@ -312,21 +367,18 @@ void AISAPI::UpdateItem(const LLUUID &itemId, const LLSD &updates, completion_t
boost::intrusive_ptr< AISCommand > responder = new AISCommand(UPDATEITEM, "UpdateItem",itemId, callback);
responder->run(boost::bind(&LLHTTPClient::patch, url, updates, responder/*,*/ DEBUG_CURLIO_PARAM(debug_off), keep_alive, (AIStateMachine*)NULL, 0));
}
void AISAPI::InvokeAISCommandCoro(AISCommand* responder,
void AISAPI::InvokeAISCommandCoro(LLHTTPClient::ResponderWithCompleted* responder,
std::string url,
LLUUID targetId, LLSD result, completion_t callback, COMMAND_TYPE type)
{
LL_DEBUGS("Inventory") << "url: " << url << LL_ENDL;
auto status = responder->getStatus();
auto status = responder->getStatus();
if (!responder->isGoodStatus(status) || !result.isMap())
{
if (!result.isMap())
{
responder->malformedResponse();
}
else if (status == 410) //GONE
{
LL_WARNS("Inventory") << "Inventory error: " << status << ": " << responder->getReason() << LL_ENDL;
if (status == 410) //GONE
{
// Item does not exist or was already deleted from server.
// parent folder is out of sync
@@ -360,11 +412,12 @@ void AISAPI::InvokeAISCommandCoro(AISCommand* responder,
}
}
}
// Keep these statuses accounted for in the responder too
if (responder->onFailure()) // If we're retrying, exit early.
return;
if (!result.isMap())
{
LL_WARNS("Inventory") << "Inventory error: Malformed response contents" << LL_ENDL;
}
LL_WARNS("Inventory") << ll_pretty_print_sd(result) << LL_ENDL;
}
else responder->markComplete();
gInventory.onAISUpdateReceived("AISCommand", result);
@@ -734,11 +787,9 @@ void AISUpdate::parseUUIDArray(const LLSD& content, const std::string& name, uui
{
if (content.has(name))
{
for(LLSD::array_const_iterator it = content[name].beginArray(),
end = content[name].endArray();
it != end; ++it)
for (auto& id : content[name].array())
{
ids.insert((*it).asUUID());
ids.insert(id.asUUID());
}
}
}

View File

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

View File

@@ -47,6 +47,7 @@
#include "llagent.h"
#include "llagentcamera.h"
#include "llagentwearables.h"
#include "llimprocessing.h"
#include "llwindow.h"
#include "llviewerstats.h"
#include "llmarketplacefunctions.h"
@@ -158,6 +159,7 @@
// Included so that constants/settings might be initialized
// in save_settings_to_globals()
#include "aosystem.h"
#include "llbutton.h"
#include "llcombobox.h"
#include "floaterlocalassetbrowse.h"
@@ -190,6 +192,7 @@
#include "llviewerthrottle.h"
#include "llparcel.h"
#include "llviewerassetstats.h"
#include "NACLantispam.h"
#include "llmainlooprepeater.h"
@@ -218,13 +221,49 @@
#include <client/crashpad_client.h>
#include <client/prune_crash_reports.h>
#include <client/settings.h>
#include <client/annotation.h>
#include <fmt/format.h>
#include "llnotificationsutil.h"
#include "llversioninfo.h"
template <size_t SIZE, crashpad::Annotation::Type T = crashpad::Annotation::Type::kString>
struct crashpad_annotation : public crashpad::Annotation {
std::array<char, SIZE> buffer;
crashpad_annotation(const char* name) : crashpad::Annotation(T, name, buffer.data())
{}
void set(const std::string& src) {
//LL_INFOS() << name() << ": " << src.c_str() << LL_ENDL;
const size_t min_size = llmin(SIZE, src.size());
memcpy(buffer.data(), src.data(), min_size);
buffer.data()[SIZE - 1] = '\0';
SetSize(min_size);
}
};
#define DEFINE_CRASHPAD_ANNOTATION(name, len) \
static crashpad_annotation<len> g_crashpad_annotation_##name##_buffer("sentry[tags]["#name"]");
#define DEFINE_CRASHPAD_ANNOTATION_EXTRA(name, len) \
static crashpad_annotation<len> g_crashpad_annotation_##name##_buffer("sentry[extra]["#name"]");
#define SET_CRASHPAD_ANNOTATION_VALUE(name, value) \
g_crashpad_annotation_##name##_buffer.set(value);
#else
#define SET_CRASHPAD_ANNOTATION_VALUE(name, value)
#define DEFINE_CRASHPAD_ANNOTATION_EXTRA(name, len)
#define DEFINE_CRASHPAD_ANNOTATION(name, len)
#endif
DEFINE_CRASHPAD_ANNOTATION_EXTRA(fatal_message, 512);
DEFINE_CRASHPAD_ANNOTATION(grid_name, 64);
DEFINE_CRASHPAD_ANNOTATION(region_name, 64);
DEFINE_CRASHPAD_ANNOTATION_EXTRA(cpu_string, 128);
DEFINE_CRASHPAD_ANNOTATION_EXTRA(gpu_string, 128);
DEFINE_CRASHPAD_ANNOTATION_EXTRA(gl_version, 128);
DEFINE_CRASHPAD_ANNOTATION_EXTRA(session_duration, 32);
DEFINE_CRASHPAD_ANNOTATION_EXTRA(startup_state, 32);
DEFINE_CRASHPAD_ANNOTATION_EXTRA(memory_sys, 32);
DEFINE_CRASHPAD_ANNOTATION_EXTRA(memory_alloc, 32);
////// Windows-specific includes to the bottom - nasty defines in these pollute the preprocessor
//
@@ -429,27 +468,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,
// or for things that are performance critical. JC
static void settings_to_globals()
@@ -789,8 +807,18 @@ bool LLAppViewer::init()
initCrashReporting();
#endif
writeDebugInfo();
setupErrorHandling();
{
auto fn = boost::bind<bool>([](const LLSD& stateInfo) -> bool {
SET_CRASHPAD_ANNOTATION_VALUE(startup_state, stateInfo["str"].asString());
return false;
}, _1);
LLStartUp::getStateEventPump().listen<::LLEventListener>("LLAppViewer", fn);
}
//
// Start of the application
//
@@ -1057,6 +1085,8 @@ bool LLAppViewer::init()
gGLManager.getGLInfo(gDebugInfo);
gGLManager.printGLInfoString();
writeDebugInfo();
// Load Default bindings
load_default_bindings(gSavedSettings.getBOOL("LiruUseZQSDKeys"));
@@ -1144,6 +1174,8 @@ bool LLAppViewer::init()
// save the graphics card
gDebugInfo["GraphicsCard"] = LLFeatureManager::getInstance()->getGPUString();
writeDebugInfo();
// Save the current version to the prefs file
gSavedSettings.setString("LastRunVersion",
LLVersionInfo::getChannelAndVersion());
@@ -1161,6 +1193,8 @@ bool LLAppViewer::init()
gGLActive = FALSE;
LLViewerMedia::initClass();
LL_INFOS("InitInfo") << "Viewer media initialized." << LL_ENDL ;
writeDebugInfo();
return true;
}
@@ -1312,6 +1346,12 @@ bool LLAppViewer::mainLoop()
//clear call stack records
LL_CLEAR_CALLSTACKS();
#ifdef USE_CRASHPAD
// Not event based. Update per frame
SET_CRASHPAD_ANNOTATION_VALUE(session_duration, std::to_string(LLFrameTimer::getElapsedSeconds()));
SET_CRASHPAD_ANNOTATION_VALUE(memory_alloc, std::to_string((LLMemory::getCurrentRSS() >> 10)/1000.f));
#endif
//check memory availability information
checkMemory() ;
@@ -1678,6 +1718,8 @@ bool LLAppViewer::cleanup()
LLCalc::cleanUp();
AOSystem::deleteSingleton();
LL_INFOS() << "Global stuff deleted" << LL_ENDL;
// Note: this is where LLFeatureManager::getInstance()-> used to be deleted.
@@ -2760,6 +2802,16 @@ void LLAppViewer::writeDebugInfo(bool isStatic)
isStatic ? LLSDSerialize::toPrettyXML(gDebugInfo, out_file)
: LLSDSerialize::toPrettyXML(gDebugInfo["Dynamic"], out_file);
#else
SET_CRASHPAD_ANNOTATION_VALUE(fatal_message, gDebugInfo["FatalMessage"].asString());
SET_CRASHPAD_ANNOTATION_VALUE(grid_name, gDebugInfo["GridName"].asString());
SET_CRASHPAD_ANNOTATION_VALUE(region_name, gDebugInfo["CurrentRegion"].asString());
SET_CRASHPAD_ANNOTATION_VALUE(cpu_string, gDebugInfo["CPUInfo"]["CPUString"].asString());
SET_CRASHPAD_ANNOTATION_VALUE(gpu_string, gDebugInfo["GraphicsCard"].asString());
SET_CRASHPAD_ANNOTATION_VALUE(gl_version, gDebugInfo["GLInfo"]["GLVersion"].asString());
SET_CRASHPAD_ANNOTATION_VALUE(session_duration, std::to_string(LLFrameTimer::getElapsedSeconds()));
SET_CRASHPAD_ANNOTATION_VALUE(memory_alloc, std::to_string((LLMemory::getCurrentRSS() >> 10) / 1000.f));
SET_CRASHPAD_ANNOTATION_VALUE(memory_sys, std::to_string(gDebugInfo["RAMInfo"]["Physical"].asInteger() * 0.001f));
#endif
}
@@ -2944,8 +2996,8 @@ void LLAppViewer::handleViewerCrash()
gDebugInfo["ViewerExePath"] = gDirUtilp->getExecutablePathAndName();
gDebugInfo["CurrentPath"] = gDirUtilp->getCurPath();
gDebugInfo["Dynamic"]["SessionLength"] = F32(LLFrameTimer::getElapsedSeconds());
gDebugInfo["StartupState"] = LLStartUp::getStartupStateString();
gDebugInfo["Dynamic"]["RAMInfo"]["Allocated"] = (LLSD::Integer) LLMemory::getCurrentRSS() >> 10;
gDebugInfo["StartupState"] = LLStartUp::getStartupStateString();
gDebugInfo["FirstLogin"] = (LLSD::Boolean) gAgent.isFirstLogin();
gDebugInfo["FirstRunThisInstall"] = gSavedSettings.getBOOL("FirstRunThisInstall");
@@ -4049,7 +4101,7 @@ void LLAppViewer::idle()
// here.
{
LAZY_FT("request_initial_instant_messages");
request_initial_instant_messages();
LLIMProcessing::requestOfflineMessages();
}
///////////////////////////////////
@@ -4209,6 +4261,7 @@ void LLAppViewer::idle()
gIdleCallbacks.callFunctions();
gInventory.idleNotifyObservers();
if (auto antispam = NACLAntiSpamRegistry::getIfExists()) antispam->idle();
}
// Metrics logging (LLViewerAssetStats, etc.)
@@ -4806,11 +4859,14 @@ void LLAppViewer::disconnectViewer()
// floater_sound_preview.xml
// floater_animation_preview.xml
// files.
// A more generic mechanism would be nice..
LLFloater* fl = static_cast<LLFloater*>(*it);
if (fl
&& (fl->getName() == "Image Preview"
|| fl->getName() == "Sound Preview"
|| fl->getName() == "Animation Preview"
|| fl->getName() == "perm prefs"
))
{
floaters_to_close.push_back(fl);

View File

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

View File

@@ -349,7 +349,10 @@ bool LLAttachmentsMgr::getPendingAttachments(uuid_set_t& ids) const
ids.clear();
// Returns the union of the LL maintained list of attachments that are waiting for link creation and our maintained list of attachments that are pending link creation
set_union(mRecentlyArrivedAttachments.begin(), mRecentlyArrivedAttachments.end(), mPendingAttachLinks.begin(), mPendingAttachLinks.end(), std::inserter(ids, ids.begin()));
ids.insert(mRecentlyArrivedAttachments.begin(), mRecentlyArrivedAttachments.end());
ids.insert(mPendingAttachLinks.begin(), mPendingAttachLinks.end());
// Singu Note: "Expression: Sequence not ordered" using std::set_union
//set_union(mRecentlyArrivedAttachments.begin(), mRecentlyArrivedAttachments.end(), mPendingAttachLinks.begin(), mPendingAttachLinks.end(), std::inserter(ids, ids.begin()));
return !ids.empty();
}

View File

@@ -1149,6 +1149,7 @@ LLSpatialPartition* LLDrawable::getSpatialPartition()
//must be an active volume
if (!mSpatialBridge)
{
// Spatial bridge ctors self-register...
if (mVObjp->isHUDAttachment())
{
setSpatialBridge(new LLHUDBridge(this, getRegion()));
@@ -1595,11 +1596,7 @@ void LLSpatialBridge::cleanupReferences()
LLDrawable::cleanupReferences();
if (mDrawable)
{
/*
DON'T DO THIS -- this should happen through octree destruction
mDrawable->setSpatialGroup(NULL);
mDrawable->setGroup(NULL);
if (mDrawable->getVObj())
{
LLViewerObject::const_child_list_t& child_list = mDrawable->getVObj()->getChildren();
@@ -1607,17 +1604,18 @@ void LLSpatialBridge::cleanupReferences()
iter != child_list.end(); iter++)
{
LLViewerObject* child = *iter;
LLDrawable* drawable = child->mDrawable;
LLDrawable* drawable = child->mDrawable;
if (drawable)
{
drawable->setSpatialGroup(NULL);
drawable->setGroup(NULL);
}
}
}*/
}
LLDrawable* drawablep = mDrawable;
mDrawable = NULL;
drawablep->setSpatialBridge(NULL);
LLPointer<LLSpatialBridge> bridgep = mDrawable->getSpatialBridge();
mDrawable->setSpatialBridge(nullptr);
mDrawable = nullptr;
bridgep = nullptr;
}
}

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