aboutsummaryrefslogtreecommitdiffstatshomepage
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--OpenSim/Region/ClientStack/Linden/Caps/SimulatorFeaturesModule.cs74
-rw-r--r--OpenSim/Region/CoreModules/ServiceConnectorsIn/Grid/LocalGridFeaturesServiceInConnector.cs129
-rw-r--r--OpenSim/Region/CoreModules/ServiceConnectorsOut/Grid/LocalGridServiceConnector.cs5
-rw-r--r--OpenSim/Region/CoreModules/ServiceConnectorsOut/Grid/RemoteGridServiceConnector.cs12
-rw-r--r--OpenSim/Server/Handlers/Grid/GridExtraFeaturesHandlers.cs127
-rw-r--r--OpenSim/Server/Handlers/Grid/GridExtraFeaturesServerInConnector.cs50
-rw-r--r--OpenSim/Server/Handlers/Grid/GridServerPostHandler.cs19
-rw-r--r--OpenSim/Services/Connectors/Grid/GridServicesConnector.cs39
-rw-r--r--OpenSim/Services/Connectors/SimianGrid/SimianGridServiceConnector.cs7
-rw-r--r--OpenSim/Services/GridService/GridService.cs43
-rw-r--r--OpenSim/Services/Interfaces/IGridService.cs3
-rw-r--r--bin/OpenSim.ini.example21
-rw-r--r--bin/Robust.HG.ini.example40
-rw-r--r--bin/Robust.ini.example40
-rw-r--r--bin/config-include/StandaloneCommon.ini.example7
15 files changed, 182 insertions, 434 deletions
diff --git a/OpenSim/Region/ClientStack/Linden/Caps/SimulatorFeaturesModule.cs b/OpenSim/Region/ClientStack/Linden/Caps/SimulatorFeaturesModule.cs
index 9f1eb88..1345bff 100644
--- a/OpenSim/Region/ClientStack/Linden/Caps/SimulatorFeaturesModule.cs
+++ b/OpenSim/Region/ClientStack/Linden/Caps/SimulatorFeaturesModule.cs
@@ -27,17 +27,18 @@
27 27
28using System; 28using System;
29using System.Collections; 29using System.Collections;
30using System.Collections.Generic;
30using System.Reflection; 31using System.Reflection;
31using log4net; 32using log4net;
32using Nini.Config; 33using Nini.Config;
33using Mono.Addins; 34using Mono.Addins;
34using OpenMetaverse; 35using OpenMetaverse;
35using OpenMetaverse.StructuredData; 36using OpenMetaverse.StructuredData;
36using OpenSim.Framework; 37//using OpenSim.Framework;
37using OpenSim.Framework.Servers.HttpServer; 38using OpenSim.Framework.Servers.HttpServer;
38using OpenSim.Region.Framework.Interfaces; 39using OpenSim.Region.Framework.Interfaces;
39using OpenSim.Region.Framework.Scenes; 40using OpenSim.Region.Framework.Scenes;
40using OpenSim.Services.Interfaces; 41// using OpenSim.Services.Interfaces;
41using Caps = OpenSim.Framework.Capabilities.Caps; 42using Caps = OpenSim.Framework.Capabilities.Caps;
42 43
43namespace OpenSim.Region.ClientStack.Linden 44namespace OpenSim.Region.ClientStack.Linden
@@ -63,8 +64,6 @@ namespace OpenSim.Region.ClientStack.Linden
63 64
64 private Scene m_scene; 65 private Scene m_scene;
65 66
66 bool m_AllowOverride = true;
67
68 /// <summary> 67 /// <summary>
69 /// Simulator features 68 /// Simulator features
70 /// </summary> 69 /// </summary>
@@ -81,25 +80,11 @@ namespace OpenSim.Region.ClientStack.Linden
81 IConfig config = source.Configs["SimulatorFeatures"]; 80 IConfig config = source.Configs["SimulatorFeatures"];
82 81
83 if (config != null) 82 if (config != null)
84 { 83 {
85 string featuresURI = config.GetString("ExtraFeaturesServiceURI", string.Empty); 84 // These are normaly set in their respective modules
86 85 m_SearchURL = config.GetString("SearchServerURI", m_SearchURL);
87 if (string.IsNullOrEmpty(featuresURI)) 86 m_DestinationGuideURL = config.GetString ("DestinationGuideURI", m_DestinationGuideURL);
88 { 87 m_ExportSupported = config.GetBoolean("ExportSupported", m_ExportSupported);
89 m_log.Info("ExtraFeaturesServiceURI is undefined. The grid's ExtraFeatures will not be available to regions in this instance.");
90 }
91 else
92 {
93 GetGridExtraFeatures(featuresURI);
94 }
95
96 if (m_AllowOverride)
97 {
98 m_SearchURL = config.GetString("SearchServerURI", m_SearchURL);
99 m_DestinationGuideURL = config.GetString ("DestinationGuideURI", m_DestinationGuideURL);
100
101 m_ExportSupported = config.GetBoolean("ExportSupported", m_ExportSupported);
102 }
103 } 88 }
104 89
105 AddDefaultFeatures(); 90 AddDefaultFeatures();
@@ -120,6 +105,7 @@ namespace OpenSim.Region.ClientStack.Linden
120 105
121 public void RegionLoaded(Scene s) 106 public void RegionLoaded(Scene s)
122 { 107 {
108 GetGridExtraFeatures(s);
123 } 109 }
124 110
125 public void PostInitialise() 111 public void PostInitialise()
@@ -169,11 +155,11 @@ namespace OpenSim.Region.ClientStack.Linden
169 else 155 else
170 extrasMap = new OSDMap(); 156 extrasMap = new OSDMap();
171 157
172 if (m_SearchURL != string.Empty && m_AllowOverride == true) 158 if (m_SearchURL != string.Empty)
173 extrasMap["search-server-url"] = m_SearchURL; 159 extrasMap["search-server-url"] = m_SearchURL;
174 if (!string.IsNullOrEmpty(m_DestinationGuideURL) && m_AllowOverride == true) 160 if (!string.IsNullOrEmpty(m_DestinationGuideURL))
175 extrasMap["destination-guide-url"] = m_DestinationGuideURL; 161 extrasMap["destination-guide-url"] = m_DestinationGuideURL;
176 if (m_ExportSupported && m_AllowOverride == true) 162 if (m_ExportSupported)
177 extrasMap["ExportSupported"] = true; 163 extrasMap["ExportSupported"] = true;
178 164
179 if (extrasMap.Count > 0) 165 if (extrasMap.Count > 0)
@@ -233,9 +219,7 @@ namespace OpenSim.Region.ClientStack.Linden
233 219
234 SimulatorFeaturesRequestDelegate handlerOnSimulatorFeaturesRequest = OnSimulatorFeaturesRequest; 220 SimulatorFeaturesRequestDelegate handlerOnSimulatorFeaturesRequest = OnSimulatorFeaturesRequest;
235 221
236 // We will not trigger the event if m_AllowOverride == False 222 if (handlerOnSimulatorFeaturesRequest != null)
237 // See Robust.ini/Robust.HG.ini [GridExtraFeatures] - AllowRegionOverride
238 if (handlerOnSimulatorFeaturesRequest != null && m_AllowOverride == true)
239 handlerOnSimulatorFeaturesRequest(agentID, ref copy); 223 handlerOnSimulatorFeaturesRequest(agentID, ref copy);
240 224
241 //Send back data 225 //Send back data
@@ -255,32 +239,22 @@ namespace OpenSim.Region.ClientStack.Linden
255 /// <param name='featuresURI'> 239 /// <param name='featuresURI'>
256 /// The URI Robust uses to handle the get_extra_features request 240 /// The URI Robust uses to handle the get_extra_features request
257 /// </param> 241 /// </param>
258 private void GetGridExtraFeatures(string featuresURI) 242 private void GetGridExtraFeatures(Scene scene)
259 { 243 {
260 JsonRpcRequestManager rpc = new JsonRpcRequestManager (); 244 Dictionary<string, object> extraFeatures = scene.GridService.GetExtraFeatures();
261 245
262 OSDMap parameters = new OSDMap ();
263 OSD Params = (OSD)parameters;
264 if (!rpc.JsonRpcRequest (ref Params, "get_extra_features", featuresURI, UUID.Random ().ToString ()))
265 {
266 m_log.Error("[SIMFEATURES]: Could not retrieve extra features from grid. Please check configuration.");
267 return;
268 }
269 parameters = (OSDMap)Params;
270 OSDMap features = (OSDMap)parameters ["result"];
271
272 if(features.ContainsKey("region_override"))
273 m_AllowOverride = features ["region_override"].AsBoolean () ;
274 else
275 m_AllowOverride = true;
276
277 OSDMap test = (OSDMap)features ["extra_features"];
278 lock (m_features) 246 lock (m_features)
279 { 247 {
280 OSDMap extrasMap = new OSDMap(); 248 OSDMap extrasMap = new OSDMap();
281 foreach (string key in test.Keys) 249
250 foreach(string key in extraFeatures.Keys)
282 { 251 {
283 extrasMap[key] = test[key]; 252 extrasMap[key] = (string)extraFeatures[key];
253
254 if (key == "ExportSupported")
255 {
256 bool.TryParse(extraFeatures[key].ToString(), out m_ExportSupported);
257 }
284 } 258 }
285 m_features["OpenSimExtras"] = extrasMap; 259 m_features["OpenSimExtras"] = extrasMap;
286 } 260 }
diff --git a/OpenSim/Region/CoreModules/ServiceConnectorsIn/Grid/LocalGridFeaturesServiceInConnector.cs b/OpenSim/Region/CoreModules/ServiceConnectorsIn/Grid/LocalGridFeaturesServiceInConnector.cs
deleted file mode 100644
index 6cfb099..0000000
--- a/OpenSim/Region/CoreModules/ServiceConnectorsIn/Grid/LocalGridFeaturesServiceInConnector.cs
+++ /dev/null
@@ -1,129 +0,0 @@
1/*
2 * Copyright (c) Contributors, http://opensimulator.org/
3 * See CONTRIBUTORS.TXT for a full list of copyright holders.
4 *
5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions are met:
7 * * Redistributions of source code must retain the above copyright
8 * notice, this list of conditions and the following disclaimer.
9 * * Redistributions in binary form must reproduce the above copyright
10 * notice, this list of conditions and the following disclaimer in the
11 * documentation and/or other materials provided with the distribution.
12 * * Neither the name of the OpenSimulator Project nor the
13 * names of its contributors may be used to endorse or promote products
14 * derived from this software without specific prior written permission.
15 *
16 * THIS SOFTWARE IS PROVIDED BY THE DEVELOPERS ``AS IS'' AND ANY
17 * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
18 * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
19 * DISCLAIMED. IN NO EVENT SHALL THE CONTRIBUTORS BE LIABLE FOR ANY
20 * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
21 * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
22 * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
23 * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
24 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
25 * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
26 */
27
28using System;
29using System.Reflection;
30using System.Collections.Generic;
31using log4net;
32using Mono.Addins;
33using Nini.Config;
34using OpenSim.Framework;
35using OpenSim.Framework.Servers;
36using OpenSim.Region.Framework.Scenes;
37using OpenSim.Region.Framework.Interfaces;
38using OpenSim.Server.Base;
39using OpenSim.Server.Handlers.Base;
40using OpenSim.Server.Handlers.Grid;
41using OpenSim.Services.Interfaces;
42using OpenSim.Framework.Servers.HttpServer;
43
44namespace OpenSim.Region.CoreModules.ServiceConnectorsIn.Grid
45{
46 [Extension(Path = "/OpenSim/RegionModules", NodeName = "RegionModule", Id = "LocalGridFeaturesServiceInConnector")]
47 public class LocalGridExtraFeaturesServiceInConnector : ISharedRegionModule
48 {
49 private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
50 private static bool m_Enabled = false;
51
52 private IConfigSource m_Config;
53 bool m_Registered = false;
54
55 #region Region Module interface
56
57 public void Initialise(IConfigSource config)
58 {
59 m_Config = config;
60 IConfig moduleConfig = config.Configs["Modules"];
61 if (moduleConfig != null)
62 {
63 string name = moduleConfig.GetString("GridExtraFeaturesServiceInConnector", "");
64 if (name == Name)
65 {
66 m_log.Info("[GridExtraFeatures]: GridExtraFeatures Service In Connector enabled");
67 InitializeService(config);
68 }
69 }
70 }
71
72 public void InitializeService(IConfigSource config)
73 {
74 GridExtraFeaturesHandlers handler = new GridExtraFeaturesHandlers(config);
75
76 IHttpServer Server = MainServer.Instance;
77
78 Server.AddJsonRPCHandler("get_extra_features", handler.JsonGetGridFeaturesMethod);
79
80 }
81
82 public void PostInitialise()
83 {
84 }
85
86 public void Close()
87 {
88 }
89
90 public Type ReplaceableInterface
91 {
92 get { return null; }
93 }
94
95 public string Name
96 {
97 get { return "LocalGridExtraFeaturesServiceInConnector"; }
98 }
99
100 public void AddRegion(Scene scene)
101 {
102 if (!m_Enabled)
103 return;
104 }
105
106 public void RemoveRegion(Scene scene)
107 {
108 if (!m_Enabled)
109 return;
110 }
111
112 public void RegionLoaded(Scene scene)
113 {
114 if (!m_Enabled)
115 return;
116
117 if (!m_Registered)
118 {
119 m_Registered = true;
120
121 m_log.Info("[GRID EXTRA FEATURES]: Starting...");
122
123 new GridExtraFeaturesServerInConnector(m_Config, MainServer.Instance, "GridExtraFeaturesService");
124 }
125 }
126#endregion
127
128 }
129} \ No newline at end of file
diff --git a/OpenSim/Region/CoreModules/ServiceConnectorsOut/Grid/LocalGridServiceConnector.cs b/OpenSim/Region/CoreModules/ServiceConnectorsOut/Grid/LocalGridServiceConnector.cs
index 731bd28..8e995db 100644
--- a/OpenSim/Region/CoreModules/ServiceConnectorsOut/Grid/LocalGridServiceConnector.cs
+++ b/OpenSim/Region/CoreModules/ServiceConnectorsOut/Grid/LocalGridServiceConnector.cs
@@ -278,6 +278,11 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Grid
278 return m_GridService.GetRegionFlags(scopeID, regionID); 278 return m_GridService.GetRegionFlags(scopeID, regionID);
279 } 279 }
280 280
281 public Dictionary<string, object> GetExtraFeatures()
282 {
283 return m_GridService.GetExtraFeatures();
284 }
285
281 #endregion 286 #endregion
282 287
283 public void HandleShowNeighboursCommand(string module, string[] cmdparams) 288 public void HandleShowNeighboursCommand(string module, string[] cmdparams)
diff --git a/OpenSim/Region/CoreModules/ServiceConnectorsOut/Grid/RemoteGridServiceConnector.cs b/OpenSim/Region/CoreModules/ServiceConnectorsOut/Grid/RemoteGridServiceConnector.cs
index ae5081c..f0c4926 100644
--- a/OpenSim/Region/CoreModules/ServiceConnectorsOut/Grid/RemoteGridServiceConnector.cs
+++ b/OpenSim/Region/CoreModules/ServiceConnectorsOut/Grid/RemoteGridServiceConnector.cs
@@ -28,6 +28,7 @@
28using log4net; 28using log4net;
29using Mono.Addins; 29using Mono.Addins;
30using System; 30using System;
31using System.Collections;
31using System.Collections.Generic; 32using System.Collections.Generic;
32using System.Reflection; 33using System.Reflection;
33using Nini.Config; 34using Nini.Config;
@@ -349,6 +350,17 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Grid
349 350
350 return flags; 351 return flags;
351 } 352 }
353
354 public Dictionary<string, object> GetExtraFeatures()
355 {
356 Dictionary<string, object> extraFeatures;
357 extraFeatures = m_LocalGridService.GetExtraFeatures();
358
359 if (extraFeatures.Count == 0)
360 extraFeatures = m_RemoteGridService.GetExtraFeatures();
361
362 return extraFeatures;
363 }
352 #endregion 364 #endregion
353 } 365 }
354} 366}
diff --git a/OpenSim/Server/Handlers/Grid/GridExtraFeaturesHandlers.cs b/OpenSim/Server/Handlers/Grid/GridExtraFeaturesHandlers.cs
deleted file mode 100644
index 6a62cfc..0000000
--- a/OpenSim/Server/Handlers/Grid/GridExtraFeaturesHandlers.cs
+++ /dev/null
@@ -1,127 +0,0 @@
1/*
2 * Copyright (c) Contributors, http://opensimulator.org/
3 * See CONTRIBUTORS.TXT for a full list of copyright holders.
4 *
5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions are met:
7 * * Redistributions of source code must retain the above copyright
8 * notice, this list of conditions and the following disclaimer.
9 * * Redistributions in binary form must reproduce the above copyright
10 * notice, this list of conditions and the following disclaimer in the
11 * documentation and/or other materials provided with the distribution.
12 * * Neither the name of the OpenSimulator Project nor the
13 * names of its contributors may be used to endorse or promote products
14 * derived from this software without specific prior written permission.
15 *
16 * THIS SOFTWARE IS PROVIDED BY THE DEVELOPERS ``AS IS'' AND ANY
17 * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
18 * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
19 * DISCLAIMED. IN NO EVENT SHALL THE CONTRIBUTORS BE LIABLE FOR ANY
20 * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
21 * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
22 * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
23 * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
24 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
25 * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
26 */
27
28using System;
29using System.Collections;
30using System.IO;
31using System.Net;
32using System.Reflection;
33using System.Security;
34using System.Text;
35using log4net;
36using Nini.Config;
37using Nwc.XmlRpc;
38using OpenSim.Framework;
39using OpenSim.Framework.Servers.HttpServer;
40using OpenMetaverse.StructuredData;
41
42
43namespace OpenSim.Server.Handlers.Grid
44{
45 /// <summary>
46 /// Grid extra features handlers.
47 /// <para>Allows grid level configuration of OpenSimExtra items.</para>
48 /// <para>Option to control region override of these settings.</para>
49 /// </summary>
50 public class GridExtraFeaturesHandlers
51 {
52 private static readonly ILog m_Log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
53 private Hashtable m_ExtraFeatures = new Hashtable();
54 private bool m_AllowRegionOverride = true;
55
56 public GridExtraFeaturesHandlers(IConfigSource configSource)
57 {
58 try
59 {
60 IConfig featuresCfg = configSource.Configs["GridExtraFeatures"];
61
62 foreach( string key in featuresCfg.GetKeys())
63 {
64 if(key != "AllowRegionOverride")
65 {
66 string value = featuresCfg.GetString(key);
67
68 // map the value to the viewer supported extra features
69 // add additional ones here as support is added in the viewer
70 // and place the configuration option in [GridExtraFeatures].
71 switch(key)
72 {
73 case "SearchServerURI":
74 m_ExtraFeatures["search-server-url"] = value;
75 break;
76 case "MapImageServerURI":
77 m_ExtraFeatures["map-server-url"] = value;
78 break;
79 case "DestinationGuideURI":
80 m_ExtraFeatures["destination-guide-url"] = value;
81 break;
82 case "ExportSupported":
83 m_ExtraFeatures["ExportSupported"] = value;
84 break;
85 case "WhisperDistance":
86 m_ExtraFeatures["whisper-range"] = value;
87 break;
88 case "SayDistance":
89 m_ExtraFeatures["say-range"] = value;
90 break;
91 case "ShoutDistance":
92 m_ExtraFeatures["shout-range"] = value;
93 break;
94 default:
95 m_Log.InfoFormat("{0} not yet supported.");
96 break;
97 }
98 }
99 else
100 m_AllowRegionOverride = featuresCfg.GetBoolean(key);
101 }
102 }
103 catch (Exception)
104 {
105 m_Log.Warn("[GRID EXTRA FEATURES SERVICE]: Cannot get grid features from config source, allowing region override");
106 }
107 }
108
109 public bool JsonGetGridFeaturesMethod(OSDMap json, ref JsonRpcResponse response)
110 {
111 OSDMap features = new OSDMap();
112 OSDMap json_map = new OSDMap();
113
114 foreach (string key in m_ExtraFeatures.Keys)
115 {
116 features[key] = OSD.FromString(m_ExtraFeatures[key].ToString());
117 }
118
119 json_map["extra_features"] = features;
120 json_map["region_override"] = m_AllowRegionOverride.ToString();
121
122 response.Result = json_map;
123
124 return true;
125 }
126 }
127} \ No newline at end of file
diff --git a/OpenSim/Server/Handlers/Grid/GridExtraFeaturesServerInConnector.cs b/OpenSim/Server/Handlers/Grid/GridExtraFeaturesServerInConnector.cs
deleted file mode 100644
index f57a4b3..0000000
--- a/OpenSim/Server/Handlers/Grid/GridExtraFeaturesServerInConnector.cs
+++ /dev/null
@@ -1,50 +0,0 @@
1/*
2 * Copyright (c) Contributors, http://opensimulator.org/
3 * See CONTRIBUTORS.TXT for a full list of copyright holders.
4 *
5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions are met:
7 * * Redistributions of source code must retain the above copyright
8 * notice, this list of conditions and the following disclaimer.
9 * * Redistributions in binary form must reproduce the above copyright
10 * notice, this list of conditions and the following disclaimer in the
11 * documentation and/or other materials provided with the distribution.
12 * * Neither the name of the OpenSimulator Project nor the
13 * names of its contributors may be used to endorse or promote products
14 * derived from this software without specific prior written permission.
15 *
16 * THIS SOFTWARE IS PROVIDED BY THE DEVELOPERS ``AS IS'' AND ANY
17 * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
18 * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
19 * DISCLAIMED. IN NO EVENT SHALL THE CONTRIBUTORS BE LIABLE FOR ANY
20 * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
21 * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
22 * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
23 * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
24 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
25 * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
26 */
27
28using System;
29using System.Collections.Generic;
30using System.Reflection;
31using log4net;
32using OpenMetaverse;
33using Nini.Config;
34using OpenSim.Framework;
35using OpenSim.Framework.Servers.HttpServer;
36using OpenSim.Server.Handlers.Base;
37
38namespace OpenSim.Server.Handlers.Grid
39{
40 public class GridExtraFeaturesServerInConnector : ServiceConnector
41 {
42 public GridExtraFeaturesServerInConnector(IConfigSource config, IHttpServer server, string configName) :
43 base(config, server, configName)
44 {
45 GridExtraFeaturesHandlers handler = new GridExtraFeaturesHandlers(config);
46
47 server.AddJsonRPCHandler("get_extra_features", handler.JsonGetGridFeaturesMethod);
48 }
49 }
50}
diff --git a/OpenSim/Server/Handlers/Grid/GridServerPostHandler.cs b/OpenSim/Server/Handlers/Grid/GridServerPostHandler.cs
index d5a9d67..849fa94 100644
--- a/OpenSim/Server/Handlers/Grid/GridServerPostHandler.cs
+++ b/OpenSim/Server/Handlers/Grid/GridServerPostHandler.cs
@@ -122,6 +122,9 @@ namespace OpenSim.Server.Handlers.Grid
122 122
123 case "get_region_flags": 123 case "get_region_flags":
124 return GetRegionFlags(request); 124 return GetRegionFlags(request);
125
126 case "get_grid_extra_features":
127 return GetGridExtraFeatures(request);
125 } 128 }
126 129
127 m_log.DebugFormat("[GRID HANDLER]: unknown method request {0}", method); 130 m_log.DebugFormat("[GRID HANDLER]: unknown method request {0}", method);
@@ -578,6 +581,22 @@ namespace OpenSim.Server.Handlers.Grid
578 //m_log.DebugFormat("[GRID HANDLER]: resp string: {0}", xmlString); 581 //m_log.DebugFormat("[GRID HANDLER]: resp string: {0}", xmlString);
579 return Util.UTF8NoBomEncoding.GetBytes(xmlString); 582 return Util.UTF8NoBomEncoding.GetBytes(xmlString);
580 } 583 }
584
585 byte[] GetGridExtraFeatures(Dictionary<string, object> request)
586 {
587
588 Dictionary<string, object> result = new Dictionary<string, object> ();
589 Dictionary<string, object> extraFeatures = m_GridService.GetExtraFeatures ();
590
591 foreach (string key in extraFeatures.Keys)
592 {
593 result [key] = extraFeatures [key];
594 }
595
596 string xmlString = ServerUtils.BuildXmlResponse(result);
597
598 return Util.UTF8NoBomEncoding.GetBytes(xmlString);
599 }
581 600
582 #endregion 601 #endregion
583 602
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
28using System; 28using System;
29using System.Collections;
29using System.Collections.Generic; 30using System.Collections.Generic;
30using System.Net; 31using System.Net;
31using System.Net.Sockets; 32using 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
diff --git a/bin/OpenSim.ini.example b/bin/OpenSim.ini.example
index f0e1a8a..8c1a2c6 100644
--- a/bin/OpenSim.ini.example
+++ b/bin/OpenSim.ini.example
@@ -538,21 +538,18 @@
538 538
539 539
540[SimulatorFeatures] 540[SimulatorFeatures]
541 ;# {ExtraFeaturesServiceURI} {} {URL to the grid ExtraFeatures Service} {} 541
542 ;; The grid can supply global values for extra simulator features to be
543 ;; passed to supporting viewers. The grid may choose to disallow local
544 ;; settings.
545 ; ExtraFeaturesServiceURI = "http://127.0.0.1:9000/"
546 ;# {MapImageServerURI} {} {URL for the map server} {}
547 ; Experimental new information sent in SimulatorFeatures cap for Kokua
548 ; viewers
549 ; meant to override the MapImage and search server url given at login, and varying
550 ; on a sim-basis.
551 ; Viewers that don't understand it, will ignore it
552 ;MapImageServerURI = "http://127.0.0.1:9000/"
553 ;# {SearchServerURI} {} {URL of the search server} {} 542 ;# {SearchServerURI} {} {URL of the search server} {}
543 ;; This is identical to the Robust LoginService SearchURL setting
544 ;; and will override that value if set here. The Robust setting
545 ;; provides a working default for the grid and setting here is
546 ;; optional.
554 ;SearchServerURI = "http://127.0.0.1:9000/" 547 ;SearchServerURI = "http://127.0.0.1:9000/"
555 ;# {DestinationGuideURI} {} {URL of the destination guide} {} 548 ;# {DestinationGuideURI} {} {URL of the destination guide} {}
549 ;;
550 ;; This serves the same purpose as the DestinationGuideURI in the
551 ;; LoginService setting in the Robust server. This will override
552 ;; the Robust setting if desired as an option.
556 ;DestinationGuideURI = "http://127.0.0.1:9000/" 553 ;DestinationGuideURI = "http://127.0.0.1:9000/"
557 554
558 555
diff --git a/bin/Robust.HG.ini.example b/bin/Robust.HG.ini.example
index 2319117..fb6531e 100644
--- a/bin/Robust.HG.ini.example
+++ b/bin/Robust.HG.ini.example
@@ -45,7 +45,6 @@ InventoryInConnector = "8003/OpenSim.Server.Handlers.dll:XInventoryInConnector"
45;VoiceConnector = "8004/OpenSim.Server.Handlers.dll:FreeswitchServerConnector" 45;VoiceConnector = "8004/OpenSim.Server.Handlers.dll:FreeswitchServerConnector"
46GridServiceConnector = "8003/OpenSim.Server.Handlers.dll:GridServiceConnector" 46GridServiceConnector = "8003/OpenSim.Server.Handlers.dll:GridServiceConnector"
47GridInfoServerInConnector = "8002/OpenSim.Server.Handlers.dll:GridInfoServerInConnector" 47GridInfoServerInConnector = "8002/OpenSim.Server.Handlers.dll:GridInfoServerInConnector"
48GridExtraFeaturesServerInConnector = "8002/OpenSim.Server.Handlers.dll:GridExtraFeaturesServerInConnector"
49AuthenticationServiceConnector = "8003/OpenSim.Server.Handlers.dll:AuthenticationServiceConnector" 48AuthenticationServiceConnector = "8003/OpenSim.Server.Handlers.dll:AuthenticationServiceConnector"
50OpenIdServerConnector = "8002/OpenSim.Server.Handlers.dll:OpenIdServerConnector" 49OpenIdServerConnector = "8002/OpenSim.Server.Handlers.dll:OpenIdServerConnector"
51AvatarServiceConnector = "8003/OpenSim.Server.Handlers.dll:AvatarServiceConnector" 50AvatarServiceConnector = "8003/OpenSim.Server.Handlers.dll:AvatarServiceConnector"
@@ -217,6 +216,10 @@ HGAssetServiceConnector = "HGAssetService@8002/OpenSim.Server.Handlers.dll:Asset
217 ;; Allow Hyperlinks to be created at the console 216 ;; Allow Hyperlinks to be created at the console
218 HypergridLinker = true 217 HypergridLinker = true
219 218
219 ;; Allow supporting viewers to export content
220 ;; Set to false to prevent export
221 ExportSupported = true
222
220 ;; If you have this set under [Hypergrid], no need to set it here, leave it commented 223 ;; If you have this set under [Hypergrid], no need to set it here, leave it commented
221 ; GatekeeperURI = "http://127.0.0.1:8002" 224 ; GatekeeperURI = "http://127.0.0.1:8002"
222 225
@@ -366,6 +369,9 @@ HGAssetServiceConnector = "HGAssetService@8002/OpenSim.Server.Handlers.dll:Asset
366 ; For V2 map 369 ; For V2 map
367 MapTileURL = "http://127.0.0.1:8002"; 370 MapTileURL = "http://127.0.0.1:8002";
368 371
372 ; Url to search service
373 ; SearchURL = "http://127.0.0.1:8002";
374
369 ; For V2/3 Web Profiles 375 ; For V2/3 Web Profiles
370 ; Work in progress: The ProfileServerURL/OpenIDServerURL are 376 ; Work in progress: The ProfileServerURL/OpenIDServerURL are
371 ; being used in a development viewer as support for webprofiles 377 ; being used in a development viewer as support for webprofiles
@@ -485,38 +491,6 @@ HGAssetServiceConnector = "HGAssetService@8002/OpenSim.Server.Handlers.dll:Asset
485 ; this is the entry point for all user-related HG services 491 ; this is the entry point for all user-related HG services
486 ; uas = http://127.0.0.1:8002/ 492 ; uas = http://127.0.0.1:8002/
487 493
488
489[GridExtraFeatures]
490 ; These are propagated out to the regions as default settings for the
491 ; SimulatorFeatures to be sent to user's viewer when they teleport via
492 ; Hypergrid into this grid.
493 ;
494
495 ; Allow regions to override our defaults.
496 ;AllowRegionOverride = true
497
498 ; Search Server URI
499 ;SearchServerURI = "http://example.com:8200/"
500
501 ; Map Server URI
502 ;MapImageServerURI = "http://example.com:8200/"
503
504 ; Grid Destination Guide URI
505 ;DestinationGuideURI = "http://example.com:8200/"
506
507 ; Chat Whisper Distance
508 ;WhisperDistance = 10
509
510 ; Chat Say Distance
511 ;SayDistance = 20
512
513 ; Chat Shout Distance
514 ;ShoutDistance = 100
515
516 ; Grid Allow Export
517 ;ExportSupported = true
518
519
520[GatekeeperService] 494[GatekeeperService]
521 LocalServiceModule = "OpenSim.Services.HypergridService.dll:GatekeeperService" 495 LocalServiceModule = "OpenSim.Services.HypergridService.dll:GatekeeperService"
522 ;; for the service 496 ;; for the service
diff --git a/bin/Robust.ini.example b/bin/Robust.ini.example
index 99a932d..17c3dcd 100644
--- a/bin/Robust.ini.example
+++ b/bin/Robust.ini.example
@@ -36,7 +36,6 @@ InventoryInConnector = "8003/OpenSim.Server.Handlers.dll:XInventoryInConnector"
36;VoiceConnector = "8004/OpenSim.Server.Handlers.dll:FreeswitchServerConnector" 36;VoiceConnector = "8004/OpenSim.Server.Handlers.dll:FreeswitchServerConnector"
37GridServiceConnector = "8003/OpenSim.Server.Handlers.dll:GridServiceConnector" 37GridServiceConnector = "8003/OpenSim.Server.Handlers.dll:GridServiceConnector"
38GridInfoServerInConnector = "8002/OpenSim.Server.Handlers.dll:GridInfoServerInConnector" 38GridInfoServerInConnector = "8002/OpenSim.Server.Handlers.dll:GridInfoServerInConnector"
39GridExtraFeaturesServerInConnector = "8002/OpenSim.Server.Handlers.dll:GridExtraFeaturesServerInConnector"
40AuthenticationServiceConnector = "8003/OpenSim.Server.Handlers.dll:AuthenticationServiceConnector" 39AuthenticationServiceConnector = "8003/OpenSim.Server.Handlers.dll:AuthenticationServiceConnector"
41OpenIdServerConnector = "8002/OpenSim.Server.Handlers.dll:OpenIdServerConnector" 40OpenIdServerConnector = "8002/OpenSim.Server.Handlers.dll:OpenIdServerConnector"
42AvatarServiceConnector = "8003/OpenSim.Server.Handlers.dll:AvatarServiceConnector" 41AvatarServiceConnector = "8003/OpenSim.Server.Handlers.dll:AvatarServiceConnector"
@@ -178,6 +177,10 @@ MapGetServiceConnector = "8002/OpenSim.Server.Handlers.dll:MapGetServiceConnecto
178 ; Region_Welcome_Area = "DefaultRegion, FallbackRegion" 177 ; Region_Welcome_Area = "DefaultRegion, FallbackRegion"
179 ; (replace spaces with underscore) 178 ; (replace spaces with underscore)
180 179
180 ;; Allow supporting viewers to export content
181 ;; Set to false to prevent export
182 ExportSupported = true
183
181; * This is the configuration for the freeswitch server in grid mode 184; * This is the configuration for the freeswitch server in grid mode
182[FreeswitchService] 185[FreeswitchService]
183 LocalServiceModule = "OpenSim.Services.FreeswitchService.dll:FreeswitchService" 186 LocalServiceModule = "OpenSim.Services.FreeswitchService.dll:FreeswitchService"
@@ -325,6 +328,9 @@ MapGetServiceConnector = "8002/OpenSim.Server.Handlers.dll:MapGetServiceConnecto
325 ; For V2 map 328 ; For V2 map
326 MapTileURL = "http://127.0.0.1:8002"; 329 MapTileURL = "http://127.0.0.1:8002";
327 330
331 ; Url to search service
332 ; SearchURL = "http://127.0.0.1:8002";
333
328 ; For V2/3 Web Profiles 334 ; For V2/3 Web Profiles
329 ; Work in progress: The ProfileServerURL/OpenIDServerURL are 335 ; Work in progress: The ProfileServerURL/OpenIDServerURL are
330 ; being used in a development viewer as support for webprofiles 336 ; being used in a development viewer as support for webprofiles
@@ -457,38 +463,6 @@ MapGetServiceConnector = "8002/OpenSim.Server.Handlers.dll:MapGetServiceConnecto
457 ; password help: optional: page providing password assistance for users of your grid 463 ; password help: optional: page providing password assistance for users of your grid
458 ;password = http://127.0.0.1/password 464 ;password = http://127.0.0.1/password
459 465
460
461[GridExtraFeatures]
462 ; These are propagated out to the regions as default settings for the
463 ; SimulatorFeatures to be sent to user's viewer when they teleport via
464 ; Hypergrid into this grid.
465 ;
466
467 ; Allow regions to override our defaults.
468 ;AllowRegionOverride = true
469
470 ; Search Server URI
471 ;SearchServerURI = "http://example.com:8200/"
472
473 ; Map Server URI
474 ;MapImageServerURI = "http://example.com:8200/"
475
476 ; Grid Destination Guide URI
477 ;DestinationGuideURI = "http://example.com:8200/"
478
479 ; Chat Whisper Distance
480 ;WhisperDistance = 10
481
482 ; Chat Say Distance
483 ;SayDistance = 20
484
485 ; Chat Shout Distance
486 ;ShoutDistance = 100
487
488 ; Grid Allow Export
489 ;ExportSupported = true
490
491
492[UserProfilesService] 466[UserProfilesService]
493 LocalServiceModule = "OpenSim.Services.UserProfilesService.dll:UserProfilesService" 467 LocalServiceModule = "OpenSim.Services.UserProfilesService.dll:UserProfilesService"
494 Enabled = false 468 Enabled = false
diff --git a/bin/config-include/StandaloneCommon.ini.example b/bin/config-include/StandaloneCommon.ini.example
index 2bbc316..c4ece54 100644
--- a/bin/config-include/StandaloneCommon.ini.example
+++ b/bin/config-include/StandaloneCommon.ini.example
@@ -105,6 +105,10 @@
105 ;; For example: 105 ;; For example:
106 Region_Welcome_Area = "DefaultRegion, FallbackRegion" 106 Region_Welcome_Area = "DefaultRegion, FallbackRegion"
107 107
108 ;; Allow supporting viewers to export content
109 ;; Set to false to prevent export
110 ExportSupported = true
111
108 ; === HG ONLY === 112 ; === HG ONLY ===
109 ;; If you have this set under [Hypergrid], no need to set it here, leave it commented 113 ;; If you have this set under [Hypergrid], no need to set it here, leave it commented
110 ; GatekeeperURI="http://127.0.0.1:9000" 114 ; GatekeeperURI="http://127.0.0.1:9000"
@@ -128,6 +132,9 @@
128 ;; For Viewer 2 132 ;; For Viewer 2
129 MapTileURL = "http://127.0.0.1:9000/" 133 MapTileURL = "http://127.0.0.1:9000/"
130 134
135 ; Url to search service
136 ; SearchURL = "http://127.0.0.1:8002";
137
131 ; The minimum user level required for a user to be able to login. 0 by default 138 ; The minimum user level required for a user to be able to login. 0 by default
132 ; If you disable a particular user's account then you can set their login level below this number. 139 ; If you disable a particular user's account then you can set their login level below this number.
133 ; You can also change this level from the console though these changes will not be persisted. 140 ; You can also change this level from the console though these changes will not be persisted.