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.
meow-7.2.2
Beq 2020-11-06 00:35:59 +00:00
parent b96eaf544c
commit 4bf29ac974
3 changed files with 33 additions and 7 deletions

View File

@ -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"))
{

View File

@ -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<bool> mSupportsExport;
std::string mMapServerURL;
std::string mGridURL;
SignaledType<std::string> mSearchURL;
SignaledType<U32> mSayRange;
SignaledType<U32> mShoutRange;

View File

@ -44,6 +44,10 @@
// <FS:Ansariel> FIRE-1874: Show server channel in statusbar
#include "llappviewer.h"
// <FS:Beq> FIRE-10549 etc, incorrect grid URL on HG back links
#include "fsgridhandler.h"
#include "lfsimfeaturehandler.h"
// </FS:Beq>
//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)
{
// <FS:CR> 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
// </FS:CR>
}
}
slurl = return_slurl;
}