示例#1
0
        private IInventoryService GetConnector(string url)
        {
            IInventoryService connector = null;

            lock (m_connectors)
            {
                if (m_connectors.ContainsKey(url))
                {
                    connector = m_connectors[url];
                }
                else
                {
                    // 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
                    {
                        RemoteXInventoryServicesConnector rxisc = new RemoteXInventoryServicesConnector(url);
                        rxisc.Scene = m_Scenes[0];
                        connector   = rxisc;
                    }

                    m_connectors.Add(url, connector);
                }
            }

            return(connector);
        }
 private IInventoryService GetConnector(string url)
 {
     return(m_connectors.GetOrAddIfNotExists(url, delegate()
     {
         // 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")
         {
             return new SimianInventoryServiceConnector(url);
         }
         else
         {
             RemoteXInventoryServicesConnector rxisc = new RemoteXInventoryServicesConnector(url);
             rxisc.Scene = m_Scenes[0];
             return rxisc;
         }
     }));
 }
        private IAssetService GetConnector(string url)
        {
            IAssetService connector = null;
            lock (m_connectors)
            {
                if (m_connectors.ContainsKey (url))
                {
                    connector = m_connectors[url];
                }
                else
                {
                    // 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 OpenSim.Services.Connectors.SimianGrid.SimianAssetServiceConnector (url);
                    else
                        connector = new OpenSim.Services.Connectors.AssetServicesConnector (url);

                    m_connectors.Add (url, connector);
                }
            }
            return connector;
        }