Compare commits

...

53 Commits

Author SHA1 Message Date
Liru Færs
4b2e358783 Sync LLInventoryModel and LLViewerInventory with upstream 2020-01-21 03:18:44 -05:00
Liru Færs
851b3659ee Improve AISv3 code to retry less aggressively
Syncs LLAISAPI with upstream alchemy
Thanks to Kitty Barnett for Appearance-SyncAttach patch
Fixes typos, uses more modern C++ features,
Accounts for VERSION_UNKNOWN so the viewer won't get stuck
Adds in support for 410 GONE response
No longer retries on empty map, malformed response.
2020-01-21 03:18:43 -05:00
Liru Færs
27d4e05f2b Prevent crash 37 2020-01-21 03:18:43 -05:00
Liru Færs
deade4438d Fix login favorites and copy Landmark SLURL missing z-axis (height) 2020-01-21 03:18:43 -05:00
Liru Færs
deafc6814d Fix crashes from badly formed json responses (LL's fault)
Adds LlsdFromJsonString, an exception-free wrapper for parsing json strings
LLSD objects that failed to parse through this will be the type Undefined.

Fixes crashes 36, 1G, 33, 21, and 3A.
2020-01-21 03:18:43 -05:00
Liru Færs
1fd6e91c68 Clean up update checker dependencies 2020-01-21 03:18:42 -05:00
Liru Færs
67126ab494 Wooops, our update checker is broken since the beta started! 2020-01-21 03:18:42 -05:00
Router Gray
e3318fb0d2 Add missing Nvidia GTX cards to gpu table. Used Cool VL Viewer's source, thanks Henri Beauchamp 2020-01-20 16:55:40 -06:00
Liru Færs
e9d28ee5c1 Inventory offers should link offerer avatar/group name 2020-01-17 23:44:41 -05:00
Liru Færs
2ffc99aecf Clean up useless code 2020-01-17 23:35:55 -05:00
Liru Færs
450afff50b [VMM] Drop zone is no longer WIP, and neither are the tabs
Searching tabs is still kinda wonky though... This needs investigation
2020-01-17 17:20:31 -05:00
Liru Færs
570b0d3c5b [VMM] Make the marketplace panel a dropzone, drag and drop anywhere~
Fixes Deltek's issue with not being able to drop in the zone
nor in the empty space where there are not folders in the listings
2020-01-17 17:19:01 -05:00
Liru Færs
09daa2a865 [VMM] Background transparency is important, even in marketplace drop zone 2020-01-17 17:14:25 -05:00
Liru Færs
e97837e103 Friendship Offered should link receiver's name 2020-01-17 14:33:38 -05:00
Liru Færs
84add2d864 This comment forgot to be saved 2020-01-17 10:54:07 -05:00
Liru Færs
4c224def62 Update FMOD Studio 2020-01-17 02:29:52 -05:00
Liru Færs
2242a1d101 Fix a bunch of disconnectNeighbor crashes in LLSurface 2020-01-17 02:27:56 -05:00
Liru Færs
b957c0930d Fix dumb in LLSurface, don't do dumb math 2020-01-17 02:27:48 -05:00
Liru Færs
f7434711ad [Follow] Reset No Progress count when target's position changes 2020-01-17 02:26:40 -05:00
Liru Færs
5f0b23edd7 [Follow] Try to sit on far away objects by moving closer
Groundsit if that still fails
2020-01-17 02:25:45 -05:00
Liru Færs
2eff62ad0d [Follow] Fix orbiting leader after follow sitting and standing up 2020-01-17 01:32:05 -05:00
Liru Færs
686795618a If object sitting while following, bypass follow logic block 2020-01-17 01:30:39 -05:00
Liru Færs
5c8c5a2c45 Condense autopilot no progress code into getAutoPilotNoProgress() 2020-01-17 00:04:31 -05:00
Liru Færs
d98b99f7b3 [Follow] Fall into walking code if RLV Sit restricted
Mostly space changes
2020-01-16 17:47:17 -05:00
Liru Færs
8d472a9c7b Rearrange some Follow code 2020-01-16 17:43:14 -05:00
Liru Færs
3747d79143 [Follow] Fly if we aren't rendering the avatar 2020-01-16 17:40:50 -05:00
Liru Færs
910a5557ab Sync some code in hopes to squish Marketplace wire chewed popups
A query url will no longer be built in making the request
The status of marketplace will no longer get reset to uninitialized upon
region change.
Merchant status will no longer be requested on regions without the DD cap
2020-01-16 17:10:08 -05:00
Liru Færs
8163448a6c [RLVa] Always show your own hover tip 2020-01-15 23:55:42 -05:00
Liru Færs
ac0e93dcad People don't seem to know what an ARC is... it's Complexity 2020-01-15 23:55:13 -05:00
Liru Færs
ed420c3645 Add Edit and Add to Selection to Object UI menus 2020-01-15 19:46:49 -05:00
Liru Færs
b872860443 Fix crash in land floater init when null region (disconnected?)
Fixes crash 2E
Cleans up code
2020-01-15 14:00:00 -05:00
Liru Færs
992f4c7b5d Modernize/sync LLSpeakers code 2020-01-15 12:57:58 -05:00
Liru Færs
8f15478ba4 Condense code~ 2020-01-15 12:56:56 -05:00
Liru Færs
1c371e7be6 Allow touching multiple objects in succession 2020-01-14 19:37:53 -05:00
Liru Færs
937c80f694 Fix an oopsie in Debug Settings, Thanks for the heads up, Yuriko 2020-01-14 15:53:42 -05:00
Liru Færs
15bd41bd71 Add Touch to object ui menus 2020-01-14 15:52:58 -05:00
Liru Færs
b9156b7955 Combine send_ObjectDeGrab and send_ObjectGrab repetitive code 2020-01-14 10:49:46 -05:00
Liru Færs
623a484ae3 Woops, gotta do a char array for that, also set errno to 0 2020-01-13 18:35:08 -05:00
Liru Færs
2ace698101 [Follow] Automatically accept Teleport Requests/Offers from the leader 2020-01-13 02:20:33 -05:00
Liru Færs
34e0c722e7 Don't cancel autopilot when escaping out of customize appearance 2020-01-13 01:34:06 -05:00
Liru Færs
82ee06a6bd Add Find on Map to avatar UI menus 2020-01-13 01:33:26 -05:00
Liru Færs
584ee8fffe const byref autopilot accessors 2020-01-13 00:29:51 -05:00
Liru Færs
d80d232ee5 Don't cancel follow if the target disappears, wait for them 2020-01-12 23:57:20 -05:00
Liru Færs
de47736038 Ignore object kills if our region is null
Fixes crash 1R
2020-01-12 20:06:01 -05:00
Liru Færs
0da16e6034 Some days, I scream in the faces of cats 2020-01-12 16:27:19 -05:00
Liru Færs
6c9a156610 Maybe fix pusssycat's issue with clicking for group profile being broken 2020-01-12 14:47:52 -05:00
Liru Færs
1726c27078 Fix for Linux file rename failures, thanks Taya and Router! 2020-01-12 13:23:02 -05:00
Liru Færs
64b43a47b5 Clean up ScriptCounter code more 2020-01-12 12:33:10 -05:00
Liru Færs
8005a58ed5 Script Counting on an avatar now shows their SLURL, instead of just a name 2020-01-11 21:53:29 -05:00
Liru Færs
d1d42701f5 Fix taya's linux crash, thanks to taya and router!
Crash was due to invalidated iterator
2020-01-11 21:00:16 -05:00
Liru Færs
c57fceff17 Modernizing scriptcounter code 2020-01-11 20:23:31 -05:00
Liru Færs
265336463d Add FMOD Logo to login screen to comply with licensing
Adds code to hide the new UI when compiled without FMOD Studio
2020-01-11 04:32:42 -05:00
Liru Færs
3ba1c88672 Remove reference to dead control 2020-01-11 03:01:28 -05:00
66 changed files with 1046 additions and 808 deletions

View File

@@ -878,7 +878,7 @@
<key>hash_algorithm</key>
<string>md5</string>
<key>url</key>
<string>/opt/devel/secondlife/pkg/fmodstudio-2.00.02.191991250-linux64-191991250.tar.bz2</string>
<string>/opt/devel/secondlife/pkg/fmodstudio-2.00.06.3-linux64-3.tar.bz2</string>
</map>
<key>name</key>
<string>linux64</string>
@@ -888,11 +888,11 @@
<key>archive</key>
<map>
<key>hash</key>
<string>e0e87e0423fa42e4d2997b47b92eac6e</string>
<string>22daed7c860daaef217eb8d90dfc1119</string>
<key>hash_algorithm</key>
<string>md5</string>
<key>url</key>
<string>https://pkg.alchemyviewer.org/repository/autobuild-internal/fmodstudio/windows/fmodstudio-2.00.03.192211030-windows-192211030.tar.bz2</string>
<string>https://pkg.alchemyviewer.org/repository/autobuild-internal/fmodstudio/windows/fmodstudio-2.00.06.3-windows-3.tar.bz2</string>
</map>
<key>name</key>
<string>windows</string>
@@ -902,18 +902,18 @@
<key>archive</key>
<map>
<key>hash</key>
<string>c2e55e1bfef7e066a0e40867a64b4cce</string>
<string>ccf7b1935743df55244139c4323c0465</string>
<key>hash_algorithm</key>
<string>md5</string>
<key>url</key>
<string>https://pkg.alchemyviewer.org/repository/autobuild-internal/fmodstudio/windows64/fmodstudio-2.00.03.192211029-windows64-192211029.tar.bz2</string>
<string>https://pkg.alchemyviewer.org/repository/autobuild-internal/fmodstudio/windows64/fmodstudio-2.00.06.3-windows64-3.tar.bz2</string>
</map>
<key>name</key>
<string>windows64</string>
</map>
</map>
<key>version</key>
<string>2.00.03.192211300</string>
<string>2.00.06.3</string>
</map>
<key>fonts</key>
<map>

View File

@@ -281,6 +281,11 @@ int LLFile::rename_nowarn(const std::string& filename, const std::string& newnam
int rc = _wrename(utf16filename.c_str(),utf16newname.c_str());
#else
int rc = ::rename(filename.c_str(),newname.c_str());
if (rc == -1 && errno == EXDEV)
{
rc = std::system(("mv '" + filename + "' '" + newname + '\'').data());
errno = 0;
}
#endif
return rc;
}

View File

@@ -79,6 +79,17 @@ LLSD LlsdFromJson(const nlohmann::json &val)
return result;
}
LLSD LlsdFromJsonString(const std::string& str)
{
auto json = nlohmann::json::parse(str, nullptr, false);
if (json.is_discarded())
{
LL_WARNS() << "Cannot parse invalid json string:\n" << str << LL_ENDL;
return LLSD();
}
return LlsdFromJson(json);
}
//=========================================================================
nlohmann::json LlsdToJson(const LLSD &val)
{

View File

@@ -54,6 +54,7 @@
/// For maps and arrays child entries will be converted and added to the structure.
/// Order is preserved for an array but not for objects.
LLSD LlsdFromJson(const nlohmann::json &val);
LLSD LlsdFromJsonString(const std::string& body);
/// Convert an LLSD object into Parsed JSON object maintaining member names and
/// array indexs.

View File

@@ -1433,6 +1433,7 @@ endif (OPENAL)
if (USE_FMODSTUDIO)
list(APPEND LLSTARTUP_COMPILE_DEFINITIONS "LL_FMODSTUDIO=1")
set_source_files_properties(llpanellogin.cpp PROPERTIES COMPILE_DEFINITIONS "LL_FMODSTUDIO=1")
endif (USE_FMODSTUDIO)
set_source_files_properties(llstartup.cpp PROPERTIES COMPILE_DEFINITIONS "${LLSTARTUP_COMPILE_DEFINITIONS}")

View File

@@ -438,6 +438,12 @@ NVIDIA GTX 770 .*NVIDIA .*GTX *77.* 3 1
NVIDIA GTX 780 .*NVIDIA .*GTX *78.* 3 1
NVIDIA GTX 970 .*NVIDIA .*GTX *97.* 3 1
NVIDIA GTX 980 .*NVIDIA .*GTX *98.* 3 1
NVIDIA GTX 1050 .*NVIDIA.*GTX 105.* 3 1
NVIDIA GTX 1060 .*NVIDIA.*GTX 106.* 3 1
NVIDIA GTX 1070 .*NVIDIA.*GTX 107.* 3 1
NVIDIA GTX 1080 .*NVIDIA.*GTX 108.* 3 1
NVIDIA GTX 1650 .*NVIDIA.*GTX 165.* 3 1
NVIDIA GTX 1660 .*NVIDIA.*GTX 166.* 3 1
NVIDIA GTX TITAN .*NVIDIA .*GTX *TITAN.* 3 1
NVIDIA GeForce/Quadro RTX .*(GeForce|Quadro) .*RTX.* 3 1
NVIDIA RTX TITAN .*NVIDIA .*RTX.*TITAN.* 3 1

View File

@@ -1734,8 +1734,7 @@ void LLAgent::stopAutoPilot(BOOL user_cancel)
// Sit response during follow pilot, now complete, resume follow
if (!user_cancel && mAutoPilotBehaviorName == "Sit" && mLeaderID.notNull())
{
mAutoPilotBehaviorName = "Follow";
mAutoPilot = true;
startFollowPilot(mLeaderID, true, gSavedSettings.getF32("SinguFollowDistance"));
return;
}
@@ -1759,6 +1758,11 @@ void LLAgent::stopAutoPilot(BOOL user_cancel)
}
bool LLAgent::getAutoPilotNoProgress() const
{
return mAutoPilotNoProgressFrameCount > AUTOPILOT_MAX_TIME_NO_PROGRESS * gFPSClamped;
}
// Returns necessary agent pitch and yaw changes, radians.
//-----------------------------------------------------------------------------
// autoPilot()
@@ -1767,52 +1771,64 @@ void LLAgent::autoPilot(F32 *delta_yaw)
{
if (mAutoPilot && isAgentAvatarValid())
{
U8 follow = mLeaderID.notNull(); //mAutoPilotBehaviorName == "Follow";
U8 follow = mAutoPilotBehaviorName == "Follow";
if (follow)
{
llassert(mLeaderID.notNull());
const auto old_pos = mAutoPilotTargetGlobal;
if (auto object = gObjectList.findObject(mLeaderID))
{
mAutoPilotTargetGlobal = object->getPositionGlobal();
if (const auto& av = object->asAvatar()) // Fly if avatar target is flying
{
setFlying(av->mInAir);
if (av->isSitting())
if (av->isSitting() && (!rlv_handler_t::isEnabled() || !gRlvHandler.hasBehaviour(RLV_BHVR_SIT)))
{
if (!rlv_handler_t::isEnabled() || !gRlvHandler.hasBehaviour(RLV_BHVR_SIT))
if (auto seat = av->getParent())
{
if (auto seat = av->getParent())
if (gAgentAvatarp->getParent() == seat)
{
mAutoPilotNoProgressFrameCount = 0; // Ground Sit may have incremented this, reset it
if (gAgentAvatarp->getParent() != seat)
{
void handle_object_sit(LLViewerObject*, const LLVector3&);
handle_object_sit(static_cast<LLViewerObject*>(seat), LLVector3::zero);
}
return; // If sitting, we won't be moving, exit here
mAutoPilotNoProgressFrameCount = 0; // We may have incremented this before making it here, reset it
return; // We're seated with them, nothing more to do
}
else // Ground sit, but only if near enough
else if (!getAutoPilotNoProgress())
{
if (dist_vec(av->getPositionAgent(), getPositionAgent()) <= mAutoPilotStopDistance) // We're close enough, sit.
{
if (!gAgentAvatarp->isSittingAvatarOnGround())
setControlFlags(AGENT_CONTROL_SIT_ON_GROUND);
mAutoPilotNoProgressFrameCount = 0; // Ground Sit may have incremented this, reset it now
return; // We're already sitting on the ground, we have nothing to do
}
else // We're not close enough yet
{
if (/*!gAgentAvatarp->isSitting() && */ // RLV takes care of sitting check for us inside standUp
mAutoPilotNoProgressFrameCount <= AUTOPILOT_MAX_TIME_NO_PROGRESS * gFPSClamped) // Only stand up if we haven't exhausted our no progress frames
standUp(); // Unsit if need be, so we can move
follow = 2; // Indicate we want to groundsit
}
void handle_object_sit(LLViewerObject*, const LLVector3&);
handle_object_sit(static_cast<LLViewerObject*>(seat), LLVector3::zero);
follow = 2; // Indicate ground sitting is okay if we can't make it
}
else return; // If the server just wouldn't let us sit there, we won't be moving, exit here
}
else // Ground sit, but only if near enough
{
if (dist_vec(av->getPositionAgent(), getPositionAgent()) <= mAutoPilotStopDistance) // We're close enough, sit.
{
if (!gAgentAvatarp->isSittingAvatarOnGround())
setControlFlags(AGENT_CONTROL_SIT_ON_GROUND);
mAutoPilotNoProgressFrameCount = 0; // Ground Sit may have incremented this, reset it now
return; // We're already sitting on the ground, we have nothing to do
}
else // We're not close enough yet
{
if (/*!gAgentAvatarp->isSitting() && */ // RLV takes care of sitting check for us inside standUp
getAutoPilotNoProgress()) // Only stand up if we haven't exhausted our no progress frames
standUp(); // Unsit if need be, so we can move
follow = 2; // Indicate we want to groundsit
}
}
}
else if (gAgentAvatarp->isSitting()) // Leader isn't sitting, standUp if needed
else
{
standUp();
mAutoPilotNoProgressFrameCount = 0; // Ground Sit may have incremented this, reset it
if (dist_vec(av->getPositionAgent(), getPositionAgent()) <= mAutoPilotStopDistance)
{
follow = 3; // We're close enough, indicate no walking
}
if (gAgentAvatarp->isSitting()) // Leader isn't sitting, standUp if needed
{
standUp();
mAutoPilotNoProgressFrameCount = 0; // Ground Sit may have incremented this, reset it
}
}
}
}
@@ -1822,20 +1838,21 @@ void LLAgent::autoPilot(F32 *delta_yaw)
auto pos = get_av_pos(mLeaderID);
if (pos.isExactlyZero()) // Default constructed or invalid from server
{
mAutoPilotBehaviorName.clear(); // Nothing left to follow pilot
stopAutoPilot();
// Wait for them for more follow pilot
return;
}
standUp(); // Leader not rendered, we mustn't be sitting
mAutoPilotNoProgressFrameCount = 0; // Ground Sit may have incremented this, reset it
mAutoPilotTargetGlobal = pos;
// Should we fly if the height difference is great enough here? Altitude is often invalid...
}
setFlying(true); // Should we fly here? Altitude is often invalid...
if (dist_vec(mAutoPilotTargetGlobal, getPositionGlobal()) <= mAutoPilotStopDistance)
{
follow = 3; // We're close enough, indicate no walking
if (dist_vec(mAutoPilotTargetGlobal, getPositionGlobal()) <= mAutoPilotStopDistance)
{
follow = 3; // We're close enough, indicate no walking
}
}
if (old_pos != mAutoPilotTargetGlobal) // Reset if position changes
mAutoPilotNoProgressFrameCount = 0;
}
if (follow % 2 == 0 && gAgentAvatarp->mInAir && mAutoPilotAllowFlying)
@@ -1853,7 +1870,7 @@ void LLAgent::autoPilot(F32 *delta_yaw)
if (follow % 2 == 0 && target_dist >= mAutoPilotTargetDist)
{
mAutoPilotNoProgressFrameCount++;
if (mAutoPilotNoProgressFrameCount > AUTOPILOT_MAX_TIME_NO_PROGRESS * gFPSClamped)
if (getAutoPilotNoProgress())
{
if (follow) // Well, we tried to reach them, let's just ground sit for now.
setControlFlags(AGENT_CONTROL_SIT_ON_GROUND);

View File

@@ -593,13 +593,14 @@ public:
public:
BOOL getAutoPilot() const { return mAutoPilot; }
LLVector3d getAutoPilotTargetGlobal() const { return mAutoPilotTargetGlobal; }
LLUUID getAutoPilotLeaderID() const { return mLeaderID; }
const LLUUID& getAutoPilotLeaderID() const { return mLeaderID; }
F32 getAutoPilotStopDistance() const { return mAutoPilotStopDistance; }
F32 getAutoPilotTargetDist() const { return mAutoPilotTargetDist; }
BOOL getAutoPilotUseRotation() const { return mAutoPilotUseRotation; }
LLVector3 getAutoPilotTargetFacing() const { return mAutoPilotTargetFacing; }
F32 getAutoPilotRotationThreshold() const { return mAutoPilotRotationThreshold; }
std::string getAutoPilotBehaviorName() const { return mAutoPilotBehaviorName; }
const std::string& getAutoPilotBehaviorName() const { return mAutoPilotBehaviorName; }
bool getAutoPilotNoProgress() const;
void startAutoPilotGlobal(const LLVector3d &pos_global,
const std::string& behavior_name = std::string(),

View File

@@ -289,11 +289,6 @@ LLAgentCamera::~LLAgentCamera()
//-----------------------------------------------------------------------------
void LLAgentCamera::resetView(BOOL reset_camera, BOOL change_camera)
{
if (gAgent.getAutoPilot())
{
gAgent.stopAutoPilot(TRUE);
}
LLSelectMgr::getInstance()->unhighlightAll();
// By popular request, keep land selection while walking around. JC

View File

@@ -35,13 +35,12 @@
#include "llviewerregion.h"
#include "llinventoryobserver.h"
#include "llviewercontrol.h"
#include <boost/bind.hpp>
///----------------------------------------------------------------------------
/// Classes for AISv3 support.
///----------------------------------------------------------------------------
class AISCommand : public LLHTTPClient::ResponderWithResult
class AISCommand final : public LLHTTPClient::ResponderWithCompleted
{
public:
typedef boost::function<void()> command_func_type;
@@ -60,35 +59,28 @@ public:
(mCommandFunc = func)();
}
char const* getName(void) const
char const* getName(void) const override
{
return mName;
}
void markComplete()
{
mRetryPolicy->onSuccess();
}
protected:
/* virtual */
void httpSuccess()
{
// Command func holds a reference to self, need to release it
// after a success or final failure.
mCommandFunc = no_op;
AISAPI::InvokeAISCommandCoro(this, getURL(), mTargetId, getContent(), mCompletionFunc, (AISAPI::COMMAND_TYPE)mType);
mRetryPolicy->onSuccess();
}
/*virtual*/
void httpFailure()
void malformedResponse() { mStatus = HTTP_INTERNAL_ERROR_OTHER; mReason = llformat("Malformed response contents (original code: %d)", mStatus); }
bool onFailure()
{
LL_WARNS("Inventory") << dumpResponse() << LL_ENDL;
S32 status = getStatus();
const AIHTTPReceivedHeaders& headers = getResponseHeaders();
mRetryPolicy->onFailure(status, headers);
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());
F32 seconds_to_wait;
if (mRetryPolicy->shouldRetry(seconds_to_wait))
if (retry && mRetryPolicy->shouldRetry(seconds_to_wait))
{
doAfterInterval(mCommandFunc,seconds_to_wait);
}
@@ -99,6 +91,13 @@ protected:
// *TODO: Notify user? This seems bad.
mCommandFunc = no_op;
}
return retry;
}
protected:
void httpCompleted() override
{
AISAPI::InvokeAISCommandCoro(this, getURL(), mTargetId, getContent(), mCompletionFunc, (AISAPI::COMMAND_TYPE)mType);
}
command_func_type mCommandFunc;
@@ -313,31 +312,97 @@ 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(LLHTTPClient::ResponderWithResult* responder,
std::string url,
void AISAPI::InvokeAISCommandCoro(AISCommand* 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();
if (!responder->isGoodStatus(status) || !result.isMap())
{
if (!result.isMap())
{
responder->failureResult(400, "Malformed response contents", result);
return;
responder->malformedResponse();
}
((AISCommand*)responder)->markComplete();
else if (status == 410) //GONE
{
// Item does not exist or was already deleted from server.
// parent folder is out of sync
if (type == REMOVECATEGORY)
{
LLViewerInventoryCategory *cat = gInventory.getCategory(targetId);
if (cat)
{
LL_WARNS("Inventory") << "Purge failed for '" << cat->getName()
<< "' local version:" << cat->getVersion()
<< " since folder no longer exists at server. Descendent count: server == " << cat->getDescendentCount()
<< ", viewer == " << cat->getViewerDescendentCount()
<< LL_ENDL;
gInventory.fetchDescendentsOf(cat->getParentUUID());
// Note: don't delete folder here - contained items will be deparented (or deleted)
// and since we are clearly out of sync we can't be sure we won't get rid of something we need.
// For example folder could have been moved or renamed with items intact, let it fetch first.
}
}
else if (type == REMOVEITEM)
{
LLViewerInventoryItem *item = gInventory.getItem(targetId);
if (item)
{
LL_WARNS("Inventory") << "Purge failed for '" << item->getName()
<< "' since item no longer exists at server." << LL_ENDL;
gInventory.fetchDescendentsOf(item->getParentUUID());
// since item not on the server and exists at viewer, so it needs an update at the least,
// so delete it, in worst case item will be refetched with new params.
gInventory.onObjectDeletedFromServer(targetId);
}
}
}
// Keep these statuses accounted for in the responder too
if (responder->onFailure()) // If we're retrying, exit early.
return;
}
else responder->markComplete();
gInventory.onAISUpdateReceived("AISCommand", result);
if (callback && callback != nullptr)
{
LLUUID id(LLUUID::null);
if (result.has("category_id") && (type == COPYLIBRARYCATEGORY))
// [SL:KB] - Patch: Appearance-SyncAttach | Checked: Catznip-3.7
uuid_list_t ids;
switch (type)
{
id = result["category_id"];
case COPYLIBRARYCATEGORY:
if (result.has("category_id"))
{
ids.insert(result["category_id"]);
}
break;
case COPYINVENTORY:
{
AISUpdate::parseUUIDArray(result, "_created_items", ids);
AISUpdate::parseUUIDArray(result, "_created_categories", ids);
}
break;
default:
break;
}
callback(id);
// If we were feeling daring we'd call LLInventoryCallback::fire for every item but it would take additional work to investigate whether all LLInventoryCallback derived classes
// were designed to handle multiple fire calls (with legacy link creation only one would ever fire per link creation) so we'll be cautious and only call for the first one for now
// (note that the LL code as written below will always call fire once with the NULL UUID for anything but CopyLibraryCategoryCommand so even the above is an improvement)
callback( (!ids.empty()) ? *ids.begin() : LLUUID::null);
// [/SL:KB]
// LLUUID id(LLUUID::null);
//
// if (result.has("category_id") && (type == COPYLIBRARYCATEGORY))
// {
// id = result["category_id"];
// }
//
// callback(id);
}
}
@@ -374,18 +439,17 @@ void AISUpdate::parseMeta(const LLSD& update)
// parse _categories_removed -> mObjectsDeletedIds
uuid_list_t cat_ids;
parseUUIDArray(update,"_categories_removed",cat_ids);
for (uuid_list_t::const_iterator it = cat_ids.begin();
it != cat_ids.end(); ++it)
for (auto cat_id : cat_ids)
{
LLViewerInventoryCategory *cat = gInventory.getCategory(*it);
LLViewerInventoryCategory *cat = gInventory.getCategory(cat_id);
if(cat)
{
mCatDescendentDeltas[cat->getParentUUID()]--;
mObjectsDeletedIds.insert(*it);
mObjectsDeletedIds.insert(cat_id);
}
else
{
LL_WARNS("Inventory") << "removed category not found " << *it << LL_ENDL;
LL_WARNS("Inventory") << "removed category not found " << cat_id << LL_ENDL;
}
}
@@ -393,36 +457,34 @@ void AISUpdate::parseMeta(const LLSD& update)
uuid_list_t item_ids;
parseUUIDArray(update,"_category_items_removed",item_ids);
parseUUIDArray(update,"_removed_items",item_ids);
for (uuid_list_t::const_iterator it = item_ids.begin();
it != item_ids.end(); ++it)
for (auto item_id : item_ids)
{
LLViewerInventoryItem *item = gInventory.getItem(*it);
LLViewerInventoryItem *item = gInventory.getItem(item_id);
if(item)
{
mCatDescendentDeltas[item->getParentUUID()]--;
mObjectsDeletedIds.insert(*it);
mObjectsDeletedIds.insert(item_id);
}
else
{
LL_WARNS("Inventory") << "removed item not found " << *it << LL_ENDL;
LL_WARNS("Inventory") << "removed item not found " << item_id << LL_ENDL;
}
}
// parse _broken_links_removed -> mObjectsDeletedIds
uuid_list_t broken_link_ids;
parseUUIDArray(update,"_broken_links_removed",broken_link_ids);
for (uuid_list_t::const_iterator it = broken_link_ids.begin();
it != broken_link_ids.end(); ++it)
for (auto broken_link_id : broken_link_ids)
{
LLViewerInventoryItem *item = gInventory.getItem(*it);
LLViewerInventoryItem *item = gInventory.getItem(broken_link_id);
if(item)
{
mCatDescendentDeltas[item->getParentUUID()]--;
mObjectsDeletedIds.insert(*it);
mObjectsDeletedIds.insert(broken_link_id);
}
else
{
LL_WARNS("Inventory") << "broken link not found " << *it << LL_ENDL;
LL_WARNS("Inventory") << "broken link not found " << broken_link_id << LL_ENDL;
}
}
@@ -766,7 +828,7 @@ void AISUpdate::parseEmbeddedCategories(const LLSD& categories)
void AISUpdate::doUpdate()
{
// Do version/descendent accounting.
// Do version/descendant accounting.
for (std::map<LLUUID,S32>::const_iterator catit = mCatDescendentDeltas.begin();
catit != mCatDescendentDeltas.end(); ++catit)
{
@@ -787,7 +849,7 @@ void AISUpdate::doUpdate()
continue;
}
// If we have a known descendent count, set that now.
// If we have a known descendant count, set that now.
LLViewerInventoryCategory* cat = gInventory.getCategory(cat_id);
if (cat)
{
@@ -824,7 +886,7 @@ void AISUpdate::doUpdate()
LLUUID category_id(update_it->first);
LLPointer<LLViewerInventoryCategory> new_category = update_it->second;
// Since this is a copy of the category *before* the accounting update, above,
// we need to transfer back the updated version/descendent count.
// we need to transfer back the updated version/descendant count.
LLViewerInventoryCategory* curr_cat = gInventory.getCategory(new_category->getUUID());
if (!curr_cat)
{
@@ -868,21 +930,19 @@ void AISUpdate::doUpdate()
}
// DELETE OBJECTS
for (uuid_list_t::const_iterator del_it = mObjectsDeletedIds.begin();
del_it != mObjectsDeletedIds.end(); ++del_it)
for (auto deleted_id : mObjectsDeletedIds)
{
LL_DEBUGS("Inventory") << "deleted item " << *del_it << LL_ENDL;
gInventory.onObjectDeletedFromServer(*del_it, false, false, false);
LL_DEBUGS("Inventory") << "deleted item " << deleted_id << LL_ENDL;
gInventory.onObjectDeletedFromServer(deleted_id, false, false, false);
}
// TODO - how can we use this version info? Need to be sure all
// changes are going through AIS first, or at least through
// something with a reliable responder.
for (uuid_int_map_t::iterator ucv_it = mCatVersionsUpdated.begin();
ucv_it != mCatVersionsUpdated.end(); ++ucv_it)
for (auto& ucv_it : mCatVersionsUpdated)
{
const LLUUID id = ucv_it->first;
S32 version = ucv_it->second;
const LLUUID id = ucv_it.first;
S32 version = ucv_it.second;
LLViewerInventoryCategory *cat = gInventory.getCategory(id);
LL_DEBUGS("Inventory") << "cat version update " << cat->getName() << " to version " << cat->getVersion() << LL_ENDL;
if (cat->getVersion() != version)
@@ -898,7 +958,16 @@ void AISUpdate::doUpdate()
// inventory COF is maintained on the viewer through calls to
// LLInventoryModel::accountForUpdate when a changing operation
// is performed. This occasionally gets out of sync however.
cat->setVersion(version);
if (version != LLViewerInventoryCategory::VERSION_UNKNOWN)
{
cat->setVersion(version);
}
else
{
// We do not account for update if version is UNKNOWN, so we shouldn't rise version
// either or viewer will get stuck on descendants count -1, try to refetch folder instead
cat->fetch();
}
}
}

View File

@@ -72,7 +72,7 @@ private:
static std::string getInvCap();
static std::string getLibCap();
static void InvokeAISCommandCoro( LLHTTPClient::ResponderWithResult* responder,
static void InvokeAISCommandCoro(AISCommand* responder,
std::string url, LLUUID targetId, LLSD body,
completion_t callback, COMMAND_TYPE type);
};
@@ -84,7 +84,10 @@ public:
void parseUpdate(const LLSD& update);
void parseMeta(const LLSD& update);
void parseContent(const LLSD& update);
void parseUUIDArray(const LLSD& content, const std::string& name, uuid_list_t& ids);
// [SL:KB] - Patch: Appearance-SyncAttach | Checked: Catznip-3.7
static void parseUUIDArray(const LLSD& content, const std::string& name, uuid_list_t& ids);
// [/SL:KB]
// void parseUUIDArray(const LLSD& content, const std::string& name, uuid_list_t& ids);
void parseLink(const LLSD& link_map);
void parseItem(const LLSD& link_map);
void parseCategory(const LLSD& link_map);

View File

@@ -4184,7 +4184,7 @@ LLUUID LLAppearanceMgr::makeNewOutfitLinks(const std::string& new_folder_name, L
// 2) Stuff with requests via makeLink and makeCopy
// 3) Call dispatch()
// 4) Let the LLPointer go out of scope.
class LLCreateLegacyOutfit : public LLBoostFuncInventoryCallbackFireOnce
class LLCreateLegacyOutfit final : public LLBoostFuncInventoryCallbackFireOnce
{
public:
LLCreateLegacyOutfit(const LLUUID& folder_id, inventory_func_type fire_func, nullary_func_type destroy_func = no_op) :

View File

@@ -1197,7 +1197,7 @@ void LLAvatarActions::requestFriendship(const LLUUID& target_id, const std::stri
calling_card_folder_id);
LLSD args;
args["TO_NAME"] = target_name;
args["TO_NAME"] = getSLURL(target_id);
LLSD payload;
payload["from_id"] = target_id;

View File

@@ -1872,10 +1872,13 @@ BOOL LLPanelLandOptions::postBuild()
mMatureCtrl = getChild<LLCheckBoxCtrl>( "MatureCheck");
childSetCommitCallback("MatureCheck", onCommitAny, this);
mGamingCtrl = getChild<LLCheckBoxCtrl>( "GamingCheck");
childSetCommitCallback("GamingCheck", onCommitAny, this);
mGamingCtrl->setVisible((gAgent.getRegion()->getGamingFlags() & REGION_GAMING_PRESENT) && !(gAgent.getRegion()->getGamingFlags() & REGION_GAMING_HIDE_PARCEL));
mGamingCtrl->setEnabled(false);
if (mGamingCtrl = getChild<LLCheckBoxCtrl>( "GamingCheck"))
{
auto region = gAgent.getRegion();
mGamingCtrl->setCommitCallback(boost::bind(&LLPanelLandOptions::onCommitAny, _1, this));
mGamingCtrl->setVisible(region && (region->getGamingFlags() & REGION_GAMING_PRESENT) && !(region->getGamingFlags() & REGION_GAMING_HIDE_PARCEL));
mGamingCtrl->setEnabled(false);
}
mPublishHelpButton = getChild<LLButton>("?");
mPublishHelpButton->setClickedCallback(onClickPublishHelp, this);

View File

@@ -94,14 +94,13 @@ BOOL LLPanelMarketplaceListings::handleDragAndDrop(S32 x, S32 y, MASK mask, BOOL
std::string& tooltip_msg)
{
LLView * handled_view = childrenHandleDragAndDrop(x, y, mask, drop, cargo_type, cargo_data, accept, tooltip_msg);
BOOL handled = (handled_view != NULL);
// Special case the drop zone
if (handled && (handled_view->getName() == "marketplace_drop_zone"))
// Special case the drop zone, also we're a giant drop zone
if (!handled_view || (handled_view->getName() == "marketplace_drop_zone"))
{
LLFolderView* root_folder = getRootFolder();
handled = root_folder->handleDragAndDropToThisFolder(mask, drop, cargo_type, cargo_data, accept, tooltip_msg);
return root_folder->handleDragAndDropToThisFolder(mask, drop, cargo_type, cargo_data, accept, tooltip_msg);
}
return handled;
return false;
}
void LLPanelMarketplaceListings::buildAllPanels()
@@ -224,7 +223,7 @@ void LLPanelMarketplaceListings::onTabChange()
// Show/hide the drop zone and resize the inventory tabs panel accordingly
LLPanel* drop_zone = (LLPanel*)getChild<LLPanel>("marketplace_drop_zone");
bool drop_zone_visible = drop_zone->getVisible();
bool allow_drop_on_root = panel->getAllowDropOnRoot() && gSavedSettings.getBOOL("LiruEnableWIPUI");
bool allow_drop_on_root = panel->getAllowDropOnRoot();
if (drop_zone_visible != allow_drop_on_root)
{
LLPanel* tabs = (LLPanel*)getChild<LLPanel>("tab_container_panel");

View File

@@ -339,10 +339,10 @@ void LLFloaterSettingsDebug::updateControl()
mValSpinner2->setMaxValue(F32_MAX);
mValSpinner3->setMaxValue(F32_MAX);
mValSpinner4->setMaxValue(F32_MAX);
mValSpinner1->setMinValue(F32_MIN);
mValSpinner2->setMinValue(F32_MIN);
mValSpinner3->setMinValue(F32_MIN);
mValSpinner4->setMinValue(F32_MIN);
mValSpinner1->setMinValue(-F32_MAX);
mValSpinner2->setMinValue(-F32_MAX);
mValSpinner3->setMinValue(-F32_MAX);
mValSpinner4->setMinValue(-F32_MAX);
if (!mValSpinner1->hasFocus())
{
mValSpinner1->setIncrement(0.1f);

View File

@@ -66,6 +66,7 @@
#include "llviewerparcelmgr.h"
#include "llviewerregion.h"
#include "llviewerwindow.h"
#include "llvoavatarself.h"
#include "llglheaders.h"
#include "llviewertexturelist.h"
//#include "lltoolobjpicker.h"
@@ -271,7 +272,7 @@ void LLHoverView::updateText()
line.clear();
if (hit_object->isAvatar())
{
if (gRlvHandler.hasBehaviour(RLV_BHVR_SHOWNAMETAGS))
if (gAgentAvatarp != hit_object && gRlvHandler.hasBehaviour(RLV_BHVR_SHOWNAMETAGS))
return; // No tag, no tip.
LLNameValue* title = hit_object->getNVPair("Title");
LLNameValue* firstname = hit_object->getNVPair("FirstName");
@@ -307,7 +308,7 @@ void LLHoverView::updateText()
}
mText.push_back(line);
mText.push_back(llformat("ARC: %d", hit_object->asAvatar()->getVisualComplexity()));
mText.push_back(LLTrans::getString("Complexity", LLSD().with("NUM", static_cast<LLSD::Integer>(hit_object->asAvatar()->getVisualComplexity()))));
}
else
{

File diff suppressed because it is too large Load Diff

View File

@@ -192,14 +192,14 @@ private:
**/
//--------------------------------------------------------------------
// Descendents
// Descendants
//--------------------------------------------------------------------
public:
// Make sure we have the descendents in the structure. Returns true
// Make sure we have the descendants in the structure. Returns true
// if a fetch was performed.
bool fetchDescendentsOf(const LLUUID& folder_id) const;
// Return the direct descendents of the id provided.Set passed
// Return the direct descendants of the id provided.Set passed
// in values to NULL if the call fails.
// NOTE: The array provided points straight into the guts of
// this object, and should only be used for read operations, since
@@ -211,10 +211,10 @@ public:
void getDirectDescendentsOf(const LLUUID& cat_id,
cat_array_t*& categories) const;
// Compute a hash of direct descendent names (for detecting child name changes)
// Compute a hash of direct descendant names (for detecting child name changes)
LLMD5 hashDirectDescendentNames(const LLUUID& cat_id) const;
// Starting with the object specified, add its descendents to the
// Starting with the object specified, add its descendants to the
// array provided, but do not add the inventory object specified
// by id. There is no guaranteed order.
// NOTE: Neither array will be erased before adding objects to it.
@@ -340,7 +340,7 @@ public:
U32 updateItem(const LLViewerInventoryItem* item, U32 mask = 0);
// Change an existing item with the matching id or add
// the category. No notifcation will be sent to observers. This
// the category. No notification will be sent to observers. This
// method will only generate network traffic if the item had to be
// reparented.
// NOTE: In usage, you will want to perform cache accounting
@@ -378,7 +378,7 @@ public:
bool update_parent_version = true,
bool do_notify_observers = true);
// Update model after all descendents removed from server.
// Update model after all descendants removed from server.
void onDescendentsPurgedFromServer(const LLUUID& object_id, bool fix_broken_links = true);
// Update model after an existing item gets updated on server.
@@ -499,10 +499,12 @@ public:
// Call to explicitly update everyone on a new state.
void notifyObservers();
// Allows outsiders to tell the inventory if something has
// been changed 'under the hood', but outside the control of the
// inventory. The next notify will include that notification.
void addChangedMask(U32 mask, const LLUUID& referent);
const changed_items_t& getChangedIDs() const { return mChangedItemIDs; }
const changed_items_t& getAddedIDs() const { return mAddedItemIDs; }
protected:
@@ -556,6 +558,7 @@ protected:
static bool loadFromFile(const std::string& filename,
cat_array_t& categories,
item_array_t& items,
changed_items_t& cats_to_update,
bool& is_cache_obsolete);
static bool saveToFile(const std::string& filename,
const cat_array_t& categories,

View File

@@ -289,6 +289,7 @@ LLVector3d getRegionPosFromGlobalPos(const LLVector3d& global_pos, const LLSimIn
LLVector3d local_pos;
local_pos[0] = fmod(global_pos[0], siminfo ? siminfo->getSizeX() : 256);
local_pos[1] = fmod(global_pos[1], siminfo ? siminfo->getSizeY() : 256);
local_pos[2] = global_pos[2];
return local_pos;
}

View File

@@ -281,8 +281,12 @@ public:
std::string body;
decode_raw_body(channels, buffer, body);
auto json = nlohmann::json::parse(body);
LLSD result = LlsdFromJson(json);;
LLSD result = LlsdFromJsonString(body);
if (result.isUndefined())
{
log_SLM_warning("Get /listings", getStatus(), getReason(), LLStringUtil::null, "Empty or Invalid JSON Response");
return;
}
if (!isGoodStatus(mStatus))
{
@@ -345,8 +349,12 @@ public:
std::string body;
decode_raw_body(channels, buffer, body);
auto json = nlohmann::json::parse(body);
LLSD result = LlsdFromJson(json);;
LLSD result = LlsdFromJsonString(body);
if (result.isUndefined())
{
log_SLM_warning("Post /listings", getStatus(), getReason(), LLStringUtil::null, "Empty or Invalid JSON Response");
return;
}
if (!isGoodStatus(mStatus))
{
@@ -404,8 +412,12 @@ public:
std::string body;
decode_raw_body(channels, buffer, body);
auto json = nlohmann::json::parse(body);
LLSD result = LlsdFromJson(json);
LLSD result = LlsdFromJsonString(body);
if (result.isUndefined())
{
log_SLM_warning("Get /listing", getStatus(), getReason(), LLStringUtil::null, "Empty or Invalid JSON Response");
return;
}
if (!isGoodStatus(mStatus))
{
@@ -480,8 +492,12 @@ public:
std::string body;
decode_raw_body(channels, buffer, body);
auto json = nlohmann::json::parse(body);
LLSD result = LlsdFromJson(json);
LLSD result = LlsdFromJsonString(body);
if (result.isUndefined())
{
log_SLM_warning("Put /listing", getStatus(), getReason(), LLStringUtil::null, "Empty or Invalid JSON Response");
return;
}
if (!isGoodStatus(mStatus))
{
@@ -557,8 +573,12 @@ public:
std::string body;
decode_raw_body(channels, buffer, body);
auto json = nlohmann::json::parse(body);
LLSD result = LlsdFromJson(json);
LLSD result = LlsdFromJsonString(body);
if (result.isUndefined())
{
log_SLM_warning("Put /associate_inventory", getStatus(), getReason(), LLStringUtil::null, "Empty or Invalid JSON Response");
return;
}
if (!isGoodStatus(mStatus))
{
@@ -629,8 +649,12 @@ public:
std::string body;
decode_raw_body(channels, buffer, body);
auto json = nlohmann::json::parse(body);
LLSD result = LlsdFromJson(json);
LLSD result = LlsdFromJsonString(body);
if (result.isUndefined())
{
log_SLM_warning("Delete /listing", getStatus(), getReason(), LLStringUtil::null, "Empty or Invalid JSON Response");
return;
}
if (!isGoodStatus(mStatus))
{
@@ -1265,7 +1289,7 @@ void LLMarketplaceData::initializeSLM(const status_updated_signal_t::slot_type&
}
log_SLM_infos("LLHTTPClient::get", url, LLStringUtil::null);
LLHTTPClient::get(url, LLSD(), new LLSLMGetMerchantResponder);
LLHTTPClient::get(url, new LLSLMGetMerchantResponder);
}
void LLMarketplaceData::setDataFetchedSignal(const status_updated_signal_t::slot_type& cb)

View File

@@ -144,7 +144,7 @@ void LLNameUI::showProfile()
{
if (!mAllowInteract) return;
switch (LFIDBearer::getActiveType())
switch (mType)
{
case LFIDBearer::GROUP: LLGroupActions::show(mNameID); break;
case LFIDBearer::AVATAR: LLAvatarActions::showProfile(mNameID); break;

View File

@@ -237,6 +237,10 @@ LLPanelLogin::LLPanelLogin(const LLRect& rect)
reshape(rect.getWidth(), rect.getHeight());
#ifndef LL_FMODSTUDIO
getChildView("fmod_logo")->setVisible(false);
#endif
LLComboBox* username_combo(getChild<LLComboBox>("username_combo"));
username_combo->setCommitCallback(boost::bind(LLPanelLogin::onSelectLoginEntry, _2));
username_combo->setFocusLostCallback(boost::bind(&LLPanelLogin::onLoginComboLostFocus, this, username_combo));

View File

@@ -193,10 +193,10 @@ void LLPanelPermissions::disableAll()
}
getChildView("Group:")->setEnabled(FALSE);
if (auto view = getChildView("Group Name Proxy"))
if (mLabelGroupName)
{
view->setValue(LLUUID::null);
view->setEnabled(FALSE);
mLabelGroupName->setNameID(LLUUID::null, LFIDBearer::GROUP);
mLabelGroupName->setEnabled(FALSE);
}
getChildView("button set group")->setEnabled(FALSE);
@@ -454,7 +454,7 @@ void LLPanelPermissions::refresh()
if(mLabelGroupName)
{
mLabelGroupName->setNameID(LLUUID::null, LFIDBearer::GROUP);
mLabelGroupName->refresh(LLUUID::null, std::string());
mLabelGroupName->setNameText();
mLabelGroupName->setEnabled(FALSE);
}
}

View File

@@ -63,10 +63,6 @@
////////////////////////////////////////////////////////////////////////////
// LLPreviewLandmark
// static
LLPreviewLandmarkList LLPreviewLandmark::sOrderedInstances;
LLPreviewLandmark::LLPreviewLandmark(const std::string& name,
const LLRect& rect,
const std::string& title,
@@ -112,18 +108,10 @@ LLPreviewLandmark::LLPreviewLandmark(const std::string& name,
translate(rect.mLeft - curRect.mLeft, rect.mTop - curRect.mTop);
}
*/
LLPreviewLandmark::sOrderedInstances.push_back( this );
}
LLPreviewLandmark::~LLPreviewLandmark()
{
LLPreviewLandmarkList::iterator this_itr;
this_itr = std::find(LLPreviewLandmark::sOrderedInstances.begin(),
LLPreviewLandmark::sOrderedInstances.end(), this);
if (this_itr != LLPreviewLandmark::sOrderedInstances.end())
{
LLPreviewLandmark::sOrderedInstances.erase(this_itr);
}
}

View File

@@ -33,72 +33,43 @@
#ifndef LL_LLPREVIEWLANDMARK_H
#define LL_LLPREVIEWLANDMARK_H
#include <deque>
#include "lllandmark.h"
#include "llfloater.h"
#include "llmap.h"
#include "llstring.h"
#include "lluuid.h"
#include "v3dmath.h"
#include "v4coloru.h"
#include "llhudtext.h"
#include "llpreview.h"
class LLIconCtrl;
class LLInventoryItem;
class LLLandmarkList;
class LLLineEditor;
class LLMessageSystem;
class LLPreviewLandmark;
class LLPanelPlace;
class LLLandmark;
const S32 PREVIEW_LANDMARK_NUM_COLORS = 6;
typedef std::deque< LLPreviewLandmark* > LLPreviewLandmarkList;
class LLPreviewLandmark : public LLPreview
class LLPreviewLandmark final : public LLPreview
{
public:
LLPreviewLandmark(const std::string& name, const LLRect& rect, const std::string& title,
const LLUUID& item_uuid,
BOOL show_keep_discard = FALSE,
LLViewerInventoryItem* inv_item = NULL);
LLViewerInventoryItem* inv_item = nullptr);
virtual ~LLPreviewLandmark();
/*virtual*/ void draw();
/*virtual*/ void draw() override;
const std::string& getName() const;
const LLColor4& getMarkerColor() const;
LLVector3d getPositionGlobal() const;
//static S32 getNumInstances() { return LLPreviewLandmark::sOrderedInstances.getLength(); }
//static const LLPreviewLandmark* getFirst() { return LLPreviewLandmark::sOrderedInstances.getFirstData(); }
//static const LLPreviewLandmark* getNext() { return LLPreviewLandmark::sOrderedInstances.getNextData(); }
static void* createPlaceDetail(void* userdata);
/*virtual*/ void loadAsset();
/*virtual*/ EAssetStatus getAssetStatus();
/*virtual*/ void loadAsset() override;
/*virtual*/ EAssetStatus getAssetStatus() override;
protected:
void getDegreesAndDist(F32* degrees, F64* horiz_dist, F64* vert_dist) const;
virtual const char *getTitleName() const { return "Landmark"; }
const char *getTitleName() const override { return "Landmark"; }
private:
// void renderBeacon();
// LLPointer<LLHUDText> mBeaconText;
LLIconCtrl* mIconLandmark;
LLPanelPlace* mPlacePanel;
LLLandmark* mLandmark;
LLColor4 mMarkerColor;
static LLPreviewLandmarkList sOrderedInstances;
};
#endif

View File

@@ -240,7 +240,7 @@ LLSpeakersDelayActionsStorage::~LLSpeakersDelayActionsStorage()
void LLSpeakersDelayActionsStorage::setActionTimer(const LLUUID& speaker_id)
{
bool not_found = true;
if (mActionTimersMap.size() > 0)
if (!mActionTimersMap.empty())
{
not_found = mActionTimersMap.find(speaker_id) == mActionTimersMap.end();
}
@@ -258,7 +258,7 @@ void LLSpeakersDelayActionsStorage::setActionTimer(const LLUUID& speaker_id)
void LLSpeakersDelayActionsStorage::unsetActionTimer(const LLUUID& speaker_id)
{
if (mActionTimersMap.size() == 0) return;
if (mActionTimersMap.empty()) return;
LLSpeakerActionTimer::action_timer_iter_t it_speaker = mActionTimersMap.find(speaker_id);
@@ -434,8 +434,8 @@ void LLSpeakerMgr::update(BOOL resort_ok)
return;
}
LLColor4 speaking_color = gSavedSettings.getColor4("SpeakingColor");
LLColor4 overdriven_color = gSavedSettings.getColor4("OverdrivenColor");
static const LLCachedControl<LLColor4> speaking_color(gSavedSettings, "SpeakingColor");
static const LLCachedControl<LLColor4> overdriven_color(gSavedSettings, "OverdrivenColor");
if(resort_ok) // only allow list changes when user is not interacting with it
{
@@ -445,10 +445,10 @@ void LLSpeakerMgr::update(BOOL resort_ok)
// update status of all current speakers
BOOL voice_channel_active = (!mVoiceChannel && LLVoiceClient::getInstance()->inProximalChannel()) || (mVoiceChannel && mVoiceChannel->isActive());
bool re_sort = false;
for (speaker_map_t::iterator speaker_it = mSpeakers.begin(); speaker_it != mSpeakers.end(); ++speaker_it)
for (auto& speaker : mSpeakers)
{
LLUUID speaker_id = speaker_it->first;
LLSpeaker* speakerp = speaker_it->second;
LLUUID speaker_id = speaker.first;
LLSpeaker* speakerp = speaker.second;
if (voice_channel_active && LLVoiceClient::getInstance()->getVoiceEnabled(speaker_id))
{
@@ -532,12 +532,8 @@ void LLSpeakerMgr::update(BOOL resort_ok)
bool index_changed = false;
S32 recent_speaker_count = 0;
S32 sort_index = 0;
for (speaker_list_t::iterator sorted_speaker_it = mSpeakersSorted.begin();
sorted_speaker_it != mSpeakersSorted.end();
++sorted_speaker_it)
for (auto speakerp : mSpeakersSorted)
{
LLPointer<LLSpeaker> speakerp = *sorted_speaker_it;
// color code recent speakers who are not currently speaking
if (speakerp->mStatus == LLSpeaker::STATUS_HAS_SPOKEN)
{
@@ -561,9 +557,6 @@ void LLSpeakerMgr::update(BOOL resort_ok)
void LLSpeakerMgr::updateSpeakerList()
{
// Always add the current agent (it has to be there...). Will do nothing if already there.
setSpeaker({ gAgentID, LLSpeaker::SPEAKER_AGENT, LLSpeaker::STATUS_VOICE_ACTIVE });
// Are we bound to the currently active voice channel?
if ((!mVoiceChannel && LLVoiceClient::getInstance()->inProximalChannel()) || (mVoiceChannel && mVoiceChannel->isActive()))
{
@@ -572,22 +565,21 @@ void LLSpeakerMgr::updateSpeakerList()
// If we are, add all voice client participants to our list of known speakers
std::vector<speaker_entry_t> speakers;
speakers.reserve(participants.size());
for (auto participant_it = participants.begin(); participant_it != participants.end(); ++participant_it)
for (auto participant : participants)
{
speakers.emplace_back(
*participant_it,
(LLVoiceClient::getInstance()->isParticipantAvatar(*participant_it) ? LLSpeaker::SPEAKER_AGENT : LLSpeaker::SPEAKER_EXTERNAL),
speakers.emplace_back(participant,
(LLVoiceClient::getInstance()->isParticipantAvatar(participant) ? LLSpeaker::SPEAKER_AGENT : LLSpeaker::SPEAKER_EXTERNAL),
LLSpeaker::STATUS_VOICE_ACTIVE,
boost::none,
boost::none,
LLVoiceClient::getInstance()->getDisplayName(*participant_it));
LLVoiceClient::getInstance()->getDisplayName(participant));
}
setSpeakers(speakers);
}
else
{
// If not, check if the list is empty, except if it's Nearby Chat (session_id NULL).
LLUUID session_id = getSessionID();
LLUUID const& session_id = getSessionID();
if (!session_id.isNull() && !mSpeakerListUpdated)
{
// If the list is empty, we update it with whatever we have locally so that it doesn't stay empty too long.
@@ -636,15 +628,16 @@ void LLSpeakerMgr::updateSpeakerList()
mSpeakerListUpdated = true;
}
}
else if (floater && mSpeakers.size() == 0)
else if (floater && mSpeakers.empty())
{
// For all other session type (ad-hoc, P2P, avaline), we use the initial participants targets list
for (const auto& id : floater->mInitialTargetIDs)
for (const auto& target_id : floater->mInitialTargetIDs)
{
// Add buddies if they are on line, add any other avatar.
if (!LLAvatarTracker::instance().isBuddy(id) || LLAvatarTracker::instance().isBuddyOnline(id))
if (!LLAvatarTracker::instance().isBuddy(target_id) || LLAvatarTracker::instance().isBuddyOnline(
target_id))
{
setSpeaker({ id, LLSpeaker::SPEAKER_AGENT, LLSpeaker::STATUS_VOICE_ACTIVE });
setSpeaker({target_id, LLSpeaker::SPEAKER_AGENT, LLSpeaker::STATUS_VOICE_ACTIVE });
}
}
mSpeakerListUpdated = true;
@@ -656,13 +649,18 @@ void LLSpeakerMgr::updateSpeakerList()
}
}
}
// Always add the current agent (it has to be there...). Will do nothing if already there.
setSpeaker({ gAgentID, LLSpeaker::SPEAKER_AGENT, LLSpeaker::STATUS_VOICE_ACTIVE });
}
void LLSpeakerMgr::setSpeakerNotInChannel(LLSpeaker* speakerp)
void LLSpeakerMgr::setSpeakerNotInChannel(LLPointer<LLSpeaker> speakerp)
{
speakerp->setStatus(LLSpeaker::STATUS_NOT_IN_CHANNEL);
speakerp->mDotColor = INACTIVE_COLOR;
mSpeakerDelayRemover->setActionTimer(speakerp->mID);
if (speakerp.notNull())
{
speakerp->setStatus(LLSpeaker::STATUS_NOT_IN_CHANNEL);
speakerp->mDotColor = INACTIVE_COLOR;
mSpeakerDelayRemover->setActionTimer(speakerp->mID);
}
}
bool LLSpeakerMgr::removeSpeaker(const LLUUID& speaker_id)
@@ -691,12 +689,12 @@ bool LLSpeakerMgr::removeSpeaker(const LLUUID& speaker_id)
LLPointer<LLSpeaker> LLSpeakerMgr::findSpeaker(const LLUUID& speaker_id)
{
//In some conditions map causes crash if it is empty(Windows only), adding check (EK)
if (mSpeakers.size() == 0)
return NULL;
if (mSpeakers.empty())
return nullptr;
speaker_map_t::iterator found_it = mSpeakers.find(speaker_id);
if (found_it == mSpeakers.end())
{
return NULL;
return nullptr;
}
return found_it->second;
}
@@ -704,9 +702,9 @@ LLPointer<LLSpeaker> LLSpeakerMgr::findSpeaker(const LLUUID& speaker_id)
void LLSpeakerMgr::getSpeakerList(speaker_list_t* speaker_list, BOOL include_text)
{
speaker_list->clear();
for (speaker_map_t::iterator speaker_it = mSpeakers.begin(); speaker_it != mSpeakers.end(); ++speaker_it)
for (auto& speaker : mSpeakers)
{
LLPointer<LLSpeaker> speakerp = speaker_it->second;
LLPointer<LLSpeaker> speakerp = speaker.second;
// what about text only muted or inactive?
if (include_text || speakerp->mStatus != LLSpeaker::STATUS_TEXT_ONLY)
{
@@ -715,12 +713,12 @@ void LLSpeakerMgr::getSpeakerList(speaker_list_t* speaker_list, BOOL include_tex
}
}
const LLUUID LLSpeakerMgr::getSessionID()
const LLUUID LLSpeakerMgr::getSessionID() const
{
return mVoiceChannel->getSessionID();
}
bool LLSpeakerMgr::isSpeakerToBeRemoved(const LLUUID& speaker_id)
bool LLSpeakerMgr::isSpeakerToBeRemoved(const LLUUID& speaker_id) const
{
return mSpeakerDelayRemover && mSpeakerDelayRemover->isTimerStarted(speaker_id);
}
@@ -746,7 +744,7 @@ void LLSpeakerMgr::speakerChatted(const LLUUID& speaker_id)
}
}
BOOL LLSpeakerMgr::isVoiceActive()
BOOL LLSpeakerMgr::isVoiceActive() const
{
// mVoiceChannel = NULL means current voice channel, whatever it is
return LLVoiceClient::getInstance()->voiceEnabled() && mVoiceChannel && mVoiceChannel->isActive();
@@ -778,8 +776,7 @@ void LLIMSpeakerMgr::setSpeakers(const LLSD& speakers)
std::vector<speaker_entry_t> speakerentries;
if ( speakers.has("agent_info") && speakers["agent_info"].isMap() )
{
LLSD::map_const_iterator speaker_it;
for(speaker_it = speakers["agent_info"].beginMap();
for(LLSD::map_const_iterator speaker_it = speakers["agent_info"].beginMap();
speaker_it != speakers["agent_info"].endMap();
++speaker_it)
{
@@ -803,8 +800,7 @@ void LLIMSpeakerMgr::setSpeakers(const LLSD& speakers)
{
//older, more decprecated way. Need here for
//using older version of servers
LLSD::array_const_iterator speaker_it;
for(speaker_it = speakers["agents"].beginArray();
for(LLSD::array_const_iterator speaker_it = speakers["agents"].beginArray();
speaker_it != speakers["agents"].endArray();
++speaker_it)
{
@@ -821,10 +817,7 @@ void LLIMSpeakerMgr::updateSpeakers(const LLSD& update)
std::vector<speaker_entry_t> speakerentries;
if ( update.has("agent_updates") && update["agent_updates"].isMap() )
{
LLSD::map_const_iterator update_it;
for(
update_it = update["agent_updates"].beginMap();
for(LLSD::map_const_iterator update_it = update["agent_updates"].beginMap();
update_it != update["agent_updates"].endMap();
++update_it)
{
@@ -838,7 +831,7 @@ void LLIMSpeakerMgr::updateSpeakers(const LLSD& update)
LLSD agent_data = update_it->second;
if (agent_data.isMap() && agent_data.has("transition"))
{
if (agent_data["transition"].asString() == "LEAVE" && speakerp.notNull())
if (agent_data["transition"].asString() == "LEAVE")
{
setSpeakerNotInChannel(speakerp);
}
@@ -882,9 +875,7 @@ void LLIMSpeakerMgr::updateSpeakers(const LLSD& update)
}
else if ( update.has("updates") && update["updates"].isMap() )
{
LLSD::map_const_iterator update_it;
for (
update_it = update["updates"].beginMap();
for (LLSD::map_const_iterator update_it = update["updates"].beginMap();
update_it != update["updates"].endMap();
++update_it)
{
@@ -892,7 +883,7 @@ void LLIMSpeakerMgr::updateSpeakers(const LLSD& update)
LLPointer<LLSpeaker> speakerp = findSpeaker(agent_id);
std::string agent_transition = update_it->second.asString();
if (agent_transition == "LEAVE" && speakerp.notNull())
if (agent_transition == "LEAVE")
{
setSpeakerNotInChannel(speakerp);
}
@@ -915,7 +906,7 @@ void LLIMSpeakerMgr::toggleAllowTextChat(const LLUUID& speaker_id)
LLPointer<LLSpeaker> speakerp = findSpeaker(speaker_id);
if (!speakerp) return;
std::string url = gAgent.getRegion()->getCapability("ChatSessionRequest");
std::string url = gAgent.getRegionCapability("ChatSessionRequest");
LLSD data;
data["method"] = "mute update";
data["session-id"] = getSessionID();
@@ -940,7 +931,7 @@ void LLIMSpeakerMgr::moderateVoiceParticipant(const LLUUID& avatar_id, bool unmu
// do not send voice moderation changes for avatars not in voice channel
if (!is_in_voice) return;
std::string url = gAgent.getRegion()->getCapability("ChatSessionRequest");
std::string url = gAgent.getRegionCapability("ChatSessionRequest");
LLSD data;
data["method"] = "mute update";
data["session-id"] = getSessionID();
@@ -980,7 +971,7 @@ void LLIMSpeakerMgr::processSessionUpdate(const LLSD& session_update)
void LLIMSpeakerMgr::moderateVoiceSession(const LLUUID& session_id, bool disallow_voice)
{
std::string url = gAgent.getRegion()->getCapability("ChatSessionRequest");
std::string url = gAgent.getRegionCapability("ChatSessionRequest");
LLSD data;
data["method"] = "session update";
data["session-id"] = session_id;
@@ -996,13 +987,13 @@ void LLIMSpeakerMgr::moderateVoiceSession(const LLUUID& session_id, bool disallo
void LLIMSpeakerMgr::forceVoiceModeratedMode(bool should_be_muted)
{
for (speaker_map_t::iterator speaker_it = mSpeakers.begin(); speaker_it != mSpeakers.end(); ++speaker_it)
for (auto& speaker : mSpeakers)
{
LLUUID speaker_id = speaker_it->first;
LLSpeaker* speakerp = speaker_it->second;
LLUUID speaker_id = speaker.first;
LLSpeaker* speakerp = speaker.second;
// participant does not match requested state
if (should_be_muted != (bool)speakerp->mModeratorMutedVoice)
if (should_be_muted != static_cast<bool>(speakerp->mModeratorMutedVoice))
{
moderateVoiceParticipant(speaker_id, !should_be_muted);
}
@@ -1036,10 +1027,9 @@ void LLActiveSpeakerMgr::updateSpeakerList()
LLSpeakerMgr::updateSpeakerList();
// clean up text only speakers
for (speaker_map_t::iterator speaker_it = mSpeakers.begin(); speaker_it != mSpeakers.end(); ++speaker_it)
for (auto& speaker : mSpeakers)
{
LLUUID speaker_id = speaker_it->first;
LLSpeaker* speakerp = speaker_it->second;
LLSpeaker* speakerp = speaker.second;
if (speakerp->mStatus == LLSpeaker::STATUS_TEXT_ONLY)
{
// automatically flag text only speakers for removal
@@ -1085,10 +1075,10 @@ void LLLocalSpeakerMgr::updateSpeakerList()
setSpeakers(speakers);
// check if text only speakers have moved out of chat range
for (speaker_map_t::iterator speaker_it = mSpeakers.begin(); speaker_it != mSpeakers.end(); ++speaker_it)
for (auto& speaker : mSpeakers)
{
LLUUID speaker_id = speaker_it->first;
LLPointer<LLSpeaker> speakerp = speaker_it->second;
LLUUID speaker_id = speaker.first;
LLPointer<LLSpeaker> speakerp = speaker.second;
if (speakerp.notNull() && speakerp->mStatus == LLSpeaker::STATUS_TEXT_ONLY)
{
LLVOAvatar* avatarp = gObjectList.findAvatar(speaker_id);

View File

@@ -36,7 +36,7 @@ class LLSpeakerMgr;
class LLVoiceChannel;
// data for a given participant in a voice channel
class LLSpeaker : public LLRefCount, public LLOldEvents::LLObservable, public LLHandleProvider<LLSpeaker>, public boost::signals2::trackable
class LLSpeaker final : public LLRefCount, public LLOldEvents::LLObservable, public LLHandleProvider<LLSpeaker>, public boost::signals2::trackable
{
public:
typedef enum e_speaker_type
@@ -80,7 +80,7 @@ public:
};
LLSpeaker(const speaker_entry_t& entry);
~LLSpeaker() {};
~LLSpeaker() = default;
void update(const speaker_entry_t& entry);
void lookupName();
@@ -130,44 +130,44 @@ public:
S32 mSortIndex;
};
class LLSpeakerUpdateSpeakerEvent : public LLOldEvents::LLEvent
class LLSpeakerUpdateSpeakerEvent final : public LLOldEvents::LLEvent
{
public:
LLSpeakerUpdateSpeakerEvent(LLSpeaker* source);
/*virtual*/ LLSD getValue();
/*virtual*/ LLSD getValue() override;
private:
const LLUUID& mSpeakerID;
};
class LLSpeakerUpdateModeratorEvent : public LLOldEvents::LLEvent
class LLSpeakerUpdateModeratorEvent final : public LLOldEvents::LLEvent
{
public:
LLSpeakerUpdateModeratorEvent(LLSpeaker* source);
/*virtual*/ LLSD getValue();
/*virtual*/ LLSD getValue() override;
private:
const LLUUID& mSpeakerID;
BOOL mIsModerator;
};
class LLSpeakerTextModerationEvent : public LLOldEvents::LLEvent
class LLSpeakerTextModerationEvent final : public LLOldEvents::LLEvent
{
public:
LLSpeakerTextModerationEvent(LLSpeaker* source);
/*virtual*/ LLSD getValue();
/*virtual*/ LLSD getValue() override;
};
class LLSpeakerVoiceModerationEvent : public LLOldEvents::LLEvent
class LLSpeakerVoiceModerationEvent final : public LLOldEvents::LLEvent
{
public:
LLSpeakerVoiceModerationEvent(LLSpeaker* source);
/*virtual*/ LLSD getValue();
/*virtual*/ LLSD getValue() override;
};
class LLSpeakerListChangeEvent : public LLOldEvents::LLEvent
class LLSpeakerListChangeEvent final : public LLOldEvents::LLEvent
{
public:
LLSpeakerListChangeEvent(LLSpeakerMgr* source, const LLUUID& speaker_id);
/*virtual*/ LLSD getValue();
/*virtual*/ LLSD getValue() override;
private:
const LLUUID& mSpeakerID;
@@ -183,7 +183,7 @@ private:
* Otherwise it should be deleted manually in place where it is used.
* If action callback is not set timer will tick only once and deleted.
*/
class LLSpeakerActionTimer : public LLEventTimer
class LLSpeakerActionTimer final : public LLEventTimer
{
public:
typedef std::function<bool(const LLUUID&)> action_callback_t;
@@ -200,14 +200,14 @@ public:
* @param speaker_id - LLUUID of speaker which will be passed into action callback.
*/
LLSpeakerActionTimer(action_callback_t action_cb, F32 action_period, const LLUUID& speaker_id);
virtual ~LLSpeakerActionTimer() {};
virtual ~LLSpeakerActionTimer() = default;
/**
* Implements timer "tick".
*
* If action callback is not specified returns true. Instance will be deleted by LLEventTimer::updateClass().
*/
virtual BOOL tick();
BOOL tick() override;
/**
* Clears the callback.
@@ -285,13 +285,13 @@ public:
void setSpeakers(const std::vector<speaker_entry_t>& speakers);
LLPointer<LLSpeaker> setSpeaker(const speaker_entry_t& speakers);
BOOL isVoiceActive();
BOOL isVoiceActive() const;
typedef std::vector<LLPointer<LLSpeaker> > speaker_list_t;
void getSpeakerList(speaker_list_t* speaker_list, BOOL include_text);
LLVoiceChannel* getVoiceChannel() { return mVoiceChannel; }
const LLUUID getSessionID();
bool isSpeakerToBeRemoved(const LLUUID& speaker_id);
const LLUUID getSessionID() const;
bool isSpeakerToBeRemoved(const LLUUID& speaker_id) const;
/**
* Removes avaline speaker.
@@ -310,7 +310,7 @@ public:
protected:
virtual void updateSpeakerList();
void setSpeakerNotInChannel(LLSpeaker* speackerp);
void setSpeakerNotInChannel(LLPointer<LLSpeaker> speackerp);
bool removeSpeaker(const LLUUID& speaker_id);
typedef std::map<LLUUID, LLPointer<LLSpeaker> > speaker_map_t;
@@ -336,7 +336,7 @@ protected:
bool mModerateModeHandledFirstTime;
};
class LLIMSpeakerMgr : public LLSpeakerMgr
class LLIMSpeakerMgr final : public LLSpeakerMgr
{
LOG_CLASS(LLIMSpeakerMgr);
@@ -376,7 +376,7 @@ public:
void processSessionUpdate(const LLSD& session_update);
protected:
virtual void updateSpeakerList();
void updateSpeakerList() override;
void moderateVoiceSession(const LLUUID& session_id, bool disallow_voice);
@@ -387,24 +387,24 @@ protected:
};
class LLActiveSpeakerMgr : public LLSpeakerMgr, public LLSingleton<LLActiveSpeakerMgr>
class LLActiveSpeakerMgr final : public LLSpeakerMgr, public LLSingleton<LLActiveSpeakerMgr>
{
LOG_CLASS(LLActiveSpeakerMgr);
public:
LLActiveSpeakerMgr();
protected:
virtual void updateSpeakerList();
void updateSpeakerList() override;
};
class LLLocalSpeakerMgr : public LLSpeakerMgr, public LLSingleton<LLLocalSpeakerMgr>
class LLLocalSpeakerMgr final : public LLSpeakerMgr, public LLSingleton<LLLocalSpeakerMgr>
{
LOG_CLASS(LLLocalSpeakerMgr);
public:
LLLocalSpeakerMgr();
~LLLocalSpeakerMgr ();
protected:
virtual void updateSpeakerList();
void updateSpeakerList() override;
};
#endif // LL_LLSPEAKERS_H

View File

@@ -3019,17 +3019,7 @@ void pass_processObjectPropertiesFamily(LLMessageSystem *msg, void**)
void process_script_running_reply(LLMessageSystem* msg, void** v)
{
LLLiveLSLEditor::processScriptRunningReply(msg, v);
if (ScriptCounter::sCheckMap.size())
{
LLUUID item_id;
msg->getUUIDFast(_PREHASH_Script, _PREHASH_ItemID, item_id);
std::map<LLUUID,ScriptCounter*>::iterator it = ScriptCounter::sCheckMap.find(item_id);
if (it != ScriptCounter::sCheckMap.end())
{
it->second->processRunningReply(msg);
ScriptCounter::sCheckMap.erase(it);
}
}
ScriptCounter::processScriptRunningReply(msg);
}
void register_viewer_callbacks(LLMessageSystem* msg)

View File

@@ -167,10 +167,10 @@ void LLSurface::create(const S32 grids_per_edge,
mGridsPerEdge = grids_per_edge + 1; // Add 1 for the east and north buffer
mOOGridsPerEdge = 1.f / mGridsPerEdge;
mGridsPerPatchEdge = grids_per_patch_edge;
mPatchesPerEdge = (mGridsPerEdge - 1) / mGridsPerPatchEdge;
mPatchesPerEdge = grids_per_edge / mGridsPerPatchEdge;
mNumberOfPatches = mPatchesPerEdge * mPatchesPerEdge;
mMetersPerGrid = width / ((F32)(mGridsPerEdge - 1));
mMetersPerEdge = mMetersPerGrid * (mGridsPerEdge - 1);
mMetersPerGrid = width / (F32)grids_per_edge;
mMetersPerEdge = mMetersPerGrid * grids_per_edge;
// <FS:CR> Aurora Sim
sTextureSize = width;
// </FS:CR> Aurora Sim
@@ -730,6 +730,7 @@ void LLSurface::disconnectNeighbor(LLSurface *surfacep)
}
// Iterate through surface patches, removing any connectivity to removed surface.
if (mPatchList) // Don't crash if removed before
for (i = 0; i < mNumberOfPatches; i++)
{
(mPatchList + i)->disconnectNeighbor(surfacep);

View File

@@ -403,7 +403,7 @@ void LLToolGrab::startGrab()
mDragStartPointGlobal = grab_start_global;
mDragStartFromCamera = grab_start_global - gAgentCamera.getCameraPositionGlobal();
send_ObjectGrab_message(objectp, mGrabPick, grab_offset);
send_ObjectGrab_message(objectp, true, &mGrabPick, grab_offset);
mGrabOffsetFromCenterInitial = grab_offset;
mGrabHiddenOffsetFromCamera = mDragStartFromCamera;
@@ -1079,7 +1079,7 @@ void LLToolGrab::stopGrab()
case GRAB_ACTIVE_CENTER:
case GRAB_NONPHYSICAL:
case GRAB_LOCKED:
send_ObjectDeGrab_message(objectp, pick);
send_ObjectGrab_message(objectp, false, &pick);
mVerticalDragging = FALSE;
break;
@@ -1133,64 +1133,45 @@ LLVector3d LLToolGrab::getGrabPointGlobal()
}
void send_ObjectGrab_message(LLViewerObject* object, const LLPickInfo & pick, const LLVector3 &grab_offset)
void send_ObjectGrab_message(LLViewerObject* object, bool grab, const LLPickInfo* const pick, const LLVector3 &grab_offset)
{
if (!object) return;
LLMessageSystem *msg = gMessageSystem;
msg->newMessageFast(_PREHASH_ObjectGrab);
msg->newMessageFast(grab ? _PREHASH_ObjectGrab : _PREHASH_ObjectDeGrab);
msg->nextBlockFast( _PREHASH_AgentData);
msg->addUUIDFast(_PREHASH_AgentID, gAgent.getID());
msg->addUUIDFast(_PREHASH_SessionID, gAgent.getSessionID());
msg->nextBlockFast( _PREHASH_ObjectData);
msg->addU32Fast( _PREHASH_LocalID, object->mLocalID);
msg->addVector3Fast(_PREHASH_GrabOffset, grab_offset);
msg->nextBlock("SurfaceInfo");
msg->addVector3("UVCoord", LLVector3(pick.mUVCoords));
msg->addVector3("STCoord", LLVector3(pick.mSTCoords));
msg->addS32Fast(_PREHASH_FaceIndex, pick.mObjectFace);
msg->addVector3("Position", pick.mIntersection);
msg->addVector3("Normal", pick.mNormal);
msg->addVector3("Binormal", pick.mBinormal);
if (grab) msg->addVector3Fast(_PREHASH_GrabOffset, grab_offset);
if (pick)
{
msg->nextBlock("SurfaceInfo");
msg->addVector3("UVCoord", LLVector3(pick->mUVCoords));
msg->addVector3("STCoord", LLVector3(pick->mSTCoords));
msg->addS32Fast(_PREHASH_FaceIndex, pick->mObjectFace);
msg->addVector3("Position", pick->mIntersection);
msg->addVector3("Normal", pick->mNormal);
msg->addVector3("Binormal", pick->mBinormal);
}
msg->sendMessage( object->getRegion()->getHost());
/* Diagnostic code
LL_INFOS() << "mUVCoords: " << pick.mUVCoords
<< ", mSTCoords: " << pick.mSTCoords
<< ", mObjectFace: " << pick.mObjectFace
<< ", mIntersection: " << pick.mIntersection
<< ", mNormal: " << pick.mNormal
<< ", mBinormal: " << pick.mBinormal
if (pick)
{
LL_INFOS() << "mUVCoords: " << pick->mUVCoords
<< ", mSTCoords: " << pick->mSTCoords
<< ", mObjectFace: " << pick->mObjectFace
<< ", mIntersection: " << pick->mIntersection
<< ", mNormal: " << pick->mNormal
<< ", mBinormal: " << pick->mBinormal
<< LL_ENDL;
}
LL_INFOS() << "Avatar pos: " << gAgent.getPositionAgent() << LL_ENDL;
LL_INFOS() << "Object pos: " << object->getPosition() << LL_ENDL;
*/
}
void send_ObjectDeGrab_message(LLViewerObject* object, const LLPickInfo & pick)
{
if (!object) return;
LLMessageSystem *msg = gMessageSystem;
msg->newMessageFast(_PREHASH_ObjectDeGrab);
msg->nextBlockFast(_PREHASH_AgentData);
msg->addUUIDFast(_PREHASH_AgentID, gAgent.getID());
msg->addUUIDFast(_PREHASH_SessionID, gAgent.getSessionID());
msg->nextBlockFast(_PREHASH_ObjectData);
msg->addU32Fast(_PREHASH_LocalID, object->mLocalID);
msg->nextBlock("SurfaceInfo");
msg->addVector3("UVCoord", LLVector3(pick.mUVCoords));
msg->addVector3("STCoord", LLVector3(pick.mSTCoords));
msg->addS32Fast(_PREHASH_FaceIndex, pick.mObjectFace);
msg->addVector3("Position", pick.mIntersection);
msg->addVector3("Normal", pick.mNormal);
msg->addVector3("Binormal", pick.mBinormal);
msg->sendMessage(object->getRegion()->getHost());
}

View File

@@ -41,9 +41,7 @@ class LLPickInfo;
// Message utilities
void send_ObjectGrab_message(LLViewerObject* object, const LLPickInfo & pick, const LLVector3 &grab_offset);
void send_ObjectDeGrab_message(LLViewerObject* object, const LLPickInfo & pick);
void send_ObjectGrab_message(LLViewerObject* object, bool grab, const LLPickInfo* const pick = nullptr, const LLVector3& grab_offset = LLVector3::zero);
class LLToolGrab : public LLTool, public LLSingleton<LLToolGrab>

View File

@@ -4,7 +4,7 @@
*
* $LicenseInfo:firstyear=2002&license=viewerlgpl$
* Second Life Viewer Source Code
* Copyright (C) 2010, Linden Research, Inc.
* Copyright (C) 2014, 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
@@ -84,20 +84,44 @@ static const char * const LOG_INV("Inventory");
static const char * const LOG_LOCAL("InventoryLocalize");
static const char * const LOG_NOTECARD("copy_inventory_from_notecard");
#if 1
// *TODO$: LLInventoryCallback should be deprecated to conform to the new boost::bind/coroutine model.
// temp code in transition
void doInventoryCb(LLPointer<LLInventoryCallback> cb, LLUUID id)
{
if (cb.notNull())
cb->fire(id);
}
#endif
///----------------------------------------------------------------------------
/// Helper class to store special inventory item names and their localized values.
///----------------------------------------------------------------------------
class LLLocalizedInventoryItemsDictionary : public LLSingleton<LLLocalizedInventoryItemsDictionary>
class LLLocalizedInventoryItemsDictionary final : public LLSingleton<LLLocalizedInventoryItemsDictionary>
{
public:
std::map<std::string, std::string> mInventoryItemsDict;
/**
* Finds passed name in dictionary and replaces it with found localized value.
*
* @param object_name - string to be localized.
* @return true if passed name was found and localized, false otherwise.
*/
bool localizeInventoryObjectName(std::string& object_name)
{
LL_DEBUGS(LOG_LOCAL) << "Searching for localization: " << object_name << LL_ENDL;
std::map<std::string, std::string>::const_iterator dictionary_iter = mInventoryItemsDict.find(object_name);
bool found = dictionary_iter != mInventoryItemsDict.end();
if(found)
{
object_name = dictionary_iter->second;
LL_DEBUGS(LOG_LOCAL) << "Found, new name is: " << object_name << LL_ENDL;
}
return found;
}
LLLocalizedInventoryItemsDictionary()
{
mInventoryItemsDict["New Shape"] = LLTrans::getString("New Shape");
@@ -196,27 +220,6 @@ public:
mInventoryItemsDict["dance7"] = LLTrans::getString("dance7");
mInventoryItemsDict["dance8"] = LLTrans::getString("dance8");
}
/**
* Finds passed name in dictionary and replaces it with found localized value.
*
* @param object_name - string to be localized.
* @return true if passed name was found and localized, false otherwise.
*/
bool localizeInventoryObjectName(std::string& object_name)
{
LL_DEBUGS(LOG_LOCAL) << "Searching for localization: " << object_name << LL_ENDL;
std::map<std::string, std::string>::const_iterator dictionary_iter = mInventoryItemsDict.find(object_name);
bool found = dictionary_iter != mInventoryItemsDict.end();
if(found)
{
object_name = dictionary_iter->second;
LL_DEBUGS(LOG_LOCAL) << "Found, new name is: " << object_name << LL_ENDL;
}
return found;
}
};
@@ -324,6 +327,7 @@ void LLViewerInventoryItem::updateServer(BOOL is_new) const
if(!mIsComplete)
{
// *FIX: deal with this better.
// If we're crashing here then the UI is incorrectly enabled.
LL_ERRS(LOG_INV) << "LLViewerInventoryItem::updateServer() - for incomplete item"
<< LL_ENDL;
LLNotificationsUtil::add("IncompleteInventoryItem");
@@ -455,7 +459,7 @@ void LLViewerInventoryItem::setTransactionID(const LLTransactionID& transaction_
{
mTransactionID = transaction_id;
}
// virtual
void LLViewerInventoryItem::packMessage(LLMessageSystem* msg) const
{
msg->addUUIDFast(_PREHASH_ItemID, mUUID);
@@ -474,6 +478,7 @@ void LLViewerInventoryItem::packMessage(LLMessageSystem* msg) const
U32 crc = getCRC32();
msg->addU32Fast(_PREHASH_CRC, crc);
}
// virtual
BOOL LLViewerInventoryItem::importFile(LLFILE* fp)
{
@@ -621,7 +626,7 @@ void LLViewerInventoryCategory::updateServer(BOOL is_new) const
if (AISAPI::isAvailable())
{
LLSD new_llsd = asLLSD();
AISAPI::completion_t cr = boost::bind(&doInventoryCb, (LLPointer<LLInventoryCallback>)NULL, _1);
AISAPI::completion_t cr = boost::bind(&doInventoryCb, LLPointer<LLInventoryCallback>(NULL), _1);
AISAPI::UpdateCategory(getUUID(), new_llsd, cr);
}
else
@@ -833,7 +838,7 @@ bool LLViewerInventoryCategory::acceptItem(LLInventoryItem* inv_item)
LLInventoryModel::item_array_t* item_array;
gInventory.getDirectDescendentsOf(getUUID(),cat_array,item_array);
// Destination stock folder must be empty OR types of incoming and existing items must be identical and have the same permissions
accept = (!item_array->size() ||
accept = (item_array->empty() ||
((item_array->at(0)->getInventoryType() == inv_item->getInventoryType()) &&
(item_array->at(0)->getPermissions().getMaskNextOwner() == inv_item->getPermissions().getMaskNextOwner())));
}
@@ -981,10 +986,10 @@ void LLInventoryCallbackManager::destroyClass()
{
if (sInstance)
{
for (callback_map_t::iterator it = sInstance->mMap.begin(), end_it = sInstance->mMap.end(); it != end_it; ++it)
for (auto& it : sInstance->mMap)
{
// drop LLPointer reference to callback
it->second = NULL;
it.second = NULL;
}
sInstance->mMap.clear();
}
@@ -1020,7 +1025,7 @@ void LLInventoryCallbackManager::fire(U32 callback_id, const LLUUID& item_id)
}
//void rez_attachment_cb(const LLUUID& inv_item, LLViewerJointAttachment *attachmentp)
// [SL:KB] - Patch: Appearance-DnDWear | Checked: 2010-09-28 (Catznip-3.0.0a) | Added: Catznip-2.2.0a
// [SL:KB] - Patch: Appearance-DnDWear | Checked: 2010-09-28 (Catznip-3.4)
void rez_attachment_cb(const LLUUID& inv_item, LLViewerJointAttachment *attachmentp, bool replace)
// [/SL:KB]
{
@@ -1107,6 +1112,7 @@ void create_gesture_cb(const LLUUID& inv_item)
}
}
void create_notecard_cb(const LLUUID& inv_item)
{
if (!inv_item.isNull())
@@ -1173,10 +1179,10 @@ void create_inventory_item(const LLUUID& agent_id, const LLUUID& session_id,
void create_inventory_callingcard(const LLUUID& avatar_id, const LLUUID& parent /*= LLUUID::null*/, LLPointer<LLInventoryCallback> cb/*=NULL*/)
{
std::string item_desc = avatar_id.asString();
std::string item_name;
gCacheName->getFullName(avatar_id, item_name);
LLAvatarName av_name;
LLAvatarNameCache::get(avatar_id, &av_name);
create_inventory_item(gAgent.getID(), gAgent.getSessionID(),
parent, LLTransactionID::tnull, item_name, item_desc, LLAssetType::AT_CALLINGCARD,
parent, LLTransactionID::tnull, av_name.getLegacyName(), item_desc, LLAssetType::AT_CALLINGCARD,
LLInventoryType::IT_CALLINGCARD, NOT_WEARABLE, PERM_MOVE | PERM_TRANSFER, cb);
}
@@ -1432,11 +1438,6 @@ void update_inventory_item(
const LLSD& updates,
LLPointer<LLInventoryCallback> cb)
{
//Singu Note:
// There was some rlva-specific code here, however it adversely affected serverside
// baking when using AISv3. Its omission looks likeley to be inconsequental, but if that's incorrect
// any bugs introduced by its removal are minor compared to non-functional serverside baking.
if (AISAPI::isAvailable())
{
AISAPI::completion_t cr = boost::bind(&doInventoryCb, cb, _1);
@@ -1466,7 +1467,6 @@ void update_inventory_item(
LLInventoryModel::LLCategoryUpdate up(new_item->getParentUUID(), 0);
gInventory.accountForUpdate(up);
gInventory.updateItem(new_item);
if (cb)
{
cb->fire(item_id);
@@ -1525,11 +1525,9 @@ void remove_inventory_items(
LLPointer<LLInventoryCallback> cb
)
{
for (LLInventoryObject::object_list_t::iterator it = items_to_kill.begin();
it != items_to_kill.end();
++it)
for (auto& it : items_to_kill)
{
remove_inventory_item(*it, cb);
remove_inventory_item(it, cb);
}
}
@@ -1603,7 +1601,7 @@ public:
mCB(cb)
{
}
/* virtual */ void fire(const LLUUID& item_id) {}
/* virtual */ void fire(const LLUUID& item_id) override {}
~LLRemoveCategoryOnDestroy()
{
LLInventoryModel::EHasChildren children = gInventory.categoryHasChildren(mID);
@@ -1629,6 +1627,10 @@ void remove_inventory_category(
LLPointer<LLViewerInventoryCategory> obj = gInventory.getCategory(cat_id);
if(obj)
{
if (!gInventory.isCategoryComplete(cat_id))
{
LL_WARNS() << "Removing (purging) incomplete category " << obj->getName() << LL_ENDL;
}
if(LLFolderType::lookupIsProtectedType(obj->getPreferredType()))
{
LLNotificationsUtil::add("CannotRemoveProtectedCategories");
@@ -1849,9 +1851,9 @@ void create_new_item(const std::string& name,
LLViewerAssetType::generateDescriptionFor(asset_type, desc);
next_owner_perm = (next_owner_perm) ? next_owner_perm : PERM_MOVE | PERM_TRANSFER;
LLPointer<LLInventoryCallback> cb = NULL;
LLPointer<LLInventoryCallback> cb = nullptr;
switch(inv_type)
switch (inv_type)
{
case LLInventoryType::IT_LSL:
{
@@ -2003,9 +2005,9 @@ void remove_folder_contents(const LLUUID& category, bool keep_outfit_links,
LLInventoryModel::item_array_t items;
gInventory.collectDescendents(category, cats, items,
LLInventoryModel::EXCLUDE_TRASH);
for (U32 i = 0; i < items.size(); ++i)
for (auto& i : items)
{
LLViewerInventoryItem *item = items.at(i);
LLViewerInventoryItem *item = i;
if (keep_outfit_links && (item->getActualType() == LLAssetType::AT_LINK_FOLDER))
continue;
if (item->getIsLinkType())
@@ -2084,7 +2086,7 @@ const std::string NEW_GESTURE_NAME = "New Gesture"; // *TODO:Translate? (probabl
}
else
{
LL_WARNS() << "Can't create unrecognized type " << type_name << LL_ENDL;
LL_WARNS(LOG_INV) << "Can't create unrecognized type " << type_name << LL_ENDL;
}
}
root->setNeedsAutoRename(TRUE);
@@ -2371,9 +2373,9 @@ PermissionMask LLViewerInventoryItem::getPermissionMask() const
//----------
void LLViewerInventoryItem::onCallingCardNameLookup(const LLUUID& id, const std::string& name, bool is_group)
void LLViewerInventoryItem::onCallingCardNameLookup(const LLUUID& id, const LLAvatarName& name)
{
rename(name);
rename(name.getLegacyName());
gInventory.addChangedMask(LLInventoryObserver::LABEL, getUUID());
gInventory.notifyObservers();
}
@@ -2382,9 +2384,10 @@ class LLRegenerateLinkCollector : public LLInventoryCollectFunctor
{
public:
LLRegenerateLinkCollector(const LLViewerInventoryItem *target_item) : mTargetItem(target_item) {}
virtual ~LLRegenerateLinkCollector() {}
virtual bool operator()(LLInventoryCategory* cat,
LLInventoryItem* item)
virtual ~LLRegenerateLinkCollector() = default;
bool operator()(LLInventoryCategory* cat,
LLInventoryItem* item) override
{
if (item)
{
@@ -2412,11 +2415,8 @@ LLUUID find_possible_item_for_regeneration(const LLViewerInventoryItem *target_i
items,
LLInventoryModel::EXCLUDE_TRASH,
candidate_matches);
for (LLViewerInventoryItem::item_array_t::const_iterator item_iter = items.begin();
item_iter != items.end();
++item_iter)
for (const LLViewerInventoryItem* item : items)
{
const LLViewerInventoryItem *item = (*item_iter);
if(item)
return item->getUUID();
}
@@ -2438,11 +2438,9 @@ BOOL LLViewerInventoryItem::regenerateLink()
items,
LLInventoryModel::EXCLUDE_TRASH,
asset_id_matches);
for (LLViewerInventoryItem::item_array_t::iterator item_iter = items.begin();
item_iter != items.end();
item_iter++)
for (auto& item_iter : items)
{
LLViewerInventoryItem *item = (*item_iter);
LLViewerInventoryItem *item = item_iter;
item->setAssetUUID(target_item_id);
item->updateServer(FALSE);
gInventory.addChangedMask(LLInventoryObserver::REBUILD, item->getUUID());

View File

@@ -42,6 +42,7 @@
class LLFolderView;
class LLFolderBridge;
class LLViewerInventoryCategory;
class LLAvatarName;
//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
// Class LLViewerInventoryItem
@@ -50,7 +51,7 @@ class LLViewerInventoryCategory;
// their inventory.
//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
class LLViewerInventoryItem : public LLInventoryItem, public boost::signals2::trackable
class LLViewerInventoryItem final : public LLInventoryItem, public boost::signals2::trackable
{
public:
typedef std::vector<LLPointer<LLViewerInventoryItem> > item_array_t;
@@ -59,24 +60,24 @@ protected:
~LLViewerInventoryItem( void ); // ref counted
public:
virtual LLAssetType::EType getType() const;
virtual const LLUUID& getAssetUUID() const;
LLAssetType::EType getType() const override;
const LLUUID& getAssetUUID() const override;
virtual const LLUUID& getProtectedAssetUUID() const; // returns LLUUID::null if current agent does not have permission to expose this asset's UUID to the user
virtual const std::string& getName() const;
const std::string& getName() const override;
virtual S32 getSortField() const;
//virtual void setSortField(S32 sortField);
virtual void getSLURL(); //Caches SLURL for landmark. //*TODO: Find a better way to do it and remove this method from here.
virtual const LLPermissions& getPermissions() const;
const LLPermissions& getPermissions() const override;
virtual const bool getIsFullPerm() const; // 'fullperm' in the popular sense: modify-ok & copy-ok & transfer-ok, no special god rules applied
virtual const LLUUID& getCreatorUUID() const;
virtual const std::string& getDescription() const;
virtual const LLSaleInfo& getSaleInfo() const;
virtual LLInventoryType::EType getInventoryType() const;
const LLUUID& getCreatorUUID() const override;
const std::string& getDescription() const override;
const LLSaleInfo& getSaleInfo() const override;
LLInventoryType::EType getInventoryType() const override;
virtual bool isWearableType() const;
virtual LLWearableType::EType getWearableType() const;
virtual U32 getFlags() const;
virtual time_t getCreationDate() const;
virtual U32 getCRC32() const; // really more of a checksum.
U32 getFlags() const override;
time_t getCreationDate() const override;
U32 getCRC32() const override; // really more of a checksum.
static BOOL extractSortFieldAndDisplayName(const std::string& name, S32* sortField, std::string* displayName);
@@ -112,7 +113,7 @@ public:
LLViewerInventoryItem(const LLInventoryItem* other);
void copyViewerItem(const LLViewerInventoryItem* other);
/*virtual*/ void copyItem(const LLInventoryItem* other);
/*virtual*/ void copyItem(const LLInventoryItem* other) override;
// construct a new clone of this item - it creates a new viewer
// inventory item using the copy constructor, and returns it.
@@ -120,15 +121,15 @@ public:
void cloneViewerItem(LLPointer<LLViewerInventoryItem>& newitem) const;
// virtual methods
virtual void updateParentOnServer(BOOL restamp) const;
virtual void updateServer(BOOL is_new) const;
void updateParentOnServer(BOOL restamp) const override;
void updateServer(BOOL is_new) const override;
void fetchFromServer(void) const;
virtual void packMessage(LLMessageSystem* msg) const;
virtual BOOL unpackMessage(LLMessageSystem* msg, const char* block, S32 block_num = 0);
void packMessage(LLMessageSystem* msg) const override;
BOOL unpackMessage(LLMessageSystem* msg, const char* block, S32 block_num = 0) override;
virtual BOOL unpackMessage(const LLSD& item);
virtual BOOL importFile(LLFILE* fp);
virtual BOOL importLegacyStream(std::istream& input_stream);
BOOL importFile(LLFILE* fp) override;
BOOL importLegacyStream(std::istream& input_stream) override;
// file handling on the viewer. These are not meant for anything
// other than cacheing.
@@ -160,7 +161,7 @@ public:
PermissionMask getPermissionMask() const;
// callback
void onCallingCardNameLookup(const LLUUID& id, const std::string& name, bool is_group);
void onCallingCardNameLookup(const LLUUID& id, const LLAvatarName& name);
// If this is a broken link, try to fix it and any other identical link.
BOOL regenerateLink();
@@ -184,7 +185,7 @@ public:
// new ones as needed.
//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
class LLViewerInventoryCategory : public LLInventoryCategory
class LLViewerInventoryCategory final : public LLInventoryCategory
{
public:
typedef std::vector<LLPointer<LLViewerInventoryCategory> > cat_array_t;
@@ -204,10 +205,10 @@ public:
LLViewerInventoryCategory(const LLViewerInventoryCategory* other);
void copyViewerCategory(const LLViewerInventoryCategory* other);
virtual void updateParentOnServer(BOOL restamp_children) const;
virtual void updateServer(BOOL is_new) const;
void updateParentOnServer(BOOL restamp_children) const override;
void updateServer(BOOL is_new) const override;
virtual void packMessage(LLMessageSystem* msg) const;
void packMessage(LLMessageSystem* msg) const override;
const LLUUID& getOwnerID() const { return mOwnerID; }
@@ -234,7 +235,7 @@ public:
bool importFileLocal(LLFILE* fp);
void determineFolderType();
void changeType(LLFolderType::EType new_folder_type);
virtual void unpackMessage(LLMessageSystem* msg, const char* block, S32 block_num = 0);
void unpackMessage(LLMessageSystem* msg, const char* block, S32 block_num = 0) override;
virtual BOOL unpackMessage(const LLSD& category);
// returns true if the category object will accept the incoming item
@@ -259,37 +260,37 @@ public:
class LLViewerJointAttachment;
//void rez_attachment_cb(const LLUUID& inv_item, LLViewerJointAttachment *attachmentp);
// [SL:KB] - Patch: Appearance-DnDWear | Checked: 2010-09-28 (Catznip-3.0.0a) | Added: Catznip-2.2.0a
// [SL:KB] - Patch: Appearance-DnDWear | Checked: 2010-09-28 (Catznip-3.4)
void rez_attachment_cb(const LLUUID& inv_item, LLViewerJointAttachment *attachmentp, bool replace = false);
// [/SL:KB]
//void rez_attachment_cb(const LLUUID& inv_item, LLViewerJointAttachment *attachmentp);
void activate_gesture_cb(const LLUUID& inv_item);
void create_gesture_cb(const LLUUID& inv_item);
class AddFavoriteLandmarkCallback : public LLInventoryCallback
class AddFavoriteLandmarkCallback final : public LLInventoryCallback
{
public:
AddFavoriteLandmarkCallback() : mTargetLandmarkId(LLUUID::null) {}
void setTargetLandmarkId(const LLUUID& target_uuid) { mTargetLandmarkId = target_uuid; }
private:
void fire(const LLUUID& inv_item);
void fire(const LLUUID& inv_item) override;
LLUUID mTargetLandmarkId;
};
typedef boost::function<void(const LLUUID&)> inventory_func_type;
typedef boost::function<void(const LLSD&)> llsd_func_type;
typedef boost::function<void()> nullary_func_type;
typedef std::function<void(const LLUUID&)> inventory_func_type;
typedef std::function<void(const LLSD&)> llsd_func_type;
typedef std::function<void()> nullary_func_type;
void no_op_inventory_func(const LLUUID&); // A do-nothing inventory_func
void no_op_llsd_func(const LLSD&); // likewise for LLSD
void no_op(); // A do-nothing nullary func.
// Shim between inventory callback and boost function/callable
class LLBoostFuncInventoryCallback: public LLInventoryCallback
class LLBoostFuncInventoryCallback : public LLInventoryCallback
{
public:
@@ -301,7 +302,7 @@ public:
}
// virtual
void fire(const LLUUID& item_id)
void fire(const LLUUID& item_id) override
{
mFireFunc(item_id);
}

View File

@@ -600,21 +600,26 @@ void set_merchant_SLM_menu()
gToolBar->getChild<LLView>("marketplace_listings_btn")->setEnabled(true);
}
void check_merchant_status()
void check_merchant_status(bool force)
{
if (!gSavedSettings.getBOOL("InventoryOutboxDisplayBoth"))
{
// Reset the SLM status: we actually want to check again, that's the point of calling check_merchant_status()
LLMarketplaceData::instance().setSLMStatus(MarketplaceStatusCodes::MARKET_PLACE_NOT_INITIALIZED);
if (force)
{
// Reset the SLM status: we actually want to check again, that's the point of calling check_merchant_status()
LLMarketplaceData::instance().setSLMStatus(MarketplaceStatusCodes::MARKET_PLACE_NOT_INITIALIZED);
}
// Hide SLM related menu item
gMenuHolder->getChild<LLView>("MarketplaceListings")->setVisible(FALSE);
// Also disable the toolbar button for Marketplace Listings
gToolBar->getChild<LLView>("marketplace_listings_btn")->setEnabled(false);
// Launch an SLM test connection to get the merchant status
LLMarketplaceData::instance().initializeSLM(boost::bind(&set_merchant_SLM_menu));
if (!gAgent.getRegionCapability("DirectDelivery").empty())
{
// Launch an SLM test connection to get the merchant status
LLMarketplaceData::instance().initializeSLM(boost::bind(&set_merchant_SLM_menu));
}
}
}
@@ -1792,21 +1797,18 @@ class LLObjectTouch : public view_listener_t
{
bool handleEvent(LLPointer<LLEvent> event, const LLSD& userdata)
{
handle_object_touch();
handle_object_touch(LLSelectMgr::getInstance()->getSelection()->getPrimaryObject(), &LLToolPie::getInstance()->getPick());
return true;
}
};
void handle_object_touch()
void handle_object_touch(LLViewerObject* object, const LLPickInfo* const pick)
{
LLViewerObject* object = LLSelectMgr::getInstance()->getSelection()->getPrimaryObject();
if (!object) return;
LLPickInfo pick = LLToolPie::getInstance()->getPick();
// [RLVa:KB] - Checked: 2010-04-11 (RLVa-1.2.0e) | Modified: RLVa-1.1.0l
// NOTE: fallback code since we really shouldn't be getting an active selection if we can't touch this
if ( (rlv_handler_t::isEnabled()) && (!gRlvHandler.canTouch(object, pick.mObjectOffset)) )
if ( (rlv_handler_t::isEnabled()) && (!gRlvHandler.canTouch(object, pick ? pick->mObjectOffset : LLVector3::zero)) )
{
RLV_ASSERT(false);
return;
@@ -1816,28 +1818,30 @@ void handle_object_touch()
// *NOTE: Hope the packets arrive safely and in order or else
// there will be some problems.
// *TODO: Just fix this bad assumption.
send_ObjectGrab_message(object, pick, LLVector3::zero);
send_ObjectDeGrab_message(object, pick);
send_ObjectGrab_message(object, true, pick);
send_ObjectGrab_message(object, false, pick);
}
bool enable_object_touch(LLViewerObject* obj, const LLVector3& offset = LLVector3::zero)
{
bool new_value = obj && obj->flagHandleTouch();
// [RLVa:KB] - Checked: 2010-11-12 (RLVa-1.2.1g) | Added: RLVa-1.2.1g
if (new_value && rlv_handler_t::isEnabled())
{
// RELEASE-RLVa: [RLVa-1.2.1] Make sure this stays in sync with handle_object_touch()
new_value = gRlvHandler.canTouch(obj, offset);
}
// [/RLVa:KB]
return new_value;
}
bool enable_object_touch(const LLSD& userdata)
{
LLViewerObject* obj = LLSelectMgr::getInstance()->getSelection()->getPrimaryObject();
bool new_value = obj && obj->flagHandleTouch();
// [RLVa:KB] - Checked: 2010-11-12 (RLVa-1.2.1g) | Added: RLVa-1.2.1g
if ( (rlv_handler_t::isEnabled()) && (new_value) )
{
// RELEASE-RLVa: [RLVa-1.2.1] Make sure this stays in sync with handle_object_touch()
new_value = gRlvHandler.canTouch(obj, LLToolPie::getInstance()->getPick().mObjectOffset);
}
// [/RLVa:KB]
std::string touch_text;
// Update label based on the node touch name if available.
LLSelectNode* node = LLSelectMgr::getInstance()->getSelection()->getFirstRootNode();
auto selection = LLSelectMgr::getInstance()->getSelection();
LLSelectNode* node = selection->getFirstRootNode();
if (node && node->mValid && !node->mTouchName.empty())
{
touch_text = node->mTouchName;
@@ -1849,7 +1853,8 @@ bool enable_object_touch(const LLSD& userdata)
gMenuHolder->childSetText("Object Touch", touch_text);
gMenuHolder->childSetText("Attachment Object Touch", touch_text);
return new_value;
return enable_object_touch(selection->getPrimaryObject(), LLToolPie::getInstance()->getPick().mObjectOffset);
};
// One object must have touch sensor
@@ -4084,6 +4089,11 @@ void handle_reset_view()
}
else
{
if (gAgent.getAutoPilot())
{
gAgent.stopAutoPilot(true);
}
reset_view_final( true );
}
}
@@ -9422,6 +9432,26 @@ class ListTeleportTo : public view_listener_t
}
};
class ListStalk : public view_listener_t
{
bool handleEvent(LLPointer<LLEvent> event, const LLSD& userdata)
{
LLAvatarActions::showOnMap(LFIDBearer::getActiveSelectedID());
return true;
}
};
class ListStalkable : public view_listener_t
{
bool handleEvent(LLPointer<LLEvent> event, const LLSD& userdata)
{
BOOL is_agent_mappable(const LLUUID& agent_id);
const auto& ids = LFIDBearer::getActiveSelectedIDs();
gMenuHolder->findControl(userdata["control"].asString())->setValue(ids.size() == 1 && is_agent_mappable(ids[0]));
return true;
}
};
class ListAbuseReport : public view_listener_t
{
bool handleEvent(LLPointer<LLEvent> event, const LLSD& userdata)
@@ -9673,6 +9703,82 @@ class ListObjectEnablePay : public view_listener_t
}
};
void list_for_each_object(std::function<void(LLViewerObject*)> func)
{
for (const auto& id : LFIDBearer::getActiveSelectedIDs())
if (auto obj = gObjectList.findObject(id))
func(obj);
}
class ListObjectTouch : public view_listener_t
{
bool handleEvent(LLPointer<LLEvent> event, const LLSD& userdata)
{
list_for_each_object([](LLViewerObject* obj) { if (enable_object_touch(obj)) handle_object_touch(obj); });
return true;
}
};
bool list_has_valid_object(std::function<bool(LLViewerObject*)> func)
{
for (const auto& id : LFIDBearer::getActiveSelectedIDs())
if (func(gObjectList.findObject(id)))
return true; // First is fine enough, we'll use all we can
return false;
}
// One object must have touch sensor
class ListObjectEnableTouch : public view_listener_t
{
bool handleEvent(LLPointer<LLEvent> event, const LLSD& userdata)
{
gMenuHolder->findControl(userdata["control"].asString())->setValue(list_has_valid_object([](LLViewerObject* obj){ return enable_object_touch(obj); }));
return true;
}
};
class ListObjectEdit : public view_listener_t
{
bool handleEvent(LLPointer<LLEvent> event, const LLSD& userdata)
{
std::vector<LLViewerObject*> objs;
auto func = rlv_handler_t::isEnabled() ? static_cast<std::function<void(LLViewerObject* obj)>>([&objs](LLViewerObject* obj) { if (gRlvHandler.canEdit(obj)) objs.push_back(obj); }) : [&objs](LLViewerObject* obj) { if (obj) objs.push_back(obj); };
list_for_each_object(func);
if (objs.empty()) return true;
bool new_selection = userdata.asBoolean();
auto& selmgr = LLSelectMgr::instance();
if (new_selection) selmgr.deselectAll();
auto selection = new_selection ? nullptr : selmgr.getSelection();
auto old_primary = selection ? selection->getPrimaryObject() : nullptr;
for (const auto& obj : objs)
selmgr.selectObjectAndFamily(obj, true);
if (old_primary) selmgr.selectObjectAndFamily(old_primary);
if (new_selection) handle_object_edit();
return true;
}
};
class ListObjectCanEdit : public view_listener_t
{
bool handleEvent(LLPointer<LLEvent> event, const LLSD& userdata)
{
bool new_selection = userdata["data"].asBoolean();
auto& selmgr = LLSelectMgr::instance();
auto selection = new_selection ? nullptr : selmgr.getSelection();
bool has_old_selection = selection && !selection->isEmpty() && !selection->isAttachment();
auto func = rlv_handler_t::isEnabled() ? static_cast<std::function<bool(LLViewerObject* obj)>>([](LLViewerObject* obj) { return !!gRlvHandler.canEdit(obj); }) : [](LLViewerObject* obj) { return !!obj; };
gMenuHolder->findControl(userdata["control"].asString())
->setValue((new_selection || has_old_selection) && list_has_valid_object(func));
return true;
}
};
class MediaCtrlCopyURL : public view_listener_t
{
bool handleEvent(LLPointer<LLEvent> event, const LLSD& userdata)
@@ -10049,6 +10155,8 @@ void initialize_menus()
addMenu(new ListStartCall(), "List.StartCall");
addMenu(new ListStartConference(), "List.StartConference");
addMenu(new ListStartIM(), "List.StartIM");
addMenu(new ListStalk, "List.Stalk");
addMenu(new ListStalkable, "List.Stalkable");
addMenu(new ListTeleportTo, "List.TeleportTo");
addMenu(new ListAbuseReport(), "List.AbuseReport");
addMenu(new ListIsNearby, "List.IsNearby");
@@ -10069,6 +10177,10 @@ void initialize_menus()
addMenu(new ListObjectSit, "List.Object.Sit");
addMenu(new ListObjectPay, "List.Object.Pay");
addMenu(new ListObjectEnablePay, "List.Object.EnablePay");
addMenu(new ListObjectTouch, "List.Object.Touch");
addMenu(new ListObjectEnableTouch, "List.Object.EnableTouch");
addMenu(new ListObjectEdit, "List.Object.Edit");
addMenu(new ListObjectCanEdit, "List.Object.CanEdit");
add_radar_listeners();

View File

@@ -38,8 +38,10 @@
class LLUICtrl;
class LLView;
class LLParcelSelection;
class LLPickInfo;
class LLObjectSelection;
class LLSelectNode;
class LLViewerObject;
void pre_init_menus();
void init_menus();
@@ -88,14 +90,14 @@ BOOL enable_god_full(void* user_data);
BOOL enable_god_liaison(void* user_data);
BOOL enable_god_basic(void* user_data);
void set_underclothes_menu_options();
void check_merchant_status();
void check_merchant_status(bool force = false);
void exchange_callingcard(const LLUUID& dest_id);
void handle_gestures(void*);
void handle_sit_down(void*);
void handle_object_build(void*);
void handle_object_touch();
void handle_object_touch(LLViewerObject*, const LLPickInfo* const = nullptr);
bool enable_object_open();
void handle_object_open();
@@ -133,7 +135,7 @@ void handle_toggle_flycam();
void handle_fake_away_status(void*);
void handle_object_sit_or_stand();
void handle_give_money_dialog(class LLViewerObject*);
void handle_give_money_dialog(LLViewerObject*);
bool enable_pay_object(LLViewerObject*);
bool enable_buy_object();
void handle_go_to(const LLVector3d& pos);

View File

@@ -1894,34 +1894,24 @@ void inventory_offer_handler(LLOfferInfo* info, bool is_friend, bool is_owned_by
// Name cache callbacks don't store userdata, so can't save
// off the LLOfferInfo. Argh.
BOOL name_found = FALSE;
payload["from_id"] = info->mFromID;
args["OBJECTFROMNAME"] = info->mFromName;
args["NAME"] = info->mFromName;
if (info->mFromGroup)
{
std::string group_name;
if (gCacheName->getGroupName(info->mFromID, group_name))
{
args["NAME"] = group_name;
name_found = TRUE;
}
args["NAME"] = LLGroupActions::getSLURL(info->mFromID);
}
else
{
std::string full_name;
if (gCacheName->getFullName(info->mFromID, full_name))
{
std::string full_name = LLAvatarActions::getSLURL(info->mFromID);
// [RLVa:KB] - Checked: 2010-11-02 (RLVa-1.2.2a) | Modified: RLVa-1.2.2a
// Only filter if the object owner is a nearby agent
if ( (gRlvHandler.hasBehaviour(RLV_BHVR_SHOWNAMES)) && (RlvUtil::isNearbyAgent(info->mFromID)) )
{
full_name = RlvStrings::getAnonym(full_name);
}
// [/RLVa:KB]
args["NAME"] = full_name;
name_found = TRUE;
if ( (gRlvHandler.hasBehaviour(RLV_BHVR_SHOWNAMES)) && (RlvUtil::isNearbyAgent(info->mFromID)) )
{
full_name = RlvStrings::getAnonym(full_name);
}
// [/RLVa:KB]
args["NAME"] = full_name;
}
@@ -1931,7 +1921,7 @@ void inventory_offer_handler(LLOfferInfo* info, bool is_friend, bool is_owned_by
// Object -> Agent Inventory Offer
if (info->mFromObject)
{
p.name = name_found ? "ObjectGiveItem" : "ObjectGiveItemUnknownUser";
p.name = "ObjectGiveItem";
}
else // Agent -> Agent Inventory Offer
{
@@ -3211,13 +3201,15 @@ void process_improved_im(LLMessageSystem *msg, void **user_data)
((IM_TELEPORT_REQUEST == dialog) && (RlvActions::autoAcceptTeleportRequest(from_id))) );
// [/RLVa:KB]
if (is_muted)
bool following = gAgent.getAutoPilotLeaderID() == from_id;
if (!following && is_muted)
{
return;
}
// else if (is_do_not_disturb)
// else if (!following && is_do_not_disturb)
// [RLVa:KB] - Checked: 2013-11-08 (RLVa-1.4.9)
else if ( (is_do_not_disturb) && (!fRlvAutoAccept) )
else if (!following && is_do_not_disturb && !fRlvAutoAccept )
// [/RLVa:KB]
{
send_do_not_disturb_message(msg, from_id);
@@ -3344,10 +3336,14 @@ void process_improved_im(LLMessageSystem *msg, void **user_data)
}
*/
LLNotification::Params params(IM_LURE_USER == dialog ? "TeleportOffered" : "TeleportRequest");
params.substitutions = args;
params.payload = payload;
if (following)
{
LLNotifications::instance().forceResponse(LLNotification::Params(params.name).payload(payload), 0);
}
else
// [RLVa:KB] - Checked: 20103-11-08 (RLVa-1.4.9)
if ( (rlv_handler_t::isEnabled()) && (fRlvAutoAccept) )
{
@@ -5269,6 +5265,9 @@ void process_kill_object(LLMessageSystem *mesgsys, void **user_data)
{
LL_RECORD_BLOCK_TIME(FTM_PROCESS_OBJECTS);
auto agent_region = gAgent.getRegion();
if (!agent_region) return;
LLUUID id;
U32 local_id;
S32 i;
@@ -5276,7 +5275,7 @@ void process_kill_object(LLMessageSystem *mesgsys, void **user_data)
num_objects = mesgsys->getNumberOfBlocksFast(_PREHASH_ObjectData);
bool different_region = mesgsys->getSender().getIPandPort() != gAgent.getRegion()->getHost().getIPandPort();
bool different_region = mesgsys->getSender().getIPandPort() != agent_region->getHost().getIPandPort();
for (i = 0; i < num_objects; i++)
{

View File

@@ -2081,8 +2081,6 @@ void LLViewerWindow::adjustRectanglesForFirstUse(const LLRect& window)
adjust_rect_top_right("FloaterMiniMapRect", window);
adjust_rect_top_right("FloaterLagMeter", window);
adjust_rect_top_left("FloaterBuildOptionsRect", window);
adjust_rect_bottom_left("FloaterActiveSpeakersRect", window);

View File

@@ -82,7 +82,13 @@ public:
return;
}
auto root = LlsdFromJson(nlohmann::json::parse(body));
auto root = LlsdFromJsonString(body);
if (root.isUndefined())
{
LL_WARNS() << "Failed to get valid json body" << LL_ENDL;
LLWebProfile::reportImageUploadStatus(false);
return;
}
// *TODO: 404 = not supported by the grid
// *TODO: increase timeout or handle HTTP_INTERNAL_ERROR_* time errors.

View File

@@ -33,6 +33,7 @@
#include "scriptcounter.h"
#include "llavataractions.h"
#include "llavatarnamecache.h"
#include "llviewerregion.h"
#include "llselectmgr.h"
@@ -44,15 +45,6 @@ void cmdline_printchat(const std::string& message);
LLVOAvatar* find_avatar_from_object( LLViewerObject* object );
namespace
{
void countedScriptsOnAvatar(LLStringUtil::format_map_t args, const LLAvatarName& av_name)
{
args["NAME"] = av_name.getNSName();
cmdline_printchat(LLTrans::getString("ScriptCountAvatar", args));
}
}
std::map<LLUUID, ScriptCounter*> ScriptCounter::sCheckMap;
ScriptCounter::ScriptCounter(bool do_delete, LLViewerObject* object)
@@ -82,22 +74,23 @@ void ScriptCounter::requestInventories()
LLVOAvatar* av = static_cast<LLVOAvatar*>(foo);
// Iterate through all the attachment points
for (LLVOAvatar::attachment_map_t::iterator i = av->mAttachmentPoints.begin(); i != av->mAttachmentPoints.end(); ++i)
for (const auto& i : av->mAttachmentPoints)
{
if (LLViewerJointAttachment* attachment = i->second)
if (LLViewerJointAttachment* attachment = i.second)
{
if (!attachment->getValid()) continue;
// Iterate through all the attachments on this point
for (LLViewerJointAttachment::attachedobjs_vec_t::const_iterator j = attachment->mAttachedObjects.begin(); j != attachment->mAttachedObjects.end(); ++j)
if (LLViewerObject* object = *j)
for (const auto& object : attachment->mAttachedObjects)
if (object)
requestInventoriesFor(object);
}
}
}
else // Iterate through all the selected objects
{
for (LLObjectSelection::valid_root_iterator i = LLSelectMgr::getInstance()->getSelection()->valid_root_begin(); i != LLSelectMgr::getInstance()->getSelection()->valid_root_end(); ++i)
auto selection = LLSelectMgr::getInstance()->getSelection();
for (auto i = selection->valid_root_begin(), end = selection->valid_root_end(); i != end; ++i)
if (LLSelectNode* selectNode = *i)
if (LLViewerObject* object = selectNode->getObject())
requestInventoriesFor(object);
@@ -111,10 +104,8 @@ void ScriptCounter::requestInventoriesFor(LLViewerObject* object)
{
++objectCount;
requestInventoryFor(object);
LLViewerObject::child_list_t child_list = object->getChildren();
for (LLViewerObject::child_list_t::iterator i = child_list.begin(); i != child_list.end(); ++i)
for (auto child : object->getChildren())
{
LLViewerObject* child = *i;
if (child->isAvatar()) continue;
requestInventoryFor(child);
}
@@ -140,41 +131,55 @@ void ScriptCounter::inventoryChanged(LLViewerObject* obj, LLInventoryObject::obj
if (inv)
{
LLInventoryObject::object_list_t::const_iterator end = inv->end();
for (LLInventoryObject::object_list_t::const_iterator i = inv->begin(); i != end; ++i)
if (LLInventoryObject* asset = (*i))
if (asset->getType() == LLAssetType::AT_LSL_TEXT)
uuid_vec_t ids;
for (auto asset : *inv)
{
const LLUUID& id = asset->getUUID();
if (asset->getType() == LLAssetType::AT_LSL_TEXT && id.notNull())
{
++scriptcount;
if (doDelete)
ids.push_back(id);
else
{
++scriptcount;
if (doDelete)
{
const LLUUID& id = asset->getUUID();
if (id.notNull())
{
//LL_INFOS() << "Deleting script " << id << " in " << objid << LL_ENDL;
obj->removeInventory(id);
--i; // Avoid iteration when removing, everything has shifted
end = inv->end();
}
}
else
{
const LLUUID& id = asset->getUUID();
LLMessageSystem* msg = gMessageSystem;
msg->newMessageFast(_PREHASH_GetScriptRunning);
msg->nextBlockFast(_PREHASH_Script);
msg->addUUIDFast(_PREHASH_ObjectID, obj->getID());
msg->addUUIDFast(_PREHASH_ItemID, id);
msg->sendReliable(obj->getRegion()->getHost());
sCheckMap[id] = this;
++checking;
}
LLMessageSystem* msg = gMessageSystem;
msg->newMessageFast(_PREHASH_GetScriptRunning);
msg->nextBlockFast(_PREHASH_Script);
msg->addUUIDFast(_PREHASH_ObjectID, obj->getID());
msg->addUUIDFast(_PREHASH_ItemID, id);
msg->sendReliable(obj->getRegion()->getHost());
sCheckMap[id] = this;
++checking;
}
}
}
for (const auto& id : ids)
{
//LL_INFOS() << "Deleting script " << id << " in " << objid << LL_ENDL;
obj->removeInventory(id);
}
}
summarize();
}
void ScriptCounter::processScriptRunningReply(LLMessageSystem* msg)
{
if (!sCheckMap.empty())
{
LLUUID item_id;
msg->getUUIDFast(_PREHASH_Script, _PREHASH_ItemID, item_id);
auto it = sCheckMap.find(item_id);
if (it != sCheckMap.end())
{
it->second->processRunningReply(msg);
sCheckMap.erase(it);
}
}
}
void ScriptCounter::processRunningReply(LLMessageSystem* msg)
{
BOOL is;
@@ -199,7 +204,10 @@ void ScriptCounter::summarize()
args["RUNNING"] = stringize(mRunningCount);
args["MONO"] = stringize(mMonoCount);
if (foo->isAvatar())
LLAvatarNameCache::get(foo->getID(), boost::bind(countedScriptsOnAvatar, args, _2));
{
args["NAME"] = LLAvatarActions::getSLURL(foo->getID());
cmdline_printchat(LLTrans::getString("ScriptCountAvatar", args));
}
else
cmdline_printchat(LLTrans::getString(doDelete ? "ScriptDeleteObject" : "ScriptCountObject", args));

View File

@@ -33,19 +33,19 @@
#include "llvoinventorylistener.h"
class ScriptCounter : public LLInstanceTracker<ScriptCounter, LLUUID>, public LLVOInventoryListener
class ScriptCounter final : public LLInstanceTracker<ScriptCounter, LLUUID>, public LLVOInventoryListener
{
public:
ScriptCounter(bool do_delete, LLViewerObject* object);
~ScriptCounter();
/*virtual*/ void inventoryChanged(LLViewerObject* obj, LLInventoryObject::object_list_t* inv, S32, void*);
void inventoryChanged(LLViewerObject* obj, LLInventoryObject::object_list_t* inv, S32, void*) override;
void requestInventories();
static void processScriptRunningReply(LLMessageSystem* msg);
private:
void requestInventoriesFor(LLViewerObject* object);
void requestInventoryFor(LLViewerObject* object);
friend void process_script_running_reply(LLMessageSystem* msg, void**);
void processRunningReply(LLMessageSystem* msg);
void summarize(); // Check if finished, if so, output and destroy.

View File

@@ -1,20 +1,12 @@
#include "llviewerprecompiledheaders.h"
#include "llviewerwindow.h"
#include "llwindow.h"
#include "llpanelgeneral.h"
#include "llappviewer.h"
#include "llbutton.h"
#include "llviewercontrol.h"
#include "llnotificationsutil.h"
#include "llstartup.h"
#include "llviewerwindow.h" // to link into child list
#include "llnotify.h"
#include "lluictrlfactory.h"
#include "llhttpclient.h"
#include "llversioninfo.h"
#include "llbufferstream.h"
#include "llhttpclient.h"
#include "llnotificationsutil.h"
#include "llversioninfo.h"
#include "llviewerwindow.h"
#include "llweb.h"
#include "llwindow.h"
#include <nlohmann/json.hpp>
@@ -56,7 +48,12 @@ public:
return;
}
auto root = nlohmann::json::parse(body);
auto root = nlohmann::json::parse(body, nullptr, false);
if (root.is_discarded())
{
LL_WARNS() << "Failed to parse json string from body:\n" << body << LL_ENDL;
return; // TODO: Should we say something here for the user?
}
std::string viewer_version = llformat("%s (%i)", LLVersionInfo::getShortVersion().c_str(), LLVersionInfo::getBuild());
@@ -140,7 +137,7 @@ void check_for_updates()
{
type = "release";
}
else if (channel == std::string("Singularity Test") || channel == std::string("Singularity Alpha"))
else if (channel == std::string("Singularity Test") || channel == std::string("Singularity Alpha") || channel == "Singularity Beta")
{
type = "alpha";
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 8.6 KiB

View File

@@ -57,6 +57,8 @@ with the same filename but different name
<texture name="Favorite_Star_Over" file_name="navbar/Favorite_Star_Over.png" preload="false" />
<texture name="Favorite_Link_Over" file_name="navbar/Favorite_Link_Over.png" preload="false" />
<texture name="FMOD_Logo" file_name="FMOD Logo.png" preload="true"/>
<texture name="Parcel_M_Dark" file_name="map_event_mature.tga" preload="true" />
<texture name="Parcel_M_Light" file_name="map_event_mature.tga" preload="false" />
<texture name="Parcel_PG_Light" file_name="map_event.tga" preload="false" />

View File

@@ -68,6 +68,10 @@
<on_click function="List.RequestTeleport"/>
<on_visible function="List.EnableSingleSelected"/>
</menu_item_call>
<menu_item_call label="Find on Map" name="Find on Map">
<on_click function="List.Stalk"/>
<on_visible function="List.Stalkable"/>
</menu_item_call>
<menu_item_call label="Share" name="Share">
<on_click function="List.Share"/>
<on_visible function="List.EnableSingleSelected"/>

View File

@@ -65,6 +65,10 @@
<on_click function="List.RequestTeleport"/>
<on_visible function="List.EnableSingleSelected"/>
</menu_item_call>
<menu_item_call label="Find on Map" name="Find on Map">
<on_click function="List.Stalk"/>
<on_visible function="List.Stalkable"/>
</menu_item_call>
<menu_item_call label="Share" name="Share">
<on_click function="List.Share"/>
<on_visible function="List.EnableSingleSelected"/>

View File

@@ -24,6 +24,18 @@
<on_click function="List.Object.Pay"/>
<on_visible function="List.Object.EnablePay"/>
</menu_item_call>
<menu_item_call label="Touch" name="Touch">
<on_click function="List.Object.Touch"/>
<on_visible function="List.Object.EnableTouch"/>
</menu_item_call>
<menu_item_call label="Edit" name="Edit">
<on_click function="List.Object.Edit" userdata="true"/>
<on_visible function="List.Object.CanEdit" userdata="true"/>
</menu_item_call>
<menu_item_call label="Add to Selection" name="Add to Selection">
<on_click function="List.Object.Edit" userdata=""/>
<on_visible function="List.Object.CanEdit" userdata=""/>
</menu_item_call>
<menu_item_separator/>
<menu_item_call label="Copy Key" name="Copy Key">
<on_click function="List.CopyUUIDs"/>

View File

@@ -65,6 +65,10 @@
<on_click function="List.RequestTeleport"/>
<on_visible function="List.EnableSingleSelected"/>
</menu_item_call>
<menu_item_call label="Find on Map" name="Find on Map">
<on_click function="List.Stalk"/>
<on_visible function="List.Stalkable"/>
</menu_item_call>
<menu_item_call label="Share" name="Share">
<on_click function="List.Share"/>
<on_visible function="List.EnableSingleSelected"/>

View File

@@ -52,6 +52,10 @@
<menu_item_call label="Request Teleport" name="Request Teleport">
<on_click function="List.RequestTeleport"/>
</menu_item_call>
<menu_item_call label="Find on Map" name="Find on Map">
<on_click function="List.Stalk"/>
<on_visible function="List.Stalkable"/>
</menu_item_call>
<menu_item_call label="Share" name="Share">
<on_click function="List.Share"/>
</menu_item_call>

View File

@@ -64,6 +64,18 @@
<on_click function="List.Object.Pay"/>
<on_visible function="List.Object.EnablePay"/>
</menu_item_call>
<menu_item_call label="Touch" name="Touch">
<on_click function="List.Object.Touch"/>
<on_visible function="List.Object.EnableTouch"/>
</menu_item_call>
<menu_item_call label="Edit" name="Edit">
<on_click function="List.Object.Edit" userdata="true"/>
<on_visible function="List.Object.CanEdit" userdata="true"/>
</menu_item_call>
<menu_item_call label="Add to Selection" name="Add to Selection">
<on_click function="List.Object.Edit" userdata=""/>
<on_visible function="List.Object.CanEdit" userdata=""/>
</menu_item_call>
<menu_item_separator
layout="topleft" />
<menu_item_call

View File

@@ -7436,27 +7436,6 @@ An object named [OBJECTFROMNAME] owned by [NAME] has given you a [OBJECTTYPE] na
</form>
</notification>
<notification
icon="notify.tga"
name="ObjectGiveItemUnknownUser"
type="notify">
An object named [OBJECTFROMNAME] owned by (an unknown user) has given you a [OBJECTTYPE] named [OBJECTNAME].
<form name="form">
<button
index="0"
name="Keep"
text="Keep"/>
<button
index="1"
name="Discard"
text="Discard"/>
<button
index="2"
name="Mute"
text="Mute"/>
</form>
</notification>
<notification
icon="notify.tga"
name="UserGiveItem"

View File

@@ -80,6 +80,8 @@
<button bottom_delta="0" left="146" height="16" width="16" follows="left|bottom" image_overlay="inv_folder_trash.tga" scale_image="true" label="" tool_tip="Delete the currently selected remembered login info, if any." name="remove_login"/>
<check_box bottom_delta="0" left="173" control_name="RememberPassword" follows="left|bottom" height="16" label="Save password" name="remember_check" width="158"/>
<icon name="fmod_logo" bottom="7" height="60" left="-425" width="228" follows="right|bottom" image_name="FMOD_Logo"/>
<text bg_visible="false" border_drop_shadow_visible="false" border_visible="false"
bottom="45" drop_shadow_visible="true" follows="right|bottom"
font="SansSerifSmall" font-style="UNDERLINE" h_pad="0" halign="right" height="16"

View File

@@ -77,9 +77,9 @@
tab_position="top"
tab_min_width="10">
<inventory_panel label="All" name="All Items" filename="panel_marketplace_listings_inventory.xml"/>
<inventory_panel visibility_control="LiruEnableWIPUI" label="Active" name="Active Items" filename="panel_marketplace_listings_listed.xml"/>
<inventory_panel visibility_control="LiruEnableWIPUI" label="Inactive" name="Inactive Items" filename="panel_marketplace_listings_unlisted.xml"/>
<inventory_panel visibility_control="LiruEnableWIPUI" label="Unassociated" name="Unassociated Items" filename="panel_marketplace_listings_unassociated.xml"/>
<inventory_panel label="Active" name="Active Items" filename="panel_marketplace_listings_listed.xml"/>
<inventory_panel label="Inactive" name="Inactive Items" filename="panel_marketplace_listings_unlisted.xml"/>
<inventory_panel label="Unassociated" name="Unassociated Items" filename="panel_marketplace_listings_unassociated.xml"/>
</tab_container>
</panel>
<panel
@@ -90,10 +90,6 @@
width="306"
bottom_delta="-40"
height="40"
background_visible="true"
background_opaque="true"
bg_alpha_image="none"
bg_alpha_color="0.38, 0.694, 0.573, 0.35"
bg_opaque_image="Marketplace_Dropzone_Background"
border="true"
bevel_style="in"

View File

@@ -3559,6 +3559,8 @@ If you continue to receive this message, please contact Second Life support for
<string name="Bottom">Bottom</string>
<string name="Bottom Right">Bottom Right</string>
<string name="Complexity">Complexity: [NUM]</string>
<!-- compile queue-->
<string name="CompileQueueDownloadedCompiling">Downloaded, now compiling</string>
<string name="CompileQueueServiceUnavailable">Script compilation service not available</string>

Binary file not shown.

After

Width:  |  Height:  |  Size: 9.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 9.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 9.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 9.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 9.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 9.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 9.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 9.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 9.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 9.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 9.5 KiB

View File

@@ -488,11 +488,14 @@ void wlfPanel_AdvSettings::onSimulatorFeaturesReceived(const LLUUID& region_id)
void wlfPanel_AdvSettings::updateEditHoverEnabled()
{
const LLViewerRegion* region = gAgent.getRegion();
bool enabled = region && region->avatarHoverHeightEnabled();
if (mHoverHeight) mHoverHeight->setEnabled(enabled);
if (enabled)
if (mHoverHeight)
{
syncFromPreferenceSetting(mHoverHeight);
const LLViewerRegion* region = gAgent.getRegion();
bool enabled = region && region->avatarHoverHeightEnabled();
mHoverHeight->setEnabled(enabled);
if (enabled)
{
syncFromPreferenceSetting(mHoverHeight);
}
}
}