diff options
author | BlueWall | 2014-08-03 20:33:40 -0400 |
---|---|---|
committer | BlueWall | 2014-08-06 17:25:12 -0400 |
commit | 10a8d2852e529fddb029ae333a3ae6a0f06f0182 (patch) | |
tree | 53806e78ef6ef300a039ceebeea8ffa40838dd98 /OpenSim/Services | |
parent | Fixed crash when using Allowed/Denied Viewers, and the viewer's name is short... (diff) | |
download | opensim-SC-10a8d2852e529fddb029ae333a3ae6a0f06f0182.zip opensim-SC-10a8d2852e529fddb029ae333a3ae6a0f06f0182.tar.gz opensim-SC-10a8d2852e529fddb029ae333a3ae6a0f06f0182.tar.bz2 opensim-SC-10a8d2852e529fddb029ae333a3ae6a0f06f0182.tar.xz |
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.
Diffstat (limited to 'OpenSim/Services')
4 files changed, 92 insertions, 0 deletions
diff --git a/OpenSim/Services/Connectors/Grid/GridServicesConnector.cs b/OpenSim/Services/Connectors/Grid/GridServicesConnector.cs index 7f86cff..9e55356 100644 --- a/OpenSim/Services/Connectors/Grid/GridServicesConnector.cs +++ b/OpenSim/Services/Connectors/Grid/GridServicesConnector.cs | |||
@@ -719,6 +719,45 @@ namespace OpenSim.Services.Connectors | |||
719 | return flags; | 719 | return flags; |
720 | } | 720 | } |
721 | 721 | ||
722 | public Dictionary<string, object> GetExtraFeatures() | ||
723 | { | ||
724 | Dictionary<string, object> sendData = new Dictionary<string, object>(); | ||
725 | Dictionary<string, object> extraFeatures = new Dictionary<string, object>(); | ||
726 | |||
727 | sendData["METHOD"] = "get_grid_extra_features"; | ||
728 | |||
729 | string reply = string.Empty; | ||
730 | string uri = m_ServerURI + "/grid"; | ||
731 | |||
732 | try | ||
733 | { | ||
734 | reply = SynchronousRestFormsRequester.MakeRequest("POST", | ||
735 | uri, | ||
736 | ServerUtils.BuildQueryString(sendData), m_Auth); | ||
737 | } | ||
738 | catch (Exception e) | ||
739 | { | ||
740 | m_log.DebugFormat("[GRID CONNECTOR]: GetExtraFeatures - Exception when contacting grid server at {0}: {1}", uri, e.Message); | ||
741 | return extraFeatures; | ||
742 | } | ||
743 | |||
744 | if (reply != string.Empty) | ||
745 | { | ||
746 | Dictionary<string, object> replyData = ServerUtils.ParseXmlResponse(reply); | ||
747 | |||
748 | if ((replyData != null) && replyData.Count > 0) | ||
749 | { | ||
750 | foreach (string key in replyData.Keys) | ||
751 | { | ||
752 | extraFeatures[key] = replyData[key].ToString(); | ||
753 | } | ||
754 | } | ||
755 | } | ||
756 | else | ||
757 | m_log.DebugFormat("[GRID CONNECTOR]: GetExtraServiceURLs received null reply"); | ||
758 | |||
759 | return extraFeatures; | ||
760 | } | ||
722 | #endregion | 761 | #endregion |
723 | 762 | ||
724 | } | 763 | } |
diff --git a/OpenSim/Services/Connectors/SimianGrid/SimianGridServiceConnector.cs b/OpenSim/Services/Connectors/SimianGrid/SimianGridServiceConnector.cs index 6b59f94..b031f21 100644 --- a/OpenSim/Services/Connectors/SimianGrid/SimianGridServiceConnector.cs +++ b/OpenSim/Services/Connectors/SimianGrid/SimianGridServiceConnector.cs | |||
@@ -402,6 +402,13 @@ namespace OpenSim.Services.Connectors.SimianGrid | |||
402 | return -1; | 402 | return -1; |
403 | } | 403 | } |
404 | } | 404 | } |
405 | |||
406 | public Dictionary<string, object> GetExtraFeatures() | ||
407 | { | ||
408 | /// See SimulatorFeaturesModule - Need to get map, search and destination guide | ||
409 | Dictionary<string, object> extraFeatures = new Dictionary<string, object>(); | ||
410 | return extraFeatures; | ||
411 | } | ||
405 | 412 | ||
406 | #endregion IGridService | 413 | #endregion IGridService |
407 | 414 | ||
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 | |||
59 | 59 | ||
60 | protected bool m_SuppressVarregionOverlapCheckOnRegistration = false; | 60 | protected bool m_SuppressVarregionOverlapCheckOnRegistration = false; |
61 | 61 | ||
62 | private static Dictionary<string,object> m_ExtraFeatures = new Dictionary<string, object>(); | ||
63 | |||
62 | public GridService(IConfigSource config) | 64 | public GridService(IConfigSource config) |
63 | : base(config) | 65 | : base(config) |
64 | { | 66 | { |
@@ -139,10 +141,38 @@ namespace OpenSim.Services.GridService | |||
139 | HandleSetFlags); | 141 | HandleSetFlags); |
140 | } | 142 | } |
141 | 143 | ||
144 | if (!suppressConsoleCommands) | ||
145 | SetExtraServiceURLs(config); | ||
146 | |||
142 | m_HypergridLinker = new HypergridLinker(m_config, this, m_Database); | 147 | m_HypergridLinker = new HypergridLinker(m_config, this, m_Database); |
143 | } | 148 | } |
144 | } | 149 | } |
145 | 150 | ||
151 | private void SetExtraServiceURLs(IConfigSource config) | ||
152 | { | ||
153 | IConfig loginConfig = config.Configs["LoginService"]; | ||
154 | IConfig gridConfig = config.Configs["GridService"]; | ||
155 | |||
156 | if (loginConfig == null || gridConfig == null) | ||
157 | return; | ||
158 | |||
159 | string configVal; | ||
160 | |||
161 | configVal = loginConfig.GetString("SearchURL", string.Empty); | ||
162 | if (!string.IsNullOrEmpty(configVal)) | ||
163 | m_ExtraFeatures["search-server-url"] = configVal; | ||
164 | |||
165 | configVal = loginConfig.GetString("MapTileURL", string.Empty); | ||
166 | if (!string.IsNullOrEmpty(configVal)) | ||
167 | m_ExtraFeatures["map-server-url"] = configVal; | ||
168 | |||
169 | configVal = loginConfig.GetString("DestinationGuide", string.Empty); | ||
170 | if (!string.IsNullOrEmpty(configVal)) | ||
171 | m_ExtraFeatures["destination-guide-url"] = configVal; | ||
172 | |||
173 | m_ExtraFeatures["ExportSupported"] = gridConfig.GetString("ExportSupported", "true"); | ||
174 | } | ||
175 | |||
146 | #region IGridService | 176 | #region IGridService |
147 | 177 | ||
148 | public string RegisterRegion(UUID scopeID, GridRegion regionInfos) | 178 | public string RegisterRegion(UUID scopeID, GridRegion regionInfos) |
@@ -928,5 +958,18 @@ namespace OpenSim.Services.GridService | |||
928 | m_Database.Store(r); | 958 | m_Database.Store(r); |
929 | } | 959 | } |
930 | } | 960 | } |
961 | |||
962 | /// <summary> | ||
963 | /// Gets the grid extra service URls we wish for the region to send in OpenSimExtras to dynamically refresh | ||
964 | /// parameters in the viewer used to access services like map, search and destination guides. | ||
965 | /// <para>see "SimulatorFeaturesModule" </para> | ||
966 | /// </summary> | ||
967 | /// <returns> | ||
968 | /// The grid extra service URls. | ||
969 | /// </returns> | ||
970 | public Dictionary<string,object> GetExtraFeatures() | ||
971 | { | ||
972 | return m_ExtraFeatures; | ||
973 | } | ||
931 | } | 974 | } |
932 | } | 975 | } |
diff --git a/OpenSim/Services/Interfaces/IGridService.cs b/OpenSim/Services/Interfaces/IGridService.cs index b7bcd6b..c45ea76 100644 --- a/OpenSim/Services/Interfaces/IGridService.cs +++ b/OpenSim/Services/Interfaces/IGridService.cs | |||
@@ -26,6 +26,7 @@ | |||
26 | */ | 26 | */ |
27 | 27 | ||
28 | using System; | 28 | using System; |
29 | using System.Collections; | ||
29 | using System.Collections.Generic; | 30 | using System.Collections.Generic; |
30 | using System.Net; | 31 | using System.Net; |
31 | using System.Net.Sockets; | 32 | using System.Net.Sockets; |
@@ -119,6 +120,8 @@ namespace OpenSim.Services.Interfaces | |||
119 | /// <param name='scopeID'></param> | 120 | /// <param name='scopeID'></param> |
120 | /// <param name='regionID'></param> | 121 | /// <param name='regionID'></param> |
121 | int GetRegionFlags(UUID scopeID, UUID regionID); | 122 | int GetRegionFlags(UUID scopeID, UUID regionID); |
123 | |||
124 | Dictionary<string,object> GetExtraFeatures(); | ||
122 | } | 125 | } |
123 | 126 | ||
124 | public class GridRegion | 127 | public class GridRegion |