Made the HG asset and inventory brokers use the Helo service in order to instantiate the right network connectors. Tested on Robust only.

viewer-2-initial-appearance
Diva Canto 2010-09-08 14:13:01 -07:00
parent d301f3fd6a
commit ae6682036d
2 changed files with 24 additions and 14 deletions

View File

@ -37,6 +37,7 @@ using OpenSim.Region.Framework.Interfaces;
using OpenSim.Region.Framework.Scenes; using OpenSim.Region.Framework.Scenes;
using OpenSim.Services.Interfaces; using OpenSim.Services.Interfaces;
using OpenSim.Services.Connectors; using OpenSim.Services.Connectors;
using OpenSim.Services.Connectors.SimianGrid;
using OpenMetaverse; using OpenMetaverse;
namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Inventory namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Inventory
@ -538,11 +539,13 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Inventory
} }
else else
{ {
// We're instantiating this class explicitly, but this won't // Still not as flexible as I would like this to be,
// work in general, because the remote grid may be running // but good enough for now
// an inventory server that has a different protocol. string connectorType = new HeloServicesConnector(url).Helo();
// Eventually we will want a piece of protocol asking m_log.DebugFormat("[HG INVENTORY SERVICE]: HELO returned {0}", connectorType);
// the remote server about its kind. Definitely cool thing to do! if (connectorType == "opensim-simian")
connector = new SimianInventoryServiceConnector(url);
else
connector = new RemoteXInventoryServicesConnector(url); connector = new RemoteXInventoryServicesConnector(url);
m_connectors.Add(url, connector); m_connectors.Add(url, connector);
} }

View File

@ -32,6 +32,8 @@ using System.Collections.Generic;
using System.Reflection; using System.Reflection;
using OpenSim.Framework; using OpenSim.Framework;
using OpenSim.Services.Interfaces; using OpenSim.Services.Interfaces;
using OpenSim.Services.Connectors.Hypergrid;
using OpenSim.Services.Connectors.SimianGrid;
namespace OpenSim.Services.Connectors namespace OpenSim.Services.Connectors
{ {
@ -41,7 +43,7 @@ namespace OpenSim.Services.Connectors
LogManager.GetLogger( LogManager.GetLogger(
MethodBase.GetCurrentMethod().DeclaringType); MethodBase.GetCurrentMethod().DeclaringType);
private Dictionary<string, AssetServicesConnector> m_connectors = new Dictionary<string, AssetServicesConnector>(); private Dictionary<string, IAssetService> m_connectors = new Dictionary<string, IAssetService>();
public HGAssetServiceConnector(IConfigSource source) public HGAssetServiceConnector(IConfigSource source)
{ {
@ -81,7 +83,7 @@ namespace OpenSim.Services.Connectors
private IAssetService GetConnector(string url) private IAssetService GetConnector(string url)
{ {
AssetServicesConnector connector = null; IAssetService connector = null;
lock (m_connectors) lock (m_connectors)
{ {
if (m_connectors.ContainsKey(url)) if (m_connectors.ContainsKey(url))
@ -90,12 +92,17 @@ namespace OpenSim.Services.Connectors
} }
else else
{ {
// We're instantiating this class explicitly, but this won't // Still not as flexible as I would like this to be,
// work in general, because the remote grid may be running // but good enough for now
// an asset server that has a different protocol. string connectorType = new HeloServicesConnector(url).Helo();
// Eventually we will want a piece of protocol asking m_log.DebugFormat("[HG ASSET SERVICE]: HELO returned {0}", connectorType);
// the remote server about its kind. Definitely cool thing to do! if (connectorType == "opensim-simian")
{
connector = new SimianAssetServiceConnector(url);
}
else
connector = new AssetServicesConnector(url); connector = new AssetServicesConnector(url);
m_connectors.Add(url, connector); m_connectors.Add(url, connector);
} }
} }