diff options
author | Erik Kundiman <erik@megapahit.org> | 2025-07-28 17:01:34 +0800 |
---|---|---|
committer | Erik Kundiman <erik@megapahit.org> | 2025-07-28 17:01:34 +0800 |
commit | 705cd43ae88b5d095e7953ef8ddf670f3bbc9e1a (patch) | |
tree | 8834086dd3ac8bed07ab10b739e959ce73c95fef /indra/newview/llappviewer.cpp | |
parent | 94f51d5a4b16d76e46e53802cc188da8c9eb795b (diff) |
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 (MP's) near range.
Diffstat (limited to 'indra/newview/llappviewer.cpp')
-rw-r--r-- | indra/newview/llappviewer.cpp | 14 |
1 files changed, 13 insertions, 1 deletions
diff --git a/indra/newview/llappviewer.cpp b/indra/newview/llappviewer.cpp index 9124651e84..bc97e5b852 100644 --- a/indra/newview/llappviewer.cpp +++ b/indra/newview/llappviewer.cpp @@ -6017,7 +6017,19 @@ void LLAppViewer::updateDiscordActivity() pos_x -= pos_x % 2; pos_y -= pos_y % 2; } - activity.SetState(llformat("%s (%d, %d, %d)", gAgent.getRegion()->getName().c_str(), pos_x, pos_y, pos_z)); + auto location = llformat("%s (%d, %d, %d)", gAgent.getRegion()->getName().c_str(), pos_x, pos_y, pos_z); + activity.SetState(location); + + auto world = LLWorld::getInstance(); + uuid_vec_t chat_radius_uuids, near_me_uuids; + auto position = gAgent.getPositionGlobal(); + world->getAvatars(&chat_radius_uuids, NULL, position, CHAT_NORMAL_RADIUS); + world->getAvatars(&near_me_uuids, NULL, position, gSavedSettings.getF32("MPVNearMeRange")); + discordpp::ActivityParty party; + party.SetId(location); + party.SetCurrentSize(chat_radius_uuids.size()); + party.SetMaxSize(near_me_uuids.size()); + activity.SetParty(party); } gDiscordClient->UpdateRichPresence(activity, [](discordpp::ClientResult) {}); |