diff --git a/OpenSim/Region/CoreModules/ServiceConnectorsIn/Hypergrid/HypergridServiceInConnectorModule.cs b/OpenSim/Region/CoreModules/ServiceConnectorsIn/Hypergrid/HypergridServiceInConnectorModule.cs index 235914a0b0..2f96bcb1ab 100644 --- a/OpenSim/Region/CoreModules/ServiceConnectorsIn/Hypergrid/HypergridServiceInConnectorModule.cs +++ b/OpenSim/Region/CoreModules/ServiceConnectorsIn/Hypergrid/HypergridServiceInConnectorModule.cs @@ -115,6 +115,7 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsIn.Hypergrid m_HypergridHandler = new GatekeeperServiceInConnector(m_Config, MainServer.Instance, simService); new UserAgentServerConnector(m_Config, MainServer.Instance); + new HeloServiceInConnector(m_Config, MainServer.Instance, "HeloService"); } scene.RegisterModuleInterface(m_HypergridHandler.GateKeeper); } diff --git a/OpenSim/Region/CoreModules/ServiceConnectorsOut/Inventory/HGInventoryBroker.cs b/OpenSim/Region/CoreModules/ServiceConnectorsOut/Inventory/HGInventoryBroker.cs index 5b4fecb802..39410b561b 100644 --- a/OpenSim/Region/CoreModules/ServiceConnectorsOut/Inventory/HGInventoryBroker.cs +++ b/OpenSim/Region/CoreModules/ServiceConnectorsOut/Inventory/HGInventoryBroker.cs @@ -37,6 +37,7 @@ using OpenSim.Region.Framework.Interfaces; using OpenSim.Region.Framework.Scenes; using OpenSim.Services.Interfaces; using OpenSim.Services.Connectors; +using OpenSim.Services.Connectors.SimianGrid; using OpenMetaverse; namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Inventory @@ -538,12 +539,14 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Inventory } else { - // We're instantiating this class explicitly, but this won't - // work in general, because the remote grid may be running - // an inventory server that has a different protocol. - // Eventually we will want a piece of protocol asking - // the remote server about its kind. Definitely cool thing to do! - connector = new RemoteXInventoryServicesConnector(url); + // Still not as flexible as I would like this to be, + // but good enough for now + string connectorType = new HeloServicesConnector(url).Helo(); + m_log.DebugFormat("[HG INVENTORY SERVICE]: HELO returned {0}", connectorType); + if (connectorType == "opensim-simian") + connector = new SimianInventoryServiceConnector(url); + else + connector = new RemoteXInventoryServicesConnector(url); m_connectors.Add(url, connector); } } diff --git a/OpenSim/Server/Handlers/Hypergrid/HeloServerConnector.cs b/OpenSim/Server/Handlers/Hypergrid/HeloServerConnector.cs index 6c83affce2..39baa324cb 100644 --- a/OpenSim/Server/Handlers/Hypergrid/HeloServerConnector.cs +++ b/OpenSim/Server/Handlers/Hypergrid/HeloServerConnector.cs @@ -39,9 +39,9 @@ using OpenSim.Server.Handlers.Base; namespace OpenSim.Server.Handlers.Hypergrid { - public class HeloServiceConnector : ServiceConnector + public class HeloServiceInConnector : ServiceConnector { - public HeloServiceConnector(IConfigSource config, IHttpServer server, string configName) : + public HeloServiceInConnector(IConfigSource config, IHttpServer server, string configName) : base(config, server, configName) { server.AddStreamHandler(new HeloServerGetHandler("opensim-robust")); @@ -68,6 +68,7 @@ namespace OpenSim.Server.Handlers.Hypergrid private byte[] OKResponse(OSHttpResponse httpResponse) { + m_log.Debug("[HELO]: hi, I was called"); httpResponse.AddHeader("X-Handlers-Provided", m_HandlersType); httpResponse.StatusCode = (int)HttpStatusCode.OK; httpResponse.StatusDescription = "OK"; diff --git a/OpenSim/Services/Connectors/Asset/HGAssetServiceConnector.cs b/OpenSim/Services/Connectors/Asset/HGAssetServiceConnector.cs index 34df54a90b..5c31639ac2 100644 --- a/OpenSim/Services/Connectors/Asset/HGAssetServiceConnector.cs +++ b/OpenSim/Services/Connectors/Asset/HGAssetServiceConnector.cs @@ -32,6 +32,8 @@ using System.Collections.Generic; using System.Reflection; using OpenSim.Framework; using OpenSim.Services.Interfaces; +using OpenSim.Services.Connectors.Hypergrid; +using OpenSim.Services.Connectors.SimianGrid; namespace OpenSim.Services.Connectors { @@ -41,7 +43,7 @@ namespace OpenSim.Services.Connectors LogManager.GetLogger( MethodBase.GetCurrentMethod().DeclaringType); - private Dictionary m_connectors = new Dictionary(); + private Dictionary m_connectors = new Dictionary(); public HGAssetServiceConnector(IConfigSource source) { @@ -81,7 +83,7 @@ namespace OpenSim.Services.Connectors private IAssetService GetConnector(string url) { - AssetServicesConnector connector = null; + IAssetService connector = null; lock (m_connectors) { if (m_connectors.ContainsKey(url)) @@ -90,12 +92,17 @@ namespace OpenSim.Services.Connectors } else { - // We're instantiating this class explicitly, but this won't - // work in general, because the remote grid may be running - // an asset server that has a different protocol. - // Eventually we will want a piece of protocol asking - // the remote server about its kind. Definitely cool thing to do! - connector = new AssetServicesConnector(url); + // Still not as flexible as I would like this to be, + // but good enough for now + string connectorType = new HeloServicesConnector(url).Helo(); + m_log.DebugFormat("[HG ASSET SERVICE]: HELO returned {0}", connectorType); + if (connectorType == "opensim-simian") + { + connector = new SimianAssetServiceConnector(url); + } + else + connector = new AssetServicesConnector(url); + m_connectors.Add(url, connector); } } diff --git a/OpenSim/Services/Connectors/SimianGrid/SimianAssetServiceConnector.cs b/OpenSim/Services/Connectors/SimianGrid/SimianAssetServiceConnector.cs index 8f601e8c48..30d3147aa4 100644 --- a/OpenSim/Services/Connectors/SimianGrid/SimianAssetServiceConnector.cs +++ b/OpenSim/Services/Connectors/SimianGrid/SimianAssetServiceConnector.cs @@ -84,6 +84,11 @@ namespace OpenSim.Services.Connectors.SimianGrid CommonInit(source); } + public SimianAssetServiceConnector(string url) + { + m_serverUrl = url; + } + public void Initialise(IConfigSource source) { IConfig moduleConfig = source.Configs["Modules"]; diff --git a/OpenSim/Services/Connectors/SimianGrid/SimianInventoryServiceConnector.cs b/OpenSim/Services/Connectors/SimianGrid/SimianInventoryServiceConnector.cs index 470eccd716..3953369e5f 100644 --- a/OpenSim/Services/Connectors/SimianGrid/SimianInventoryServiceConnector.cs +++ b/OpenSim/Services/Connectors/SimianGrid/SimianInventoryServiceConnector.cs @@ -91,6 +91,11 @@ namespace OpenSim.Services.Connectors.SimianGrid CommonInit(source); } + public SimianInventoryServiceConnector(string url) + { + m_serverUrl = url; + } + public void Initialise(IConfigSource source) { IConfig moduleConfig = source.Configs["Modules"]; diff --git a/bin/Robust.HG.ini.example b/bin/Robust.HG.ini.example index dae7a19e21..deceb86cdd 100644 --- a/bin/Robust.HG.ini.example +++ b/bin/Robust.HG.ini.example @@ -21,7 +21,7 @@ ; * [[@]/][:] ; * [Startup] -ServiceConnectors = "8003/OpenSim.Server.Handlers.dll:AssetServiceConnector,8003/OpenSim.Server.Handlers.dll:XInventoryInConnector,8002/OpenSim.Server.Handlers.dll:FreeswitchServerConnector,8003/OpenSim.Server.Handlers.dll:GridServiceConnector,8002/OpenSim.Server.Handlers.dll:GridInfoServerInConnector,8003/OpenSim.Server.Handlers.dll:AuthenticationServiceConnector,8002/OpenSim.Server.Handlers.dll:OpenIdServerConnector,8003/OpenSim.Server.Handlers.dll:AvatarServiceConnector,8002/OpenSim.Server.Handlers.dll:LLLoginServiceInConnector,8003/OpenSim.Server.Handlers.dll:PresenceServiceConnector,8003/OpenSim.Server.Handlers.dll:UserAccountServiceConnector,8003/OpenSim.Server.Handlers.dll:GridUserServiceConnector,8003/OpenSim.Server.Handlers.dll:FriendsServiceConnector,8002/OpenSim.Server.Handlers.dll:GatekeeperServiceInConnector,8002/OpenSim.Server.Handlers.dll:UserAgentServerConnector,HGInventoryService@8002/OpenSim.Server.Handlers.dll:XInventoryInConnector,8002/OpenSim.Server.Handlers.dll:AssetServiceConnector" +ServiceConnectors = "8003/OpenSim.Server.Handlers.dll:AssetServiceConnector,8003/OpenSim.Server.Handlers.dll:XInventoryInConnector,8002/OpenSim.Server.Handlers.dll:FreeswitchServerConnector,8003/OpenSim.Server.Handlers.dll:GridServiceConnector,8002/OpenSim.Server.Handlers.dll:GridInfoServerInConnector,8003/OpenSim.Server.Handlers.dll:AuthenticationServiceConnector,8002/OpenSim.Server.Handlers.dll:OpenIdServerConnector,8003/OpenSim.Server.Handlers.dll:AvatarServiceConnector,8002/OpenSim.Server.Handlers.dll:LLLoginServiceInConnector,8003/OpenSim.Server.Handlers.dll:PresenceServiceConnector,8003/OpenSim.Server.Handlers.dll:UserAccountServiceConnector,8003/OpenSim.Server.Handlers.dll:GridUserServiceConnector,8003/OpenSim.Server.Handlers.dll:FriendsServiceConnector,8002/OpenSim.Server.Handlers.dll:GatekeeperServiceInConnector,8002/OpenSim.Server.Handlers.dll:UserAgentServerConnector,HGInventoryService@8002/OpenSim.Server.Handlers.dll:XInventoryInConnector,8002/OpenSim.Server.Handlers.dll:AssetServiceConnector,8002/OpenSim.Server.Handlers.dll:HeloServiceInConnector" ; * This is common for all services, it's the network setup for the entire ; * server instance, if none if specified above