From 390137d540b9ae39eba3ba9136bd49d5e992bc5f Mon Sep 17 00:00:00 2001 From: Diva Canto Date: Mon, 21 Sep 2009 11:05:01 -0700 Subject: Added grid handler and grid remote connector. --- .../Server/Handlers/Grid/GridServerConnector.cs | 60 +++++ .../Server/Handlers/Grid/GridServerPostHandler.cs | 269 +++++++++++++++++++++ 2 files changed, 329 insertions(+) create mode 100644 OpenSim/Server/Handlers/Grid/GridServerConnector.cs create mode 100644 OpenSim/Server/Handlers/Grid/GridServerPostHandler.cs (limited to 'OpenSim/Server/Handlers/Grid') diff --git a/OpenSim/Server/Handlers/Grid/GridServerConnector.cs b/OpenSim/Server/Handlers/Grid/GridServerConnector.cs new file mode 100644 index 0000000..b80c479 --- /dev/null +++ b/OpenSim/Server/Handlers/Grid/GridServerConnector.cs @@ -0,0 +1,60 @@ +/* + * Copyright (c) Contributors, http://opensimulator.org/ + * See CONTRIBUTORS.TXT for a full list of copyright holders. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * * Neither the name of the OpenSimulator Project nor the + * names of its contributors may be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE DEVELOPERS ``AS IS'' AND ANY + * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED + * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + * DISCLAIMED. IN NO EVENT SHALL THE CONTRIBUTORS BE LIABLE FOR ANY + * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES + * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND + * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS + * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +using System; +using Nini.Config; +using OpenSim.Server.Base; +using OpenSim.Services.Interfaces; +using OpenSim.Framework.Servers.HttpServer; +using OpenSim.Server.Handlers.Base; + +namespace OpenSim.Server.Handlers.Grid +{ + public class GridServiceConnector : ServiceConnector + { + private IGridService m_GridService; + + public GridServiceConnector(IConfigSource config, IHttpServer server) : + base(config, server) + { + IConfig serverConfig = config.Configs["GridService"]; + if (serverConfig == null) + throw new Exception("No section 'Server' in config file"); + + string gridService = serverConfig.GetString("GridServiceModule", + String.Empty); + + if (gridService == String.Empty) + throw new Exception("No AuthenticationService in config file"); + + Object[] args = new Object[] { config }; + m_GridService = ServerUtils.LoadPlugin(gridService, args); + + server.AddStreamHandler(new GridServerPostHandler(m_GridService)); + } + } +} diff --git a/OpenSim/Server/Handlers/Grid/GridServerPostHandler.cs b/OpenSim/Server/Handlers/Grid/GridServerPostHandler.cs new file mode 100644 index 0000000..39c0584 --- /dev/null +++ b/OpenSim/Server/Handlers/Grid/GridServerPostHandler.cs @@ -0,0 +1,269 @@ +/* + * Copyright (c) Contributors, http://opensimulator.org/ + * See CONTRIBUTORS.TXT for a full list of copyright holders. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * * Neither the name of the OpenSimulator Project nor the + * names of its contributors may be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE DEVELOPERS ``AS IS'' AND ANY + * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED + * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + * DISCLAIMED. IN NO EVENT SHALL THE CONTRIBUTORS BE LIABLE FOR ANY + * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES + * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND + * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS + * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +using Nini.Config; +using log4net; +using System; +using System.Reflection; +using System.IO; +using System.Net; +using System.Text; +using System.Text.RegularExpressions; +using System.Xml; +using System.Xml.Serialization; +using System.Collections.Generic; +using OpenSim.Server.Base; +using OpenSim.Services.Interfaces; +using OpenSim.Framework; +using OpenSim.Framework.Servers.HttpServer; +using OpenMetaverse; + +namespace OpenSim.Server.Handlers.Grid +{ + public class GridServerPostHandler : BaseStreamHandler + { + private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); + + private IGridService m_GridService; + + public GridServerPostHandler(IGridService service) : + base("POST", "/grid") + { + m_GridService = service; + } + + public override byte[] Handle(string path, Stream requestData, + OSHttpRequest httpRequest, OSHttpResponse httpResponse) + { + StreamReader sr = new StreamReader(requestData); + string body = sr.ReadToEnd(); + sr.Close(); + + Dictionary request = + ServerUtils.ParseQueryString(body); + + if (!request.ContainsKey("METHOD")) + return FailureResult(); + + string method = request["METHOD"]; + + switch (method) + { + case "register": + return Register(request); + + case "deregister": + return Deregister(request); + + case "get_neighbours": + return GetNeighbours(request); + + case "get_region_by_uuid": + return GetRegionByUUID(request); + + case "get_region_by_position": + return GetRegionByPosition(request); + + case "get_region_by_name": + return GetRegionByName(request); + + case "get_regions_by_name": + return GetRegionsByName(request); + + case "get_region_range": + return GetRegionRange(request); + + default: + m_log.DebugFormat("[GRID HANDLER]: unknown method request {0}", method); + return FailureResult(); + } + + } + + #region Method-specific handlers + + byte[] Register(Dictionary request) + { + UUID scopeID = UUID.Zero; + if (request["SCOPEID"] != null) + UUID.TryParse(request["SCOPEID"], out scopeID); + else + m_log.WarnFormat("[GRID HANDLER]: no scopeID in request to register region"); + + Dictionary rinfoData = new Dictionary(); + foreach (KeyValuePair kvp in request) + rinfoData[kvp.Key] = kvp.Value; + SimpleRegionInfo rinfo = new SimpleRegionInfo(rinfoData); + + bool result = m_GridService.RegisterRegion(scopeID, rinfo); + + if (result) + return SuccessResult(); + else + return FailureResult(); + } + + byte[] Deregister(Dictionary request) + { + UUID regionID = UUID.Zero; + if (request["REGIONID"] != null) + UUID.TryParse(request["REGIONID"], out regionID); + else + m_log.WarnFormat("[GRID HANDLER]: no regionID in request to deregister region"); + + bool result = m_GridService.DeregisterRegion(regionID); + + if (result) + return SuccessResult(); + else + return FailureResult(); + + } + + byte[] GetNeighbours(Dictionary request) + { + UUID scopeID = UUID.Zero; + if (request["SCOPEID"] != null) + UUID.TryParse(request["SCOPEID"], out scopeID); + else + m_log.WarnFormat("[GRID HANDLER]: no scopeID in request to get neighbours"); + + UUID regionID = UUID.Zero; + if (request["REGIONID"] != null) + UUID.TryParse(request["REGIONID"], out scopeID); + else + m_log.WarnFormat("[GRID HANDLER]: no regionID in request to get neighbours"); + + List rinfos = m_GridService.GetNeighbours(scopeID, regionID); + + Dictionary result = new Dictionary(); + int i = 0; + foreach (SimpleRegionInfo rinfo in rinfos) + { + Dictionary rinfoDict = rinfo.ToKeyValuePairs(); + result["region" + i] = rinfoDict; + i++; + } + + string xmlString = ServerUtils.BuildXmlResponse(result); + UTF8Encoding encoding = new UTF8Encoding(); + return encoding.GetBytes(xmlString); + + } + + byte[] GetRegionByUUID(Dictionary request) + { + // TODO + return new byte[0]; + } + + byte[] GetRegionByPosition(Dictionary request) + { + // TODO + return new byte[0]; + } + + byte[] GetRegionByName(Dictionary request) + { + // TODO + return new byte[0]; + } + + byte[] GetRegionsByName(Dictionary request) + { + // TODO + return new byte[0]; + } + + byte[] GetRegionRange(Dictionary request) + { + // TODO + return new byte[0]; + } + + #endregion + + #region Misc + + private byte[] SuccessResult() + { + XmlDocument doc = new XmlDocument(); + + XmlNode xmlnode = doc.CreateNode(XmlNodeType.XmlDeclaration, + "", ""); + + doc.AppendChild(xmlnode); + + XmlElement rootElement = doc.CreateElement("", "ServerResponse", + ""); + + doc.AppendChild(rootElement); + + XmlElement result = doc.CreateElement("", "Result", ""); + result.AppendChild(doc.CreateTextNode("Success")); + + rootElement.AppendChild(result); + + return DocToBytes(doc); + } + + private byte[] FailureResult() + { + XmlDocument doc = new XmlDocument(); + + XmlNode xmlnode = doc.CreateNode(XmlNodeType.XmlDeclaration, + "", ""); + + doc.AppendChild(xmlnode); + + XmlElement rootElement = doc.CreateElement("", "ServerResponse", + ""); + + doc.AppendChild(rootElement); + + XmlElement result = doc.CreateElement("", "Result", ""); + result.AppendChild(doc.CreateTextNode("Failure")); + + rootElement.AppendChild(result); + + return DocToBytes(doc); + } + + private byte[] DocToBytes(XmlDocument doc) + { + MemoryStream ms = new MemoryStream(); + XmlTextWriter xw = new XmlTextWriter(ms, null); + xw.Formatting = Formatting.Indented; + doc.WriteTo(xw); + xw.Flush(); + + return ms.GetBuffer(); + } + + #endregion + } +} -- cgit v1.1 From 34f4738159300ab6370e3db47df5187b6cea8771 Mon Sep 17 00:00:00 2001 From: Diva Canto Date: Tue, 22 Sep 2009 11:58:40 -0700 Subject: Added HGGridConnector and related code. --- OpenSim/Server/Handlers/Grid/GridServerConnector.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'OpenSim/Server/Handlers/Grid') diff --git a/OpenSim/Server/Handlers/Grid/GridServerConnector.cs b/OpenSim/Server/Handlers/Grid/GridServerConnector.cs index b80c479..7bf2e66 100644 --- a/OpenSim/Server/Handlers/Grid/GridServerConnector.cs +++ b/OpenSim/Server/Handlers/Grid/GridServerConnector.cs @@ -49,7 +49,7 @@ namespace OpenSim.Server.Handlers.Grid String.Empty); if (gridService == String.Empty) - throw new Exception("No AuthenticationService in config file"); + throw new Exception("No GridService in config file"); Object[] args = new Object[] { config }; m_GridService = ServerUtils.LoadPlugin(gridService, args); -- cgit v1.1 From 882d2c9cc399c4c7d1809702104ce94c9c2c7b17 Mon Sep 17 00:00:00 2001 From: Diva Canto Date: Tue, 22 Sep 2009 20:25:00 -0700 Subject: Added hg console commands to the module. Added the IN connector module for link-region and corresponding handler to be used in the regions only. No service as such is needed. This will replace the current link-region machinery. Compiles but not tested. --- .../Handlers/Grid/HypergridServerConnector.cs | 112 +++++++++++++++++++++ 1 file changed, 112 insertions(+) create mode 100644 OpenSim/Server/Handlers/Grid/HypergridServerConnector.cs (limited to 'OpenSim/Server/Handlers/Grid') diff --git a/OpenSim/Server/Handlers/Grid/HypergridServerConnector.cs b/OpenSim/Server/Handlers/Grid/HypergridServerConnector.cs new file mode 100644 index 0000000..b8d9c7d --- /dev/null +++ b/OpenSim/Server/Handlers/Grid/HypergridServerConnector.cs @@ -0,0 +1,112 @@ +/* + * Copyright (c) Contributors, http://opensimulator.org/ + * See CONTRIBUTORS.TXT for a full list of copyright holders. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * * Neither the name of the OpenSimulator Project nor the + * names of its contributors may be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE DEVELOPERS ``AS IS'' AND ANY + * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED + * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + * DISCLAIMED. IN NO EVENT SHALL THE CONTRIBUTORS BE LIABLE FOR ANY + * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES + * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND + * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS + * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +using System; +using System.Collections; +using System.Collections.Generic; +using System.Reflection; +using System.Net; +using Nini.Config; +using OpenSim.Framework; +using OpenSim.Server.Base; +using OpenSim.Services.Interfaces; +using OpenSim.Framework.Servers.HttpServer; +using OpenSim.Server.Handlers.Base; + +using log4net; +using Nwc.XmlRpc; + +namespace OpenSim.Server.Handlers.Grid +{ + public class HypergridServiceInConnector : ServiceConnector + { + private static readonly ILog m_log = + LogManager.GetLogger( + MethodBase.GetCurrentMethod().DeclaringType); + + private List m_RegionsOnSim = new List(); + + public HypergridServiceInConnector(IConfigSource config, IHttpServer server) : + base(config, server) + { + server.AddXmlRPCHandler("link_region", LinkRegionRequest, false); + } + + /// + /// Someone wants to link to us + /// + /// + /// + public XmlRpcResponse LinkRegionRequest(XmlRpcRequest request, IPEndPoint remoteClient) + { + Hashtable requestData = (Hashtable)request.Params[0]; + //string host = (string)requestData["host"]; + //string portstr = (string)requestData["port"]; + string name = (string)requestData["region_name"]; + + m_log.DebugFormat("[HGrid]: Hyperlink request"); + + SimpleRegionInfo regInfo = null; + foreach (SimpleRegionInfo r in m_RegionsOnSim) + { + if ((r.RegionName != null) && (name != null) && (r.RegionName.ToLower() == name.ToLower())) + { + regInfo = r; + break; + } + } + + if (regInfo == null) + regInfo = m_RegionsOnSim[0]; // Send out the first region + + Hashtable hash = new Hashtable(); + hash["uuid"] = regInfo.RegionID.ToString(); + hash["handle"] = regInfo.RegionHandle.ToString(); + //m_log.Debug(">> Here " + regInfo.RegionHandle); + //hash["region_image"] = regInfo.RegionSettings.TerrainImageID.ToString(); + hash["region_name"] = regInfo.RegionName; + hash["internal_port"] = regInfo.InternalEndPoint.Port.ToString(); + //m_log.Debug(">> Here: " + regInfo.InternalEndPoint.Port); + + + XmlRpcResponse response = new XmlRpcResponse(); + response.Value = hash; + return response; + } + + public void AddRegion(SimpleRegionInfo rinfo) + { + m_RegionsOnSim.Add(rinfo); + } + + public void RemoveRegion(SimpleRegionInfo rinfo) + { + if (m_RegionsOnSim.Contains(rinfo)) + m_RegionsOnSim.Remove(rinfo); + } + } +} -- cgit v1.1 From 67276589c883fe1a74d8d52057db1431d637dade Mon Sep 17 00:00:00 2001 From: Diva Canto Date: Wed, 23 Sep 2009 17:20:07 -0700 Subject: Changed IGridService to use the new GridRegion data structure instead of old SimpleRegionInfo. Added grid configs to standalones. --- OpenSim/Server/Handlers/Grid/GridServerPostHandler.cs | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'OpenSim/Server/Handlers/Grid') diff --git a/OpenSim/Server/Handlers/Grid/GridServerPostHandler.cs b/OpenSim/Server/Handlers/Grid/GridServerPostHandler.cs index 39c0584..e72c2eb 100644 --- a/OpenSim/Server/Handlers/Grid/GridServerPostHandler.cs +++ b/OpenSim/Server/Handlers/Grid/GridServerPostHandler.cs @@ -38,6 +38,7 @@ using System.Xml.Serialization; using System.Collections.Generic; using OpenSim.Server.Base; using OpenSim.Services.Interfaces; +using GridRegion = OpenSim.Services.Interfaces.GridRegion; using OpenSim.Framework; using OpenSim.Framework.Servers.HttpServer; using OpenMetaverse; @@ -117,7 +118,7 @@ namespace OpenSim.Server.Handlers.Grid Dictionary rinfoData = new Dictionary(); foreach (KeyValuePair kvp in request) rinfoData[kvp.Key] = kvp.Value; - SimpleRegionInfo rinfo = new SimpleRegionInfo(rinfoData); + GridRegion rinfo = new GridRegion(rinfoData); bool result = m_GridService.RegisterRegion(scopeID, rinfo); @@ -158,11 +159,11 @@ namespace OpenSim.Server.Handlers.Grid else m_log.WarnFormat("[GRID HANDLER]: no regionID in request to get neighbours"); - List rinfos = m_GridService.GetNeighbours(scopeID, regionID); + List rinfos = m_GridService.GetNeighbours(scopeID, regionID); Dictionary result = new Dictionary(); int i = 0; - foreach (SimpleRegionInfo rinfo in rinfos) + foreach (GridRegion rinfo in rinfos) { Dictionary rinfoDict = rinfo.ToKeyValuePairs(); result["region" + i] = rinfoDict; -- cgit v1.1 From 2824bbc47b30ab6fb9a12bce3201bb5b79b20bd5 Mon Sep 17 00:00:00 2001 From: Diva Canto Date: Thu, 24 Sep 2009 05:48:35 -0700 Subject: Changed name of the hyperlink XMLRPC method to linkk-region, so that it doesn't conflict with the existing one. --- OpenSim/Server/Handlers/Grid/HypergridServerConnector.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'OpenSim/Server/Handlers/Grid') diff --git a/OpenSim/Server/Handlers/Grid/HypergridServerConnector.cs b/OpenSim/Server/Handlers/Grid/HypergridServerConnector.cs index b8d9c7d..ad63485 100644 --- a/OpenSim/Server/Handlers/Grid/HypergridServerConnector.cs +++ b/OpenSim/Server/Handlers/Grid/HypergridServerConnector.cs @@ -53,7 +53,7 @@ namespace OpenSim.Server.Handlers.Grid public HypergridServiceInConnector(IConfigSource config, IHttpServer server) : base(config, server) { - server.AddXmlRPCHandler("link_region", LinkRegionRequest, false); + server.AddXmlRPCHandler("linkk_region", LinkRegionRequest, false); } /// -- cgit v1.1 From dd3d52ae1faefbca85e2fe8d8cea67f7db4005ac Mon Sep 17 00:00:00 2001 From: Diva Canto Date: Thu, 24 Sep 2009 13:33:58 -0700 Subject: Added test GridClient, which allowed me to remove a few bugs out of the new code. --- OpenSim/Server/Handlers/Grid/GridServerConnector.cs | 2 +- OpenSim/Server/Handlers/Grid/GridServerPostHandler.cs | 11 +++++++---- 2 files changed, 8 insertions(+), 5 deletions(-) (limited to 'OpenSim/Server/Handlers/Grid') diff --git a/OpenSim/Server/Handlers/Grid/GridServerConnector.cs b/OpenSim/Server/Handlers/Grid/GridServerConnector.cs index 7bf2e66..ebdf489 100644 --- a/OpenSim/Server/Handlers/Grid/GridServerConnector.cs +++ b/OpenSim/Server/Handlers/Grid/GridServerConnector.cs @@ -45,7 +45,7 @@ namespace OpenSim.Server.Handlers.Grid if (serverConfig == null) throw new Exception("No section 'Server' in config file"); - string gridService = serverConfig.GetString("GridServiceModule", + string gridService = serverConfig.GetString("LocalServiceModule", String.Empty); if (gridService == String.Empty) diff --git a/OpenSim/Server/Handlers/Grid/GridServerPostHandler.cs b/OpenSim/Server/Handlers/Grid/GridServerPostHandler.cs index e72c2eb..eaeed6f 100644 --- a/OpenSim/Server/Handlers/Grid/GridServerPostHandler.cs +++ b/OpenSim/Server/Handlers/Grid/GridServerPostHandler.cs @@ -63,6 +63,7 @@ namespace OpenSim.Server.Handlers.Grid StreamReader sr = new StreamReader(requestData); string body = sr.ReadToEnd(); sr.Close(); + body = body.Trim(); Dictionary request = ServerUtils.ParseQueryString(body); @@ -98,11 +99,11 @@ namespace OpenSim.Server.Handlers.Grid case "get_region_range": return GetRegionRange(request); - default: - m_log.DebugFormat("[GRID HANDLER]: unknown method request {0}", method); - return FailureResult(); } + m_log.DebugFormat("[GRID HANDLER XXX]: unknown method {0} request {1}", method.Length, method); + return FailureResult(); + } #region Method-specific handlers @@ -155,11 +156,12 @@ namespace OpenSim.Server.Handlers.Grid UUID regionID = UUID.Zero; if (request["REGIONID"] != null) - UUID.TryParse(request["REGIONID"], out scopeID); + UUID.TryParse(request["REGIONID"], out regionID); else m_log.WarnFormat("[GRID HANDLER]: no regionID in request to get neighbours"); List rinfos = m_GridService.GetNeighbours(scopeID, regionID); + //m_log.DebugFormat("[GRID HANDLER]: neighbours for region {0}: {1}", regionID, rinfos.Count); Dictionary result = new Dictionary(); int i = 0; @@ -171,6 +173,7 @@ namespace OpenSim.Server.Handlers.Grid } string xmlString = ServerUtils.BuildXmlResponse(result); + //m_log.DebugFormat("[GRID HANDLER]: resp string: {0}", xmlString); UTF8Encoding encoding = new UTF8Encoding(); return encoding.GetBytes(xmlString); -- cgit v1.1 From 1faaa0a43a851c44af40336336ddbe3a7dbe83af Mon Sep 17 00:00:00 2001 From: Diva Canto Date: Thu, 24 Sep 2009 15:30:00 -0700 Subject: GridServerPostHandler finished. GridClient tests all work. More guards on getting parameters and replies over the wire. --- .../Server/Handlers/Grid/GridServerPostHandler.cs | 187 +++++++++++++++++++-- 1 file changed, 172 insertions(+), 15 deletions(-) (limited to 'OpenSim/Server/Handlers/Grid') diff --git a/OpenSim/Server/Handlers/Grid/GridServerPostHandler.cs b/OpenSim/Server/Handlers/Grid/GridServerPostHandler.cs index eaeed6f..f50e6a2 100644 --- a/OpenSim/Server/Handlers/Grid/GridServerPostHandler.cs +++ b/OpenSim/Server/Handlers/Grid/GridServerPostHandler.cs @@ -164,12 +164,17 @@ namespace OpenSim.Server.Handlers.Grid //m_log.DebugFormat("[GRID HANDLER]: neighbours for region {0}: {1}", regionID, rinfos.Count); Dictionary result = new Dictionary(); - int i = 0; - foreach (GridRegion rinfo in rinfos) + if ((rinfos == null) || ((rinfos != null) && (rinfos.Count == 0))) + result["result"] = "null"; + else { - Dictionary rinfoDict = rinfo.ToKeyValuePairs(); - result["region" + i] = rinfoDict; - i++; + int i = 0; + foreach (GridRegion rinfo in rinfos) + { + Dictionary rinfoDict = rinfo.ToKeyValuePairs(); + result["region" + i] = rinfoDict; + i++; + } } string xmlString = ServerUtils.BuildXmlResponse(result); @@ -181,32 +186,184 @@ namespace OpenSim.Server.Handlers.Grid byte[] GetRegionByUUID(Dictionary request) { - // TODO - return new byte[0]; + UUID scopeID = UUID.Zero; + if (request["SCOPEID"] != null) + UUID.TryParse(request["SCOPEID"], out scopeID); + else + m_log.WarnFormat("[GRID HANDLER]: no scopeID in request to get neighbours"); + + UUID regionID = UUID.Zero; + if (request["REGIONID"] != null) + UUID.TryParse(request["REGIONID"], out regionID); + else + m_log.WarnFormat("[GRID HANDLER]: no regionID in request to get neighbours"); + + GridRegion rinfo = m_GridService.GetRegionByUUID(scopeID, regionID); + //m_log.DebugFormat("[GRID HANDLER]: neighbours for region {0}: {1}", regionID, rinfos.Count); + + Dictionary result = new Dictionary(); + if (rinfo == null) + result["result"] = "null"; + else + result["result"] = rinfo.ToKeyValuePairs(); + + string xmlString = ServerUtils.BuildXmlResponse(result); + //m_log.DebugFormat("[GRID HANDLER]: resp string: {0}", xmlString); + UTF8Encoding encoding = new UTF8Encoding(); + return encoding.GetBytes(xmlString); } byte[] GetRegionByPosition(Dictionary request) { - // TODO - return new byte[0]; + UUID scopeID = UUID.Zero; + if (request["SCOPEID"] != null) + UUID.TryParse(request["SCOPEID"], out scopeID); + else + m_log.WarnFormat("[GRID HANDLER]: no scopeID in request to get region by position"); + + int x = 0, y = 0; + if (request["X"] != null) + Int32.TryParse(request["X"], out x); + else + m_log.WarnFormat("[GRID HANDLER]: no X in request to get region by position"); + if (request["Y"] != null) + Int32.TryParse(request["Y"], out y); + else + m_log.WarnFormat("[GRID HANDLER]: no Y in request to get region by position"); + + GridRegion rinfo = m_GridService.GetRegionByPosition(scopeID, x, y); + //m_log.DebugFormat("[GRID HANDLER]: neighbours for region {0}: {1}", regionID, rinfos.Count); + + Dictionary result = new Dictionary(); + if (rinfo == null) + result["result"] = "null"; + else + result["result"] = rinfo.ToKeyValuePairs(); + + string xmlString = ServerUtils.BuildXmlResponse(result); + //m_log.DebugFormat("[GRID HANDLER]: resp string: {0}", xmlString); + UTF8Encoding encoding = new UTF8Encoding(); + return encoding.GetBytes(xmlString); } byte[] GetRegionByName(Dictionary request) { - // TODO - return new byte[0]; + UUID scopeID = UUID.Zero; + if (request["SCOPEID"] != null) + UUID.TryParse(request["SCOPEID"], out scopeID); + else + m_log.WarnFormat("[GRID HANDLER]: no scopeID in request to get region by name"); + + string regionName = string.Empty; + if (request["NAME"] != null) + regionName = request["NAME"]; + else + m_log.WarnFormat("[GRID HANDLER]: no name in request to get region by name"); + + GridRegion rinfo = m_GridService.GetRegionByName(scopeID, regionName); + //m_log.DebugFormat("[GRID HANDLER]: neighbours for region {0}: {1}", regionID, rinfos.Count); + + Dictionary result = new Dictionary(); + if (rinfo == null) + result["result"] = "null"; + else + result["result"] = rinfo.ToKeyValuePairs(); + + string xmlString = ServerUtils.BuildXmlResponse(result); + //m_log.DebugFormat("[GRID HANDLER]: resp string: {0}", xmlString); + UTF8Encoding encoding = new UTF8Encoding(); + return encoding.GetBytes(xmlString); } byte[] GetRegionsByName(Dictionary request) { - // TODO - return new byte[0]; + UUID scopeID = UUID.Zero; + if (request["SCOPEID"] != null) + UUID.TryParse(request["SCOPEID"], out scopeID); + else + m_log.WarnFormat("[GRID HANDLER]: no scopeID in request to get regions by name"); + + string regionName = string.Empty; + if (request["NAME"] != null) + regionName = request["NAME"]; + else + m_log.WarnFormat("[GRID HANDLER]: no NAME in request to get regions by name"); + + int max = 0; + if (request["MAX"] != null) + Int32.TryParse(request["MAX"], out max); + else + m_log.WarnFormat("[GRID HANDLER]: no MAX in request to get regions by name"); + + List rinfos = m_GridService.GetRegionsByName(scopeID, regionName, max); + //m_log.DebugFormat("[GRID HANDLER]: neighbours for region {0}: {1}", regionID, rinfos.Count); + + Dictionary result = new Dictionary(); + if ((rinfos == null) || ((rinfos != null) && (rinfos.Count == 0))) + result["result"] = "null"; + else + { + int i = 0; + foreach (GridRegion rinfo in rinfos) + { + Dictionary rinfoDict = rinfo.ToKeyValuePairs(); + result["region" + i] = rinfoDict; + i++; + } + } + + string xmlString = ServerUtils.BuildXmlResponse(result); + //m_log.DebugFormat("[GRID HANDLER]: resp string: {0}", xmlString); + UTF8Encoding encoding = new UTF8Encoding(); + return encoding.GetBytes(xmlString); } byte[] GetRegionRange(Dictionary request) { - // TODO - return new byte[0]; + UUID scopeID = UUID.Zero; + if (request["SCOPEID"] != null) + UUID.TryParse(request["SCOPEID"], out scopeID); + else + m_log.WarnFormat("[GRID HANDLER]: no scopeID in request to get region range"); + + int xmin = 0, xmax = 0, ymin = 0, ymax = 0; + if (request["XMIN"] != null) + Int32.TryParse(request["XMIN"], out xmin); + else + m_log.WarnFormat("[GRID HANDLER]: no XMIN in request to get region range"); + if (request["XMAX"] != null) + Int32.TryParse(request["XMAX"], out xmax); + else + m_log.WarnFormat("[GRID HANDLER]: no XMAX in request to get region range"); + if (request["YMIN"] != null) + Int32.TryParse(request["YMIN"], out ymin); + else + m_log.WarnFormat("[GRID HANDLER]: no YMIN in request to get region range"); + if (request["YMAX"] != null) + Int32.TryParse(request["YMAX"], out ymax); + else + m_log.WarnFormat("[GRID HANDLER]: no YMAX in request to get region range"); + + + List rinfos = m_GridService.GetRegionRange(scopeID, xmin, xmax, ymin, ymax); + + Dictionary result = new Dictionary(); + if ((rinfos == null) || ((rinfos != null) && (rinfos.Count == 0))) + result["result"] = "null"; + else + { + int i = 0; + foreach (GridRegion rinfo in rinfos) + { + Dictionary rinfoDict = rinfo.ToKeyValuePairs(); + result["region" + i] = rinfoDict; + i++; + } + } + string xmlString = ServerUtils.BuildXmlResponse(result); + //m_log.DebugFormat("[GRID HANDLER]: resp string: {0}", xmlString); + UTF8Encoding encoding = new UTF8Encoding(); + return encoding.GetBytes(xmlString); } #endregion -- cgit v1.1 From b2772b3a2ded5149db6cd31dab745c2369d74075 Mon Sep 17 00:00:00 2001 From: Diva Canto Date: Fri, 25 Sep 2009 07:38:05 -0700 Subject: Added GridForm.html in Tests/Clients/Grid that shows how to interact with a grid server via regular Web forms. May be good for developing administrative tools. --- OpenSim/Server/Handlers/Grid/GridServerPostHandler.cs | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) (limited to 'OpenSim/Server/Handlers/Grid') diff --git a/OpenSim/Server/Handlers/Grid/GridServerPostHandler.cs b/OpenSim/Server/Handlers/Grid/GridServerPostHandler.cs index f50e6a2..711639f 100644 --- a/OpenSim/Server/Handlers/Grid/GridServerPostHandler.cs +++ b/OpenSim/Server/Handlers/Grid/GridServerPostHandler.cs @@ -64,7 +64,9 @@ namespace OpenSim.Server.Handlers.Grid string body = sr.ReadToEnd(); sr.Close(); body = body.Trim(); - + + //m_log.DebugFormat("[XXX]: query String: {0}", body); + Dictionary request = ServerUtils.ParseQueryString(body); @@ -101,7 +103,7 @@ namespace OpenSim.Server.Handlers.Grid } - m_log.DebugFormat("[GRID HANDLER XXX]: unknown method {0} request {1}", method.Length, method); + m_log.DebugFormat("[GRID HANDLER]: unknown method {0} request {1}", method.Length, method); return FailureResult(); } @@ -320,26 +322,27 @@ namespace OpenSim.Server.Handlers.Grid byte[] GetRegionRange(Dictionary request) { + //m_log.DebugFormat("[GRID HANDLER]: GetRegionRange"); UUID scopeID = UUID.Zero; - if (request["SCOPEID"] != null) + if (request.ContainsKey("SCOPEID")) UUID.TryParse(request["SCOPEID"], out scopeID); else m_log.WarnFormat("[GRID HANDLER]: no scopeID in request to get region range"); int xmin = 0, xmax = 0, ymin = 0, ymax = 0; - if (request["XMIN"] != null) + if (request.ContainsKey("XMIN")) Int32.TryParse(request["XMIN"], out xmin); else m_log.WarnFormat("[GRID HANDLER]: no XMIN in request to get region range"); - if (request["XMAX"] != null) + if (request.ContainsKey("XMAX")) Int32.TryParse(request["XMAX"], out xmax); else m_log.WarnFormat("[GRID HANDLER]: no XMAX in request to get region range"); - if (request["YMIN"] != null) + if (request.ContainsKey("YMIN")) Int32.TryParse(request["YMIN"], out ymin); else m_log.WarnFormat("[GRID HANDLER]: no YMIN in request to get region range"); - if (request["YMAX"] != null) + if (request.ContainsKey("YMAX")) Int32.TryParse(request["YMAX"], out ymax); else m_log.WarnFormat("[GRID HANDLER]: no YMAX in request to get region range"); -- cgit v1.1 From dcfd08b8dd57e667db8e0b5900da4648a020160e Mon Sep 17 00:00:00 2001 From: Diva Canto Date: Sat, 26 Sep 2009 11:01:18 -0700 Subject: Fixed a bug with link-region. --- .../Server/Handlers/Grid/HypergridServerConnector.cs | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) (limited to 'OpenSim/Server/Handlers/Grid') diff --git a/OpenSim/Server/Handlers/Grid/HypergridServerConnector.cs b/OpenSim/Server/Handlers/Grid/HypergridServerConnector.cs index ad63485..d2e791b 100644 --- a/OpenSim/Server/Handlers/Grid/HypergridServerConnector.cs +++ b/OpenSim/Server/Handlers/Grid/HypergridServerConnector.cs @@ -36,6 +36,7 @@ using OpenSim.Server.Base; using OpenSim.Services.Interfaces; using OpenSim.Framework.Servers.HttpServer; using OpenSim.Server.Handlers.Base; +using GridRegion = OpenSim.Services.Interfaces.GridRegion; using log4net; using Nwc.XmlRpc; @@ -48,12 +49,12 @@ namespace OpenSim.Server.Handlers.Grid LogManager.GetLogger( MethodBase.GetCurrentMethod().DeclaringType); - private List m_RegionsOnSim = new List(); + private List m_RegionsOnSim = new List(); public HypergridServiceInConnector(IConfigSource config, IHttpServer server) : base(config, server) { - server.AddXmlRPCHandler("linkk_region", LinkRegionRequest, false); + server.AddXmlRPCHandler("link_region", LinkRegionRequest, false); } /// @@ -70,8 +71,8 @@ namespace OpenSim.Server.Handlers.Grid m_log.DebugFormat("[HGrid]: Hyperlink request"); - SimpleRegionInfo regInfo = null; - foreach (SimpleRegionInfo r in m_RegionsOnSim) + GridRegion regInfo = null; + foreach (GridRegion r in m_RegionsOnSim) { if ((r.RegionName != null) && (name != null) && (r.RegionName.ToLower() == name.ToLower())) { @@ -85,9 +86,9 @@ namespace OpenSim.Server.Handlers.Grid Hashtable hash = new Hashtable(); hash["uuid"] = regInfo.RegionID.ToString(); + m_log.Debug(">> Here " + regInfo.RegionID); hash["handle"] = regInfo.RegionHandle.ToString(); - //m_log.Debug(">> Here " + regInfo.RegionHandle); - //hash["region_image"] = regInfo.RegionSettings.TerrainImageID.ToString(); + hash["region_image"] = regInfo.TerrainImage.ToString(); hash["region_name"] = regInfo.RegionName; hash["internal_port"] = regInfo.InternalEndPoint.Port.ToString(); //m_log.Debug(">> Here: " + regInfo.InternalEndPoint.Port); @@ -98,12 +99,12 @@ namespace OpenSim.Server.Handlers.Grid return response; } - public void AddRegion(SimpleRegionInfo rinfo) + public void AddRegion(GridRegion rinfo) { m_RegionsOnSim.Add(rinfo); } - public void RemoveRegion(SimpleRegionInfo rinfo) + public void RemoveRegion(GridRegion rinfo) { if (m_RegionsOnSim.Contains(rinfo)) m_RegionsOnSim.Remove(rinfo); -- cgit v1.1 From f4bf581b96347b8d7f115eca74fa84a644eb729c Mon Sep 17 00:00:00 2001 From: Diva Canto Date: Sat, 26 Sep 2009 21:00:51 -0700 Subject: Moved all HG1 operations to HGGridConnector.cs and HypergridServerConnector.cs/HypergridServiceConnector.cs, away from Region.Communications and HGNetworkServersInfo. Fixed small bugs with hyperlinked regions' map positions. --- .../Handlers/Grid/HypergridServerConnector.cs | 111 +++++++++++++++++++-- 1 file changed, 103 insertions(+), 8 deletions(-) (limited to 'OpenSim/Server/Handlers/Grid') diff --git a/OpenSim/Server/Handlers/Grid/HypergridServerConnector.cs b/OpenSim/Server/Handlers/Grid/HypergridServerConnector.cs index d2e791b..c47f652 100644 --- a/OpenSim/Server/Handlers/Grid/HypergridServerConnector.cs +++ b/OpenSim/Server/Handlers/Grid/HypergridServerConnector.cs @@ -38,6 +38,7 @@ using OpenSim.Framework.Servers.HttpServer; using OpenSim.Server.Handlers.Base; using GridRegion = OpenSim.Services.Interfaces.GridRegion; +using OpenMetaverse; using log4net; using Nwc.XmlRpc; @@ -50,11 +51,25 @@ namespace OpenSim.Server.Handlers.Grid MethodBase.GetCurrentMethod().DeclaringType); private List m_RegionsOnSim = new List(); + private IHyperlinkService m_HyperlinkService; - public HypergridServiceInConnector(IConfigSource config, IHttpServer server) : + public HypergridServiceInConnector(IConfigSource config, IHttpServer server, IHyperlinkService hyperService) : base(config, server) { + m_HyperlinkService = hyperService; server.AddXmlRPCHandler("link_region", LinkRegionRequest, false); + server.AddXmlRPCHandler("expect_hg_user", ExpectHGUser, false); + } + + public void AddRegion(GridRegion rinfo) + { + m_RegionsOnSim.Add(rinfo); + } + + public void RemoveRegion(GridRegion rinfo) + { + if (m_RegionsOnSim.Contains(rinfo)) + m_RegionsOnSim.Remove(rinfo); } /// @@ -99,15 +114,95 @@ namespace OpenSim.Server.Handlers.Grid return response; } - public void AddRegion(GridRegion rinfo) + /// + /// Received from other HGrid nodes when a user wants to teleport here. This call allows + /// the region to prepare for direct communication from the client. Sends back an empty + /// xmlrpc response on completion. + /// This is somewhat similar to OGS1's ExpectUser, but with the additional task of + /// registering the user in the local user cache. + /// + /// + /// + public XmlRpcResponse ExpectHGUser(XmlRpcRequest request, IPEndPoint remoteClient) { - m_RegionsOnSim.Add(rinfo); - } + Hashtable requestData = (Hashtable)request.Params[0]; + ForeignUserProfileData userData = new ForeignUserProfileData(); - public void RemoveRegion(GridRegion rinfo) - { - if (m_RegionsOnSim.Contains(rinfo)) - m_RegionsOnSim.Remove(rinfo); + userData.FirstName = (string)requestData["firstname"]; + userData.SurName = (string)requestData["lastname"]; + userData.ID = new UUID((string)requestData["agent_id"]); + UUID sessionID = new UUID((string)requestData["session_id"]); + userData.HomeLocation = new Vector3((float)Convert.ToDecimal((string)requestData["startpos_x"]), + (float)Convert.ToDecimal((string)requestData["startpos_y"]), + (float)Convert.ToDecimal((string)requestData["startpos_z"])); + + userData.UserServerURI = (string)requestData["userserver_id"]; + userData.UserAssetURI = (string)requestData["assetserver_id"]; + userData.UserInventoryURI = (string)requestData["inventoryserver_id"]; + + m_log.DebugFormat("[HGrid]: Prepare for connection from {0} {1} (@{2}) UUID={3}", + userData.FirstName, userData.SurName, userData.UserServerURI, userData.ID); + + ulong userRegionHandle = 0; + int userhomeinternalport = 0; + if (requestData.ContainsKey("region_uuid")) + { + UUID uuid = UUID.Zero; + UUID.TryParse((string)requestData["region_uuid"], out uuid); + userData.HomeRegionID = uuid; + userRegionHandle = Convert.ToUInt64((string)requestData["regionhandle"]); + userData.UserHomeAddress = (string)requestData["home_address"]; + userData.UserHomePort = (string)requestData["home_port"]; + userhomeinternalport = Convert.ToInt32((string)requestData["internal_port"]); + + m_log.Debug("[HGrid]: home_address: " + userData.UserHomeAddress + + "; home_port: " + userData.UserHomePort); + } + else + m_log.WarnFormat("[HGrid]: User has no home region information"); + + XmlRpcResponse resp = new XmlRpcResponse(); + + // Let's check if someone is trying to get in with a stolen local identity. + // The need for this test is a consequence of not having truly global names :-/ + bool comingHome = false; + if (m_HyperlinkService.CheckUserAtEntry(userData.ID, sessionID, out comingHome) == false) + { + m_log.WarnFormat("[HGrid]: Access denied to foreign user."); + Hashtable respdata = new Hashtable(); + respdata["success"] = "FALSE"; + respdata["reason"] = "Foreign user has the same ID as a local user, or logins disabled."; + resp.Value = respdata; + return resp; + } + + // Finally, everything looks ok + //m_log.Debug("XXX---- EVERYTHING OK ---XXX"); + + if (!comingHome) + { + // We don't do this if the user is coming to the home grid + GridRegion home = new GridRegion(); + home.RegionID = userData.HomeRegionID; + home.ExternalHostName = userData.UserHomeAddress; + home.HttpPort = Convert.ToUInt32(userData.UserHomePort); + uint x = 0, y = 0; + Utils.LongToUInts(userRegionHandle, out x, out y); + home.RegionLocX = (int)x; + home.RegionLocY = (int)y; + home.InternalEndPoint = new IPEndPoint(IPAddress.Parse("0.0.0.0"), (int)userhomeinternalport); + + m_HyperlinkService.AcceptUser(userData, home); + } + // else the user is coming to a non-home region of the home grid + // We simply drop this user information altogether + + Hashtable respdata2 = new Hashtable(); + respdata2["success"] = "TRUE"; + resp.Value = respdata2; + + return resp; } + } } -- cgit v1.1 From 0ed7371f3ed97bfe10c88dd128c311699ec54a30 Mon Sep 17 00:00:00 2001 From: Melanie Date: Mon, 28 Sep 2009 13:27:33 +0100 Subject: Change DocToBytes to return no trailing whitespace. --- OpenSim/Server/Handlers/Grid/GridServerPostHandler.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'OpenSim/Server/Handlers/Grid') diff --git a/OpenSim/Server/Handlers/Grid/GridServerPostHandler.cs b/OpenSim/Server/Handlers/Grid/GridServerPostHandler.cs index 711639f..b9a4867 100644 --- a/OpenSim/Server/Handlers/Grid/GridServerPostHandler.cs +++ b/OpenSim/Server/Handlers/Grid/GridServerPostHandler.cs @@ -425,7 +425,7 @@ namespace OpenSim.Server.Handlers.Grid doc.WriteTo(xw); xw.Flush(); - return ms.GetBuffer(); + return ms.ToArray(); } #endregion -- cgit v1.1 From 9bdb585a93f824223f20f248e1411ba6da760624 Mon Sep 17 00:00:00 2001 From: Diva Canto Date: Mon, 28 Sep 2009 10:56:05 -0700 Subject: Added Protocol versions back, this time in a range model. --- OpenSim/Server/Handlers/Grid/GridServerPostHandler.cs | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) (limited to 'OpenSim/Server/Handlers/Grid') diff --git a/OpenSim/Server/Handlers/Grid/GridServerPostHandler.cs b/OpenSim/Server/Handlers/Grid/GridServerPostHandler.cs index 711639f..3d72fec 100644 --- a/OpenSim/Server/Handlers/Grid/GridServerPostHandler.cs +++ b/OpenSim/Server/Handlers/Grid/GridServerPostHandler.cs @@ -118,6 +118,24 @@ namespace OpenSim.Server.Handlers.Grid else m_log.WarnFormat("[GRID HANDLER]: no scopeID in request to register region"); + int versionNumberMin = 0, versionNumberMax = 0; + if (request.ContainsKey("VERSIONMIN")) + Int32.TryParse(request["VERSIONMIN"], out versionNumberMin); + else + m_log.WarnFormat("[GRID HANDLER]: no minimum protocol version in request to register region"); + + if (request.ContainsKey("VERSIONMAX")) + Int32.TryParse(request["VERSIONMAX"], out versionNumberMax); + else + m_log.WarnFormat("[GRID HANDLER]: no maximum protocol version in request to register region"); + + // Check the protocol version + if ((versionNumberMin > ProtocolVersions.ServerProtocolVersionMax && versionNumberMax < ProtocolVersions.ServerProtocolVersionMax)) + { + // Can't do, there is no overlap in the acceptable ranges + FailureResult(); + } + Dictionary rinfoData = new Dictionary(); foreach (KeyValuePair kvp in request) rinfoData[kvp.Key] = kvp.Value; -- cgit v1.1 From 276b0a0cbe2cec5ff0e937a2d2eda6b48b5691b2 Mon Sep 17 00:00:00 2001 From: Diva Canto Date: Mon, 28 Sep 2009 11:17:34 -0700 Subject: Forgot a return statement. --- OpenSim/Server/Handlers/Grid/GridServerPostHandler.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'OpenSim/Server/Handlers/Grid') diff --git a/OpenSim/Server/Handlers/Grid/GridServerPostHandler.cs b/OpenSim/Server/Handlers/Grid/GridServerPostHandler.cs index 3d72fec..e751365 100644 --- a/OpenSim/Server/Handlers/Grid/GridServerPostHandler.cs +++ b/OpenSim/Server/Handlers/Grid/GridServerPostHandler.cs @@ -133,7 +133,7 @@ namespace OpenSim.Server.Handlers.Grid if ((versionNumberMin > ProtocolVersions.ServerProtocolVersionMax && versionNumberMax < ProtocolVersions.ServerProtocolVersionMax)) { // Can't do, there is no overlap in the acceptable ranges - FailureResult(); + return FailureResult(); } Dictionary rinfoData = new Dictionary(); -- cgit v1.1 From 1096103d66d7391943efa85553f46a633cf0d3ee Mon Sep 17 00:00:00 2001 From: Melanie Date: Tue, 29 Sep 2009 09:44:12 +0100 Subject: Fix loading modules with alternate configurations and ports into ROBUST. Make all current modules support the configuration name option --- OpenSim/Server/Handlers/Grid/GridServerConnector.cs | 11 ++++++----- OpenSim/Server/Handlers/Grid/HypergridServerConnector.cs | 2 +- 2 files changed, 7 insertions(+), 6 deletions(-) (limited to 'OpenSim/Server/Handlers/Grid') diff --git a/OpenSim/Server/Handlers/Grid/GridServerConnector.cs b/OpenSim/Server/Handlers/Grid/GridServerConnector.cs index ebdf489..14daf12 100644 --- a/OpenSim/Server/Handlers/Grid/GridServerConnector.cs +++ b/OpenSim/Server/Handlers/Grid/GridServerConnector.cs @@ -37,19 +37,20 @@ namespace OpenSim.Server.Handlers.Grid public class GridServiceConnector : ServiceConnector { private IGridService m_GridService; + private string m_ConfigName = "GridService"; - public GridServiceConnector(IConfigSource config, IHttpServer server) : - base(config, server) + public GridServiceConnector(IConfigSource config, IHttpServer server, string configName) : + base(config, server, configName) { - IConfig serverConfig = config.Configs["GridService"]; + IConfig serverConfig = config.Configs[m_ConfigName]; if (serverConfig == null) - throw new Exception("No section 'Server' in config file"); + throw new Exception(String.Format("No section {0} in config file", m_ConfigName)); string gridService = serverConfig.GetString("LocalServiceModule", String.Empty); if (gridService == String.Empty) - throw new Exception("No GridService in config file"); + throw new Exception("No LocalServiceModule in config file"); Object[] args = new Object[] { config }; m_GridService = ServerUtils.LoadPlugin(gridService, args); diff --git a/OpenSim/Server/Handlers/Grid/HypergridServerConnector.cs b/OpenSim/Server/Handlers/Grid/HypergridServerConnector.cs index c47f652..115ac29 100644 --- a/OpenSim/Server/Handlers/Grid/HypergridServerConnector.cs +++ b/OpenSim/Server/Handlers/Grid/HypergridServerConnector.cs @@ -54,7 +54,7 @@ namespace OpenSim.Server.Handlers.Grid private IHyperlinkService m_HyperlinkService; public HypergridServiceInConnector(IConfigSource config, IHttpServer server, IHyperlinkService hyperService) : - base(config, server) + base(config, server, String.Empty) { m_HyperlinkService = hyperService; server.AddXmlRPCHandler("link_region", LinkRegionRequest, false); -- cgit v1.1