diff --git a/indra/newview/llagentui.cpp b/indra/newview/llagentui.cpp index bbbe354f6af4dcb8dcc4df5fbbe0eeea636438ee..97f7a107e7d04eba99f72fef05a3eb6cff47492c 100755 --- a/indra/newview/llagentui.cpp +++ b/indra/newview/llagentui.cpp @@ -50,16 +50,16 @@ void LLAgentUI::buildFullname(std::string& name) //static void LLAgentUI::buildSLURL(LLSLURL& slurl, const bool escaped /*= true*/) { - LLSLURL return_slurl; - LLViewerRegion *regionp = gAgent.getRegion(); - if (regionp) - { - LLVector3d pos_global = gAgent.getPositionGlobal(); - const LLSimInfo* sim = LLWorldMap::getInstance()->simInfoFromPosGlobal(pos_global); - pos_global[0] = fmod(pos_global[0], sim ? sim->getSizeX() : 256); - pos_global[1] = fmod(pos_global[1], sim ? sim->getSizeY() : 256); - return_slurl = LLSLURL(regionp->getName(), pos_global); - } + LLSLURL return_slurl; + LLViewerRegion *regionp = gAgent.getRegion(); + if (regionp) + { + LLVector3d pos_global = gAgent.getPositionGlobal(); + const LLSimInfo* sim = LLWorldMap::getInstance()->simInfoFromPosGlobal(pos_global); + pos_global[0] = fmod(pos_global[0], sim ? sim->getSizeX() : 256); + pos_global[1] = fmod(pos_global[1], sim ? sim->getSizeY() : 256); + return_slurl = LLSLURL(regionp->getHGGrid(), regionp->getName(), pos_global); + } slurl = return_slurl; } diff --git a/indra/newview/llfloaterpreference.cpp b/indra/newview/llfloaterpreference.cpp index ed7f508eeade8ae5297738d727cb92c957782ffb..9916f6064571f0ed699b71888003f9cee3f65c2f 100755 --- a/indra/newview/llfloaterpreference.cpp +++ b/indra/newview/llfloaterpreference.cpp @@ -378,6 +378,7 @@ LLFloaterPreference::LLFloaterPreference(const LLSD& key) mCommitCallbackRegistrar.add("Pref.ResetToDefault", boost::bind(&LLFloaterPreference::onClickResetControlDefault, this, _2)); // <alchemy/> mCommitCallbackRegistrar.add("Pref.AddGrid", boost::bind(&LLFloaterPreference::onClickAddGrid, this)); mCommitCallbackRegistrar.add("Pref.RemoveGrid", boost::bind(&LLFloaterPreference::onClickRemoveGrid, this)); + mCommitCallbackRegistrar.add("Pref.RefreshGrid", boost::bind(&LLFloaterPreference::onClickRefreshGrid, this)); mCommitCallbackRegistrar.add("Pref.SelectGrid", boost::bind(&LLFloaterPreference::onSelectGrid, this, _2)); } diff --git a/indra/newview/llnavigationbar.cpp b/indra/newview/llnavigationbar.cpp index 6d0f6cd6b14dcd1557f76ad64b5a58296f18a106..f7f8c3bec760dbe32da532fa309b06d0a55fa7da 100755 --- a/indra/newview/llnavigationbar.cpp +++ b/indra/newview/llnavigationbar.cpp @@ -42,6 +42,7 @@ #include "lllandmarkactions.h" #include "lllocationhistory.h" #include "lllocationinputctrl.h" +#include "llnotificationsutil.h" #include "llpaneltopinfobar.h" #include "llteleporthistory.h" #include "llsearchcombobox.h" @@ -54,6 +55,7 @@ #include "llworldmapmessage.h" #include "llappviewer.h" #include "llviewercontrol.h" +#include "llviewernetwork.h" #include "llweb.h" #include "llhints.h" @@ -473,25 +475,32 @@ void LLNavigationBar::onLocationSelection() // </alchemy> else if(!slurl.isValid()) { - // we have to do this check after previous, because LLUrlRegistry contains handlers for slurl too - // but we need to know whether typed_location is a simple http url. - if (LLUrlRegistry::instance().isUrl(typed_location)) - { - // display http:// URLs in the media browser, or - // anything else is sent to the search floater - LLWeb::loadURL(typed_location); - return; - } - else - { - // assume that an user has typed the {region name} or possible {region_name, parcel} - region_name = typed_location.substr(0,typed_location.find(',')); - } + // we have to do this check after previous, because LLUrlRegistry contains handlers for slurl too + // but we need to know whether typed_location is a simple http url. + if (LLUrlRegistry::instance().isUrl(typed_location)) + { + // display http:// URLs in the media browser, or + // anything else is sent to the search floater + LLWeb::loadURL(typed_location); + return; + } + else + { + // assume that an user has typed the {region name} or possible {region_name, parcel} + region_name = typed_location.substr(0,typed_location.find(',')); + } } else { - // was an app slurl, home, whatever. Bail // <alchemy/> - We support app slurls here now. - return; + // was an app slurl, home, whatever. Bail // <alchemy/> - We support app slurls here now. + return; + } + + const std::string& grid = slurl.getGrid(); + const std::string& current_grid = LLGridManager::getInstance()->getGrid(); + if (grid != current_grid) + { + region_name.insert(0, llformat("%s:", grid.c_str())); } // Resolve the region name to its global coordinates. diff --git a/indra/newview/llslurl.cpp b/indra/newview/llslurl.cpp index 464cc1a1745843dbdd686118abe32466bb6a6633..4a59d5f09ffddca9ce8e99fe66717f989c7157a0 100755 --- a/indra/newview/llslurl.cpp +++ b/indra/newview/llslurl.cpp @@ -33,7 +33,7 @@ #include "llviewercontrol.h" #include "llviewernetwork.h" #include "llfiltersd2xmlrpc.h" -#include "curl/curl.h" + const char* LLSLURL::SLURL_HTTP_SCHEME = "http"; const char* LLSLURL::SLURL_HTTPS_SCHEME = "https"; const char* LLSLURL::SLURL_SECONDLIFE_SCHEME = "secondlife"; @@ -184,28 +184,15 @@ LLSLURL::LLSLURL(const std::string& slurl) (slurl_uri.scheme() == LLSLURL::SLURL_X_GRID_LOCATION_INFO_SCHEME)) { // We're dealing with either a Standalone style slurl or slurl.com slurl - if ((slurl_uri.hostName() == LLSLURL::SLURL_COM) || - (slurl_uri.hostName() == LLSLURL::WWW_SLURL_COM) || - (slurl_uri.hostName() == LLSLURL::MAPS_SECONDLIFE_COM)) + if ((slurl_uri.hostName() == LLSLURL::SLURL_COM) || + (slurl_uri.hostName() == LLSLURL::WWW_SLURL_COM) || + (slurl_uri.hostName() == LLSLURL::MAPS_SECONDLIFE_COM)) { // slurl.com implies maingrid mGrid = MAINGRID; } else { - // Don't try to match any old http://<host>/ URL as a SLurl. - // SLE SLurls will have the grid hostname in the URL, so only - // match http URLs if the hostname matches the grid hostname - // (or its a slurl.com or maps.secondlife.com URL). - - if ((slurl_uri.scheme() == LLSLURL::SLURL_HTTP_SCHEME || - slurl_uri.scheme() == LLSLURL::SLURL_HTTPS_SCHEME) && - (slurl_uri.hostName() != LLGridManager::getInstance()->getGrid() && - slurl_uri.hostNameAndPort() != LLGridManager::getInstance()->getGrid())) - { - return; - } - // As it's a Standalone grid/open, we will always have a hostname, as Standalone/open style // urls are properly formed, unlike the stinky maingrid style mGrid = slurl_uri.hostNameAndPort(); @@ -346,7 +333,7 @@ LLSLURL::LLSLURL(const std::string& grid, const std::string& region, const LLVector3d& global_position) { - *this = LLSLURL(LLGridManager::getInstance()->getGridId(grid), + *this = LLSLURL(LLGridManager::getInstance()->getGridByProbing(grid), region, LLVector3(global_position.mdV[VX], global_position.mdV[VY], global_position.mdV[VZ])); diff --git a/indra/newview/llurldispatcher.cpp b/indra/newview/llurldispatcher.cpp index 78268944fc0aa28b1c580f006a4fd94e81bcae82..3e5b4b75e2034d2e6a671bdce1ea363ddf77ed66 100755 --- a/indra/newview/llurldispatcher.cpp +++ b/indra/newview/llurldispatcher.cpp @@ -182,11 +182,18 @@ bool LLURLDispatcherImpl::dispatchRegion(const LLSLURL& slurl, const std::string LLPanelLogin::setLocation(slurl); return true; } + LLSLURL _slurl = slurl; + const std::string& grid = slurl.getGrid(); + const std::string& current_grid = LLGridManager::getInstance()->getGrid(); + if (grid != current_grid) + { + _slurl = LLSLURL(llformat("%s:%s", grid.c_str(), slurl.getRegion().c_str()), slurl.getPosition()); + } // Request a region handle by name LLWorldMapMessage::getInstance()->sendNamedRegionRequest(slurl.getRegion(), LLURLDispatcherImpl::regionNameCallback, - slurl.getSLURLString(), + _slurl.getSLURLString(), LLUI::sSettingGroups["config"]->getBOOL("SLURLTeleportDirectly")); // don't teleport return true; } diff --git a/indra/newview/llviewernetwork.cpp b/indra/newview/llviewernetwork.cpp index 45b4ee8465b1bb4c32f2cae58a1227e08d2a7607..5dbbb80a06261e2363af93e008838af05fcbdec3 100755 --- a/indra/newview/llviewernetwork.cpp +++ b/indra/newview/llviewernetwork.cpp @@ -54,8 +54,6 @@ const std::string GRID_HELPER_URI_VALUE = "helper_uri"; const std::string GRID_LOGIN_PAGE_VALUE = "login_page"; /// internal data on system grids const std::string GRID_IS_SYSTEM_GRID_VALUE = "system_grid"; -/// internal data on hypergrid -const std::string GRID_IS_HYPERGRID_VALUE = "hypergrid"; /// whether this is single or double names const std::string GRID_LOGIN_IDENTIFIER_TYPES = "login_identifier_types"; /// the url for registering a new account for the given grid @@ -618,6 +616,9 @@ std::map<std::string, std::string> LLGridManager::getKnownGrids() const grid_iter != mGridList.endMap(); grid_iter++) { + // skip temp grids. since this is just for "grid label mappings for UI purposes" + if (grid_iter->second.has(GRID_TEMPORARY) && grid_iter->second[GRID_TEMPORARY].asBoolean()) + continue; result[grid_iter->first] = grid_iter->second[GRID_LABEL_VALUE].asString(); } @@ -678,12 +679,12 @@ std::string LLGridManager::getGrid(const std::string& grid) const std::string LLGridManager::getGridByProbing(const std::string& identifier) const { std::string grid = LLStringUtil::null; + grid = getGridByAttribute(GRID_GATEKEEPER, identifier); + if (!grid.empty()) return grid; grid = getGridByAttribute(GRID_VALUE, identifier); if (!grid.empty()) return grid; grid = getGridByAttribute(GRID_ID_VALUE, identifier); if (!grid.empty()) return grid; - grid = getGridByAttribute(GRID_GATEKEEPER, identifier); - if (!grid.empty()) return grid; return grid; } @@ -960,15 +961,6 @@ bool LLGridManager::isSystemGrid(const std::string& grid) const ); } -bool LLGridManager::isHypergrid(const std::string& grid) const -{ - std::string grid_name = getGrid(grid); - return (!grid_name.empty() - && mGridList.has(grid) - && mGridList[grid].has(GRID_IS_HYPERGRID_VALUE) - && mGridList[grid][GRID_IS_HYPERGRID_VALUE].asBoolean()); -} - // build a slurl for the given region within the selected grid std::string LLGridManager::getSLURLBase(const std::string& grid) const { diff --git a/indra/newview/llviewernetwork.h b/indra/newview/llviewernetwork.h index 67fce50ca571fa163d4e76cde3c21a5f5d1f6043..63f24af782b8af1417bf974e7f5c87d674c54560 100755 --- a/indra/newview/llviewernetwork.h +++ b/indra/newview/llviewernetwork.h @@ -225,9 +225,6 @@ class LLGridManager : public LLSingleton<LLGridManager> /// Is the selected grid one of the hard-coded default grids (Agni or Aditi) bool isSystemGrid() const { return isSystemGrid(mGrid); } - /// Is the selected grid Hypergrid fetched? - bool isHypergrid(const std::string& grid) const; - /// Is the selected grid Second Life? bool isInSecondlife() const; diff --git a/indra/newview/llviewerregion.cpp b/indra/newview/llviewerregion.cpp index 5fb3ad6ca892ac77460b56576383d3a0c6a25870..e0612e22f76beb8c70fd42221a448849419cfded 100755 --- a/indra/newview/llviewerregion.cpp +++ b/indra/newview/llviewerregion.cpp @@ -2138,10 +2138,17 @@ void LLViewerRegion::setSimulatorFeatures(const LLSD& sim_features) LL_INFOS() << str.str() << LL_ENDL; mSimulatorFeatures = sim_features; if (LLGridManager::getInstance()->isInOpenSim()) + { setGodnames(); - + if (mSimulatorFeatures.has("OpenSimExtras") + && mSimulatorFeatures["OpenSimExtras"].has("GridURL")) + { + const std::string& grid_url = mSimulatorFeatures["OpenSimExtras"]["GridURL"].asString(); + if (LLGridManager::getInstance()->getGrid(grid_url).empty()) + LLGridManager::getInstance()->addRemoteGrid(grid_url, false); + } + } setSimulatorFeaturesReceived(true); - } //this is called when the parent is not cacheable. @@ -2838,6 +2845,7 @@ void LLViewerRegionImpl::buildCapabilityNames(LLSD& capabilityNames) capabilityNames.append("ObjectMedia"); capabilityNames.append("ObjectMediaNavigate"); capabilityNames.append("ObjectNavMeshProperties"); + capabilityNames.append("OpenSimExtras"); capabilityNames.append("ParcelPropertiesUpdate"); capabilityNames.append("ParcelVoiceInfoRequest"); capabilityNames.append("ProductInfoRequest"); @@ -3343,24 +3351,23 @@ std::string LLViewerRegion::getSearchServerURL() const return url; } -std::string LLViewerRegion::getGridURL() const +std::string LLViewerRegion::getHGGrid() const { - std::string url; + std::string authority = LLStringUtil::null; if (mSimulatorFeatures.has("OpenSimExtras") && mSimulatorFeatures["OpenSimExtras"].has("GridURL")) { - url = mSimulatorFeatures["OpenSimExtras"]["GridURL"].asString(); + const std::string& url = mSimulatorFeatures["OpenSimExtras"]["GridURL"].asString(); + authority = LLURI(url).authority(); } else { - std::vector<std::string> uris; - LLGridManager::getInstance()->getLoginURIs(uris); - url = uris.front(); + authority = LLGridManager::getInstance()->getGrid(); } - return url; + return authority; } -std::string LLViewerRegion::getGridName() const +std::string LLViewerRegion::getHGGridName() const { std::string name; if (mSimulatorFeatures.has("OpenSimExtras") diff --git a/indra/newview/llviewerregion.h b/indra/newview/llviewerregion.h index 2dfc6c9b625bfe346331e506bdf11b162f776dfc..95ef7ef472b49cc97076e0c04bb19dc118e7d76d 100755 --- a/indra/newview/llviewerregion.h +++ b/indra/newview/llviewerregion.h @@ -402,10 +402,10 @@ public: std::string getMapServerURL() const; /// Hypergrid search server url std::string getSearchServerURL() const; - /// Grid login/gateway uri (for generating slurls (0.8.1) - std::string getGridURL() const; + /// Grid login/gateway authority (0.8.1) + std::string getHGGrid() const; /// Grid name (0.8.1) - std::string getGridName() const; + std::string getHGGridName() const; /// "God names" surname and full account names map std::set<std::string> getGods() const { return mGodNames; }; //@}