diff --git a/indra/llcommon/lluri.cpp b/indra/llcommon/lluri.cpp index 3c3bf855f8e48170e9abebeaaf6d903fbd0fd471..fe422e92b7c8155382748918afea39e1c095dc2c 100644 --- a/indra/llcommon/lluri.cpp +++ b/indra/llcommon/lluri.cpp @@ -509,12 +509,21 @@ LLURI LLURI::buildHTTP(const std::string& prefix, return uri; } +// static +LLURI LLURI::buildHTTP(const std::string& scheme, + const std::string& prefix, + const LLSD& path, + const LLSD& query) +{ + return buildHTTP(fmt::format(FMT_STRING("{:s}://{:s}"), scheme, prefix), path, query); +} + // static LLURI LLURI::buildHTTP(const std::string& host, const U32& port, const LLSD& path) { - return LLURI::buildHTTP(llformat("%s:%u", host.c_str(), port), path); + return LLURI::buildHTTP(fmt::format(FMT_STRING("{:s}:{:d}"), host, port), path); } // static @@ -523,7 +532,7 @@ LLURI LLURI::buildHTTP(const std::string& host, const LLSD& path, const LLSD& query) { - return LLURI::buildHTTP(llformat("%s:%u", host.c_str(), port), path, query); + return LLURI::buildHTTP(fmt::format(FMT_STRING("{:s}:{:d}"), host, port), path, query); } std::string LLURI::asString() const @@ -593,6 +602,14 @@ std::string LLURI::hostName() const return unescape(host); } +std::string LLURI::hostNameAndPort() const +{ + std::string user, host, port; + findAuthorityParts(mEscapedAuthority, user, host, port); + return port.empty() ? unescape(host) : unescape(host + ":" + port); +} + + std::string LLURI::userName() const { std::string user, userPass, host, port; diff --git a/indra/llcommon/lluri.h b/indra/llcommon/lluri.h index e78be311ea900d41894ffa931cf8cadf03f5b186..d3d753a62efc2ede5e07c010ff9198c3b5ba3667 100644 --- a/indra/llcommon/lluri.h +++ b/indra/llcommon/lluri.h @@ -66,6 +66,13 @@ class LL_COMMON_API LLURI const std::string& prefix, const LLSD& path, const LLSD& query); + + static LLURI buildHTTP( + const std::string& scheme, + const std::string& prefix, + const LLSD& path, + const LLSD& query); + ///< prefix is either a full URL prefix of the form /// "http://example.com:8080", or it can be simply a host and /// optional port like "example.com" or "example.com:8080", in @@ -93,20 +100,21 @@ class LL_COMMON_API LLURI std::string scheme() const; ///< ex.: "http", note lack of colon std::string opaque() const; ///< everything after the colon - // for schemes that follow path like syntax (http, https, ftp) - std::string authority() const; // ex.: "host.com:80" - std::string hostName() const; // ex.: "host.com" - std::string userName() const; - std::string password() const; - U16 hostPort() const; // ex.: 80, will include implicit port - BOOL defaultPort() const; // true if port is default for scheme - const std::string& escapedPath() const { return mEscapedPath; } - std::string path() const; // ex.: "/abc/def", includes leading slash - LLSD pathArray() const; // above decoded into an array of strings - std::string query() const; // ex.: "x=34", section after "?" - const std::string& escapedQuery() const { return mEscapedQuery; } - LLSD queryMap() const; // above decoded into a map - static LLSD queryMap(std::string escaped_query_string); + // for schemes that follow path like syntax (http, https, ftp) + std::string authority() const; // ex.: "user:pass@host.com:80" + std::string hostName() const; // ex.: "host.com" + std::string hostNameAndPort() const; // ex.: "host.com:80" + std::string userName() const; + std::string password() const; + U16 hostPort() const; // ex.: 80, will include implicit port + BOOL defaultPort() const; // true if port is default for scheme + const std::string& escapedPath() const { return mEscapedPath; } + std::string path() const; // ex.: "/abc/def", includes leading slash + LLSD pathArray() const; // above decoded into an array of strings + std::string query() const; // ex.: "x=34", section after "?" + const std::string& escapedQuery() const { return mEscapedQuery; } + LLSD queryMap() const; // above decoded into a map + static LLSD queryMap(std::string escaped_query_string); /** * @brief given a name value map, return a serialized query string. diff --git a/indra/llinventory/llfoldertype.h b/indra/llinventory/llfoldertype.h index e3be00384a00b9ff546ebc8e8769a12069380343..79d11146828585c0287a7d0230a3874826fbbab7 100644 --- a/indra/llinventory/llfoldertype.h +++ b/indra/llinventory/llfoldertype.h @@ -93,11 +93,12 @@ class LLFolderType FT_SETTINGS = 56, + FT_ANIM_OVERRIDES = 57, + FT_TOXIC = 58, + FT_RLV = 59, + FT_SUITCASE = 100, - FT_ANIM_OVERRIDES, - FT_TOXIC, - FT_RLV, FT_COUNT, diff --git a/indra/newview/llagent.cpp b/indra/newview/llagent.cpp index f2fa426282aec78827585ce02efe661cda02552f..181d0627e18c5d9e7785b14541b4dc5ef528790a 100644 --- a/indra/newview/llagent.cpp +++ b/indra/newview/llagent.cpp @@ -2585,9 +2585,24 @@ void LLAgent::setStartPosition( U32 location_id ) body["HomeLocation"] = homeLocation; - if (!requestPostCapability("HomeLocation", body, - boost::bind(&LLAgent::setStartPositionSuccess, this, _1))) - LL_WARNS() << "Unable to post to HomeLocation capability." << LL_ENDL; + if (!requestPostCapability("HomeLocation", body, + boost::bind(&LLAgent::setStartPositionSuccess, this, _1))) + { + LLMessageSystem* msg = gMessageSystem; + msg->newMessageFast(_PREHASH_SetStartLocationRequest); + msg->nextBlockFast(_PREHASH_AgentData); + msg->addUUIDFast(_PREHASH_AgentID, gAgentID); + msg->addUUIDFast(_PREHASH_SessionID, gAgentSessionID); + msg->nextBlockFast(_PREHASH_StartLocationData); + // corrected by sim + msg->addStringFast(_PREHASH_SimName, ""); + msg->addU32Fast(_PREHASH_LocationID, homeLocation["LocationId"].asInteger()); + msg->addVector3Fast(_PREHASH_LocationPos, + ll_vector3_from_sdmap(homeLocation["LocationPos"])); + msg->addVector3Fast(_PREHASH_LocationLookAt, + ll_vector3_from_sdmap(homeLocation["LocationLookAt"])); + gAgent.sendReliableMessage(); + } const U32 HOME_INDEX = 1; if( HOME_INDEX == location_id ) diff --git a/indra/newview/llavataractions.cpp b/indra/newview/llavataractions.cpp index 4435180488aec871f7a191409dfc42996674cd0f..38cb70781b1708ab710104c77e3f6546335900aa 100644 --- a/indra/newview/llavataractions.cpp +++ b/indra/newview/llavataractions.cpp @@ -1526,7 +1526,7 @@ bool LLAvatarActions::canBlock(const LLUUID& id) LLAvatarNameCache::get(id, &av_name); std::string full_name = av_name.getUserName(); - bool is_linden = (full_name.find("Linden") != std::string::npos); + bool is_linden = LLMuteList::isLinden(full_name); bool is_self = id == gAgentID; return !is_self && !is_linden; } diff --git a/indra/newview/llfloatertos.cpp b/indra/newview/llfloatertos.cpp index 0ec0b62cb7c383f91648004d32bf4a5303f34f3c..857f5adc3441fdce9b6f206c865078367d56ea90 100644 --- a/indra/newview/llfloatertos.cpp +++ b/indra/newview/llfloatertos.cpp @@ -29,6 +29,7 @@ #include "llfloatertos.h" // viewer includes +#include "llviewernetwork.h" #include "llviewerstats.h" #include "llviewerwindow.h" @@ -45,6 +46,9 @@ #include "llcorehttputil.h" #include "llfloaterreg.h" +// system includes +#include <boost/regex.hpp> + LLFloaterTOS::LLFloaterTOS(const LLSD& data) : LLModalDialog( data["message"].asString() ), mMessage(data["message"].asString()), @@ -80,7 +84,27 @@ BOOL LLFloaterTOS::postBuild() editor->setVisible( FALSE ); LLMediaCtrl* web_browser = getChild<LLMediaCtrl>("tos_html"); - if ( web_browser ) + + bool use_web_browser = false; + if (LLGridManager::getInstance()->isInOpenSim()) + { + //Check to see if the message is a link to display + const boost::regex url_regex("https?://([^\\s/?\\.#]+\\.?)+\\.\\w+(:\\d+)?(/\\S*)?", + boost::regex::perl | boost::regex::icase); + + //IF it has http:// in it, we use the web browser + if(mMessage.size() >= 4 && boost::regex_match(mMessage, url_regex)) + { + // it exists + use_web_browser = true; + } + } + else + { + use_web_browser = true; + } + + if (web_browser && use_web_browser) { // if we are forced to send users to an external site in their system browser // (e.g.) Linux users because of lack of media support for HTML ToS page @@ -98,17 +122,44 @@ BOOL LLFloaterTOS::postBuild() #else web_browser->addObserver(this); - // Don't use the start_url parameter for this browser instance -- it may finish loading before we get to add our observer. - // Store the URL separately and navigate here instead. - web_browser->navigateTo( getString( "loading_url" ) ); - LLPluginClassMedia* media_plugin = web_browser->getMediaPlugin(); - if (media_plugin) + if (LLGridManager::getInstance()->isInOpenSim()) { - // All links from tos_html should be opened in external browser - media_plugin->setOverrideClickTarget("_external"); + mRealNavigateBegun = true; + updateAgreeEnabled(true); + web_browser->navigateTo(mMessage); + } + else + { + // Don't use the start_url parameter for this browser instance -- it may finish loading before we get to add our observer. + // Store the URL separately and navigate here instead. + web_browser->navigateTo( getString( "loading_url" ) ); + LLPluginClassMedia* media_plugin = web_browser->getMediaPlugin(); + if (media_plugin) + { + // All links from tos_html should be opened in external browser + media_plugin->setOverrideClickTarget("_external"); + } } #endif } + else if (LLGridManager::getInstance()->isInOpenSim()) + { + std::string showTos = "data:text/html,%3Chtml%3E%3Chead%3E" + "%3Cstyle%3E%0A" + "body%20%7B%0A" + "background-color%3Argb%2831%2C%2031%2C%2031%29%3B%0A" + "margin%3A5px%2020px%205px%2030px%3B%0A" + "padding%3A0%3B%0A%7D%0A" + "pre%20%7B%0Afont-size%3A12px%3B%0A" + "font-family%3A%22Deja%20Vu%20Sans%22%2C%20Helvetica%2C%20Arial%2C%20sans-serif%3B%0A" + "color%3A%23fff%3B%0A%7D%0A" + "%3C/style%3E" + "%3C/head%3E%3Cbody%3E%3Cpre%3E" + mMessage + "%3C/pre%3E%3C/body%3E%3C/html%3E"; + + mRealNavigateBegun = true; + updateAgreeEnabled(true); + web_browser->navigateTo(showTos); + } return TRUE; } diff --git a/indra/newview/llfloaterworldmap.cpp b/indra/newview/llfloaterworldmap.cpp index 38f2867c2b81f9030d7cb62c69d5cb6adde2427d..0398c142a9cf616779612fb9626ef0f973b6e7fe 100644 --- a/indra/newview/llfloaterworldmap.cpp +++ b/indra/newview/llfloaterworldmap.cpp @@ -669,8 +669,10 @@ void LLFloaterWorldMap::trackLocation(const LLVector3d& pos_global) } std::string sim_name = sim_info->getName(); - F32 region_x = (F32)fmod( pos_global.mdV[VX], (F64)REGION_WIDTH_METERS ); - F32 region_y = (F32)fmod( pos_global.mdV[VY], (F64)REGION_WIDTH_METERS ); + U32 locX, locY; + from_region_handle(sim_info->getHandle(), &locX, &locY); + F32 region_x = pos_global.mdV[VX] - locX; + F32 region_y = pos_global.mdV[VY] - locY; std::string full_name = llformat("%s (%d, %d, %d)", sim_name.c_str(), ll_round(region_x), @@ -722,17 +724,32 @@ void LLFloaterWorldMap::enableTeleportCoordsDisplay( bool enabled ) void LLFloaterWorldMap::updateTeleportCoordsDisplay( const LLVector3d& pos ) { // if we're going to update their value, we should also enable them - enableTeleportCoordsDisplay( true ); - + enableTeleportCoordsDisplay(true); + // convert global specified position to a local one - F32 region_local_x = (F32)fmod( pos.mdV[VX], (F64)REGION_WIDTH_METERS ); - F32 region_local_y = (F32)fmod( pos.mdV[VY], (F64)REGION_WIDTH_METERS ); - F32 region_local_z = (F32)llclamp( pos.mdV[VZ], 0.0, (F64)REGION_HEIGHT_METERS ); + F32 region_local_x; + F32 region_local_y; + F32 region_local_z; + LLSimInfo* sim_info = LLWorldMap::getInstanceFast()->simInfoFromPosGlobal(pos); + if (sim_info) + { + U32 locX, locY; + from_region_handle(sim_info->getHandle(), &locX, &locY); + region_local_x = pos.mdV[VX] - locX; + region_local_y = pos.mdV[VY] - locY; + region_local_z = (F32)pos.mdV[VZ]; + } + else + { + region_local_x = (F32)fmod(pos.mdV[VX], (F64)REGION_WIDTH_METERS); + region_local_y = (F32)fmod(pos.mdV[VY], (F64)REGION_WIDTH_METERS); + region_local_z = (F32)llclamp(pos.mdV[VZ], 0.0, (F64)REGION_HEIGHT_METERS); + } // write in the values - childSetValue("teleport_coordinate_x", region_local_x ); - childSetValue("teleport_coordinate_y", region_local_y ); - childSetValue("teleport_coordinate_z", region_local_z ); + childSetValue("teleport_coordinate_x", region_local_x); + childSetValue("teleport_coordinate_y", region_local_y); + childSetValue("teleport_coordinate_z", region_local_z); } void LLFloaterWorldMap::updateLocation() diff --git a/indra/newview/llinventorypanel.cpp b/indra/newview/llinventorypanel.cpp index a3916d7da6fe8e0dea7b74abd36f1efe62f761f9..640d66a3a01205148156505980cbe4b7c97af2b7 100644 --- a/indra/newview/llinventorypanel.cpp +++ b/indra/newview/llinventorypanel.cpp @@ -2003,5 +2003,6 @@ namespace LLInitParam declare(LLFolderType::lookup(LLFolderType::FT_MARKETPLACE_LISTINGS) , LLFolderType::FT_MARKETPLACE_LISTINGS); declare(LLFolderType::lookup(LLFolderType::FT_MARKETPLACE_STOCK), LLFolderType::FT_MARKETPLACE_STOCK); declare(LLFolderType::lookup(LLFolderType::FT_MARKETPLACE_VERSION), LLFolderType::FT_MARKETPLACE_VERSION); + declare(LLFolderType::lookup(LLFolderType::FT_SUITCASE), LLFolderType::FT_SUITCASE); } } diff --git a/indra/newview/llmanip.cpp b/indra/newview/llmanip.cpp index b0858ffd6c62869cafaea1ff259072108fa48db9..233e74206cdf499eec621645b8082af36eee9bf7 100644 --- a/indra/newview/llmanip.cpp +++ b/indra/newview/llmanip.cpp @@ -47,6 +47,7 @@ #include "llviewercamera.h" #include "llviewerjoint.h" #include "llviewerobject.h" +#include "llviewerregion.h" // getRegion() #include "llviewerwindow.h" #include "llvoavatar.h" #include "llworld.h" // for LLWorld::getInstance() @@ -395,7 +396,7 @@ void LLManip::renderGuidelines(BOOL draw_x, BOOL draw_y, BOOL draw_z) grid_rot.getAngleAxis(&angle_radians, &x, &y, &z); gGL.rotatef(angle_radians * RAD_TO_DEG, x, y, z); - F32 region_size = LLWorld::getInstanceFast()->getRegionWidthInMeters(); + F32 region_size = object->getRegion()->getWidth(); const F32 LINE_ALPHA = 0.33f; diff --git a/indra/newview/llmutelist.cpp b/indra/newview/llmutelist.cpp index fb7bf7c2146be9c8a8627d70628b34caf29bd174..dbf4a3e5130e74abd482b5573b5d895decc5bc2d 100644 --- a/indra/newview/llmutelist.cpp +++ b/indra/newview/llmutelist.cpp @@ -60,7 +60,10 @@ #include "llimview.h" #include "llnotifications.h" #include "llviewercontrol.h" +#include "llviewernetwork.h" #include "llviewerobjectlist.h" +#include "llviewerregion.h" +#include "llvoavatar.h" #include "lltrans.h" namespace @@ -192,6 +195,15 @@ void LLMuteList::cleanupSingleton() LLAvatarNameCache::getInstance()->setAccountNameChangedCallback(NULL); } +// static +BOOL LLMuteList::isLinden(const LLUUID& id) +{ + std::string name; + gCacheName->getFullName(id, name); + return isLinden(name); +} + +// static BOOL LLMuteList::isLinden(const std::string& name) { std::string username = boost::replace_all_copy(name, ".", " "); @@ -201,12 +213,25 @@ BOOL LLMuteList::isLinden(const std::string& name) tokenizer::iterator token_iter = tokens.begin(); if (token_iter == tokens.end()) return FALSE; - token_iter++; + ++token_iter; if (token_iter == tokens.end()) return FALSE; std::string last_name = *token_iter; - LLStringUtil::toLower(last_name); - return last_name == "linden"; + if (LLGridManager::getInstance()->isInSecondlife()) + { + // Simple! + return last_name == "Linden" || last_name == "ProductEngine"; + } + else if (LLGridManager::getInstance()->isInOpenSim()) + { + LLViewerRegion* region = gAgent.getRegion(); + if (!region) return FALSE; + const auto& gods = region->getGods(); + if (gods.empty()) return FALSE; + + return (gods.find(name) != gods.cend() || gods.find(last_name) != gods.cend()); + } + return FALSE; } static LLVOAvatar* find_avatar(const LLUUID& id) @@ -432,6 +457,7 @@ BOOL LLMuteList::remove(const LLMute& mute, U32 flags) // Must be after erase. notifyObservers(); notifyObserversDetailed(localmute); + found = TRUE; } else { @@ -446,6 +472,7 @@ BOOL LLMuteList::remove(const LLMute& mute, U32 flags) // Must be after erase. notifyObservers(); notifyObserversDetailed(mute); + found = TRUE; } } @@ -665,9 +692,16 @@ BOOL LLMuteList::saveToFile(const std::string& filename) BOOL LLMuteList::isMuted(const LLUUID& id, const std::string& name, U32 flags) const { + if (mMutes.empty() && mLegacyMutes.empty()) + return FALSE; + // for objects, check for muting on their parent prim LLViewerObject* mute_object = get_object_to_mute_from_id(id); LLUUID id_to_check = (mute_object) ? mute_object->getID() : id; + if (id_to_check == gAgentID) + { + return FALSE; + } // don't need name or type for lookup LLMute mute(id_to_check); @@ -683,8 +717,7 @@ BOOL LLMuteList::isMuted(const LLUUID& id, const std::string& name, U32 flags) c } // empty names can't be legacy-muted - bool avatar = mute_object && mute_object->isAvatar(); - if (name.empty() || avatar) return FALSE; + if (name.empty()) return FALSE; // Look in legacy pile string_set_t::const_iterator legacy_it = mLegacyMutes.find(name); diff --git a/indra/newview/llmutelist.h b/indra/newview/llmutelist.h index 32b45a836f897cb7d709fa88321ef356a830ee99..234a2aa28ee838fc4999487b7727c57fa840a95c 100644 --- a/indra/newview/llmutelist.h +++ b/indra/newview/llmutelist.h @@ -104,6 +104,7 @@ class LLMuteList final : public LLSingleton<LLMuteList> // Alternate (convenience) form for places we don't need to pass the name, but do need flags BOOL isMuted(const LLUUID& id, U32 flags) const { return isMuted(id, LLStringUtil::null, flags); }; + static BOOL isLinden(const LLUUID& id); static BOOL isLinden(const std::string& name); BOOL isLoaded() const { return mIsLoaded; } diff --git a/indra/newview/llpathfindingmanager.cpp b/indra/newview/llpathfindingmanager.cpp index 792dcf3a993c34a4a7ebd767f88af702df6b80c4..8623c1ba61c08e7edbe66dd8292ecbea2ec6214f 100644 --- a/indra/newview/llpathfindingmanager.cpp +++ b/indra/newview/llpathfindingmanager.cpp @@ -183,8 +183,10 @@ bool LLPathfindingManager::isPathfindingEnabledForCurrentRegion() const bool LLPathfindingManager::isPathfindingEnabledForRegion(LLViewerRegion *pRegion) const { - std::string retrieveNavMeshURL = getRetrieveNavMeshURLForRegion(pRegion); - return !retrieveNavMeshURL.empty(); + if (pRegion) + return pRegion->isCapabilityAvailable(CAP_SERVICE_RETRIEVE_NAVMESH); + + return false; } bool LLPathfindingManager::isAllowViewTerrainProperties() const diff --git a/indra/newview/llviewermenu.cpp b/indra/newview/llviewermenu.cpp index 9b8525449696d910732d6eb0846244b78d8e2397..ecea26ced3e65db4140953d716af3d1f994f7ece 100644 --- a/indra/newview/llviewermenu.cpp +++ b/indra/newview/llviewermenu.cpp @@ -3224,8 +3224,7 @@ bool enable_object_mute() { // It's an avatar LLNameValue *lastname = avatar->getNVPair("LastName"); - bool is_linden = - lastname && !LLStringUtil::compareStrings(lastname->getString(), "Linden"); + bool is_linden = LLMuteList::isLinden(avatar->getFullname()); bool is_self = avatar->isSelf(); // return !is_linden && !is_self; // [RLVa:KB] - Checked: RLVa-1.2.1 @@ -3251,8 +3250,7 @@ bool enable_object_unmute() { // It's an avatar LLNameValue *lastname = avatar->getNVPair("LastName"); - bool is_linden = - lastname && !LLStringUtil::compareStrings(lastname->getString(), "Linden"); + bool is_linden = LLMuteList::isLinden(avatar->getFullname()); bool is_self = avatar->isSelf(); return !is_linden && !is_self; } diff --git a/indra/newview/llviewerregion.cpp b/indra/newview/llviewerregion.cpp index 2bb8001537a1888210fa16f42b21ace7919e3afe..2d1baf690f9d509e4de929385bc5aa56f28cbf62 100644 --- a/indra/newview/llviewerregion.cpp +++ b/indra/newview/llviewerregion.cpp @@ -1882,7 +1882,7 @@ F32 LLViewerRegion::getCompositionXY(const S32 x, const S32 y) const } else { - LLVector3d center = getCenterGlobal() + LLVector3d(mWidth, 0, 0.f); + LLVector3d center = getCenterGlobal() + LLVector3d(mWidth, 0.f, 0.f); LLViewerRegion *regionp = LLWorld::getInstanceFast()->getRegionFromPosGlobal(center); if (regionp) {