From 10a8d2852e529fddb029ae333a3ae6a0f06f0182 Mon Sep 17 00:00:00 2001 From: BlueWall Date: Sun, 3 Aug 2014 20:33:40 -0400 Subject: OpenSimExtras Move the experimental extra features functionality into the GridService. This sends default values for map, search and destination guide, plus ExportSupported control to the region on startup. Please watch http://opensimulator.org/wiki/SimulatorFeatures_Extras for changes and documentation. --- OpenSim/Services/GridService/GridService.cs | 43 +++++++++++++++++++++++++++++ 1 file changed, 43 insertions(+) (limited to 'OpenSim/Services/GridService') diff --git a/OpenSim/Services/GridService/GridService.cs b/OpenSim/Services/GridService/GridService.cs index 013cc53..e8a545c 100644 --- a/OpenSim/Services/GridService/GridService.cs +++ b/OpenSim/Services/GridService/GridService.cs @@ -59,6 +59,8 @@ namespace OpenSim.Services.GridService protected bool m_SuppressVarregionOverlapCheckOnRegistration = false; + private static Dictionary m_ExtraFeatures = new Dictionary(); + public GridService(IConfigSource config) : base(config) { @@ -139,10 +141,38 @@ namespace OpenSim.Services.GridService HandleSetFlags); } + if (!suppressConsoleCommands) + SetExtraServiceURLs(config); + m_HypergridLinker = new HypergridLinker(m_config, this, m_Database); } } + private void SetExtraServiceURLs(IConfigSource config) + { + IConfig loginConfig = config.Configs["LoginService"]; + IConfig gridConfig = config.Configs["GridService"]; + + if (loginConfig == null || gridConfig == null) + return; + + string configVal; + + configVal = loginConfig.GetString("SearchURL", string.Empty); + if (!string.IsNullOrEmpty(configVal)) + m_ExtraFeatures["search-server-url"] = configVal; + + configVal = loginConfig.GetString("MapTileURL", string.Empty); + if (!string.IsNullOrEmpty(configVal)) + m_ExtraFeatures["map-server-url"] = configVal; + + configVal = loginConfig.GetString("DestinationGuide", string.Empty); + if (!string.IsNullOrEmpty(configVal)) + m_ExtraFeatures["destination-guide-url"] = configVal; + + m_ExtraFeatures["ExportSupported"] = gridConfig.GetString("ExportSupported", "true"); + } + #region IGridService public string RegisterRegion(UUID scopeID, GridRegion regionInfos) @@ -928,5 +958,18 @@ namespace OpenSim.Services.GridService m_Database.Store(r); } } + + /// + /// Gets the grid extra service URls we wish for the region to send in OpenSimExtras to dynamically refresh + /// parameters in the viewer used to access services like map, search and destination guides. + /// see "SimulatorFeaturesModule" + /// + /// + /// The grid extra service URls. + /// + public Dictionary GetExtraFeatures() + { + return m_ExtraFeatures; + } } } -- cgit v1.1