From e0c5069492b2fd70fa42a9fc414b644f42d9ecfd Mon Sep 17 00:00:00 2001 From: Hecklezz Date: Sun, 14 Jun 2026 21:05:43 +1000 Subject: [PATCH] Fix unnecessary duplicate AddGrid requests and AddGrid errors in OpenSim --- indra/newview/fsgridhandler.cpp | 41 +++++++++++++--------- indra/newview/fsgridhandler.h | 2 ++ indra/newview/llnavigationbar.cpp | 2 -- indra/newview/llteleporthistory.cpp | 2 +- indra/newview/llteleporthistorystorage.cpp | 2 +- 5 files changed, 28 insertions(+), 21 deletions(-) diff --git a/indra/newview/fsgridhandler.cpp b/indra/newview/fsgridhandler.cpp index 1e127f2115..ba5d7fa04d 100644 --- a/indra/newview/fsgridhandler.cpp +++ b/indra/newview/fsgridhandler.cpp @@ -74,15 +74,18 @@ void gridDownloadError(const LLSD& aData, LLGridManager* mOwner, GridEntry* mDat } else if (LLGridManager::TRYLEGACY == mState) // we did TRYLEGACY and faild { - LLSD args; - args["GRID"] = mData->grid[GRID_VALUE]; - // Could not add [GRID] to the grid list. - std::string reason_dialog = "Server didn't provide grid info: "; - reason_dialog.append(mData->last_http_error); - reason_dialog.append("\nPlease check if the loginuri is correct and"); - args["REASON"] = reason_dialog; - //[REASON] contact support of [GRID]. - LLNotificationsUtil::add("CantAddGrid", args); + if (!mData->grid.has("FLAG_TEMPORARY")) + { + LLSD args; + args["GRID"] = mData->grid[GRID_VALUE]; + // Could not add [GRID] to the grid list. + std::string reason_dialog = "Server didn't provide grid info: "; + reason_dialog.append(mData->last_http_error); + reason_dialog.append("\nPlease check if the loginuri is correct and"); + args["REASON"] = reason_dialog; + //[REASON] contact support of [GRID]. + LLNotificationsUtil::add("CantAddGrid", args); + } LL_WARNS() << "No legacy login page. Giving up for " << mData->grid[GRID_VALUE] << LL_ENDL; mOwner->addGrid(mData, LLGridManager::FAIL); @@ -1327,15 +1330,19 @@ std::string LLGridManager::getSLURLBase(const std::string& grid) // else { - LL_DEBUGS("GridManager") << "Trying to fetch info for:" << grid << LL_ENDL; - GridEntry* grid_entry = new GridEntry; - grid_entry->set_current = false; - grid_entry->grid = LLSD::emptyMap(); - grid_entry->grid[GRID_VALUE] = grid; + if (!mFetchedGridInfo.contains(grid)) + { + LL_DEBUGS("GridManager") << "Trying to fetch info for:" << grid << LL_ENDL; + GridEntry* grid_entry = new GridEntry; + grid_entry->set_current = false; + grid_entry->grid = LLSD::emptyMap(); + grid_entry->grid[GRID_VALUE] = grid; + mFetchedGridInfo.insert(grid); - // add the grid with the additional values, or update the - // existing grid if it exists with the given values - addGrid(grid_entry, FETCHTEMP); + // add the grid with the additional values, or update the + // existing grid if it exists with the given values + addGrid(grid_entry, FETCHTEMP); + } // deal with hand edited entries std::string grid_norm = grid; diff --git a/indra/newview/fsgridhandler.h b/indra/newview/fsgridhandler.h index df08fc07bb..33714df93e 100644 --- a/indra/newview/fsgridhandler.h +++ b/indra/newview/fsgridhandler.h @@ -258,6 +258,8 @@ private: S32 mClassifiedFee; S32 mDirectoryFee; + std::unordered_set mFetchedGridInfo; + protected: void updateIsInProductionGrid(); diff --git a/indra/newview/llnavigationbar.cpp b/indra/newview/llnavigationbar.cpp index 4956e0c997..d0ff8e691f 100644 --- a/indra/newview/llnavigationbar.cpp +++ b/indra/newview/llnavigationbar.cpp @@ -650,8 +650,6 @@ void LLNavigationBar::onLocationSelection() std::string current_grid = LFSimFeatureHandler::instance().hyperGridURL(); std::string gatekeeper = LLGridManager::getInstance()->getGatekeeper(grid); - LL_INFOS("Hecklezz") << "grid: " << grid << ", current_grid: " << current_grid << ", gatekeeper: " << gatekeeper << LL_ENDL; - // Requesting region information from the server is only required when changing grid if (slurl.isValid() && grid != current_grid) { diff --git a/indra/newview/llteleporthistory.cpp b/indra/newview/llteleporthistory.cpp index b0e705ec22..56c8d98ec8 100644 --- a/indra/newview/llteleporthistory.cpp +++ b/indra/newview/llteleporthistory.cpp @@ -344,7 +344,7 @@ void LLTeleportHistory::dump() const line << i << ": " << mItems[i].mTitle; line << " REGION_ID: " << mItems[i].mRegionID; line << ", pos: " << mItems[i].mGlobalPos; - line << ", slurl: " << mItems[i].mSLURL.asString(); // Fix Teleport and Location History for OpenSim + line << ", slurl: " << mItems[i].mSLURL.getSLURLString(); // Fix Teleport and Location History for OpenSim LL_INFOS() << line.str() << LL_ENDL; } } diff --git a/indra/newview/llteleporthistorystorage.cpp b/indra/newview/llteleporthistorystorage.cpp index 696e031cf8..0d8cf68bda 100644 --- a/indra/newview/llteleporthistorystorage.cpp +++ b/indra/newview/llteleporthistorystorage.cpp @@ -287,7 +287,7 @@ void LLTeleportHistoryStorage::dump() const line << i << ": " << mItems[i].mTitle; line << " global pos: " << mItems[i].mGlobalPos; line << " date: " << mItems[i].mDate; - line << " slurl: " << mItems[i].mSLURL.asString(); // Fix Teleport and Location History for OpenSim + line << " slurl: " << mItems[i].mSLURL.getSLURLString(); // Fix Teleport and Location History for OpenSim LL_INFOS() << line.str() << LL_ENDL; }