From b4bc9727f1b818f2d30ecbaeaf5372761d92d716 Mon Sep 17 00:00:00 2001 From: Latif Khalifa Date: Wed, 31 Jul 2013 04:24:13 +0200 Subject: [PATCH] Confirm to new OpenSimExtras specification of SimulatorFeatures cap See: http://opensimulator.org/wiki/SimulatorFeatures_Extras * Moved SupportsExport inside this map to avoid possible collision with Linden Lab * Added the ability for a sim to specify map server (Fixes maps after hypergrid jumps) --- indra/newview/lfsimfeaturehandler.cpp | 6 +++++- indra/newview/lfsimfeaturehandler.h | 4 ++++ indra/newview/llworldmap.cpp | 3 ++- indra/newview/llworldmipmap.cpp | 5 ++++- 4 files changed, 15 insertions(+), 3 deletions(-) diff --git a/indra/newview/lfsimfeaturehandler.cpp b/indra/newview/lfsimfeaturehandler.cpp index bce7124ae..5613da8f5 100644 --- a/indra/newview/lfsimfeaturehandler.cpp +++ b/indra/newview/lfsimfeaturehandler.cpp @@ -54,7 +54,11 @@ void LFSimFeatureHandler::setSupportedFeatures() region->getSimulatorFeatures(info); //if (!gHippoGridManager->getCurrentGrid()->isSecondLife()) // Non-SL specific sim features { - mSupportsExport = info.has("ExportSupported"); + // For definition of OpenSimExtras please see + // http://opensimulator.org/wiki/SimulatorFeatures_Extras + mSupportsExport = info["OpenSimExtras"]["ExportSupported"].asBoolean(); + mMapServerURL = info["OpenSimExtras"]["map-server-url"].asString(); + mSearchURL = info["OpenSimExtras"]["search-server-url"].asString(); } } } diff --git a/indra/newview/lfsimfeaturehandler.h b/indra/newview/lfsimfeaturehandler.h index 070d6ba1e..f91dc1566 100644 --- a/indra/newview/lfsimfeaturehandler.h +++ b/indra/newview/lfsimfeaturehandler.h @@ -60,10 +60,14 @@ public: // Accessors bool simSupportsExport() const { return mSupportsExport; } + std::string mapServerURL() const { return mMapServerURL; } + std::string searchURL() const { return mSearchURL; } private: // SignaledTypes SignaledType mSupportsExport; + std::string mMapServerURL; + std::string mSearchURL; }; #endif //LFSIMFEATUREHANDLER_H diff --git a/indra/newview/llworldmap.cpp b/indra/newview/llworldmap.cpp index 752be770f..b153cfafd 100644 --- a/indra/newview/llworldmap.cpp +++ b/indra/newview/llworldmap.cpp @@ -49,6 +49,7 @@ #include "llregionflags.h" #include "llworldmapmessage.h" #include "hippogridmanager.h" +#include "lfsimfeaturehandler.h" bool LLWorldMap::sGotMapURL = false; // Timers to temporise database requests @@ -512,7 +513,7 @@ bool LLWorldMap::useWebMapTiles() { static const LLCachedControl use_web_map_tiles("UseWebMapTiles",false); return use_web_map_tiles && - (( gHippoGridManager->getConnectedGrid()->isSecondLife() || sGotMapURL)); + (( gHippoGridManager->getConnectedGrid()->isSecondLife() || sGotMapURL || !LFSimFeatureHandler::instance().mapServerURL().empty())); } void LLWorldMap::reloadItems(bool force) diff --git a/indra/newview/llworldmipmap.cpp b/indra/newview/llworldmipmap.cpp index e27c5d644..66ee60d47 100644 --- a/indra/newview/llworldmipmap.cpp +++ b/indra/newview/llworldmipmap.cpp @@ -37,6 +37,7 @@ #include "llviewercontrol.h" #include "llviewertexturelist.h" #include "math.h" // log() +#include "lfsimfeaturehandler.h" // Turn this on to output tile stats in the standard output #define DEBUG_TILES_STAT 0 @@ -187,7 +188,9 @@ LLPointer LLWorldMipmap::getObjectsTile(U32 grid_x, U32 LLPointer LLWorldMipmap::loadObjectsTile(U32 grid_x, U32 grid_y, S32 level) { // Get the grid coordinates - std::string imageurl = gSavedSettings.getString("MapServerURL") + llformat("map-%d-%d-%d-objects.jpg", level, grid_x, grid_y); + std::string simOverrideMap = LFSimFeatureHandler::instance().mapServerURL(); + std::string imageurl = (simOverrideMap.empty() ? gSavedSettings.getString("MapServerURL") : simOverrideMap) + + llformat("map-%d-%d-%d-objects.jpg", level, grid_x, grid_y); // DO NOT COMMIT!! DEBUG ONLY!!! // Use a local jpeg for every tile to test map speed without S3 access