From 4bf29ac9747d22ea9250c2f6cbe78779a024f230 Mon Sep 17 00:00:00 2001 From: Beq Date: Fri, 6 Nov 2020 00:35:59 +0000 Subject: [PATCH] FIRE-10549 etc. part one of a potentially larger change to come later This fixes the hop grid name issue. The expectation is that an HG grid has a valid GridURL parameter in the OpenSim extras, if not the home grid will be used as normal. Extensions to this such as map copy slurl, and other places may follow in a future release but require more investigation. --- indra/newview/lfsimfeaturehandler.cpp | 14 ++++++++++++++ indra/newview/lfsimfeaturehandler.h | 2 ++ indra/newview/llagentui.cpp | 24 +++++++++++++++++------- 3 files changed, 33 insertions(+), 7 deletions(-) diff --git a/indra/newview/lfsimfeaturehandler.cpp b/indra/newview/lfsimfeaturehandler.cpp index 735aaca03f..a8eb3d5b60 100644 --- a/indra/newview/lfsimfeaturehandler.cpp +++ b/indra/newview/lfsimfeaturehandler.cpp @@ -104,6 +104,20 @@ void LFSimFeatureHandler::setSupportedFeatures() mShoutRange = extras.has("shout-range") ? extras["shout-range"].asInteger() : 100; mWhisperRange = extras.has("whisper-range") ? extras["whisper-range"].asInteger() : 10; + if(extras.has("GridURL")) + { + mGridURL = extras["GridURL"].asString(); + auto pos = mGridURL.find("://"); + if( pos != std::string::npos) + { + mGridURL = mGridURL.substr(pos+3,mGridURL.size()-(pos+3)); + } + } + else + { + mGridURL = LLGridManager::instance().getGridId(); + } + if (extras.has("SimulatorFPS") && extras.has("SimulatorFPSFactor") && extras.has("SimulatorFPSWarnPercent") && extras.has("SimulatorFPSCritPercent")) { diff --git a/indra/newview/lfsimfeaturehandler.h b/indra/newview/lfsimfeaturehandler.h index 06096ab9d6..9a348857e2 100644 --- a/indra/newview/lfsimfeaturehandler.h +++ b/indra/newview/lfsimfeaturehandler.h @@ -88,6 +88,7 @@ public: // Accessors bool simSupportsExport() const { return mSupportsExport; } std::string mapServerURL() const { return mMapServerURL; } + std::string gridURL() const { return mGridURL; } std::string searchURL() const { return mSearchURL; } U32 sayRange() const { return mSayRange; } U32 shoutRange() const { return mShoutRange; } @@ -113,6 +114,7 @@ private: // SignaledTypes SignaledType mSupportsExport; std::string mMapServerURL; + std::string mGridURL; SignaledType mSearchURL; SignaledType mSayRange; SignaledType mShoutRange; diff --git a/indra/newview/llagentui.cpp b/indra/newview/llagentui.cpp index a27ae92ba4..c1884ec800 100644 --- a/indra/newview/llagentui.cpp +++ b/indra/newview/llagentui.cpp @@ -44,6 +44,10 @@ // FIRE-1874: Show server channel in statusbar #include "llappviewer.h" +// FIRE-10549 etc, incorrect grid URL on HG back links +#include "fsgridhandler.h" +#include "lfsimfeaturehandler.h" +// //static void LLAgentUI::buildFullname(std::string& name) @@ -55,15 +59,21 @@ 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) - { + LLSLURL return_slurl; + LLViewerRegion *regionp = gAgent.getRegion(); + if (regionp) + { // Aurora-sim var region teleports - //return_slurl = LLSLURL(regionp->getName(), gAgent.getPositionGlobal()); - return_slurl = LLSLURL(regionp->getName(), gAgent.getPositionAgent()); +#ifdef OPENSIM + if(LLGridManager::instance().isInOpenSim()) + { + return_slurl = LLSLURL(LFSimFeatureHandler::getInstance()->gridURL(), regionp->getName(), gAgent.getPositionAgent()); + } +#else + return_slurl = LLSLURL(regionp->getName(), gAgent.getPositionGlobal()); +#endif // - } + } slurl = return_slurl; }