From ddae988aa5d5f89840e88bb70757a6f4266c775e Mon Sep 17 00:00:00 2001 From: Salvatore La Bua Date: Mon, 30 Sep 2013 12:27:33 +0200 Subject: [PATCH 1/9] Minor change in class listing order in llnetmap.h --- indra/newview/llnetmap.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/indra/newview/llnetmap.h b/indra/newview/llnetmap.h index cac65a418..143919987 100644 --- a/indra/newview/llnetmap.h +++ b/indra/newview/llnetmap.h @@ -165,13 +165,13 @@ private: /*virtual*/ bool handleEvent(LLPointer event, const LLSD& userdata); }; - class LLChatRings : public LLMemberListener + class LLShowObjects : public LLMemberListener { public: /*virtual*/ bool handleEvent(LLPointer event, const LLSD& userdata); }; - class LLShowObjects : public LLMemberListener + class LLChatRings : public LLMemberListener { public: /*virtual*/ bool handleEvent(LLPointer event, const LLSD& userdata); From 723f4963e07cc23d3ce58b4a01a709939aaef61b Mon Sep 17 00:00:00 2001 From: Aleric Inglewood Date: Mon, 30 Sep 2013 17:31:17 +0200 Subject: [PATCH 2/9] Do not count long poll connections against CurlConcurrentConnectionsPerService This is necessary for opensim mega regions that can have up to 16 long poll connections for a single service, while upping the maximum number of connections per service just for that is clearly nonsense. I also changed that long poll connections do not "use" the "Other" capability type (which shows that the debug info in the HTTP debug console for the Other capability type turns grey when it only has event poll connections). As a result additional connections become available for textures, mesh and the inventory (the other capability types) on opensim, which has all types on the same service, because now Other does no longer constantly reserves a full share of the available connections. This makes the actual number of connections used for textures and mesh a lot more like it is on Second Life. --- indra/llmessage/aicurl.cpp | 1 + indra/llmessage/aicurlperservice.cpp | 62 +++++++++++++++++++++++++--- indra/llmessage/aicurlperservice.h | 8 ++-- indra/llmessage/aicurlprivate.h | 2 + indra/llmessage/aicurlthread.cpp | 11 ++++- indra/llmessage/llhttpclient.h | 3 ++ indra/newview/aihttpview.cpp | 5 ++- indra/newview/lleventpoll.cpp | 1 + 8 files changed, 81 insertions(+), 12 deletions(-) diff --git a/indra/llmessage/aicurl.cpp b/indra/llmessage/aicurl.cpp index c6d42e1ad..246371aab 100644 --- a/indra/llmessage/aicurl.cpp +++ b/indra/llmessage/aicurl.cpp @@ -1437,6 +1437,7 @@ void BufferedCurlEasyRequest::prepRequest(AICurlEasyRequest_wat& curl_easy_reque mResponder = responder; // Cache capability type, because it will be needed even after the responder was removed. mCapabilityType = responder->capability_type(); + mIsEventPoll = responder->is_event_poll(); // Send header events to responder if needed. if (mResponder->needsHeaders()) diff --git a/indra/llmessage/aicurlperservice.cpp b/indra/llmessage/aicurlperservice.cpp index af01e94f0..570a7e5b2 100644 --- a/indra/llmessage/aicurlperservice.cpp +++ b/indra/llmessage/aicurlperservice.cpp @@ -75,6 +75,7 @@ AIPerService::AIPerService(void) : mConcurrentConnections(CurlConcurrentConnectionsPerService), mApprovedRequests(0), mTotalAdded(0), + mEventPolls(0), mEstablishedConnections(0), mUsedCT(0), mCTInUse(0) @@ -335,24 +336,70 @@ bool AIPerService::throttled(AICapabilityType capability_type) const mCapabilityType[capability_type].mAdded >= mCapabilityType[capability_type].mConcurrentConnections; } -void AIPerService::added_to_multi_handle(AICapabilityType capability_type) +void AIPerService::added_to_multi_handle(AICapabilityType capability_type, bool event_poll) { + if (event_poll) + { + llassert(capability_type == cap_other); + // We want to mark this service as unused when only long polls have been added, because they + // are not counted towards the maximum number of connection for this service and therefore + // should not cause another capability type to get less connections. + // For example, if - like on opensim - Textures and Other capability types use the same + // service then it is nonsense to reserve 4 connections Other and only give 4 connections + // to Textures, only because there is a long poll connection (or any number of long poll + // connections). What we want is to see: 0-0-0,{0/7,0} for textures when Other is ONLY in + // use for the Event Poll. + // + // This translates to that, since we're adding an event_poll and are about to remove it from + // either the command queue OR the request queue, that when mAdded == 1 at the end of this function + // (and the rest of the pipeline is empty) we want to mark this capability type as unused. + // + // If mEventPolls > 0 at this point then mAdded will not be incremented. + // If mEventPolls == 0 then mAdded will be incremented and thus should be 0 now. + // In other words, if the number of mAdded requests is equal to the number of (counted) + // mEventPoll requests right now, then that will still be the case after we added another + // event poll request (the transition from used to unused only being necessary because + // event poll requests in the pipe line ARE counted; not because that is necessary but + // because it would be more complex to not do so). + // + // Moreover, when we get here then the request that is being added is still counted as being in + // the command queue, or the request queue, so that pipelined_requests() will return 1 more than + // the actual count. + U16 counted_event_polls = (mEventPolls == 0) ? 0 : 1; + if (mCapabilityType[capability_type].mAdded == counted_event_polls && + mCapabilityType[capability_type].pipelined_requests() == counted_event_polls + 1) + { + mark_unused(capability_type); + } + if (++mEventPolls > 1) + { + // This only happens on megaregions. Do not count the additional long poll connections against the maximum handles for this service. + return; + } + } ++mCapabilityType[capability_type].mAdded; ++mTotalAdded; } -void AIPerService::removed_from_multi_handle(AICapabilityType capability_type, bool downloaded_something, bool success) +void AIPerService::removed_from_multi_handle(AICapabilityType capability_type, bool event_poll, bool downloaded_something, bool success) { CapabilityType& ct(mCapabilityType[capability_type]); - llassert(mTotalAdded > 0 && ct.mAdded > 0); - bool done = --ct.mAdded == 0; + llassert(mTotalAdded > 0 && ct.mAdded > 0 && (!event_poll || mEventPolls)); + if (!event_poll || --mEventPolls == 0) + { + --ct.mAdded; + --mTotalAdded; + } if (downloaded_something) { llassert(ct.mDownloading > 0); --ct.mDownloading; } - --mTotalAdded; - if (done && ct.pipelined_requests() == 0) + // If the number of added request handles is equal to the number of counted event poll handles, + // in other words, when there are only long poll connections left, then mark the capability type + // as unused. + U16 counted_event_polls = (capability_type != cap_other || mEventPolls == 0) ? 0 : 1; + if (ct.mAdded == counted_event_polls && ct.pipelined_requests() == counted_event_polls) { mark_unused(capability_type); } @@ -467,6 +514,9 @@ void AIPerService::add_queued_to(curlthread::MultiHandle* multi_handle, bool onl break; } // Request was added, remove it from the queue. + // Note: AIPerService::added_to_multi_handle (called from add_easy_request above) relies on the fact that + // we first add the easy handle and then remove it from the request queue (which is necessary to avoid + // that another thread adds one just in between). ct.mQueuedRequests.pop_front(); // Mark that at least one request of this CT was successfully added. success |= mask; diff --git a/indra/llmessage/aicurlperservice.h b/indra/llmessage/aicurlperservice.h index 188d383bf..8af4cdab6 100644 --- a/indra/llmessage/aicurlperservice.h +++ b/indra/llmessage/aicurlperservice.h @@ -169,6 +169,7 @@ class AIPerService { int mConcurrentConnections; // The maximum number of allowed concurrent connections to this service. int mApprovedRequests; // The number of approved requests for this service by approveHTTPRequestFor that were not added to the command queue yet. int mTotalAdded; // Number of active easy handles with this service. + int mEventPolls; // Number of active event poll handles with this service. int mEstablishedConnections; // Number of connected sockets to this service. U32 mUsedCT; // Bit mask with one bit per capability type. A '1' means the capability was in use since the last resetUsedCT(). @@ -267,9 +268,10 @@ class AIPerService { public: void added_to_command_queue(AICapabilityType capability_type) { ++mCapabilityType[capability_type].mQueuedCommands; mark_inuse(capability_type); } - void removed_from_command_queue(AICapabilityType capability_type) { --mCapabilityType[capability_type].mQueuedCommands; llassert(mCapabilityType[capability_type].mQueuedCommands >= 0); } - void added_to_multi_handle(AICapabilityType capability_type); // Called when an easy handle for this service has been added to the multi handle. - void removed_from_multi_handle(AICapabilityType capability_type, bool downloaded_something, bool success); // Called when an easy handle for this service is removed again from the multi handle. + void removed_from_command_queue(AICapabilityType capability_type) { llassert(mCapabilityType[capability_type].mQueuedCommands > 0); --mCapabilityType[capability_type].mQueuedCommands; } + void added_to_multi_handle(AICapabilityType capability_type, bool event_poll); // Called when an easy handle for this service has been added to the multi handle. + void removed_from_multi_handle(AICapabilityType capability_type, bool event_poll, + bool downloaded_something, bool success); // Called when an easy handle for this service is removed again from the multi handle. void download_started(AICapabilityType capability_type) { ++mCapabilityType[capability_type].mDownloading; } bool throttled(AICapabilityType capability_type) const; // Returns true if the maximum number of allowed requests for this service/capability type have been added to the multi handle. bool nothing_added(AICapabilityType capability_type) const { return mCapabilityType[capability_type].mAdded == 0; } diff --git a/indra/llmessage/aicurlprivate.h b/indra/llmessage/aicurlprivate.h index cbb9a293d..c5e3514a7 100644 --- a/indra/llmessage/aicurlprivate.h +++ b/indra/llmessage/aicurlprivate.h @@ -418,6 +418,7 @@ class BufferedCurlEasyRequest : public CurlEasyRequest { buffer_ptr_t mOutput; LLHTTPClient::ResponderPtr mResponder; AICapabilityType mCapabilityType; + bool mIsEventPoll; //U32 mBodyLimit; // From the old LLURLRequestDetail::mBodyLimit, but never used. U32 mStatus; // HTTP status, decoded from the first header line. std::string mReason; // The "reason" from the same header line. @@ -466,6 +467,7 @@ class BufferedCurlEasyRequest : public CurlEasyRequest { // Return the capability type of this request. AICapabilityType capability_type(void) const { llassert(mCapabilityType != number_of_capability_types); return mCapabilityType; } + bool is_event_poll(void) const { return mIsEventPoll; } // Return true if any data was received. bool received_data(void) const { return mTotalRawBytes > 0; } diff --git a/indra/llmessage/aicurlthread.cpp b/indra/llmessage/aicurlthread.cpp index 5339e9b65..83e258fd9 100644 --- a/indra/llmessage/aicurlthread.cpp +++ b/indra/llmessage/aicurlthread.cpp @@ -1340,6 +1340,9 @@ void AICurlThread::process_commands(AICurlMultiHandle_wat const& multi_handle_w) break; case cmd_add: { + // Note: AIPerService::added_to_multi_handle (called from add_easy_request) relies on the fact that + // we first add the easy handle and then remove it from the command queue (which is necessary to + // avoid that another thread adds one just in between). multi_handle_w->add_easy_request(AICurlEasyRequest(command_being_processed_r->easy_request()), false); PerService_wat(*per_service)->removed_from_command_queue(capability_type); break; @@ -1747,10 +1750,12 @@ bool MultiHandle::add_easy_request(AICurlEasyRequest const& easy_request, bool f { bool throttled = true; // Default. AICapabilityType capability_type; + bool event_poll; AIPerServicePtr per_service; { AICurlEasyRequest_wat curl_easy_request_w(*easy_request); capability_type = curl_easy_request_w->capability_type(); + event_poll = curl_easy_request_w->is_event_poll(); per_service = curl_easy_request_w->getPerServicePtr(); if (!from_queue) { @@ -1782,7 +1787,7 @@ bool MultiHandle::add_easy_request(AICurlEasyRequest const& easy_request, bool f curl_easy_request_w->set_timeout_opts(); if (curl_easy_request_w->add_handle_to_multi(curl_easy_request_w, mMultiHandle) == CURLM_OK) { - per_service_w->added_to_multi_handle(capability_type); // (About to be) added to mAddedEasyRequests. + per_service_w->added_to_multi_handle(capability_type, event_poll); // (About to be) added to mAddedEasyRequests. throttled = false; // Fall through... } } @@ -1841,6 +1846,7 @@ CURLMcode MultiHandle::remove_easy_request(addedEasyRequests_type::iterator cons { CURLMcode res; AICapabilityType capability_type; + bool event_poll; AIPerServicePtr per_service; { AICurlEasyRequest_wat curl_easy_request_w(**iter); @@ -1848,8 +1854,9 @@ CURLMcode MultiHandle::remove_easy_request(addedEasyRequests_type::iterator cons bool success = curl_easy_request_w->success(); res = curl_easy_request_w->remove_handle_from_multi(curl_easy_request_w, mMultiHandle); capability_type = curl_easy_request_w->capability_type(); + event_poll = curl_easy_request_w->is_event_poll(); per_service = curl_easy_request_w->getPerServicePtr(); - PerService_wat(*per_service)->removed_from_multi_handle(capability_type, downloaded_something, success); // (About to be) removed from mAddedEasyRequests. + PerService_wat(*per_service)->removed_from_multi_handle(capability_type, event_poll, downloaded_something, success); // (About to be) removed from mAddedEasyRequests. #ifdef SHOW_ASSERT curl_easy_request_w->mRemovedPerCommand = as_per_command; #endif diff --git a/indra/llmessage/llhttpclient.h b/indra/llmessage/llhttpclient.h index 507ee2a04..a366811d6 100644 --- a/indra/llmessage/llhttpclient.h +++ b/indra/llmessage/llhttpclient.h @@ -228,6 +228,9 @@ public: // If this function returns false then we generate an error when a redirect status (300..399) is received. virtual bool redirect_status_ok(void) const { return true; } + // Overridden by LLEventPollResponder to return true. + virtual bool is_event_poll(void) const { return false; } + // Returns the capability type used by this responder. virtual AICapabilityType capability_type(void) const { return cap_other; } diff --git a/indra/newview/aihttpview.cpp b/indra/newview/aihttpview.cpp index 58bc2f689..ec9e3acc6 100644 --- a/indra/newview/aihttpview.cpp +++ b/indra/newview/aihttpview.cpp @@ -80,6 +80,7 @@ void AIServiceBar::draw() U32 is_used; U32 is_inuse; int total_added; + int event_polls; int established_connections; int concurrent_connections; size_t bandwidth; @@ -88,6 +89,7 @@ void AIServiceBar::draw() is_used = per_service_r->is_used(); is_inuse = per_service_r->is_inuse(); total_added = per_service_r->mTotalAdded; + event_polls = per_service_r->mEventPolls; established_connections = per_service_r->mEstablishedConnections; concurrent_connections = per_service_r->mConcurrentConnections; bandwidth = per_service_r->bandwidth().truncateData(AIHTTPView::getTime_40ms()); @@ -148,7 +150,7 @@ void AIServiceBar::draw() } start = mHTTPView->updateColumn(mc_col, start); #if defined(CWDEBUG) || defined(DEBUG_CURLIO) - text = llformat(" | %d,%d/%d", total_added, established_connections, concurrent_connections); + text = llformat(" | %d,%d,%d/%d", total_added, event_polls, established_connections, concurrent_connections); #else text = llformat(" | %d/%d", total_added, concurrent_connections); #endif @@ -227,6 +229,7 @@ void AIGLHTTPHeaderBar::draw(void) height -= sLineHeight; start = h_offset; text = "Service (host:port)"; + // This must match AICapabilityType! static char const* caption[number_of_capability_types] = { " | Textures", " | Inventory", " | Mesh", " | Other" }; diff --git a/indra/newview/lleventpoll.cpp b/indra/newview/lleventpoll.cpp index 75d3c4eda..604f8a7c8 100644 --- a/indra/newview/lleventpoll.cpp +++ b/indra/newview/lleventpoll.cpp @@ -75,6 +75,7 @@ namespace void handleMessage(const LLSD& content); /*virtual*/ void error(U32 status, const std::string& reason); /*virtual*/ void result(const LLSD& content); + /*virtual*/ bool is_event_poll(void) const { return true; } /*virtual*/ AIHTTPTimeoutPolicy const& getHTTPTimeoutPolicy(void) const { return eventPollResponder_timeout; } /*virtual*/ char const* getName(void) const { return "LLEventPollResponder"; } From c0961e9760a88c0a5e751b33e41dc7b051883f84 Mon Sep 17 00:00:00 2001 From: Salvatore La Bua Date: Mon, 30 Sep 2013 22:21:11 +0200 Subject: [PATCH 3/9] Remove unnecessary listeners for the MiniMap New class ToggleControl is used in place of the removed listeners. Much cleaner code for the MiniMap chat rings. Remove redundant debug setting: MiniMapChatRings. -Thanks Liru for the advices. --- indra/newview/app_settings/settings.xml | 13 +-- indra/newview/llnetmap.cpp | 101 ++++-------------- indra/newview/llnetmap.h | 45 ++------ .../skins/default/xui/en-us/menu_mini_map.xml | 16 +-- 4 files changed, 36 insertions(+), 139 deletions(-) diff --git a/indra/newview/app_settings/settings.xml b/indra/newview/app_settings/settings.xml index 1eba2c840..9467360e3 100644 --- a/indra/newview/app_settings/settings.xml +++ b/indra/newview/app_settings/settings.xml @@ -4788,7 +4788,7 @@ This should be as low as possible, but too low may break functionality Type U32 Value - 8 + 32 CurlTimeoutDNSLookup @@ -10068,17 +10068,6 @@ This should be as low as possible, but too low may break functionality Value 1 - MiniMapChatRings - - Comment - Display chat distance rings on mini map - Persist - 1 - Type - Boolean - Value - 0 - MiniMapWhisperRing Comment diff --git a/indra/newview/llnetmap.cpp b/indra/newview/llnetmap.cpp index 9d480d610..e77ca7a0b 100644 --- a/indra/newview/llnetmap.cpp +++ b/indra/newview/llnetmap.cpp @@ -113,14 +113,8 @@ LLNetMap::LLNetMap(const std::string& name) : (new LLScaleMap())->registerListener(this, "MiniMap.ZoomLevel"); (new LLCenterMap())->registerListener(this, "MiniMap.Center"); (new LLCheckCenterMap())->registerListener(this, "MiniMap.CheckCenter"); - (new LLRotateMap())->registerListener(this, "MiniMap.Rotate"); - (new LLCheckRotateMap())->registerListener(this, "MiniMap.CheckRotate"); - (new LLShowObjects())->registerListener(this, "MiniMap.ShowObjects"); - (new LLCheckShowObjects())->registerListener(this, "MiniMap.CheckShowObjects"); (new LLChatRings())->registerListener(this, "MiniMap.ChatRings"); - (new LLWhisperRing())->registerListener(this, "MiniMap.WhisperRing"); - (new LLChatRing())->registerListener(this, "MiniMap.ChatRing"); - (new LLShoutRing())->registerListener(this, "MiniMap.ShoutRing"); + (new LLCheckChatRings())->registerListener(this, "MiniMap.CheckChatRings"); (new LLStopTracking())->registerListener(this, "MiniMap.StopTracking"); (new LLEnableTracking())->registerListener(this, "MiniMap.EnableTracking"); (new LLShowAgentProfile())->registerListener(this, "MiniMap.ShowProfile"); @@ -133,6 +127,7 @@ LLNetMap::LLNetMap(const std::string& name) : (new mmsetcustom())->registerListener(this, "MiniMap.setcustom"); (new mmsetunmark())->registerListener(this, "MiniMap.setunmark"); (new mmenableunmark())->registerListener(this, "MiniMap.enableunmark"); + (new LLToggleControl())->registerListener(this, "MiniMap.ToggleControl"); LLUICtrlFactory::getInstance()->buildPanel(this, "panel_mini_map.xml"); @@ -1163,95 +1158,29 @@ bool LLNetMap::LLCheckCenterMap::handleEvent(LLPointer event, const LLS return true; } -bool LLNetMap::LLRotateMap::handleEvent(LLPointer event, const LLSD& userdata) -{ - BOOL rotate = gSavedSettings.getBOOL("MiniMapRotate"); - gSavedSettings.setBOOL("MiniMapRotate", !rotate); - - return true; -} - -bool LLNetMap::LLCheckRotateMap::handleEvent(LLPointer event, const LLSD& userdata) -{ - LLNetMap *self = mPtr; - BOOL enabled = gSavedSettings.getBOOL("MiniMapRotate"); - self->findControl(userdata["control"].asString())->setValue(enabled); - return true; -} - -bool LLNetMap::LLShowObjects::handleEvent(LLPointer event, const LLSD& userdata) -{ - BOOL showobjects = gSavedSettings.getBOOL("ShowMiniMapObjects"); - gSavedSettings.setBOOL("ShowMiniMapObjects", !showobjects); - return true; -} - -bool LLNetMap::LLCheckShowObjects::handleEvent(LLPointer event, const LLSD& userdata) -{ - LLNetMap *self = mPtr; - BOOL enabled = gSavedSettings.getBOOL("ShowMiniMapObjects"); - self->findControl(userdata["control"].asString())->setValue(enabled); - return true; -} - bool LLNetMap::LLChatRings::handleEvent(LLPointer event, const LLSD& userdata) { - BOOL all_enabled = gSavedSettings.getBOOL("MiniMapChatRings"); - gSavedSettings.setBOOL("MiniMapChatRings", !all_enabled); + BOOL whisper_enabled = gSavedSettings.getBOOL("MiniMapWhisperRing"); + BOOL chat_enabled = gSavedSettings.getBOOL("MiniMapChatRing"); + BOOL shout_enabled = gSavedSettings.getBOOL("MiniMapShoutRing"); + BOOL all_enabled = whisper_enabled && chat_enabled && shout_enabled; + gSavedSettings.setBOOL("MiniMapWhisperRing", !all_enabled); gSavedSettings.setBOOL("MiniMapChatRing", !all_enabled); gSavedSettings.setBOOL("MiniMapShoutRing", !all_enabled); - return true; -} - -bool LLNetMap::LLWhisperRing::handleEvent(LLPointer event, const LLSD& userdata) -{ - BOOL all_enabled = gSavedSettings.getBOOL("MiniMapChatRings"); - BOOL whisper_enabled = gSavedSettings.getBOOL("MiniMapWhisperRing"); - BOOL chat_enabled = gSavedSettings.getBOOL("MiniMapChatRing"); - BOOL shout_enabled = gSavedSettings.getBOOL("MiniMapShoutRing"); - - gSavedSettings.setBOOL("MiniMapWhisperRing", !whisper_enabled); - - if(all_enabled) - gSavedSettings.setBOOL("MiniMapChatRings", !all_enabled); - else if(!whisper_enabled && chat_enabled && shout_enabled) - gSavedSettings.setBOOL("MiniMapChatRings", TRUE); return true; } -bool LLNetMap::LLChatRing::handleEvent(LLPointer event, const LLSD& userdata) +bool LLNetMap::LLCheckChatRings::handleEvent(LLPointer event, const LLSD& userdata) { - BOOL all_enabled = gSavedSettings.getBOOL("MiniMapChatRings"); BOOL whisper_enabled = gSavedSettings.getBOOL("MiniMapWhisperRing"); BOOL chat_enabled = gSavedSettings.getBOOL("MiniMapChatRing"); BOOL shout_enabled = gSavedSettings.getBOOL("MiniMapShoutRing"); + BOOL all_enabled = whisper_enabled && chat_enabled && shout_enabled; - gSavedSettings.setBOOL("MiniMapChatRing", !chat_enabled); - - if(all_enabled) - gSavedSettings.setBOOL("MiniMapChatRings", !all_enabled); - else if(whisper_enabled && !chat_enabled && shout_enabled) - gSavedSettings.setBOOL("MiniMapChatRings", TRUE); - - return true; -} - -bool LLNetMap::LLShoutRing::handleEvent(LLPointer event, const LLSD& userdata) -{ - BOOL all_enabled = gSavedSettings.getBOOL("MiniMapChatRings"); - BOOL whisper_enabled = gSavedSettings.getBOOL("MiniMapWhisperRing"); - BOOL chat_enabled = gSavedSettings.getBOOL("MiniMapChatRing"); - BOOL shout_enabled = gSavedSettings.getBOOL("MiniMapShoutRing"); - - gSavedSettings.setBOOL("MiniMapShoutRing", !shout_enabled); - - if(all_enabled) - gSavedSettings.setBOOL("MiniMapChatRings", !all_enabled); - else if(whisper_enabled && chat_enabled && !shout_enabled) - gSavedSettings.setBOOL("MiniMapChatRings", TRUE); - + LLNetMap *self = mPtr; + self->findControl(userdata["control"].asString())->setValue(all_enabled); return true; } @@ -1300,3 +1229,11 @@ bool LLNetMap::LLEnableProfile::handleEvent(LLPointer event, const LLSD //self->findControl(userdata["control"].asString())->setValue(self->isAgentUnderCursor()); return true; } + +bool LLNetMap::LLToggleControl::handleEvent(LLPointer event, const LLSD& userdata) +{ + std::string control_name = userdata.asString(); + gSavedSettings.setBOOL(control_name, !gSavedSettings.getBOOL(control_name)); + return true; +} + diff --git a/indra/newview/llnetmap.h b/indra/newview/llnetmap.h index 143919987..82f48bc9a 100644 --- a/indra/newview/llnetmap.h +++ b/indra/newview/llnetmap.h @@ -147,49 +147,13 @@ private: /*virtual*/ bool handleEvent(LLPointer event, const LLSD& userdata); }; - class LLRotateMap : public LLMemberListener - { - public: - /*virtual*/ bool handleEvent(LLPointer event, const LLSD& userdata); - }; - - class LLCheckRotateMap : public LLMemberListener - { - public: - /*virtual*/ bool handleEvent(LLPointer event, const LLSD& userdata); - }; - - class LLCheckShowObjects : public LLMemberListener - { - public: - /*virtual*/ bool handleEvent(LLPointer event, const LLSD& userdata); - }; - - class LLShowObjects : public LLMemberListener - { - public: - /*virtual*/ bool handleEvent(LLPointer event, const LLSD& userdata); - }; - class LLChatRings : public LLMemberListener { public: /*virtual*/ bool handleEvent(LLPointer event, const LLSD& userdata); }; - class LLWhisperRing : public LLMemberListener - { - public: - /*virtual*/ bool handleEvent(LLPointer event, const LLSD& userdata); - }; - - class LLChatRing : public LLMemberListener - { - public: - /*virtual*/ bool handleEvent(LLPointer event, const LLSD& userdata); - }; - - class LLShoutRing : public LLMemberListener + class LLCheckChatRings : public LLMemberListener { public: /*virtual*/ bool handleEvent(LLPointer event, const LLSD& userdata); @@ -268,6 +232,13 @@ private: public: /*virtual*/ bool handleEvent(LLPointer event, const LLSD& userdata); }; + + class LLToggleControl : public LLMemberListener + { + public: + /*virtual*/ bool handleEvent(LLPointer event, const LLSD& userdata); + }; + }; diff --git a/indra/newview/skins/default/xui/en-us/menu_mini_map.xml b/indra/newview/skins/default/xui/en-us/menu_mini_map.xml index 244f25317..336f66229 100644 --- a/indra/newview/skins/default/xui/en-us/menu_mini_map.xml +++ b/indra/newview/skins/default/xui/en-us/menu_mini_map.xml @@ -21,32 +21,32 @@ - - + + - - + + - + - + - + - + From c9753396419bfd6b5879985f9c143b0d83b55cd5 Mon Sep 17 00:00:00 2001 From: Salvatore La Bua Date: Mon, 30 Sep 2013 22:36:08 +0200 Subject: [PATCH 4/9] Fix copy/paste clumsiness in settings.xml --- indra/newview/app_settings/settings.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/indra/newview/app_settings/settings.xml b/indra/newview/app_settings/settings.xml index 9467360e3..20bf857f9 100644 --- a/indra/newview/app_settings/settings.xml +++ b/indra/newview/app_settings/settings.xml @@ -4788,7 +4788,7 @@ This should be as low as possible, but too low may break functionality Type U32 Value - 32 + 8 CurlTimeoutDNSLookup From bed0ed73d9a27259638d236700d53c42443e5981 Mon Sep 17 00:00:00 2001 From: Salvatore La Bua Date: Mon, 30 Sep 2013 22:45:50 +0200 Subject: [PATCH 5/9] Remove unused userdata fields from the MiniMap menu --- indra/newview/skins/default/xui/en-us/menu_mini_map.xml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/indra/newview/skins/default/xui/en-us/menu_mini_map.xml b/indra/newview/skins/default/xui/en-us/menu_mini_map.xml index 336f66229..373d6fc1b 100644 --- a/indra/newview/skins/default/xui/en-us/menu_mini_map.xml +++ b/indra/newview/skins/default/xui/en-us/menu_mini_map.xml @@ -32,8 +32,8 @@ - - + + From e4202c361b83970ff4c3eb904726fb7531d4eb51 Mon Sep 17 00:00:00 2001 From: Latif Khalifa Date: Mon, 30 Sep 2013 23:35:51 +0200 Subject: [PATCH 6/9] Don't skip transparent faces by default in Collada export --- indra/newview/app_settings/settings.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/indra/newview/app_settings/settings.xml b/indra/newview/app_settings/settings.xml index 20bf857f9..cc9d96c27 100644 --- a/indra/newview/app_settings/settings.xml +++ b/indra/newview/app_settings/settings.xml @@ -17663,7 +17663,7 @@ This should be as low as possible, but too low may break functionality Type Boolean Value - 1 + 0 DAEExportTextures From bc64e3aa29f55ee0ef296388ee80ec998561bd68 Mon Sep 17 00:00:00 2001 From: Latif Khalifa Date: Tue, 1 Oct 2013 03:29:57 +0200 Subject: [PATCH 7/9] Don't display both username and display name if they're the same. This is issue especially on Aurora based grids. Patch by Liru --- indra/llcommon/llavatarname.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/indra/llcommon/llavatarname.cpp b/indra/llcommon/llavatarname.cpp index cce8d33b4..c05ac09d5 100644 --- a/indra/llcommon/llavatarname.cpp +++ b/indra/llcommon/llavatarname.cpp @@ -80,7 +80,7 @@ void LLAvatarName::fromLLSD(const LLSD& sd) mDisplayName = sd[DISPLAY_NAME].asString(); mLegacyFirstName = sd[LEGACY_FIRST_NAME].asString(); mLegacyLastName = sd[LEGACY_LAST_NAME].asString(); - mIsDisplayNameDefault = sd[IS_DISPLAY_NAME_DEFAULT].asBoolean(); + mIsDisplayNameDefault = sd[IS_DISPLAY_NAME_DEFAULT].asBoolean() || mUsername == mDisplayName; LLDate expires = sd[DISPLAY_NAME_EXPIRES]; mExpires = expires.secondsSinceEpoch(); LLDate next_update = sd[DISPLAY_NAME_NEXT_UPDATE]; From ffd32542cc158826e90e4f71d92fb65c308f6506 Mon Sep 17 00:00:00 2001 From: Inusaito Sayori Date: Tue, 1 Oct 2013 20:00:54 -0400 Subject: [PATCH 8/9] [VarRegions] Prevent crashing on regions at the edge of reality itself (such as Null, Null) Demotes "Asking for patch out of bounds" to llwarns to prevent crashies, guards against some seemingly potent cases. --- indra/newview/llsurface.cpp | 23 +++++++++++++++++++++-- 1 file changed, 21 insertions(+), 2 deletions(-) diff --git a/indra/newview/llsurface.cpp b/indra/newview/llsurface.cpp index 661358bfb..fd7c0da59 100644 --- a/indra/newview/llsurface.cpp +++ b/indra/newview/llsurface.cpp @@ -440,6 +440,11 @@ void LLSurface::connectNeighbor(LLSurface *neighborp, U32 direction) // Aurora Sim //neighbor_patchp = neighborp->getPatch(mPatchesPerEdge - 1, 0); neighbor_patchp = neighborp->getPatch(neighbor_offset[0] - 1, off); //neighborPatchesPerEdge - 1 + if (!neighbor_patchp) + { + mNeighbors[direction] = NULL; + return; + } // Aurora Sim patchp->connectNeighbor(neighbor_patchp, direction); @@ -451,6 +456,11 @@ void LLSurface::connectNeighbor(LLSurface *neighborp, U32 direction) // Aurora Sim //neighbor_patchp = neighborp->getPatch(mPatchesPerEdge - 1, mPatchesPerEdge - 1); neighbor_patchp = neighborp->getPatch(neighbor_offset[0] - 1, neighbor_offset[1] - 1); + if (!neighbor_patchp) + { + mNeighbors[direction] = NULL; + return; + } // Aurora Sim patchp->connectNeighbor(neighbor_patchp, direction); @@ -472,6 +482,11 @@ void LLSurface::connectNeighbor(LLSurface *neighborp, U32 direction) // Aurora Sim //neighbor_patchp = neighborp->getPatch(0, mPatchesPerEdge - 1); neighbor_patchp = neighborp->getPatch(off, neighbor_offset[1] - 1); //0 + if (!neighbor_patchp) + { + mNeighbors[direction] = NULL; + return; + } // Aurora Sim patchp->connectNeighbor(neighbor_patchp, direction); @@ -600,6 +615,7 @@ void LLSurface::connectNeighbor(LLSurface *neighborp, U32 direction) //neighbor_patchp = neighborp->getPatch(mPatchesPerEdge - 1, i); patchp = getPatch(0, i + own_offset[1]); neighbor_patchp = neighborp->getPatch(neighborPatchesPerEdge - 1, i + neighbor_offset[1]); + if (!neighbor_patchp) continue; // Aurora Sim patchp->connectNeighbor(neighbor_patchp, direction); @@ -620,6 +636,7 @@ void LLSurface::connectNeighbor(LLSurface *neighborp, U32 direction) //neighbor_patchp = neighborp->getPatch(mPatchesPerEdge - 1, i - 1); patchp = getPatch(0, i + own_offset[1]); neighbor_patchp = neighborp->getPatch(neighborPatchesPerEdge - 1, i - 1 + neighbor_offset[1]); + if (!neighbor_patchp) continue; // Aurora Sim patchp->connectNeighbor(neighbor_patchp, SOUTHWEST); @@ -637,6 +654,7 @@ void LLSurface::connectNeighbor(LLSurface *neighborp, U32 direction) //neighbor_patchp = neighborp->getPatch(mPatchesPerEdge - 1, i + 1); patchp = getPatch(0, i + own_offset[1]); neighbor_patchp = neighborp->getPatch(neighborPatchesPerEdge - 1, i + 1 + neighbor_offset[1]); + if (!neighbor_patchp) continue; // Aurora Sim patchp->connectNeighbor(neighbor_patchp, NORTHWEST); @@ -656,6 +674,7 @@ void LLSurface::connectNeighbor(LLSurface *neighborp, U32 direction) //neighbor_patchp = neighborp->getPatch(i, mPatchesPerEdge - 1); patchp = getPatch(i + own_offset[0], 0); neighbor_patchp = neighborp->getPatch(i + neighbor_offset[0], neighborPatchesPerEdge - 1); + if (!neighbor_patchp) continue; // Aurora Sim patchp->connectNeighbor(neighbor_patchp, direction); @@ -1321,12 +1340,12 @@ LLSurfacePatch *LLSurface::getPatch(const S32 x, const S32 y) const { if ((x < 0) || (x >= mPatchesPerEdge)) { - llerrs << "Asking for patch out of bounds" << llendl; + llwarns << "Asking for patch out of bounds" << llendl; return NULL; } if ((y < 0) || (y >= mPatchesPerEdge)) { - llerrs << "Asking for patch out of bounds" << llendl; + llwarns << "Asking for patch out of bounds" << llendl; return NULL; } From a415b34c285cfa19e16503a884977230b787e5ab Mon Sep 17 00:00:00 2001 From: Inusaito Sayori Date: Tue, 1 Oct 2013 20:02:45 -0400 Subject: [PATCH 9/9] Fix a crash noticed while working on the last commit, when asserts aren't always, we should return before using null pointers. --- indra/newview/llsurfacepatch.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/indra/newview/llsurfacepatch.cpp b/indra/newview/llsurfacepatch.cpp index c2466c5e1..ff99580e6 100644 --- a/indra/newview/llsurfacepatch.cpp +++ b/indra/newview/llsurfacepatch.cpp @@ -881,6 +881,7 @@ void LLSurfacePatch::setOriginGlobal(const LLVector3d &origin_global) void LLSurfacePatch::connectNeighbor(LLSurfacePatch *neighbor_patchp, const U32 direction) { llassert(neighbor_patchp); + if (!neighbor_patchp) return; mNormalsInvalid[direction] = TRUE; neighbor_patchp->mNormalsInvalid[gDirOpposite[direction]] = TRUE;