summaryrefslogtreecommitdiff
path: root/indra/newview/llviewerparcelmgr.cpp
diff options
context:
space:
mode:
authorGlenn Glazer <coyot@lindenlab.com>2016-04-07 12:10:13 -0700
committerGlenn Glazer <coyot@lindenlab.com>2016-04-07 12:10:13 -0700
commit369cefd5b3f2f52ae0dd203fcd45a4618f74b0f3 (patch)
tree941d27a32099abaf71bae8a2865002e2b25a3512 /indra/newview/llviewerparcelmgr.cpp
parent0494a502aafac73800352dc26c4eb3a27b02a8ce (diff)
parent18928ea6c6f2830a0d45ec412c915eceff1b76b0 (diff)
pull from viewer-release
Diffstat (limited to 'indra/newview/llviewerparcelmgr.cpp')
-rwxr-xr-xindra/newview/llviewerparcelmgr.cpp99
1 files changed, 58 insertions, 41 deletions
diff --git a/indra/newview/llviewerparcelmgr.cpp b/indra/newview/llviewerparcelmgr.cpp
index 2a6b105cab..dddfb6745e 100755
--- a/indra/newview/llviewerparcelmgr.cpp
+++ b/indra/newview/llviewerparcelmgr.cpp
@@ -67,6 +67,7 @@
#include "roles_constants.h"
#include "llweb.h"
#include "llvieweraudio.h"
+#include "llcorehttputil.h"
const F32 PARCEL_COLLISION_DRAW_SECS = 1.f;
@@ -143,8 +144,8 @@ LLViewerParcelMgr::LLViewerParcelMgr()
// JC: Resolved a merge conflict here, eliminated
// mBlockedImage->setAddressMode(LLTexUnit::TAM_WRAP);
// because it is done in llviewertexturelist.cpp
- mBlockedImage = LLViewerTextureManager::getFetchedTextureFromFile("world/NoEntryLines.png");
- mPassImage = LLViewerTextureManager::getFetchedTextureFromFile("world/NoEntryPassLines.png");
+ mBlockedImage = LLViewerTextureManager::getFetchedTextureFromFile("world/NoEntryLines.png", FTT_LOCAL_FILE, TRUE, LLGLTexture::BOOST_UI);
+ mPassImage = LLViewerTextureManager::getFetchedTextureFromFile("world/NoEntryPassLines.png", FTT_LOCAL_FILE, TRUE, LLGLTexture::BOOST_UI);
S32 overlay_size = mParcelsPerEdge * mParcelsPerEdge / PARCEL_OVERLAY_CHUNKS;
sPackedOverlay = new U8[overlay_size];
@@ -1286,10 +1287,13 @@ const std::string& LLViewerParcelMgr::getAgentParcelName() const
void LLViewerParcelMgr::sendParcelPropertiesUpdate(LLParcel* parcel, bool use_agent_region)
{
- if(!parcel) return;
+ if(!parcel)
+ return;
LLViewerRegion *region = use_agent_region ? gAgent.getRegion() : LLWorld::getInstance()->getRegionFromPosGlobal( mWestSouth );
- if (!region) return;
+ if (!region)
+ return;
+
//LL_INFOS() << "found region: " << region->getName() << LL_ENDL;
LLSD body;
@@ -1302,7 +1306,9 @@ void LLViewerParcelMgr::sendParcelPropertiesUpdate(LLParcel* parcel, bool use_ag
parcel->packMessage(body);
LL_INFOS() << "Sending parcel properties update via capability to: "
<< url << LL_ENDL;
- LLHTTPClient::post(url, body, new LLHTTPClient::Responder());
+
+ LLCoreHttpUtil::HttpCoroutineAdapter::messageHttpPost(url, body,
+ "Parcel Properties sent to sim.", "Parcel Properties failed to send to sim.");
}
else
{
@@ -1453,6 +1459,7 @@ void LLViewerParcelMgr::processParcelProperties(LLMessageSystem *msg, void **use
BOOL region_deny_identified_override = false; // Deprecated
BOOL region_deny_transacted_override = false; // Deprecated
BOOL region_deny_age_unverified_override = false;
+ BOOL agent_parcel_update = false; // updating previous(existing) agent parcel
S32 other_clean_time = 0;
@@ -1542,6 +1549,18 @@ void LLViewerParcelMgr::processParcelProperties(LLMessageSystem *msg, void **use
// Actually extract the data.
if (parcel)
{
+ if (local_id == parcel_mgr.mAgentParcel->getLocalID())
+ {
+ // Parcels in different regions can have same ids.
+ LLViewerRegion* parcel_region = LLWorld::getInstance()->getRegion(msg->getSender());
+ LLViewerRegion* agent_region = gAgent.getRegion();
+ if (parcel_region && agent_region && parcel_region->getRegionID() == agent_region->getRegionID())
+ {
+ // we got an updated version of agent parcel
+ agent_parcel_update = true;
+ }
+ }
+
parcel->init(owner_id,
FALSE, FALSE, FALSE,
claim_date, claim_price_per_meter, rent_price_per_meter,
@@ -1600,16 +1619,10 @@ void LLViewerParcelMgr::processParcelProperties(LLMessageSystem *msg, void **use
}
}
}
- else if (local_id == parcel_mgr.mAgentParcel->getLocalID())
+ else if (agent_parcel_update)
{
- // Parcels in different regions can have same ids.
- LLViewerRegion* parcel_region = LLWorld::getInstance()->getRegion( msg->getSender() );
- LLViewerRegion* agent_region = gAgent.getRegion();
- if (parcel_region && agent_region && parcel_region->getRegionID() == agent_region->getRegionID())
- {
- // updated agent parcel
- parcel_mgr.mAgentParcel->unpackMessage(msg);
- }
+ // updated agent parcel
+ parcel_mgr.mAgentParcel->unpackMessage(msg);
}
}
@@ -1752,33 +1765,37 @@ void LLViewerParcelMgr::processParcelProperties(LLMessageSystem *msg, void **use
{
if (parcel)
{
- std::string music_url_raw = parcel->getMusicURL();
-
- // Trim off whitespace from front and back
- std::string music_url = music_url_raw;
- LLStringUtil::trim(music_url);
-
- // If there is a new music URL and it's valid, play it.
- if (music_url.size() > 12)
- {
- if (music_url.substr(0,7) == "http://")
- {
- optionally_start_music(music_url);
- }
- else
- {
- LL_INFOS() << "Stopping parcel music (invalid audio stream URL)" << LL_ENDL;
- // clears the URL
- // null value causes fade out
- LLViewerAudio::getInstance()->startInternetStreamWithAutoFade(LLStringUtil::null);
- }
- }
- else if (!gAudiop->getInternetStreamURL().empty())
- {
- LL_INFOS() << "Stopping parcel music (parcel stream URL is empty)" << LL_ENDL;
- // null value causes fade out
- LLViewerAudio::getInstance()->startInternetStreamWithAutoFade(LLStringUtil::null);
- }
+ // Only update stream if parcel changed (recreated) or music is playing (enabled)
+ if (!agent_parcel_update || gSavedSettings.getBOOL("MediaTentativeAutoPlay"))
+ {
+ std::string music_url_raw = parcel->getMusicURL();
+
+ // Trim off whitespace from front and back
+ std::string music_url = music_url_raw;
+ LLStringUtil::trim(music_url);
+
+ // If there is a new music URL and it's valid, play it.
+ if (music_url.size() > 12)
+ {
+ if (music_url.substr(0, 7) == "http://")
+ {
+ optionally_start_music(music_url);
+ }
+ else
+ {
+ LL_INFOS() << "Stopping parcel music (invalid audio stream URL)" << LL_ENDL;
+ // clears the URL
+ // null value causes fade out
+ LLViewerAudio::getInstance()->startInternetStreamWithAutoFade(LLStringUtil::null);
+ }
+ }
+ else if (!gAudiop->getInternetStreamURL().empty())
+ {
+ LL_INFOS() << "Stopping parcel music (parcel stream URL is empty)" << LL_ENDL;
+ // null value causes fade out
+ LLViewerAudio::getInstance()->startInternetStreamWithAutoFade(LLStringUtil::null);
+ }
+ }
}
else
{