Commit Graph

1281 Commits (1bbad3fd00a9db28944bab1ec9c0e10fd5d1c2f2)

Author SHA1 Message Date
Erik Kundiman afcc64cb07
Rich Presence support using Discord Social SDK (#4457)
* Rich Presence support using Discord Social SDK

Download DiscordSocialSdk-1.4.9649.zip from
https://discord.com/developers/applications/1394782217405862001/social-sdk/downloads
Add -DUSE_DISCORD:BOOL=ON to your cmake line.
The Discord app needs to be set to be a public client in the OAuth2 tab.
All Discord-related code are contained within one file, llstartup.cpp,
and other classes access it through some opaque layer, static functions,
otherwise we'd get these "duplicate symbol" linking errors.

* Move Discord-related code to llappviewer.cpp

The doFrame is the one called over and over again, so running the
Discord callbacks from there shouldn't have one extra function
overhead, while running the Discord initialisation is only once so
it's much more okay to have the extra function overhead there.

* panel_preferences_privacy tabs

Add tab and checkboxes for discord social SDK integration options to panel_preferences_privacy.xml

* Shorten Discord-related local variable names

* Connect to Discord now through privacy tab

Now the access token is saved the way passwords are saved, but
without a username, so we can have some persistence without having
to implement an OAuth2 backend server cause we would have to store
those tokens there anyway still, and it's just simpler to not go
that way. Discord Social SDK doesn't have a helper for sending code
to a custom server anyway, that we would have to have some
asynchronous HTTP requestor ready.
Show location check button gets enabled only when Discord
integration is enabled, though it's not functioning yet.

* Location for Discord Rich Presence Activity State

I was going to use LLAgentUI::buildLocationString but there's no
location format that shows only region and coords without having
to have the parcel name empty, so I copied buildLocationString
implementation in the case of LOCATION_FORMAT_NO_MATURITY but when
the parcel name is empty.
I had to make updateDiscordActivity check agent's ID and the
existence of agent avatar pointer first before trying to set
Activity Details or State, cause I like the "Show location" button
be checkable not only after online when both the ID & pointer will
have existed. I think this way is simpler than programmatically
enabling the "Show location" button after the user is logged in.
I put a trigger to Activity update somewhere after the user is
logged in for now, not yet after a TP.
The elapsed time gets reset whenever Activity is updated for now,
but I'll try to make elapsed time extended instead.
No Party for now, because I couldn't find a way to make a Party
shown without showing its CurrentSize (I could still get away not
showing its MaxSize by setting it to 0), so the State (location)
is shown above the elapsed time, not on the right of it.
I'll try to figure out to get some representative numbers for its
CurrentSize & MaxSize next.
Also no privacy on hiding the username for now, until the UI is
ready.

* Update Rich Presence location on region change

I had to find a spot in source code where it doesn't cause a crash
(it did in LLAgent::setRegion), but I'm not removing the one in
llstartup.cpp because on login, the one in llviewermessage.cpp
gets only the placeholder coords (10, 10, 10).

* Show display name too on Discord Rich Presence

Avatar name cache can be used right away upon login now after I
moved the update call to the end of PRECACHE section in llstartup.

* Show Discord Rich Presence Activity Party

By setting CurrentSize to the number of people within chat radius,
and MaxSize to the number of people within near range.

* Call updateDiscordActivity too in Discord init

so when the user enables the integration after being logged in,
the init can show the name and location right away.

* Discord Rich Presence: Hide name & connect to llappviewer.cpp

Add option to show/hide avatar name in privacy panel & connect rich presense directly to llappviewer.cpp

* Discord time elapsed not reset on region change

Time elapses right after viewer launch even before login.
Plus parameter name change in header to make it the same as in
implementation.

* Cache bool setting retrievals in updateDiscordActivity

As suggested by Andrey Kleschev.
getBOOL and getF32 are expensive, so using `static LLCachedControl<>`
is the way to do it in llappviewer.cpp.

* Check Discord creds existence before getting token

as suggested by Andrey Kleshchev, anticipating external factors
such as user moving settings from another PC.

* Tracy visibility for looped Discord function calls

As suggested by Andrey Kleshchev. They likely can get pricey so
they need to be visible in the profiler.

* Discord-related error handling/logging

plus delay saving Discord credentials to only after the access
token is successfully updated on Discord, and try to disconnect
from Discord when the integration gets disabled regardless whether
there are credentials to delete or not and whether there's an
access token to revoke or not.

* Use getAvatars already called for Discord Party numbers

so we don't have to make any extra getAvatars calls just for this,
as it's pricy in crowds, and we'll just be piggybacking
`updateSpeakerList` and `updateNearbyList`.

* Assemble Discord Activity Details only once

by saving it to a static global string for reuse.

* Remove updateDiscordActivity call in startup loop

The State field (region & coords) is updated well enough without it
now.

* Rename handleDiscordSocial to toggleDiscordIntegration

* Update Discord Activity only when integration is enabled

No need to check setting for the status change callback one,
because getting there would need to be connected to Discord first,
which in turn needs the integration to be enabled first.

---------

Co-authored-by: Secret Foxtail <remmy@megapahit.net>
2025-07-31 08:54:39 -07:00
Andrey Kleshchev 8efc4744de #4370 Fix change in crouch behaviour
A motion wasn't reset and requires an extra 'push' from viewer.
2025-07-19 12:45:09 +03:00
Maxim Nikolenko 50108bf0b7
#4011 Add conversation list highlight for chat mention 2025-05-07 18:59:00 +03:00
Andrey Kleshchev 9a333e65c4
Merge develop into release/2025.04 2025-04-18 21:36:56 +03:00
Jonathan "Geenz" Goodman d19d44cc72
Merge pull request #3911 from secondlife/main
Merge 2025.03 release into develop.
2025-04-15 10:14:27 -04:00
Maxim Nikolenko 515c1f15d8
#3044 Add option to hide L$ balance for Snapshots with Interface showing 2025-03-31 19:06:06 +03:00
Rider Linden b86c36eafc Merge remote-tracking branch 'remotes/origin/develop' into rider/bot_tattle
Fix conflicts
2025-03-25 09:58:43 -07:00
Andrey Kleshchev 969ed53680 Merge branch 'release/2025.03' into release/2025.04 2025-03-19 00:03:42 +02:00
Rider Linden 7cd50ceace Issue #2907: Process metadata sent along with chats of type IM_NOTHING_SPECIAL, The metadata can contain information about the bot status of the sender. It may also contain a system-injected notification that is displayed to the agent as part of the 1:1 chat window. 2025-02-26 16:23:21 -08:00
Rider Linden 3dc945c1df Private Issue #297: Code review feedback. 2025-02-26 16:02:26 -08:00
Rider Linden 81df0476b5 Private Issue #297: Accept new flags in ScriptTeleportRequest message. Flags indicate if the world map should be opened and focused. 2025-02-26 16:02:24 -08:00
Andrey Kleshchev 483e85cbf3 #3488 Prioritization adjustments 2025-02-19 14:16:42 +02:00
Andrey Kleshchev 74d2ed918d #3488 Speed up nearby avatar loading after a tp 2025-02-05 18:50:31 +02:00
Andrey Kleshchev b84f3ff6b1 viewer#2780 Speed up terrain loading on teleport
Terrain was arriving and processing too late resulting in issues like
"Lower terrain material incorrectly shown momentarily"
2025-02-05 18:50:31 +02:00
Alexander Gavriliuk 27b8e6d576 #2408 The long covenant with emojis significantly slows down some operations in the viewer 2024-09-18 17:13:59 +02:00
leviathan da87e8bd37 send AgentUpdate ASAP when control bits change 2024-09-13 10:47:24 -07:00
Rye Mutt 7d2cd036ea Fix rare shutdown crash in LLViewerObjectList 2024-07-21 20:10:02 -04:00
Ansariel 9fdca96f8b Re-enable compiler warnings C4244 and C4396 except for lltracerecording.h and llunittype.h for now 2024-07-08 20:27:14 +02:00
Brad Linden 7c42711ca3 Merge remote-tracking branch 'origin/DRTVWR-600-maint-A' into project/gltf_development 2024-06-10 16:22:12 -07:00
Ansariel b42f9d836b Re-enable a lot of compiler warnings for MSVC and address the C4267 "possible loss of precision" warnings 2024-06-01 15:49:26 +02:00
Dave Parks 2f41200384
Remove tinygltf dependency from LL::GLTF (#1541)
* #1535 Image loading/saving support in boost::json driven GLTF parser
* #1536 GLB Support in boost::json drvien GLTF parser
2024-05-28 09:45:40 -05:00
Ansariel e2e37cced8 Fix line endlings 2024-05-22 22:40:26 +03:00
Ansariel 1b67dd855c Merge remote-tracking branch 'origin/main' into DRTVWR-600-maint-A
# Conflicts:
#	autobuild.xml
#	indra/cmake/CMakeLists.txt
#	indra/cmake/GoogleMock.cmake
#	indra/llaudio/llaudioengine_fmodstudio.cpp
#	indra/llaudio/llaudioengine_fmodstudio.h
#	indra/llaudio/lllistener_fmodstudio.cpp
#	indra/llaudio/lllistener_fmodstudio.h
#	indra/llaudio/llstreamingaudio_fmodstudio.cpp
#	indra/llaudio/llstreamingaudio_fmodstudio.h
#	indra/llcharacter/llmultigesture.cpp
#	indra/llcharacter/llmultigesture.h
#	indra/llimage/llimage.cpp
#	indra/llimage/llimagepng.cpp
#	indra/llimage/llimageworker.cpp
#	indra/llimage/tests/llimageworker_test.cpp
#	indra/llmessage/tests/llmockhttpclient.h
#	indra/llprimitive/llgltfmaterial.h
#	indra/llrender/llfontfreetype.cpp
#	indra/llui/llcombobox.cpp
#	indra/llui/llfolderview.cpp
#	indra/llui/llfolderviewmodel.h
#	indra/llui/lllineeditor.cpp
#	indra/llui/lllineeditor.h
#	indra/llui/lltextbase.cpp
#	indra/llui/lltextbase.h
#	indra/llui/lltexteditor.cpp
#	indra/llui/lltextvalidate.cpp
#	indra/llui/lltextvalidate.h
#	indra/llui/lluictrl.h
#	indra/llui/llview.cpp
#	indra/llwindow/llwindowmacosx.cpp
#	indra/newview/app_settings/settings.xml
#	indra/newview/llappearancemgr.cpp
#	indra/newview/llappearancemgr.h
#	indra/newview/llavatarpropertiesprocessor.cpp
#	indra/newview/llavatarpropertiesprocessor.h
#	indra/newview/llbreadcrumbview.cpp
#	indra/newview/llbreadcrumbview.h
#	indra/newview/llbreastmotion.cpp
#	indra/newview/llbreastmotion.h
#	indra/newview/llconversationmodel.h
#	indra/newview/lldensityctrl.cpp
#	indra/newview/lldensityctrl.h
#	indra/newview/llface.inl
#	indra/newview/llfloatereditsky.cpp
#	indra/newview/llfloatereditwater.cpp
#	indra/newview/llfloateremojipicker.h
#	indra/newview/llfloaterimsessiontab.cpp
#	indra/newview/llfloaterprofiletexture.cpp
#	indra/newview/llfloaterprofiletexture.h
#	indra/newview/llgesturemgr.cpp
#	indra/newview/llgesturemgr.h
#	indra/newview/llimpanel.cpp
#	indra/newview/llimpanel.h
#	indra/newview/llinventorybridge.cpp
#	indra/newview/llinventorybridge.h
#	indra/newview/llinventoryclipboard.cpp
#	indra/newview/llinventoryclipboard.h
#	indra/newview/llinventoryfunctions.cpp
#	indra/newview/llinventoryfunctions.h
#	indra/newview/llinventorygallery.cpp
#	indra/newview/lllistbrowser.cpp
#	indra/newview/lllistbrowser.h
#	indra/newview/llpanelobjectinventory.cpp
#	indra/newview/llpanelprofile.cpp
#	indra/newview/llpanelprofile.h
#	indra/newview/llpreviewgesture.cpp
#	indra/newview/llsavedsettingsglue.cpp
#	indra/newview/llsavedsettingsglue.h
#	indra/newview/lltooldraganddrop.cpp
#	indra/newview/llurllineeditorctrl.cpp
#	indra/newview/llvectorperfoptions.cpp
#	indra/newview/llvectorperfoptions.h
#	indra/newview/llviewerparceloverlay.cpp
#	indra/newview/llviewertexlayer.cpp
#	indra/newview/llviewertexturelist.cpp
#	indra/newview/macmain.h
#	indra/test/test.cpp
2024-05-22 19:04:52 +02:00
Alexander Gavriliuk f9473e8afc secondlife/viewer#1333 BOOL to bool conversion leftovers: ternaries 2024-05-07 10:18:51 +02:00
Andrey Lihatskiy 38c2a5bde9 Merge branch 'marchcat/w-whitespace' into marchcat/x-ws-merge 2024-05-01 08:16:58 +03:00
Andrey Lihatskiy 1b68f71348 #824 Process source files in bulk: replace tabs with spaces, convert CRLF to LF, and trim trailing whitespaces as needed 2024-04-29 07:56:09 +03:00
Andrey Lihatskiy 85f2447b3d Merge branch 'main' into marchcat/a-merge
# Conflicts:
#	autobuild.xml
#	indra/llimage/llimage.cpp
#	indra/llui/llsearcheditor.cpp
#	indra/llui/llview.cpp
#	indra/newview/llagent.cpp
#	indra/newview/llappviewer.cpp
#	indra/newview/llfloatercamera.cpp
#	indra/newview/llfloatereditsky.cpp
#	indra/newview/llfloatereditwater.cpp
#	indra/newview/llinventoryfunctions.cpp
#	indra/newview/lloutfitgallery.cpp
#	indra/newview/lloutfitslist.cpp
#	indra/newview/llpanelgroupbulkban.cpp
#	indra/newview/llsidepanelappearance.cpp
#	indra/newview/llvovolume.cpp
2024-04-24 19:28:15 +03:00
Andrey Lihatskiy 428f21cf79 Merge branch 'main' into marchcat/x-merge 2024-04-24 18:45:54 +03:00
Andrey Lihatskiy eab5beb54c Merge branch 'main' into marchcat/x-merge
# Conflicts:
#	indra/llimage/llimageworker.cpp
#	indra/llimage/llimageworker.h
#	indra/newview/llcontrolavatar.cpp
#	indra/newview/llfloaterprofiletexture.cpp
#	indra/newview/lloutfitslist.cpp
#	indra/newview/lloutfitslist.h
#	indra/newview/lltexturefetch.cpp
2024-04-12 15:43:34 +03:00
Ansariel d0102af56d Merge branch 'main' of https://github.com/secondlife/viewer into DRTVWR-600-maint-A
# Conflicts:
#	indra/llcommon/llapp.cpp
#	indra/llcommon/llapp.h
#	indra/llimage/llimageworker.cpp
#	indra/llui/llcontainerview.cpp
#	indra/llui/llcontainerview.h
#	indra/llui/llkeywords.cpp
#	indra/llui/lltabcontainer.cpp
#	indra/llui/lltextbase.cpp
#	indra/newview/llappviewer.cpp
#	indra/newview/llfavoritesbar.cpp
#	indra/newview/llfavoritesbar.h
#	indra/newview/llfloaterimnearbychathandler.cpp
#	indra/newview/llfloaterpreference.cpp
#	indra/newview/llhudnametag.h
#	indra/newview/llinventorypanel.cpp
#	indra/newview/llinventorypanel.h
#	indra/newview/llmeshrepository.cpp
#	indra/newview/lloutfitgallery.cpp
#	indra/newview/lloutfitslist.cpp
#	indra/newview/llpaneleditwearable.cpp
#	indra/newview/llpanelprofilepicks.cpp
#	indra/newview/llpanelvoicedevicesettings.h
#	indra/newview/llpreviewscript.cpp
#	indra/newview/llpreviewscript.h
#	indra/newview/llselectmgr.cpp
#	indra/newview/lltranslate.cpp
#	indra/newview/llviewerassetupload.cpp
#	indra/newview/llviewermessage.cpp
2024-04-11 21:59:38 +02:00
Salad Dais 00e09ddcad Fix BUG-225288: Detaching stops unrelated animations
This is to do with misunderstandings related to how .find()
works with multimaps. .find() will, in fact, return an iterator
to the first iterator it finds, and will iterate through all
elements in the multimap when incremented, not just items with
the same key.

Change code working with animation sources to be aware of this
fact, so unrelated animation sources do not have their animations
stopped.
2024-04-10 17:59:25 +03:00
Andrey Lihatskiy 84dfe55810 Merge branch 'main' into marchcat/y-merge
# Conflicts:
#	autobuild.xml
#	indra/llcommon/llsys.cpp
2024-04-10 07:08:25 +03:00
Ansariel 60d3dd98a4 Convert remaining BOOL to bool 2024-02-21 23:14:31 +02:00
Lars Næsbye Christensen f1c97f4057 misc: BOOL to bool 2024-02-18 22:04:44 +02:00
Ansariel c285f59ce2 Replace BOOL with bool in llwindow and dependent classes 2024-02-18 15:51:54 +02:00
Lars Næsbye Christensen 9e854b697a misc: BOOL to bool 2024-02-17 12:23:07 +02:00
Lars Næsbye Christensen 4419bb8709 more misc: BOOL (int) to real bool 2024-02-12 23:17:22 +02:00
Lars Næsbye Christensen 2b31dad400 miscellaneous: BOOL (int) to real bool 2024-02-12 23:17:22 +02:00
Andrey Lihatskiy e3e1672ac4 Merge branch 'DRTVWR-599-maint-Z' into release/maint-yz
# Conflicts:
#	indra/newview/llchiclet.h
2024-02-05 22:04:40 +02:00
Ansariel ba74152c82 Replace BOOST_FOREACH with standard C++ range-based for-loops 2024-01-09 20:44:50 +02:00
Andrey Kleshchev 8c1aa6d662 SL-20714 Crash accessing mControlAVBridge
Looks like control avatar was recreated after cleanup then object was
deleted
2023-12-12 00:40:22 +02:00
Andrey Lihatskiy c409236dac Merge branch 'DRTVWR-594-maint-Y' into marchcat/594-y-pbr-merge
# Conflicts:
#	indra/newview/llinventorygallery.cpp
#	indra/newview/skins/default/xui/en/notifications.xml
2023-11-30 18:09:29 +02:00
Andrey Lihatskiy 27dae1d967 Merge branch 'DRTVWR-591-maint-X' into marchcat/591-x-pbr-merge
# Conflicts:
#	indra/llrender/llgl.cpp
#	indra/llrender/llvertexbuffer.cpp
#	indra/llui/llflatlistview.cpp
#	indra/newview/app_settings/settings.xml
#	indra/newview/lldrawpoolground.cpp
#	indra/newview/llinventorybridge.cpp
#	indra/newview/llinventorygallery.cpp
#	indra/newview/llspatialpartition.cpp
#	indra/newview/llviewercontrol.cpp
#	indra/newview/llviewertexture.cpp
#	indra/newview/llvosky.cpp
#	indra/newview/skins/default/xui/en/menu_inventory.xml
2023-11-30 13:30:27 +02:00
Andrey Lihatskiy 0465c761a4 Merge branch 'DRTVWR-588-maint-W' into marchcat/588-w-pbr-merge
# Conflicts:
#	indra/llrender/llgl.cpp
#	indra/llrender/llvertexbuffer.cpp
#	indra/llui/llflatlistview.cpp
#	indra/newview/lldrawpoolground.cpp
#	indra/newview/llspatialpartition.cpp
#	indra/newview/lltexturefetch.cpp
#	indra/newview/llviewergenericmessage.cpp
#	indra/newview/llviewertexture.cpp
#	indra/newview/llvosky.cpp
#	indra/newview/skins/default/xui/en/floater_preferences_graphics_advanced.xml
#	indra/newview/skins/default/xui/en/floater_stats.xml
#	indra/newview/skins/default/xui/en/floater_texture_fetch_debugger.xml
#	indra/newview/skins/default/xui/en/notifications.xml
#	indra/newview/skins/default/xui/en/panel_performance_preferences.xml
2023-11-30 12:28:26 +02:00
Salad Dais dd694f0add Fix BUG-225288: Detaching stops unrelated animations
This is to do with misunderstandings related to how .find()
works with multimaps. .find() will, in fact, return an iterator
to the first iterator it finds, and will iterate through all
elements in the multimap when incremented, not just items with
the same key.

Change code working with animation sources to be aware of this
fact, so unrelated animation sources do not have their animations
stopped.
2023-11-09 23:10:39 +02:00
Alexander Gavriliuk b134e91d2a SL-20419 Receiving new objects or items, etc causes inventory to switch from recent to my inventory tab 2023-10-11 21:22:30 +02:00
Alexander Gavriliuk 136a993ef2 SL-20419 Receiving new objects or items, etc causes inventory to switch from recent to my inventory tab 2023-10-11 21:19:40 +02:00
Andrey Lihatskiy 878fb36a0b Merge branch 'main' into DRTVWR-591-maint-X
# Conflicts:
#	indra/newview/app_settings/settings.xml
#	indra/newview/llinventorybridge.cpp
#	indra/newview/lltexturectrl.h
#	indra/newview/llvovolume.cpp
2023-10-03 19:55:49 +03:00
Andrey Kleshchev 7d50a51434 Merge branch 'main' (DRTVWR-567) into DRTVWR-559
# Conflicts:
#	indra/newview/CMakeLists.txt
#	indra/newview/VIEWER_VERSION.txt
#	indra/newview/llagent.cpp
#	indra/newview/llfloaternewfeaturenotification.cpp
#	indra/newview/llinventorybridge.cpp
#	indra/newview/llinventorymodel.cpp
#	indra/newview/lloutfitgallery.cpp
#	indra/newview/llpanelmaininventory.cpp
#	indra/newview/llpanelmaininventory.h
#	indra/newview/llsidepaneltaskinfo.cpp
#	indra/newview/llsidepaneltaskinfo.h
#	indra/newview/lltexturectrl.cpp
#	indra/newview/lltexturectrl.h
#	indra/newview/llviewerinventory.cpp
#	indra/newview/llviewerobject.cpp
#	indra/newview/llviewertexturelist.cpp
#	indra/newview/llviewertexturelist.h
#	indra/newview/skins/default/xui/en/floater_new_feature_notification.xml
#	indra/newview/skins/default/xui/en/menu_inventory.xml
2023-10-03 19:00:33 +03:00
Andrey Kleshchev 3a1ae84c26 SL-15039 Restored couple settings that are still in use by TPVs 2023-09-27 13:11:12 +03:00